help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Re: Mac OS X ODBC MathProg


From: Noli Sicad
Subject: Re: [Help-glpk] Re: Mac OS X ODBC MathProg
Date: Tue, 16 Feb 2010 10:59:13 +0700

Hi,

I think this case is close. We can run Mac OS X ODBC and MathProg
especially SQLite.

Chris actually emailed me yesterdy regard this patch to rename #define
ODBC_DLNAME "libiodbc.so" to #define ODBC_DLNAME "libiodbc.dylib"
after ./configure --enable-dl=dlfcn --enable-odbc and edit config.h
before compiling in Mac OS Xl (see his copy of his email below).

Xypron, Yes, this is alternative to create symbolic linking. This is
your idea :-)

 "sudo ln -s /usr/lib/libiodbc.dylib /usr/lib/libodbc.so"

http://www.mail-archive.com/address@hidden/msg02112.html

Now, I can confirm that sqlite3 is working properly in Mac OS X. I
have run the transp_sqilte.mod today with No DSN.

http://www.mail-archive.com/address@hidden/msg03772.html

BTW, Chris is package manager for SQLite for Mac OS X and I think he
is just force to join the help glpk because of me having hard time
running SQLite in Mac OS X.
http://www.ch-werner.de/sqliteodbc/

Chris, sorry for the delay of posting your email to group. I just like
to make it sure than I can run sqlite odbc in MathProg myself.

Thanks.

Regards, Noli


From: Chris Wolf <address@hidden>
Date: Sun, 14 Feb 2010 23:33:27 -0500

Noli,

I was able run the transp_odbc.mod against sqlite on my mac -
it seems to work fine:


clozaril-2:sql cwolf$ glpsol -m transp_sqlite.mod
GLPSOL: GLPK LP/MIP Solver, v4.42
Parameter(s) specified in the command line:
 -m transp_sqlite.mod
Reading model section from transp_sqlite.mod...
Reading data section from transp_sqlite.mod...
72 lines were read
Reading plants...
Connected to SQLite 3.4.0 - /Users/cwolf/glptest.db
SELECT PLANT, CAPA AS CAPACITY FROM transp_capa
Reading markets...
Connected to SQLite 3.4.0 - /Users/cwolf/glptest.db
SELECT MARKET, DEMAND FROM transp_demand
Reading dist...
Connected to SQLite 3.4.0 - /Users/cwolf/glptest.db
SELECT LOC1, LOC2, DIST FROM transp_dist
Generating cost...
Generating supply...
Generating demand...
Model has been successfully generated
GLPK Simplex Optimizer, v4.42
6 rows, 6 columns, 18 non-zeros
Preprocessing...
5 rows, 6 columns, 12 non-zeros
Scaling...
 A: min|aij| =  1.000e+00  max|aij| =  1.000e+00  ratio =  1.000e+00
Problem data seem to be well scaled
Constructing initial basis...
Size of triangular part = 5
      0: obj =   0.000000000e+00  infeas =  9.000e+02 (0)
*     4: obj =   1.561500000e+02  infeas =  0.000e+00 (0)
*     5: obj =   1.536750000e+02  infeas =  0.000e+00 (0)
OPTIMAL SOLUTION FOUND
Time used:   0.0 secs
Memory used: 0.1 Mb (133441 bytes)
Writing result...
Connected to SQLite 3.4.0 - /Users/cwolf/glptest.db
DELETE FROM transp_result
INSERT INTO transp_result VALUES (?,?,?)
Model has been successfully processed



1.) When you build glpk, you must run configure as:

./configure --enable-dl=dlfcn --enable-odbc

2.) *Before* compiling, you need to edit "config.h"
and change the defined constant :

#define ODBC_DLNAME "libiodbc.so"

to

#define ODBC_DLNAME "libiodbc.dylib"

Since shared libraries on MacOS have a ".dylib" extension, not ".so"
and not ".dll"


3.) You have to convert the MySQL database script to sqlite syntax,
    (which you did not mention in your mailing list comments.)
    The converted file is attached.

4.) In the transp.mod, I just used a user-DSN rather than in-lining
    the connection info.  i.e. I have just 'DSN=GLPTest'

    Then in my user-local odbc.ini file, I defined the DSN as:

[GLPTest]
Driver  = /usr/local/lib/libsqlite3odbc-0.83.dylib
Description = Test SQLite database for GLPK
Database = /Users/cwolf/glptest.db


So you should have no issues using the SQLite ODBC driver with GLPK on MacOS.


Hope this helps,

   -Chris




reply via email to

[Prev in Thread] Current Thread [Next in Thread]