easybuilders / easybuild

EasyBuild - building software with ease
http://easybuild.io
GNU General Public License v2.0
456 stars 142 forks source link

When installing GCCcore as a dependency for another program: "could not find a working compiler" #888

Closed skylord-a52 closed 4 months ago

skylord-a52 commented 4 months ago

Hi,

I'm attempting to use EasyBuild to install Gkeyll, as compilation always fails for some reason when I try to install it myself.

I'm running the following command:

eb --software-name=GKeyll --toolchain-name=foss --robot

However, while attempting to install GCCcore, the build fails. Here are the last few lines of the log:

checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI=64
checking compiler gcc -O2 -pedantic -fomit-frame-pointer -m64 ... no
checking ABI=x32
checking compiler gcc -O2 -pedantic -fomit-frame-pointer -mx32 ... no
checking ABI=32
checking compiler gcc -m32 -O2 -pedantic -fomit-frame-pointer ... no
checking compiler gcc -O2 -pedantic -fomit-frame-pointer ... no
configure: error: could not find a working compiler, see config.log for details
 (at easybuild/tools/run.py:682 in parse_cmd_output)
== 2024-03-11 16:27:06,753 build_log.py:267 INFO ... (took 7 mins 28 secs)
== 2024-03-11 16:27:06,755 filetools.py:2012 INFO Removing lock /home/andrea/.local/easybuild/software/.locks/_home_andrea_.local_easybuild_software_GCCcore_9.3.0.lock...
== 2024-03-11 16:27:06,755 filetools.py:383 INFO Path /home/andrea/.local/easybuild/software/.locks/_home_andrea_.local_easybuild_software_GCCcore_9.3.0.lock successfully removed.
== 2024-03-11 16:27:06,755 filetools.py:2016 INFO Lock removed: /home/andrea/.local/easybuild/software/.locks/_home_andrea_.local_easybuild_software_GCCcore_9.3.0.lock
== 2024-03-11 16:27:06,755 easyblock.py:4283 WARNING build failed (first 300 chars): cmd " ./configure --prefix=/home/andrea/.local/easybuild/build/GCCcore/9.3.0/system-system/gcc-9.3.0/stage2_stuff --with-pic --disable-shared --enable-cxx  --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu" exited with exit code 1 and output:
checking build system type... x86_64-pc-linux-gnu
ch
== 2024-03-11 16:27:06,755 easyblock.py:328 INFO Closing log for application name GCCcore version 9.3.0

System information:

OS: Windows 11 running Ubuntu 22.04.4 LTS via WSL 2 gcc: 11.4.0 lmod: 6.6 eb: 4.9.0

I'm not sure why it's installing gcc in the first place anyway -- I've already got that installed globally. Unless it needs a specific version, or GCCcore is different?

ocaisa commented 4 months ago

Are you sure you have all the EasyBuild requirements installed on the platform? See https://docs.easybuild.io/installation/#requirements (in particular you need to have g++ available to build GCC).

If so, then the likely issue is that you are trying to build an old compiler on a newer system and the binutils required by the toolchain is too old. Your system compiler is GCC 11, which may indeed have issues trying to build GCC 9. One thing you can try is to filter out binutils as a dependency: Add the build option --filter-deps=binutils to your command.

ocaisa commented 4 months ago

EasyBuild controls the entire stack to (try to) ensure reproducible builds. In this case that means going back and building the compiler needed for the version of Gkeyll that EasyBuild knows about (https://github.com/easybuilders/easybuild-easyconfigs/blob/develop/easybuild/easyconfigs/g/GKeyll/GKeyll-20220803-foss-2020a-Python-3.8.2.eb)

skylord-a52 commented 4 months ago

It looks like my install of GCC was corrupted/incomplete in some way, as reinstalling it fixed my original issue with the manual installation of GKeyll.

Although this means that I no longer need EasyBuild, I checked if it works now for the sake of anyone having this issue in the future. ...It didn't. So if you need this, you're out of luck! Sorry.