Linear Programming/Simplex Algorithm

Discussion in 'Ruby' started by Taura A., Sep 24, 2010.

  1. Taura A.

    Taura A. Guest

    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/.
     
    Taura A., Sep 24, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    1,194
    Roedy Green
    Nov 15, 2005
  2. Replies:
    1
    Views:
    4,619
    Jack Klein
    Jan 12, 2005
  3. Mounard le Fougueux

    Simplex in VHDL/FPGA

    Mounard le Fougueux, Sep 27, 2006, in forum: VHDL
    Replies:
    0
    Views:
    774
    Mounard le Fougueux
    Sep 27, 2006
  4. Deepak
    Replies:
    1
    Views:
    1,237
    Mike Wahler
    Jan 11, 2005
  5. Tommy Vee

    Simplex Algorithm

    Tommy Vee, Sep 2, 2013, in forum: Python
    Replies:
    10
    Views:
    285
    Tommy Vee
    Sep 2, 2013
Loading...

Share This Page