Skip to content

Fix build with NVHPC#1323

Merged
SGSSGene merged 1 commit intojbeder:masterfrom
davschneller:fix-nvhpc-build
Mar 10, 2026
Merged

Fix build with NVHPC#1323
SGSSGene merged 1 commit intojbeder:masterfrom
davschneller:fix-nvhpc-build

Conversation

@davschneller
Copy link
Contributor

@davschneller davschneller commented Oct 11, 2024

Exclude all warning-emitting flags if building as main project with the NVHPC compiler (effectively making it take the same exception as for MSVC there).

Otherwise, the build will fail right now, due to NVHPC not recognizing all the specified compiler options. Cf. the following snippet which runs CMake and attempts to build yaml-cpp 0.8.0:

$ cmake ..
-- The CXX compiler identification is NVHPC 24.7.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /[...]/24.7/compilers/bin/nvc++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.8s)
-- Generating done (1.1s)
-- Build files have been written to: /[...]/yaml-cpp/build
$ make
[  2%] Building CXX object CMakeFiles/yaml-cpp.dir/src/contrib/graphbuilder.cpp.o
nvc++-Error-Unknown switch: -Weffc++
nvc++-Error-Unknown switch: -pedantic-errors
make[2]: *** [CMakeFiles/yaml-cpp.dir/build.make:76: CMakeFiles/yaml-cpp.dir/src/contrib/graphbuilder.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:861: CMakeFiles/yaml-cpp.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

@SGSSGene SGSSGene merged commit 8bcadb1 into jbeder:master Mar 10, 2026
@davschneller davschneller deleted the fix-nvhpc-build branch March 10, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants