From 937d46ab4e16cfdb4d8e7e2bd2d8f2b3d72a5ae6 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Mon, 26 Oct 2020 11:18:26 +1300 Subject: [PATCH] Add checks for RegistryCI AutoMerge (#362) --- Project.toml | 2 +- deps/build.jl | 9 ++++++++- src/Gurobi.jl | 12 ++++++++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Project.toml b/Project.toml index 1a5f09f5..ade95a01 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Gurobi" uuid = "2e9cd046-0924-5485-92f1-d5272153d98b" repo = "https://github.com/jump-dev/Gurobi.jl" -version = "0.9.1" +version = "0.9.2" [deps] CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82" diff --git a/deps/build.jl b/deps/build.jl index 92c28a3f..6e079924 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -71,6 +71,8 @@ function _print_GUROBI_HOME_help() Pkg.add("Gurobi") Pkg.build("Gurobi") ``` + **Note: your path may differ. Check which folder you installed the Gurobi + binary in, and update the path accordingly.** """) end @@ -85,6 +87,7 @@ function diagnose_gurobi_install() println(""" Did you download and install one of these versions from gurobi.com? + Installing Gurobi.jl via the Julia package manager is _not_ sufficient! """) if haskey(ENV, "GUROBI_HOME") dir = joinpath(ENV["GUROBI_HOME"], Sys.isunix() ? "lib" : "bin") @@ -148,7 +151,11 @@ function diagnose_gurobi_install() end end -if !found && !haskey(ENV, "GUROBI_JL_SKIP_LIB_CHECK") +if haskey(ENV, "GUROBI_JL_SKIP_LIB_CHECK") + # Skip! +elseif get(ENV, "JULIA_REGISTRYCI_AUTOMERGE", "false") == "true" + write_depsfile("julia_registryci_automerge") +elseif !found diagnose_gurobi_install() error(""" Unable to locate Gurobi installation. If the advice above did not help, diff --git a/src/Gurobi.jl b/src/Gurobi.jl index c1b41b3c..acdb7efe 100644 --- a/src/Gurobi.jl +++ b/src/Gurobi.jl @@ -16,10 +16,14 @@ include("gen/ctypes.jl") include("gen/libgrb_common.jl") include("gen/libgrb_api.jl") -const _GUROBI_VERSION = let - majorP, minorP, technicalP = Ref{Cint}(), Ref{Cint}(), Ref{Cint}() - GRBversion(majorP, minorP, technicalP) - VersionNumber("$(majorP[]).$(minorP[]).$(technicalP[])") +const _GUROBI_VERSION = if libgurobi == "julia_registryci_automerge" + VersionNumber(9, 0, 0) +else + let + majorP, minorP, technicalP = Ref{Cint}(), Ref{Cint}(), Ref{Cint}() + GRBversion(majorP, minorP, technicalP) + VersionNumber("$(majorP[]).$(minorP[]).$(technicalP[])") + end end if !(v"9.0.0" <= _GUROBI_VERSION < v"9.1")