Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
easyblock = 'CMakeMake'

name = 'dorado'
version = '1.4.0'
versionsuffix = '-CUDA-%(cudaver)s'

homepage = 'https://github.com/nanoporetech/dorado'
description = """Dorado is a high-performance, easy-to-use, open source basecaller for Oxford Nanopore reads."""

toolchain = {'name': 'foss', 'version': '2025a'}
toolchainopts = {'usempi': False}

source_urls = ['https://github.com/nanoporetech/dorado/archive/']
sources = [{
'git_config': {
'url': 'https://github.com/nanoporetech',
'repo_name': name,
'tag': 'v%(version)s',
'recursive': True,
},
'filename': SOURCE_TAR_XZ,
}]
patches = [
'dorado-1.4.0_fix-hts-cmake.patch',
'dorado-1.4.0_fix-TestUtils.h.patch',
]
checksums = [
{'dorado-1.4.0.tar.xz': 'b65aaaeacd9169ecf3722b4e37956f74ae4ac9ce09827d3bb4cdef1ec82e6965'},
{'dorado-1.4.0_fix-hts-cmake.patch': 'b99f268086650462437cc252040bb8636dfe1e1bbb566e65590fd3401d63f2a0'},
{'dorado-1.4.0_fix-TestUtils.h.patch': 'f99f0de9506ad9e58be508ae353546e94eb77c6ae5b085637060ec83331ad5ed'},
]

builddependencies = [
('CMake', '3.31.3'),
('git', '2.49.0'),
]

dependencies = [
('CUDA', '12.8.0', '', SYSTEM),
('Python', '3.13.1'),
('OpenSSL', '3', '', SYSTEM),
('PyTorch', '2.9.1', versionsuffix),
('HDF5', '1.14.6'),
('zstd', '1.5.6'),
('HTSlib', '1.22.1'),
('kineto', '20260317', versionsuffix),
('libaec', '1.1.4'),
]

# 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 && "
# link in the ssl and crypto libs, to fix:
# undefined reference to symbol 'SSL_get_peer_certificate@@OPENSSL_1_1_0'
preconfigopts += r"sed -i 's/OpenSSL::SSL/ssl\n crypto/g' ../dorado/dorado/utils/CMakeLists.txt && "
# replace dont_install_external_libraries.patch by sed cmd - use system CUDA
preconfigopts += "sed -i '/install(FILES ${NATIVE_CUDA_LIBS} DESTINATION lib COMPONENT redist_libs)/d' "
preconfigopts += "../dorado/cmake/InstallRedistLibs.cmake && "
# disable treating warnings like errors by stripping out -Werror
# cfr. https://github.com/nanoporetech/dorado/issues/779
preconfigopts += "sed -i 's/-Werror//g' ../dorado/cmake/Warnings.cmake && "

local_torch_root_py = 'import torch, pathlib; print(pathlib.Path(torch.__file__).resolve().parent)'
configopts = ' '.join([
"-DCUDA_TOOLKIT_ROOT_DIR=$EBROOTCUDA",
"-DCMAKE_CUDA_COMPILER=$EBROOTCUDA/bin/nvcc",
'-DOPENSSL_ROOT_DIR=$EBROOTOPENSSL',
'-DCMAKE_C_FLAGS="$CFLAGS -pthread"',
'-DCMAKE_CXX_FLAGS="$CXXFLAGS -pthread"',
# let torch find its files - different paths for PyTorch from sources and wheels
rf'''-DDORADO_LIBTORCH_DIR="$(python -s -c '{local_torch_root_py}')"''',
r'''-DCMAKE_PREFIX_PATH="$(python -s -c 'import torch; print(torch.utils.cmake_prefix_path)')"''',
]) + ' '

runtest = True

sanity_check_paths = {
'files': ['bin/dorado'],
'dirs': [],
}

sanity_check_commands = ["dorado basecaller --help"]

moduleclass = 'bio'
23 changes: 23 additions & 0 deletions easybuild/easyconfigs/d/dorado/dorado-1.4.0_fix-TestUtils.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Replace std::filesystem::remove_all with rm -rf in test temp-dir cleanup to avoid
segfault with PyTorch 2.9.1-loaded filesystem symbols
Author: Pavel Tomanek (Inuits/Ugent) with help of ChatGPT5.4
--- tests/TestUtils.h.orig 2026-03-27 16:30:29.957036727 +0100
+++ tests/TestUtils.h 2026-03-27 16:31:17.700602831 +0100
@@ -2,6 +2,7 @@

