coin-or / CyLP

A Python interface to CLP, CBC, and CGL to solve LPs and MIPs.
Other
182 stars 69 forks source link

Build error relating to gfortran #53

Closed waldstein1983 closed 5 years ago

waldstein1983 commented 7 years ago

Dears, I encounter an error when build Cylp at its root directory by using "python setup.py install":

9801a7b319bb:CyLP baohuaw$ python setup.py install /usr/local/lib/python2.7/site-packages/setuptools/dist.py:332: UserWarning: Normalizing '0.7.4 ' to '0.7.4' normalized_version, running install cylp/cy/CyClpDualRowPivotBase.cpp: if (std::isspace(ts)) cylp/cy/CyDualPivotPythonBase.cpp: if (std::isspace(ts)) cylp/cy/CyPEPivot.cpp: std::isspace(Py_CHARMASK(s[len-1])) && cylp/cy/CyTest.cpp: std::isspace(Py_CHARMASK(s[len-1])) && running build running build_py running build_ext building 'cylp.cy.CyClpPrimalColumnPivotBase' extension clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I./cylp/cpp -I./cylp/cy -I/Users/baohuaw/OpenSouce/Cbc-2.9/include/coin -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I. -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c cylp/cpp/IClpPrimalColumnPivotBase.cpp -o build/temp.macosx-10.11-x86_64-2.7/cylp/cpp/IClpPrimalColumnPivotBase.o -w clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I./cylp/cpp -I./cylp/cy -I/Users/baohuaw/OpenSouce/Cbc-2.9/include/coin -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I. -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c cylp/cy/CyClpPrimalColumnPivotBase.cpp -o build/temp.macosx-10.11-x86_64-2.7/cylp/cy/CyClpPrimalColumnPivotBase.o -w clang++ -bundle -undefined dynamic_lookup build/temp.macosx-10.11-x86_64-2.7/cylp/cpp/IClpPrimalColumnPivotBase.o build/temp.macosx-10.11-x86_64-2.7/cylp/cy/CyClpPrimalColumnPivotBase.o -L. -L./cylp/cy -L/Users/baohuaw/OpenSouce/Cbc-2.9/lib -L./cylp/cy -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -lCbcSolver -lCbc -lCgl -lOsiClp -lClpSolver -lClp -lcoinasl -lm -ldl -lcoinmumps -lgfortran -lSystem -lquadmath -lm -lcoinmetis -lOsi -lCoinUtils -lbz2 -lz -lm -lcoinglpk -ldl -lm -lgmp -o build/lib.macosx-10.11-x86_64-2.7/cylp/cy/CyClpPrimalColumnPivotBase.so -Wl,-framework -Wl,Accelerate -headerpad_max_install_names ld: library not found for -lgfortran clang: error: linker command failed with exit code 1 (use -v to see invocation) error: command 'clang++' failed with exit status 1

Can anybody help me? Thanks.

tkralphs commented 5 years ago

I take it that you are on OS X? How are you installing Cbc? This error looks to be because you built Cbc with MUMPS (presumably by running get.Mumps before configuring Cbc). Mumps is written in Fortran, which introduces a dependency on the Fortran library. I'm not actually too sure how to get that library into the library search path when building a Python extension. Building without MUMPS is the easiest unless you really need that for some reason. I'm going to close this for now, but feel free to open if you are still having problems and still want to resolve this.