Menu

1.2.0 won't compile on AMD64 SUSE10.0

Help
alagalah
2006-02-28
2012-09-19
  • alagalah

    alagalah - 2006-02-28

    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.

     
    • Andy Dustman

      Andy Dustman - 2006-03-01

      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).

       
      • alagalah

        alagalah - 2006-03-01

        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

         
        • Andy Dustman

          Andy Dustman - 2006-03-01

          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.

           

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.