luntergroup / octopus

Bayesian haplotype-based mutation calling
MIT License
301 stars 37 forks source link

cmake with custom htslib location #175

Closed jdmontenegro closed 3 years ago

jdmontenegro commented 3 years ago

Hi, I am trying to compile using cmake with a custom htslib location. The cmake command fails because it cannot find the htslib install location. How should I provide the custom HTSlib installation directory to the cmake command, so that uses it directly?

Best regards,

Juan D. montenegro

jdmontenegro commented 3 years ago

So, I just read issue 30 (https://github.com/luntergroup/octopus/issues/30) and try setting up the global variable. HTSLIB_ROOT to my custom install path and I got the same error:

$ export HTSLIB_ROOT=/soft/htslib/local_build $ sudo /soft/cmake-3.19.1/bin/cmake .. && make install [sudo] password for jmontenegro: -- Build type: Release -- Installation prefix: /soft/octopus/bin -- Linking against boost dynamic libraries -- Boost include dir: /usr/include -- Boost libraries: /usr/lib64/libboost_system.so/usr/lib64/libboost_filesystem.so/usr/lib64/libboost_program_options.so/usr/lib64/libboost_date_time.so/usr/lib64/libboost_log_setup.so/usr/lib64/libboost_log.so/usr/lib64/libboost_iostreams.so/usr/lib64/libboost_timer.so/usr/lib64/libboost_thread.so-pthread/usr/lib64/libboost_regex.so/usr/lib64/libboost_chrono.so/usr/lib64/libboost_atomic.so -- GMP_INCLUDES=/usr/include -- GMP include dir: /usr/include -- GMP libraries: /usr/lib64/libgmp.so HTSlib_INCLUDE_DIR=HTSlib_INCLUDE_DIR-NOTFOUND HTSlib_LIBRARY=HTSlib_LIBRARY-NOTFOUND CMake Error at build/cmake/modules/FindHTSlib.cmake:67 (message): Required library HTSlib NOT FOUND.

Install the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually. Call Stack (most recent call first): build/cmake/modules/FindHTSlib.cmake:149 (libfind_process) src/CMakeLists.txt:785 (find_package)

-- Configuring incomplete, errors occurred! See also "/soft/octopus/build/CMakeFiles/CMakeOutput.log". See also "/soft/octopus/build/CMakeFiles/CMakeError.log".

other dependencies:

GCC = 8,3 cmake = 3.19 gmp = 1:6.1.2

dancooke commented 3 years ago

Please try using the Python installation script. You can specify the htslib installation directory with the --htslib option. For example if you installed htslib to /usr/local (so headers are in /usr/local/include and library files are in /usr/local/lib) then you would have something like:

$ ./scripts/install.py --htslib /usr/local

Note that you can also specify Boost and GMP locations with the --boost and --gmp options in the same way.