Skip to content

Commit

Permalink
Move minizinc installation instruction in "known issues" (#438)
Browse files Browse the repository at this point in the history
Minizinc is not mandatory anymore so should not be the first thing
people see in installation instructions.
We let it in the known issues to ease its installation for people
needing it.
  • Loading branch information
nhuet authored Oct 25, 2024
1 parent 017ce4c commit 85e5c49
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 67 deletions.
6 changes: 0 additions & 6 deletions docs/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ This guide is organized as follows:

## Setting up your development environment

### Prerequisite: minizinc (optional)

If you plan to use wrapped [discrete-optimization](https://github.com/airbus/discrete-optimization) solvers based on [minizinc](https://www.minizinc.org/),
you need first to install minizinc binary (version greater than 2.8) and update the `PATH` environment variable
so that it can be found by Python. See [minizinc documentation](https://www.minizinc.org/doc-latest/en/installation.html) for more details.

### Installing from source in developer mode

> **Disclaimer**: The following process has only been tested on Linux/MacOS platforms.
Expand Down
121 changes: 60 additions & 61 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,6 @@

## Prerequisites

### Minizinc 2.8+ (Optional)

If you plan to use the solver for scheduling domains `DOSolver`
that wraps [discrete-optimization](https://github.com/airbus/discrete-optimization) solvers,
keep in mind that some of them are based on [minizinc](https://www.minizinc.org/).
In that case, you may need to install minizinc binary (version greater than 2.8) and update the `PATH` environment variable
so that it can be found by Python. See [minizinc documentation](https://www.minizinc.org/doc-latest/en/installation.html) for more details.

::: tip
You can easily install minizinc from the command line, which can be useful when on cloud.
In order to make life easier to cloud users, we reproduce below the necessary lines. Please be careful that this
is not an official documentation for minizinc and that the following lines can stop working without notice
as we do not test them automatically.
:::

#### Linux command line
On a Linux distribution, you can use the bundled [minizinc AppImage](https://www.minizinc.org/doc-latest/en/installation.html#appimage).

If [FUSE](https://en.wikipedia.org/wiki/Filesystem_in_Userspace) is available:
```
mkdir minizinc_install
curl -o minizinc_install/minizinc -L https://github.com/MiniZinc/MiniZincIDE/releases/download/2.8.5/MiniZincIDE-2.8.5-x86_64.AppImage
chmod +x minizinc_install/minizinc
export PATH="$(pwd)/minizinc_install/":$PATH
minizinc --version
```
Else, this is still possible by extracting the files:
```
mkdir minizinc_install
cd minizinc_install
curl -o minizinc.AppImage -L https://github.com/MiniZinc/MiniZincIDE/releases/download/2.8.5/MiniZincIDE-2.8.5-x86_64.AppImage
chmod +x minizinc.AppImage
./minizinc.AppImage --appimage-extract
cd ..
export LD_LIBRARY_PATH="$(pwd)/minizinc_install/squashfs-root/usr/lib/":$LD_LIBRARY_PATH
export PATH="$(pwd)/minizinc_install/squashfs-root/usr/bin/":$PATH
minizinc --version
```

#### MacOs command line
```
mkdir minizinc_install
curl -o minizinc.dmg -L https://github.com/MiniZinc/MiniZincIDE/releases/download/2.8.5/MiniZincIDE-2.8.5-bundled.dmg
hdiutil attach minizinc.dmg
cp -R /Volumes/MiniZinc*/MiniZincIDE.app minizinc_install/.
export PATH="$(pwd)/minizinc_install/MiniZincIDE.app/Contents/Resources":$PATH
minizinc --version
```

#### Windows command line
Works on Windows Server 2022 with bash shell:
```
mkdir minizinc_install
curl -o minizinc_setup.exe -L https://github.com/MiniZinc/MiniZincIDE/releases/download/2.8.5/MiniZincIDE-2.8.5-bundled-setup-win64.exe
cmd //c "minizinc_setup.exe /verysilent /currentuser /norestart /suppressmsgboxes /sp"
export PATH="~/AppData/Local/Programs/MiniZinc":$PATH
minizinc --version
```


### Python 3.9+ environment

The use of a virtual environment for scikit-decide is recommended, and you will need to ensure that the environment use a Python version greater than 3.9.
Expand Down Expand Up @@ -115,7 +55,7 @@ pip install -U scikit-decide

## Known issues

### pygrib
### Pygrib

When installing [pygrib](https://jswhit.github.io/pygrib/index.html) on MacOS ARM (in dependencies of `scikit-decide[all]`),
no wheel exists on PyPI and there is issues when pip tries to build it.
Expand All @@ -129,3 +69,62 @@ If the issue persists, you can try to install the pygrib package available on co
```shell
conda install -c conda-forge pygrib
```

### Minizinc

If you plan to use the solver for scheduling domains `DOSolver`
that wraps [discrete-optimization](https://github.com/airbus/discrete-optimization) solvers,
keep in mind that some of them are based on [minizinc](https://www.minizinc.org/).
In that case, you may need to install minizinc binary (version greater than 2.8) and update the `PATH` environment variable
so that it can be found by Python. See [minizinc documentation](https://www.minizinc.org/doc-latest/en/installation.html) for more details.

::: tip
You can easily install minizinc from the command line, which can be useful when on cloud.
In order to make life easier to cloud users, we reproduce below the necessary lines. Please be careful that this
is not an official documentation for minizinc and that the following lines can stop working without notice
as we do not test them automatically.
:::

#### Linux command line
On a Linux distribution, you can use the bundled [minizinc AppImage](https://www.minizinc.org/doc-latest/en/installation.html#appimage).

If [FUSE](https://en.wikipedia.org/wiki/Filesystem_in_Userspace) is available:
```
mkdir minizinc_install
curl -o minizinc_install/minizinc -L https://github.com/MiniZinc/MiniZincIDE/releases/download/2.8.5/MiniZincIDE-2.8.5-x86_64.AppImage
chmod +x minizinc_install/minizinc
export PATH="$(pwd)/minizinc_install/":$PATH
minizinc --version
```
Else, this is still possible by extracting the files:
```
mkdir minizinc_install
cd minizinc_install
curl -o minizinc.AppImage -L https://github.com/MiniZinc/MiniZincIDE/releases/download/2.8.5/MiniZincIDE-2.8.5-x86_64.AppImage
chmod +x minizinc.AppImage
./minizinc.AppImage --appimage-extract
cd ..
export LD_LIBRARY_PATH="$(pwd)/minizinc_install/squashfs-root/usr/lib/":$LD_LIBRARY_PATH
export PATH="$(pwd)/minizinc_install/squashfs-root/usr/bin/":$PATH
minizinc --version
```

#### MacOs command line
```
mkdir minizinc_install
curl -o minizinc.dmg -L https://github.com/MiniZinc/MiniZincIDE/releases/download/2.8.5/MiniZincIDE-2.8.5-bundled.dmg
hdiutil attach minizinc.dmg
cp -R /Volumes/MiniZinc*/MiniZincIDE.app minizinc_install/.
export PATH="$(pwd)/minizinc_install/MiniZincIDE.app/Contents/Resources":$PATH
minizinc --version
```

#### Windows command line
Works on Windows Server 2022 with bash shell:
```
mkdir minizinc_install
curl -o minizinc_setup.exe -L https://github.com/MiniZinc/MiniZincIDE/releases/download/2.8.5/MiniZincIDE-2.8.5-bundled-setup-win64.exe
cmd //c "minizinc_setup.exe /verysilent /currentuser /norestart /suppressmsgboxes /sp"
export PATH="~/AppData/Local/Programs/MiniZinc":$PATH
minizinc --version
```

0 comments on commit 85e5c49

Please sign in to comment.