0

I have compiled scip with:

$ IPOPT=true make SHARED=true scipoptlib

It has compiled successfully and I run python setup.py install of the python interface. However, when I run from pyscipopt.scip import Model in Python, I get the following error message:

ImportError: scip-3.2.1/interfaces/python/lib/libscipopt.so: undefined symbol: _ZTIN5Ipopt7JournalE
Jason
  • 2,278
  • 2
  • 17
  • 25
Florence
  • 29
  • 6
  • and for some reason when i read a problem in scip from zimpl, it still shows Quadratic constraint handler does not have LAPACK for eigenvalue computation. Why can't I optimize thru the LAPACK library even if I have already compiled with IPOPT? – Florence Mar 21 '16 at 04:09
  • My ultimate questions is how do I use lapack through IPOPT with the scip python interface – Florence Mar 21 '16 at 06:59
  • By the way, the correct importing command is ```from pyscipopt import Model```. – mattmilten Mar 21 '16 at 12:44

1 Answers1

0

You need to adapt the setup.py to also include Ipopt as library to link to.

It's close to the end of the file and is called libraries in the definition of the Cython extension.

mattmilten
  • 6,242
  • 3
  • 35
  • 65
  • Hi,I adapted accordingly but the same error msg popped upt. I adapted two places of the setup.py file. if usesharedlib: libraries=['readline', 'z', 'gmp', 'ncurses', 'm','Ipopt'])] and after the else: libraries=['readline', 'z', 'gmp', 'ncurses', 'm','Ipopt'])] Did I edited it correctly? – Florence Mar 21 '16 at 08:19
  • I recompiled scip with IPOPT and adapted setup.py(i added 'ipopt' in libraries). When I run python setup.py install this time, I got the error message /usr/bin/ld: cannot find -lipopt Collect2:error: ld returned 1 exit status error:command 'gcc' failed with exit status 1 – Florence Mar 21 '16 at 10:30
  • You might want to do a build of the scip executable with VERBOSE=true to check which linker flags are used to link against Ipopt. Very similar ones should be passed through to the linker call in the python setup.py. In general, it would probably be nicer if the "scipoptlib" would already have its depencies recorded, so the Python interface setup doesn't have to guess. – stefan Mar 21 '16 at 12:43
  • Please verify that ```setup.py``` was executed correctly. Also, please remove ```pyscipopt/scip.c``` to force the interface to be built from scratch. – mattmilten Mar 21 '16 at 12:47
  • Thank you very much for the replies! How do I make sure that scipoptlib has all its dependencies included? When I build, I used $make IPOPT=true SHARED=true scipoptlib. And added the soft link, what else do I need to do? – Florence Mar 21 '16 at 13:47
  • The scipoptlib does NOT have its dependencies included. That's why you need to specify them again in the ```setup.py``` – mattmilten Mar 21 '16 at 14:09
  • You may run ```ldd``` on the library to see its dependencies. – mattmilten Mar 21 '16 at 14:21
  • Finally got it working! I added the path to my libipopt.so in library_dirs of setup.py. Thank you very much! – Florence Mar 22 '16 at 05:22