how to install lpsolve library for MATLAB on Ubuntu 12.04 64bit?

11 views (last 30 days)
I am trying to install this library for 3 hours.... first, for Python.. I gave up. Then for MATLAB...
I am still very confused, because the document barely says anything about how to install it.
Why is it so complicated? It is not like windows, in which for everything I want to install, double-clicking 'setup' or 'install' file on the .zip file installed everything I need.
I am so confused and distressed.. Please help me...
I do not know a bit about Ubuntu, so please explain to me which files I should download(there are a lot of files but I do not know what to download...), and how I could install it with what commands.
Thank you.

Answers (2)

Adriano Rezende
Adriano Rezende on 21 Mar 2018
Edited: Adriano Rezende on 21 Mar 2018
I am now trying to install this library in Matlab. But for python I got this solution some time ago:
-Installation guide for lpsolve with python -Linux Ubuntu 14.04
-Refference guide:
-First install some lpsolve librarries:
sudo apt-get install lp-solve lp-solve-doc
sudo apt-get install liblpsolve55-dev
-Paste the following line command on ~/.bashrc and save:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/lp_solve/
-Open another terminal or execute on the current terminal:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/lp_solve/
-Downloading files:
-Go to the page:
https://sourceforge.net/projects/lpsolve/files/lpsolve/5.5.0.15/
-Download the file that contain the files for lpsolve:
lp_solve_5.5.0.15_source.tar.gz
-Extract the files to obtain the folder:
lp_solve_5.5
-Go to the page:
https://sourceforge.net/projects/lpsolve/files/lpsolve/5.5.2.5/
-Download the file that contain the extras files for python:
lp_solve_5.5.2.5_Python_source.tar.gz
-Extract the files to obtain another folder with the same name:
lp_solve_5.5
-Go to the second folder lp_solve_5.5 and copy the files inside ./extra/Python to the first folder lp_solve_5.5
-In the first folder lp_solve_5.5 open the file setup.py
-Change the line:
libraries = ["lpsolve55"]
-To:
libraries = ["/usr/lib/lp_solve/lpsolve55"])
-Now, still in the ffirst folder lp_solve_5.5 run: (maybe use sudo, I dont remember)
python setup.py install
-Now you should be able to run a example. In the first folder lp_solve_5.5 run:
python example1.py
-You should see:
78.26
31.7827586207
[28.6, 0.0, 0.0, 31.82758620689655]
[92.3, 6.864, 391.29282758620695]

Adriano Rezende
Adriano Rezende on 23 Mar 2018
I got the solution for installing lpsolve on Matlab. I tested it in Ubuntu 14.04.
First, go to the the following address:
https://sourceforge.net/projects/lpsolve/files/lpsolve/5.5.2.0/
Download the files:
1 - lp_solve_5.5.2.0_dev_ux64.tar.gz
2 - lp_solve_5.5.2.0_MATLAB_exe_ux64.tar.gz
3 - lp_solve_5.5.2.0_MATLAB_source.tar.gz
Extract all of the contents of these archives into a folder "lpsolve_matlab". Archives 1 and 2 will give a bunch of files, while archive 3 should give you a folder named lp_solve_5.5 Copy the file liblpsolve55.so, which is now inside lpsolve_matlab, to /usr/lib and /usr/lib64
sudo cp .../lpsolve_matlab/liblpsolve55.so /usr/lib
sudo cp .../lpsolve_matlab/liblpsolve55.so /usr/lib64
Note: 1) Replace ... by the path of your lpsolve_matlab folder. 2) You will need permission to do that, thus, you can also run 'sudo nautilus' to copy the files
Now, copy the files inside your folder lpsolve_matlab into the folder lpsolve_matlab/lp_solve_5.5/extra/MATLAB/lpsolve. Note that a some files are repeated, do not worry, you can replace them.
Open MATLAB, go to the folder lpsolve and run Makefile.m:
cd .../lpsolve_matlab/lp_solve_5.5/extra/MATLAB/lpsolve/
Makefile
You should see:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Automatic compilation of Matlab MEX interface for lp_solve 5.5
We assume that lp_solve 5.5 is installed in: ../../..
If that is not correct path for lp_solve 5.5, modify this file accordingly.
*************************************************************
  • Old version of MEX lp_solve files will be overwritten !!! *
*************************************************************
Press any key to continue
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Then you press any key and you should see:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Compiling in progress. Please wait...
compiling...
Building with 'gcc'.
Warning: ...
MEX completed successfully.
linking...
Building with 'g++'.
Warning: ...
MEX completed successfully.
Compiling finished.
You can now run ex and lpdemo on matlab command line to test.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
You can also run the examples: example1.m, example2.m ...
This examples work because you are in the folder .../lpsolve_matlab/lp_solve_5.5/extra/MATLAB/lpsolve. If you want to add this folder permanently to matlab path type this in your matlab Command Window
addpath('.../lpsolve_matlab/lp_solve_5.5/extra/MATLAB/lpsolve')
savepath
References:

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!