I tried to compile several time MySQL-python 1.2.1 on my Tiger G5. Everytimes I have the same problems.
I have Tiger OSX 10.4.6. My python version is the lattest :
Python 2.4.3 (#1, Apr 10 2006, 17:26:34) [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin
The error message is the following:
running build
running build_py
copying MySQLdb/release.py -> build/lib.darwin-8.6.0-Power_Macintosh-2.4/MySQLdb
running build_ext
building '_mysql' extension
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/mysql/include -I/usr/local/include/python2.4 -c _mysql.c -o build/temp.darwin-8.6.0-Power_Macintosh-2.4/_mysql.o -Os -arch ppc64 -fno-common -Dversion_info="(1,2,1,'final',1)" -Dversion="1.2.1"
In file included from /usr/local/include/python2.4/Python.h:55,
from pymemcompat.h:10,
from _mysql.c:29:
/usr/local/include/python2.4/pyport.h:612:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
In file included from _mysql.c:40:
/usr/local/mysql/include/my_config.h:1021:1: warning: "SIZEOF_LONG" redefined
In file included from /usr/local/include/python2.4/Python.h:8,
from pymemcompat.h:10,
from _mysql.c:29:
/usr/local/include/python2.4/pyconfig.h:726:1: warning: this is the location of the previous definition
error: command 'gcc' failed with exit status 1
I was running MySQL-python 1.2.0 perfectly before. But for some hardware problem, I had to format my computer, since that it's impossible to compile MySQL-python. The only change is the version of MySQL that I use (I was using the 4.1 version).
Any help with my problem will be appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Do you think that I need to build again python zith the 64-it support. I used the configure command, but perhaps we have a way to force the 64-bit.
I don't know if it's easy to uninstall my current version of mysql and install a new one.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would go with 64-bit python if possible. I'm not sure exactly what it would take to do this though. I do most of my development on amd64, and I know MySQLdb works on ppc64 on AIX, and that is it is 64-bit clean, so I would expect upgrading Python would be a better solution.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The above statements from adustman are true.
I had the same issue, then installed the not-64bit version (which is a fat binary) and then I succeeded in installing mysql_python
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you are interested in keeping your 64-bit mysql server, you can compile the 32-bit client libraries (--without-server is the configure option) and then after making, copy the libraries and build MySQLdb with those libraries.
Obviously, you don't get the benefits of a 64-bit server; however, I have used this approach with several languages' mysql libraries.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is a conflict between the way your Python is built and MySQL (not MySQLdb). MySQL appears to be bulid for ppc64, so perhaps Python is not. Anyway, try this:
file /usr/local/bin/python2.4 (or wherever it is)
file /usr/local/mysql/bin/mysql
and see if they are the same file format.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried to compile several time MySQL-python 1.2.1 on my Tiger G5. Everytimes I have the same problems.
I have Tiger OSX 10.4.6. My python version is the lattest :
Python 2.4.3 (#1, Apr 10 2006, 17:26:34)
[GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin
The error message is the following:
running build
running build_py
copying MySQLdb/release.py -> build/lib.darwin-8.6.0-Power_Macintosh-2.4/MySQLdb
running build_ext
building '_mysql' extension
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/mysql/include -I/usr/local/include/python2.4 -c _mysql.c -o build/temp.darwin-8.6.0-Power_Macintosh-2.4/_mysql.o -Os -arch ppc64 -fno-common -Dversion_info="(1,2,1,'final',1)" -Dversion="1.2.1"
In file included from /usr/local/include/python2.4/Python.h:55,
from pymemcompat.h:10,
from _mysql.c:29:
/usr/local/include/python2.4/pyport.h:612:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
In file included from _mysql.c:40:
/usr/local/mysql/include/my_config.h:1021:1: warning: "SIZEOF_LONG" redefined
In file included from /usr/local/include/python2.4/Python.h:8,
from pymemcompat.h:10,
from _mysql.c:29:
/usr/local/include/python2.4/pyconfig.h:726:1: warning: this is the location of the previous definition
error: command 'gcc' failed with exit status 1
The output of mysql_config is:
Usage: /usr/local/mysql/bin/mysql_config [OPTIONS]
Options:
--cflags [-I/usr/local/mysql/include -Os -arch ppc64 -fno-common]
--include [-I/usr/local/mysql/include]
--libs [-arch ppc64 -L/usr/local/mysql/lib -lmysqlclient -lz -lm]
--libs_r [-arch ppc64 -L/usr/local/mysql/lib -lmysqlclient_r -lz -lm]
--socket [/tmp/mysql.sock]
--port [3306]
--version [5.0.19]
--libmysqld-libs [-arch ppc64 -L/usr/local/mysql/lib -lmysqld -lz -lm]
I was running MySQL-python 1.2.0 perfectly before. But for some hardware problem, I had to format my computer, since that it's impossible to compile MySQL-python. The only change is the version of MySQL that I use (I was using the 4.1 version).
Any help with my problem will be appreciated.
file /usr/local/bin/python2.4 :
/usr/local/bin/python2.4: Mach-O executable ppc
file /usr/local/mysql/bin/mysql
/usr/local/mysql/bin/mysql: Mach-O 64-bit executable ppc64
Arf it seems that you pointed out the problem.
Do you think that I need to build again python zith the 64-it support. I used the configure command, but perhaps we have a way to force the 64-bit.
I don't know if it's easy to uninstall my current version of mysql and install a new one.
I would go with 64-bit python if possible. I'm not sure exactly what it would take to do this though. I do most of my development on amd64, and I know MySQLdb works on ppc64 on AIX, and that is it is 64-bit clean, so I would expect upgrading Python would be a better solution.
Ok I'm going to try to do that.
Thanks again.
Ok I tried to find a way to install a 64-bit python. I couldn't. Even the official Mac installation of python is only ppc.
Now I will try to unistall my version of mysql and go with a 32-bit mysql.
The above statements from adustman are true.
I had the same issue, then installed the not-64bit version (which is a fat binary) and then I succeeded in installing mysql_python
If you are interested in keeping your 64-bit mysql server, you can compile the 32-bit client libraries (--without-server is the configure option) and then after making, copy the libraries and build MySQLdb with those libraries.
Obviously, you don't get the benefits of a 64-bit server; however, I have used this approach with several languages' mysql libraries.
There is a conflict between the way your Python is built and MySQL (not MySQLdb). MySQL appears to be bulid for ppc64, so perhaps Python is not. Anyway, try this:
file /usr/local/bin/python2.4 (or wherever it is)
file /usr/local/mysql/bin/mysql
and see if they are the same file format.