Skip to content

Commit

Permalink
Use c++ for vcpkg when CXX is nvc++
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Feb 22, 2023
1 parent ed98454 commit b575c37
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,24 @@ jobs:
fi
echo "nvcc is here: $CUDACXX"
NVHPC_FLAGS=
CMAKE_EXTRA_ARGS=
if [ ${{ matrix.add_nvcpp_repo }} ]; then
# cmake (in some versions) passes some flags that nvc++ does not understand
NVHPC_FLAGS='-noswitcherror'
CMAKE_EXTRA_ARGS='-DCMAKE_CXX_FLAGS=-noswitcherror'
# boost fails to compile with nvc++ during vcpkg install, so retarget to system c++ via triplet/toolchain
echo "
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE $(pwd)/toolchain.cmake)
" >> triplet.cmake
echo 'set(CMAKE_CXX_COMPILER c++ CACHE STRING "")' >> toolchain.cmake
CMAKE_EXTRA_ARGS='-DVCPKG_DEFAULT_TRIPLET=triplet -DVCPKG_OVERLAY_TRIPLETS=$(pwd)' VCPKG_DEFAULT_TRIPLET=triplet
fi
cmake .. -DBUILD_TESTING=ON \
Expand All @@ -271,8 +285,8 @@ jobs:
-Dalpaka_CXX_STANDARD=17 \
-DCMAKE_CUDA_COMPILER=$CUDACXX \
-DCMAKE_CUDA_HOST_COMPILER=$CXX \
-DCMAKE_CXX_FLAGS=$NVHPC_FLAGS \
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake
$CMAKE_EXTRA_ARGS
- name: build tests + examples
run: |
if [ ${{ matrix.install_oneapi }} ]; then source /opt/intel/oneapi/setvars.sh; fi
Expand Down

0 comments on commit b575c37

Please sign in to comment.