Hi Caspar,
On 22/12/2017 10:52, Caspar van Leeuwen wrote:
Dear Easybuilders,
We would like to install a GCC with OpenMP 4.5 / OpenACC with
offloading capabilities to nvptx targets as described here
https://gcc.gnu.org/wiki/Offloading#How_to_try_offloading_enabled_GCC
We would of course prefer to do this installation with EasyBuild. As
far as I can determine, no EasyConfigs are available for this yet, and
I even doubt whether this can be build with the conventional GCC
EasyBlock: the installation procedure for a GCC with offloading
support is quite different, as nvptx-tool, nvptx-newlib, an
accelerator GCC compiler and a host GCC compiler all need to be built
(and it is suggested to install all in the same directory), through
repeated configure/make/make installs (see e.g. this build script:
https://gist.github.com/kristerw/4e9a735f2d755ffa73f9bf27edbf3c29 ).
My questions to you:
1) Has anyone already tried building a GCC with offloading support
though EasyBuild?
2) Specifically to the Gent people who wrote the GCC EasyBlock: would
you think this can somehow be done with the current EasyBlock (my
guess would be: no)? If not, would you think the existing EasyBlock
should be adapted to support this, or would you feel a separate
EasyBlock would be better? I personally wouldn't like 2 GCC
EasyBlocks; on the other hand, incorporating it in the existing one
results in a more complicated EasyBlock.
I must immediately say that I am not yet sure if I can invest the time
to write / adapt an EasyBlock for this, but I just want to explore my
options and your thoughts on this.
After taking a quick look at this, it looks like you could enhance the
existing easyblock for GCC with fairly limited effort to build a GCC
with offloading capabilities.
A lot of the logic in the current easyblock for GCC is there to first
build a GCC that can be used to build the CLooG & PPL libraries, to
finally obtain a GCC that has support for using these libraries. See the
code paths guarded with "if self.stagedbuild".
All this stuff is probably irrelevant for you (unless you want to build
a GCC that supports both offloading and CLooG/PPL...).
From the looks of it, these are a couple of changes you would need to do:
* add an extra custom easyconfig parameter for GCC to enable building
with offloading support, let's call it "with_offloading"
* disable building with "make bootstrap" in the build step if
"with_offloading" is enabled (or maybe not, you may still want to do
this for the host compiler actually...)
* build the accel compiler (either for Intel MIC or Nvidia PTX) if
"with_offloading" is enabled, this should probably be done in the build
step before the current last line there ("super(EB_GCC, self).build_step()")
* build the host compiler with the right configure options when
"with_offloading" is enabled (this should probably be done at the end of
build step)
You could probably just ignore the GCC easyblock all together and use a
(very) complicated easyconfig file that leverages the generic
ConfigureMake easyblock (since we already support running multiple
cycles of configure-make-install in a generic way by using a list of
string values for configopts rather than a single string value, see for
example the older FFTW easyconfigs), but you'll probably find yourself
making nasty hacks to get it to work the way you need to (just a hunch,
it may actually work just fine).
Forking off another GCC easyblock specifically for this doesn't seem
like a good idea either, I agree with you.
It may feel cleaner initially, but it would probably bite you later (for
example when the existing EB_GCC is tweaked, which somehow causes the
EB_GCC_offloading easyblock that would sit on top of EB_GCC to break..).
Note that the support for "eb -x" would be of great help here, since it
gives you a pretty good idea of the effect of changes you make to an
easyblock, see
http://easybuild.readthedocs.io/en/latest/Extended_dry_run.html for more
info.
This may be worth looking at during the hands-on sessions during the
EasyBuild User Meeting...
regards,
Kenneth
Regards,
Caspar van Leeuwen
SURFsara