Skip to content
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

{bio}[foss/2023a] dorado v0.8.3 w/ CUDA 12.1.1 #21996

Merged
Merged
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
104 changes: 104 additions & 0 deletions easybuild/easyconfigs/d/dorado/dorado-0.8.3-foss-2023a-CUDA-12.1.1.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
easyblock = 'CMakeMake'

name = 'dorado'
version = '0.8.3'
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': '2023a'}
toolchainopts = {'usempi': True}

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_GZ,
}]
patches = [
'%(name)s-0.8.0_dont_install_external_libraries.patch',
]
checksums = [
None,
'28942b7057af00c574a5e70d33a58b4036fd09ae0b041f45b67581c8dda832b1',
]

builddependencies = [
('binutils', '2.40'),
('CMake', '3.26.3'),
('patchelf', '0.18.0'),
]

dependencies = [
('CUDA', '12.1.1', '', SYSTEM),
('OpenSSL', '1.1', '', SYSTEM),
('PyTorch', '2.1.2', '-CUDA-%(cudaver)s'),
('HDF5', '1.14.0'),
('zstd', '1.5.5'),
('HTSlib', '1.18'),
('kineto', '0.4.0'),
('libaec', '1.0.6'),
]

# 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 += "sed -i 's/OpenSSL::SSL/ssl\\n crypto/g' ../dorado/dorado/utils/CMakeLists.txt && "

# don't use vendored HTSlib, use provided HTSlib dependency
preconfigopts += "rm -r ../dorado/dorado/3rdparty/htslib/ && "
preconfigopts += "sed -i '/add_dependencies.*htslib_project/d' ../dorado/CMakeLists.txt && "
preconfigopts += "sed -i '/add_dependencies.*htslib_project/d' ../dorado/dorado/utils/CMakeLists.txt && "
preconfigopts += "sed -i '/Htslib.cmake/d' ../dorado/CMakeLists.txt && "
# link with -lhts, not -lhtslib
preconfigopts += "sed -i 's/htslib/hts/g' ../dorado/CMakeLists.txt && "
preconfigopts += "sed -i 's/htslib/hts/g' ../dorado/dorado/utils/CMakeLists.txt && "
preconfigopts += "sed -i 's/htslib/hts/g' ../dorado/dorado/torch_utils/CMakeLists.txt && "

# 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 && "

_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) + ' '

# disable CMake fiddling with RPATH when EasyBuild is configured to use RPATH linking
configopts += "$(if %(rpath_enabled)s; then "
configopts += "echo '-DCMAKE_SKIP_INSTALL_RPATH=YES -DCMAKE_SKIP_RPATH=YES'; fi) "

# CUDA libraries that are copied to installdir need to be patched to have an RPATH section
# when EasyBuild is configured to use RPATH linking (required to pass RPATH sanity check);
# by default, CMake sets RUNPATH to '$ORIGIN' rather than RPATH (but that's disabled above)
postinstallcmds = [
"if %(rpath_enabled)s; then "
" for lib in $(ls %(installdir)s/lib/lib{cu,nv}*.so*); do "
" echo setting RPATH in $lib;"
" patchelf --force-rpath --set-rpath '$ORIGIN' $lib;"
" done;"
"fi",
]

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

sanity_check_commands = ["dorado basecaller --help"]

moduleclass = 'bio'
Loading