Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation Fails due to catch.hpp #7

Open
xsyourpal opened this issue Nov 12, 2022 · 1 comment
Open

Compilation Fails due to catch.hpp #7

xsyourpal opened this issue Nov 12, 2022 · 1 comment

Comments

@xsyourpal
Copy link

xsyourpal commented Nov 12, 2022

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

@pradkrish
Copy link

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.

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

No branches or pull requests

2 participants