sellout / cl-glpk

Common Lisp interface to GLPK (GNU Linear Programming Kit). This is a fork of Kai Kaminski’s original (http://common-lisp.net/project/cl-glpk/).
6 stars 5 forks source link

error in ffi access #2

Open bvraghav opened 6 years ago

bvraghav commented 6 years ago

I try to load sample.lisp and exec (sample-high-level) but get the following error:

The alien function "_glp_lpx_create_prob" is undefined.
   [Condition of type SB-KERNEL::UNDEFINED-ALIEN-FUNCTION-ERROR]

Restarts:
 0: [RETRY] Retry SLIME REPL evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {10020D7F93}>)

Backtrace:
  0: ("undefined function")
  1: [error printing frame]
  2: ((LAMBDA (SB-PCL::|.P0.| SB-PCL::|.P1.| SB-PCL::|.P2.| SB-PCL::|.P3.|)) #<unavailable argument> #<unavailable argument> #<unavailable argument> #<unavailable argument>)
  3: (SB-INT:SIMPLE-EVAL-IN-LEXENV (CL-GLPK:MAKE-LINEAR-PROGRAM :MAXIMIZE (+ (* 10 X1) (* 6 X2) (* 4 X3)) :SUBJECT-TO ((<= # 100) (<= # 600) (<= # 300)) :BOUNDS ...) #<NULL-LEXENV>)
  4: (EVAL (CL-GLPK:MAKE-LINEAR-PROGRAM :MAXIMIZE (+ (* 10 X1) (* 6 X2) (* 4 X3)) :SUBJECT-TO ((<= # 100) (<= # 600) (<= # 300)) :BOUNDS ...))
 --more--

I checked if libglpk.so is installed and accessible... So here it is:

glpk /usr/
glpk /usr/bin/
glpk /usr/bin/glpsol
glpk /usr/include/
glpk /usr/include/glpk.h
glpk /usr/lib/
glpk /usr/lib/libglpk.so
glpk /usr/lib/libglpk.so.40
glpk /usr/lib/libglpk.so.40.3.0
glpk /usr/share/
glpk /usr/share/doc/
glpk /usr/share/doc/glpk/
glpk /usr/share/doc/glpk/glpk.pdf
glpk /usr/share/doc/glpk/gmpl.pdf

Please suggest

phikal commented 4 years ago

I can confirm the same error. Any hints on how to debug this?

phikal commented 4 years ago

I managed to fix it, at least on my system (Debian 10), by changing changing every instance of _glp_lpx_ with glp_. I'm not sure, bit it seems the API changed some 16-13 years ago, so it might be worth changing that here too.