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

GCCcore/9.3.0 fails to find GMP in stage2 for ISL on OpenSUSE Leap 15.2 #2309

Closed
zao opened this issue Jan 14, 2021 · 2 comments · Fixed by #2339
Closed

GCCcore/9.3.0 fails to find GMP in stage2 for ISL on OpenSUSE Leap 15.2 #2309

zao opened this issue Jan 14, 2021 · 2 comments · Fixed by #2339
Milestone

Comments

@zao
Copy link
Contributor

zao commented Jan 14, 2021

After fixing binutils on OpenSUSE Leap 15.2 I'm trying to build the full foss/2020a toolchain.

During the build of GCCcore/9.3.0 while configuring ISL for stage 2 with the following run_cmd command, it finds the header but not the static library in the stage2 prefix:

./configure --prefix=/tmp/eb-build/GCCcore/9.3.0/system-system/gcc-9.3.0/stage2_stuff --with-pic --disable-shared --with-gmp=system --with-gmp
-prefix=/tmp/eb-build/GCCcore/9.3.0/system-system/gcc-9.3.0/stage2_stuff  --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
checking which gmp to use... system
checking gmp.h usability... yes
checking gmp.h presence... yes
checking for gmp.h... yes
checking for main in -lgmp... no
configure: error: gmp library not found

The failing config.log test uses this command line:

configure:19076: gcc -o conftest -O3 -fomit-frame-pointer -malign-double -fstrict-aliasing -ffast-math -I/tmp/eb-build/GCCcore/9.3.0/system-system/gcc-9.3.0/stage2_stuff/include  -L/tmp/eb-build/GCCcore/9.3.0/system-system/gcc-9.3.0/stage2_stuff/lib -I/tmp/eb-build/GCCcore/9.3.0/system-system/gcc-9.3.0/stage2_stuff/include  -L/tmp/eb-build/GCCcore/9.3.0/system-system/gcc-9.3.0/stage2_stuff/lib  conftest.c -lgmp  -lgmp  >&5 

The given -L/tmp/eb-build/GCCcore/9.3.0/system-system/gcc-9.3.0/stage2_stuff/lib location for GMP is incorrect as on this platform, the library is in a lib64 directory: /tmp/eb-build/GCCcore/9.3.0/system-system/gcc-9.3.0/stage2_stuff/lib64/libgmp.a

@bartoldeman found a part in gcc.py that assumes that libraries are installed in a lib directory, not sure if that's a root cause or just an attempt to plaster over this GCC build behaviour on some platforms:

if lib == "gmp":
# make sure correct GMP is found
libpath = os.path.join(stage2prefix, 'lib')
incpath = os.path.join(stage2prefix, 'include')
cppflags = os.getenv('CPPFLAGS', '')
env.setvar('CPPFLAGS', "%s -L%s -I%s " % (cppflags, libpath, incpath))

@boegel
Copy link
Member

boegel commented Feb 18, 2021

@zao So this would need a small change in the GCC easyblock to also consider lib64 if that lib dir was not found, rather than blindly assuming it's there?

@boegel
Copy link
Member

boegel commented Feb 18, 2021

@zao Can you take #2339 for a spin on OpenSUSE?

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