Menu

Build error on Mac OS X 10.5

Help
sethtrain
2007-10-30
2012-09-19
  • sethtrain

    sethtrain - 2007-10-30

    Here is the error traceback that I get when trying to install on Mac OS 10.5. I am using the version of python (2.5.1) that comes with 10.5 and the MySQL Mac install from their website:

    Can someone help me with this?

    Downloading http://osdn.dl.sourceforge.net/sourceforge/mysql-python/MySQL-python-1.2.2.tar.gz
    Processing MySQL-python-1.2.2.tar.gz
    Running MySQL-python-1.2.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-mh1vmY/MySQL-python-1.2.2/egg-dist-tmp-nNq59c
    In file included from /usr/local/mysql/include/mysql.h:43,
    from _mysql.c:40:
    /usr/include/sys/types.h:92: error: duplicate ‘unsigned’
    /usr/include/sys/types.h:92: error: two or more data types in declaration specifiers
    error: Setup script exited with error: command 'gcc' failed with exit status 1
    choy:mysql seth$ gcc' failed with exit status 1

    Versions:
    Python 2.5.1
    mysql Ver 14.12 Distrib 5.0.45, for apple-darwin8.5.1 (i686) using readline 5.0
    gcc -v
    Using built-in specs.
    Target: i686-apple-darwin9
    Configured with: /var/tmp/gcc/gcc-5465~16/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=i686-apple-darwin9 --with-arch=apple --with-tune=generic --host=i686-apple-darwin9 --target=i686-apple-darwin9
    Thread model: posix
    gcc version 4.0.1 (Apple Inc. build 5465)

     
    • benha

      benha - 2007-11-01

      There's another issue that perhaps someone here can help with.

      The "standard" installs of MySQL for OSX don't have support for x86_64, but apache2 on OSX is x86_64 compliant and it runs that way on machines that support it.

      This presents a problem if you're trying to use MySQLdb with ModPython. ModPython, with some trickery, can be compiled x86_64. MySQLdb can be compiled x86_64 as well. But because MySQL doesn't support it, you things fail at the link stage.

      Does anyone have a reliable set of instructions for building and installing an x86_64 version of MySQL? It was miserable enough trying to get the little bits compiled x86_64 - I'm not sure I have it in me to try to figure it out for MySQL...

      -Ben

       
    • benha

      benha - 2007-10-30

      I'm having the same problem...

      Any luck sorting this out?

       
      • sethtrain

        sethtrain - 2007-10-30

        Yes.

        kylev's post helped but I had other issues and found http://forums.mysql.com/read.php?50,175059,179979#msg-179979 to be more helpful.

         
    • Kyle VanderBeek

      Kyle VanderBeek - 2007-10-30
       
    • Kyle VanderBeek

      Kyle VanderBeek - 2007-10-30

      In the interest of getting an actual solution and patch for the lib loading part of the problem (not the unsigned int part), can one or both of you paste the output of running "mysql_config"?

       
      • sethtrain

        sethtrain - 2007-10-30

        choy:~ seth$ mysql_config
        Usage: /usr/local/mysql/bin/mysql_config [OPTIONS]
        Options:
        --cflags [-I/usr/local/mysql/include -Os -arch i386 -fno-common]
        --include [-I/usr/local/mysql/include]
        --libs [-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lm]
        --libs_r [-L/usr/local/mysql/lib/mysql -lmysqlclient_r -lz -lm]
        --socket [/tmp/mysql.sock]
        --port [3306]
        --version [5.0.45]
        --libmysqld-libs [-L/usr/local/mysql/lib/mysql -lmysqld -lz -lm]

         
        • Kyle VanderBeek

          Kyle VanderBeek - 2007-10-30

          Thanks. The linking problem is a MySQL-side bug. If you ask mysql_config where the library is, it replies /usr/local/mysql/lib/mysql instead of /usr/local/mysql/lib (the actual location of the libs). MySQL-python uses that incorrect path when creating the loadable library, so it gets ugly from there.

          MySQL has a bug open (P2) for the mysql_config issue:
          http://bugs.mysql.com/bug.php?id=30148

          My patch for the initial mysql-python "unsigned" compile bug is proposed as a patch on the SF Bug:
          https://sourceforge.net/tracker/index.php?func=detail&aid=1808476&group_id=22307&atid=374932

           
    • Ken

      Ken - 2007-10-31

      This help worked great. I put together a step by step on my blog for getting it working based on the responses. Thanks for all of the help.

      http://www.keningle.com/?p=11

       
      • Kyle VanderBeek

        Kyle VanderBeek - 2007-10-31

        Sorry, I'm working blind here (no Mac, just a brain). Rather than symlinking the files, I think symlinking the directory might be just a touch cleaner (and one less step). You'll have to get the directory you made out of the way first:

        mv /usr/local/mysql/lib/mysql /usr/local/mysql/lib/mysql.old

        And replace the directory with a symlink to the correct directory:

        ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql

        I think that will work as well, and be one less step. If it works, blow away the mysql.old directory containing the file symlinks.

         
    • Ken

      Ken - 2007-11-01

      That makes complete sense. I will update the tutorial. Thanks for the tip.

       

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.