Skip to content

Commit

Permalink
Add support for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Jul 17, 2024
1 parent 8c7a7d3 commit 871342b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
version: ['1.6', '1'] # Test against LTS and current minor release
os: [ubuntu-latest, macOS-latest] # MiniZinc_jll broken on windows-latest
os: [ubuntu-latest, macOS-latest, windows-latest]
arch: [x64]
steps:
- uses: actions/checkout@v4
Expand Down
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,8 @@ import Pkg
Pkg.add("MiniZinc")
```

**Windows**

On Linux and macOS, this package automatically installs `libminizinc`. However,
we're still working out problems with the install on Windows. To use
MiniZinc.jl, you'll need to manually install a copy of `libminizinc` from
[minizinc.org](https://www.minizinc.org) or compile one yourself from
[MiniZinc/libminizinc](https://github.com/MiniZinc/libminizinc).

To teach MiniZinc.jl where to look for `libminizinc`, set the
`JULIA_LIBMINIZINC_DIR` environment variable. For example:
To use a custom install of MiniZinc, set the `JULIA_LIBMINIZINC_DIR` environment
variable. For example:
```julia
ENV["JULIA_LIBMINIZINC_DIR"] = "C:\\Program Files\\MiniZinc"
```
Expand Down
8 changes: 1 addition & 7 deletions src/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,8 @@ function _minizinc_exe(f::F) where {F}
else
return f(joinpath(user_dir, "minizinc"))
end
elseif Sys.islinux() || Sys.isapple()
return f(MiniZinc_jll.minizinc())
end
return error(
"Unable to call libminizinc. Please manually install a copy and set " *
"the `JULIA_LIBMINIZINC_DIR` environment variable. See the README.md " *
"for more details",
)
return f(MiniZinc_jll.minizinc())
end

function _run_minizinc(dest::Optimizer)
Expand Down

0 comments on commit 871342b

Please sign in to comment.