internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: easybuilders/easybuild-easyblocks

Issue:
Perl-5.28.0-GCCcore-7.3.0.eb  not building due to perldoc sanity checks failing
```
$ eb --version
This is EasyBuild 3.8.1 (framework: 3.8.1, easyblocks: 3.8.1)
```

From [my build log](https://www.dropbox.com/s/0rmwuqpju9kfqiy/install_foss_2018b_toolchain_job.sge.o3588049.gz?dl=0) for Perl-5.28.0-GCCcore-7.3.0.eb the following looks like a major problem:
```
 /usr/local/community/rse/EasyBuild/software/Perl/5.28.0-GCCcore-7.3.0/lib/perl5/5.28.0/xCouldn't copy cpan/podlators/blib/script/pod2man to /usr/local/scripts/pod2man: No such file or directory
```

I.e., it looks like it is trying to install stuff in the wrong place.

@boegel thinks the problem is that the Perl install process finds a `/usr/local/scripts` directory in my environment and incorrectly assumes that's where I'd like it to install scripts.  

[More background info](https://openpkg-dev.openpkg.narkive.com/bGejYSaD/bugdb-perl-possible-build-problem-copying-into-usr-local-scripts-pr-133) (from 16 years ago!)

Suggested fix: add the following to the Perl easyconfig (not tested yet):
```python
configopts = "-Dscriptdirexp=%(installdir)s/bin"
```

NB I've not yet had chance to test this! 


Discussion:

Resolving patch:
diff --git a/easybuild/easyblocks/p/perl.py b/easybuild/easyblocks/p/perl.py
--- a/easybuild/easyblocks/p/perl.py
+++ b/easybuild/easyblocks/p/perl.py
@@ -58,11 +58,19 @@ def configure_step(self):
             '-Dcc="{0}"'.format(os.getenv('CC')),
             '-Dccflags="{0}"'.format(os.getenv('CFLAGS')),
             '-Dinc_version_list=none',
+            '-Dprefix=%(installdir)s',
+            # guarantee that scripts are installed in /bin in the installation directory (and not in a guessed path)
+            # see https://github.com/easybuilders/easybuild-easyblocks/issues/1659
+            '-Dinstallscript=%(installdir)s/bin',
+            '-Dscriptdir=%(installdir)s/bin',
+            '-Dscriptdirexp=%(installdir)s/bin',
         ]
         if self.cfg['use_perl_threads']:
             configopts.append('-Dusethreads')
 
-        cmd = './Configure -de %s -Dprefix="%s"' % (' '.join(configopts), self.installdir)
+        configopts = (' '.join(configopts)) % {'installdir': self.installdir}
+
+        cmd = './Configure -de %s' % configopts
         run_cmd(cmd, log_all=True, simple=True)
 
     def test_step(self):


Test patch:
Repository: easybuilders/easybuild-easyblocks

Issue:
CUDA_{ROOT,HOME,PATH} are PATH-like?
See: https://github.com/easybuilders/easybuild-easyblocks/blob/e3a4cd70357103e1fa463751df13378f217c7ad1/easybuild/easyblocks/c/cuda.py#L191-L193

This creates `prepend_path` module commands, instead of `setenv`! Is there a particular reason to do so?


Discussion:
Doh, that's wrong, at least for HOME and ROOT, not sure what CUDA_PATH is used for.
Looks like `$CUDA_PATH` should also be set via `setenv`, see https://docs-cupy.chainer.org/en/stable/install.html#install-cuda .
I'm MotW, I'll make a PR for that now
@bertwesarg Thanks a lot for reporting this!

How did you notice that these environment variables were set incorrectly via `prepend_path` rather than `setenv`? Did you run into some problem because of it, or did you just happen to notice?
@ocaisa Should be done via `make_module_extra`
> @bertwesarg Thanks a lot for reporting this!
> 
> How did you notice that these environment variables were set incorrectly via `prepend_path` rather than `setenv`? Did you run into some problem because of it, or did you just happen to notice?

More or less by accident. I noticed on our system that the `refcount` variable is set, than looked into the modules file, notified our support, and they told me, its coming from easybuild.

Resolving patch:
diff --git a/easybuild/easyblocks/c/cuda.py b/easybuild/easyblocks/c/cuda.py
--- a/easybuild/easyblocks/c/cuda.py
+++ b/easybuild/easyblocks/c/cuda.py
@@ -173,6 +173,15 @@ def sanity_check_step(self):
 
         super(EB_CUDA, self).sanity_check_step(custom_paths=custom_paths)
 
+    def make_module_extra(self):
+        """Set the install directory as CUDA_HOME, CUDA_ROOT, CUDA_PATH."""
+        txt = super(EB_CUDA, self).make_module_extra()
+        txt += self.module_generator.set_environment('CUDA_HOME', self.installdir)
+        txt += self.module_generator.set_environment('CUDA_ROOT', self.installdir)
+        txt += self.module_generator.set_environment('CUDA_PATH', self.installdir)
+        self.log.debug("make_module_extra added this: %s", txt)
+        return txt
+
     def make_module_req_guess(self):
         """Specify CUDA custom values for PATH etc."""
 
@@ -198,9 +207,6 @@ def make_module_req_guess(self):
             'LD_LIBRARY_PATH': lib_path,
             'LIBRARY_PATH': ['lib64', os.path.join('lib64', 'stubs')],
             'CPATH': inc_path,
-            'CUDA_HOME': [''],
-            'CUDA_ROOT': [''],
-            'CUDA_PATH': [''],
         })
 
         return guesses


