Skip to content

Commit

Permalink
Merge pull request #294 from odow/od/windows
Browse files Browse the repository at this point in the history
Update README with clarified Windows instructions
  • Loading branch information
matbesancon authored Sep 30, 2024
2 parents a4e0830 + 0079ba8 commit 3622f0f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 22 deletions.
48 changes: 26 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,40 @@ licensed under the [Apache 2.0 license](https://github.com/scipopt/scip/blob/mas

## Installation

Install SCIP.jl using `Pkg.add`:
**SCIP cannot be installed automatically on Windows. See the "Custom installation"
instructions below.**

Install SCIP using `Pkg.add`:
```julia
import Pkg
Pkg.add("SCIP")
julia> import Pkg

julia> Pkg.add("SCIP")
```

On MacOS and Linux, installing the SCIP Julia package will work out of the box
and install the [`SCIP_jll.jl`](https://github.com/JuliaBinaryWrappers/SCIP_jll.jl) and
[`SCIP_PaPILO_jll.jl`](https://github.com/JuliaBinaryWrappers/SCIP_PaPILO_jll.jl)
dependencies.
On platforms other than Windows, in addition to installing the SCIP.jl package,
this will also download and install the SCIP binaries. You do not need to
install SCIP separately.

On Windows, a separate installation of SCIP is still mandatory, as detailed in
the "Custom installation" section below.
## Windows and custom installations

## Custom installations
If you use Windows, or you want a custom SCIP installation, you must manually
install the SCIP binaries.

If you use an older Julia version, Windows, or you want a custom SCIP
installation, you must manually install the SCIP binaries.
Binaries are available for download at [https://www.scipopt.org/#download](https://www.scipopt.org/#download).

Once installed, set the `SCIPOPTDIR` environment variable to point to the
installation path, that is, depending on your operating system,
Once the binaries are installed, set the `SCIPOPTDIR` environment variable to
temporarily point to the installation path (that is, depending on your operating system,
`$SCIPOPTDIR/lib/libscip.so`, `$SCIPOPTDIR/lib/libscip.dylib`, or
`$SCIPOPTDIR/bin/scip.dll` must exist.

Then, install `SCIP.jl` using `Pkg.add` and `Pkg.build`:
`$SCIPOPTDIR/bin/libscip.dll` must exist). Then, install `SCIP.jl` using `Pkg.add`
and `Pkg.build` from the Julia command line:
```julia
ENV["SCIPOPTDIR"] = "/Users/Oscar/code/SCIP"
import Pkg
Pkg.add("SCIP")
Pkg.build("SCIP")
julia> ENV["SCIPOPTDIR"] = raw"C:\Program Files\SCIPOptSuite 9.1.1" # for Windows

julia> import Pkg

julia> Pkg.add("SCIP")

julia> Pkg.build("SCIP")
```

## Use with JuMP
Expand Down Expand Up @@ -112,7 +116,7 @@ List of supported model attributes:

All of the public API methods are wrapped and available within the `SCIP`
package. This includes the `scip_*.h` and `pub_*.h` headers that are collected
in `scip.h`, as well as all default constraint handlers (`cons_*.h`.)
in `scip.h`, as well as all default constraint handlers (`cons_*.h`.)

The wrapped functions do not transform any data structures and work on the *raw*
pointers (for example, `SCIP*` in C, `Ptr{SCIP_}` in Julia). Convenience wrapper
Expand Down
5 changes: 5 additions & 0 deletions src/init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ if isfile(depsjl_path)
# User-provided SCIP library
include(depsjl_path)
else
if Sys.iswindows()
@warn(
"SCIP_jll still doesn't work with Windows, segfaults are likely! See the README for instructions on how to manually install SCIP."
)
end
# Artifact from BinaryBuilder package
import SCIP_PaPILO_jll
if SCIP_PaPILO_jll.is_available()
Expand Down

0 comments on commit 3622f0f

Please sign in to comment.