I am installing MySQL-Python 1.2.1 on a RHEL 4 box using Python 2.3.5. I have the following MySQL packages installed:
[root@www MySQL-python-1.2.1]# rpm -qa | grep mysql
mysqlclient10-3.23.58-6 [root@www MySQL-python-1.2.1]# rpm -qa | grep MySQL
MySQL-devel-standard-4.1.20-0.rhel3
MySQL-shared-compat-4.1.20-0.rhel3
MySQL-client-standard-4.1.20-0.rhel3
MySQL-shared-standard-4.1.20-0.rhel3
MySQL-server-standard-4.1.20-0.rhel3
The build process chokes when gcc starts (see below), complaining that the CPU does not support the x86-64 instruction set. The machine is a Sun x4200, which comes with Opteron 285SE CPUs ... presumably this should work, no??
[root@www MySQL-python-1.2.1]# /usr/local/bin/python2.3 ./setup.py build
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.3
copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.3
creating build/lib.linux-x86_64-2.3/MySQLdb
copying MySQLdb/init.py -> build/lib.linux-x86_64-2.3/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.3/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.3/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.3/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.3/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-2.3/MySQLdb
creating build/lib.linux-x86_64-2.3/MySQLdb/constants
copying MySQLdb/constants/init.py -> build/lib.linux-x86_64-2.3/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.3/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.3/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.3/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.3/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.3/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.3/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-x86_64-2.3
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/mysql -I/usr/local/include/python2.3 -c _mysql.c -o build/temp.linux-x86_64-2.3/_mysql.o -g -pipe -march=i386 -mcpu=i686 -Dversion_info="(1,2,1,'final',1)" -Dversion="1.2.1"
_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
I toyed with the site.cfg compiler settings but did not acheive any positive results, and have been unable to locate a similar error by way of Google or various mailing lists. Any suggestions would be appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Looks like you built your own Python. Check /usr/local/lib/python2.3/config/Makefile and see what compiler flags are in there. Chances are you'll see -march=i386 and -mcpu=i686, which is probably the root of your problem. Solution: Rebuild Python with x86-64 instructions.
Either that, or you have an i386 MySQL (odd that it's from RHEL3 and not 4). Check output of mysql_config. Solution: Get the x86-64 version.
One of the two things above is not built x86-64, and I'm pretty sure what your compiler is complaining about is the -march=i386 flag.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am installing MySQL-Python 1.2.1 on a RHEL 4 box using Python 2.3.5. I have the following MySQL packages installed:
[root@www MySQL-python-1.2.1]# rpm -qa | grep mysql
mysqlclient10-3.23.58-6
[root@www MySQL-python-1.2.1]# rpm -qa | grep MySQL
MySQL-devel-standard-4.1.20-0.rhel3
MySQL-shared-compat-4.1.20-0.rhel3
MySQL-client-standard-4.1.20-0.rhel3
MySQL-shared-standard-4.1.20-0.rhel3
MySQL-server-standard-4.1.20-0.rhel3
The build process chokes when gcc starts (see below), complaining that the CPU does not support the x86-64 instruction set. The machine is a Sun x4200, which comes with Opteron 285SE CPUs ... presumably this should work, no??
[root@www MySQL-python-1.2.1]# /usr/local/bin/python2.3 ./setup.py build
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.3
copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.3
creating build/lib.linux-x86_64-2.3/MySQLdb
copying MySQLdb/init.py -> build/lib.linux-x86_64-2.3/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.3/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.3/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.3/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.3/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-2.3/MySQLdb
creating build/lib.linux-x86_64-2.3/MySQLdb/constants
copying MySQLdb/constants/init.py -> build/lib.linux-x86_64-2.3/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.3/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.3/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.3/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.3/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.3/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.3/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-x86_64-2.3
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/mysql -I/usr/local/include/python2.3 -c _mysql.c -o build/temp.linux-x86_64-2.3/_mysql.o -g -pipe -march=i386 -mcpu=i686 -Dversion_info="(1,2,1,'final',1)" -Dversion="1.2.1"
_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
I toyed with the site.cfg compiler settings but did not acheive any positive results, and have been unable to locate a similar error by way of Google or various mailing lists. Any suggestions would be appreciated.
Looks like you built your own Python. Check /usr/local/lib/python2.3/config/Makefile and see what compiler flags are in there. Chances are you'll see -march=i386 and -mcpu=i686, which is probably the root of your problem. Solution: Rebuild Python with x86-64 instructions.
Either that, or you have an i386 MySQL (odd that it's from RHEL3 and not 4). Check output of mysql_config. Solution: Get the x86-64 version.
One of the two things above is not built x86-64, and I'm pretty sure what your compiler is complaining about is the -march=i386 flag.