Comments (8)
from python-mip.
Thanks for providing the instructions.
I tried them and it failed because it could not link to libquadmath. Looks like its not supported on arm platforms yet - https://packages.debian.org/buster/libquadmath0
I modified the buildCBCLinux.sh locally by passing --disable-libquadmath option to the configure script. Lets see if it works.
Update: Unfortunately it didn't work.
from python-mip.
Hi
Spend sometime looking into this. I had to make 2 changes and I was able to compile. Since libquadmath
is not available on Pi I had to remove it from linking. Here is the final bash script
if [ ! -d "Cbc" ];
then
echo "call this script in the CBC source directory"
exit
fi
if [ ! -f "configure" ];
then
echo "call this script in the CBC source directory"
exit
fi
export CFLAGS="-Ofast -fPIC -flto -DNDEBUG -fprefetch-loop-arrays -I/opt/gcc/include/"
export FFLAGS="-Ofast -fPIC -flto -DNDEBUG -I/opt/gcc/include/"
export CXXFLAGS="-Ofast -fPIC -flto -DNDEBUG -I/opt/gcc/include/"
export LDFLAGS="-Ofast -fPIC -L/opt/gcc/lib -flto -static-libgcc -static-libstdc++ -static-libgfortran"
./configure --enable-cbc-parallel --enable-static --disable-shared --disable-libquadmath
make clean
make -j 1
g++ -shared -Ofast -fPIC -o cbc-c-linux-x86-64.so \
-I~/prog/include/ -I./CoinUtils/src/ -I./Osi/src/ -I./Clp/src/ -I./Clp/src/ \
-I./Cgl/src/ -I./Cbc/src/ -I./Osi/src/Osi/ -I./Clp/src/OsiClp/ -DCBC_THREAD \
./Cbc/src/Cbc_C_Interface.cpp -L/opt/gcc/lib64/ -L./Cbc/src/.libs/ -L./Cgl/src/.libs/ \
-L./Cgl/src/.libs/ -L./Osi/src/Osi/.libs/ -L./Clp/src/OsiClp/.libs/ -L./Clp/src/.libs/ \
-L./CoinUtils/src/.libs/ -L./Cgl/src/.libs/ -L./Clp/src/OsiClp/.libs/ -L./Clp/src/.libs/ \
-L./ThirdParty/Lapack/.libs/ -L./ThirdParty/Blas/.libs/ \
-lCbcSolver -lCbc -lpthread -lrt -lCgl -lOsiClp -lClpSolver -lClp -lOsi -lCoinUtils \
-lcoinlapack -lcoinblas -lgfortran -lm -static-libgcc -static-libstdc++ -static-libgfortran
I have attached the produced binary file.
But I think it still does not work. Because when I do a = ffi.dlopen("/tmp/cbc-c-linux-x86-64.so")
with the generated file it produces the following error -
OSError: cannot load library '/tmp/cbc-c-linux-x86-64.so': /tmp/cbc-c-linux-x86-64.so: undefined symbol: BZ2_bzWriteClose. Additionally, ctypes.util.find_library() did not manage to locate a library called '/tmp/cbc-c-linux-x86-64.so'
from python-mip.
Looking for all undefined symbols looks like there are a lot of them
nm /tmp/cbc-c-linux-x86-64.so | grep 'U '
yields
U BZ2_bzRead
U BZ2_bzReadClose
U BZ2_bzReadOpen
U BZ2_bzWrite
U BZ2_bzWriteClose
U BZ2_bzWriteOpen
U _gfortran_stop_string@@GFORTRAN_8
U _gfortran_string_len_trim@@GFORTRAN_8
U _gfortran_st_write_done@@GFORTRAN_8
U _gfortran_st_write@@GFORTRAN_8
U _gfortran_transfer_character_write@@GFORTRAN_8
U _gfortran_transfer_integer_write@@GFORTRAN_8
U gzclose
U gzopen
U gzread
U gzwrite
from python-mip.
It worked!!! Just needed to add bz2
as a library
g++ -shared -Ofast -fPIC -o cbc-c-linux-x86-64.so \
-I~/prog/include/ -I./CoinUtils/src/ -I./Osi/src/ -I./Clp/src/ -I./Clp/src/ \
-I./Cgl/src/ -I./Cbc/src/ -I./Osi/src/Osi/ -I./Clp/src/OsiClp/ -DCBC_THREAD \
./Cbc/src/Cbc_C_Interface.cpp -L/opt/gcc/lib64/ -L./Cbc/src/.libs/ -L./Cgl/src/.libs/ \
-L./Cgl/src/.libs/ -L./Osi/src/Osi/.libs/ -L./Clp/src/OsiClp/.libs/ -L./Clp/src/.libs/ \
-L./CoinUtils/src/.libs/ -L./Cgl/src/.libs/ -L./Clp/src/OsiClp/.libs/ -L./Clp/src/.libs/ \
-L./ThirdParty/Lapack/.libs/ -L./ThirdParty/Blas/.libs/ \
-lCbcSolver -lCbc -lpthread -lrt -lCgl -lOsiClp -lClpSolver -lClp -lOsi -lCoinUtils -lbz2 \
-lcoinlapack -lcoinblas -lgfortran -lm -static-libgcc -static-libstdc++ -static-libgfortran
Here is the .so file which loads in python.
cbc-c-linux-x86-64.so.zip
from python-mip.
from python-mip.
just added this to the TODO list of the project, I'll remove as an issue for now
from python-mip.
I was installing mip on a raspberry pi, but it is still not working "out of the box"
I have build the binary by myself from https://github.com/coin-or /
Cbc
And with a softlink to the builded binary the mip library works fine.
But I want to use it in Appdaemon of Home Assistant and that docker image doesn't allow me to install binaries.
Is it possible to get this to work with an arm-binary?
from python-mip.
Related Issues (20)
- Incorrect n-Queens Constraints? HOT 1
- Output search tree HOT 1
- Confusing Behaviour with disposing of Gurobi Environment HOT 1
- Incorrect file extension when call write() with CBC solver HOT 1
- Explicitly provide supported versions of Cbc HOT 2
- Passing Solver explicitly causes UnboundLocalError
- [1.15.0] Tests fail: ImportError: cannot import name '__version__' from 'mip._version' (/usr/ports/math/py-mip/work-py39/mip-1.15.0/mip/_version.py) HOT 1
- More verbose errors? HOT 3
- still logging when verbose=0 (on a recent version of CBC)
- Support Python 3.12
- Add py.typed marker HOT 1
- Infeasibility Issue in Python-MIP When Incrementing an Integer Constant HOT 2
- `add_constr` returns broken object when adding constraint without variables HOT 3
- help support mac arm HOT 2
- Constraint creation is not symmetric for combination variable and tensor
- Highs with python-mip is slow HOT 3
- how to get all or more solutions?
- Python 3.12 HOT 4
- upper bound not reported correctly in CBC Progress Callback
- Log output not displayed in Jupyter Notebook
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-mip.