spack: GCC Build Fails on AArch64
I’ve been testing Spack out on our Cray Envoy system and have hit a problem with the GCC build.
The end of the spack-build.out file looks like this:
cp /home/sw/arm1/.spack/var/spack/stage/gcc-7.2.0-wodkpzprkhbwcsupyybm6w6ywayku554/gcc-7.2.0/gcc/../fixincludes/README-fixinc include-fixed/README
chmod a+r include-fixed/README
echo timestamp > stmp-int-hdrs
/tmp/xmr/spack-stage/spack-stage-UotD4k/gcc-7.2.0/spack-build/./gcc/xgcc -B/tmp/xmr/spack-stage/spack-stage-UotD4k/gcc-7.2.0/spack-build/./gcc/ -nostdinc -x c /dev/null -S -o /dev/null -fself-test=/home/sw/arm1/.spack/var/spack/stage/gcc-7.2.0-wodkpzprkhbwcsupyybm6w6ywayku554/gcc-7.2.0/gcc/testsuite/selftests
/tmp/xmr/spack-stage/spack-stage-UotD4k/gcc-7.2.0/spack-build/./gcc/cc1: error while loading shared libraries: libisl.so.15: cannot open shared object file: No such file or directory
Makefile:1933: recipe for target 's-selftest' failed
make[3]: *** [s-selftest] Error 1
rm gfortran.pod gcc.pod
make[3]: Leaving directory '/tmp/xmr/spack-stage/spack-stage-UotD4k/gcc-7.2.0/spack-build/gcc'
Makefile:4585: recipe for target 'all-stage2-gcc' failed
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory '/tmp/xmr/spack-stage/spack-stage-UotD4k/gcc-7.2.0/spack-build'
Makefile:22412: recipe for target 'stage2-bubble' failed
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory '/tmp/xmr/spack-stage/spack-stage-UotD4k/gcc-7.2.0/spack-build'
Makefile:931: recipe for target 'all' failed
make: *** [all] Error 2
You can see that it can’t find libisl.so.15.
The install page at the GCC wiki says that configuring with the --with-mpc, --with-mpfr & --with-gmp is not recommended because you have to add those paths to LD_LIBRARY_PATH every time you use gcc. It appears that the same applies to --with-isl, too, with the additional caveat that you need to set LD_LIBRARY_PATH before even calling make.
The wiki page offers two recommended options:
- Just use the existing system versions of libisl (and the others) or
- After unpacking the source code, execute the contrib/download_prerequisites script which will fetch the mpc, mpfr, gmp and isl source packages extract them into the gcc source tree. Then they’ll automatically be built as part of gcc. It seems to me that this would also mean that we could remove the dependencies on mpc, mpfr, gmp & isl from the gcc package.
Interestingly, I tried loading the isl module manually (which set LD_LIBRARY_PATH properly) but the build still failed. At the moment, I’m assuming that LD_LIBRARY_PATH got reset somewhere during the build, but I haven’t verified that.
Note that the build worked just fine when I tried it out on my x86_64 Fedora workstation, but that was probably because a sufficiently recent version of libisl was already installed in /usr/lib64.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 26 (25 by maintainers)
@tgamblin I think that’s the issue. If I add
'--with-boot-ldflags={0}'.format(self.rpath_args)to the options list at the top ofconfigure_args(), then the build works fine. It would also explain why enabling the binutils variant fixed the problem for @morganiain.FWIW: This more of a SLES12 issue than an AArch64 issue. SLES12 includes an isl library that’s too old for recent versions of gcc. The fundamental problem is that when Spack builds gcc, it will link against the system version of libisl (and some other libraries) rather than the spack-built versions.
Thanks for reporting this @rgmiller