gvbarroso / iSMC

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

Compilation error. Could not find a package configuration file provided by "bpp-phyl3" #15

Open ThomasBrazier opened 7 months ago

ThomasBrazier commented 7 months ago

Hello,

I am trying to install iSMC into a Docker, yet I have an issue at the compilation step. The system is Ubuntu Focal.

FROM biocontainers/biocontainers:v1.2.0_cv2

(...)

RUN apt update \
  && apt install -y \
  git \
  g++ \
  cmake\
  libbpp-core-dev \
  libbpp-seq-dev \
  libbpp-phyl-dev \
  libboost-iostreams-dev \
  libc6 \
  libgsl-dev \
  libopenblas-dev \
  libopenblas-pthread-dev \
  libopenblas-openmp-dev \
  ca-certificates \
  libssl-dev \
  libgmp-dev \
  libmpfr-dev \
  libgsl-dev \
  python3-dev \
  libgsl0-dev \
  python3-pip \
  && rm -rf /var/lib/apt/lists/*

RUN git clone https://gitlab.gwdg.de/molsysevol/simple-ziphmm && \
  cd simple-ziphmm &&\
  cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local &&\
  make &&\
  make install &&\
  cd ..

RUN git clone https://github.com/gvbarroso/iSMC.git && \
  cd iSMC && \
  cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local -DBUILD_STATIC=ON && \
  make && \
  make install && \
  cd ..

Everything is going fine until the iSMC layer. The error message is:

0.280 Cloning into 'iSMC'...
0.917 CMake Warning:
0.917   No source or binary directory provided.  Both will be assumed to be the
0.917   same as the current working directory, but note that this warning will
0.917   become a fatal error in future CMake releases.
0.917 
0.917 
0.966 -- The CXX compiler identification is GNU 9.3.0
0.970 -- Check for working CXX compiler: /usr/bin/c++
1.049 -- Check for working CXX compiler: /usr/bin/c++ -- works
1.049 -- Detecting CXX compiler ABI info
1.111 -- Detecting CXX compiler ABI info - done
1.119 -- Detecting CXX compile features
1.119 -- Detecting CXX compile features - done
1.120 -- Static linkage requested.
1.124 CMake Error at CMakeLists.txt:56 (FIND_PACKAGE):
1.124   By not providing "Findbpp-phyl3.cmake" in CMAKE_MODULE_PATH this project
1.124   has asked CMake to find a package configuration file provided by
1.124   "bpp-phyl3", but CMake did not find one.
1.124 
1.124   Could not find a package configuration file provided by "bpp-phyl3"
1.124   (requested version 1.0.0) with any of the following names:
1.124 
1.124     bpp-phyl3Config.cmake
1.124     bpp-phyl3-config.cmake
1.124 
1.124   Add the installation prefix of "bpp-phyl3" to CMAKE_PREFIX_PATH or set
1.124   "bpp-phyl3_DIR" to a directory containing one of the above files.  If
1.124   "bpp-phyl3" provides a separate development package or SDK, be sure it has
1.124   been installed.
1.124 
1.124 
1.124 -- Configuring incomplete, errors occurred!
1.124 See also "/data/iSMC/CMakeFiles/CMakeOutput.log".

The error seems related to Bio++ libraries. bbp-core, bbp-seq and bpp-phyl are version 2.4.1 but Cmake is looking for version bpp-phyl3 3.0.0 instead of bpp-phyl.

Do you have an idea of the problem or a way to fix it?

Thank you,

Thomas Brazier

jydu commented 7 months ago

Hi Thomas,

If you would like to compile the latest version of iSMC from sources, you need to install the latest development version of the Bio++ libraries, from their github repositories.

Hope this helps,

Julien.

ThomasBrazier commented 7 months ago

Thanks,

It helped me to go further, but I am not sure of the branch to use in github repositories. The 'main' branch is the most recent and the 'devel' is four years old.

Which branch do you recommend for the three bpp repositories?

I installed the main branch like this:

RUN git clone https://github.com/BioPP/bpp-core.git && \
    cd bpp-core && \
    cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local -DBUILD_STATIC=ON && \
    make install && \
    cd ..

RUN git clone https://github.com/BioPP/bpp-seq.git && \
    cd bpp-seq && \
    cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local -DBUILD_STATIC=ON && \
    make install && \
    cd ..

RUN git clone https://github.com/BioPP/bpp-phyl.git && \
    cd bpp-phyl && \
    cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local -DBUILD_STATIC=ON && \
    make install && \
    cd ..

And I finally got a new error with the main branch :

22.93 [ 24%] Building CXX object src/CMakeFiles/ismc.dir/BaumWelch.cpp.o
23.87 In file included from /iSMC/src/Psmc.h:26,
23.87                  from /iSMC/src/BaumWelch.h:17,
23.87                  from /iSMC/src/BaumWelch.cpp:11:
23.87 /iSMC/src/SequentiallyMarkovCoalescent.h: In constructor 'SequentiallyMarkovCoalescent::SequentiallyMarkovCoalescent(unsigned int, const string&, double, const bpp::ParameterList&)':
23.87 /iSMC/src/SequentiallyMarkovCoalescent.h:83:71: error: no matching function for call to 'bpp::Parameter::Parameter(const std::shared_ptr<bpp::Parameter>&)'
23.87    83 |     addParameter_(new bpp::Parameter(optimParams.getParameter("theta")));
23.87       |                                                                       ^
23.87 In file included from /root/.local/include/Bpp/Numeric/ParameterList.h:11,
23.87                  from /root/.local/include/Bpp/Numeric/Parametrizable.h:15,
23.87                  from /root/.local/include/Bpp/Numeric/AbstractParametrizable.h:9,
23.87                  from /root/.local/include/Bpp/Numeric/AbstractParameterAliasable.h:9,
23.87                  from /iSMC/src/SequentiallyMarkovCoalescent.h:16,
23.87                  from /iSMC/src/Psmc.h:26,
23.87                  from /iSMC/src/BaumWelch.h:17,
23.87                  from /iSMC/src/BaumWelch.cpp:11:
23.87 /root/.local/include/Bpp/Numeric/Parameter.h:131:3: note: candidate: 'bpp::Parameter::Parameter(const bpp::Parameter&)'
23.87   131 |   Parameter(const Parameter& param);
23.87       |   ^~~~~~~~~
23.87 /root/.local/include/Bpp/Numeric/Parameter.h:131:30: note:   no known conversion for argument 1 from 'const std::shared_ptr<bpp::Parameter>' to 'const bpp::Parameter&'
23.87   131 |   Parameter(const Parameter& param);
23.87       |             ~~~~~~~~~~~~~~~~~^~~~~
23.87 /root/.local/include/Bpp/Numeric/Parameter.h:124:3: note: candidate: 'bpp::Parameter::Parameter(const string&, double, std::shared_ptr<bpp::ConstraintInterface>, double)'
23.87   124 |   Parameter(const std::string& name, double value, std::shared_ptr<ConstraintInterface> constraint = 0, double precision = 0);
23.87       |   ^~~~~~~~~
23.87 /root/.local/include/Bpp/Numeric/Parameter.h:124:3: note:   candidate expects 4 arguments, 1 provided
23.87 In file included from /root/.local/include/Bpp/Numeric/ParameterList.h:11,
23.87                  from /root/.local/include/Bpp/Numeric/Parametrizable.h:15,
23.87                  from /root/.local/include/Bpp/Numeric/AbstractParametrizable.h:9,
23.87                  from /root/.local/include/Bpp/Numeric/AbstractParameterAliasable.h:9,
23.87                  from /iSMC/src/SequentiallyMarkovCoalescent.h:16,
23.87                  from /iSMC/src/Psmc.h:26,
23.87                  from /iSMC/src/BaumWelch.h:17,
23.87                  from /iSMC/src/BaumWelch.cpp:11:
23.87 /root/.local/include/Bpp/Numeric/Parameter.h:113:3: note: candidate: 'bpp::Parameter::Parameter()'
23.87   113 |   Parameter() : name_(""), value_(0), precision_(0), constraint_(0), listeners_() {}
23.87       |   ^~~~~~~~~
23.87 /root/.local/include/Bpp/Numeric/Parameter.h:113:3: note:   candidate expects 0 arguments, 1 provided
23.87 In file included from /iSMC/src/Psmc.h:26,
23.87                  from /iSMC/src/BaumWelch.h:17,
23.87                  from /iSMC/src/BaumWelch.cpp:11:
23.87 /iSMC/src/SequentiallyMarkovCoalescent.h:84:69: error: no matching function for call to 'bpp::Parameter::Parameter(const std::shared_ptr<bpp::Parameter>&)'
23.87    84 |     addParameter_(new bpp::Parameter(optimParams.getParameter("rho")));
23.87       |                                                                     ^
23.87 In file included from /root/.local/include/Bpp/Numeric/ParameterList.h:11,
23.87                  from /root/.local/include/Bpp/Numeric/Parametrizable.h:15,
23.87                  from /root/.local/include/Bpp/Numeric/AbstractParametrizable.h:9,
23.87                  from /root/.local/include/Bpp/Numeric/AbstractParameterAliasable.h:9,
23.87                  from /iSMC/src/SequentiallyMarkovCoalescent.h:16,
23.87                  from /iSMC/src/Psmc.h:26,
23.87                  from /iSMC/src/BaumWelch.h:17,
23.87                  from /iSMC/src/BaumWelch.cpp:11:
23.87 /root/.local/include/Bpp/Numeric/Parameter.h:131:3: note: candidate: 'bpp::Parameter::Parameter(const bpp::Parameter&)'
23.87   131 |   Parameter(const Parameter& param);
23.87       |   ^~~~~~~~~
23.87 /root/.local/include/Bpp/Numeric/Parameter.h:131:30: note:   no known conversion for argument 1 from 'const std::shared_ptr<bpp::Parameter>' to 'const bpp::Parameter&'
23.87   131 |   Parameter(const Parameter& param);
23.87       |             ~~~~~~~~~~~~~~~~~^~~~~
23.87 /root/.local/include/Bpp/Numeric/Parameter.h:124:3: note: candidate: 'bpp::Parameter::Parameter(const string&, double, std::shared_ptr<bpp::ConstraintInterface>, double)'
23.87   124 |   Parameter(const std::string& name, double value, std::shared_ptr<ConstraintInterface> constraint = 0, double precision = 0);
23.87       |   ^~~~~~~~~
23.87 /root/.local/include/Bpp/Numeric/Parameter.h:124:3: note:   candidate expects 4 arguments, 1 provided
23.87 In file included from /root/.local/include/Bpp/Numeric/ParameterList.h:11,
23.87                  from /root/.local/include/Bpp/Numeric/Parametrizable.h:15,
23.87                  from /root/.local/include/Bpp/Numeric/AbstractParametrizable.h:9,
23.87                  from /root/.local/include/Bpp/Numeric/AbstractParameterAliasable.h:9,
23.87                  from /iSMC/src/SequentiallyMarkovCoalescent.h:16,
23.87                  from /iSMC/src/Psmc.h:26,
23.87                  from /iSMC/src/BaumWelch.h:17,
23.87                  from /iSMC/src/BaumWelch.cpp:11:
23.87 /root/.local/include/Bpp/Numeric/Parameter.h:113:3: note: candidate: 'bpp::Parameter::Parameter()'
23.87   113 |   Parameter() : name_(""), value_(0), precision_(0), constraint_(0), listeners_() {}
23.87       |   ^~~~~~~~~
23.87 /root/.local/include/Bpp/Numeric/Parameter.h:113:3: note:   candidate expects 0 arguments, 1 provided
25.31 make[2]: *** [src/CMakeFiles/ismc.dir/build.make:89: src/CMakeFiles/ismc.dir/BaumWelch.cpp.o] Error 1
25.31 make[1]: *** [CMakeFiles/Makefile2:180: src/CMakeFiles/ismc.dir/all] Error 2
25.31 make: *** [Makefile:152: all] Error 2
jydu commented 7 months ago

Hi,

The master branch is the right one. I noticed the error and just fixed it, if you pull from iSMC it should now hopefully work (this is due to a recent upstream update in bpp-core).

Julien.