Skip to content

Easyblock for Gurobi#962

Merged
boegel merged 7 commits intoeasybuilders:developfrom
rug-cit-hpc:gurobi
Jun 21, 2016
Merged

Easyblock for Gurobi#962
boegel merged 7 commits intoeasybuilders:developfrom
rug-cit-hpc:gurobi

Conversation

@bedroge
Copy link
Copy Markdown
Contributor

@bedroge bedroge commented Jun 21, 2016

No description provided.

Comment thread easybuild/easyblocks/g/gurobi.py Outdated
lic_path = os.path.join(self.installdir, 'gurobi.lic')
try:
shutil.copy2(self.cfg['license_file'], lic_path)
except OSError, err:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style nitpicking (slowly looking forward to making things Py3 compatible): please use except OSError as err

@boegel
Copy link
Copy Markdown
Member

boegel commented Jun 21, 2016

@bedroge this looks pretty good, but it should include the license header like we have in other easyblocks, please add it?

@boegel boegel added this to the v2.9.0 milestone Jun 21, 2016
@bedroge
Copy link
Copy Markdown
Contributor Author

bedroge commented Jun 21, 2016

@boegel I added the license header, but it did not accept the umlaut in my last name. Is it okay to use utf-8 encoding to solve this, or should I just change the ö to o or oe? ;-)

@boegel
Copy link
Copy Markdown
Member

boegel commented Jun 21, 2016

@bedroge what did not like the ö? eb?

@bedroge
Copy link
Copy Markdown
Contributor Author

bedroge commented Jun 21, 2016

@boegel yes, eb failed with the following error:

ERROR: Failed to process easyconfig /home/bob/easybuild/easybuild-easyconfigs/easybuild/easyconfigs/g/Gurobi/Gurobi-6.5.1.eb: Failed to obtain class for None easyblock (not available?): Non-ASCII character '\xc3' in file /home/bob/easybuild/easybuild-easyblocks/easybuild/easyblocks/g/gurobi.py on line 29, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (gurobi.py, line 28)

@boegel
Copy link
Copy Markdown
Member

boegel commented Jun 21, 2016

@bedroge did the # -*- coding: utf-8 -*- fix that problem for you? If so, fine by me.

@bedroge
Copy link
Copy Markdown
Contributor Author

bedroge commented Jun 21, 2016

@boegel Yes, tried it with that line and then it worked fine. :)

Comment thread easybuild/easyblocks/g/gurobi.py Outdated
"""No configuration for Gurobi."""
# ensure a license file is specified
if self.cfg['license_file'] is None:
raise EasyBuildError("No license file specified.")
Copy link
Copy Markdown
Member

@boegel boegel Jun 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if license_file is defined but points to a non-existing file, you get a nasty traceback like below, so maybe also check here whether the file exists?

if self.cfg['license_file'] is None or not os.path.exists(self.cfg['license_file']):
    raise EasyBuildError("No existing license file specified: %s", self.cfg['license_file'])
ERROR: Traceback (most recent call last):
  File "/user/scratchdelcatty/gent/gvo000/gvo00002/vsc40023/easybuild_easy_installed/lib/python2.6/site-packages/easybuild_framework-2.9.0.dev0-py2.6.egg/easybuild/main.py", line 114, in build_and_install_software
    (ec_res['success'], app_log, err) = build_and_install_one(ec, init_env)
  File "/user/scratch/gent/vsc400/vsc40023/easybuild_easy_installed/lib/python2.6/site-packages/easybuild_framework-2.9.0.dev0-py2.6.egg/easybuild/framework/easyblock.py", line 2358, in build_and_install_one
    result = app.run_all_steps(run_test_cases=run_test_cases)
  File "/user/scratch/gent/vsc400/vsc40023/easybuild_easy_installed/lib/python2.6/site-packages/easybuild_framework-2.9.0.dev0-py2.6.egg/easybuild/framework/easyblock.py", line 2274, in run_all_steps
    self.run_step(step_name, step_methods)
  File "/user/scratch/gent/vsc400/vsc40023/easybuild_easy_installed/lib/python2.6/site-packages/easybuild_framework-2.9.0.dev0-py2.6.egg/easybuild/framework/easyblock.py", line 2153, in run_step
    step_method(self)()
  File "/tmp/eb-X2qMnA/included-easyblocks/easybuild/easyblocks/gurobi.py", line 56, in install_step
    shutil.copy2(self.cfg['license_file'], lic_path)
  File "/usr/lib64/python2.6/shutil.py", line 95, in copy2
    copyfile(src, dst)
  File "/usr/lib64/python2.6/shutil.py", line 50, in copyfile
    with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: '/user/home/gent/vsc400/vsc40023/licenses/Gurobi/gurobi.lic'

@boegel
Copy link
Copy Markdown
Member

boegel commented Jun 21, 2016

tested with easybuilders/easybuild-easyconfigs#3239, looks great, so going in, thanks @bedroge!

@boegel boegel merged commit e27c0a0 into easybuilders:develop Jun 21, 2016
@bedroge bedroge deleted the gurobi branch June 22, 2016 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants