Skip to content

Commit

Permalink
Merge pull request easybuilders#1056 from pescobar/binary_block_skip_…
Browse files Browse the repository at this point in the history
…rpath_sanity_check

skip RPATH sanity check for binary installations
  • Loading branch information
boegel authored Dec 3, 2016
2 parents 49c34c3 + 2fbb2ca commit 496d3a7
Show file tree
Hide file tree
Showing 18 changed files with 78 additions and 183 deletions.
12 changes: 2 additions & 10 deletions easybuild/easyblocks/a/ansys.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,19 @@
import os
import stat

from easybuild.framework.easyblock import EasyBlock
from easybuild.easyblocks.generic.packedbinary import PackedBinary
from easybuild.tools.run import run_cmd
from easybuild.tools.filetools import adjust_permissions


class EB_ANSYS(EasyBlock):
class EB_ANSYS(PackedBinary):
"""Support for installing ANSYS."""

def __init__(self, *args, **kwargs):
"""Initialize ANSYS-specific variables."""
super(EB_ANSYS, self).__init__(*args, **kwargs)
self.ansysver = "v%s" % ''.join(self.version.split('.')[0:2])

def configure_step(self):
"""No configuration for ANSYS."""
pass

def build_step(self):
"""No building for ANSYS."""
pass

def install_step(self):
"""Custom install procedure for ANSYS."""
licserv = self.cfg['license_server']
Expand Down
12 changes: 2 additions & 10 deletions easybuild/easyblocks/a/ant.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,15 @@
import os
import shutil

from easybuild.framework.easyblock import EasyBlock
from easybuild.easyblocks.generic.packedbinary import PackedBinary
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.modules import get_software_root, get_software_version
from easybuild.tools.run import run_cmd


class EB_ant(EasyBlock):
class EB_ant(PackedBinary):
"""Support for building and installing ant."""

def configure_step(self):
"""No configure step for ant."""
pass

def build_step(self):
"""No build step for ant."""
pass

def install_step(self):
"""Custom install procedure for ant."""

Expand Down
27 changes: 8 additions & 19 deletions easybuild/easyblocks/b/bisearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,43 +33,32 @@
"""
import os

from easybuild.framework.easyblock import EasyBlock
from easybuild.easyblocks.generic.packedbinary import PackedBinary
from easybuild.tools.run import run_cmd_qa


class EB_BiSearch(EasyBlock):
class EB_BiSearch(PackedBinary):
"""
Support for building BiSearch.
Basically just run the interactive installation script install.sh.
"""

def configure_step(self):
"""(no configure)"""
pass

def build_step(self):
"""(empty, building is performed in make_install step)"""
pass

def install_step(self):
cmd = "./install.sh"

qanda = {
'Please enter the BiSearch root directory: ': self.installdir,
'Please enter the path of c++ compiler [/usr/bin/g++]: ': os.getenv('CXX')
}
'Please enter the BiSearch root directory: ': self.installdir,
'Please enter the path of c++ compiler [/usr/bin/g++]: ': os.getenv('CXX')
}

no_qa = [r'Compiling components\s*\.*']

run_cmd_qa(cmd, qanda, no_qa=no_qa, log_all=True, simple=True)

def sanity_check_step(self):
"""Custom sanity check for BiSearch."""

custom_paths = {
'files':["bin/%s" % x for x in ["fpcr", "indexing_cdna",
"indexing_genome", "makecomp"]],
'dirs':[]
}

'files':['bin/%s' % x for x in ['fpcr', 'indexing_cdna', 'indexing_genome', 'makecomp']],
'dirs':[],
}
super(EB_BiSearch, self).sanity_check_step(custom_paths=custom_paths)
18 changes: 5 additions & 13 deletions easybuild/easyblocks/c/chimera.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,21 @@

import os

from easybuild.framework.easyblock import EasyBlock
from easybuild.easyblocks.generic.packedbinary import PackedBinary
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.run import run_cmd


class EB_Chimera(EasyBlock):
class EB_Chimera(PackedBinary):
"""Support for installing Chimera."""

def extract_step(self, verbose=False):
"""Custom extraction of sources for Chimera: unpack installation file
to obtain chimera.bin installer."""

cmd = "unzip -d %s %s" % (self.builddir, self.src[0]['path'])
run_cmd(cmd, log_all=True, simple=True)

def configure_step(self, cmd_prefix=''):
""" skip configure """
pass

def build_step(self, verbose=False):
""" skip build """
pass


def install_step(self):
"""Install using chimera.bin."""

Expand Down
16 changes: 2 additions & 14 deletions easybuild/easyblocks/e/eigen.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,16 @@
import shutil
from distutils.version import LooseVersion

from easybuild.framework.easyblock import EasyBlock
from easybuild.easyblocks.generic.tarball import Tarball
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.filetools import mkdir


class EB_Eigen(EasyBlock):
class EB_Eigen(Tarball):
"""
Support for building Eigen.
"""

def configure_step(self):
"""
No configure for Eigen.
"""
pass

def build_step(self):
"""
No build for Eigen.
"""
pass

def install_step(self):
"""
Install by copying files to install dir
Expand Down
8 changes: 2 additions & 6 deletions easybuild/easyblocks/f/fdtd_solutions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,15 @@
import glob
import os
import shutil
from easybuild.easyblocks.generic.packedbinary import PackedBinary
from easybuild.easyblocks.generic.rpm import rebuild_rpm
from easybuild.framework.easyblock import EasyBlock
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.run import run_cmd_qa


class EB_FDTD_underscore_Solutions(EasyBlock):
class EB_FDTD_underscore_Solutions(PackedBinary):
"""Support for building/installing FDTD Solutions."""

def configure_step(self):
"""No configuration for FDTD Solutions."""
pass

def build_step(self):
"""No build step for FDTD Solutions."""
# locate RPM and rebuild it to make it relocatable
Expand Down
13 changes: 2 additions & 11 deletions easybuild/easyblocks/f/fluent.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,21 @@
import stat
from distutils.version import LooseVersion

from easybuild.framework.easyblock import EasyBlock
from easybuild.easyblocks.generic.packedbinary import PackedBinary
from easybuild.tools.filetools import adjust_permissions
from easybuild.tools.run import run_cmd


class EB_FLUENT(EasyBlock):
class EB_FLUENT(PackedBinary):
"""Support for installing FLUENT."""

def __init__(self, *args, **kwargs):
"""Custom constructor for FLUENT easyblock, initialize/define class parameters."""
super(EB_FLUENT, self).__init__(*args, **kwargs)
self.fluent_verdir = 'v%s' % ''.join(self.version.split('.')[:2])

def configure_step(self):
"""No configuration for FLUENT."""
pass

def build_step(self):
"""No building for FLUENT."""
pass

def install_step(self):
"""Custom install procedure for FLUENT."""

extra_args =''
# only include -noroot flag for older versions
if LooseVersion(self.version) < LooseVersion('15.0'):
Expand Down
7 changes: 6 additions & 1 deletion easybuild/easyblocks/generic/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(self, *args, **kwargs):
self.log.info("Performing staged installation via %s" % self.installdir)

def extract_step(self):
"""Move all source files to the build directory"""
"""Copy all source files to the build directory"""

self.src[0]['finalpath'] = self.builddir

Expand Down Expand Up @@ -124,6 +124,11 @@ def post_install_step(self):

super(Binary, self).post_install_step()

def sanity_check_rpath(self):
"""Skip the rpath sanity check, this is binary software"""
self.log.info("RPATH sanity check is skipped when using %s easyblock (derived from Binary)",
self.__class__.__name__)

def make_module_extra(self):
"""Add the install directory to the PATH."""

Expand Down
5 changes: 5 additions & 0 deletions easybuild/easyblocks/generic/intelbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,11 @@ def move_after_install(self):
shutil.rmtree(os.path.join(self.installdir, self.name))
except OSError, err:
raise EasyBuildError("Failed to move contents of %s to %s: %s", subdir, self.installdir, err)

def sanity_check_rpath(self):
"""Skip the rpath sanity check, this is binary software"""
self.log.info("RPATH sanity check is skipped when using %s easyblock (derived from IntelBase)",
self.__class__.__name__)

def make_module_extra(self):
"""Custom variable definitions in module file."""
Expand Down
5 changes: 5 additions & 0 deletions easybuild/easyblocks/generic/tarball.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,8 @@ def install_step(self, src=None):
shutil.copytree(src, self.installdir, symlinks=self.cfg['keepsymlinks'])
except OSError, err:
raise EasyBuildError("Copying %s to installation dir %s failed: %s", src, self.installdir, err)