Test patch:
Repository: easybuilders/easybuild-easyblocks

Issue:
CP2K easyblock fails when using Python 3
```
$ CP2K-6.1-foss-2019a.eb
...
== testing...
ERROR: Traceback (most recent call last):
  File "/home/kehoste/easybuild-framework/easybuild/main.py", line 112, in build_and_install_software
    (ec_res['success'], app_log, err) = build_and_install_one(ec, init_env)
  File "/home/kehoste/easybuild-framework/easybuild/framework/easyblock.py", line 3046, in build_and_install_one
    result = app.run_all_steps(run_test_cases=run_test_cases)
  File "/home/kehoste/easybuild-framework/easybuild/framework/easyblock.py", line 2954, in run_all_steps
    self.run_step(step_name, step_methods)
  File "/home/kehoste/easybuild-framework/easybuild/framework/easyblock.py", line 2824, in run_step
    step_method(self)()
  File "/home/kehoste/easybuild-easyblocks/easybuild/easyblocks/c/cp2k.py", line 702, in test_step
    test_core_cnt = min(self.cfg.get('parallel', sys.maxint), 4)
AttributeError: module 'sys' has no attribute 'maxint'
```


Discussion:

Resolving patch:
diff --git a/easybuild/easyblocks/c/cp2k.py b/easybuild/easyblocks/c/cp2k.py
--- a/easybuild/easyblocks/c/cp2k.py
+++ b/easybuild/easyblocks/c/cp2k.py
@@ -699,7 +699,7 @@ def test_step(self):
                 self.log.info("No reference output found for regression test, just continuing without it...")
 
             # prefer using 4 cores, since some tests require/prefer square (n^2) numbers or powers of 2 (2^n)
-            test_core_cnt = min(self.cfg.get('parallel', sys.maxint), 4)
+            test_core_cnt = min(self.cfg['parallel'], 4)
             if get_avail_core_count() < test_core_cnt:
                 raise EasyBuildError("Cannot run MPI tests as not enough cores (< %s) are available", test_core_cnt)
             else:


Test patch:
diff --git a/test/easyblocks/init_easyblocks.py b/test/easyblocks/init_easyblocks.py
--- a/test/easyblocks/init_easyblocks.py
+++ b/test/easyblocks/init_easyblocks.py
@@ -126,6 +126,8 @@ def check_extra_options_format(extra_options):
         re.compile(r"[^\w]basestring([^\w]|$)"),
         # check for use of '.iteritems()', which is Python 2.x only (should use .items instead)
         re.compile(r"\.iteritems\(\)"),
