r00tman/EventHands

problem when compiling c++ code

Opened this issue · 1 comments

Thanks for your excellent work! But I met some problem when compiling the c++ code.

$ cmake .. -DCMAKE_CXX_COMPILER=g++-8 -DCMAKE_C_COMPILER=gcc-8
-- The CXX compiler identification is GNU 8.4.0
-- The CUDA compiler identification is NVIDIA 10.1.105
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++-8 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Found SDL2: /usr/lib/x86_64-linux-gnu/libSDL2.so (found version "2.0.10")
CMake Warning (dev) at /usr/local/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to find_package_handle_standard_args (SDL2main)
does not match the name of the calling package (SDL2). This can lead to
problems in calling code that expects find_package result variables
(e.g., _FOUND) to follow a certain pattern.
Call Stack (most recent call first):
cmake/sdl2/FindSDL2.cmake:318 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:37 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Found SDL2main: /usr/lib/x86_64-linux-gnu/libSDL2main.a (found version "2.0.10")
CMake Warning (dev) at /usr/local/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to find_package_handle_standard_args (SDL2main)
does not match the name of the calling package (SDL2). This can lead to
problems in calling code that expects find_package result variables
(e.g., _FOUND) to follow a certain pattern.
Call Stack (most recent call first):
cmake/sdl2/FindSDL2.cmake:318 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
cmake/sdl2/FindSDL2_image.cmake:114 (find_package)
CMakeLists.txt:42 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Found SDL2_image: /usr/lib/x86_64-linux-gnu/libSDL2_image.so (found version "2.0.5")
-- Found GLEW: /usr/include (found version "2.1.0")
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found GLM: /usr/include
-- Looking for sgemm_
-- Looking for sgemm_ - found
-- Found BLAS: /usr/lib/x86_64-linux-gnu/libopenblas.so
-- Looking for cheev_
-- Looking for cheev_ - found
-- Found LAPACK: /usr/lib/x86_64-linux-gnu/libopenblas.so;/usr/lib/x86_64-linux-gnu/libopenblas.so
-- Found CUDAToolkit: /usr/local/cuda/include (found version "10.1.105")
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cll/disk/EventHands/evsim_joints/build

$ cmake --build .
[ 6%] Building CXX object CMakeFiles/evsim.dir/main.cpp.o
[ 12%] Building CUDA object CMakeFiles/evsim.dir/evc.cu.o
/usr/lib/gcc/x86_64-linux-gnu/7/include/avx512fintrin.h(11265): error: identifier "__builtin_ia32_scalefsd_round" is undefined

/usr/lib/gcc/x86_64-linux-gnu/7/include/avx512fintrin.h(11274): error: identifier "__builtin_ia32_scalefss_round" is undefined

2 errors detected in the compilation of "/tmp/tmpxft_00001d58_00000000-6_evc.cpp1.ii".
make[2]: *** [CMakeFiles/evsim.dir/build.make:90: CMakeFiles/evsim.dir/evc.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/evsim.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Could you please provide any instructions on it? Thank you in advance.

Hi, thank you and sorry for the delayed response!

Something seems wrong with nvcc paths, as /usr/lib/gcc/x86_64-linux-gnu/7/include/avx512fintrin.h is from g++-7 libraries, and you are specifically using g++-8 in the arguments.
It could be that nvcc is using gcc-7 as the backbone, then you can either update it to a newer nvcc or try switching to g++-7 for the rest of the project instead.

If this is still a problem, please write here.