/PNNL/NWGraph/build/_deps/catch2-src/single_include/catch2/catch.hpp:10822:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’
10822 | static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
| ^~~
In file included from /usr/include/c++/11/bits/atomic_wait.h:44,
from /usr/include/c++/11/bits/atomic_base.h:41,
from /usr/include/c++/11/bits/shared_ptr_atomic.h:33,
from /usr/include/c++/11/memory:78,
from //PNNL/NWGraph/build/_deps/catch2-src/single_include/catch2/catch.hpp:2943,
from /PNNL/NWGraph/build/_deps/catch2-src/src/catch_with_main.cpp:2:
/usr/include/unistd.h:640:17: note: ‘long int sysconf(int)’ declared here
640 | extern long int sysconf (int name) THROW;
catch2-src/single_include/catch2/catch.hpp:10881:45: error: size of array ‘altStackMem’ is not an integral constant-expression
10881 | char FatalConditionHandler::altStackMem[sigStackSize] = {};
make[2]: [_deps/catch2-build/CMakeFiles/Catch2WithMain.dir/build.make:76: _deps/catch2-build/CMakeFiles/Catch2WithMain.dir/src/catch_with_main.cpp.o] Error 1
make[1]: [CMakeFiles/Makefile2:1491: _deps/catch2-build/CMakeFiles/Catch2WithMain.dir/all] Error 2
make[1]: Waiting for unfinished jobs....
make[2]: [test/CMakeFiles/catch_main.dir/build.make:76: test/CMakeFiles/catch_main.dir/catch_main.cpp.o] Error 1
make[1]: [CMakeFiles/Makefile2:971: test/CMakeFiles/catch_main.dir/all] Error 2
[ 9%] Linking CXX shared library libdocopt.so
[ 9%] Built target docopt
make: [Makefile:166: all] Error 2
Solved. It seems to be a known bug and you can read about it here. Changing the cmake version to v2.13.5 in Catch2.cmake fixes the problem. Happy to push a hotfix if it helps others.
Ubuntu 22.04.1 g++ (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
/PNNL/NWGraph/build/_deps/catch2-src/single_include/catch2/catch.hpp:10822:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’ 10822 | static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ; | ^
~~In file included from /usr/include/c++/11/bits/atomic_wait.h:44, from /usr/include/c++/11/bits/atomic_base.h:41, from /usr/include/c++/11/bits/shared_ptr_atomic.h:33, from /usr/include/c++/11/memory:78, from //PNNL/NWGraph/build/_deps/catch2-src/single_include/catch2/catch.hpp:2943, from /PNNL/NWGraph/build/_deps/catch2-src/src/catch_with_main.cpp:2: /usr/include/unistd.h:640:17: note: ‘long int sysconf(int)’ declared here 640 | extern long int sysconf (int name) THROW;catch2-src/single_include/catch2/catch.hpp:10881:45: error: size of array ‘altStackMem’ is not an integral constant-expression 10881 | char FatalConditionHandler::altStackMem[sigStackSize] = {}; make[2]: [_deps/catch2-build/CMakeFiles/Catch2WithMain.dir/build.make:76: _deps/catch2-build/CMakeFiles/Catch2WithMain.dir/src/catch_with_main.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:1491: _deps/catch2-build/CMakeFiles/Catch2WithMain.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... make[2]: [test/CMakeFiles/catch_main.dir/build.make:76: test/CMakeFiles/catch_main.dir/catch_main.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:971: test/CMakeFiles/catch_main.dir/all] Error 2 [ 9%] Linking CXX shared library libdocopt.so [ 9%] Built target docopt make: [Makefile:166: all] Error 2