TinkerTools / tinker9

Tinker9: Next Generation of Tinker with GPU Support
Other
48 stars 26 forks source link

Issue compiling in debian -- assertion failed at syspredef.cpp #239

Closed blakemertz closed 5 months ago

blakemertz commented 10 months ago

System specs:

My cmake call: cmake -DCMAKE_Fortran_COMPILER=gfortran -DCOMPUTE_CAPABILITY=86 -DCUDA_DIR=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/cuda ..

Following the cmake flags and compile instructions provided at the end of issue #199 I can only get the source code 69% compiled and then get the following error message: (beginning)

make -j4
[  0%] Built target tinker9_f
[  0%] Built target tinkerObjCpp
[  0%] Performing build step for 'BuildCatch2'
[  0%] Building CXX object src/CMakeFiles/tinker9_version.dir/xinfo.cc.o
[  0%] Built target __t9_symlink
[  1%] Building CXX object src/CMakeFiles/tinker9_version.dir/promo.cc.o
[  0%] Building CXX object src/CMakeFiles/Catch2.dir/catch2/benchmark/catch_chronometer.cpp.o
"/usr/include/wchar.h", line 397: error: identifier "_Float32" is undefined
  extern _Float32 wcstof32 (const wchar_t *__restrict __nptr,

(end)

"/usr/include/c++/13/bits/std_abs.h", line 142: error: identifier "_Float128" is undefined
      return __builtin_fabsf128(__x);
             ^

"/usr/include/c++/13/bits/std_abs.h", line 142: error: expected a ")"
      return __builtin_fabsf128(__x);
             ^

"/usr/include/c++/13/bits/std_abs.h", line 142: internal error: assertion failed at: "sys_predef.cpp", line 1787 in builtin_function_type_for_index

      return __builtin_fabsf128(__x);
             ^

27 errors and 1 catastrophic error detected in the compilation of "/media/Data/binaries/github/tinker9/ext/ext/catch2v3/src/catch2/benchmark/detail/catch_run_for_at_least.cpp".
Compilation aborted.
"/usr/include/c++/13/bits/std_abs.h", line 142: error: identifier "_Float128" is undefined
      return __builtin_fabsf128(__x);
             ^

"/usr/include/c++/13/bits/std_abs.h", line 142: error: expected a ")"
      return __builtin_fabsf128(__x);
             ^

"/usr/include/c++/13/bits/std_abs.h", line 142: internal error: assertion failed at: "sys_predef.cpp", line 1787 in builtin_function_type_for_index

      return __builtin_fabsf128(__x);
             ^

27 errors and 1 catastrophic error detected in the compilation of "/media/Data/binaries/github/tinker9/ext/ext/catch2v3/src/catch2/benchmark/detail/catch_benchmark_function.cpp".
Compilation aborted.

Not really sure what next steps would be, as I don't have the ability to start picking through the source code.

zhi-wang commented 10 months ago

This looks like some incompatibility in your compilers/OS combination.

Reference: https://forums.developer.nvidia.com/t/strange-errors-after-system-gcc-upgraded-to-13-1-1/252441/2 https://forums.developer.nvidia.com/t/identifier-float32-is-undefined-etc-cuda-12-2-0-gcc-13-1/258930

blakemertz commented 10 months ago

@zhi-wang thanks for the response and suggestions on the incompatibility issue. Looking at the first link on the nvidia developer forums, it appears that I am using an acceptable version of the gcc compiler (v. 12.3). The only solutions provided by the Nvidia dev are to use either 1) setting “–std=c++14” or using 2) the “–gcc-toolchain” flag and pointing to the install path. Is that a setting I need to implement in my cmake call or in CMakeLists.txt?

zhi-wang commented 9 months ago

I think there is a flag -DSTD=14 for the cmake command to employ the c++ 14 standard. https://github.com/TinkerTools/tinker9/blob/master/doc/manual/m/install/buildwithcmake.rst

But I am still not sure if this would fix this problem.

blakemertz commented 5 months ago

@zhi-wang sorry this took so long to fix the problem -- I had to go back and start with a fresh install of both tinker and tinker9 before I was able to get a working system to compile everything. I didn't get the exact issue addressed, but I think it was something to do with incompatibility of my gcc version, cuda, and tinker. Anyhow, I was able to get tinker9 compiled successfully on two different GPUs both with compute capability = 86, as explained in my successful build entry: #121. Will consider this issue closed.