0

I'm trying to set up MaxHS SAT solver from this git repo - https://github.com/fbacchus/MaxHS.

I get an error that says '/usr/bin/ld: cannot find -lcplex'. Can anyone guide me on what is lcplex library and how to fix this? My console looks like this..

install -d /mnt/c/Akhil/Abhyas/CQA/maxhs_installation/include/maxhs
install -d /mnt/c/Akhil/Abhyas/CQA/maxhs_installation/include/minisat
for dir in maxhs/core maxhs/ifaces maxhs/ds maxhs/utils; do \
install -d /mnt/c/Akhil/Abhyas/CQA/maxhs_installation/include/$dir ; \
done
for dir in minisat/mtl minisat/utils minisat/core minisat/simp; do \
install -d /mnt/c/Akhil/Abhyas/CQA/maxhs_installation/include/$dir ; \
done
for h in minisat/mtl/Alg.h minisat/mtl/Map.h minisat/mtl/Alloc.h 
minisat/mtl/Vec.h minisat/mtl/Rnd.h minisat/mtl/Sort.h minisat/mtl/IntMap.h 
minisat/mtl/Queue.h minisat/mtl/IntTypes.h minisat/mtl/Heap.h 
minisat/mtl/XAlloc.h minisat/core/SolverTypes.h minisat/core/Dimacs.h 
minisat/core/Solver.h minisat/utils/System.h minisat/utils/ParseUtils.h 
minisat/utils/Options.h minisat/simp/SimpSolver.h  ; do \
install -m 644 $h /mnt/c/Akhil/Abhyas/CQA/maxhs_installation/include/$h ; \
done
for h in maxhs/core/Bvars.h maxhs/core/Dimacs.h maxhs/core/MaxSolverTypes.h 
maxhs/core/Assumptions.h maxhs/core/Wcnf.h maxhs/core/MaxSolver.h 
maxhs/ifaces/miniSatSolver.h maxhs/ifaces/GreedySolver.h 
maxhs/ifaces/Cplex.h maxhs/ifaces/greedySatSolver.h maxhs/ifaces/muser.h 
maxhs/ifaces/SatSolver.h maxhs/ds/Packed.h maxhs/utils/io.h 
maxhs/utils/Params.h maxhs/utils/hash.h  ; do \
install -m 644 $h /mnt/c/Akhil/Abhyas/CQA/maxhs_installation/include/$h ; \
done
install -d /mnt/c/Akhil/Abhyas/CQA/maxhs_installation/lib
install -m 644 build/release/lib/libmaxhs.a 
/mnt/c/Akhil/Abhyas/CQA/maxhs_installation/lib
Linking Binary: build/release/bin/maxhs
/usr/bin/ld: cannot find -lcplex
collect2: error: ld returned 1 exit status
Makefile:155: recipe for target 'build/release/bin/maxhs' failed
make: *** [build/release/bin/maxhs] Error 1
Akhil Dixit
  • 125
  • 1
  • 2
  • 8
  • 3
    It's in the readme file. – n. m. could be an AI Oct 13 '17 at 04:49
  • As in the README, did you install CPLEX? Did you set the "required variable settings" (i.e., `LINUX_CPLEXLIBDIR` and `LINUX_CPLEXINCDIR` or `DARWIN_CPLEXLIBDIR` and `DARWIN_CPLEXINCDIR`)? As an aside, I could be wrong, but it looks like Windows is not supported. – rkersh Oct 13 '17 at 16:19

1 Answers1

0

Linking Binary: build/release/bin/maxhs /usr/bin/ld: cannot find -lcplex

This says that linker is unable to find libcplex.so

You need to give path of this library something like -L/pathtolibrary

Owais
  • 21
  • 1
  • 6
  • In the MaxHS README it says that it links with the static library, so the linker is actually looking for `libcplex.a`. – rkersh Oct 13 '17 at 16:08