#include <spdlog/spdlog.h>

+#include <cstdlib>
#include <cstring>
#include <filesystem>
#include <string>
@@ -44,7 +45,8 @@
while (!deleted && tries < 5) {
try {
tries++;
- deleted = std::filesystem::remove_all(m_path);
+ std::string cmd = "rm -rf -- \"" + m_path.string() + "\"";
+ deleted = (std::system(cmd.c_str()) == 0) ? 1 : 0;
} catch (std::exception& e) {
std::string what = e.what();
spdlog::warn(what);
118 changes: 118 additions & 0 deletions easybuild/easyconfigs/d/dorado/dorado-1.4.0_fix-hts-cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
Replace vendored HTSlib CMake integration with system HTSlib target
Author: Pavel Tomanek (Inuits/Ugent) with help of ChatGPT5.4
--- cmake/Htslib.cmake.orig 2026-03-27 16:02:28.928335000 +0100
+++ cmake/Htslib.cmake 2026-03-27 16:03:27.115524695 +0100
@@ -1,100 +1,14 @@
-if(NOT TARGET htslib) # lazy include guard
- if(WIN32)
- message(STATUS "Fetching htslib")
- download_and_extract(
- ${DORADO_CDN_URL}/htslib-win-v1.22.1.tar.gz
- htslib-win
- "8cedc027d0c796e6fe6c8e30fe8ec161c46122d9ab66d5d6339f039ffc91b2ea"
- )
- set(HTSLIB_DIR ${DORADO_3RD_PARTY_DOWNLOAD}/htslib-win CACHE STRING
- "Path to htslib repo")
- add_library(htslib SHARED IMPORTED)
- set_target_properties(htslib PROPERTIES
- "IMPORTED_IMPLIB" ${HTSLIB_DIR}/hts-3.lib
- "IMPORTED_LOCATION" ${HTSLIB_DIR}/hts-3.dll
- "INTERFACE_INCLUDE_DIRECTORIES" ${HTSLIB_DIR})
- target_link_directories(htslib INTERFACE ${HTSLIB_DIR})
- else()
- message(STATUS "Setting up htslib build")
- set(HTSLIB_DIR ${DORADO_3RD_PARTY_SOURCE}/htslib CACHE STRING "Path to htslib repo")
- set(htslib_PREFIX ${CMAKE_BINARY_DIR}/3rdparty/htslib)
-
- find_program(MAKE_COMMAND make REQUIRED)
- find_program(AUTOCONF_COMMAND autoconf REQUIRED)
- find_program(AUTOHEADER_COMMAND autoheader REQUIRED)
- execute_process(
- COMMAND bash -c "${AUTOCONF_COMMAND} -V | sed 's/.* //; q'"
- OUTPUT_VARIABLE AUTOCONF_VERS
- COMMAND_ERROR_IS_FATAL ANY
- )
- if (AUTOCONF_VERS VERSION_GREATER_EQUAL 2.70 AND NOT CMAKE_GENERATOR STREQUAL "Xcode")
- set(AUTOCONF_COMMAND autoreconf --install)
- endif()
-
- # htslib will only try to build the .so as PIC, but ont_core needs it all as PIC.
- unset(hts_cflags)
- if (LINUX)
- set(hts_cflags "-fPIC")
- endif()
-
- # If we're building with sanitizers then we need to build htslib the same way.
- if (ECM_ENABLE_SANITIZERS MATCHES "address")
- set(hts_cflags "${hts_cflags} -g -fsanitize=address")
- endif()
- if (ECM_ENABLE_SANITIZERS MATCHES "undefined")
- set(hts_cflags "${hts_cflags} -g -fsanitize=undefined")
- endif()
- if (ECM_ENABLE_SANITIZERS MATCHES "thread")
- set(hts_cflags "${hts_cflags} -g -fsanitize=thread")
- endif()
-
- unset(hts_configure_flags)
- if (hts_cflags)
- set(hts_configure_flags "CPPFLAGS=${hts_cflags}" "LDFLAGS=${hts_cflags}")
- endif()
-
- # Parallelise the htslib build too, though not enough to compete with the main build.
- include(ProcessorCount)
- ProcessorCount(nproc)
- math(EXPR htslib_build_jobs "${nproc} / 4")
- if (htslib_build_jobs EQUAL 0)
- set(htslib_build_jobs 1)
- endif()
-
- # The Htslib build apparently requires BUILD_IN_SOURCE=1, which is a problem when
- # switching between build targets because htscodecs object files aren't regenerated.
- # To avoid this, copy the source tree to a build-specific directory and do the build there.
- set(HTSLIB_BUILD ${CMAKE_BINARY_DIR}/htslib_build)
- file(COPY ${HTSLIB_DIR} DESTINATION ${HTSLIB_BUILD})
-
- include(ExternalProject)
- ExternalProject_Add(htslib_project
- PREFIX ${HTSLIB_BUILD}
- SOURCE_DIR ${HTSLIB_BUILD}/htslib
- BUILD_IN_SOURCE 1
- CONFIGURE_COMMAND ${AUTOHEADER_COMMAND}
- COMMAND ${AUTOCONF_COMMAND}
- COMMAND ./configure --disable-bz2 --disable-lzma --disable-libcurl --disable-s3 --disable-gcs --without-libdeflate ${hts_configure_flags}
- BUILD_COMMAND ${MAKE_COMMAND} -j${htslib_build_jobs} install prefix=${htslib_PREFIX}
- COMMAND ${INSTALL_NAME}
- INSTALL_COMMAND ""
- BUILD_BYPRODUCTS ${htslib_PREFIX}/lib/libhts.a
- LOG_CONFIGURE 0
- LOG_BUILD 0
- LOG_TEST 0
- LOG_INSTALL 0
- )
-
- add_library(htslib STATIC IMPORTED)
- # Need to ensure this directory exists before we can add it to INTERFACE_INCLUDE_DIRECTORIES
- file(MAKE_DIRECTORY ${htslib_PREFIX}/include)
- set_target_properties(htslib
- PROPERTIES
- "IMPORTED_LOCATION" ${htslib_PREFIX}/lib/libhts.a
- "INTERFACE_INCLUDE_DIRECTORIES" ${htslib_PREFIX}/include)
- message(STATUS "Done configuring htslib")
-
- # Make sure that the project is built before any targets try to use it.
- add_dependencies(htslib htslib_project)
- endif()
+if(NOT TARGET htslib)
+ find_package(htslib QUIET NO_MODULE)
+ if(htslib_FOUND AND TARGET htslib::hts)
+ add_library(htslib INTERFACE IMPORTED)
+ target_link_libraries(htslib INTERFACE htslib::hts)
+ message(STATUS "Using system htslib via config package")
+ else()
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(HTSLIB REQUIRED IMPORTED_TARGET htslib)
+ add_library(htslib INTERFACE IMPORTED)
+ target_link_libraries(htslib INTERFACE PkgConfig::HTSLIB)
+ message(STATUS "Using system htslib via pkg-config")
+ endif()
endif()
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
easyblock = 'CMakeMake'

name = 'kineto'
version = '20260317'
local_commit = '7d860f2'
versionsuffix = '-CUDA-%(cudaver)s'

homepage = 'https://github.com/pytorch/kineto'
description = "A CPU+GPU Profiling library that provides access to timeline traces and hardware performance counters"

toolchain = {'name': 'GCC', 'version': '14.2.0'}

source_urls = ['https://github.com/pytorch/kineto/archive/']
sources = [{
'git_config': {
'url': 'https://github.com/pytorch',
'repo_name': name,
'commit': local_commit,
'recursive': True,
},
'filename': SOURCE_TAR_XZ,
}]
checksums = ['015ad66abc07c4120be0789168d34f5537dc8b87b0ad96775a3ba70a18894c96']

builddependencies = [
('CMake', '3.31.3'),
('Python', '3.13.1'),
]
dependencies = [('CUDA', '12.8.0', '', SYSTEM)]

start_dir = 'libkineto'

sanity_check_paths = {
'files': ['lib/libkineto.a'],
'dirs': ['include/kineto'],
}

moduleclass = 'perf'
Loading