I’d successfully built and run HiGHS/AMPL and I’m trying to do the same with CBC.
Cbc has been installed using the Gentoo Linux packaging system and I did so with the “static-libs” USE flag. That let me craft this cmake invocation from within ~/mp/build-cbcmp (I have build-highsmp right next door)
cmake .. -DBUILD=cbcmp -DCBC_INCLUDE_DIRS=/usr/include/coin -DCBC_LIBS=/usr/lib64/libCbc.so.3.10.5
After that, “cmake --build .” almost made it do the end, but then it did this:
[ 98%] Linking CXX shared library ../bin/libcbcmp-lib.so
cd /home/me/mp/build-cbcmp/solvers && /usr/bin/cmake -E cmake_link_script CMakeFiles/cbcmp-lib.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -Wall -Wextra -pedantic -march=native -O3 -flto -O3 -DNDEBUG -shared -Wl,-soname,libcbcmp-lib.so -o ../bin/libcbcmp-lib.so CMakeFiles/cbcmp-lib.dir/cbcmp/cbcmp-lib.c.o CMakeFiles/cbcmp-lib.dir/__/src/solver.cc.o ../lib/libamplcbcmp-static.a /usr/lib64/libCbc.so.3.10.5 ../lib/libmp.a /usr/lib64/librt.a
[100%] Linking CXX executable ../bin/cbcmp
cd /home/me/mp/build-cbcmp/solvers && /usr/bin/cmake -E cmake_link_script CMakeFiles/cbcmp.dir/link.txt --verbose=1
/usr/bin/c++ -Wall -Wextra -pedantic -march=native -O3 -flto -O3 -DNDEBUG -rdynamic CMakeFiles/cbcmp.dir/cbcmp/main.cc.o -o ../bin/cbcmp ../lib/libamplcbcmp-static.a /usr/lib64/libCbc.so.3.10.5 ../lib/libmp.a /usr/lib64/librt.a
/home/me/mp/include/mp/backend-std.h: In member function ‘get’:
/home/me/mp/include/mp/backend-std.h:579:14: warning: ‘v’ may be used uninitialized [-Wmaybe-uninitialized]
579 | return v;
| ^
/home/me/mp/include/mp/backend-std.h:577:13: note: ‘v’ was declared here
577 | Value v;
| ^
/home/me/mp/include/mp/backend-std.h: In member function ‘get’:
/home/me/mp/include/mp/backend-std.h:579:14: warning: ‘v’ may be used uninitialized [-Wmaybe-uninitialized]
579 | return v;
| ^
/home/me/mp/include/mp/backend-std.h:577:13: note: ‘v’ was declared here
577 | Value v;
| ^
gmake[2]: Leaving directory '/home/me/mp/build-cbcmp'
[100%] Built target cbcmp-lib
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/ccMyfemr.ltrans1.ltrans.o: undefined reference to symbol '_ZN13CbcOrClpParamD1Ev'
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libClpSolver.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
gmake[2]: *** [solvers/CMakeFiles/cbcmp.dir/build.make:101: bin/cbcmp] Error 1
gmake[2]: Leaving directory '/home/me/mp/build-cbcmp'
gmake[1]: *** [CMakeFiles/Makefile2:1235: solvers/CMakeFiles/cbcmp.dir/all] Error 2
gmake[1]: Leaving directory '/home/me/mp/build-cbcmp'
gmake: *** [Makefile:146: all] Error 2
Any suggestions? “DSO missing from command line” is Greek to me.