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

Initial commit

parents
Branches
No related tags found
No related merge requests found
Showing
with 478 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 VisIt,
implemented as an easyblock.
@author: Lumir Jasiok (IT4Innovations)
"""
import os
import shutil
from easybuild.framework.easyblock import EasyBlock
from easybuild.tools.systemtools import get_platform_name
from easybuild.tools.run import run_cmd
class EB_VisIt(EasyBlock):
"""Support for building and installing VisIt."""
def extract_step(self):
"""We don't want any file to be unpacked, but we have to copy
installation files to the build directory
"""
# We have to run it here, so self.cfg['start_dir'] is available
self.guess_start_dir()
for item in self.src:
shutil.copy2(item['path'], self.cfg['start_dir'])
def install_step(self):
"""Simply run installation script with configuration options"""
self.log.info("Changing VisIt installer permission")
os.chdir(self.cfg['start_dir'])
chmod_cmd = "chmod 755 visit-install2_10_0"
run_cmd(chmod_cmd, log_all=True)
install_cmd = "./visit-install2_10_0 -c none 2.10.0 \
linux-x86_64-rhel6 %s" % self.installdir
self.log.info("Running VisIt installer")
run_cmd(install_cmd, log_all=True)
def make_module_req_guess(self):
"""
A dictionary of possible directories to look for
"""
guesses = super(EB_VisIt, self).make_module_req_guess()
platform_name = get_platform_name()
if platform_name.startswith('x86_64'):
self.arch = "x86_64"
base_path = os.path.join('current', 'linux-%s' % self.arch)
lib_path = os.path.join(base_path, 'lib')
include_path = os.path.join(base_path, 'include')
guesses.update({
'LD_LIBRARY_PATH': [lib_path],
'LIBRARY_PATH': [lib_path],
'INCLUDE': [include_path],
'PATH': ['bin'],
})
return guesses
#!/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 VTune Amplifier,
implemented as an easyblock.
@author: Lumir Jasiok (IT4Innovations)
"""
import os
from easybuild.easyblocks.generic.intelbase import IntelBase
from easybuild.tools.run import run_cmd
class EB_VTune(IntelBase):
"""
Support for installing Intel VTune Amplifier XE
"""
def install_step(self):
"""Actual installation
- create silent.cfg
- run install.sh
"""
kernel_version = os.uname()[2]
silent_cfg = """
ACCEPT_EULA=accept
CONTINUE_WITH_OPTIONAL_ERROR=yes
PSET_INSTALL_DIR=%s
CONTINUE_WITH_INSTALLDIR_OVERWRITE=yes
PSET_MODE=install
ACTIVATION_TYPE=license_file
ACTIVATION_LICENSE_FILE=%s
CLUSTER_INSTALL_AUTOMOUNT=yes
PHONEHOME_SEND_USAGE_DATA=no
AMPLIFIER_SAMPLING_DRIVER_INSTALL_TYPE=kit
AMPLIFIER_DRIVER_ACCESS_GROUP=wheel
AMPLIFIER_DRIVER_PERMISSIONS=666
AMPLIFIER_LOAD_DRIVER=no
AMPLIFIER_C_COMPILER=/usr/bin/gcc
AMPLIFIER_KERNEL_SRC_DIR=/lib/modules/%s/build
AMPLIFIER_MAKE_COMMAND=/usr/bin/make
AMPLIFIER_INSTALL_BOOT_SCRIPT=no
AMPLIFIER_DRIVER_PER_USER_MODE=no
MPSS_RESTART_STACK=no
MPSS_INSTALL_STACK=no
COMPONENTS=ALL
""" % (self.installdir, self.license_file, kernel_version)
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_VTune, self).make_module_req_guess()
if self.cfg['m32']:
guesses.update({
'PATH': ['vtune_amplifier_xe/bin32'],
'LD_LIBRARY_PATH': ['vtune_amplifier_xe/lib32'],
'LIBRARY_PATH': ['vtune_amplifier_xe/lib32'],
})
else:
guesses.update({
'PATH': ['vtune_amplifier_xe/bin64'],
'LD_LIBRARY_PATH': ['vtune_amplifier_xe/lib64'],
'LIBRARY_PATH': ['vtune_amplifier_xe/lib64'],
})
guesses.update({
'CPATH': ['vtune_amplifier_xe/include'],
'FPATH': ['vtune_amplifier_xe/include'],
'MANPATH': ['vtune_amplifier_xe/man'],
})
return guesses
File added
##
# Copyright 2012-2015 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://vscentrum.be/nl/en),
# the Hercules foundation (http://www.herculesstichting.be/in_English)
# 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 GCC compiler toolchain.
@author: Kenneth Hoste (Ghent University)
"""
from easybuild.toolchains.compiler.gcc import Gcc
from easybuild.tools.toolchain import DUMMY_TOOLCHAIN_NAME
class GCCcore(Gcc):
"""Compiler-only toolchain, including only GCC and binutils."""
NAME = 'GCCcore'
# Replace the default compiler module name with our own
COMPILER_MODULE_NAME = [NAME]
SUBTOOLCHAIN = DUMMY_TOOLCHAIN_NAME
##
# Copyright 2012-2015 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://vscentrum.be/nl/en),
# the Hercules foundation (http://www.herculesstichting.be/in_English)
# 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 GCC compiler toolchain.
@author: Kenneth Hoste (Ghent University)
"""
from easybuild.toolchains.compiler.gcc import Gcc
class GNU(Gcc):
"""Compiler-only toolchain, including only GCC and binutils."""
NAME = 'GNU'
from pkgutil import extend_path
# we're not the only ones in this namespace
__path__ = extend_path(__path__, __name__)
File added
File added
from pkgutil import extend_path
# we're not the only ones in this namespace
__path__ = extend_path(__path__, __name__)
File added
#!/usr/bin/env python
#
# Copyright (C) 2015 IT4Innovations
# Lumir Jasiok
# lumir.jasiok@vsb.cz
# http://www.it4i.cz
#
#
import os
from easybuild.tools.config import install_path
from easybuild.tools.module_naming_scheme import ModuleNamingScheme
class IT4I_UV_ModuleNamingScheme(ModuleNamingScheme):
"""Class implementing an example module naming scheme."""
#REQUIRED_KEYS = ['name', 'version', 'toolchain', 'moduleclass', 'sources', 'description', 'versionsuffix']
REQUIRED_KEYS = []
def det_install_subdir(self, ec):
"""
Determine name of software installation subdirectory of install path.
@param ec: dict-like object with easyconfig parameter values; for now only the 'name',
'version', 'versionsuffix' and 'toolchain' parameters are guaranteed to be available
@return: string with name of subdirectory, e.g.: '<compiler>/<mpi_lib>/<name>/<version>'
"""
# by default: use full module name as name for install subdir
# fetch required values
name = ec['name']
version = ec['version']
tc_name = ec['toolchain']['name']
tc_version = ec['toolchain']['version']
moduleclass = ec['moduleclass']
version_suffix = ec['versionsuffix']
if version_suffix != '':
self.log.info("IT4I UV version_suffix %s" % version_suffix)
else:
self.log.info("IT4I UV version_suffix not found")
# Get the install path from configuration
installpath = os.path.join(install_path(), 'uv')
self.log.info("IT4I UV Install path for software is %s" % installpath)
self.log.info("IT4I UV This application moduleclass is %s" % moduleclass)
moduleclass_dir = os.path.join(installpath, moduleclass)
if (tc_name == "dummy" and (tc_version == "dummy" or not tc_version)):
self.software_full_version = version
self.log.info("IT4I UV Software full name (dummy toolchain) is %s" % self.software_full_version)
else:
self.software_full_version = version + "-" + tc_name + "-" + tc_version
self.log.info("IT4I UV Software full name is %s" % self.software_full_version)
if (version_suffix != ''):
self.software_full_version += version_suffix
self.log.info("IT4I UV Software full name (with version_suffix) is %s" % self.software_full_version)
if not os.path.isdir(moduleclass_dir):
self.log.info("IT4I UV software moduleclass directory %s missing, creating" % moduleclass_dir)
os.mkdir(moduleclass_dir)
software_dir = os.path.join(moduleclass_dir, name)
if not os.path.isdir(software_dir):
self.log.info("IT4I UV software application directory %s missing, creating" % software_dir)
os.mkdir(software_dir)
symlink_path = os.path.join(software_dir, self.software_full_version)
if not os.path.islink(symlink_path):
self.log.info("IT4I UV Missing application symlink %s, creating" % symlink_path)
os.symlink(os.path.join(installpath, 'all', name, self.software_full_version), symlink_path)
return os.path.join('all', name, self.software_full_version)
def det_module_subdir(self, ec):
"""
Determine subdirectory for module file in $MODULEPATH.
This determines the separation between module names exposed to users, and what's part of the $MODULEPATH.
@param ec: dict-like object with easyconfig parameter values; for now only the 'name',
'version', 'versionsuffix' and 'toolchain' parameters are guaranteed to be available
@return: string with subdir path (relative to $MODULEPATH), e.g. '<compiler>/<mpi_lib>'
"""
# by default: no subdirectory, but we have to use 'uv' subdirectory
return 'uv'
def det_full_module_name(self, ec):
"""
Determine full module name from given easyconfig, according to an example module naming scheme.
@param ec: dict-like object with easyconfig parameter values (e.g. 'name', 'version', etc.)
@return: string representing full module name, e.g.: 'goolf/1.4.10/gzip/1.5'
"""
# fetch required values
name = ec['name']
version = ec['version']
tc_name = ec['toolchain']['name']
tc_version = ec['toolchain']['version']
version_suffix = ec['versionsuffix']
if (tc_name == "dummy" and (tc_version == "dummy" or not tc_version)):
self.module_full_version = version
else:
self.module_full_version = version + "-" + tc_name + "-" + tc_version
if (version_suffix != ''):
self.module_full_version += version_suffix
self.log.debug("IT4I UV Full module name is %s" % self.module_full_version)
return os.path.join(name, self.module_full_version)
File added
File added
#!/usr/bin/env python
#
# Copyright (C) 2015 IT4Innovations
# Lumir Jasiok
# lumir.jasiok@vsb.cz
# http://www.it4i.cz
#
#
import os
from easybuild.tools.config import install_path
from easybuild.tools.module_naming_scheme import ModuleNamingScheme
class IT4IModuleNamingScheme(ModuleNamingScheme):
"""Class implementing an example module naming scheme."""
REQUIRED_KEYS = []
def det_install_subdir(self, ec):
"""
Determine name of software installation subdirectory of install path.
@param ec: dict-like object with easyconfig parameter values; for now
only the 'name', 'version', 'versionsuffix' and
'toolchain' parameters are guaranteed to be available
@return: string with name of subdirectory, e.g.:
'<compiler>/<mpi_lib>/<name>/<version>'
"""
# by default: use full module name as name for install subdir
# fetch required values
name = ec['name']
version = ec['version']
tc_name = ec['toolchain']['name']
tc_version = ec['toolchain']['version']
moduleclass = ec['moduleclass']
version_suffix = ec['versionsuffix']
if version_suffix != '':
self.log.info("IT4I found version_suffix %s" % version_suffix)
else:
self.log.info("IT4I version_suffix not found")
# Get the install path from configuration
installpath = install_path()
self.log.info("IT4I Install path for software is %s" % installpath)
self.log.info("IT4I This application moduleclass is %s" % moduleclass)
moduleclass_dir = os.path.join(installpath, moduleclass)
if (tc_name == "dummy" and (tc_version == "dummy" or not tc_version)):
self.software_full_version = version
self.log.info("IT4I Software full name (dummy toolchain) is %s"
% self.software_full_version)
else:
self.software_full_version = version + "-" + tc_name + "-" \
+ tc_version
self.log.info("IT4I Software full name is %s"
% self.software_full_version)
if (version_suffix != ''):
self.software_full_version += version_suffix
self.log.info("IT4I Software full name (with version_suffix) is %s"
% self.software_full_version)
if not os.path.isdir(moduleclass_dir):
self.log.info("IT4I software moduleclass directory %s \
missing, creating" % moduleclass_dir)
os.mkdir(moduleclass_dir)
software_dir = os.path.join(moduleclass_dir, name)
if not os.path.isdir(software_dir):
self.log.info("IT4I software application directory %s \
missing, creating" % software_dir)
os.mkdir(software_dir)
symlink_path = os.path.join(software_dir, self.software_full_version)
if not os.path.islink(symlink_path):
self.log.info("IT4I Missing application symlink %s, creating"
% symlink_path)
os.symlink(os.path.join(installpath, 'all', name, self.software_full_version), symlink_path)
return os.path.join('all', name, self.software_full_version)
def det_full_module_name(self, ec):
"""
Determine full module name from given easyconfig, according to and
example module naming scheme.
@param ec: dict-like object with easyconfig parameter values
(e.g. 'name', 'version', etc.)
@return: string representing full module name, e.g.:
'goolf/1.4.10/gzip/1.5'
"""
# fetch required values
name = ec['name']
version = ec['version']
tc_name = ec['toolchain']['name']
tc_version = ec['toolchain']['version']
version_suffix = ec['versionsuffix']
if (tc_name == "dummy" and (tc_version == "dummy" or not tc_version)):
self.module_full_version = version
else:
self.module_full_version = version + "-" + tc_name + "-" + tc_version
if (version_suffix != ''):
self.module_full_version += version_suffix
self.log.debug("IT4I Full module name is %s"
% self.module_full_version)
return os.path.join(name, self.module_full_version)
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment