sourmash-bio / sourmash

Quickly search, compare, and analyze genomic and metagenomic data sets.
http://sourmash.readthedocs.io/en/latest/
Other
476 stars 79 forks source link

compile error on sourmash install #474

Closed phiweger closed 4 years ago

phiweger commented 6 years ago

On installing sourmash via pip install .../master.zip on mac OS sierra (10.13.3), the following error is thrown:

    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/phi/miniconda3/envs/lab/include -I/Users/phi/miniconda3/envs/lab/include -I./sourmash -I./third-party/smhasher/ -I/Users/phi/miniconda3/envs/lab/include/python3.6m -c sourmash/_minhash.cpp -o build/temp.macosx-10.9-x86_64-3.6/sourmash/_minhash.o -std=c++11 -pedantic -arch x86_64 -mmacosx-version-min=10.7 -stdlib=libc++
    gcc: error: unrecognized command line option '-stdlib=libc++'
    error: command 'gcc' failed with exit status 1

This is because the current "default mac gcc" does not have a flag -stdlib.

Downloading the zip and removing '-stdlib=libc++' in setup.py from the following lines

    EXTRA_COMPILE_ARGS.extend(['-arch', 'x86_64', '-mmacosx-version-min=10.7',
                               '-stdlib=libc++'])

solves this:

Successfully installed sourmash-2.0.0a6
phiweger commented 6 years ago

But then it doesn't solve the issue:

sourmash compute -k 21 -n 1000 example.fa -o example.sig.json

Traceback (most recent call last):
  File ".../miniconda3/envs/lab/bin/sourmash", line 7, in <module>
    from sourmash.__main__ import main
  File ".../miniconda3/envs/lab/lib/python3.6/site-packages/sourmash/__init__.py", line 10, in <module>
    from ._minhash import (MinHash, get_minhash_default_seed, get_minhash_max_hash)
ImportError: dlopen(.../miniconda3/envs/lab/lib/python3.6/site-packages/sourmash/_minhash.cpython-36m-darwin.so, 2): Symbol not found: __ZSt24__throw_out_of_range_fmtPKcz
  Referenced from: .../miniconda3/envs/lab/lib/python3.6/site-packages/sourmash/_minhash.cpython-36m-darwin.so
  Expected in: flat namespace
 in .../miniconda3/envs/lab/lib/python3.6/site-packages/sourmash/_minhash.cpython-36m-darwin.so

The problem seems to be in setup.py not being sure which gcc to invoke. See here on this switch.

ctb commented 5 years ago

hi @phiweger is this still a problem?