[Top][All Lists]

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

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

From: Xypron
Subject: Re: [Help-glpk] Re: Mac OS X ODBC MathProg
Date: Mon, 15 Feb 2010 22:43:49 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20091017 SeaMonkey/2.0

Hello Andrew,

please, have a look at

Learning from this example we could use the following

case $host_os in

Best regards


Chris Wolf wrote:

I would advise against option #2.  As I was trying to indicate to Noli
on a separate thread - it might work, but as long as you're
compiling GPLK anyway, why not use the correct shared library extension
name for the platform?  On MacOS the extension is ".dylib" - not "*.so".

I would go with option #1, for sure. See my procedure, below, I show
how to use the stream editor in a one-line command so you don't even
have to open config.h in an editor.

Also option #2 is a hack for another reason - there are two distinct
ODBC API implementations for Linux/UNIX platforms - one is called
"unixODBC" and the other is "iODBC" - MacOS uses iODBC, and that
API's base name for the library is "libiodbc"  (with letter 'i'),
but for unixODBC, the basename is "libodbc" (no letter 'i').

So by creating that symlink, you're essentially causing other
potential programs that expect unixODBC API to inadvertently
load an iODBC library, which may or may not work.


So the steps to build it with ODBC support on MacOS are:

1.) ./configure --enable-dl=dlfcn --enable-odbc
2.) cat config.h | sed -e s/.so/.dylib/>  /tmp/config.$$&&  mv /tmp/config.$$ 

(step 2 invokes the stream editor to change all instances of ".so" to ".dylib", 
  that the shared library name is corrected for MacOS - not only for ODBC, but 
for the MySQL
  driver as well, if you chose this config option)

3.) make
4.) sudo make install

I did this and was able to run the transp_odbc.mod example on SQLite with
no issues, other then changing the DSN string to 'DSN=GLPTest', then
creating a user-DSN named "GLPTest".

Before you can run the model, of course you have to create
the schema and load the data which is done with the "transp.sql", which
I converted to SQLite syntax.  (See attached file)

Here's how to create the schema / load the data:

$ sqlite3 -init transp_sqlite.sql ~/glptest.db

(you can replace "~glptest.db" with wherever your SQLite DB file is located)

Hope that helps,

Chris Wolf

Xypron wrote:
Hello Noli,

thank you for the patches. Am I right that 1 and 2 are alternatives?

Hence it would be sufficient to put a remark into ./INSTALL
that a symbolic link needs to be created on OS X systems?

Best regards


Noli Sicad wrote:

The patches:

1. In config.h change

#define ODBC_DLNAME ""
/* ODBC shared library name if this feature is enabled */


#define ODBC_DLNAME "libiodbc.dylib"
/* ODBC shared library name if this feature is enabled */

2. Create symlink,  in Terminal

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

I forget to mentioned that I installed iodbc and sqlite3 odbc driver
for Mac OS X

iODBC manager

SQLite3 ODBC driver


On 2/15/10, Noli Sicad<address@hidden>   wrote:

Help-glpk mailing list

reply via email to

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