From 871342bd8afd0ccbe090b945ea1be0d633a6da92 Mon Sep 17 00:00:00 2001 From: odow Date: Mon, 29 May 2023 21:10:29 +1200 Subject: [PATCH] Add support for Windows --- .github/workflows/ci.yml | 2 +- README.md | 12 ++---------- src/optimize.jl | 8 +------- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8eed4f5..c2d4f72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/README.md b/README.md index a25c1ef..4159d02 100644 --- a/README.md +++ b/README.md @@ -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" ``` diff --git a/src/optimize.jl b/src/optimize.jl index e8da0b5..fde6876 100644 --- a/src/optimize.jl +++ b/src/optimize.jl @@ -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)