Search code examples
linear-programmingampllpsolve

AMPL IDE: unable to use lpsolve


I downloaded and extracted amplide-demo-linux64.tar.gz to /opt/amplide/.

Then I downloaded lp_solve_5.5.2.0_exe_ux32.tar.gz and extracted file lpsolve to /opt/amplide/ampl/.

And I have liblpsolve55.so under directory suggested on AMPL page:

kjrz@kjrz-tsh ~ $ ll /usr/lib/lp_solve/
total 604
drwxr-xr-x   2 root root   4096 Jun 24  2014 .
drwxr-xr-x 185 root root  20480 Jan 14 11:11 ..
-rw-r--r--   1 root root 590168 Dec 23  2013 liblpsolve55.so

This is what happens:

ampl: option solver lpsolve; 
ampl: model owd.mod;
ampl: data owd.dat;
ampl: solve;
lpsolve: error while loading shared libraries: liblpsolve55.so: cannot open shared object file: No such file or directory
exit code 127
<BREAK>

How is that?


Solution

  • You should put (a link to) the liblpsolve55.so somewhere on the library search paths, for example /usr/lib:

    $ sudo ln -s /usr/lib/lp_solve/liblpsolve55.so /usr/lib
    

    Also make sure that you have 32-bit (x86) version of liblpsolve55.so installed. For example, on 64-bit Ubuntu you can install 32-bit version of liblpsolve55.so as follows:

    $ sudo apt-get install lp-solve:i386