[scilab-Users] Integration between LPSolve and Scilab

Michaël Baudin michael.baudin at scilab.org
Mon Jan 3 08:45:55 CET 2011


Hi,

As far as I know, the lpsolve interface is not available for Scilab 5.3. 
It is not available in ATOMS. A linear solver which is available in 
Scilab 5.3 is linpro, from the quapro module :

http://atoms.scilab.org/toolboxes/quapro

Is there a reason why you specifically need the lpsolve module ?

Best regards,

Michaël Baudin


Le 29/12/2010 23:52, Prof. Dr. Reinaldo Golmia Dante a écrit :
> Hi,
>
> I would like to know if someone can help me to integrate LPSOLVE with Scilab.
> Seems hard to do it into Scilab.
>
> I have Win7 home edition.
>
> What I did:
>
> First:
>
> I downloaded the file: lp_solve_5.5.2.0_IDE_Setup.exe  and ran it. I wanted
> to check if LPSOLVE is
> a good software and easy to use it.
>
> I tested a simple linear equation and it worked in LPSOLVE console ! Good signal
> !
>
> Second:
>
> I accessed the URL: http://lpsolve.sourceforge.net/5.5/ and read Quickstart. Wow
> ... it was so confused !!!!
>
> Then, I downloaded the file: lp_solve_5.5.2.0_scilab_exe_win32.zip  at URL:
> http://en.sourceforge.jp/projects/sfnet_lpsolve/downloads/lpsolve/5.5.2.0/lp_solve_5.5.2.0_scilab_exe_win32.zip/
>
>
> and unzipped it. The directory lp_solve contains three sub-directories bin,
> macros and man, and some files, as follows:
>   
> 12/29/2010 07:00 PM<DIR>  .
> 12/29/2010 07:00 PM<DIR>  ..
> 12/29/2010 07:00 PM<DIR>  bin
> 12/29/2010 07:00 PM 3,796 builder.sce
> 12/29/2010 07:00 PM 730 changes
> 12/29/2010 07:00 PM 3,699 ex.sce
> 12/29/2010 07:00 PM 974 example1.sce
> 12/29/2010 07:00 PM 837 example2.sce
> 12/29/2010 07:00 PM 296 example3.sce
> 12/29/2010 07:00 PM 258 example4.sce
> 12/29/2010 07:00 PM 279 example5.sce
> 12/29/2010 07:00 PM 527 example6.sce
> 12/29/2010 07:00 PM 916 loader.sce
> 12/29/2010 07:00 PM 2,682 lpdemo.sce
> 12/29/2010 07:00 PM<DIR>  macros
> 12/29/2010 07:00 PM<DIR>  man
> 12/29/2010 07:19 PM 2,127 README.txt
> 12/29/2010 07:00 PM 123,079 Scilab.htm
>
> I tried to read again the Quickstart at http://lpsolve.sourceforge.net/5.5/, but
> it really seems confused !
>
> I stopped here !!
>
> I copied it to this mail and wrote some comments (doubts), as follows:
>
> Quickstart
> Compile and build sclpsolve: ----------------------------
> 	1. Get the needed sources and libraries: Archive
> lp_solve_5.5.2.0_scilab_source.tar.gz contains the sources to build sclpsolve.
> Uncompress it to a directory, for example d:\lp_solve. Make sure that the folder
> structure is kept. It will create a directory structure
> lp_solve_5.5\extra\scilab\lpsolve in that folder.
>
>   
>   
> MY COMMENT: it is not the file that I downloaded, because my OS is Win7 home
> edition. Moreover,
> when I unzipped it, it does not create that directory structure:
> lp_solve_5.5\extra\scilab\lpsolve
> So, need I create it ???
>   
>   
>       Archive lp_solve_5.5.2.0_dev.zip (Windows) or lp_solve_5.5.2.0_dev.tar.gz
> (Unix) contains needed libraries and include files to link the sources with.
> Uncompress it to the same folder as for the sources, appended with lp_solve_5.5.
> In this example that would be d:\lp_solve\lp_solve_5.5
>   
>   
> MY COMMENT: I could not find the file lp_solve_5.5.2.0_dev.zip to download !!
>   
>   You have now all needed files in place. In your chosen directory (in this
> example d:\lp_solve) there will only be a directory lp_solve_5.5 In this
> directory, you have a directory extra and some files ending with .h and .lib The
> extra directory contains a scilab directory which contains a directory lpsolve
> with some files and directories. Under Windows, the lpsolve library
> lpsolve55.lib must be available in the lpsolve55 directory. However older
> version of scilab (<=3.0) require that this file is called lpsolve55.ilib In
> that case copy lpsolve55.lib to lpsolve55.ilib
>
> 	1.
> 	2.
> 	3. Under Windows, the Microsoft Visual C/C++ compiler must be installed and the
> environment variables must be active so that when a command prompt is opened,
> the cl and nmake commands can be executed. This can be done also by opening a
> command prompt and execute the batch file VCVARS32.BAT (somewhere on your
> system) and then starting scilab from that same command prompt.
>   
>   
> MY COMMENT: I am not sure if I have C/C++ compiler installed in my computer.
> Before I installed
> Mingw and it installed some C/C++ files and created a directory called gcc which
> contains:
>
> 12/20/2010 12:34 PM<DIR>  .
> 12/20/2010 12:34 PM<DIR>  ..
> 12/20/2010 12:33 PM<DIR>  bin
> 12/20/2010 12:33 PM<DIR>  i686-pc-mingw32
> 12/20/2010 12:34 PM<DIR>  include
> 12/20/2010 12:34 PM<DIR>  lib
> 12/20/2010 12:34 PM<DIR>  libexec
> 12/20/2010 12:34 PM<DIR>  manual
> 12/20/2010 12:34 PM<DIR>  share
>   
> How can I certify that C/C++ compiler is installed ? In case it is installed,
> what are cl and nmake
> commands ? How can I know if they work properly ? Moreover, what can I do with
> the file VCVARS32.BAT ?
>   
>   
> 	1. Start Scilab
> 	1.
> 	2. Check under Scilab that the current directory is the lpsolve directory. Use
> the Scilab pwd command to show the current directory. With the chdir command,
> you can change the current directory. This current directory must be
> lp_solve_5.5/extra/scilab/lpsolve example:
> chdir('d:/lp_solve/lp_solve_5.5/extra/scilab/lpsolve')
>   
>   
> MY COMMENT: when I type pwd in Scilab, the path is:
>   
> -->pwd
>   ans  =
>   
>   C:\Program Files (x86)\scilab-5.3.0 
>   
>   
> 	1. To compile and build sclpsolve, enter the following command in Scilab:
> -->exec builder.sce This should be done once to build the sclpsolve driver and
> to produce the file loader.sce. Load the sclpsolve driver in the Scilab memory
> space: -----------------------------------------------------
> 	1. Under Windows, make sure that the lpsolve55.dll file is somewhere in the
> path Under Unix/Linux, make sure that the liblpsolve55.so shared library is in
> /usr/lib or /lib so that Unix can find it. They are in archives
> lp_solve_5.5.2.0_dev.zip/lp_solve_5.5.2.0_dev.tar.gz and were installed in the
> lp_solve_5.5 directory of step 1 of the previous procedure.
>
> 	2. It is required that the sclpsolve driver is first build. That must be done
> only once. So if you haven't taken the steps yet to build the sclpsolve driver,
> then do this first as described previously in 'Compile and build sclpsolve'
>
> 	3. Start Scilab
> 	4. Check under Scilab that the current directory is the lpsolve directory. Use
> the Scilab pwd command to show the current directory. With the chdir command,
> you can change the current directory. This current directory must be
> lp_solve_5.5/extra/scilab/lpsolve example:
> chdir('/lp_solve/lp_solve_5.5/extra/scilab/lpsolve')
>
> 	5. Enter the following command in Scilab:    -->exec loader.sce
>   
>   
>   
> Therefore, I think the Quickstart is a little bit confused to understand !
> Could be better if we might transfer lp_solve directory to Scilab and type
> atomsInstall([...])
> like other modules !!!
>   
> If someone knows how to integrate LPSOLVE with Scilab, please give me some hints
> !!
>   
> Thank you in advance.
>   
> All best,
> Reinaldo.
>
>
>


-- 
Michaël Baudin
Ingénieur de développement
michael.baudin at scilab.org
-------------------------
Consortium Scilab - Digiteo
Domaine de Voluceau - Rocquencourt
B.P. 105 - 78153 Le Chesnay Cedex
Tel. : 01 39 63 56 87 - Fax : 01 39 63 55 94





More information about the users mailing list