gvbarroso / iSMC

The integrated Sequentially Markovian Coalescent
GNU General Public License v3.0
11 stars 3 forks source link

compilation failed #2

Closed hmoral closed 4 years ago

hmoral commented 4 years ago

Hello,

I was getting this type of errors during compilation:

In file included from /Users/nrv690/Documents/Software/iSMC/src/MmPsmc.cpp:23:
/Users/nrv690/Documents/Software/iSMC/src/MmPsmc.h:30:12: fatal error: 'zipHMM/viterbi.hpp' file not found
  #include <zipHMM/viterbi.hpp>
           ^~~~~~~~~~~~~~~~~~~~

Which I fixed by editing those files to the correct path:

  #include </usr/local/include/SimpleZipHMM/viterbi.hpp>
  #include </usr/local/include/SimpleZipHMM/forwarder.hpp>

But now I'm getting this error, that I don't know how to fix:


[ 13%] Built target ismc_mapper
[ 17%] Linking CXX executable ismc
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
Undefined symbols for architecture x86_64:
  "zipHMM::posterior_decoding(std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > const&, zipHMM::Matrix const&, zipHMM::Matrix const&, zipHMM::Matrix const&, zipHMM::Matrix&)", referenced from:
      MmPsmc::posteriorDecodingUsingZipHMM(unsigned long, unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, zipHMM::Matrix&, std::__1::vector<double, std::__1::allocator<double> >&) in MmPsmc.cpp.o
      MmPsmc::computePosteriorProbs(unsigned long, unsigned long, zipHMM::Matrix&, std::__1::vector<double, std::__1::allocator<double> >&) in MmPsmc.cpp.o
      Psmc::posteriorDecodingUsingZipHMM(unsigned long, unsigned long) in Psmc.cpp.o
  "zipHMM::Forwarder::read_from_directory(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, Psmc::computeBatchLogLikelihood_(std::__1::vector<std::__1::pair<unsigned long, unsigned long>, std::__1::allocator<std::__1::pair<unsigned long, unsigned long> > > const&)::$_1, unsigned long> >(void*) in Psmc.cpp.o
  "zipHMM::Forwarder::read_seq(std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > const&, unsigned long, unsigned long, unsigned long)", referenced from:
      Psmc::writeDataStructures() in Psmc.cpp.o
  "zipHMM::Forwarder::write_to_directory(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from:
      Psmc::writeDataStructures() in Psmc.cpp.o
  "zipHMM::Forwarder::forward(zipHMM::Matrix const&, zipHMM::Matrix const&, zipHMM::Matrix const&) const", referenced from:
      void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, Psmc::computeBatchLogLikelihood_(std::__1::vector<std::__1::pair<unsigned long, unsigned long>, std::__1::allocator<std::__1::pair<unsigned long, unsigned long> > > const&)::$_1, unsigned long> >(void*) in Psmc.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/ismc] Error 1
make[1]: *** [src/CMakeFiles/ismc.dir/all] Error 2
make: *** [all] Error 2```

thanks! 
jydu commented 4 years ago

Hi,

You need to tell CMake to use SimpleZipHMM instead of ZipHMM. In your build directory, type ccmake . and check that the USE_LIBSIMPLEZIPHMM is set to ON. Alternatively, run cmake -DUSE_LIBSIMPLEZIPHMM=ON .

Hope this helps,

Julien.