Skip to content

Commit

Permalink
toolchain/sirius: fix CXX_FLAGS override, import patch to fix build i…
Browse files Browse the repository at this point in the history
…ssues with CUDA with newer NVHPC packages
  • Loading branch information
dev-zero committed Dec 29, 2021
1 parent 885bd66 commit ea7b3f3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/toolchain/scripts/stage8/install_sirius.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ case "$with_sirius" in
[ -d sirius-${sirius_ver} ] && rm -rf sirius-${sirius_ver}
tar -xzf SIRIUS-${sirius_ver}.tar.gz
cd SIRIUS-${sirius_ver}

# fix the CUDA include path
patch -p1 < "${SCRIPT_DIR}/stage8/sirius-7.3.0-cudatoolkit.patch"

rm -Rf build
mkdir build
cd build
Expand Down Expand Up @@ -136,7 +140,7 @@ case "$with_sirius" in
fi

cmake -DCMAKE_INSTALL_PREFIX="${pkg_install_dir}" \
-DCMAKE_CXXFLAGS_RELEASE="${SIRIUS_OPT}" \
-DCMAKE_CXX_FLAGS_RELEASE="${SIRIUS_OPT}" \
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="${SIRIUS_DBG}" \
-DCMAKE_CXX_COMPILER="${MPICXX}" \
-DCMAKE_C_COMPILER="${MPICC}" \
Expand All @@ -161,7 +165,7 @@ case "$with_sirius" in
cd build-cuda
CMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}:${SPFFT_ROOT}/lib/cmake:${SPFFT_ROOT}/lib64/cmake" \
cmake -DCMAKE_INSTALL_PREFIX=${pkg_install_dir} \
-DCMAKE_CXXFLAGS_RELEASE="${SIRIUS_OPT}" \
-DCMAKE_CXX_FLAGS_RELEASE="${SIRIUS_OPT}" \
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="${SIRIUS_DBG}" \
-DCMAKE_CUDA_FLAGS="-std=c++14 -allow-unsupported-compiler" \
-DUSE_CUDA=ON \
Expand Down
13 changes: 13 additions & 0 deletions tools/toolchain/scripts/stage8/sirius-7.3.0-cudatoolkit.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/cmake/cudalibs_target.cmake b/cmake/cudalibs_target.cmake
index 29802dd3..3d4d761b 100644
--- a/cmake/cudalibs_target.cmake
+++ b/cmake/cudalibs_target.cmake
@@ -1,6 +1,5 @@
+find_package(CUDAToolkit REQUIRED)
if (NOT TARGET sirius::cudalibs)
add_library(sirius::cudalibs INTERFACE IMPORTED)
- set_target_properties(sirius::cudalibs PROPERTIES
- INTERFACE_INCLUDE_DIRECTORIES "${CUDA_INCLUDE_DIRS}"
- INTERFACE_LINK_LIBRARIES "${CUDA_LIBRARIES};${CUDA_CUBLAS_LIBRARIES};${CUDA_CUFFT_LIBRARIES};${CUDA_cusolver_LIBRARY}")
+ target_link_libraries(sirius::cudalibs INTERFACE CUDA::cudart CUDA::cublas CUDA::cufft CUDA::cusolver)
endif()

0 comments on commit ea7b3f3

Please sign in to comment.