Skip to content

Commit

Permalink
update dorado to properly use openssl from EB and not install externa…
Browse files Browse the repository at this point in the history
…l EB libraries into its own lib directory.
  • Loading branch information
akesandgren committed Sep 2, 2024
1 parent 9c5ffc0 commit 5b9dc18
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ sources = [{
},
'filename': SOURCE_TAR_GZ,
}]
patches = ['dorado-0.7.3_include-fstream.patch']
patches = [
'%(name)s-%(version)s_include-fstream.patch',
'%(name)s-%(version)s_dont_install_external_libraries.patch',
]

checksums = [
None,
'a32cbd34185bcc5ae3d552a072e396825aa7184187cd11c70a4380618387a530',
'2a250d606c0ae17f47d99981309fa204a1394ddd81851a1d530dcd0aea2306ac',
]

builddependencies = [
Expand All @@ -45,7 +50,6 @@ dependencies = [
# don't link to OpenSSL static libraries
# fix for CMake Error "missing: OPENSSL_CRYPTO_LIBRARY" (if only shared OpenSSL libraries are available)
preconfigopts = "sed -i '/OPENSSL_USE_STATIC_LIBS TRUE/d' ../dorado/cmake/OpenSSL.cmake && "
preconfigopts += "export OPENSSL_ROOT_DIR=$EBROOTOPENSSL && "
# link in the ssl and crypto libs, to fix:
# undefined reference to symbol 'SSL_get_peer_certificate@@OPENSSL_1_1_0'
preconfigopts += "sed -i 's/OpenSSL::SSL/ssl\\n crypto/g' ../dorado/dorado/utils/CMakeLists.txt && "
Expand All @@ -63,12 +67,17 @@ preconfigopts += "sed -i 's/htslib/hts/g' ../dorado/dorado/utils/CMakeLists.txt
# cfr. https://github.com/nanoporetech/dorado/issues/779
preconfigopts += "sed -i 's/-Werror//g' ../dorado/cmake/Warnings.cmake && "

configopts = "-DDORADO_INSTALL_PATH=%(installdir)s "
configopts += "-DCUDA_TOOLKIT_ROOT_DIR=$EBROOTCUDA -DCMAKE_CUDA_COMPILER=$EBROOTCUDA/bin/nvcc "
configopts += "-DDORADO_LIBTORCH_DIR=$EBROOTPYTORCH/lib "
# add -pthread flag (in addition to -lpthread) to avoid linking error:
# in function `_GLOBAL__sub_I_mutex.cc': mutex.cc:(.text.startup+0x17): undefined reference to `pthread_atfork'
configopts += '-DCMAKE_C_FLAGS="$CFLAGS -pthread" '
_copts = [
"-DCUDA_TOOLKIT_ROOT_DIR=$EBROOTCUDA",
"-DCMAKE_CUDA_COMPILER=$EBROOTCUDA/bin/nvcc",
'-DOPENSSL_ROOT_DIR=$EBROOTOPENSSL',
"-DDORADO_LIBTORCH_DIR=$EBROOTPYTORCH/lib",
# add -pthread flag (in addition to -lpthread) to avoid linking error:
# in function `_GLOBAL__sub_I_mutex.cc': mutex.cc:(.text.startup+0x17): undefined reference to `pthread_atfork'
'-DCMAKE_C_FLAGS="$CFLAGS -pthread"',
]

configopts = ' '.join(_copts)

sanity_check_paths = {
'files': ['bin/dorado'],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Don't install external libraries in Dorado's lib directory.

Åke Sandgren, 2024-09-02
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a84c7524..0791dda8 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -431,7 +431,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
else()
# bundle the libraries from the cuda toolkit
file(GLOB NATIVE_CUDA_LIBS "${CUDAToolkit_TARGET_DIR}/targets/${CMAKE_SYSTEM_PROCESSOR}-linux/lib/${LIB}")
- install(FILES ${NATIVE_CUDA_LIBS} DESTINATION lib COMPONENT redist_libs)
+ #install(FILES ${NATIVE_CUDA_LIBS} DESTINATION lib COMPONENT redist_libs)
endif()
endforeach()

@@ -444,14 +444,14 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
RESOLVE_SYMLINKS("${DEBUG_LIBRARIES}" NEW_HDF_DEBUG_LIBRARIES)
foreach(HDF_LIB IN LISTS NEW_HDF_DEBUG_LIBRARIES)
if(${HDF_LIB} MATCHES "hdf5")
- install(FILES ${HDF_LIB} DESTINATION lib COMPONENT redist_libs CONFIGURATIONS Debug)
+ #install(FILES ${HDF_LIB} DESTINATION lib COMPONENT redist_libs CONFIGURATIONS Debug)
endif()
endforeach()
FILTER_LIST("${HDF5_C_LIBRARIES}" RELEASE_LIBRARIES optimized debug ${SHARED_LIB_EXT})
RESOLVE_SYMLINKS("${RELEASE_LIBRARIES}" NEW_HDF_RELEASE_LIBRARIES)
foreach(HDF_LIB IN LISTS NEW_HDF_RELEASE_LIBRARIES)
if(${HDF_LIB} MATCHES "hdf5")
- install(FILES ${HDF_LIB} DESTINATION lib COMPONENT redist_libs CONFIGURATIONS Release ReleaseWithDebInfo)
+ #install(FILES ${HDF_LIB} DESTINATION lib COMPONENT redist_libs CONFIGURATIONS Release ReleaseWithDebInfo)
endif()
endforeach()
endif()
@@ -459,17 +459,17 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_library(SZ_DLL sz REQUIRED)
get_filename_component(SZ_DLL_PATH ${SZ_DLL} DIRECTORY)
file(GLOB SZ_DLLS "${SZ_DLL_PATH}/libsz.so*")
- install(FILES ${SZ_DLLS} DESTINATION lib COMPONENT redist_libs)
+ #install(FILES ${SZ_DLLS} DESTINATION lib COMPONENT redist_libs)

find_library(AEC_DLL aec REQUIRED)
get_filename_component(AEC_DLL_PATH ${AEC_DLL} DIRECTORY)
file(GLOB AEC_DLLS "${AEC_DLL_PATH}/libaec.so*")
- install(FILES ${AEC_DLLS} DESTINATION lib COMPONENT redist_libs)
+ #install(FILES ${AEC_DLLS} DESTINATION lib COMPONENT redist_libs)

# If zstd has been dynamically linked, add the .so to the package
get_filename_component(ZSTD_LIBRARY_PATH ${ZSTD_LIBRARY_RELEASE} DIRECTORY)
file(GLOB ZSTD_DLLS "${ZSTD_LIBRARY_PATH}/*zstd.so*")
- install(FILES ${ZSTD_DLLS} DESTINATION lib COMPONENT redist_libs)
+ #install(FILES ${ZSTD_DLLS} DESTINATION lib COMPONENT redist_libs)

elseif(WIN32)
file(GLOB TORCH_DLLS "${TORCH_LIB}/lib/*.dll")

0 comments on commit 5b9dc18

Please sign in to comment.