diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a11c89001e6795250d8af67ec9fe65fcd08b4862..488348391a2d9820e28acd61a1a335d21e5f120f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,7 +20,7 @@ variables: - cd .. && pwd - for FILE in patches/*.diff; do patch -p1 < $FILE; done # Compile python module - - python setup.py build_ext --swig="$SWIG" --swig-opts="-c++ -I./Cbc/include/coin/" -I./Cbc/include/coin/ -L./Cbc/lib/ + - python setup.py build_ext --swig="$SWIG" --swig-opts="-doxygen -c++ -I./Cbc/include/coin/" -I./Cbc/include/coin/ -L./Cbc/lib/ # Build package - python -m pip install wheel --upgrade - python setup.py bdist_wheel diff --git a/README.md b/README.md index 52a3202bb3acd25c919322eb667d72c3bae17ab3..379143d4975314eee5d049e3b6668b2b24b16ddd 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,10 @@ Native Python interface for Coin-or Branch and Cut Solver ([Cbc](https://github. # Description -This project provide the build mechanism to automatically generate the wrapper code betweeb Cbc c++ code and python using [SWIG](http://www.swig.org/). - -# Build +This project provide the build mechanism to automatically generate the wrapper code between Cbc c++ code and python using [SWIG](http://www.swig.org/). This project was develop as part of the CBC Coin-or Sprint Aug 2019. -# Installation - -Python packages are deployed to [cbcpy Pypi repositories](https://pypi.org/cbcpy). - Binaries for the following platform are pre-compiled: * linux x86_64 / python 2.7 * linux x86_64 / python 3.5 @@ -21,10 +15,35 @@ Binaries for the following platform are pre-compiled: * linux x86_64 / python 3.7 * win32 / python 2.7 +**Linux i386 is not supported.** + +NOTICE Adding more platform is in progress. + +# Installation + +## Linux + +Install Cbc binaries from bintray: https://bintray.com/coin-or/download/Cbc/2.10.3 + + cd /tmp + wget https://bintray.com/coin-or/download/download_file?file_path=Cbc-2.10.3-linux-x86_64-gcc4.8.tgz -O Cbc-2.10.3-linux-x86_64-gcc4.8.tgz + tar -zxvf Cbc-2.10.3-linux-x86_64-gcc4.8.tgz + cp -R bin include lib share /usr/local/ + ldconfig + +Python packages are deployed to [cbcpy Pypi repositories](https://pypi.org/cbcpy). To install `cbcpy` you should make use of `pip` command line: pip install cbcpy +## Windows + +On Windows, the binaries as statically build. So you don't need to install Cbc. + +To install `cbcpy` you should make use of `pip` command line: + + pip install cbcpy + # Usage Here a minimalistic python script making use of `cbcpy`. @@ -42,4 +61,15 @@ You may download `p0033.mps` from [here](https://raw.githubusercontent.com/coin- for i in range(numberColumns): value = solution[i] print("%s has value %s" % (i, value)) + +# Documentation + +Original documentation from Cbc project is available in python using the `help()` function. + # python + Python 2.7.16 (default, Jul 13 2019, 16:01:51) + [GCC 8.3.0] on linux2 + Type "help", "copyright", "credits" or "license" for more information. + >>> import cbcpy + >>> help(cbcpy) + Help on module cbcpy: