Skip to content

Conversation

vbraun
Copy link
Member

@vbraun vbraun commented May 25, 2024

The GMP configure test should link against our own libstdc++ instead of the (too old) system libstdc++

Fixes #38085

Copy link

github-actions bot commented May 26, 2024

Documentation preview for this PR (built with commit 2ba6a8d; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

vbraun pushed a commit to vbraun/sage that referenced this pull request May 26, 2024
…ilt our own toolchain

The GMP configure test should link against our own libstdc++ instead of
the (too old) system libstdc++

Fixes sagemath#38085

URL: sagemath#38087
Reported by: Volker Braun
Reviewer(s):
@mkoeppe
Copy link
Contributor

mkoeppe commented May 26, 2024

This does not fix the failure for me.
Tested with tox -e docker-debian-bullseye-gcc_spkg-minimal; the 2nd build of GMP fails:

#24 64.01   [gmp-6.3.0]   Host system: Linux buildkitsandbox 6.6.26-linuxkit #1 SMP PREEMPT_DYNAMIC Sat Apr 27 04:15:35 UTC 2024 x86_64 GNU/Linux
#24 64.01   [gmp-6.3.0]   C compiler: gcc, Using built-in specs., COLLECT_GCC=gcc, COLLECT_LTO_WRAPPER=/sage/local/libexec/gcc/x86_64-pc-linux-gnu/13.2.0/lto-wrapper, Target: x86_64-pc-linux-gnu, Configured with: ../src/configure --prefix=/sage/local --with-local-prefix=/sage/local --with-gmp=/sage/local --with-mpfr=/sage/local --with-mpc=/sage/local --with-system-zlib --without-isl --disable-multilib --disable-nls --disable-libitm --enable-languages=c,c++,fortran   CXX=, Thread model: posix, Supported LTO compression algorithms: zlib, gcc version 13.2.0 (GCC)
#24 64.01   [gmp-6.3.0]   [spkg-install] Building a 64-bit version of GMP.
#24 64.01   [gmp-6.3.0]   [spkg-install] Building GMP with the C++ interface and (also) static libraries.
#24 64.01   [gmp-6.3.0]   [spkg-install] Checking what CFLAGS GMP would use if they were empty...
#24 64.01   [gmp-6.3.0]   [spkg-install] Settings chosen by GMP when configuring with CFLAGS unset:
#24 64.01   [gmp-6.3.0]   [spkg-install]   CC:      gcc
#24 64.01   [gmp-6.3.0]   [spkg-install]   CFLAGS:  -O2 -pedantic -fomit-frame-pointer -m64 -mtune=skylake -march=broadwell
#24 64.01   [gmp-6.3.0]   [spkg-install] Settings added by Sage to build GMP, taking into account SAGE_DEBUG etc.:
#24 64.01   [gmp-6.3.0]   [spkg-install]   CFLAGS:  
#24 64.01   [gmp-6.3.0]   [spkg-install]   LDFLAGS: 
#24 64.01   [gmp-6.3.0]   [spkg-install]   ABI:     64
#24 64.01   [gmp-6.3.0]   [spkg-install] Settings from the "global" environment:
#24 64.01   [gmp-6.3.0]   [spkg-install]   CC:      gcc
#24 64.01   [gmp-6.3.0]   [spkg-install]   CFLAGS:  -g -O2
#24 64.01   [gmp-6.3.0]   [spkg-install]   LDFLAGS: -Wl,-rpath-link,/sage/local/lib -L/sage/local/lib -Wl,-rpath,/sage/local/lib -Wl,-rpath-link,/sage/local/lib -L/sage/local/lib -Wl,-rpath,/sage/local/lib 
#24 64.01   [gmp-6.3.0]   [spkg-install]   ABI:     
#24 64.01   [gmp-6.3.0]   [spkg-install]   (CPP, CPPFLAGS, CXX and CXXFLAGS are listed below; these don't get modified.)
#24 64.01   [gmp-6.3.0]   [spkg-install] Finally using the following settings:
#24 64.01   [gmp-6.3.0]   [spkg-install]   CC=gcc
#24 64.01   [gmp-6.3.0]   [spkg-install]   CFLAGS=-O2 -pedantic -fomit-frame-pointer -m64 -mtune=skylake -march=broadwell  -g -O2
#24 64.01   [gmp-6.3.0]   [spkg-install]   CPP=
#24 64.01   [gmp-6.3.0]   [spkg-install]   CPPFLAGS=
#24 64.01   [gmp-6.3.0]   [spkg-install]   CXX=g++
#24 64.01   [gmp-6.3.0]   [spkg-install]   CXXFLAGS=-g -O2
#24 64.01   [gmp-6.3.0]   [spkg-install]   LDFLAGS= -Wl,-rpath-link,/sage/local/lib -L/sage/local/lib -Wl,-rpath,/sage/local/lib -Wl,-rpath-link,/sage/local/lib -L/sage/local/lib -Wl,-rpath,/sage/local/lib 
#24 64.01   [gmp-6.3.0]   [spkg-install]   ABI=64
#24 64.01   [gmp-6.3.0]   [spkg-install] (These settings may still get overridden by 'configure' or Makefiles.)
#24 64.01   [gmp-6.3.0]   [spkg-install] Configuring GMP with the following options:
#24 64.01   [gmp-6.3.0]   [spkg-install]     --prefix="/sage/local" --libdir="/sage/local/lib" --enable-cxx --enable-static --enable-shared 
#24 64.01   [gmp-6.3.0]   [spkg-install] You can set GMP_CONFIGURE to pass additional parameters.
#24 64.01   [gmp-6.3.0]   [spkg-install] checking build system type... kabylake-pc-linux-gnu
#24 64.01   [gmp-6.3.0]   [spkg-install] checking host system type... kabylake-pc-linux-gnu
#24 64.01   [gmp-6.3.0]   [spkg-install] checking for a BSD-compatible install... /usr/bin/install -c
#24 64.01   [gmp-6.3.0]   [spkg-install] checking whether build environment is sane... yes
#24 64.01   [gmp-6.3.0]   [spkg-install] checking for a thread-safe mkdir -p... /bin/mkdir -p
#24 64.01   [gmp-6.3.0]   [spkg-install] checking for gawk... no
#24 64.01   [gmp-6.3.0]   [spkg-install] checking for mawk... mawk
#24 64.01   [gmp-6.3.0]   [spkg-install] checking whether make sets $(MAKE)... yes
#24 64.01   [gmp-6.3.0]   [spkg-install] checking whether make supports nested variables... yes
#24 64.01   [gmp-6.3.0]   [spkg-install] checking whether to enable maintainer-specific portions of Makefiles... no
#24 64.01   [gmp-6.3.0]   [spkg-install] checking ABI=64
#24 64.01   [gmp-6.3.0]   [spkg-install] checking compiler gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=skylake -march=broadwell  -g -O2 ... yes
#24 64.01   [gmp-6.3.0]   [spkg-install] checking for gcc... gcc
#24 64.01   [gmp-6.3.0]   [spkg-install] checking whether the C compiler works... yes
#24 64.01   [gmp-6.3.0]   [spkg-install] checking for C compiler default output file name... a.out
#24 64.01   [gmp-6.3.0]   [spkg-install] checking for suffix of executables... 
#24 64.01   [gmp-6.3.0]   [spkg-install] checking whether we are cross compiling... no
#24 64.01   [gmp-6.3.0]   [spkg-install] checking for suffix of object files... o
#24 64.01   [gmp-6.3.0]   [spkg-install] checking whether we are using the GNU C compiler... yes
#24 64.01   [gmp-6.3.0]   [spkg-install] checking whether gcc accepts -g... yes
#24 64.01   [gmp-6.3.0]   [spkg-install] checking for gcc option to accept ISO C89... none needed
#24 64.01   [gmp-6.3.0]   [spkg-install] checking whether gcc understands -c and -o together... yes
#24 64.01   [gmp-6.3.0]   [spkg-install] checking for gcc option to accept ISO C99... none needed
#24 64.01   [gmp-6.3.0]   [spkg-install] checking how to run the C preprocessor... gcc -E
#24 64.01   [gmp-6.3.0]   [spkg-install] checking build system compiler gcc... yes
#24 64.01   [gmp-6.3.0]   [spkg-install] checking for build system preprocessor... gcc -E
#24 64.01   [gmp-6.3.0]   [spkg-install] checking for build system executable suffix... 
#24 64.01   [gmp-6.3.0]   [spkg-install] checking whether build system compiler is ANSI... yes
#24 64.01   [gmp-6.3.0]   [spkg-install] checking for build system compiler math library... -lm
#24 64.01   [gmp-6.3.0]   [spkg-install] checking whether we are using the GNU C++ compiler... yes
#24 64.01   [gmp-6.3.0]   [spkg-install] checking whether g++ accepts -g... yes
#24 64.01   [gmp-6.3.0]   [spkg-install] checking C++ compiler g++  -g -O2... no, std iostream, program does not run
#24 64.01   [gmp-6.3.0]   [spkg-install] configure: error: C++ compiler not available, see config.log for details
#24 64.01   [gmp-6.3.0]   [spkg-install] Error configuring GMP. (See above for the options passed to it.)
#24 64.01   [gmp-6.3.0]   [spkg-install] real 0m43.247s user 0m21.471s sys 0m16.236s
#24 64.01   [gmp-6.3.0]   ************************************************************************
#24 64.02   [gmp-6.3.0]   Error installing package gmp-6.3.0
#24 64.02   [gmp-6.3.0]   ************************************************************************
#24 64.02   [gmp-6.3.0] Full log file: /sage/logs/pkgs/gmp-6.3.0.log
#24 64.02 make[2]: *** [Makefile:3444: gmp-SAGE_LOCAL-no-deps] Error 1
#24 64.02 make[1]: *** [Makefile:3444: /sage/local/var/lib/sage/installed/gmp-6.3.0] Error 2

@vbraun vbraun force-pushed the fix-link-gmp-libstdc++ branch from 2a4e9df to 2ba6a8d Compare May 26, 2024 20:38
@vbraun
Copy link
Member Author

vbraun commented May 26, 2024

Yes configure is run twice, so we have to smuggle in the rpath in both invocations. Unfortunately the configure test doesn't use LDFLAGS though libstdc++ is linked (but implicitly, without explicitly adding -lstdc++). So we have to kind of abuse CXXFLAGS.

vbraun pushed a commit to vbraun/sage that referenced this pull request May 26, 2024
…ilt our own toolchain

The GMP configure test should link against our own libstdc++ instead of
the (too old) system libstdc++

Fixes sagemath#38085

URL: sagemath#38087
Reported by: Volker Braun
Reviewer(s):
@mkoeppe
Copy link
Contributor

mkoeppe commented May 26, 2024

It works now, thanks

vbraun pushed a commit to vbraun/sage that referenced this pull request May 27, 2024
sagemathgh-38087: Still add rpath to our own libstdc++, in case we built our own toolchain
    
The GMP configure test should link against our own libstdc++ instead of
the (too old) system libstdc++


Fixes sagemath#38085
    
URL: sagemath#38087
Reported by: Volker Braun
Reviewer(s):
vbraun pushed a commit to vbraun/sage that referenced this pull request May 29, 2024
sagemathgh-38087: Still add rpath to our own libstdc++, in case we built our own toolchain
    
The GMP configure test should link against our own libstdc++ instead of
the (too old) system libstdc++


Fixes sagemath#38085
    
URL: sagemath#38087
Reported by: Volker Braun
Reviewer(s):
@vbraun vbraun merged commit 3d1a66e into sagemath:develop Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GMP 6.3.0 fails to build due to GLIBCXX version incompatibility with self-compiled gcc
2 participants