Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Linear Programming/Simplex Algorithm

Reply
Thread Tools

Linear Programming/Simplex Algorithm

 
 
Taura A.
Guest
Posts: n/a
 
      09-24-2010
Hi,

I'm looking for a way, to solve a linear optimization within ruby. I
already tried this gem:

http://rglpk.rubyforge.org/rglpk/

but wasn't able to get it to work, because I have Windows and somehow
the gem doesn't seem to work with the winversion of GLPK (or, more
likely, I'm too dense to get it to work). I "installed" winglpk (its
working, I tested it via command line), but whenever I try to install
the gem, it says, it couldn't find the GLPK Library Installation. (I
included the error message at the end of the post.)

Could someone help me please, either with the rglpk gem or with another
solution? All I really need is a working simplex algorithm to solve my
LP, all the other stuff GLPK does isn't relevant for me.

Thanks in advance,

taura


----------------

Error Message, when trying to install rglpk:

Building native extensions. This could take a while...
ERROR: Error installing rglpk:
ERROR: Failed to build gem native extension.

C:/Programme/Ruby/bin/ruby.exe extconf.rb
checking for main() in -lglpk... no

ERROR: Cannot find the GLPK library, aborting.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Programme/Ruby/bin/ruby
--with-glpk-dir
--without-glpk-dir
--with-glpk-include
--without-glpk-include=${glpk-dir}/include
--with-glpk-lib
--without-glpk-lib=${glpk-dir}/lib
--with-glpklib
--without-glpklib


Gem files will remain installed in
C:/Programme/Ruby/lib/ruby/gems/1.8/gems/rglpk-0.1.1 for inspection.
Results logged to
C:/Programme/Ruby/lib/ruby/gems/1.8/gems/rglpk-0.1.1/ext/gem_make.out

-----------------

Contents of mkmf.log:
have_library: checking for main() in -lglpk... -------------------- no

"gcc -o conftest -I. -IC:/Programme/Ruby/lib/ruby/1.8/i386-mingw32 -I.
-g -O2 -DFD_SETSIZE=256 conftest.c -L. -LC:/Programme/Ruby/lib -L.
-lmsvcrt-ruby18-static -lglpk -lshell32 -lws2_32 "
c:\Programme\Ruby\devkit\gcc\3.4.5\bin\..\lib\gcc\ mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe:
cannot find -lglpk
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include <ws2tcpip.h>
2: #include <winsock2.h>
3: #include <windows.h>
4:
5: /*top*/
6: int main() { return 0; }
7: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
/* end */

"gcc -o conftest -I. -IC:/Programme/Ruby/lib/ruby/1.8/i386-mingw32 -I.
-g -O2 -DFD_SETSIZE=256 conftest.c -L. -LC:/Programme/Ruby/lib -L.
-lmsvcrt-ruby18-static -lglpk -lshell32 -lws2_32 "
c:\Programme\Ruby\devkit\gcc\3.4.5\bin\..\lib\gcc\ mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe:
cannot find -lglpk
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { main(); return 0; }
/* end */

--------------------
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linear interpolation in vhdl df84077@gmail.com VHDL 8 10-07-2011 08:38 AM
Filtered Back Projection Algorithm (FBP Algorithm) Bapaiah Katepalli VHDL 1 06-23-2006 04:50 PM
Code for linear congruences, diophantine linear equations alessandra_cabrini@virgilio.it Java 1 11-15-2005 12:23 PM
3D linear interpolation Cary Robins Java 1 02-04-2004 08:41 AM
Key generation algorithm and Cipher algorithm Ahmed Moustafa Java 0 11-15-2003 06:35 AM



Advertisments