Skip to content

Commit 449a462

Browse files
authored
gurobi: add versions 11 and 12 (spack#47889)
This also means removing the Python support for these versions, as the installation method was deprecated in favor of pip/conda
1 parent f3c6f00 commit 449a462

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

var/spack/repos/builtin/packages/gurobi/package.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ class Gurobi(Package):
2323
homepage = "https://www.gurobi.com"
2424
manual_download = True
2525

26+
version("12.0.0", sha256="a2bdc9c1d6bf8eb4e551a184af1ce8d7b0435ea8e7d19a017cc7d53fd5efda12")
27+
version("11.0.3", sha256="82a2c8671c234bbaa9dc64da22b1951abf41c62047fdf77004e65f24a91dfd13")
2628
version("10.0.0", sha256="91a9ce1464f5f948809fcdfbdeb55f77698ed8a6d6cfa6985295424b6ece2bd4")
2729
version("9.5.2", sha256="95d8ca18b7f86116ba834a27fd6228c5b1708ae67927e7ea0e954c09374a2d0f")
2830
version("9.5.1", sha256="fa82859d33f08fb8aeb9da66b0fbd91718ed573c534f571aa52372c9deb891da")
@@ -36,7 +38,9 @@ class Gurobi(Package):
3638
license_url = "http://www.gurobi.com/downloads/download-center"
3739

3840
extends("python")
39-
depends_on("[email protected],3.6:")
41+
depends_on("[email protected],3.6:", when="@:10")
42+
depends_on("[email protected]:", when="@11")
43+
depends_on("[email protected]:", when="@12")
4044

4145
def url_for_version(self, version):
4246
return "file://{0}/gurobi{1}_linux64.tar.gz".format(os.getcwd(), version)
@@ -50,10 +54,14 @@ def patch(self):
5054
def setup_run_environment(self, env):
5155
env.set("GUROBI_HOME", self.prefix)
5256
env.set("GRB_LICENSE_FILE", join_path(self.prefix, "gurobi.lic"))
57+
env.prepend_path("LD_LIBRARY_PATH", self.prefix.lib),
5358

5459
def install(self, spec, prefix):
5560
install_tree("linux64", prefix)
5661

62+
# the Python package installation was deprecated after version 10,
63+
# to be superseded by pip/conda installs
64+
@when("@:10")
5765
@run_after("install")
5866
def gurobipy(self):
5967
with working_dir("linux64"):

0 commit comments

Comments
 (0)