def sanity_check_rpath(self):
"""Skip the rpath sanity check, this is binary software"""
self.log.info("RPATH sanity check is skipped when using %s easyblock (derived from Tarball)",
self.__class__.__name__)
12 changes: 2 additions & 10 deletions easybuild/easyblocks/i/ironpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@

import os

from easybuild.framework.easyblock import EasyBlock
from easybuild.easyblocks.generic.packedbinary import PackedBinary
from easybuild.tools.run import run_cmd


class EB_IronPython(EasyBlock):
class EB_IronPython(PackedBinary):
"""Support for building/installing IronPython."""

def __init__(self, *args, **kwargs):
Expand All @@ -52,14 +52,6 @@ def extract_step(self):
self.cfg.update('unpack_options', "--strip-components=1")
super(EB_IronPython, self).extract_step()

def configure_step(self):
"""No dedicated configure step for IronPython."""
pass

def build_step(self):
"""No dedicated build step for IronPython."""
pass

def install_step(self):
"""Custom install step for IronPython, using xbuild command."""

Expand Down
49 changes: 16 additions & 33 deletions easybuild/easyblocks/m/maple.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,45 +35,30 @@
import os
import shutil

from easybuild.framework.easyblock import EasyBlock
from easybuild.easyblocks.generic.binary import Binary
from easybuild.tools.run import run_cmd_qa


class EB_Maple(EasyBlock):
class EB_Maple(Binary):
"""Support for installing Maple."""

def extract_step(self):
"""Unpacking of files is just copying Maple binary installer to build dir."""

for f in self.src:
shutil.copy(f['path'], os.path.join(self.builddir, f['name']))
f['finalpath'] = self.builddir

def configure_step(self):
"""No configuration needed, binary installer"""
pass

def build_step(self):
"""No compilation needed, binary installer"""
pass

def install_step(self):
"""Interactive install of Maple."""

cmd = "%s/Maple%sLinuxX86_64Installer.bin" % (self.builddir, self.cfg['version'])

qa = {
'PRESS <ENTER> TO CONTINUE:': '',
'DO YOU ACCEPT THE TERMS OF THIS LICENSE AGREEMENT? (Y/N):': 'Y',
'ENTER AN ABSOLUTE PATH, OR PRESS <ENTER> TO ACCEPT THE DEFAULT :': self.installdir,
'IS THIS CORRECT? (Y/N):': 'Y',
'Do you wish to have a shortcut installed on your desktop? ->1- Yes 2- No ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT::': '2',
'->1- Single User License 2- Network License ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT::': '2',
'PRESS <ENTER> TO EXIT THE INSTALLER:': '',
'License server (DEFAULT: ):': self.cfg['license_server'],
'Port number (optional) (DEFAULT: ):': '',
'->1- Configure toolbox for Matlab 2- Do not configure at this time ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT::': '2'
}
'PRESS <ENTER> TO CONTINUE:': '',
'DO YOU ACCEPT THE TERMS OF THIS LICENSE AGREEMENT? (Y/N):': 'Y',
'ENTER AN ABSOLUTE PATH, OR PRESS <ENTER> TO ACCEPT THE DEFAULT :': self.installdir,
'IS THIS CORRECT? (Y/N):': 'Y',
'Do you wish to have a shortcut installed on your desktop? ->1- Yes 2- No ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT::': '2',
'->1- Single User License 2- Network License ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT::': '2',
'PRESS <ENTER> TO EXIT THE INSTALLER:': '',
'License server (DEFAULT: ):': self.cfg['license_server'],
'Port number (optional) (DEFAULT: ):': '',
'->1- Configure toolbox for Matlab 2- Do not configure at this time ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT::': '2'
}

no_qa = ['Graphical installers are not supported by the VM. The console mode will be used instead...',
'Extracting the JRE from the installer archive...',
Expand All @@ -86,10 +71,8 @@ def install_step(self):

def sanity_check_step(self):
"""Custom sanity check for Maple."""

custom_paths = {
'files': ['bin/maple', 'lib/maple.mla'] ,
'dirs':[]
}

'files': ['bin/maple', 'lib/maple.mla'] ,
'dirs':[]
}
super(EB_Maple, self).sanity_check_step(custom_paths=custom_paths)
Loading

0 comments on commit 496d3a7

Please sign in to comment.