-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2382 from easybuilders/4.3.x
release EasyBuild v4.3.4
- Loading branch information
Showing
23 changed files
with
343 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,13 +18,11 @@ | |
@author: Kenneth Hoste (Ghent University) | ||
@author: George Tsouloupas <[email protected]> | ||
""" | ||
|
||
import os | ||
import shutil | ||
from distutils.version import LooseVersion | ||
|
||
from easybuild.easyblocks.generic.configuremake import ConfigureMake | ||
from easybuild.tools.build_log import EasyBuildError | ||
from easybuild.tools.filetools import copy_file, mkdir | ||
|
||
|
||
class EB_BWA(ConfigureMake): | ||
|
@@ -35,45 +33,55 @@ class EB_BWA(ConfigureMake): | |
def __init__(self, *args, **kwargs): | ||
"""Add extra config options specific to BWA.""" | ||
super(EB_BWA, self).__init__(*args, **kwargs) | ||
self.files = [] | ||
|
||
def configure_step(self): | ||
""" | ||
Empty function as bwa comes with _no_ configure script | ||
""" | ||
self.files = ["bwa", "qualfa2fq.pl", "xa2multi.pl"] | ||
if LooseVersion(self.version) < LooseVersion("0.7.0"): | ||
self.files = ['bwa', 'qualfa2fq.pl', 'xa2multi.pl'] | ||
if LooseVersion(self.version) < LooseVersion('0.7.0'): | ||
# solid2fastq was dropped in recent versions because the same functionality | ||
# is covered by other tools already | ||
# cfr. http://osdir.com/ml/general/2010-10/msg26205.html | ||
self.files.append("solid2fastq.pl") | ||
self.files.append('solid2fastq.pl') | ||
|
||
def configure_step(self): | ||
""" | ||
Empty function as BWA comes with _no_ configure script | ||
""" | ||
pass | ||
|
||
def build_step(self): | ||
"""Custom build procedure: pass down compiler command and options as arguments to 'make'.""" | ||
|
||
for env_var in ('CC', 'CFLAGS'): | ||
if env_var + '=' not in self.cfg['buildopts']: | ||
self.cfg.update('buildopts', env_var + '="$' + env_var + '"') | ||
|
||
super(EB_BWA, self).build_step() | ||
|
||
def install_step(self): | ||
""" | ||
Install by copying files to install dir | ||
""" | ||
srcdir = self.cfg['start_dir'] | ||
destdir = os.path.join(self.installdir, 'bin') | ||
mandir = os.path.join(self.installdir, 'man') | ||
manman1dir = os.path.join(self.installdir, 'man/man1') | ||
mkdir(destdir) | ||
for filename in self.files: | ||
srcfile = os.path.join(srcdir, filename) | ||
copy_file(srcfile, destdir) | ||
|
||
manfile = os.path.join(srcdir, 'bwa.1') | ||
srcfile = None | ||
try: | ||
os.makedirs(destdir) | ||
os.makedirs(mandir) | ||
os.makedirs(manman1dir) | ||
for filename in self.files: | ||
srcfile = os.path.join(srcdir, filename) | ||
shutil.copy2(srcfile, destdir) | ||
shutil.copy2(manfile, manman1dir) | ||
except OSError as err: | ||
raise EasyBuildError("Copying %s to installation dir %s failed: %s", srcfile, destdir, err) | ||
manman1dir = os.path.join(self.installdir, 'man', 'man1') | ||
mkdir(manman1dir, parents=True) | ||
copy_file(manfile, manman1dir) | ||
|
||
def sanity_check_step(self): | ||
"""Custom sanity check for BWA.""" | ||
|
||
custom_paths = { | ||
'files': ["bin/%s" % x for x in self.files], | ||
'files': [os.path.join('bin', x) for x in self.files], | ||
'dirs': [] | ||
} | ||
|
||
super(EB_BWA, self).sanity_check_step(custom_paths=custom_paths) | ||
# 'bwa' command doesn't have a --help option, but it does print help-like information to stderr | ||
# when run without arguments (and exits with exit code 1) | ||
custom_commands = ["bwa 2>&1 | grep 'index sequences in the FASTA format'"] | ||
|
||
super(EB_BWA, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,26 @@ | ||
## | ||
# This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild | ||
# Copyright 2012-2021 Ghent University | ||
# | ||
# Copyright:: Copyright 2012-2019 Cyprus Institute / CaSToRC, Uni.Lu, NTUA, Ghent University, | ||
# Forschungszentrum Juelich GmbH | ||
# Authors:: George Tsouloupas <[email protected]>, Fotis Georgatos <[email protected]>, Kenneth Hoste, Damian Alvarez | ||
# License:: MIT/GPL | ||
# $Id$ | ||
# This file is part of EasyBuild, | ||
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), | ||
# with support of Ghent University (http://ugent.be/hpc), | ||
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), | ||
# Flemish Research Foundation (FWO) (http://www.fwo.be/en) | ||
# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). | ||
# | ||
# This work implements a part of the HPCBIOS project and is a component of the policy: | ||
# http://hpcbios.readthedocs.org/en/latest/HPCBIOS_2012-99.html | ||
# https://github.com/easybuilders/easybuild | ||
# | ||
# EasyBuild is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation v2. | ||
# | ||
# EasyBuild is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>. | ||
## | ||
""" | ||
EasyBuild support for CUDA, implemented as an easyblock | ||
|
@@ -20,6 +32,7 @@ | |
@author: Kenneth Hoste (Ghent University) | ||
@author: Damian Alvarez (Forschungszentrum Juelich) | ||
@author: Ward Poelmans (Free University of Brussels) | ||
@author: Robert Mijakovic (LuxProvide S.A.) | ||
""" | ||
import os | ||
import stat | ||
|
@@ -29,10 +42,10 @@ | |
from easybuild.easyblocks.generic.binary import Binary | ||
from easybuild.framework.easyconfig import CUSTOM | ||
from easybuild.tools.build_log import EasyBuildError | ||
from easybuild.tools.filetools import adjust_permissions, patch_perl_script_autoflush | ||
from easybuild.tools.filetools import remove_file, which, write_file | ||
from easybuild.tools.filetools import adjust_permissions, copy_dir, patch_perl_script_autoflush | ||
from easybuild.tools.filetools import remove_file, symlink, which, write_file | ||
from easybuild.tools.run import run_cmd, run_cmd_qa | ||
from easybuild.tools.systemtools import POWER, X86_64, get_cpu_architecture, get_shared_lib_ext | ||
from easybuild.tools.systemtools import AARCH64, POWER, X86_64, get_cpu_architecture, get_shared_lib_ext | ||
|
||
# Wrapper script definition | ||
WRAPPER_TEMPLATE = """#!/bin/sh | ||
|
@@ -62,10 +75,12 @@ def extra_options(): | |
def __init__(self, *args, **kwargs): | ||
""" Init the cuda easyblock adding a new cudaarch template var """ | ||
myarch = get_cpu_architecture() | ||
if myarch == X86_64: | ||
cudaarch = '' | ||
if myarch == AARCH64: | ||
cudaarch = '_sbsa' | ||
elif myarch == POWER: | ||
cudaarch = '_ppc64le' | ||
elif myarch == X86_64: | ||
cudaarch = '' | ||
else: | ||
raise EasyBuildError("Architecture %s is not supported for CUDA on EasyBuild", myarch) | ||
|
||
|
@@ -179,7 +194,7 @@ def create_wrapper(wrapper_name, wrapper_comp): | |
for comp in (self.cfg['host_compilers'] or []): | ||
create_wrapper('nvcc_%s' % comp, comp) | ||
|
||
ldconfig = which('ldconfig') | ||
ldconfig = which('ldconfig', log_ok=False, log_error=False) | ||
sbin_dirs = ['/sbin', '/usr/sbin'] | ||
if not ldconfig: | ||
# ldconfig is usually in /sbin or /usr/sbin | ||
|
@@ -195,23 +210,28 @@ def create_wrapper(wrapper_name, wrapper_comp): | |
path = os.environ.get('PATH', '') | ||
raise EasyBuildError("Unable to find 'ldconfig' in $PATH (%s), nor in any of %s", path, sbin_dirs) | ||
|
||
stubs_dir = os.path.join(self.installdir, 'lib64', 'stubs') | ||
# Run ldconfig to create missing symlinks in the stubs directory (libcuda.so.1, etc) | ||
cmd = ' '.join([ldconfig, '-N', os.path.join(self.installdir, 'lib64', 'stubs')]) | ||
cmd = ' '.join([ldconfig, '-N', stubs_dir]) | ||
run_cmd(cmd) | ||
|
||
# GCC searches paths in LIBRARY_PATH and the system paths suffixed with ../lib64 or ../lib first | ||
# This means stubs/../lib64 is searched before the system /lib64 folder containing a potentially older libcuda. | ||
# See e.g. https://github.com/easybuilders/easybuild-easyconfigs/issues/12348 | ||
# Workaround: Create a copy that matches this pattern | ||
new_stubs_dir = os.path.join(self.installdir, 'stubs') | ||
copy_dir(stubs_dir, os.path.join(new_stubs_dir, 'lib64')) | ||
# Also create the lib dir as a symlink | ||
symlink('lib64', os.path.join(new_stubs_dir, 'lib'), use_abspath_source=False) | ||
|
||
super(EB_CUDA, self).post_install_step() | ||
|
||
def sanity_check_step(self): | ||
"""Custom sanity check for CUDA.""" | ||
|
||
shlib_ext = get_shared_lib_ext() | ||
|
||
chk_libdir = ["lib64"] | ||
|
||
# Versions higher than 6 do not provide 32 bit libraries | ||
if LooseVersion(self.version) < LooseVersion("6"): | ||
chk_libdir += ["lib"] | ||
|
||
chk_libdir = ["lib64", "lib"] | ||
culibs = ["cublas", "cudart", "cufft", "curand", "cusparse"] | ||
custom_paths = { | ||
'files': [os.path.join("bin", x) for x in ["fatbinary", "nvcc", "nvlink", "ptxas"]] + | ||
|
@@ -259,7 +279,7 @@ def make_module_req_guess(self): | |
guesses.update({ | ||
'PATH': bin_path, | ||
'LD_LIBRARY_PATH': lib_path, | ||
'LIBRARY_PATH': ['lib64', os.path.join('lib64', 'stubs')], | ||
'LIBRARY_PATH': ['lib64', os.path.join('stubs', 'lib64')], | ||
'CPATH': inc_path, | ||
}) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.