easybuilders / easybuild-easyconfigs

A collection of easyconfig files that describe which software to build using which build options with EasyBuild.
https://easybuild.io
GNU General Public License v2.0
371 stars 698 forks source link

PGI Community Edition #6338

Open cstackpole opened 6 years ago

cstackpole commented 6 years ago

PGI is now offering a community edition in which the download provides a license key in the tar.gz file (actual path is install_components/common/license.dat).

I'm having some difficulty getting this going, I'm trying one more thing but I am curious if anyone else has tips before I dump all my issues here. :-)

Thanks!

cstackpole commented 6 years ago

I thought better about it and decided to dump what I've got. I pulled the license file out of the tar.gz and dumped it into ~/pgi.dat.

Here is the EB script (I hacked apart a previous example):

name = 'PGI'
version = '2018-184'

homepage = 'http://www.pgroup.com/'
description = "C, C++ and Fortran compilers from The Portland Group - PGI"

toolchain = {'name': 'dummy', 'version': ''}

sources = ['pgilinux-2018-184-x86-64.tar.gz']
checksums = ['b55461f9f0986acbd51902c51c2074b9']

gccver = '6.4.0'
binutilsver = '2.28'
versionsuffix = '-GCC-%s-%s' % (gccver, binutilsver)

dependencies = [
    ('GCCcore', gccver),
    ('binutils', binutilsver, '', ('GCCcore', gccver)),
    ('numactl', '2.0.11', '', ('GCCcore', gccver)),
]

# license file
license_file = HOME + '/pgi.dat'

moduleclass = 'compiler'

And here is the output that I am currently stuck on.

$ eb --sourcepath=~/EB_Downloads/ PGI-2018-184-GCC-6.4.0-2.28.eb -r
== temporary log file in case of crash /tmp/eb-M4zY8s/easybuild-zVNCGE.log
== resolving dependencies ...
== processing EasyBuild easyconfig /software/eb/software/EasyBuild/3.6.0/lib/python2.7/site-packages/easybuild_easyconfigs-3.6.0-py2.7.egg/easybuild/easyconfigs/p/PGI/PGI-2018-184-GCC-6.4.0-2.28.eb
== building and installing PGI/2018-184-GCC-6.4.0-2.28...
== fetching files...
== creating build dir, resetting environment...
== unpacking...
== patching...
== preparing...
== configuring...
== building...
== testing...
== installing...
ERROR: Traceback (most recent call last):
  File "/software/eb/software/EasyBuild/3.6.0/lib/python2.7/site-packages/easybuild_framework-3.6.0-py2.7.egg/easybuild/main.py", line 129, in build_and_install_software
    (ec_res['success'], app_log, err) = build_and_install_one(ec, init_env, hooks=hooks)
  File "/software/eb/software/EasyBuild/3.6.0/lib/python2.7/site-packages/easybuild_framework-3.6.0-py2.7.egg/easybuild/framework/easyblock.py", line 2698, in build_and_install_one
    result = app.run_all_steps(run_test_cases=run_test_cases)
  File "/software/eb/software/EasyBuild/3.6.0/lib/python2.7/site-packages/easybuild_framework-3.6.0-py2.7.egg/easybuild/framework/easyblock.py", line 2614, in run_all_steps
    self.run_step(step_name, step_methods)
  File "/software/eb/software/EasyBuild/3.6.0/lib/python2.7/site-packages/easybuild_framework-3.6.0-py2.7.egg/easybuild/framework/easyblock.py", line 2489, in run_step
    step_method(self)()
  File "/software/eb/software/EasyBuild/3.6.0/lib/python2.7/site-packages/easybuild_easyblocks-3.6.0-py2.7.egg/easybuild/easyblocks/p/pgi.py", line 134, in install_step
    for line in fileinput.input(filename, inplace='1', backup='.orig'):
  File "/usr/lib64/python2.7/fileinput.py", line 253, in next
    line = self.readline()
  File "/usr/lib64/python2.7/fileinput.py", line 322, in readline
    os.rename(self._filename, self._backupfilename)
OSError: [Errno 2] No such file or directory
boegel commented 6 years ago

@cstackpole Looks like the PGI easyblock is trying to patch a file that isn't there in the community edition? See https://github.com/easybuilders/easybuild-easyblocks/blob/master/easybuild/easyblocks/p/pgi.py#L131

We can probably enhance the PGI easyblock to auto-detect the community edition so you don't need to hack around to get it installed...

I think @wpoely86 has looked at this too?

vanzod commented 6 years ago

I successfully installed the Community Edition compiler with the easyblock that has been merged from #6323 which looks identical to yours.

cstackpole commented 6 years ago

Confirmed @vanzod. Thanks! The only thing that I had to do with that file was point it to the license file that I pulled out of the tar.gz file. It doesn't appear this is an issue anymore with that merged file! Whooo! Thank you. [EDIT for future people who stumble on this. Here is the file that worked for me.

@boegel, if EB could be expanded to look at the license file path first before erroring out on the license file, that would be awesome. It fails on the configuring step so at that point it has access to the file. Or maybe there is a way to set the "PGROUPD_LICENSE_FILE" environment variable to be relative to the path of the expanded files?

Should I open another ticket for that feature request or just leave this one open?

Thanks guys!!

wpoely86 commented 6 years ago

Well, for the community edition you don't need to worry about the license file but it will stop working in 1 year (that's what I understood from it).

I quickly patched the easyblock to work fine with a license being specified. You don't need to extract it from the tarball, it works just fine without it.

Maybe add a flag for Community edition to ignore any license stuff?

cstackpole commented 6 years ago

From my understanding, it doesn't use the flexlm license manager but it still has a license file that is provided. I, however, don't know how critical that license file is. Only that it is provided.

boegel commented 6 years ago

@wpoely86 Where's the PR for what you had to change in the PGI easyblock to make the community edition work? ;-)

BTW, it seems like the download of the community edition and the "pro" edition is exactly the same (same checksum)...

boegel commented 6 years ago

PGI easyblock updated in https://github.com/easybuilders/easybuild-easyblocks/pull/1427