Skip to content

Commit

Permalink
Force use of libstdc++
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland committed Dec 20, 2024
1 parent a8a9089 commit 89928f8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ jobs:
-DCUDA_PATH=/usr/local/cuda-12.6 \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CUDA_FLAGS="-std=c++20" \
-DCMAKE_CUDA_FLAGS="-std=c++20 -Xcompiler -stdlib=libstdc++" \
-DCMAKE_CXX_FLAGS="-stdlib=libstdc++" \
.. \
--debug-output
Expand Down
16 changes: 15 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,21 @@ if(HAVE_BOOST_TEST)
enable_language(CUDA)
set(CMAKE_CUDA_EXTENSIONS OFF)

boost_test_jamfile(FILE nvcc_jamfile LINK_LIBRARIES Boost::crypt ${CUDA_LIBRARIES} INCLUDE_DIRECTORIES ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES} COMPILE_OPTIONS --expt-relaxed-constexpr -std=c++20 -Xcompiler -std=c++20 -MMD )
# Add these lines to explicitly use libstdc++
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler -stdlib=libstdc++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++")

boost_test_jamfile(
FILE nvcc_jamfile
LINK_LIBRARIES Boost::crypt ${CUDA_LIBRARIES}
INCLUDE_DIRECTORIES ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
COMPILE_OPTIONS
--expt-relaxed-constexpr
-std=c++20
-Xcompiler -std=c++20
-Xcompiler -stdlib=libstdc++
-MMD
)

elseif (BOOST_CRYPT_ENABLE_NVRTC)

Expand Down

0 comments on commit 89928f8

Please sign in to comment.