Easyblock for Gurobi#962
Conversation
| lic_path = os.path.join(self.installdir, 'gurobi.lic') | ||
| try: | ||
| shutil.copy2(self.cfg['license_file'], lic_path) | ||
| except OSError, err: |
There was a problem hiding this comment.
style nitpicking (slowly looking forward to making things Py3 compatible): please use except OSError as err
|
@bedroge this looks pretty good, but it should include the license header like we have in other easyblocks, please add it? |
|
@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? ;-) |
|
@bedroge what did not like the |
|
@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) |
|
@bedroge did the |
|
@boegel Yes, tried it with that line and then it worked fine. :) |
| """No configuration for Gurobi.""" | ||
| # ensure a license file is specified | ||
| if self.cfg['license_file'] is None: | ||
| raise EasyBuildError("No license file specified.") |
There was a problem hiding this comment.
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'
|
tested with easybuilders/easybuild-easyconfigs#3239, looks great, so going in, thanks @bedroge! |
No description provided.