gvbarroso / iSMC

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

compilation error #9

Closed AntoineHo closed 3 years ago

AntoineHo commented 3 years ago

Hello, I am trying to install the tool but I get an error, I believe this is due to versioning of libpp but I do not know how to solve it.

I will put below the compilation output. I installed these dependencies before compiling: sudo apt-get install libbpp-core-dev libbpp-phyl-dev libboost-dev libboost-iostreams-dev libbpp-seq-dev

Can you help me?

Cheers, Antoine

(base) ➜  iSMC git:(master) ✗ cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local -DUSE_LIBSIMPLEZIPHMM=/home/antoine/.local/lib/ 
CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.

-- Static linkage requested.
-- bpp-core 4.1.0 found:
--   static lib: /usr/lib/x86_64-linux-gnu/libbpp-core.a
--   shared lib: /usr/lib/x86_64-linux-gnu/libbpp-core.so.4.1.0
--   includes: /usr/include
-- bpp-seq 12.0.0 found:
--   static lib: /usr/lib/x86_64-linux-gnu/libbpp-seq.a
--   shared lib: /usr/lib/x86_64-linux-gnu/libbpp-seq.so.12.0.0
--   includes: /usr/include
-- bpp-phyl 12.0.0 found:
--   static lib: /usr/lib/x86_64-linux-gnu/libbpp-phyl.a
--   shared lib: /usr/lib/x86_64-linux-gnu/libbpp-phyl.so.12.0.0
--   includes: /usr/include
-- simpleziphmm 1.0.0 found:
--   static lib: /home/antoine/.local/lib/libsimpleziphmm.a
--   shared lib: /home/antoine/.local/lib/libsimpleziphmm.so.1.0.0
--   includes: /home/antoine/.local/include
-- Boost libraries found here:
   includes: /usr/include
   dynamic libraries: Boost::iostreams
-- Library z found here:
   includes: /usr/include
   static libraries: /usr/lib/x86_64-linux-gnu/libz.a
-- Library bz2 found here:
   includes: /usr/include
   static libraries: /usr/lib/x86_64-linux-gnu/libbz2.a
-- Library blas found here:
   includes: /usr/include/x86_64-linux-gnu
   static libraries: /usr/lib/x86_64-linux-gnu/libblas.a
-- Configuring done
-- Generating done
-- Build files have been written to: /home/antoine/Desktop/ismc/iSMC

(base) ➜  iSMC git:(master) ✗ make                                                                                     
[  6%] Built target ismc_mapper2
[ 13%] Built target ismc_mapper
[ 17%] Building CXX object src/CMakeFiles/ismc.dir/BaumWelch.cpp.o
In file included from /home/antoine/Desktop/ismc/iSMC/src/Psmc.h:26,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.h:17,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.cpp:11:
/home/antoine/Desktop/ismc/iSMC/src/SequentiallyMarkovCoalescent.h: In constructor ‘SequentiallyMarkovCoalescent::SequentiallyMarkovCoalescent(std::shared_ptr<OptionsContainer>, const std::vector<std::vector<unsigned char> >&)’:
/home/antoine/Desktop/ismc/iSMC/src/SequentiallyMarkovCoalescent.h:38:78: error: no matching function for call to ‘bpp::Parameter::Parameter(const char [6], double, const bpp::IntervalConstraint&)’
   38 |     addParameter_(new bpp::Parameter("theta", 1., bpp::Parameter::R_PLUS_STAR));
      |                                                                              ^
In file included from /usr/include/Bpp/Numeric/ParameterList.h:43,
                 from /usr/include/Bpp/Numeric/Parametrizable.h:49,
                 from /usr/include/Bpp/Numeric/AbstractParametrizable.h:44,
                 from /usr/include/Bpp/Numeric/AbstractParameterAliasable.h:43,
                 from /home/antoine/Desktop/ismc/iSMC/src/SequentiallyMarkovCoalescent.h:16,
                 from /home/antoine/Desktop/ismc/iSMC/src/Psmc.h:26,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.h:17,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.cpp:11:
/usr/include/Bpp/Numeric/Parameter.h:173:5: note: candidate: ‘bpp::Parameter::Parameter(const bpp::Parameter&)’
  173 |     Parameter(const Parameter& param);
      |     ^~~~~~~~~
/usr/include/Bpp/Numeric/Parameter.h:173:5: note:   candidate expects 1 argument, 3 provided
/usr/include/Bpp/Numeric/Parameter.h:167:5: note: candidate: ‘bpp::Parameter::Parameter(const string&, double, const bpp::Constraint*, double)’
  167 |     Parameter(const std::string& name, double value, const Constraint* constraint = 0, double precision=0);
      |     ^~~~~~~~~
