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<[email protected]> wrote: >> > > > > _______________________________________________ > Help-glpk mailing list > [email protected] > http://lists.gnu.org/mailman/listinfo/help-glpk >
-- Originally transp_mysql.sql ` -- production capacity drop table if exists transp_capa; create table transp_capa ( PLANT text(127) primary key, CAPA real ); insert into transp_capa ( PLANT, CAPA ) values ( 'Seattle', 350 ); insert into transp_capa ( PLANT, CAPA ) values ( 'San Diego', 600 ); -- demand drop table if exists transp_demand; create table transp_demand ( MARKET text(127) primary key, DEMAND REAL ); INSERT INTO transp_demand ( MARKET, DEMAND ) VALUES ( 'New York', 325 ); INSERT INTO transp_demand ( MARKET, DEMAND ) VALUES ( 'Chicago', 300 ); INSERT INTO transp_demand ( MARKET, DEMAND ) VALUES ( 'Topeka', 275 ); -- distance DROP TABLE if exists transp_dist; CREATE TABLE transp_dist ( LOC1 TEXT(127), LOC2 TEXT(127), DIST REAL, PRIMARY KEY (LOC1, LOC2) ); INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'Seattle', 'New York', 2.5 ); INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'Seattle', 'Chicago', 1.7 ); INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'Seattle', 'Topeka', 1.8 ); INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'San Diego', 'New York', 2.5 ); INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'San Diego', 'Chicago', 1.8 ); INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'San Diego', 'Topeka', 1.4 ); -- result DROP TABLE if exists transp_result; CREATE TABLE transp_result ( LOC1 TEXT(127), LOC2 TEXT(127), QUANTITY REAL, PRIMARY KEY (LOC1, LOC2) );
_______________________________________________ Help-glpk mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-glpk
