ParBLiSS / FastANI

Fast Whole-Genome Similarity (ANI) Estimation
Apache License 2.0
374 stars 67 forks source link

Compilation fails on macOS 12/`conda`: c++ command problem #91

Open widdowquinn opened 2 years ago

widdowquinn commented 2 years ago

OS: macOS 12.1

To reproduce:

In conda environment (Python 3.9, boost installed via conda)

$ git clone git@github.com:ParBLiSS/FastANI.git  # repo at commit 2a1e83f
$ cd FastANI
$ ./bootstrap.sh
$ ./configure --with-boost=${CONDA_PREFIX}/lib
$ make
c++ -O3 -DNDEBUG -std=c++11 -Isrc -I ${CONDA_PREFIX}/lib/include  -mmacosx-version-min=10.7 -stdlib=libc++ -Xpreprocessor -fopenmp -lomp -DUSE_BOOST src/cgi/core_genome_identity.cpp -o fastANI ${CONDA_PREFIX}/lib/lib/libboost_math_c99.a -lstdc++ -lz -lm  
clang: error: no such file or directory: '${CONDA_PREFIX}/lib/lib/libboost_math_c99.a'

The compiler command places an additional lib/ in the path to the math_c99 library, and expects a .a file instead of a .dylib file.

To fix, remove the extra lib/ and substitute .a with .dylib:

c++ -O3 -DNDEBUG -std=c++11 -Isrc -I ${CONDA_PREFIX}/lib/include  -mmacosx-version-min=10.7 -stdlib=libc++ -Xpreprocessor -fopenmp -lomp -DUSE_BOOST src/cgi/core_genome_identity.cpp -o fastANI ${CONDA_PREFIX}/lib/libboost_math_c99.dylib -lstdc++ -lz -lm  

NOTE: ${CONDA_PREFIX} only used here to obscure home directory