Skip to content
Snippets Groups Projects
Commit a7328deb authored by Easy Build's avatar Easy Build
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
Showing
with 899 additions and 0 deletions
#!/usr/bin/env python
#
# Copyright (C) 2015 IT4Innovations
# Lumir Jasiok
# lumir.jasiok@vsb.cz
# http://www.it4i.cz
#
#
#
"""
EasyBuild support for building and installing LAMPPS,
implemented as an easyblock
@author: Lumir Jasiok (IT4 Innovations)
"""
import os
import shutil
from easybuild.framework.easyblock import EasyBlock
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.run import run_cmd
class EB_LAMMPS(EasyBlock):
"""Support for building and installing LAMMPS."""
def build_step(self):
"""Run simply make mkl"""
cmd = "%s make mkl" % self.cfg['prebuildopts']
run_cmd(cmd, log_all=True)
srcdir = os.path.join(self.cfg['start_dir'], 'src')
targetdir = os.path.join(self.installdir, 'bin')
self.log.info("LAMMPS install directory is %s" % self.installdir)
try:
if os.path.isdir(self.installdir):
self.log.info("Directory %s exists, deleting"
% self.installdir)
shutil.rmtree(self.installdir)
os.mkdir(self.installdir)
os.mkdir(targetdir)
shutil.copy2(os.path.join(srcdir, 'lmp_mkl'),
os.path.join(targetdir, 'lmp_mkl'))
except Exception, err:
raise EasyBuildError("Failed to install LAMMPS binary, %s" % err)
File added
##
# Copyright 2009-2017 Ghent University
#
# 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).
#
# http://github.com/hpcugent/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 installing MATLAB, implemented as an easyblock
@author: Stijn De Weirdt (Ghent University)
@author: Dries Verdegem (Ghent University)
@author: Kenneth Hoste (Ghent University)
@author: Pieter De Baets (Ghent University)
@author: Jens Timmerman (Ghent University)
@author: Fotis Georgatos (Uni.Lu, NTUA)
"""
import re
import os
import shutil
import stat
from easybuild.easyblocks.generic.packedbinary import PackedBinary
from easybuild.framework.easyconfig import CUSTOM
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.filetools import adjust_permissions, read_file, write_file
from easybuild.tools.run import run_cmd
from easybuild.tools.systemtools import get_shared_lib_ext
class EB_MATLAB(PackedBinary):
"""Support for installing MATLAB."""
def __init__(self, *args, **kwargs):
"""Add extra config options specific to MATLAB."""
super(EB_MATLAB, self).__init__(*args, **kwargs)
self.comp_fam = None
self.configfile1 = os.path.join(self.builddir, 'my_installer_input1.txt')
self.configfile2 = os.path.join(self.builddir, 'my_installer_input2.txt')
@staticmethod
def extra_options():
extra_vars = {
'java_options': ['-Xmx256m', "$_JAVA_OPTIONS value set for install and in module file.", CUSTOM],
}
return PackedBinary.extra_options(extra_vars)
def configure_step(self):
"""Configure MATLAB installation: create license file."""
# create license file
licserv = self.cfg['license_server']
licport = self.cfg['license_server_port']
lictxt = '\n'.join([
"SERVER %s 000000000000 %s" % (licserv, licport),
"USE_SERVER",
])
licfile = os.path.join(self.builddir, 'matlab.lic')
write_file(licfile, lictxt)
try:
shutil.copyfile(os.path.join(self.cfg['start_dir'], 'installer_input.txt'), self.configfile1)
shutil.copyfile(os.path.join(self.cfg['start_dir'], 'installer_input.txt'), self.configfile2)
config1 = read_file(self.configfile1)
config2 = read_file(self.configfile2)
regdest = re.compile(r"^# destinationFolder=.*", re.M)
regkey = re.compile(r"^# fileInstallationKey=.*", re.M)
regagree = re.compile(r"^# agreeToLicense=.*", re.M)
regmode = re.compile(r"^# mode=.*", re.M)
reglicpath = re.compile(r"^# licensePath=.*", re.M)
config1 = regdest.sub("destinationFolder=%s" % self.installdir, config1)
key1 = self.cfg['exts_defaultclass']
config1 = regkey.sub("fileInstallationKey=%s" % key1, config1)
config1 = regagree.sub("agreeToLicense=Yes", config1)
config1 = regmode.sub("mode=silent", config1)
config1 = reglicpath.sub("licensePath=%s" % licfile, config1)
config2 = regdest.sub("destinationFolder=%s" % self.installdir, config2)
key2 = self.cfg['key']
config2 = regkey.sub("fileInstallationKey=%s" % key2, config2)
config2 = regagree.sub("agreeToLicense=Yes", config2)
config2 = regmode.sub("mode=silent", config2)
config2 = reglicpath.sub("licensePath=%s" % licfile, config2)
write_file(self.configfile1, config1)
write_file(self.configfile2, config2)
except IOError, err:
raise EasyBuildError("Failed to create installation config file %s: %s", self.configfile1, err)
self.log.debug('configuration file written to %s:\n %s', self.configfile1, config1)
self.log.debug('configuration file written to %s:\n %s', self.configfile2, config2)
def install_step(self):
"""MATLAB install procedure using 'install' command."""
src = os.path.join(self.cfg['start_dir'], 'install')
# make sure install script is executable
adjust_permissions(src, stat.S_IXUSR)
# make sure $DISPLAY is not defined, which may lead to (hard to trace) problems
# this is a workaround for not being able to specify --nodisplay to the install scripts
if 'DISPLAY' in os.environ:
os.environ.pop('DISPLAY')
if not '_JAVA_OPTIONS' in self.cfg['preinstallopts']:
self.cfg['preinstallopts'] = ('export _JAVA_OPTIONS="%s" && ' % self.cfg['java_options']) + self.cfg['preinstallopts']
cmd = "%s ./install -v -inputFile %s %s" % (self.cfg['preinstallopts'], self.configfile1, self.cfg['installopts'])
run_cmd(cmd, log_all=True, simple=True)
cmd = "%s ./install -v -inputFile %s %s" % (self.cfg['preinstallopts'], self.configfile2, self.cfg['installopts'])
run_cmd(cmd, log_all=True, simple=True)
def sanity_check_step(self):
"""Custom sanity check for MATLAB."""
custom_paths = {
'files': ["bin/matlab"],
'dirs': ["java/jar", "toolbox/compiler"],
}
super(EB_MATLAB, self).sanity_check_step(custom_paths=custom_paths)
def make_module_extra(self):
"""Extend PATH and set proper _JAVA_OPTIONS (e.g., -Xmx)."""
java_path = os.environ.get('EBROOTJAVA')
java_path += '/jre'
txt = super(EB_MATLAB, self).make_module_extra()
txt += self.module_generator.set_environment('_JAVA_OPTIONS', self.cfg['java_options'])
txt += self.module_generator.set_environment('MATLAB_JAVA', java_path)
return txt
#!/usr/bin/env python
#
# Copyright (C) 2015 IT4Innovations
# Lumir Jasiok
# lumir.jasiok@vsb.cz
# http://www.it4i.cz
#
#
#
"""
EasyBuild support for building and installing OpenCL,
implemented as an easyblock.
It use some code from generic IntelBase class.
@author: Lumir Jasiok (IT4 Innovations)
"""
import os
from easybuild.easyblocks.generic.intelbase import IntelBase
from easybuild.tools.run import run_cmd
class OpenCL(IntelBase):
"""Support for building and installing OpenCL"""
def install_step(self):
"""Actual installation
- extract files from RPM
- copy to the tagret directory
"""
# extract rpm files
self.log.info("Going to build dir %s" % self.cfg['start_dir'])
rpm_dir = os.path.join(self.cfg['start_dir'], 'rpm')
os.chdir(rpm_dir)
rpm_list = os.listdir(rpm_dir)
for rpm in rpm_list:
cmd = "rpm2cpio %s | cpio -idv" % rpm
run_cmd(cmd, log_all=True, simple=True)
# Copy extracted files to the target dir
subdir = os.listdir(os.path.join('opt', 'intel'))[0]
path_prefix = os.path.join('opt', 'intel', subdir)
items_to_be_copied = os.listdir(path_prefix)
for item in items_to_be_copied:
file_or_dir = os.path.join(path_prefix, item)
cmd = "cp -r %s %s/" % (file_or_dir, self.installdir)
run_cmd(cmd, log_all=True, simple=True)
return True
File added
#!/usr/bin/env python
#
# Copyright (C) 2015 IT4Innovations
# Lumir Jasiok
# lumir.jasiok@vsb.cz
# http://www.it4i.cz
#
#
#
"""
EasyBuild support for building and installing p4vasp,
implemented as an easyblock
@author: Lumir Jasiok (IT4 Innovations)
"""
import os
from easybuild.framework.easyblock import EasyBlock
from easybuild.tools.run import run_cmd
class EB_p4vasp(EasyBlock):
"""Support for building and installing p4vasp."""
def configure_step(self):
"""
Create %(builddir)s/install/Configuration.mk file to skip
run "python configure.py local"
"""
builddir = os.path.join(self.builddir, '%s-%s'
% (self.name, self.version))
installdir = self.installdir
p4vasp_path = installdir.split('/')[1:-1]
p4vasp_root = os.path.join('/', *p4vasp_path)
self.log.info("p4vasp builddir id %s" % builddir)
self.log.info("p4vasp installdir id %s" % installdir)
self.log.info("p4vasp root dir is %s" % p4vasp_root)
conf_file = os.path.join(builddir, 'install', 'Configuration.mk')
fd = open(conf_file, 'w')
conf_content = """
ROOT = %s
P4VASP_HOME = %s
SITE_PACKAGES = %s/python-packages
INCLUDEDIR = %s/include
LIBDIR = %s/lib
BINDIR = %s/bin
""" % (p4vasp_root, installdir, installdir,
installdir, installdir, installdir)
fd.write(conf_content)
fd.close()
def build_step(self):
"""Run simply make install"""
cmd = "make install"
run_cmd(cmd, log_all=True)
File added
#!/usr/bin/env python
#
# Copyright (C) 2016 IT4Innovations
# Lumir Jasiok
# lumir.jasiok@vsb.cz
# http://www.it4i.cz
#
#
#
"""
EasyBuild support for building and installing QScintilla - port to Qt of
the Scintilla editing component, implemented as an easyblock.
@author: Lumir Jasiok (IT4Innovations)
"""
from easybuild.framework.easyblock import EasyBlock
from easybuild.tools.run import run_cmd
class EB_QScintilla(EasyBlock):
"""
Support for installing QScintilla -
port to Qt of the Scintilla editing component
"""
def configure_step(self):
"""Configure step"""
cmd = "%s qmake qscintilla.pro" % self.cfg['preconfigopts']
run_cmd(cmd, log_all=True)
def build_step(self):
"""Build step"""
cmd = "%s make" % self.cfg['prebuildopts']
run_cmd(cmd, log_all=True)
def install_step(self):
"""Install step"""
cmd = "%s make install" % self.cfg['preinstallopts']
run_cmd(cmd, log_all=True)
File added
#!/usr/bin/env python
#
# Copyright (C) 2015 IT4Innovations
# Lumir Jasiok
# lumir.jasiok@vsb.cz
# http://www.it4i.cz
#
#
#
"""
EasyBuild support for building and installing Qwt -
Qt Widgets for Technical Applications, implemented as an easyblock.
@author: Lumir Jasiok (IT4Innovations)
"""
import os
import re
from easybuild.framework.easyblock import EasyBlock
from easybuild.tools.run import run_cmd
class EB_Qwt(EasyBlock):
"""
Support for installing Qwt - Qt Widgets for Technical Applications
"""
def configure_step(self):
"""Configure step, patching qwtconfig.pri"""
conf_file = os.path.join(self.cfg['start_dir'], 'qwtconfig.pri')
fd = open(conf_file, 'r+')
orig_text = fd.read()
regex = re.compile("^unix\s+{\n\s+QWT_INSTALL_PREFIX\s+=\s+(\S+)\n\s+#.*\n}",
re.MULTILINE)
new_text = regex.sub(r"unix {\n QWT_INSTALL_PREFIX = %s\n}"
% self.installdir, orig_text)
fd.seek(0)
fd.write(new_text)
fd.close()
cmd = "%s qmake qwt.pro" % self.cfg['preconfigopts']
run_cmd(cmd)
def build_step(self):
"""Build step"""
cmd = "%s make" % self.cfg['prebuildopts']
run_cmd(cmd, log_all=True)
def install_step(self):
"""Install step"""
cmd = "%s make install" % self.cfg['preinstallopts']
run_cmd(cmd, log_all=True)
File added
##
# Copyright 2009-2017 Ghent University
#
# 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).
#
# http://github.com/hpcugent/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 building and installing Siesta, implemented as an easyblock
@author: Miguel Dias Costa (National University of Singapore)
@author: Ake Sandgren (Umea University)
"""
import os
import stat
import easybuild.tools.toolchain as toolchain
from distutils.version import LooseVersion
from easybuild.easyblocks.generic.configuremake import ConfigureMake
from easybuild.framework.easyconfig import CUSTOM
from easybuild.tools.build_log import EasyBuildError, print_msg
from easybuild.tools.filetools import adjust_permissions, apply_regex_substitutions, change_dir, copy_dir, copy_file, mkdir
from easybuild.tools.modules import get_software_root
from easybuild.tools.run import run_cmd
class siesta(ConfigureMake):
"""
Support for building/installing Siesta.
- avoid parallel build for older versions
"""
@staticmethod
def extra_options(extra_vars=None):
"""Define extra options for Siesta"""
extra = {
'with_transiesta': [True, "Build transiesta", CUSTOM],
'with_utils': [True, "Build all utils", CUSTOM],
}
return ConfigureMake.extra_options(extra_vars=extra)
def configure_step(self):
"""
Custom configure and build procedure for Siesta.
- There are two main builds to do, siesta and transiesta
- In addition there are multiple support tools to build
"""
start_dir = self.cfg['start_dir']
obj_dir = os.path.join(start_dir, 'Obj')
arch_make = os.path.join(obj_dir, 'arch.make')
bindir = os.path.join(start_dir, 'bin')
par = ''
if LooseVersion(self.version) >= LooseVersion('4.1'):
par = '-j %s' % self.cfg['parallel']
# enable OpenMP support if desired
env_var_suff = ''
if self.toolchain.options.get('openmp', None):
env_var_suff = '_MT'
scalapack = os.environ['LIBSCALAPACK' + env_var_suff]
blacs = os.environ['LIBSCALAPACK' + env_var_suff]
lapack = os.environ['LIBLAPACK' + env_var_suff]
blas = os.environ['LIBBLAS' + env_var_suff]
if get_software_root('imkl') or get_software_root('FFTW'):
fftw = os.environ['LIBFFT' + env_var_suff]
else:
fftw = None
regex_newlines = []
regex_subs = [
('dc_lapack.a', ''),
(r'^NETCDF_INTERFACE\s*=.*$', ''),
('libsiestaBLAS.a', ''),
('libsiestaLAPACK.a', ''),
# Needed here to allow 4.1-b1 to be built with openmp
(r"^(LDFLAGS\s*=).*$", r"\1 %s %s" % (os.environ['FCFLAGS'], os.environ['LDFLAGS'])),
]
netcdff_loc = get_software_root('netCDF-Fortran')
if netcdff_loc:
# Needed for gfortran at least
regex_newlines.append((r"^(ARFLAGS_EXTRA\s*=.*)$", r"\1\nNETCDF_INCFLAGS = -I%s/include" % netcdff_loc))
if fftw:
fft_inc, fft_lib = os.environ['FFT_INC_DIR'], os.environ['FFT_LIB_DIR']
fppflags = r"\1\nFFTW_INCFLAGS = -I%s\nFFTW_LIBS = -L%s %s" % (fft_inc, fft_lib, fftw)
regex_newlines.append((r'(FPPFLAGS\s*=.*)$', fppflags))
# Make a temp installdir during the build of the various parts
mkdir(bindir)
# change to actual build dir
change_dir(obj_dir)
# Populate start_dir with makefiles
run_cmd(os.path.join(start_dir, 'Src', 'obj_setup.sh'), log_all=True, simple=True, log_output=True)
if LooseVersion(self.version) < LooseVersion('4.1-b2'):
# MPI?
if self.toolchain.options.get('usempi', None):
self.cfg.update('configopts', '--enable-mpi')
# BLAS and LAPACK
self.cfg.update('configopts', '--with-blas="%s"' % blas)
self.cfg.update('configopts', '--with-lapack="%s"' % lapack)
# ScaLAPACK (and BLACS)
self.cfg.update('configopts', '--with-scalapack="%s"' % scalapack)
self.cfg.update('configopts', '--with-blacs="%s"' % blacs)
# NetCDF-Fortran
if netcdff_loc:
self.cfg.update('configopts', '--with-netcdf=-lnetcdff')
# Configure is run in obj_dir, configure script is in ../Src
super(EB_Siesta, self).configure_step(cmd_prefix='../Src/')
if LooseVersion(self.version) > LooseVersion('4.0'):
regex_subs_Makefile = [
(r'CFLAGS\)-c', r'CFLAGS) -c'),
]
apply_regex_substitutions('Makefile', regex_subs_Makefile)
else: # there's no configure on newer versions
if self.toolchain.comp_family() in [toolchain.INTELCOMP]:
copy_file(os.path.join(obj_dir, 'intel.make'), arch_make)
elif self.toolchain.comp_family() in [toolchain.GCC]:
copy_file(os.path.join(obj_dir, 'gfortran.make'), arch_make)
else:
raise EasyBuildError("There is currently no support for compiler: %s", self.toolchain.comp_family())
if self.toolchain.options.get('usempi', None):
regex_subs.extend([
(r"^(CC\s*=\s*).*$", r"\1%s" % os.environ['MPICC']),
(r"^(FC\s*=\s*).*$", r"\1%s" % os.environ['MPIF90']),
(r"^(FPPFLAGS\s*=.*)$", r"\1 -DMPI"),
])
regex_newlines.append((r"^(FPPFLAGS\s*=.*)$", r"\1\nMPI_INTERFACE = libmpi_f90.a\nMPI_INCLUDE = ."))
complibs = scalapack
else:
complibs = lapack
regex_subs.extend([
(r"^(LIBS\s*=\s).*$", r"\1 %s" % complibs),
# Needed for a couple of the utils
(r"^(FFLAGS\s*=\s*).*$", r"\1 -fPIC %s" % os.environ['FCFLAGS']),
])
regex_newlines.append((r"^(COMP_LIBS\s*=.*)$", r"\1\nWXML = libwxml.a"))
if netcdff_loc:
regex_subs.extend([
(r"^(COMP_LIBS\s*=.*)$", r"\1 libncdf.a libfdict.a"),
(r"^(LIBS\s*=.*)$", r"\1 $(NETCDF_LIBS)"),
(r"^(FPPFLAGS\s*=.*)$", r"\1 -DCDF -DNCDF -DNCDF_4 -DNCDF_PARALLEL"),
])
#we are using netCDF with HDF5
regex_newlines.append((r"^(COMP_LIBS\s*=.*)$", r"\1\nNETCDF_LIBS = -lnetcdff -lnetcdf -lhdf5_fortran -lhdf5 -lz"))
apply_regex_substitutions(arch_make, regex_subs)
# individually apply substitutions that add lines
for regex_nl in regex_newlines:
apply_regex_substitutions(arch_make, [regex_nl])
print_msg("building siesta...")
run_cmd('make %s' % par, log_all=True, simple=True, log_output=True)
# Put binary in temporary install dir
copy_file(os.path.join(obj_dir, 'siesta'), bindir)
if self.cfg['with_utils']:
# Make the utils
change_dir(os.path.join(start_dir, 'Util'))
# clean_all.sh might be missing executable bit...
adjust_permissions('./clean_all.sh', stat.S_IXUSR, recursive=False, relative=True)
run_cmd('./clean_all.sh', log_all=True, simple=True, log_output=True)
if LooseVersion(self.version) >= LooseVersion('4.1'):
regex_subs_TS = [
(r"^default:.*$", r""),
(r"^EXE\s*=.*$", r""),
(r"^(include\s*..ARCH_MAKE.*)$", r"EXE=tshs2tshs\ndefault: $(EXE)\n\1"),
(r"^(INCFLAGS.*)$", r"\1 -I%s" % obj_dir),
]
makefile = os.path.join(start_dir, 'Util', 'TS', 'tshs2tshs', 'Makefile')
apply_regex_substitutions(makefile, regex_subs_TS)
# SUFFIX rules in wrong place
regex_subs_suffix = [
(r'^(\.SUFFIXES:.*)$', r''),
(r'^(include\s*\$\(ARCH_MAKE\).*)$', r'\1\n.SUFFIXES:\n.SUFFIXES: .c .f .F .o .a .f90 .F90'),
]
makefile = os.path.join(start_dir, 'Util', 'Sockets', 'Makefile')
apply_regex_substitutions(makefile, regex_subs_suffix)
makefile = os.path.join(start_dir, 'Util', 'SiestaSubroutine', 'SimpleTest', 'Src', 'Makefile')
apply_regex_substitutions(makefile, regex_subs_suffix)
regex_subs_UtilLDFLAGS = [
(r'(\$\(FC\)\s*-o\s)', r'$(FC) %s %s -o ' % (os.environ['FCFLAGS'], os.environ['LDFLAGS'])),
]
makefile = os.path.join(start_dir, 'Util', 'Optimizer', 'Makefile')
apply_regex_substitutions(makefile, regex_subs_UtilLDFLAGS)
makefile = os.path.join(start_dir, 'Util', 'JobList', 'Src', 'Makefile')
apply_regex_substitutions(makefile, regex_subs_UtilLDFLAGS)
print_msg("building utils...")
run_cmd('./build_all.sh', log_all=True, simple=True, log_output=True)
# Now move all the built utils to the temp installdir
expected_utils = [
'Bands/eigfat2plot',
'CMLComp/ccViz',
'Contrib/APostnikov/eig2bxsf', 'Contrib/APostnikov/rho2xsf',
'Contrib/APostnikov/vib2xsf', 'Contrib/APostnikov/fmpdos',
'Contrib/APostnikov/xv2xsf', 'Contrib/APostnikov/md2axsf',
'COOP/mprop', 'COOP/fat',
'Denchar/Src/denchar',
'DensityMatrix/dm2cdf', 'DensityMatrix/cdf2dm',
'Eig2DOS/Eig2DOS',
'Gen-basis/ioncat', 'Gen-basis/gen-basis',
'Grid/cdf2grid', 'Grid/cdf_laplacian', 'Grid/cdf2xsf',
'Grid/grid2cube',
'Grid/grid_rotate', 'Grid/g2c_ng', 'Grid/grid2cdf', 'Grid/grid2val',
'Helpers/get_chem_labels',
'HSX/hs2hsx', 'HSX/hsx2hs',
'JobList/Src/getResults', 'JobList/Src/countJobs',
'JobList/Src/runJobs', 'JobList/Src/horizontal',
'Macroave/Src/macroave',
'ON/lwf2cdf',
'Optimizer/simplex', 'Optimizer/swarm',
'pdosxml/pdosxml',
'Projections/orbmol_proj',
'SiestaSubroutine/FmixMD/Src/driver',
'SiestaSubroutine/FmixMD/Src/para',
'SiestaSubroutine/FmixMD/Src/simple',
'STM/simple-stm/plstm', 'STM/ol-stm/Src/stm',
'VCA/mixps', 'VCA/fractional',
'Vibra/Src/vibra', 'Vibra/Src/fcbuild',
'WFS/info_wfsx', 'WFS/wfsx2wfs',
'WFS/readwfx', 'WFS/wfsnc2wfsx', 'WFS/readwf', 'WFS/wfs2wfsx',
]
if LooseVersion(self.version) <= LooseVersion('4.0'):
expected_utils.extend([
'Bands/new.gnubands',
'TBTrans/tbtrans',
])
if LooseVersion(self.version) >= LooseVersion('4.0'):
expected_utils.extend([
'SiestaSubroutine/ProtoNEB/Src/protoNEB',
'SiestaSubroutine/SimpleTest/Src/simple_pipes_parallel',
'SiestaSubroutine/SimpleTest/Src/simple_pipes_serial',
'Sockets/f2fmaster', 'Sockets/f2fslave',
])
if LooseVersion(self.version) >= LooseVersion('4.1'):
expected_utils.extend([
'Bands/gnubands',
'Grimme/fdf2grimme',
'SpPivot/pvtsp',
'TS/ts2ts/ts2ts', 'TS/tshs2tshs/tshs2tshs', 'TS/TBtrans/tbtrans',
])
for util in expected_utils:
copy_file(os.path.join(start_dir, 'Util', util), bindir)
if self.cfg['with_transiesta']:
# Build transiesta
change_dir(obj_dir)
run_cmd('make clean', log_all=True, simple=True, log_output=True)
print_msg("building transiesta...")
run_cmd('make %s transiesta' % par, log_all=True, simple=True, log_output=True)
copy_file(os.path.join(obj_dir, 'transiesta'), bindir)
def build_step(self):
"""No build step for Siesta."""
pass
def install_step(self):
"""Custom install procedure for Siesta: copy binaries."""
bindir = os.path.join(self.installdir, 'bin')
copy_dir(os.path.join(self.cfg['start_dir'], 'bin'), bindir)
def sanity_check_step(self):
"""Custom sanity check for Siesta."""
bins = ['bin/siesta']
if self.cfg['with_transiesta']:
bins.append('bin/transiesta')
if self.cfg['with_utils']:
bins.append('bin/denchar')
custom_paths = {
'files': bins,
'dirs': [],
}
custom_commands = []
if self.toolchain.options.get('usempi', None):
# make sure Siesta was indeed built with support for running in parallel
custom_commands.append("echo 'SystemName test' | mpirun -np 2 siesta 2>/dev/null | grep PARALLEL")
super(siesta, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)
#!/usr/bin/env python
#
# Copyright (C) 2016 IT4Innovations
# Lumir Jasiok
# lumir.jasiok@vsb.cz
# http://www.it4i.cz
#
#
#
"""
EasyBuild support for building and installing SnuCL, implemented as
an easyblock
@author: Lumir Jasiok (IT4 Innovations)
"""
import os
import shutil
from easybuild.framework.easyblock import EasyBlock
from easybuild.tools.run import run_cmd
class EB_SnuCL(EasyBlock):
"""Support for building and installing SnuCL."""
def build_step(self):
"""Build al three modes of SnuCL: CPU, Single, Cluster"""
# export necessary environemnt variable for build
os.environ['SNUCLROOT'] = self.cfg['start_dir']
os.path.expandvars('$PATH:%s' % os.path.join(self.cfg['start_dir'],
'bin'))
os.path.expandvars('$LD_LIBRARY_PATH:%s'
% os.path.join(self.cfg['start_dir'], 'lib'))
self.build_dir = os.path.join(self.cfg['start_dir'], 'build')
self._build_cpu()
self._build_single()
self._build_cluster()
def _build_cpu(self):
"""Build CPU library"""
os.chdir(self.build_dir)
# Run CPU build
cmd = "%s ./build_cpu.sh" % self.cfg['prebuildopts']
run_cmd(cmd, log_all=True)
def _build_single(self):
"""Build Single library"""
os.chdir(self.build_dir)
# Run Single build
cmd = "%s ./build_single.sh" % self.cfg['prebuildopts']
run_cmd(cmd, log_all=True)
def _build_cluster(self):
"""Build Cluster library"""
os.chdir(self.build_dir)
# Run Cluster build
cmd = "%s ./build_cluster.sh" % self.cfg['prebuildopts']
run_cmd(cmd, log_all=True)
def install_step(self):
"""Install libraries"""
if not os.path.isdir(self.installdir):
self.log.info('Missing SnuCL target directory, creating...')
os.mkdir(self.installdir)
to_be_copied = ['bin', 'inc', 'lib', 'LICENSE.TXT']
for f in to_be_copied:
self.log.info("Copying %s into the %s" % (f, self.installdir))
if os.path.isfile(os.path.join(self.cfg['start_dir'], f)):
self.log.info("Source %s is file" % f)
shutil.copy2(os.path.join(self.cfg['start_dir'], f),
os.path.join(self.installdir, f))
else:
self.log.info("Source %s is directory" % f)
shutil.copytree(os.path.join(self.cfg['start_dir'], f),
os.path.join(self.installdir, f))
File added
#!/usr/bin/env python
#
# Copyright (C) 2015 IT4Innovations
# Lumir Jasiok
# lumir.jasiok@vsb.cz
# http://www.it4i.cz
#
#
#
"""
EasyBuild support for building and installing Intel
Threading Building Blocks, implemented as an easyblock.
@author: Lumir Jasiok (IT4Innovations)
"""
import os
import platform
from easybuild.easyblocks.generic.intelbase import IntelBase
from easybuild.tools.run import run_cmd
class EB_tbb(IntelBase):
"""
Support for installing Intel Threading Building Blocks
"""
def install_step(self):
"""Actual installation
- create silent.cfg
- run install.sh
"""
machine = platform.machine()
if machine == "i386":
self.arch = "ia32"
else:
self.arch = "intel64"
silent_cfg = """
ACCEPT_EULA=accept
CONTINUE_WITH_OPTIONAL_ERROR=yes
PSET_INSTALL_DIR=%s
CONTINUE_WITH_INSTALLDIR_OVERWRITE=yes
COMPONENTS=ALL
PSET_MODE=install
ACTIVATION_LICENSE_FILE=%s
ACTIVATION_TYPE=license_file
PHONEHOME_SEND_USAGE_DATA=no
SIGNING_ENABLED=yes
ARCH_SELECTED=%s
""" % (self.installdir, self.license_file, self.arch.upper())
build_dir = self.cfg['start_dir']
silent_file = os.path.join(build_dir, 'silent.cfg')
fd = open(silent_file, 'w')
fd.write(silent_cfg)
fd.close()
os.chdir(build_dir)
self.log.info("Build dir is %s" % (build_dir))
cmd = "./install.sh -s silent.cfg --SHARED_INSTALL"
run_cmd(cmd, log_all=True, simple=True)
return True
def make_module_req_guess(self):
"""
A dictionary of possible directories to look for
"""
guesses = super(EB_tbb, self).make_module_req_guess()
tbbcomp = "gcc4.4"
if not tbbcomp:
self.log.error('You have to specify TBB architecture \
(tbb_compiler = gcc4.1/gcc4.4) in easyconfig!')
lib_path = 'tbb/lib/%s/%s' % (self.arch, tbbcomp)
lib_arr = []
lib_arr.append(lib_path)
guesses.update({
'LD_LIBRARY_PATH': lib_arr,
'LIBRARY_PATH': lib_arr,
'PATH': ['tbb/bin'],
'CPATH': ['tbb/include'],
'INCLUDE': ['tbb/include'],
'TBB_EXAMPLES': ['tbb/examples'],
})
return guesses
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment