In this case we have the line: modtclfooter = 'prepend-path LM_LICENSE_FILE "[email protected]:[email protected]"' in our eb file
On 11 February 2016 at 12:57, Alan O'Cais <[email protected]<mailto:[email protected]>> wrote: Hi Joachim, We have the same situation and hacked around this. You can create a modified easyblock that skips the licence file txt check and set the environment variable for you. Below is the hack, it's not robust enough for the main repo yet though. To use it add '--include-easyblocks=/path/to/pgi.py' to your command line. Alan import os import fileinput import re import sys from easybuild.framework.easyblock import EasyBlock from easybuild.tools.build_log import EasyBuildError from easybuild.tools.run import run_cmd class EB_PGI(EasyBlock): """ Support for installing the PGI compilers """ def __init__(self, *args, **kwargs): """Easyblock constructor, define custom class variables specific to PGI.""" super(EB_PGI, self).__init__(*args, **kwargs) if not self.cfg['license_file']: self.cfg['license_file'] = 'UNKNOWN' self.install_subdir = os.path.join('linux86-64', self.version) def configure_step(self): """ Dummy configure method, just a license check """ #if not os.path.exists(self.cfg['license_file']): # raise EasyBuildError("Non-existing license file specified: %s", self.cfg['license_file']) def build_step(self): """ Dummy build method: nothing to build """ pass def install_step(self): """Install by running install command.""" pgi_env_vars = { 'PGI_ACCEPT_EULA': 'accept', 'PGI_INSTALL_AMD': 'true', 'PGI_INSTALL_DIR': self.installdir, 'PGI_INSTALL_JAVA': 'true', 'PGI_INSTALL_MANAGED': 'true', 'PGI_INSTALL_NVIDIA': 'true', 'PGI_SILENT': 'true', } cmd = "%s ./install" % ' '.join(['%s=%s' % x for x in sorted(pgi_env_vars.items())]) run_cmd(cmd, log_all=True, simple=True) # make sure localrc uses GCC in PATH, not always the system GCC, and does not use a system g77 but gfortran install_abs_subdir = os.path.join(self.installdir, self.install_subdir) filename = os.path.join(install_abs_subdir, "bin", "makelocalrc") for line in fileinput.input(filename, inplace='1', backup='.orig'): line = re.sub(r"^PATH=/", r"#PATH=/", line) sys.stdout.write(line) cmd = "%s -x %s -g77 /" % (filename, install_abs_subdir) run_cmd(cmd, log_all=True, simple=True) def sanity_check_step(self): """Custom sanity check for PGI""" prefix = self.install_subdir custom_paths = { 'files': [os.path.join(prefix, "bin", "pgcc")], 'dirs': [os.path.join(prefix, "bin"), os.path.join(prefix, "lib"), os.path.join(prefix, "include"), os.path.join(prefix, "man")] } super(EB_PGI, self).sanity_check_step(custom_paths=custom_paths) def make_module_req_guess(self): """Prefix subdirectories in PGI install directory considered for environment variables defined in module file.""" dirs = super(EB_PGI, self).make_module_req_guess() for key in dirs: dirs[key] = [os.path.join(self.install_subdir, d) for d in dirs[key]] return dirs def make_module_extra(self): """Add environment variables LM_LICENSE_FILE and PGI for license file and PGI location""" txt = super(EB_PGI, self).make_module_extra() if self.cfg['license_file'] != 'UNKNOWN': txt += self.module_generator.prepend_paths('LM_LICENSE_FILE', [self.cfg['license_file']], allow_abs=True) txt += self.module_generator.set_environment('PGI', self.installdir) return txt On 11 February 2016 at 12:14, Joachim Hein <[email protected]<mailto:[email protected]>> wrote: Hi, We just build a PGI compiler using PGI-15.10-GCC-4.9.3-2.25.eb and had some fun with the license handling. We use flexlm and set an env-variable (LM_LICENSE_FILE). The icc easyconfigs can handle this, the PGI config does not. In the end we created a dummy licences file (EasyBuild seems only to check for the existence) and modified the module file for what we need. So we can now continue. Using an export [email protected]<mailto:[email protected]> type statement did not make things build. It does for the icc. When comparing the easy-configs (PGI and ICC) I didn’t notice the obvious difference, so that should be in the easyblock. I am wondering whether some with better expertise on those could have a look and “upgrade” the PGI. Best wishes Joachim -- Dr. Alan O'Cais Application Support Juelich Supercomputing Centre Forschungszentrum Juelich GmbH 52425 Juelich, Germany Phone: +49 2461 61 5213<tel:%2B49%202461%2061%205213> Fax: +49 2461 61 6656<tel:%2B49%202461%2061%206656> E-mail: [email protected]<mailto:[email protected]> WWW: http://www.fz-juelich.de/ias/jsc/EN -- Dr. Alan O'Cais Application Support Juelich Supercomputing Centre Forschungszentrum Juelich GmbH 52425 Juelich, Germany Phone: +49 2461 61 5213 Fax: +49 2461 61 6656 E-mail: [email protected]<mailto:[email protected]> WWW: http://www.fz-juelich.de/ias/jsc/EN ------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------ Forschungszentrum Juelich GmbH 52425 Juelich Sitz der Gesellschaft: Juelich Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498 Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender), Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt, Prof. Dr. Sebastian M. Schmidt ------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------

