Menu

Ignoring mysql_config

Alex Sayle
2007-07-02
2012-09-19
  • Alex Sayle

    Alex Sayle - 2007-07-02

    Hi,

    I'm having trouble understanding some logic in the building process...

    I'm building MySQLdb 1.2.2, my mysql is installed into a non-standard location and my mysql_config reflects this by spitting out the following

    /opt/mysql/5.0.22/bin/mysql_config --libs
    -Wl,-rpath=/opt/mysql/5.0.22/lib/mysql -L/opt/mysql/5.0.22/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm

    As you can see, my mysql_config spits out all the flags that it needs, yet,

    running build
    running build_py
    creating build/lib.linux-i686-2.4
    copying _mysql_exceptions.py -> build/lib.linux-i686-2.4
    creating build/lib.linux-i686-2.4/MySQLdb
    copying MySQLdb/init.py -> build/lib.linux-i686-2.4/MySQLdb
    copying MySQLdb/converters.py -> build/lib.linux-i686-2.4/MySQLdb
    copying MySQLdb/connections.py -> build/lib.linux-i686-2.4/MySQLdb
    copying MySQLdb/cursors.py -> build/lib.linux-i686-2.4/MySQLdb
    copying MySQLdb/release.py -> build/lib.linux-i686-2.4/MySQLdb
    copying MySQLdb/times.py -> build/lib.linux-i686-2.4/MySQLdb
    creating build/lib.linux-i686-2.4/MySQLdb/constants
    copying MySQLdb/constants/init.py -> build/lib.linux-i686-2.4/MySQLdb/constants
    copying MySQLdb/constants/CR.py -> build/lib.linux-i686-2.4/MySQLdb/constants
    copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-i686-2.4/MySQLdb/constants
    copying MySQLdb/constants/ER.py -> build/lib.linux-i686-2.4/MySQLdb/constants
    copying MySQLdb/constants/FLAG.py -> build/lib.linux-i686-2.4/MySQLdb/constants
    copying MySQLdb/constants/REFRESH.py -> build/lib.linux-i686-2.4/MySQLdb/constants
    copying MySQLdb/constants/CLIENT.py -> build/lib.linux-i686-2.4/MySQLdb/constants
    running build_ext
    building '_mysql' extension
    creating build/temp.linux-i686-2.4
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,2,'final',0) -Dversion=1.2.2 -I/opt/mysql/5.0.22/include/mysql -I/usr/include/python2.4 -c _mysql.c -o build/temp.linux-i686-2.4/_mysql.o
    gcc -pthread -shared build/temp.linux-i686-2.4/_mysql.o -L/opt/mysql/5.0.22/lib/lib/mysql -lmysqlclient_r -lz -lpthread -lcrypt -lnsl -lm -lpthread -o build/lib.linux-i686-2.4/_mysql.so
    /usr/bin/ld: cannot find -lmysqlclient_r
    collect2: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1

    a little investigation shows with examples like

    setup_posix.py - line 52

    library_dirs = [ dequote(i[2:]) for i in libs if i.startswith(compiler_flag("L")) ]
    libraries = [ dequote(i[2:]) for i in libs if i.startswith(compiler_flag("l")) ]
    

    that there's assumptions as to what options mysql_config will return and as a consequence flags such as "-Wl," are not being passed onto to the compiler.

    now I'm not a shit hot python programmer so I maybe missing something obvious but this is surely a bug ...

     
    • Alex Sayle

      Alex Sayle - 2007-07-02

      one thing quickly, the compile error is totally my fault, I'm very aware that libmysqlclient_r.so is missing and that is breaking the build.

       

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.