hpides/viper

make failed

Closed this issue · 3 comments

Hi,When I run make in the viper directory, I encountered the following error, can you help me?

Consolidate compiler generated dependencies of target playground
[ 50%] Building CXX object CMakeFiles/playground.dir/playground.cpp.o
In file included from /opt/rh/devtoolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/include/immintrin.h:139,
from /root/viper/include/viper/viper.hpp:15,
from /root/viper/playground.cpp:3:
/opt/rh/devtoolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/include/clwbintrin.h: In function ‘void viper::internal::pmem_persist(const void*, size_t)’:
/opt/rh/devtoolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/include/clwbintrin.h:39:1: error: inlining failed in call to always_inline ‘void _mm_clwb(void*)’: target specific option mismatch
39 | _mm_clwb (void *__A)
| ^~~~~~~~
In file included from /root/viper/playground.cpp:3:
/root/viper/include/viper/viper.hpp:105:17: note: called from here
105 | _mm_clwb(addr_ptr);
| ~~~~~~~~^~~~~~~~~~
make[2]: *** [CMakeFiles/playground.dir/playground.cpp.o] Error 1
make[1]: *** [CMakeFiles/playground.dir/all] Error 2
make: *** [all] Error 2

Mhm, it looks like your server either does not support clwb or you are not specifying it when building. Can you try adding -mclwb when building and see if that helps?

In the CMakeLists.txt, I'm specifying that -march=native should be used (which includes clwb on Cascade Lake), but maybe this is not transitive.

Please let me know if the clwb fix above works, then I can add it explicitly.

hi,I tried adding -mlcwb ( target_compile_options(playground PRIVATE -march=native -mclwb -pthread) )and succeeded. Thank you very much.
Your paper is very worth learning, thank you for putting forward such a good idea.

Thanks for testing this. I've update the file to include -mclwb. If you pull the master, it should work.