Bug #24569 MySql connector odbc 3.51.12 for PowerPC does not work on Intel Mac's
Submitted: 24 Nov 2006 9:58 Modified: 15 Mar 2007 20:51
Reporter: Frédéric Brussel Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:3.51.12 OS:MacOS (Mac OS X 10.4.8)
Assigned to: Kent Boortz CPU Architecture:Any
Tags: Compilation and installation successful

[24 Nov 2006 9:58] Frédéric Brussel
Description:
The ODBC connector for Intel Mac does not exist and the PowerPC version is not compatible on Intel Mac's. There is no more possibility to connect to any MySQL database using ODBC on the new Macintoshes. It's a disaster !

How to repeat:
Always

Suggested fix:
Compile and provide us a Universal Binary or Intel version of the connector
[27 Nov 2006 20:23] Sveta Smirnova
Thank you for the report.

Verified as described: all files installed but library doesn't work:

apples-computer:~/Documents/MySQL/bugs apple$ cat > bug24569.c
int main()
{

};
^C
apples-computer:~/Documents/MySQL/bugs apple$ gcc /usr/lib/libmyodbc3.dylib -o bug24569 bug24569.c 
/usr/bin/ld: warning /usr/lib/libmyodbc3.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded)

If I try to invoke command-line utility, I always get Could not SQLConnect error.

apples-computer:~/Documents/web_project/MySQL/bugs apple$ myodbc3i -q -s
ODBC Data Sources
myodbc
ODBC
apples-computer:~/Documents/web_project/MySQL/bugs apple$ myodbc3m 'DRIVER=MySQL ODBC 3.51 Driver; DSN=myodbc'
[imyodbc]ERROR: Could not SQLConnect
apples-computer:~/Documents/web_project/MySQL/bugs apple$
[1 Dec 2006 12:08] Frédéric Brussel
Do you plan to compile it for Intel soon ?
[8 Dec 2006 3:07] Trevor Page
I've successfully compiled MyODBC drivers on an Intel Mac. Please see my articles and video tutorial on how to accomplish it:

http://www.graphiccare.ca/index.php?option=com_content&task=view&id=56&Itemid=37
[8 Dec 2006 11:36] Frédéric Brussel
Dear Trevor Page, thanks a lot for providing us a way to do it by our own. Unfortunately, I get the following error when executing "sudo make install". Can you help ?

------------------
Making install in util
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
Making install in driver
test -z "/usr/local/myodbc/lib" || /bin/sh ../mkinstalldirs "/usr/local/myodbc/lib"
 /bin/sh ../libtool --mode=install /usr/bin/install -c  'libmyodbc3.la' '/usr/local/myodbc/lib/libmyodbc3.la'
/usr/bin/install -c .libs/libmyodbc3-3.51.12.so /usr/local/myodbc/lib/libmyodbc3-3.51.12.so
(cd /usr/local/myodbc/lib && rm -f libmyodbc3.so && ln -s libmyodbc3-3.51.12.so libmyodbc3.so)
/usr/bin/install -c .libs/libmyodbc3.lai /usr/local/myodbc/lib/libmyodbc3.la
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/myodbc/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[2]: Nothing to be done for `install-data-am'.
Making install in driver_r
test -z "/usr/local/myodbc/lib" || /bin/sh ../mkinstalldirs "/usr/local/myodbc/lib"
 /bin/sh ../libtool --mode=install /usr/bin/install -c  'libmyodbc3_r.la' '/usr/local/myodbc/lib/libmyodbc3_r.la'
/usr/bin/install -c .libs/libmyodbc3_r-3.51.12.so /usr/local/myodbc/lib/libmyodbc3_r-3.51.12.so
(cd /usr/local/myodbc/lib && rm -f libmyodbc3_r.so && ln -s libmyodbc3_r-3.51.12.so libmyodbc3_r.so)
/usr/bin/install -c .libs/libmyodbc3_r.lai /usr/local/myodbc/lib/libmyodbc3_r.la
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/myodbc/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[2]: Nothing to be done for `install-data-am'.
Making install in setup
test -z "/usr/local/myodbc/lib" || /bin/sh ../mkinstalldirs "/usr/local/myodbc/lib"
make[2]: Nothing to be done for `install-data-am'.
Making install in MYODBCConfig
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
Making install in myodbcinst
test -z "/usr/local/myodbc/bin" || /bin/sh ../mkinstalldirs "/usr/local/myodbc/bin"
  /bin/sh ../libtool --mode=install /usr/bin/install -c 'myodbc3i' '/usr/local/myodbc/bin/myodbc3i'
/usr/bin/install -c myodbc3i /usr/local/myodbc/bin/myodbc3i
make[2]: Nothing to be done for `install-data-am'.
Making install in imyodbc
test -z "/usr/local/myodbc/bin" || /bin/sh ../mkinstalldirs "/usr/local/myodbc/bin"
  /bin/sh ../libtool --mode=install /usr/bin/install -c 'myodbc3m' '/usr/local/myodbc/bin/myodbc3m'
/usr/bin/install -c myodbc3m /usr/local/myodbc/bin/myodbc3m
make[2]: Nothing to be done for `install-data-am'.
Making install in samples
/bin/sh ../libtool --tag=CC --mode=link gcc  -O -DDBUG_OFF   -I/usr/local/mysql/include -Os -arch i386 -fno-common ../driver_r/libmyodbc3_r.la -L/usr/local/mysql/lib -lmysqlclient_r -lz -lm -lltdl -lltdl -o my_basics  my_basics.o  -lz  -liodbcinst

*** Warning: Linking the executable my_basics against the loadable module
*** libmyodbc3_r.so is not portable!
** Warning, lib libmyodbc3_r.so is a module, not a shared library

** And there doesn't seem to be a static archive available
** The link will probably fail, sorry
gcc -O -DDBUG_OFF -I/usr/local/mysql/include -Os -arch i386 -fno-common -o .libs/my_basics my_basics.o  ../driver_r/.libs/libmyodbc3_r.so -L/usr/local/mysql/lib -lmysqlclient_r -lm /usr/lib/libltdl.3.1.0.dylib -ldl -lz -liodbcinst
/usr/bin/ld: ../driver_r/.libs/libmyodbc3_r.so is input for the dynamic link editor, is not relocatable by the static link editor again
collect2: ld returned 1 exit status
make[1]: *** [my_basics] Error 1
make: *** [install-recursive] Error 1
[12 Dec 2006 14:28] Frédéric Brussel
I succeded in compiling and installing the iODBC driver for my Intel Mac. I am allowed to share this self compiled driver with other persons, or do everybody need to compile it by themselves ? (copyright question)
[10 Feb 2007 0:07] Joseph Kouyoumjian
Frederic:

I have the same problem.  How did you resove it?

Thanks!
[15 Mar 2007 20:51] Kent Boortz
Thank you for your bug report. This issue has been fixed in
the latest released version of that product, which you can
download at

  http://www.mysql.com/downloads/

There is now both PowerPC 32 bit and Intel x86 32 bit
versions, compiled against the Apple provided iODBC.