|
| 1 | +string(APPEND CONFIG_ARGS " --host=cray") |
| 2 | +set(USE_CUDA "TRUE") |
| 3 | +string(APPEND CPPDEFS " -DGPU") |
| 4 | +if (COMP_NAME STREQUAL gptl) |
| 5 | + string(APPEND CPPDEFS " -DHAVE_NANOTIME -DBIT64 -DHAVE_SLASHPROC -DHAVE_GETTIMEOFDAY") |
| 6 | +endif() |
| 7 | +string(APPEND CPPDEFS " -DTHRUST_IGNORE_CUB_VERSION_CHECK") |
| 8 | +string(APPEND KOKKOS_OPTIONS " -DKokkos_ARCH_AMPERE80=On -DKokkos_ENABLE_CUDA=On -DKokkos_ENABLE_CUDA_LAMBDA=On -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=Off -DKokkos_ENABLE_IMPL_CUDA_MALLOC_ASYNC=OFF") |
| 9 | +# Workaround for Intel oneAPI 2025.3+ (clang/21) + NVCC 12.9 incompatibility: |
| 10 | +# Intel clang/21 headers use builtins (e.g., __builtin_elementwise_popcount) that NVCC's |
| 11 | +# internal Clang (~LLVM 14) does not support. This sets CMAKE_CUDA_HOST_COMPILER=g++ for |
| 12 | +# direct cmake-managed .cu file compilation. |
| 13 | +# |
| 14 | +# NOTE: This does NOT fix the EKAT kokkoscore build failure, which occurs when |
| 15 | +# kokkos_launch_compiler routes C++ files through nvcc_wrapper with icpx as ccbin. |
| 16 | +# That failure is fixed by pre-setting NVCC_WRAPPER_DEFAULT_COMPILER in share/build/buildlib.ekat. |
| 17 | +find_program(GCC_CXX_COMPILER "g++") |
| 18 | +if (GCC_CXX_COMPILER) |
| 19 | + string(APPEND CMAKE_CUDA_FLAGS " -ccbin ${GCC_CXX_COMPILER}") |
| 20 | + string(APPEND KOKKOS_OPTIONS " -DCMAKE_CUDA_HOST_COMPILER=${GCC_CXX_COMPILER}") |
| 21 | +else() |
| 22 | + message(WARNING "g++ not found; Intel oneAPI 2025.3+ CUDA host compiler incompatibility may occur") |
| 23 | +endif() |
| 24 | +string(APPEND CMAKE_CUDA_FLAGS " -O2 -arch sm_80 --use_fast_math --allow-unsupported-compiler") |
| 25 | +set(CMAKE_CUDA_ARCHITECTURES "80") |
| 26 | +set(MPICC "cc") |
| 27 | +set(MPICXX "CC") |
| 28 | +set(MPIFC "ftn") |
| 29 | +set(SCC "icx") |
| 30 | +set(SCXX "icpx") |
| 31 | +set(SFC "ifx") |
| 32 | + |
| 33 | +# The Intel LLVM icpx on this system does not support -fp-model=source (set by intelgpu.cmake). |
| 34 | +# Reset CXX flags and replicate the correct set, same approach as alvarez-cpu_intel.cmake. |
| 35 | +set(CMAKE_CXX_FLAGS " ") |
| 36 | +if (compile_threaded) |
| 37 | + string(APPEND CMAKE_CXX_FLAGS " -qopenmp") |
| 38 | +endif() |
| 39 | +string(APPEND CMAKE_CXX_FLAGS_DEBUG " -O0 -g") |
| 40 | +string(APPEND CMAKE_CXX_FLAGS_RELEASE " -O2") |
| 41 | +string(APPEND CMAKE_CXX_FLAGS " -fp-model=precise") |
| 42 | +string(APPEND CMAKE_CXX_FLAGS " -fp-model=consistent") |
| 43 | + |
| 44 | +# Check for Intel LLVM (ifx) version 2025 or newer |
| 45 | +if (CMAKE_Fortran_COMPILER_ID STREQUAL "IntelLLVM") |
| 46 | + if (CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL "2025.0") |
| 47 | + string(APPEND CMAKE_Fortran_FLAGS_DEBUG " -check nouninit") # Applying Intel 2025.3 sanitization workaround |
| 48 | + endif() |
| 49 | +endif() |
| 50 | + |
| 51 | +string(APPEND CMAKE_Fortran_FLAGS " -fp-model=consistent -fimf-use-svml") |
| 52 | +string(APPEND CMAKE_Fortran_FLAGS " -DHAVE_ERF_INTRINSICS") |
| 53 | +string(APPEND CMAKE_Fortran_FLAGS_RELEASE " -g -traceback") |
0 commit comments