Skip to content

add patch to allow SymEngine v0.7 to compile with glibc >= 2.34#23817

Merged
Crivella merged 2 commits intoeasybuilders:developfrom
Flamefire:20250908122650_new_pr_SymEngine070
Sep 9, 2025
Merged

add patch to allow SymEngine v0.7 to compile with glibc >= 2.34#23817
Crivella merged 2 commits intoeasybuilders:developfrom
Flamefire:20250908122650_new_pr_SymEngine070

Conversation

@Flamefire
Copy link
Copy Markdown
Contributor

(created using eb --new-pr)

@github-actions github-actions Bot added the change label Sep 8, 2025
@Flamefire
Copy link
Copy Markdown
Contributor Author

Test report by @Flamefire
SUCCESS
Build succeeded for 4 out of 4 (1 easyconfigs in total)
n1607 - Linux RHEL 8.9 (Ootpa), x86_64, Intel(R) Xeon(R) Platinum 8470 (sapphirerapids), Python 3.9.18
See https://gist.github.com/Flamefire/c3b19d5a6b2d464b0cf3fc2674f79033 for a full test report.

@Crivella
Copy link
Copy Markdown
Contributor

Crivella commented Sep 9, 2025

Another possible solution to this might be to add a

#define SIGSTKSZ sysconf (_SC_SIGSTKSZ)

PS: Trying to see if I can get this to work otherwise I think also defining the fallback value would be fine

@Crivella
Copy link
Copy Markdown
Contributor

Crivella commented Sep 9, 2025

NVM using sysconf would only evaluate at runtime. Also do not think we could used _SC_SIGSTKSZ directly as it seems to evaluate differently than sysconf(_SC_SIGSTKSZ)

#include <stdio.h>
#include <unistd.h>

#define SIGSTKSZ sysconf (_SC_SIGSTKSZ)

int main() {
  printf("    SIGSTKSZ: %ld\n", SIGSTKSZ);
  printf("_SC_SIGSTKSZ: %d\n", _SC_SIGSTKSZ);
}

//     SIGSTKSZ: 14528
// _SC_SIGSTKSZ: 250

@Crivella Crivella added bug fix and removed change labels Sep 9, 2025
@Crivella
Copy link
Copy Markdown
Contributor

Crivella commented Sep 9, 2025

Test report by @Crivella
SUCCESS
Build succeeded for 1 out of 1 (1 easyconfigs in total)
crivella-desktop - Linux Ubuntu 22.04.5 LTS (Jammy Jellyfish), x86_64, 13th Gen Intel(R) Core(TM) i9-13900K (skylake), Python 3.11.13
See https://gist.github.com/Crivella/88d8d12c98efdb1e99fcc2a68f0107dc for a full test report.

Copy link
Copy Markdown
Contributor

@Crivella Crivella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding comments for the patch

@github-actions github-actions Bot added the change label Sep 9, 2025
@Crivella
Copy link
Copy Markdown
Contributor

Crivella commented Sep 9, 2025

@boegelbot please test @ jsc-zen3
EB_ARGS="--installpath /tmp/$USER/pr-23817"

@boegelbot
Copy link
Copy Markdown
Collaborator

@Crivella: Request for testing this PR well received on jsczen3l1.int.jsc-zen3.fz-juelich.de

PR test command 'if [[ develop != 'develop' ]]; then EB_BRANCH=develop ./easybuild_develop.sh 2> /dev/null 1>&2; EB_PREFIX=/home/boegelbot/easybuild/develop source init_env_easybuild_develop.sh; fi; EB_PR=23817 EB_ARGS="--installpath /tmp/$USER/pr-23817" EB_CONTAINER= EB_REPO=easybuild-easyconfigs EB_BRANCH=develop /opt/software/slurm/bin/sbatch --job-name test_PR_23817 --ntasks=8 ~/boegelbot/eb_from_pr_upload_jsc-zen3.sh' executed!

  • exit code: 0
  • output:
Submitted batch job 7891

Test results coming soon (I hope)...

Details

- notification for comment with ID 3269962741 processed

Message to humans: this is just bookkeeping information for me,
it is of no use to you (unless you think I have a bug, which I don't).

@boegelbot
Copy link
Copy Markdown
Collaborator

Test report by @boegelbot
SUCCESS
Build succeeded for 2 out of 2 (1 easyconfigs in total)
jsczen3c1.int.jsc-zen3.fz-juelich.de - Linux Rocky Linux 9.6, x86_64, AMD EPYC-Milan Processor (zen3), Python 3.9.21
See https://gist.github.com/boegelbot/46876f4ad91c334584787cb4da5e3f25 for a full test report.

@Crivella
Copy link
Copy Markdown
Contributor

Crivella commented Sep 9, 2025

I guess we can live with the ~32kb non deallocated array since i think it will be done only once throughout the code.

On a side note when digging a little from signal.h importing sigstksz.h SIGSTKSZ is actually defined as i had found in the previous comments

#if defined __USE_DYNAMIC_STACK_SIZE && __USE_DYNAMIC_STACK_SIZE
# include <unistd.h>

/* Default stack size for a signal handler: sysconf (SC_SIGSTKSZ).  */
# undef SIGSTKSZ
# define SIGSTKSZ sysconf (_SC_SIGSTKSZ)

/* Minimum stack size for a signal handler: SIGSTKSZ.  */
# undef MINSIGSTKSZ
# define MINSIGSTKSZ SIGSTKSZ
#endif

which is the reason the code is not failing due to the undefined macro, but is failing since you cannot allocate a static array with a non constant integer.

@Crivella Crivella changed the title Fix compile error in SymEngine 0.7 Allow SymEngine 0.7 to compile with glibc >= 2.34 Sep 9, 2025
@Crivella Crivella removed the change label Sep 9, 2025
Copy link
Copy Markdown
Contributor

@Crivella Crivella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

considering this is a fix for 2021a which is now deprecated I do not think we need to overcomplicate the patch to try and free the 32kb array

@Crivella Crivella added this to the next release (5.1.2) milestone Sep 9, 2025
@Crivella
Copy link
Copy Markdown
Contributor

Crivella commented Sep 9, 2025

Going in, thanks @Flamefire!

@Crivella Crivella merged commit 3e62cef into easybuilders:develop Sep 9, 2025
8 checks passed
@Flamefire Flamefire deleted the 20250908122650_new_pr_SymEngine070 branch September 9, 2025 12:51
@Flamefire
Copy link
Copy Markdown
Contributor Author

considering this is a fix for 2021a which is now deprecated I do not think we need to overcomplicate the patch to try and free the 32kb array

It is used in catch so I assume it is only used for the tests where it seems to be ok to leak some memory

@boegel boegel changed the title Allow SymEngine 0.7 to compile with glibc >= 2.34 add patch to allow SymEngine v0.7 to compile with glibc >= 2.34 Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants