diff --git a/Project.toml b/Project.toml index 23ef693..00e15ea 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Clp" uuid = "e2554f3b-3117-50c0-817c-e040a3ddf72d" repo = "https://github.com/jump-dev/Clp.jl.git" -version = "1.2.1" +version = "1.2.2" [deps] Clp_jll = "06985876-5285-5a41-9fcb-8948a742cc53" diff --git a/src/Clp.jl b/src/Clp.jl index b109496..14bc944 100644 --- a/src/Clp.jl +++ b/src/Clp.jl @@ -50,29 +50,34 @@ end import PrecompileTools -PrecompileTools.@setup_workload begin - PrecompileTools.@compile_workload begin - let - model = MOI.Utilities.CachingOptimizer( - MOI.Utilities.UniversalFallback(MOI.Utilities.Model{Float64}()), - MOI.instantiate(Clp.Optimizer; with_bridge_type = Float64), - ) - MOI.set(model, MOI.Silent(), true) - x = MOI.add_variables(model, 3) - sets = (MOI.GreaterThan(0.0), MOI.LessThan(2.0), MOI.EqualTo(1.0)) - for i in 1:3, f in (x[i], 1.0 * x[1] + 2.0 * x[2]) - MOI.supports_constraint(model, typeof(f), typeof(sets[i])) - MOI.add_constraint(model, f, sets[i]) +@static if !(Sys.isapple() && Sys.ARCH == :aarch64) + PrecompileTools.@setup_workload begin + PrecompileTools.@compile_workload begin + let + model = MOI.Utilities.CachingOptimizer( + MOI.Utilities.UniversalFallback( + MOI.Utilities.Model{Float64}(), + ), + MOI.instantiate(Clp.Optimizer; with_bridge_type = Float64), + ) + MOI.set(model, MOI.Silent(), true) + x = MOI.add_variables(model, 3) + sets = + (MOI.GreaterThan(0.0), MOI.LessThan(2.0), MOI.EqualTo(1.0)) + for i in 1:3, f in (x[i], 1.0 * x[1] + 2.0 * x[2]) + MOI.supports_constraint(model, typeof(f), typeof(sets[i])) + MOI.add_constraint(model, f, sets[i]) + end + f = 1.0 * x[1] + x[2] + x[3] + MOI.set(model, MOI.ObjectiveSense(), MOI.MAX_SENSE) + MOI.supports(model, MOI.ObjectiveFunction{typeof(f)}()) + MOI.set(model, MOI.ObjectiveFunction{typeof(f)}(), f) + MOI.optimize!(model) + MOI.get(model, MOI.TerminationStatus()) + MOI.get(model, MOI.PrimalStatus()) + MOI.get(model, MOI.DualStatus()) + MOI.get(model, MOI.VariablePrimal(), x) end - f = 1.0 * x[1] + x[2] + x[3] - MOI.set(model, MOI.ObjectiveSense(), MOI.MAX_SENSE) - MOI.supports(model, MOI.ObjectiveFunction{typeof(f)}()) - MOI.set(model, MOI.ObjectiveFunction{typeof(f)}(), f) - MOI.optimize!(model) - MOI.get(model, MOI.TerminationStatus()) - MOI.get(model, MOI.PrimalStatus()) - MOI.get(model, MOI.DualStatus()) - MOI.get(model, MOI.VariablePrimal(), x) end end end