简体   繁体   中英

Linking SCIP to existing project

I've been trying to use SCIP in a personal project. I managed to compile the scipoptsuite-3.2.1 fine (even if the resulting folder is in my Download folder, because I'm a slob), but I can't seem to make it work.

I work on Eclipse CDT, I could link the headers just fine, the functions are recognized but I have undefined references all over the place. When I try to link scip's library (libscip.a) however, I have the following error :

/usr/bin/ld: /home/myusername/Downloads/scipoptsuite-3.2.1/scip-3.2.1/lib/libscip.a(fileio.o): undefined reference to symbol 'gzdopen'
//lib/x86_64-linux-gnu/libz.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Segmentation_2D] Error 1

To solve that, I added the command -lz but .. That doesn't work either.

  • If I link as such : -lscip -lz -> Compilation starts going in an infinite loop
  • If I link as such : -lz -lscip -> DOS missing
  • If I link as such : -lz -lscip -lz -> Compilation starts going in an infinite loop

I just don't know what to try next, any help would be appreciated.

Thanks

EDIT -

I have now redone the installation using the flags ZLIB=false, READLINE=false and ZIMPL=false. I also used the command INSTALLDIR="" to correctly place the libraries, headers and binaries in my system (I had to edit the Makefile to do that since it would originally link to ../thePath, with thePath="/usr/local", for example).

However, it still doesn't work. What I thought was a infinite loop is in fact a massive number of errors (13.000+) which seem to be unresolved call of every function. (I only compile with -lscip now).

What can I do now ?

Unfortunately, libscip is not the correct library for your application. You should rather use libscipopt from within the lib/ directory of the SCIP Optimization Suite (run make scipoptlib ).

libscip only contains pure SCIP code and will only work together with

  • liblpi{spx,cpx,...} to have an LP solver
  • libnlpi to have an NLP solver
  • libobjscip for C++ support

libscipopt is supposed to combine all these libraries into one for easier usage.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM