Update gcc easyblock to add enable-fat option#1336
Update gcc easyblock to add enable-fat option#1336boegel merged 5 commits intoeasybuilders:developfrom
Conversation
This change will build gcc so it will run on multiple platforms. During stage2 build that gmp was being optimized for the processor on the build machine. The --enable-fat option to configure enables gmp to run on other platforms.
|
Hmm, I'm not sure we should do this by default, since strictly speaking this introduces a performance regression for GCC compared to how we were installing it previously... On the other hand, the performance of GCC is certainly not critical (as opposed to scientific software, where it is). Thoughts on this @geimer, @wpoely86? @raj76 On the EasyBuild mailing list you also mentioned similar issues with ISL? Is this change sufficient to make the GCC build work on multiple platforms? |
|
@raj76 According to the GMP docs, this option only works on x86 (cfr. https://gmplib.org/manual/Build-Options.html#Build-Options). While the docs could be out of date, we should definitely double-check that unconditionally adding this option doesn't cause trouble on POWER or ARM. @boegel I have no clue where GMP is being used within GCC. I could imagine something like constant folding within the compiler, but quite likely also in the Fortran runtime libs, so there may indeed be a performance penalty. How severe it is is hard to judge, though. So maybe this should be implemented as a package-specific option which is disabled by default? As far as I know, ISL (or PPL/CLooG for older versions of GCC) is used for the Graphite loop transformations in the optimizer. And I believe they have to be enabled explicitly. So this has to be taken into account when testing whether ISL needs something similar. |
|
I did some further research. Here are my findings:
I haven't checked PPL/CLooG, as it would only affect GCC 4.x anyway. Whoever is interested in this outdated stuff has to look into this. My conclusion: |
|
A quick check on my AArch64 box shows that passing |
|
@boegel Just setting --enable-fat option for GMP made gcc work on both AMD and Intel platforms. |
|
@raj76 I'll take a look at the custom easyconfig option. Stay tuned... BTW: Passing |
Make generic code generation configurable via a custom easyconfig parameter
|
@geimer Thanks for adding the custom easyconfig parameter. It works as expected. |
| cmd = "./configure --prefix=%s " % stage2prefix | ||
| cmd += "--with-pic --disable-shared --enable-cxx" | ||
| cmd += "--with-pic --disable-shared --enable-cxx " | ||
| if self.cfg['generic']: |
There was a problem hiding this comment.
@raj76 @geimer Should we also consider the use of --optarch=GENERIC to enable this?
from easybuild.tools.config import build_option
from easybuild.tools.toolchain.compiler import OPTARCH_GENERIC
...
if build_option('optarch') == OPTARCH_GENERIC or self.cfg['generic']:Having a dedicated easyconfig parameter makes sense, but maybe we should use None as default value.
That way we can allow people setting it to False to indicate that the generic build should not be done when --optarch=GENERIC is used. That's a bit of a weird use case, but I guess it's possible?
if build_option('optarch') == OPTARCH_GENERIC and self.cfg['generic'] != False:There was a problem hiding this comment.
I am OK with using --optarch=GENERIC to enable this as well.
There was a problem hiding this comment.
I made the proposed changes in raj76#2, please review/merge to update this PR.
There was a problem hiding this comment.
I tested the updated gcc.py both with and without --optarch=GENERIC, works as intended.
also consider use of --optarch=generic to build GCC generically
This change will build gcc so it will run on multiple platforms. During stage2 build that gmp was being optimized for the processor on the build machine. The --enable-fat option to configure enables gmp to run on other platforms. This fix has been tested on our test cluster for building foss 2016b, 2017a, 2017b on AMD and Intel platforms.