Skip to content

Commit

Permalink
Skip precompile on aarch64-darwin (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Dec 29, 2024
1 parent 8f51920 commit 639f148
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
49 changes: 27 additions & 22 deletions src/Clp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

2 comments on commit 639f148

@odow
Copy link
Member Author

@odow odow commented on 639f148 Dec 29, 2024

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/122143

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.2.2 -m "<description of version>" 639f14893c4caa09424ccee7b6a28aa8f172e70c
git push origin v1.2.2

Please sign in to comment.