/usr/include/Bpp/Numeric/Parameter.h:167:72: note:   no known conversion for argument 3 from ‘const bpp::IntervalConstraint’ to ‘const bpp::Constraint*’
  167 |     Parameter(const std::string& name, double value, const Constraint* constraint = 0, double precision=0);
      |                                                      ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
In file included from /usr/include/Bpp/Numeric/ParameterList.h:43,
                 from /usr/include/Bpp/Numeric/Parametrizable.h:49,
                 from /usr/include/Bpp/Numeric/AbstractParametrizable.h:44,
                 from /usr/include/Bpp/Numeric/AbstractParameterAliasable.h:43,
                 from /home/antoine/Desktop/ismc/iSMC/src/SequentiallyMarkovCoalescent.h:16,
                 from /home/antoine/Desktop/ismc/iSMC/src/Psmc.h:26,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.h:17,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.cpp:11:
/usr/include/Bpp/Numeric/Parameter.h:156:5: note: candidate: ‘bpp::Parameter::Parameter(const string&, double, bpp::Constraint*, bool, double)’
  156 |     Parameter(const std::string& name, double value, Constraint* constraint, bool attachConstraint, double precision=0);
      |     ^~~~~~~~~
/usr/include/Bpp/Numeric/Parameter.h:156:5: note:   candidate expects 5 arguments, 3 provided
/usr/include/Bpp/Numeric/Parameter.h:142:5: note: candidate: ‘bpp::Parameter::Parameter()’
  142 |     Parameter(): name_(""), value_(0), precision_(0), constraint_(0), attach_(true), listeners_(), listenerAttach_() {}
      |     ^~~~~~~~~
/usr/include/Bpp/Numeric/Parameter.h:142:5: note:   candidate expects 0 arguments, 3 provided
In file included from /home/antoine/Desktop/ismc/iSMC/src/Psmc.h:26,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.h:17,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.cpp:11:
/home/antoine/Desktop/ismc/iSMC/src/SequentiallyMarkovCoalescent.h:40:105: error: no matching function for call to ‘bpp::Parameter::Parameter(const char [4], double, const bpp::IntervalConstraint&)’
   40 |     addParameter_(new bpp::Parameter("rho", getParameterValue("theta") / 2., bpp::Parameter::R_PLUS_STAR));
      |                                                                                                         ^
In file included from /usr/include/Bpp/Numeric/ParameterList.h:43,
                 from /usr/include/Bpp/Numeric/Parametrizable.h:49,
                 from /usr/include/Bpp/Numeric/AbstractParametrizable.h:44,
                 from /usr/include/Bpp/Numeric/AbstractParameterAliasable.h:43,
                 from /home/antoine/Desktop/ismc/iSMC/src/SequentiallyMarkovCoalescent.h:16,
                 from /home/antoine/Desktop/ismc/iSMC/src/Psmc.h:26,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.h:17,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.cpp:11:
/usr/include/Bpp/Numeric/Parameter.h:173:5: note: candidate: ‘bpp::Parameter::Parameter(const bpp::Parameter&)’
  173 |     Parameter(const Parameter& param);
      |     ^~~~~~~~~
/usr/include/Bpp/Numeric/Parameter.h:173:5: note:   candidate expects 1 argument, 3 provided
/usr/include/Bpp/Numeric/Parameter.h:167:5: note: candidate: ‘bpp::Parameter::Parameter(const string&, double, const bpp::Constraint*, double)’
  167 |     Parameter(const std::string& name, double value, const Constraint* constraint = 0, double precision=0);
      |     ^~~~~~~~~
/usr/include/Bpp/Numeric/Parameter.h:167:72: note:   no known conversion for argument 3 from ‘const bpp::IntervalConstraint’ to ‘const bpp::Constraint*’
  167 |     Parameter(const std::string& name, double value, const Constraint* constraint = 0, double precision=0);
      |                                                      ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
In file included from /usr/include/Bpp/Numeric/ParameterList.h:43,
                 from /usr/include/Bpp/Numeric/Parametrizable.h:49,
                 from /usr/include/Bpp/Numeric/AbstractParametrizable.h:44,
                 from /usr/include/Bpp/Numeric/AbstractParameterAliasable.h:43,
                 from /home/antoine/Desktop/ismc/iSMC/src/SequentiallyMarkovCoalescent.h:16,
                 from /home/antoine/Desktop/ismc/iSMC/src/Psmc.h:26,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.h:17,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.cpp:11:
/usr/include/Bpp/Numeric/Parameter.h:156:5: note: candidate: ‘bpp::Parameter::Parameter(const string&, double, bpp::Constraint*, bool, double)’
  156 |     Parameter(const std::string& name, double value, Constraint* constraint, bool attachConstraint, double precision=0);
      |     ^~~~~~~~~
