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

Compile failure with glibc >= 2.34 due to SIGSTKSZ in Catch #197

Open
sheepforce opened this issue Apr 8, 2022 · 2 comments
Open

Compile failure with glibc >= 2.34 due to SIGSTKSZ in Catch #197

sheepforce opened this issue Apr 8, 2022 · 2 comments

Comments

@sheepforce
Copy link

PCMsolver cannot build with recent glibc version. The issue seems to be, that in glibc >= 2.34 SIGSTKSZ is not constant anymore. This leads to type errors in the Catch code:

In file included from /build/source/tests/unit_tests.cpp:25:
/build/source/external/Catch/catch.hpp:6470:41: error: array bound is not an integer constant before ']' token
 6470 |         static char altStackMem[SIGSTKSZ];
      |                                         ^
/build/source/external/Catch/catch.hpp: In constructor 'Catch::FatalConditionHandler::FatalConditionHandler()':
/build/source/external/Catch/catch.hpp:6489:30: error: 'altStackMem' was not declared in this scope
 6489 |             sigStack.ss_sp = altStackMem;
      |                              ^~~~~~~~~~~
/build/source/external/Catch/catch.hpp: At global scope:
/build/source/external/Catch/catch.hpp:6521:53: error: array bound is not an integer constant before ']' token
 6521 |     char FatalConditionHandler::altStackMem[SIGSTKSZ] = {};
      |                                                     ^

Expected Behavior

PCMSolver should compile with recent Glibc versions.

Current Behavior

Glibc >= 2.34 breaks PCMSolver

Possible Solution

Update the catch code to be compatible with recent Glibc? (I am no C++ dev myself)

Steps to Reproduce (for bugs)

nix build nixpkgs/f35d4e3c73eaecfa5d1eabdcfd14d8047b440a15#pcmsolver --print-build-logs
or build on probably any other linux with glibc >= 2.34

Context

I am maintaining pcmsolver in NixOS and nixpkgs. The glibc incompatibility of PCMSolver unfortunately also breaks Psi4 and Dalton in Nixpkgs/NixOS.

The glibc change apparently also bit other people, e.g.:

Your Environment

@robertodr
Copy link
Member

Thanks for reporting. This is indeed an annoyance. As you suggest, upgrading the bundled version of Catch would solve the issue. I'll try to patch it up during the week. I'm rewriting this library from scratch, so it's not exactly high priority, but since it broke a lot of packages, it must be fixed.

@sheepforce
Copy link
Author

A quick workaround I've just used to repair the broken nixpkgs branches is to replace SIGSTKSZ by _SC_SIGSTKSZ

markuskowa pushed a commit to NixOS/nixpkgs that referenced this issue Apr 11, 2022
related to PCMSolver/pcmsolver#197. This is a temporary workaround until we have a proper fix from upstream
@foxtran foxtran mentioned this issue Jan 29, 2023
5 tasks
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