Skip to content

Commit

Permalink
Merge pull request #3044 from Micket/20231129171637_new_pr_comsol
Browse files Browse the repository at this point in the history
also consider `$EB_COMSOL_LICENSE_FILE` environment variable in custom easyblock for COMSOL
  • Loading branch information
boegel authored Dec 29, 2023
2 parents 8b569c0 + e3bbe0b commit 6cd454a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions easybuild/easyblocks/c/comsol.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,22 @@ def extract_step(self):
def configure_step(self):
"""Configure COMSOL installation: create license file."""

default_lic_env_var = 'LMCOMSOL_LICENSE_FILE'
lic_specs, self.license_env_var = find_flexlm_license(custom_env_vars=[default_lic_env_var],
comsol_lic_env_vars = ['EB_COMSOL_LICENSE_FILE', 'LMCOMSOL_LICENSE_FILE']
lic_specs, self.license_env_var = find_flexlm_license(custom_env_vars=comsol_lic_env_vars,
lic_specs=[self.cfg['license_file']])

if lic_specs:
if self.license_env_var is None:
self.log.info("Using COMSOL license specifications from 'license_file': %s", lic_specs)
self.license_env_var = default_lic_env_var
self.license_env_var = comsol_lic_env_vars[0]
else:
self.log.info("Using COMSOL license specifications from $%s: %s", self.license_env_var, lic_specs)

self.license_file = os.pathsep.join(lic_specs)
env.setvar(self.license_env_var, self.license_file)
else:
msg = "No viable license specifications found; "
msg += "specify 'license_file', or define $%s" % default_lic_env_var
msg += "specify 'license_file', or define %s" % (', '.join('$%s' % x for x in comsol_lic_env_vars))
raise EasyBuildError(msg)

copy_file(os.path.join(self.start_dir, 'setupconfig.ini'), self.configfile)
Expand Down

0 comments on commit 6cd454a

Please sign in to comment.