/usr/include/Bpp/Numeric/Parameter.h:156:5: note:   candidate expects 5 arguments, 3 provided
/usr/include/Bpp/Numeric/Parameter.h:142:5: note: candidate: ‘bpp::Parameter::Parameter()’
  142 |     Parameter(): name_(""), value_(0), precision_(0), constraint_(0), attach_(true), listeners_(), listenerAttach_() {}
      |     ^~~~~~~~~
/usr/include/Bpp/Numeric/Parameter.h:142:5: note:   candidate expects 0 arguments, 3 provided
In file included from /home/antoine/Desktop/ismc/iSMC/src/Psmc.h:26,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.h:17,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.cpp:11:
/home/antoine/Desktop/ismc/iSMC/src/SequentiallyMarkovCoalescent.h: In constructor ‘SequentiallyMarkovCoalescent::SequentiallyMarkovCoalescent(unsigned int, const string&, double, const std::vector<std::vector<unsigned char> >&)’:
/home/antoine/Desktop/ismc/iSMC/src/SequentiallyMarkovCoalescent.h:54:78: error: no matching function for call to ‘bpp::Parameter::Parameter(const char [6], double, const bpp::IntervalConstraint&)’
   54 |     addParameter_(new bpp::Parameter("theta", 1., bpp::Parameter::R_PLUS_STAR));
      |                                                                              ^
In file included from /usr/include/Bpp/Numeric/ParameterList.h:43,
                 from /usr/include/Bpp/Numeric/Parametrizable.h:49,
                 from /usr/include/Bpp/Numeric/AbstractParametrizable.h:44,
                 from /usr/include/Bpp/Numeric/AbstractParameterAliasable.h:43,
                 from /home/antoine/Desktop/ismc/iSMC/src/SequentiallyMarkovCoalescent.h:16,
                 from /home/antoine/Desktop/ismc/iSMC/src/Psmc.h:26,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.h:17,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.cpp:11:
/usr/include/Bpp/Numeric/Parameter.h:173:5: note: candidate: ‘bpp::Parameter::Parameter(const bpp::Parameter&)’
  173 |     Parameter(const Parameter& param);
      |     ^~~~~~~~~
/usr/include/Bpp/Numeric/Parameter.h:173:5: note:   candidate expects 1 argument, 3 provided
/usr/include/Bpp/Numeric/Parameter.h:167:5: note: candidate: ‘bpp::Parameter::Parameter(const string&, double, const bpp::Constraint*, double)’
  167 |     Parameter(const std::string& name, double value, const Constraint* constraint = 0, double precision=0);
      |     ^~~~~~~~~
/usr/include/Bpp/Numeric/Parameter.h:167:72: note:   no known conversion for argument 3 from ‘const bpp::IntervalConstraint’ to ‘const bpp::Constraint*’
  167 |     Parameter(const std::string& name, double value, const Constraint* constraint = 0, double precision=0);
      |                                                      ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
In file included from /usr/include/Bpp/Numeric/ParameterList.h:43,
                 from /usr/include/Bpp/Numeric/Parametrizable.h:49,
                 from /usr/include/Bpp/Numeric/AbstractParametrizable.h:44,
                 from /usr/include/Bpp/Numeric/AbstractParameterAliasable.h:43,
                 from /home/antoine/Desktop/ismc/iSMC/src/SequentiallyMarkovCoalescent.h:16,
                 from /home/antoine/Desktop/ismc/iSMC/src/Psmc.h:26,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.h:17,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.cpp:11:
/usr/include/Bpp/Numeric/Parameter.h:156:5: note: candidate: ‘bpp::Parameter::Parameter(const string&, double, bpp::Constraint*, bool, double)’
  156 |     Parameter(const std::string& name, double value, Constraint* constraint, bool attachConstraint, double precision=0);
      |     ^~~~~~~~~
/usr/include/Bpp/Numeric/Parameter.h:156:5: note:   candidate expects 5 arguments, 3 provided
/usr/include/Bpp/Numeric/Parameter.h:142:5: note: candidate: ‘bpp::Parameter::Parameter()’
  142 |     Parameter(): name_(""), value_(0), precision_(0), constraint_(0), attach_(true), listeners_(), listenerAttach_() {}
      |     ^~~~~~~~~
/usr/include/Bpp/Numeric/Parameter.h:142:5: note:   candidate expects 0 arguments, 3 provided
In file included from /home/antoine/Desktop/ismc/iSMC/src/Psmc.h:26,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.h:17,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.cpp:11:
/home/antoine/Desktop/ismc/iSMC/src/SequentiallyMarkovCoalescent.h:56:105: error: no matching function for call to ‘bpp::Parameter::Parameter(const char [4], double, const bpp::IntervalConstraint&)’
   56 |     addParameter_(new bpp::Parameter("rho", getParameterValue("theta") / 2., bpp::Parameter::R_PLUS_STAR));
      |                                                                                                         ^
