s4hts / HTStream

A high throughput sequence read toolset using a streaming approach facilitated by Linux pipes
https://s4hts.github.io/HTStream/
Apache License 2.0
49 stars 9 forks source link

Compiling from source fails on Ubuntu 22.04.1 #251

Closed amphioxus closed 1 year ago

amphioxus commented 1 year ago

After updating from Ubuntu 20.04 to the new 22.04 LTS version, HTStream no longer worked for me. (I had previously installed it from source.) I tried rebuilding it, but when running make, the build process stopped with an error at [ 12%] Building CXX object googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o

Since the external googletest library seemed like the culprit here, I downloaded the newest googletest release from https://github.com/google/googletest (v1.12.1) and placed the tar file (release-1.12.1.tar.gz) within ext/googletest of the HTStream repo.

I then changed the file cmake/gtest.cmake to use the updated googletest version instead of the included v.1.10.0 one. Here are the changes I applied:

$ git diff cmake/gtest.cmake

diff --git a/cmake/gtest.cmake b/cmake/gtest.cmake
index e10e50c..6b866a0 100644
--- a/cmake/gtest.cmake
+++ b/cmake/gtest.cmake
@@ -5,15 +5,15 @@ include(ExternalProject)

 execute_process(
-  COMMAND "tar" "-xzf" "${CMAKE_SOURCE_DIR}/ext/googletest/release-1.10.0.tar.gz"
+  COMMAND "tar" "-xzf" "${CMAKE_SOURCE_DIR}/ext/googletest/release-1.12.1.tar.gz"
   WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/ext/googletest"
   RESULT_VARIABLE tar_result
   )

-message(STATUS "tar result: ${tar_result} ${CMAKE_SOURCE_DIR}/ext/googletest/release-1.10.0.tar.gz")
+message(STATUS "tar result: ${tar_result} ${CMAKE_SOURCE_DIR}/ext/googletest/release-1.12.1.tar.gz")

 ExternalProject_Add(googletest
-  SOURCE_DIR "${CMAKE_SOURCE_DIR}/ext/googletest/googletest-release-1.10.0"
+  SOURCE_DIR "${CMAKE_SOURCE_DIR}/ext/googletest/googletest-release-1.12.1"
   CMAKE_ARGS -Dgtest_force_shared_crt=ON
   PREFIX "${CMAKE_CURRENT_BINARY_DIR}"

After running cmake .. and make again, the build succeeded and it seems like everything is working as it should. Maybe this info helps someone...

Thanks for this great tool! Armin

samhunter commented 1 year ago

Hi @amphioxus thanks for reporting this! I'm glad you like HTStream. Do you happen to know if you used statically linked libraries when you compiled from source (e.g. -DBUILD_STATIC_BIN=ON)? I ask because I include statically linked executables as part of the release (https://github.com/s4hts/HTStream/releases/download/v1.3.3/HTStream_v1.3.3.tar.gz), and now I wonder if they will stop working under 22.04. Either way it seems reasonable to upgrade HTStream so that it uses the latest version of googletest.

amphioxus commented 1 year ago

I didn't specifically use the -DBUILD_STATIC_BIN=ON flag when building, so I'm guessing it's using dynamically linked libraries. I just tested the 1.3.3. release you linked above and it works fine on 22.04.

Side note: The reason I built it from source in the first place was that the report JSON structure of the 1.3.0 release was slightly different than the one of the version I encountered when I took a class at UC Davis. (I thought 1.3.0 was the latest release because it’s used for the instructions on https://s4hts.github.io/HTStream/) The newer v1.3.3 release fixes the JSON issue as well for me, so I don't even have a need for building from source now. Thanks!

On Oct 18, 2022, at 10:50 PM, Sam Hunter @.***> wrote:

Hi @amphioxus https://github.com/amphioxus thanks for reporting this! I'm glad you like HTStream. Do you happen to know if you used statically linked libraries when you compiled from source (e.g. -DBUILD_STATIC_BIN=ON)? I ask because I include statically linked executables as part of the release (https://github.com/s4hts/HTStream/releases/download/v1.3.3/HTStream_v1.3.3.tar.gz https://github.com/s4hts/HTStream/releases/download/v1.3.3/HTStream_v1.3.3.tar.gz), and now I wonder if they will stop working under 22.04. Either way it seems reasonable to upgrade HTStream so that it uses the latest version of googletest.

— Reply to this email directly, view it on GitHub https://github.com/s4hts/HTStream/issues/251#issuecomment-1283465265, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJ6T47P4BHITQ6PZPR2PG3WD6DZ5ANCNFSM6AAAAAARHVAKM4. You are receiving this because you were mentioned.