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: 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:1.9.1.4) Gecko/20091017 SeaMonkey/2.0

Hello Andrew,

please, have a look at
http://source.winehq.org/source/configure.ac

Learning from this example we could use the following
in configure.ac:

case $host_os in
  darwin*|macosx*)
     LIBIODBC="libiodbc.dylib"
     LIBMYSQL="libmysqlclient.dylib"
     LIBODBC="libodbc.dylib"
     ;;
  *)
     LIBIODBC="libiodbc.so"
     LIBMYSQL="libmysqlclient.so"
     LIBODBC="libodbc.so"
     ;;
esac

Best regards

Xypron


Chris Wolf wrote:
Xypron,

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.

See:

http://en.wikipedia.org/wiki/IODBC
http://en.wikipedia.org/wiki/UnixODBC


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.$$ 
./config.h

(step 2 invokes the stream editor to change all instances of ".so" to ".dylib", 
such
  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

Xypron

Noli Sicad wrote:
Hi

The patches:

1. In config.h change

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

to

#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/libodbc.so"

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

iODBC manager
http://www.iodbc.org/dataspace/iodbc/wiki/iODBC/Downloads#Mac%20OS%20X

SQLite3 ODBC driver
http://www.ch-werner.de/sqliteodbc/

Noli

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



_______________________________________________
Help-glpk mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-glpk






reply via email to

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