In file included from /usr/include/Bpp/Numeric/ParameterList.h:43,
                 from /usr/include/Bpp/Numeric/Parametrizable.h:49,
                 from /usr/include/Bpp/Numeric/AbstractParametrizable.h:44,
                 from /usr/include/Bpp/Numeric/AbstractParameterAliasable.h:43,
                 from /home/antoine/Desktop/ismc/iSMC/src/SequentiallyMarkovCoalescent.h:16,
                 from /home/antoine/Desktop/ismc/iSMC/src/Psmc.h:26,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.h:17,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.cpp:11:
/usr/include/Bpp/Numeric/Parameter.h:173:5: note: candidate: ‘bpp::Parameter::Parameter(const bpp::Parameter&)’
  173 |     Parameter(const Parameter& param);
      |     ^~~~~~~~~
/usr/include/Bpp/Numeric/Parameter.h:173:5: note:   candidate expects 1 argument, 3 provided
/usr/include/Bpp/Numeric/Parameter.h:167:5: note: candidate: ‘bpp::Parameter::Parameter(const string&, double, const bpp::Constraint*, double)’
  167 |     Parameter(const std::string& name, double value, const Constraint* constraint = 0, double precision=0);
      |     ^~~~~~~~~
/usr/include/Bpp/Numeric/Parameter.h:167:72: note:   no known conversion for argument 3 from ‘const bpp::IntervalConstraint’ to ‘const bpp::Constraint*’
  167 |     Parameter(const std::string& name, double value, const Constraint* constraint = 0, double precision=0);
      |                                                      ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
In file included from /usr/include/Bpp/Numeric/ParameterList.h:43,
                 from /usr/include/Bpp/Numeric/Parametrizable.h:49,
                 from /usr/include/Bpp/Numeric/AbstractParametrizable.h:44,
                 from /usr/include/Bpp/Numeric/AbstractParameterAliasable.h:43,
                 from /home/antoine/Desktop/ismc/iSMC/src/SequentiallyMarkovCoalescent.h:16,
                 from /home/antoine/Desktop/ismc/iSMC/src/Psmc.h:26,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.h:17,
                 from /home/antoine/Desktop/ismc/iSMC/src/BaumWelch.cpp:11:
/usr/include/Bpp/Numeric/Parameter.h:156:5: note: candidate: ‘bpp::Parameter::Parameter(const string&, double, bpp::Constraint*, bool, double)’
  156 |     Parameter(const std::string& name, double value, Constraint* constraint, bool attachConstraint, double precision=0);
      |     ^~~~~~~~~
/usr/include/Bpp/Numeric/Parameter.h:156:5: note:   candidate expects 5 arguments, 3 provided
/usr/include/Bpp/Numeric/Parameter.h:142:5: note: candidate: ‘bpp::Parameter::Parameter()’
  142 |     Parameter(): name_(""), value_(0), precision_(0), constraint_(0), attach_(true), listeners_(), listenerAttach_() {}
      |     ^~~~~~~~~
/usr/include/Bpp/Numeric/Parameter.h:142:5: note:   candidate expects 0 arguments, 3 provided
make[2]: *** [src/CMakeFiles/ismc.dir/build.make:89: src/CMakeFiles/ismc.dir/BaumWelch.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:180: src/CMakeFiles/ismc.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
gvbarroso commented 3 years ago

Hi there!

It seems to me also that this has to do with the bpp version... I know that they were updating some things. @jydu , would you be able to help here?

jydu commented 3 years ago

Hi,

Indeed iSMC is currently out of sync with the BPP libraries (which are undergoing a major upgrade, so soon things will be easier). So to compile iSMC from sources, you need to get the BPP libraries from github:

git clone https://github.com/BioPP/bpp-core.git
git fetch
git checkout rel299
mkdir build
cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local
make install

and the same for bpp-seq and bpp-phyl. Please do not hesitate to report any further issue. Note: iSMC will currently NOT compile against the master branch of the BPP libraries!

Hope this helps,

Julien.

AntoineHo commented 3 years ago

Hello, Thanks for your help, the compilation of bpp-core works with git checkout rel299 but there seems to be no branch "rel299" for bpp-seq. So I cannot compile bpp-seq and bpp-phyl.

Just to be sure this is not an error in my understanding, here is what I have tried:

cd bpp-core
git fetch
git checkout rel299
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local ..
make
make install # <-- this works
cd ../../

cd bpp-seq
#git fetch
#git checkout rel299 # <-- does not work / cannot find the branch rel299
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local .. # <-- does not work with master or other recent branches
make
make install
cd ../../

Cheers, Antoine

jydu commented 3 years ago

Oups, should be fixed now! Thanks for reporting.

AntoineHo commented 3 years ago

Many thanks, it compiles now. Cheers