+        # sys.maxint is no longer there in Python 3
+        re.compile(r"sys\.maxint"),
     ]
     for regexp in regexps:
         self.assertFalse(regexp.search(txt), "No match for '%s' in %s" % (regexp.pattern, easyblock))
Repository: easybuilders/easybuild-easyblocks

Issue:
SuiteSparse easyblock fails when using Python 3
When running `eb` on top of Python 3.6.8:

```
$ eb SuiteSparse-5.4.0-foss-2019a-METIS-5.1.0.eb
...
== configuring...
ERROR: Traceback (most recent call last):
  File "/home/kehoste/easybuild-framework/easybuild/main.py", line 112, in build_and_install_software
    (ec_res['success'], app_log, err) = build_and_install_one(ec, init_env)
  File "/home/kehoste/easybuild-framework/easybuild/framework/easyblock.py", line 3046, in build_and_install_one
    result = app.run_all_steps(run_test_cases=run_test_cases)
  File "/home/kehoste/easybuild-framework/easybuild/framework/easyblock.py", line 2954, in run_all_steps
    self.run_step(step_name, step_methods)
  File "/home/kehoste/easybuild-framework/easybuild/framework/easyblock.py", line 2824, in run_step
    step_method(self)()
  File "/home/kehoste/easybuild-easyblocks/easybuild/easyblocks/s/suitesparse.py", line 113, in configure_step
    for (var, val) in cfgvars.items():
RuntimeError: dictionary changed size during iteration
```


Discussion:

Resolving patch:
diff --git a/easybuild/easyblocks/s/suitesparse.py b/easybuild/easyblocks/s/suitesparse.py
--- a/easybuild/easyblocks/s/suitesparse.py
+++ b/easybuild/easyblocks/s/suitesparse.py
@@ -110,7 +110,7 @@ def configure_step(self):
 
         try:
             for line in fileinput.input(fp, inplace=1, backup='.orig'):
-                for (var, val) in cfgvars.items():
+                for (var, val) in list(cfgvars.items()):
                     orig_line = line
                     # for variables in cfgvars, substiture lines assignment
                     # in the file, whatever they are, by assignments to the


Test patch:
Repository: easybuilders/easybuild-easyblocks

Issue:
Increase timeout of CUDA install
The current CUDA EB fails on our Power system with

`== FAILED: Installation ended unsuccessfully (build directory: /tmp/easybuild_build-ml/CUDA/10.1.243/GCC-8.3.0): build failed (first 300 chars): run_cmd_qa: cmd   ./cuda-installer  --silent --toolkit --toolkitpath=/scratch/ws/s3248973-EasyBuild/easybuild-ml/eb/CUDA/10.1.243-GCC-8.3.0 --defaultroot=/scratch/ws/s3248973-EasyBuild/easybuild-ml/eb/CUDA/10.1.243-GCC-8.3.0  : Max nohits 300 reached: end of output  (took 9 min 35 sec)`

Running `time ./cuda-installer ...` manually shows a total time of ~13min.

However that fails anyway on power, so retrying with 10.2 running manually takes ~7min

I propose to increase the waiting time to 15 minutes


Discussion:
I'm fine with bumping the `maxhits` from 300 to say 1000 in the `run_cmd_qa` command in the CUDA easyblock to fix this. Are you up for opening a PR for this @Flamefire?

The fact that it takes a while may also be affected by a slow target filesystem, although I guess single-thread performance on POWER processors is typically a lot lower than on x86_64?
> The fact that it takes a while may also be affected by a slow target filesystem, although I guess single-thread performance on POWER processors is typically a lot lower than on x86_64?

