Skip to content

Build failure in Fedora 42 with gcc 15 #40047

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

Open
2 tasks done
erentar opened this issue May 4, 2025 · 12 comments
Open
2 tasks done

Build failure in Fedora 42 with gcc 15 #40047

erentar opened this issue May 4, 2025 · 12 comments

Comments

@erentar
Copy link

erentar commented May 4, 2025

Environment

I am opening this issue to consolidate the dialog currently ongoing on various pull requests.
Currently, pull requests relating to this problem are

Steps To Reproduce

git checkout develop
git checkout 7888c42db953cc5852fbdf7e21dc524a219ae5d2 #Updated SageMath version to 10.7.beta2
make configure

Config log

singular will fail with

[spkg-install] libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./include -I./include -I. -DFACTORY_BUILDING_DLL -I/home/user/git/sage/local/var/tmp/sage/build/singular-4.4.0/src -I/home/user/git/sage/local/var/tmp/sage/build/singular-4.4.0/src -I/home/user/git/sage/local/include -DSING_NDEBUG -DOM_NDEBUG -g -O2 -pipe -fno-common -g0 -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter -Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default -finline-functions -fno-exceptions -fno-threadsafe-statics -fno-enforce-eh-specs -fconserve-space -funroll-loops -fno-rtti -c threadsupport.cc  -fPIC -DPIC -o .libs/threadsupport.o
[spkg-install] facMul.cc: In function 'void kronSubFp(nmod_poly_struct*, const CanonicalForm&, int)':
[spkg-install] facMul.cc:1258:3: error: 'flint_mpn_zero' was not declared in this scope
[spkg-install]  1258 |   flint_mpn_zero (result->coeffs, d*(degAy+1));
[spkg-install]       |   ^~~~~~~~~~~~~~
[spkg-install] facMul.cc:1267:5: error: 'flint_mpn_copyi' was not declared in this scope
[spkg-install]  1267 |     flint_mpn_copyi (result->coeffs+k, buf->coeffs, nmod_poly_length(buf));
[spkg-install]       |     ^~~~~~~~~~~~~~~
[spkg-install] make[9]: *** [Makefile:1274: facMul.lo] Error 1
[spkg-install] make[9]: *** Waiting for unfinished jobs....
[spkg-install] make[8]: *** [Makefile:1379: all-recursive] Error 1
[spkg-install] make[7]: *** [Makefile:1041: all] Error 2
[spkg-install] make[6]: *** [Makefile:624: all-recursive] Error 1
[spkg-install] make[5]: *** [Makefile:475: all] Error 2
[spkg-install] ********************************************************************************
[spkg-install] Error building singular-4.4.0
[spkg-install] ********************************************************************************
************************************************************************
Error installing package singular-4.4.0
************************************************************************
Please email sage-devel (http://groups.google.com/group/sage-devel)
explaining the problem and including the log files
  /home/user/git/sage/logs/pkgs/singular-4.4.0.log
and
  /home/user/git/sage/config.log
Describe your computer, operating system, etc.
If you want to try to fix the problem yourself, *don't* just cd to
/home/user/git/sage/local/var/tmp/sage/build/singular-4.4.0 and type 'make' or whatever is appropriate.
Instead, the following commands setup all environment variables
correctly and load a subshell for you to debug the error:
  (cd '/home/user/git/sage/local/var/tmp/sage/build/singular-4.4.0' && '/home/user/git/sage/sage' --buildsh)
When you are done debugging, you can type "exit" to leave the subshell.
************************************************************************
real 2m29.211s user 3m58.318s sys 1m25.191s

Package logs

No response

Additional Information

No response

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide
@erentar
Copy link
Author

erentar commented May 4, 2025

At this point, i pulled the following

git pull --rebase https://github.com/dimpase/sage.git test442332
git pull --rebase https://github.com/dimpase/sage.git develop

which solved the issue with singular by allowing the use of a system package.
at this point build progresses until maxima and planarity fails.

maxima will fail because of

;;; Internal error:
;;;   ** Error code 1 when executing
;;; (EXT:RUN-PROGRAM "gcc" ("-I." "-I/usr/include/" "-D_GNU_SOURCE" "-D_FILE_OFFSET_BITS=64" "-O2" "-flto=auto" "-ffat-lto-objects" "-fexceptions" "-g" "-grecord-gcc-switches" "-pipe" "-Wall" "-Werror=format-security" "-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3" "-Wp,-D_GLIBCXX_ASSERTIONS" "-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1" "-fstack-protector-strong" "-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1" "-m64" "-mtune=generic" "-fasynchronous-unwind-tables" "-fstack-clash-protection" "-fcf-protection" "-fno-omit-frame-pointer" "-mno-omit-leaf-frame-pointer" "-Wno-unused" "-Wno-return-type" "-Wno-unknown-pragmas" "-fPIC" "-D_THREAD_SAFE" "-Dlinux" "-O2" "-c" "binary-ecl/maxima-package.c" "-o" "binary-ecl/maxima-package.o")):
;;; In file included from /usr/include/ecl/ecl.h:86,
;;;                  from /usr/include/ecl/ecl-cmp.h:36,
;;;                  from binary-ecl/maxima-package.c:5:
;;; /usr/include/ecl/object.h:32:13: error: ‘bool’ cannot be defined via ‘typedef’
;;;    32 | typedef int bool;
;;;       |             ^~~~
;;; /usr/include/ecl/object.h:32:13: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
;      - Binary file binary-ecl/maxima-package.fas is old or does not exist. 

Interestingly, maxima 5.47 itself, from the upstream(https://git.code.sf.net/p/maxima/code), will compile fine

@erentar
Copy link
Author

erentar commented May 4, 2025

Applying the patch

From 77ff9989ef7ccf261ad82c1c843686acd4eaec87 Mon Sep 17 00:00:00 2001
From: erentar
Date: Sun, 4 May 2025 14:43:15 +0200
Subject: [PATCH] planarity update

---
 build/pkgs/planarity/checksums.ini       | 7 ++++---
 build/pkgs/planarity/package-version.txt | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/build/pkgs/planarity/checksums.ini b/build/pkgs/planarity/checksums.ini
index 3caec0cca3f..032b6245f57 100644
--- a/build/pkgs/planarity/checksums.ini
+++ b/build/pkgs/planarity/checksums.ini
@@ -1,4 +1,5 @@
 tarball=planarity-VERSION.tar.gz
-sha1=8407bccf33c07bf0dae22d79b5e6ac7d89c62ea3
-sha256=63e979d37e7160e4e72a286a8dd7ba74e4795f63742f417c8ba1cea2b2a51280
-upstream_url=https://github.com/sagemath/sage-package/releases/download/tars/planarity-VERSION.tar.gz
+sha1=85574b846db77a2258d5ab5279464184990cb21e
+sha256=df3c86c32fd37b801079aea7de67675efdef12ada557cbcaae821e81b8db438d
+; upstream_url=https://github.com/sagemath/sage-package/releases/download/tars/planarity-VERSION.tar.gz
+upstream_url=https://github.com/graph-algorithms/edge-addition-planarity-suite/releases/download/Version_4.0.0.0/planarity-4.0.0.0.tar.gz
\ No newline at end of file
diff --git a/build/pkgs/planarity/package-version.txt b/build/pkgs/planarity/package-version.txt
index 9a2596b9e46..f69d48948a7 100644
--- a/build/pkgs/planarity/package-version.txt
+++ b/build/pkgs/planarity/package-version.txt
@@ -1 +1 @@
-3.0.1.0
+4.0.0.0
\ No newline at end of file
-- 
2.49.0

and configuring with ./configure --with-system-ecl=no allows build to continue past build failures at maxima and planarity, however sagelib fails.

@tobiasdiez
Copy link
Contributor

See also #40038 which contains the changes I had to implement to have it compile on Fedora 42 (using meson, not sage-the-distro).

@enriqueartal
Copy link
Contributor

I am not sure if it is the right way, but I needed to add gnu=17 to gap and sagelib; also to planarity, but it seems changing to the new version avoids this change.

@gmou3
Copy link
Contributor

gmou3 commented May 5, 2025

Build also fails on archlinux when installing singular. Probably due to the gcc upgrade:

> gcc --version
gcc (GCC) 15.1.1 20250425
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@enriqueartal
Copy link
Contributor

If you apply the changes in #40033 it should work.

@gmou3
Copy link
Contributor

gmou3 commented May 6, 2025

Indeed, these changes also resolve the issues for archlinux.
There seem to exist excessively many packages that need to be built now, gcc being a new addition. Also numpy and scipy are two that take up lots of time on my machine, although I have them on my system's python (and which can be installed there very fast).

@erentar
Copy link
Author

erentar commented May 11, 2025

I'm not sure how anyone is able to build successfully given ecl 24.5 (the latest version, also the current version on sage) is incompatible with it.

[sagelib-10.7.beta2] [spkg-install]     /home/user/git/sage-fix/sage/local/include/ecl/object.h:27:13: error: 'bool' cannot be defined via 'typedef'
[sagelib-10.7.beta2] [spkg-install]     error: command '/usr/lib64/ccache/gcc' failed with exit code 1

keywords bool which is used by ecl became reserved words in C23, which came in with gcc15.

According to #39977 (comment) this issue is being worked on, however the fix has not come in yet.

@erentar
Copy link
Author

erentar commented May 11, 2025

Nevermind. I have misread the thread at #39977.
executing CFLAGS="-std=gnu17" make -j $(nproc) build does make sagelib happy. Perhaps this should be integrated in sagelib's spkg-install.in as it is in ecl's .in file.

@erentar
Copy link
Author

erentar commented May 11, 2025

Building from fresh with CFLAGS="-std=gnu17" make -j $(nproc) build causes contourlib python package to fail building.

A jank way around this is to first build with make -j $(nproc) build, let sagelib fail, then rebuild with CFLAGS="-std=gnu17" make -j $(nproc) build.

I will provide a dockerfile soon

The only successful build i have managed was with these commits https://github.com/erentar/sage/commits/fedora42fix1/ and issuing

$ make configure

$ ./configure \
    --with-system-ecl=no \
    --with-system-singular=no \
    --with-system-linbox=no

$ make -j $(nproc) build \
    || CFLAGS="-std=gnu17" make -j $(nproc) build

@enriqueartal
Copy link
Contributor

What worked for me is in #39977 (comment) and modifying spkg-install.in for: gap, planarity, and sagelib.

@dimpase
Copy link
Member

dimpase commented May 23, 2025

planarity should be fixed by #40153 - please check it out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants