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 May 29, 2023
1 parent 8a3404b commit c1b241a
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 @@ -12,7 +12,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@v2
Expand Down
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,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 @@ -45,14 +45,8 @@ function _minizinc_exe(f::F) where {F}
else
return f(joinpath(user_dir, "minizinc"))
end
elseif Sys.islinux() || Sys.isapple()
return MiniZinc_jll.minizinc(f)
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 MiniZinc_jll.minizinc(f)
end

function _run_minizinc(dest::Optimizer)
Expand Down

0 comments on commit c1b241a

Please sign in to comment.