Skip to content

Commit b26d747

Browse files
Initial commit
0 parents  commit b26d747

17 files changed

+8135
-0
lines changed

.gitignore

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# project specific
2+
*~
3+
*.swp
4+
*.swo
5+
build/
6+
dist/
7+
include
8+
lib
9+
src/pyscipopt/*.c
10+
src/pyscipopt/*.cpp
11+
__pycache__
12+
.cache
13+
scripts/
14+
15+
# Byte-compiled / optimized / DLL files
16+
__pycache__/
17+
*.py[cod]
18+
*$py.class
19+
20+
# C extensions
21+
*.so
22+
23+
# Distribution / packaging
24+
.Python
25+
build/
26+
develop-eggs/
27+
dist/
28+
downloads/
29+
eggs/
30+
.eggs/
31+
lib/
32+
lib64/
33+
parts/
34+
sdist/
35+
var/
36+
wheels/
37+
*.egg-info/
38+
.installed.cfg
39+
*.egg
40+
MANIFEST
41+
42+
# PyInstaller
43+
# Usually these files are written by a python script from a template
44+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
45+
*.manifest
46+
*.spec
47+
48+
# Installer logs
49+
pip-log.txt
50+
pip-delete-this-directory.txt
51+
52+
# Unit test / coverage reports
53+
htmlcov/
54+
.tox/
55+
.coverage
56+
.coverage.*
57+
.cache
58+
nosetests.xml
59+
coverage.xml
60+
*.cover
61+
.hypothesis/
62+
63+
# Translations
64+
*.mo
65+
*.pot
66+
67+
# Django stuff:
68+
*.log
69+
.static_storage/
70+
.media/
71+
local_settings.py
72+
73+
# Flask stuff:
74+
instance/
75+
.webassets-cache
76+
77+
# Scrapy stuff:
78+
.scrapy
79+
80+
# Sphinx documentation
81+
docs/_build/
82+
83+
# PyBuilder
84+
target/
85+
86+
# Jupyter Notebook
87+
.ipynb_checkpoints
88+
89+
# pyenv
90+
.python-version
91+
92+
# celery beat schedule file
93+
celerybeat-schedule
94+
95+
# SageMath parsed files
96+
*.sage.py
97+
98+
# Environments
99+
.env
100+
.venv
101+
env/
102+
venv/
103+
venv3/
104+
ENV/
105+
env.bak/
106+
venv.bak/
107+
108+
# Spyder project settings
109+
.spyderproject
110+
.spyproject
111+
112+
# Rope project settings
113+
.ropeproject
114+
115+
# mkdocs documentation
116+
/site
117+
118+
# mypy
119+
.mypy_cache/
120+
121+
# pytest
122+
.pytest_cache/
123+
124+
# model (for tests)
125+
model
126+
model.cip
127+
model.lp
128+
129+
# VSCode
130+
.vscode/
131+
.devcontainer/
132+
133+
# documentation
134+
docs/html
135+
docs/*.tag

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# CHANGELOG
2+
3+
## Unreleased
4+
### Added
5+
### Fixed
6+
### Changed
7+
### Removed

INSTALL.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
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.

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
PyGCGOpt
2+
=========
3+
4+
This project provides an interface from Python to the [GCG Solver](https://gcg.or.rwth-aachen.de/).
5+
6+
Documentation
7+
-------------
8+
9+
See [CHANGELOG.md](CHANGELOG.md) for added, removed or fixed functionality.
10+
11+
Installation
12+
------------
13+
14+
**Using PyPI and from Source**
15+
16+
See [INSTALL.md](INSTALL.md) for instructions.
17+
Please note that the latest PyGCGOpt version is usually only compatible with the latest major release of the SCIP Optimization Suite and the GCG Solver.
18+
Information which version of PyGCGOpt is required for a given GCG version can also be found in [INSTALL.md](INSTALL.md).
19+

0 commit comments

Comments
 (0)