mfem: Compiling with cuda-unsupported compiler

Intel 24 is too new. Oh dear.

cmake
    -D CMAKE_INSTALL_PREFIX=/work/00434/eijkhout/mfem/installation-mfem-4.7-milan-intel24-impi21.12
    -D CMAKE_COLOR_DIAGNOSTICS=OFF
    -D CMAKE_VERBOSE_MAKEFILE=ON
    -D BUILD_SHARED_LIBS=ON
    -Wno-dev
    -D CMAKE_BUILD_TYPE=Release
    -D MFEM_USE_MPI=YES
    -D MFEM_USE_CUDA=YES
    -D CMAKE_NVCC_FLAGS=-allow-unsupported-compiler
[...]

but I still get:

  #$ "/scratch/projects/compilers/intel24.1/oneapi/mpi/2021.12/bin"/mpicxx
  -D__CUDA_ARCH__=520 -E -x c++ -DCUDA_DOUBLE_MATH_FUNCTIONS -D__CUDACC__
  -D__NVCC__ "-I/opt/apps/cuda/11.4/bin/../targets/x86_64-linux/include"
  -D__CUDACC_VER_MAJOR__=11 -D__CUDACC_VER_MINOR__=4
  -D__CUDACC_VER_BUILD__=120 -D__CUDA_API_VER_MAJOR__=11
  -D__CUDA_API_VER_MINOR__=4 -include "cuda_runtime.h" -m64
  "CMakeCUDACompilerId.cu" -o "tmp/CMakeCUDACompilerId.cpp1.ii"

  In file included from <built-in>:1:

  In file included from
  /opt/apps/cuda/11.4/bin/../targets/x86_64-linux/include/cuda_runtime.h:83:


  /opt/apps/cuda/11.4/bin/../targets/x86_64-linux/include/crt/host_config.h:147:2:
  error: -- unsupported clang version! clang version must be less than 13 and
  greater than 3.2 .  The nvcc flag '-allow-unsupported-compiler' can be used
  to override this version check; however, using an unsupported host compiler
  may cause compilation failure or incorrect run time execution.  Use at your
  own risk.

    147 | #error -- unsupported clang version! clang version must be less than 13 and greater than 3.2 . The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
        |  ^

  1 error generated.

  # --error 0x1 --





Call Stack (most recent call first):
  /opt/apps/cmake/3.24.2/share/cmake-3.24/Modules/CMakeDetermineCompilerId.cmake:6 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  /opt/apps/cmake/3.24.2/share/cmake-3.24/Modules/CMakeDetermineCompilerId.cmake:48 (__determine_compiler_id_test)
  /opt/apps/cmake/3.24.2/share/cmake-3.24/Modules/CMakeDetermineCUDACompiler.cmake:307 (CMAKE_DETERMINE_COMPILER_ID)
  CMakeLists.txt:120 (enable_language)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (10 by maintainers)

Most upvoted comments

You can use CUDA_FLAGS = -x=cu --expt-extended-lambda -arch=$(CUDA_ARCH) -allow-unsupported-compiler in user.mk if using make. I have not tested CMake.

I would try invoking nvcc by passing the options -Xcompiler -std=gnu++14, which will set the host compiler c++'s dialect version to match nvcc’s toolchain.

Or just set the std to c++17 with cmake.

And that is the winning suggestion. The cmake config when t through and the build is running.