Hi, I have MySQLdb installed at home but trying to move a project to my work system. When I try to:
python setup.py build
I get the following error:
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -g -fPIC -I/usr/include/mysql -I/usr/include/python2.4 -c _mysql.c -o build/temp.linux-x86_64-2.4/_mysql.o -I/usr/include/mysql -g -march=i586 -mcpu=i686 -fmessage-length=0 -mcpu=' is deprecated. Use-mtune=' or '-march=' instead.
_mysql.c:1: error: CPU you selected does not support x86-64 instruction set
_mysql.c:1: error: CPU you selected does not support x86-64 instruction set
error: command 'gcc' failed with exit status 1
Would greatly appreciate any help! If I have missed any vital info you need to further help me, please just tell me exactly what you need.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, 1.2.1c4 is out, and has build fixes relative to 1.2.0, but I don't think it will help. It's picking up the compiler flags from mysql_config. Run mysql-config from the command line and see if -march=586 is in there. Either that or your python installation is compiled for x86 and running in emulation mode. I'm pretty sure either python or mysql is compiled for x86 and the other is x86-64. Probably you'll have to reinstall one of them with an x86-64 version (I'm guessing mysql).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Turns out for some reason config("cflags") was returning -march=i586
instead of athlon64.
I hard coded the extra_compile_args in setup.py and was then over that
hump.
I did realise that I had installed the 32-bit version of MySQL which
caused some lib issues, which was easy to fix (just installed the right
RPMs like I should have done in the first place!) but then I found
another dependency.
It couldn't find "-lz", and some Googling turned up that I needed to
install zlib-devel.
After that was installed, the build and install (and subsequent import
of MySQLdb) worked swimmingly.
Just about to port over my /var/lib/mysql files onto the new AMD64
machine and test the code I wrote at home.
Much obliged to al
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The 32-bit MySQL is what caused config("cflags") (which is mysql_config --cflags) to return -march=i586: mysql_config is hard-coded to return the flags used to compile MySQL.
zlib-devel is listed as a dependency in the README
Give 1.2.1c4 a try; I intend to release 1.2.1 on March 8.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I have MySQLdb installed at home but trying to move a project to my work system. When I try to:
python setup.py build
I get the following error:
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -g -fPIC -I/usr/include/mysql -I/usr/include/python2.4 -c _mysql.c -o build/temp.linux-x86_64-2.4/_mysql.o -I/usr/include/mysql -g -march=i586 -mcpu=i686 -fmessage-length=0
-mcpu=' is deprecated. Use
-mtune=' or '-march=' instead._mysql.c:1: error: CPU you selected does not support x86-64 instruction set
_mysql.c:1: error: CPU you selected does not support x86-64 instruction set
error: command 'gcc' failed with exit status 1
Would greatly appreciate any help! If I have missed any vital info you need to further help me, please just tell me exactly what you need.
Well, 1.2.1c4 is out, and has build fixes relative to 1.2.0, but I don't think it will help. It's picking up the compiler flags from mysql_config. Run mysql-config from the command line and see if -march=586 is in there. Either that or your python installation is compiled for x86 and running in emulation mode. I'm pretty sure either python or mysql is compiled for x86 and the other is x86-64. Probably you'll have to reinstall one of them with an x86-64 version (I'm guessing mysql).
Thanks Andy!
Turns out for some reason config("cflags") was returning -march=i586
instead of athlon64.
I hard coded the extra_compile_args in setup.py and was then over that
hump.
I did realise that I had installed the 32-bit version of MySQL which
caused some lib issues, which was easy to fix (just installed the right
RPMs like I should have done in the first place!) but then I found
another dependency.
It couldn't find "-lz", and some Googling turned up that I needed to
install zlib-devel.
After that was installed, the build and install (and subsequent import
of MySQLdb) worked swimmingly.
Just about to port over my /var/lib/mysql files onto the new AMD64
machine and test the code I wrote at home.
Much obliged to al
The 32-bit MySQL is what caused config("cflags") (which is mysql_config --cflags) to return -march=i586: mysql_config is hard-coded to return the flags used to compile MySQL.
zlib-devel is listed as a dependency in the README
Give 1.2.1c4 a try; I intend to release 1.2.1 on March 8.