ECP-copa / Cabana

Performance-portable library for particle-based simulations
Other
193 stars 51 forks source link

CMake issue with PGI v20.4 #277

Closed rhager closed 3 years ago

rhager commented 3 years ago

I ran into a problem with Cabana and PGI version 20.4. I use the Cabana tag 0.3.0 with Kokkos branch https://github.com/masterleinad/kokkos/tree/fix_host_compiler_pgi_2 (which resolves the problems I had with the Kokkos tag 3.1.00). This is my configuration in ccmake:

 CMAKE_BUILD_TYPE                 Release 
 CMAKE_INSTALL_PREFIX             /home/rhager/Software/install/cabana/0.3.0-RHEL8/pgi 
 Cabana_BUILD_MARCH                
 Cabana_ENABLE_ARBORX             OFF 
 Cabana_ENABLE_COVERAGE_BUILD     OFF 
 Cabana_ENABLE_EXAMPLES           OFF 
 Cabana_ENABLE_FORTRAN_EXAMPLES   OFF 
 Cabana_ENABLE_MPI                ON 
 Cabana_ENABLE_PERFORMANCE_TEST   OFF 
 Cabana_ENABLE_TESTING            OFF 
 Cabana_REQUIRE_CUDA              ON 
 Cabana_REQUIRE_HIP               OFF 
 Cabana_REQUIRE_OPENMP            ON 
 Cabana_REQUIRE_SERIAL            ON 
 Cabana_REQUIRE_THREADS           OFF 
 Kokkos_DIR                       /home/rhager/Software/install/kokkos/masterleinad-cf3c76c-RHEL8/pgi/lib64/cmake/Kokkos 

The configuration then fails with the following error:

 CMake Error at core/src/CMakeLists.txt:64 (target_compile_features):
   target_compile_features The compiler feature "cxx_attribute_deprecated" is
   not known to CXX compiler

   "PGI"

   version 20.4.0.

Let me know if you need me to post any of the CMake log files.

(Tagging @ascheinb)

dalg24 commented 3 years ago

What CMake version are you using?

rhager commented 3 years ago

v 3.11.4

rhager commented 3 years ago

That was it. I tried v3.18 and it worked.

rhager commented 3 years ago

That was premature. The configure stage worked. Now I get compiler errors:

[rhager@traverse8 cabana_build]$ make
Scanning dependencies of target cabanacore
[ 50%] Building CXX object core/src/CMakeFiles/cabanacore.dir/impl/Cabana_Version.cpp.o
pgc++-Error-Unknown switch: --relocatable-device-code=true
pgc++-Error-Unknown switch: -Wext-lambda-captures-this
pgc++-Error-Unknown switch: -arch=sm_72
make[2]: *** [core/src/CMakeFiles/cabanacore.dir/build.make:82: core/src/CMakeFiles/cabanacore.dir/impl/Cabana_Version.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:243: core/src/CMakeFiles/cabanacore.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
rhager commented 3 years ago

Ok, my mistake again. I forgot to set the compiler to nvcc_wrapper. Everything works now. Thanks!

junghans commented 3 years ago

@sslattery @dalg24 I guess the conclusion from this issue is that we should raise the required CMake version (at least for PGI).

sslattery commented 3 years ago

Agreed - any reason we can't always go higher?

dalg24 commented 3 years ago

I'd say no. This is a slippery slope towards requiring the latest CMake in case someone want to use some new version of a compiler. I think it is the user's responsibility to use a CMake version compatible with his compiler/toolbox.

sslattery commented 3 years ago

I'd say no. This is a slippery slope towards requiring the latest CMake in case someone want to use some new version of a compiler. I think it is the user's responsibility to use a CMake version compatible with his compiler/toolbox.

:+1: