-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
htslib not found by cmake #30
Comments
Hi Chris, Could you please conform how htslib was installed? You only need to specify
Should work. Note there is no space after the I've attached a bash script I wrote to install octopus on our centres CentOS cluster. It loads GCC and Python with Cheers, bash script to install octopus from scratch#!/usr/bin/env bash
# Summary: This script is for installing a fresh instance of the variant caller Octopus
# on the Wellcome Centres rescomp cluster.
# Author: Daniel Cooke (dcooke@well.ox.ac.uk)
# Date: 23/06/2018
##############################################
################# Config #####################
##############################################
# Dependency installation directory
DEPENDENCY_DIR=$(pwd)/local
# Dependency versions
GCC_VERSION=7.2.0
CMAKE_VERSION=3.11.4
BOOST_VERSION=1.67.0
HTSLIB_VERSION=master
PYTHON_VERSION=3.4.3
# Octopus version (Github branch or tag)
OCTOPUS_VERSION=master
# Number of threads for compiling
N_THREADS=4
##############################################
##############################################
echo "Loading available modules"
module load gcc/$GCC_VERSION
module load python/$PYTHON_VERSION
mkdir $DEPENDENCY_DIR
echo "Installing CMake ${CMAKE_VERSION}"
CMAKE_DIR=cmake-$CMAKE_VERSION
CMAKE_TAR=${CMAKE_DIR}.tar.gz
CMAKE_MAJOR_VERSION="${CMAKE_VERSION%.*}"
wget https://cmake.org/files/v${CMAKE_MAJOR_VERSION}/${CMAKE_TAR}
tar -xzvf $CMAKE_TAR
rm $CMAKE_TAR
cd $CMAKE_DIR
./bootstrap --prefix=$DEPENDENCY_DIR && make -j$N_THREADS && make install
cd ..
rm -rf $CMAKE_DIR
echo "Installing Boost ${BOOST_VERSION}"
BOOST_VERSION_=${BOOST_VERSION//[.]/_}
BOOST_DIR=boost_$BOOST_VERSION_
BOOST_TAR=${BOOST_DIR}.tar.gz
wget -O $BOOST_TAR http://sourceforge.net/projects/boost/files/boost/${BOOST_VERSION}/${BOOST_TAR}/download
tar -xzvf $BOOST_TAR
rm $BOOST_TAR
cd $BOOST_DIR
./bootstrap.sh --prefix=$DEPENDENCY_DIR --without-libraries=python,mpi
./b2 -j$N_THREADS cxxflags="-std=c++11"
./b2 install
cd ..
rm -rf $BOOST_DIR
echo "Installing htslib"
HTSLIB_DIR=htslib
git clone -b $HTSLIB_VERSION https://github.com/samtools/htslib.git
cd $HTSLIB_DIR
autoheader
autoconf
./configure --prefix=$DEPENDENCY_DIR
make -j$N_THREADS && make install
cd ..
rm -rf $HTSLIB_DIR
# Setup PATH
INCLUDE_PATH=$DEPENDENCY_DIR/include
CMAKE_PATH=$DEPENDENCY_DIR/bin
export PATH=$PATH:$INCLUDE_PATH:$CMAKE_PATH
export HTSLIB_ROOT=$DEPENDENCY_DIR
echo "Installing Octopus"
git clone -b $OCTOPUS_VERSION https://github.com/luntergroup/octopus.git
cd octopus
./scripts/install.py --boost $DEPENDENCY_DIR --threads $N_THREADS
cd ..
# Setup LD libraries
LIB_PATH=$DEPENDENCY_DIR/lib
export LD_LIBRARY_PATH=$LIB_PATH
# Add octopus to PATH
OCTOPUS_BIN_DIR=$(pwd)/octopus/bin
export PATH=$PATH:OCTOPUS_BIN_DIR
# Test installation
octopus --version
# Post installation instructions
LD_LIBRARY_EXPORT_CMD="export LD_LIBRARY_PATH=$LIB_PATH"
ADD_LD_LIBRARY_TO_BASHRC_CMD="echo '$LD_LIBRARY_EXPORT_CMD' >> ~/.bashrc"
echo "You may need to add linked libraries to LD_LIBRARY_PATH. To do this permanently use:"
echo " $ADD_LD_LIBRARY_TO_BASHRC_CMD"
PATH_STR='$PATH'
OCTOPUS_BIN_EXPORT_CMD="export PATH=$PATH_STR:$OCTOPUS_BIN_DIR"
ADD_OCTOPUS_BIN_TO_BASHRC_CMD="echo '$OCTOPUS_BIN_EXPORT_CMD' >> ~/.bashrc"
echo "Command to add octopus executable to .bashrc:"
echo " $ADD_OCTOPUS_BIN_TO_BASHRC_CMD" |
Hi Dan, Thanks for your reply and sorry for the delay, I was testing some of the following items:
My last attempt (item 5 above) still raised errors but reached 73% of the octopus "make install" command as you can see in the attached log file. Looks like issue is with boost. Maybe it can help to know that in the test item 4 above, lots of error in the "make install" of octopus that were parentheses related. such as: I thank you for your help to reach the 100% compilation :-) Addendum I thank you for your help to reach the 100% compilation :-) |
Thanks Chris. From attempt 5 it looks like GCC 8 is emitting a warning that previous GCC versions weren't (I hadn't included GCC 8 in my integration tests). There is a new octopus release coming out imminently, I'll make everything works with GCC 8. |
I've updated the Dockerfile on the develop branch to use GCC 8.1. This is now building and linking successfully. I had to change ./b2 -j2 cxxflags="-std=c++11" to ./b2 -j2 toolset=gcc-8 cxxflags="-std=c++14" To get Boost to link. |
Hi Dan, GCC_VERSION == 7.2.0 By doing so, I reached 100% of compilation but got an error on the last line [ 99%] Building CXX object src/CMakeFiles/octopus.dir/core/calling_components.cpp.o CMakeFiles/octopus.dir/config/option_parser.cpp.o (symbol from plugin): undefined reference to vtable for boost::program_options::abstract_variables_map' Hope it helps with the current version. I will wait for the coming version of octopus and let you know how it goes. |
Hi @ChristopheLegendre v0.5.0-beta is now available and should resolve this issue. Please re-open if you have any problems. |
Hi Dan, I just wanted to let you know that I successfully installed octopus-0.5.0-Beta on CentOS 7.2 using the following Dependencies: Dependency versionsGCC_VERSION=8.2.0 To do install Octopus, I modified the script you provided in this issue (see above), and in particular for compiling boost, as you recommended when using GCC8, I added the line: I hope this information will help other Octopus' users for installing the tool. Let me know if you have questions. Thanks, |
I tried to follow this (I installed loads of things through conda) and I also managed to compile it, but run into some problems during linking...
Is there something obvious I have done wrong / easy fix to it? If not, I will just try to properly install it in a clean env with the versions of stuff you mention here (I realized too late I should be paying attention to them). |
I tried to redo everything in a clean environment with versions mentioned here or higher, I still installed most of things through conda (all but htslib) but I still run in a similar problem with
|
@KamilSJaron What are your installation commands (step-by-step)? |
Hi @dancooke, sorry about the mess and thanks tons for looking to it. I extracted from the history things I did (cleaning the part that did not result in anything useful). Some of the conda commands are replacing the previous ones (at least gcc is installed there 3x).
Here it compiles everything but then crushes during linking. Now that I think about it, the problem might be that I might have updated gcc after I compiled htslib, so perhaps it would be worth getting all conda things installed first and then compile htslib and octopus. |
@KamilSJaron Please try the following: $ conda update conda
$ conda create --name octopus
$ conda activate octopus
$ conda install -c conda-forge gcc_linux-64 gxx_linux-64 make cmake distro boost-cpp gmp htslib icu bzip2 xz zlib
$ git clone https://github.com/luntergroup/octopus
$ octopus/scripts/install.py -c x86_64-conda-linux-gnu-gcc -cxx x86_64-conda-linux-gnu-g++ --boost ~/miniconda3/envs/octopus --gmp ~/miniconda3/envs/octopus --htslib ~/miniconda3/envs/octopus
$ octopus/bin/octopus --version assuming |
Hi Daniel and the Octopus' Contributors
Describe the bug
htslib directory is not found by cmake.
Command
Command line to run install octopus:
Desktop (please complete the following information):
Additional context
before running the command mentioned above and get the error below, we installed ALL the requirements in /tmp/ folder, i.e.:
Git 2.18.0
Boost 1.68
htslib 1.4
CMake 3.12.1
gcc 8.2
Actions we performed
part1
Then, we added directories of gcc 8.2. cmake 3.12.1, boost 1.68 and htslib 1.4 to the PATH, the LD_LIBRARY_PATH and LIBRARY_PATH variables.
part2
We also created the env variable as follow:
export HTSLIB_ROOT= /tmp/htslib-1.4
and also
export HTSLIB_DIR= /tmp/htslib-1.4
then we run cmake command as described above. We still got the Error Message below.
part3
We also added the file "HTSlibConfig.cmake" to the /tmp/htslib-1.4 directory.
cmake found that file, but not the requested information that should have been in that file; not knowing what information to add to the file and what CMAKE needs, it did not help fixing the issue
** ERROR Message from cmake**
CMake Error at src/CMakeLists.txt:564 (find_package):
By not providing "FindHTSlib.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "HTSlib", but
CMake did not find one.
Could not find a package configuration file provided by "HTSlib" (requested
version 1.4) with any of the following names:
HTSlibConfig.cmake
htslib-config.cmake
Add the installation prefix of "HTSlib" to CMAKE_PREFIX_PATH or set
"HTSlib_DIR" to a directory containing one of the above files. If "HTSlib"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!
Questions
Could you help us fixing this issue?
Could you provide further information needed to get cmake finding the HTSLIB folder?
Thanks.
Chris
The text was updated successfully, but these errors were encountered: