Hi Chris,
On 07/08/15 08:13, Christopher Samuel wrote:
On 07/08/15 15:55, Kenneth Hoste wrote:
[...]
What Bart was saying is that he added 'configopts = ...' to the GCC
easyconfig file, which resulted in the extra configure flags to be used
when GCC is built.
[...]
Yeah, what I'm trying to achieve is the same, all GCC's to be built with:
--with-arch=native
so that people who build their own code with GCC will get to use the
full capabilities of the architecture by default.
(I muddled the --march and --with-arch options from looking through
all the various places that could set native and didn't got back and
double check our own scripts, sigh).
The simplest way to do that is to just patch:
/usr/local/easybuild/software/EasyBuild/2.2.0/lib/python2.6/site-packages/easybuild_easyblocks-2.2.0-py2.6.egg/easybuild/easyblocks/g/gcc.py
to add:
configopts += " --with-arch=native"
after it's set all other options, that way you don't have to try and
patch every GCC easyconfig file.
You'd need to include this, rather than what you mentioned (that would
only work in easyconfig files):
self.cfg.update('configopts', '--with-arch=native')
However, this change will be lost as soon as you reinstall/update
EasyBuild, so you'd need to remember to reapply this patch.
For now, it may suffice as a temporary solution, but we need a better
solution in place for sure to support these kind of site customizations.
We've already set __INTEL_PRE_CFLAGS and __INTEL_PRE_FFLAGS so
that's the Intel compilers covered.
Hah, I didn't know about these, interesting.
Having already gone through and done the Slurm patching for OpenMPI
and now find that having upgraded to 2.2.0 I've got to try and merge
them all together again just to add:
configopts += " --with-slurm"
I think if there's a similar way to fix OpenMPI too.
There's no easyblock for OpenMPI, since OpenMPI is installed using the
generic ConfigureMake easyblock, so you can't just go and patch
openmpi.py like you did for gcc.py.
If you really want to fix it in one place, you could modify your
configuremake.py with something like:
if self.name == 'OpenMPI':
self.cfg.update('configopts', '--with-slurm')
I don't recommend this though; same argument as for gcc.py, it's an ugly
hack that is bound to bite you in the ass at some point.
For now, if you need to enhance easyconfigs with site customizations,
you should copy and edit the easyconfig files, and put them in a directory.
You can then define robot-paths in your EasyBuild configuration file, to
make sure that your customized easyconfigs get preference over the ones
included in the EasyBuild installation you're using:
robot-paths = /path/to/my/custom/easyconfigs:%(DEFAULT_ROBOT_PATHS)s
See also
http://easybuild.readthedocs.org/en/latest/Using_the_EasyBuild_command_line.html#controlling-the-robot-search-path
.
You can check with eb --dry-run which easyconfig files are being used
before performing installations.
That does mean you need to be careful that new easyconfigs that are
added when you update your EasyBuild installation also get a customized
version.
I know it's not a satisfactory solution for simple modifications that
are version-agnostic, but it's the best we have in place for now.
regards,
Kenneth