Turned out the huge increase was due to a) a failing build with CUDA 10.1 and b) a slow filesystem due to Lustre over NFS (don't ask...)

Resolving patch:
diff --git a/easybuild/easyblocks/c/cuda.py b/easybuild/easyblocks/c/cuda.py
--- a/easybuild/easyblocks/c/cuda.py
+++ b/easybuild/easyblocks/c/cuda.py
@@ -153,9 +153,9 @@ def install_step(self):
         # instead of segfaulting in the cuda-installer.
         remove_file('/tmp/cuda-installer.log')
 
-        # overriding maxhits default value to 300 (300s wait for nothing to change in the output without seeing a known
-        # question)
-        run_cmd_qa(cmd, qanda, std_qa=stdqa, no_qa=noqanda, log_all=True, simple=True, maxhits=300)
+        # overriding maxhits default value to 1000 (seconds to wait for nothing to change in the output
+        # without seeing a known question)
+        run_cmd_qa(cmd, qanda, std_qa=stdqa, no_qa=noqanda, log_all=True, simple=True, maxhits=1000)
 
         # Remove the cuda-installer log file
         remove_file('/tmp/cuda-installer.log')


Test patch:
Repository: easybuilders/easybuild-easyblocks

Issue:
Bundle Easyblock does not put patches into root config
At https://github.com/easybuilders/easybuild-easyblocks/blob/b99cc5a4dfb98cafbbd4a8827ea9bfb444724e27/easybuild/easyblocks/generic/bundle.py#L156 the patches checksums are added to the root, but the patches are not which makes e.g. the unit tests fail, see https://github.com/easybuilders/easybuild-easyconfigs/pull/9546

Should the patches be added? From the logic in the check_checksums it seems: yes


Discussion:

Resolving patch:
diff --git a/easybuild/easyblocks/generic/bundle.py b/easybuild/easyblocks/generic/bundle.py
--- a/easybuild/easyblocks/generic/bundle.py
+++ b/easybuild/easyblocks/generic/bundle.py
@@ -74,6 +74,8 @@ def __init__(self, *args, **kwargs):
         # list of sources for bundle itself *must* be empty
         if self.cfg['sources']:
             raise EasyBuildError("List of sources for bundle itself must be empty, found %s", self.cfg['sources'])
+        if self.cfg['patches']:
+            raise EasyBuildError("List of patches for bundle itself must be empty, found %s", self.cfg['patches'])
 
         # disable templating to avoid premature resolving of template values
         self.cfg.enable_templating = False
@@ -109,7 +111,7 @@ def __init__(self, *args, **kwargs):
             comp_cfg['easyblock'] = None
 
             # reset list of sources/source_urls/checksums
-            comp_cfg['sources'] = comp_cfg['source_urls'] = comp_cfg['checksums'] = []
+            comp_cfg['sources'] = comp_cfg['source_urls'] = comp_cfg['checksums'] = comp_cfg['patches'] = []
 
             for key in self.cfg['default_component_specs']:
                 comp_cfg[key] = self.cfg['default_component_specs'][key]
@@ -151,6 +153,9 @@ def __init__(self, *args, **kwargs):
                 # add per-component checksums for patches to list of checksums for patches
                 checksums_patches.extend(comp_cfg['checksums'][src_cnt:])
 
+            if comp_cfg['patches']:
+                self.cfg.update('patches', comp_cfg['patches'])
+
             self.comp_cfgs.append(comp_cfg)
 
         self.cfg.update('checksums', checksums_patches)


Test patch:
Repository: easybuilders/easybuild-easyblocks

Issue:
pylibdir of versionindependentpythonpackage.py is overwritten by pythonpackage.py
In 599869d `set_pylibdirs` of [pythonpackage.py](https://github.com/easybuilders/easybuild-easyblocks/blob/develop/easybuild/easyblocks/generic/pythonpackage.py) was changed to always set `self.pylibdir` (not only if its value is `UNKNOWN`). This seems to break the `prepare_step` of [versionindependentpythonpackage.py](https://github.com/easybuilders/easybuild-easyblocks/blob/develop/easybuild/easyblocks/generic/versionindependentpythonpackage.py) because pylibdir is now overwritten. This forces the `install_step` to crash afterwards due to missing subdirs within the `os.mkdir(full_pylibdir)` command.


Discussion:

Resolving patch:
diff --git a/easybuild/easyblocks/generic/versionindependentpythonpackage.py b/easybuild/easyblocks/generic/versionindependentpythonpackage.py
--- a/easybuild/easyblocks/generic/versionindependentpythonpackage.py
+++ b/easybuild/easyblocks/generic/versionindependentpythonpackage.py
@@ -47,10 +47,11 @@ def build_step(self):
         """No build procedure."""
         pass
 
-    def prepare_step(self, *args, **kwargs):
-        """Set pylibdir"""
+    def set_pylibdirs(self):
+        """Set pylibdir."""
+        super(VersionIndependentPythonPackage, self).set_pylibdirs()
         self.pylibdir = 'lib'
-        super(VersionIndependentPythonPackage, self).prepare_step(*args, **kwargs)
+        self.all_pylibdirs = ['lib']
 
     def install_step(self):
         """Custom install procedure to skip selection of python package versions."""


Test patch:
Repository: easybuilders/easybuild-easyblocks

Issue:
Incorrect download path for test data in wps.py
Hi,

As bugs this is pretty minor but in wps.py, the download path for geog_complete data set is currently

http://www2.mmm.ucar.edu/wrf/src/wps_files/geog_complete.tar.bz2

and it should be 

https://www2.mmm.ucar.edu/wrf/src/wps_files/geog_complete.tar.gz

Thanks


Discussion:

Resolving patch:
diff --git a/easybuild/easyblocks/w/wps.py b/easybuild/easyblocks/w/wps.py
--- a/easybuild/easyblocks/w/wps.py
+++ b/easybuild/easyblocks/w/wps.py
@@ -68,7 +68,7 @@ def __init__(self, *args, **kwargs):
             testdata_urls.append("http://www2.mmm.ucar.edu/wrf/src/wps_files/geog.tar.gz")
         elif LooseVersion(self.version) < LooseVersion('4.0'):
             # 2.3GB download!
-            testdata_urls.append("http://www2.mmm.ucar.edu/wrf/src/wps_files/geog_complete.tar.bz2")
+            testdata_urls.append("http://www2.mmm.ucar.edu/wrf/src/wps_files/geog_complete.tar.gz")
         else:
             # 2.6GB download, 29GB unpacked!!
             testdata_urls.append("http://www2.mmm.ucar.edu/wrf/src/wps_files/geog_high_res_mandatory.tar.gz")


Test patch:
Repository: easybuilders/easybuild-easyblocks

Issue:
enhanced extension filter for Python packages causes trouble for netcdf4-python sanity check
The enhanced extension filter for Python packages made in #2224 causes trouble for `netcdf4-python-1.5.3-intel-2020a-Python-3.8.2.eb`:

```
== 2020-12-03 20:44:05,145 build_log.py:169 ERROR EasyBuild crashed with an error (at easybuild/base/exceptions.py:124 in __init__): Sanity check failed: command "mpirun -n 1 PYTHONNOUSERSITE=1 python -c "import netCDF4"" failed; output:
[proxy:0:0@node3406.kirlia.os] HYD_spawn (../../../../../src/pm/i_hydra/libhydra/spawn/intel/hydra_spawn.c:128):
execvp error on file PYTHONNOUSERSITE=1 (No such file or directory)
```

We should set `$PYTHONNOUSERSITE` to `1` some other way, and make sure its set *again* after the environment is reset in the sanity check step...

cc @Flamefire


Discussion:
The problem here is that we must make sure it is set for all sanity checks and for the skip check. I don't know where a good place for that would be.

Resolving patch:
diff --git a/easybuild/easyblocks/p/python.py b/easybuild/easyblocks/p/python.py
--- a/easybuild/easyblocks/p/python.py
+++ b/easybuild/easyblocks/p/python.py
@@ -53,7 +53,7 @@
 import easybuild.tools.toolchain as toolchain
 
 
-EXTS_FILTER_PYTHON_PACKAGES = ('PYTHONNOUSERSITE=1 python -c "import %(ext_name)s"', "")
+EXTS_FILTER_PYTHON_PACKAGES = ('python -c "import %(ext_name)s"', "")
 
 # magic value for unlimited stack size
 UNLIMITED = 'unlimited'


Test patch:
Repository: easybuilders/easybuild-easyblocks

Issue:
stderr: ERROR: Unable to locate a modulefile for 'PrgEnv-pgi' 
I am installing CrayCCE on the a Cray XC40 and am recieving the error.

```
stderr: ERROR: Unable to locate a modulefile for 'PrgEnv-pgi'\n)") 
```

Looking at the LOG I see...

```
module unload PrgEnv-gnu
module unload PrgEnv-intel
module unload PrgEnv-pgi

; stderr: ERROR: Unable to locate a modulefile for 'PrgEnv-pgi' 
```

In our system we do not even have `PrgEnv-pgi` so it is natural that we get this error, but we are not using pgi either so
it should be checked if such a module exists prior of unloading it.
Also `PrgEnv-pgi` is not listed as a dependency in the config file.

We are using module.tcl Modules Release 4.1.3.1 (2018-11-29)
and I know that EasyBuild prefers Lmod, but still module.tcl is supported.

Cheers
Henric


Discussion:
Thanks for reporting this @menzzana !

Usually a modules tool is happy to unload a module that isn't loaded, even if the module file doesn't exist, but apparently 4.1.3 doesn't... Maybe @xdelaruelle can shed some light on this?

In any case, it should be fairly easy to fix this, by guarding the `module unload` with a condition.
That change should be made in the [CrayToolchain](https://github.com/easybuilders/easybuild-easyblocks/blob/develop/easybuild/easyblocks/generic/craytoolchain.py)

Resolving patch:
diff --git a/easybuild/easyblocks/generic/craytoolchain.py b/easybuild/easyblocks/generic/craytoolchain.py
--- a/easybuild/easyblocks/generic/craytoolchain.py
+++ b/easybuild/easyblocks/generic/craytoolchain.py
@@ -76,7 +76,9 @@ def make_module_dep(self):
         # unload statements for other PrgEnv modules
         prgenv_unloads = ['']
         for prgenv in [prgenv for prgenv in KNOWN_PRGENVS if not prgenv_mod.startswith(prgenv)]:
-            prgenv_unloads.append(self.module_generator.unload_module(prgenv).strip())
+            is_loaded_guard = self.module_generator.is_loaded(prgenv)
+            unload_stmt = self.module_generator.unload_module(prgenv).strip()
+            prgenv_unloads.append(self.module_generator.conditional_statement(is_loaded_guard, unload_stmt))
 
         # load statement for selected PrgEnv module (only when not loaded yet)
         prgenv_load = self.module_generator.load_module(prgenv_mod, recursive_unload=False)


Test patch:
Repository: easybuilders/easybuild-easyblocks

Issue:
GCCcore/9.3.0 fails to find GMP in stage2 for ISL on OpenSUSE Leap 15.2
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: https://github.com/easybuilders/easybuild-easyblocks/blob/6e63e1498a849f5e0bc8c57eef614e3bd4fea8ff/easybuild/easyblocks/g/gcc.py#L595-L601


Discussion:
@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?

Resolving patch:
diff --git a/easybuild/easyblocks/g/gcc.py b/easybuild/easyblocks/g/gcc.py
--- a/easybuild/easyblocks/g/gcc.py
+++ b/easybuild/easyblocks/g/gcc.py
@@ -599,6 +599,14 @@ def build_step(self):
                     if lib == "gmp":
                         # make sure correct GMP is found
                         libpath = os.path.join(stage2prefix, 'lib')
+
+                        # fall back to lib64 directory if lib was not found,
+                        # give up if neither are there
+                        if not os.path.exists(libpath):
+                            libpath += '64'
+                        if not os.path.exists(libpath):
+                            raise EasyBuildError("lib(64) subdirectory not found in %s!" % stage2prefix)
+
                         incpath = os.path.join(stage2prefix, 'include')
 
                         cppflags = os.getenv('CPPFLAGS', '')


Test patch: