Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use setup.py if Gurobi v >= 11.0.0 #3160

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion easybuild/easyblocks/g/gurobi.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from easybuild.tools.filetools import copy_file
from easybuild.tools.modules import get_software_root
from easybuild.tools.run import run_cmd
from easybuild.tools import LooseVersion


class EB_Gurobi(Tarball):
Expand Down Expand Up @@ -76,7 +77,14 @@ def install_step(self):
copy_file(self.orig_license_file, self.license_file)

if get_software_root('Python'):
run_cmd("python setup.py install --prefix=%s" % self.installdir)
# Python component installation method changed in v11.0.0 to use pip install
if LooseVersion(self.version) < LooseVersion('11.0.0'):
run_cmd('python setup.py install --prefix=%s' % self.installdir)
else:
run_cmd(
'python -m pip install --find-links=%s --no-index --no-deps --ignore-installed \
Copy link
Member

Choose a reason for hiding this comment

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

Although this will work, the (big) downside of this approach is that this will make pip download the gurobipy wheel from PyPI, rather than letting EasyBuild download (and cache it).

I took a different approach in #3225 + easybuilders/easybuild-easyconfigs#19838, by simply disabling the use of setup.py, and installing gurobipy as an extension to Gurobi, which leaves EasyBuild in control of the downloading from PyPI...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, that is indeed a much better solution. Feel free and close this and PR easybuilders/easybuild-easyconfigs#19838, or just ping me and I'll add a note and close them 👍

--no-build-isolation --prefix=%s gurobipy' % (self.builddir, self.installdir)
)

def sanity_check_step(self):
"""Custom sanity check for Gurobi."""
Expand Down
Loading