easybuilders / easybuild-easyblocks

Collection of easyblocks that implement support for building and installing software with EasyBuild.
https://easybuild.io
GNU General Public License v2.0
105 stars 284 forks source link

gcc appends the hard-coded configure options to the user specified ones #1356

Open rhaas80 opened 6 years ago

rhaas80 commented 6 years ago

Namely in here: https://github.com/easybuilders/easybuild-easyblocks/blob/3c92355e1f3d9a4f83bd0d1951bf0e608d51f384/easybuild/easyblocks/g/gcc.py#L242 which means that user specified options will be overwritten by the hard-coded ones.

In my case I wanted to change the default linker back to bfd from gold which however is not possible by added --enable-gold=yes.

I would seem better to me to append the user options to the hard-coded ones so that they take precedence.

boegel commented 6 years ago

@rhaas80 Your suggestion makes a lot of sense, we should indeed to it the other way around to allow for overriding configure options included by the GCC easyblock.

Doing so now will result in breaking backward compatibility however, so this needs to be done with care...

Thoughts on this @wpoely86, @geimer?

wpoely86 commented 6 years ago

Hmm, tricky. I'm not sure what happens if you do thing like --enable-gold=yes --enable-gold=no. Does the first or last one win? Did you test it @rhaas80 ?

I would definitely display a warning message but we can indeed append?

rhaas80 commented 6 years ago

I gave this a try:

$> bin/gcc -v
...
Configured with: ../configure --enable-gold=no --enable-languages=c,c++,fortran --enable-lto --enable-checking=release --disable-multilib --enable-shared=yes --enable-static=yes --enable-threads=posix --enable-gold=default --enable-plugins --enable-ld --with-plugin-ld=ld.gold --prefix=/u/staff/rhaas/tmp/sw/EasyBuild/software/GCCcore/7.3.0 --with-local-prefix=/u/staff/rhaas/tmp/sw/EasyBuild/software/GCCcore/7.3.0 --enable-bootstrap --with-isl=/dev/shm/rhaas/easybuild/build/GCCcore/7.3.0/dummy-/gcc-7.3.0/stage2_stuff
Thread model: posix
gcc version 7.3.0 (GCC)
$> bin/gcc -Wl,-verbose hello.c
/usr/bin/ld.gold: Attempt to open /usr/lib/../lib64/crt1.o succeeded
/usr/lib/../lib64/crt1.o
...

so "last one wins" since the configure line is --enable-gold=no ... --enable-gold=default.

If backwards compatibility must be maintained then a postconfigopts option would also be an option. How do other packages in easybuild handle configopts? postconfigopts is not really nice though I would think.