jessieren / VirHostMatcher

VirHostMatcher: matching hosts of viruses based on oligonucleotide frequency (ONF) comparison
Other
28 stars 5 forks source link

Compiling on Mac with clang #3

Open mooreryan opened 6 years ago

mooreryan commented 6 years ago

Hey, I'm having some trouble when using the default clang compiler on the Mac. I get errors like this

$ ./countKmer.out -l -k 1 -i test/toyexample/virus/AJ609634.fasta -o OUTPUT/tmp/KC/AJ609634.fasta -s AJ609634.fasta

option -l: the input file is longseq (need to concatenate lines).
option -k, the value of k, with value `1'
option -i, the input filename, with value `test/toyexample/virus/AJ609634.fasta'
option -o, the output directory, with value `OUTPUT/tmp/KC/AJ609634.fasta'
option -s, the short name, with value `AJ609634.fasta'
outputFileDir: OUTPUT/tmp/KC/AJ609634.fasta/
combinefileName: OUTPUT/tmp/KC/AJ609634.fasta/AJ609634.fasta_combine
dyld: lazy symbol binding failed: Symbol not found: __ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv
  Referenced from: VirHostMatcher/./countKmer.out
  Expected in: /usr/lib/libstdc++.6.dylib

dyld: Symbol not found: __ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv
  Referenced from: VirHostMatcher/./countKmer.out
  Expected in: /usr/lib/libstdc++.6.dylib

Abort trap: 6

Default version of g++ is

$ /usr/bin/g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.37)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

When I compile the c++ code using the gnu gcc compiler from Homebrew (in this case g++-7 (Homebrew GCC 7.2.0) 7.2.0) like this

$ CC="$(brew --prefix)/bin/g++-7" make

and then re-run everything, it works fine.

So (at least on my Mac -- OSX 10.12.6), it looks like the default clang gcc doesn't work but the gnu gcc does work.