Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Windows #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading