Skip to content

Commit

Permalink
gurobi: add versions 11 and 12 (spack#47889)
Browse files Browse the repository at this point in the history
This also means removing the Python support for these versions,
as the installation method was deprecated in favor of pip/conda
  • Loading branch information
upsj authored Dec 10, 2024
1 parent f3c6f00 commit 449a462
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion var/spack/repos/builtin/packages/gurobi/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class Gurobi(Package):
homepage = "https://www.gurobi.com"
manual_download = True

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

extends("python")
depends_on("python@2.7,3.6:")
depends_on("python@2.7,3.6:", when="@:10")
depends_on("python@3.8:", when="@11")
depends_on("python@3.9:", when="@12")

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

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

# the Python package installation was deprecated after version 10,
# to be superseded by pip/conda installs
@when("@:10")
@run_after("install")
def gurobipy(self):
with working_dir("linux64"):
Expand Down

0 comments on commit 449a462

Please sign in to comment.