[Biopython] Installing biopython on OS X 10.10.5

Michael Muratet muratetm at gmail.com
Mon May 9 18:53:44 UTC 2016


Greetings

I have a MacBook Pro 17” Early 2009 running 10.10.5. I’m using anaconda: 

Python 2.7.9 |Anaconda 2.1.0 (x86_64)| (default, Dec 15 2014, 10:37:34) 
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin

I have the command line tools for XCode 7.2, but I can select “Updates”  with the App Store app and they will reinstall every time. Weird.

I’ve installed and/or upgraded earlier biopythons on this machine several times without a problem, but I have run afoul of a known problem that I can’t fix.

Here’s the tail end of the build output from pip:

building 'Bio.cpairwise2' extension

creating build/temp.macosx-10.5-x86_64-2.7

creating build/temp.macosx-10.5-x86_64-2.7/Bio

gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -I/Users/mmuratet/anaconda/include/python2.7 -c Bio/cpairwise2module.c -o build/temp.macosx-10.5-x86_64-2.7/Bio/cpairwise2module.o

gcc: error: unrecognized command line option '-Qunused-arguments'

gcc: error: unrecognized command line option '-Qunused-arguments'

error: command 'gcc' failed with exit status 1

I get the same error with easy_install.

I looked inside setup.py and found:

    We can avoid the clang compilation error with -Qunused-arguments which is
    (currently) harmless if gcc is being used instead (e.g. compiling Biopython
    against a locally compiled Python rather than the Apple provided Python).
    """
    # see http://lists.open-bio.org/pipermail/biopython-dev/2014-April/011240.html
    if sys.platform != "darwin":
        return
    # see also Bio/_py3k/__init__.py (which we can't use in setup.py)
    if sys.version_info[0] >= 3:
        from subprocess import getoutput
    else:
        from commands import getoutput
    cc = getoutput("cc -v")
    if "gcc" in cc or "clang" not in cc:
        return
    for flag in ["CFLAGS", "CPPFLAGS"]:
        if flag not in os.environ:
            os.environ[flag] = "-Qunused-arguments"
        elif "-Qunused-arguments" not in os.environ[flag]:
            os.environ[flag] += " -Qunused-arguments”

My platform is “darwin” but my version comes back as 2. Furthermore, cc contains “clang” and so the " -Qunused-arguments” flag is getting set.

I am tempted to just comment out the code to get rid of the flag, but I thought someone might be able to suggest a better solution.

Cheers

Mike


More information about the Biopython mailing list