|
| 1 | +Requirements |
| 2 | +============ |
| 3 | + |
| 4 | +PyGCGOpt requires a working installation of the [GCG Solver](https://gcg.or.rwth-aachen.de/). Please, make sure that your GCG installation works! |
| 5 | + |
| 6 | +Note that the latest PyGCGOpt version is usually only compatible with the latest major release of the SCIP Optimization Suite. |
| 7 | +The following table summarizes which versions of PyGCGOpt, GCG, PySCIPOpt, and SCIP are compatible: |
| 8 | + |
| 9 | +|SCIP| PySCIPOpt | GCG | PyGCGOpt |
| 10 | +|----|----|----|----| |
| 11 | +7.0 | 3.x | 3.1.x | 0.1.x | |
| 12 | +6.0 | 2.x | - | - | |
| 13 | +5.0 | 1.4, 1.3 | - | - | |
| 14 | +4.0 | 1.2, 1.1 | - | - | |
| 15 | +3.2 | 1.0 | - | - | |
| 16 | + |
| 17 | +If SCIP and GCG are not installed in the global path, |
| 18 | +you need to specify the install location using the environment variable |
| 19 | +`SCIPOPTDIR`: |
| 20 | + |
| 21 | +- on Linux and OS X:\ |
| 22 | + `export SCIPOPTDIR=<path_to_install_dir>` |
| 23 | +- on Windows:\ |
| 24 | + `set SCIPOPTDIR=<path_to_install_dir>` (**cmd**, **Cmder**, **WSL**)\ |
| 25 | + `$Env:SCIPOPTDIR = "<path_to_install_dir>"` (**powershell**) |
| 26 | + |
| 27 | +`SCIPOPTDIR` needs to have a subdirectory `lib` that contains the |
| 28 | +library, e.g. `libscip.so` and `libgcg.so` (for Linux) and a subdirectory `include` that |
| 29 | +contains the corresponding header files: |
| 30 | + |
| 31 | + SCIPOPTDIR |
| 32 | + > lib |
| 33 | + > libscip.so ... |
| 34 | + > libscip.so ... |
| 35 | + > include |
| 36 | + > scip |
| 37 | + > gcg |
| 38 | + > lpi |
| 39 | + > nlpi |
| 40 | + > ... |
| 41 | + |
| 42 | +If you are not using the installer packages, you need to [install GCG using CMake](https://gcg.or.rwth-aachen.de/dev/doc-3.1.0/install-manually.html). |
| 43 | +The Makefile system is not compatible with PyGCGOpt and PySCIPOpt! |
| 44 | + |
| 45 | +On Windows it is highly recommended to use the [Anaconda Python |
| 46 | +Platform](https://www.anaconda.com/). |
| 47 | + |
| 48 | +Installation from PyPI |
| 49 | +====================== |
| 50 | + |
| 51 | + python -m pip install pygcgopt |
| 52 | + |
| 53 | +On Windows you may need to ensure that the `scip` and `gcg` libraries can be found |
| 54 | +at runtime by adjusting your `PATH` environment variable: |
| 55 | + |
| 56 | +- on Windows: `set PATH=%PATH%;%SCIPOPTDIR%\bin` |
| 57 | + |
| 58 | +On Linux and OS X this is encoded in the generated PyGCGOpt library and |
| 59 | +therefore not necessary. |
| 60 | + |
| 61 | +Building everything from source |
| 62 | +=============================== |
| 63 | + |
| 64 | +Recommended is to install in a virtual environment (e.g. `python3 -m venv <DIR_PATH>`). |
| 65 | +Please note that a globally installed version of PyGCGOpt on your machine might lead to problems. |
| 66 | + |
| 67 | +After setting up and activating your virtual environment (`source <DIR_PATH>/bin/activate`) make sure you have [Cython](http://cython.org/) installed, at least version 0.21 |
| 68 | + |
| 69 | + pip install cython |
| 70 | + |
| 71 | +Note you will also need the `wheel` package, which usually is already installed: |
| 72 | + |
| 73 | + pip install wheel |
| 74 | + |
| 75 | +Furthermore, you need to have the Python |
| 76 | +development files installed on your system (error message "Python.h not |
| 77 | +found"): |
| 78 | + |
| 79 | + sudo apt-get install python-dev # for Python 2, on Linux |
| 80 | + sudo apt-get install python3-dev # for Python 3, on Linux |
| 81 | + |
| 82 | +After setting up `SCIPOPTDIR` as specified above install PyGCGOpt |
| 83 | + |
| 84 | + export SCIPOPTDIR=/path/to/scip/install/dir |
| 85 | + python -m pip install [-e] . |
| 86 | + |
| 87 | +For recompiling the source in the current directory `.` use |
| 88 | + |
| 89 | + python -m pip install --compile . |
| 90 | + |
| 91 | +Building with debug information |
| 92 | +=============================== |
| 93 | + |
| 94 | +To use debug information in PyGCGOpt you need to build it like this: |
| 95 | + |
| 96 | + python -m pip install --install-option="--debug" . |
| 97 | + |
| 98 | +Be aware that you will need the **debug library** of the SCIP |
| 99 | +Optimization Suite for this to work |
| 100 | +(`cmake .. -DCMAKE_BUILD_TYPE=Debug`). |
| 101 | + |
| 102 | +Testing new installation |
| 103 | +======================== |
| 104 | + |
| 105 | +To test your brand-new installation of PyGCGOpt you need |
| 106 | +[pytest](https://pytest.org/) on your system. |
| 107 | + |
| 108 | + pip install pytest |
| 109 | + |
| 110 | +Here is the complete [installation |
| 111 | +procedure](https://docs.pytest.org/en/latest/getting-started.html). |
| 112 | + |
| 113 | +Tests can be run in the `PyGCGOpt` directory with: : |
| 114 | + |
| 115 | + py.test # all the available tests |
| 116 | + py.test tests/test_name.py # a specific tests/test_name.py (Unix) |
| 117 | + |
| 118 | +Ideally, the status of your tests must be passed or skipped. Running |
| 119 | +tests with pytest creates the `__pycache__` directory in `tests` and, |
| 120 | +occasionally, a `model` file in the working directory. They can be |
| 121 | +removed harmlessly. |
0 commit comments