diff --git a/easybuild/easyblocks/a/armadillo.py b/easybuild/easyblocks/a/armadillo.py index 60b0744ffc8..dc52d9d0205 100644 --- a/easybuild/easyblocks/a/armadillo.py +++ b/easybuild/easyblocks/a/armadillo.py @@ -51,6 +51,9 @@ def configure_step(self): self.cfg.update('configopts', '-DBLAS_LIBRARY:PATH="%s"' % os.getenv('LIBBLAS')) self.cfg.update('configopts', '-DLAPACK_LIBRARY:PATH="%s"' % os.getenv('LIBLAPACK')) + # enable out-of-source build (until it becomes the default) + self.cfg['separate_build_dir'] = True + super(EB_Armadillo, self).configure_step() def sanity_check_step(self): diff --git a/easybuild/easyblocks/b/bamtools.py b/easybuild/easyblocks/b/bamtools.py index b797f1fa5ad..0e2af6bae50 100755 --- a/easybuild/easyblocks/b/bamtools.py +++ b/easybuild/easyblocks/b/bamtools.py @@ -42,14 +42,8 @@ class EB_BamTools(MakeCp, CMakeMake): def configure_step(self): """Configure BamTools build.""" - # BamTools requires an out of source build. - builddir = os.path.join(self.cfg['start_dir'], 'build') - try: - mkdir(builddir) - os.chdir(builddir) - except OSError, err: - raise EasyBuildError("Failed to move to %s: %s", builddir, err) - + # BamTools requires an out of source build, so enable it (until it becomes the default) + self.cfg['separate_build_dir'] = True CMakeMake.configure_step(self, srcdir='..') def sanity_check_step(self): diff --git a/easybuild/easyblocks/c/cgal.py b/easybuild/easyblocks/c/cgal.py index a8ceb50967e..c7a139c9801 100644 --- a/easybuild/easyblocks/c/cgal.py +++ b/easybuild/easyblocks/c/cgal.py @@ -52,6 +52,9 @@ def configure_step(self): os.environ['BOOST_ROOT'] = get_software_root("Boost") + # enable out-of-source build (until it becomes the default) + self.cfg['separate_build_dir'] = True + super(EB_CGAL, self).configure_step() def sanity_check_step(self): diff --git a/easybuild/easyblocks/c/clang.py b/easybuild/easyblocks/c/clang.py index 479d3887ad5..87be3344ab6 100644 --- a/easybuild/easyblocks/c/clang.py +++ b/easybuild/easyblocks/c/clang.py @@ -194,6 +194,9 @@ def configure_step(self): if self.cfg['parallel']: self.make_parallel_opts = "-j %s" % self.cfg['parallel'] + # disable regular out-of-source build, too simplistic for Clang to work + self.cfg['separate_build_dir'] = False + self.log.info("Configuring") super(EB_Clang, self).configure_step(srcdir=self.llvm_src_dir) diff --git a/easybuild/easyblocks/g/gate.py b/easybuild/easyblocks/g/gate.py index edf3e489d14..69c461c620c 100644 --- a/easybuild/easyblocks/g/gate.py +++ b/easybuild/easyblocks/g/gate.py @@ -68,6 +68,10 @@ def configure_step(self): """Custom configure procedure for GATE: CMake for versions 6.2 or more recent.""" if LooseVersion(self.version) >= '6.2': + + # enable out-of-source build (until it becomes the default) + self.cfg['separate_build_dir'] = True + super(EB_GATE, self).configure_step() def build_step(self): diff --git a/easybuild/easyblocks/g/geant4.py b/easybuild/easyblocks/g/geant4.py index 588fc9b592c..a2e92987784 100644 --- a/easybuild/easyblocks/g/geant4.py +++ b/easybuild/easyblocks/g/geant4.py @@ -79,9 +79,10 @@ def configure_step(self): # Geant4 switched to a CMake build system in version 9.4 if LooseVersion(self.version) >= LooseVersion("9.4"): - mkdir('configdir') - os.chdir('configdir') - super(EB_Geant4, self).configure_step(srcdir="..") + # enable out-of-source build + self.cfg['separate_build_dir'] = True + + super(EB_Geant4, self).configure_step() else: pwd = self.cfg['start_dir'] diff --git a/easybuild/easyblocks/g/gromacs.py b/easybuild/easyblocks/g/gromacs.py index f1f72947414..0e1249c5a9f 100644 --- a/easybuild/easyblocks/g/gromacs.py +++ b/easybuild/easyblocks/g/gromacs.py @@ -112,6 +112,9 @@ def configure_step(self): else: self.cfg.update('configopts', "-DGMX_GSL=OFF") + # enable out-of-source build (until it becomes the default) + self.cfg['separate_build_dir'] = True + # complete configuration with configure_method of parent out = super(EB_GROMACS, self).configure_step() diff --git a/easybuild/easyblocks/generic/cmakemake.py b/easybuild/easyblocks/generic/cmakemake.py index 5953650df75..9d16da873f5 100644 --- a/easybuild/easyblocks/generic/cmakemake.py +++ b/easybuild/easyblocks/generic/cmakemake.py @@ -47,12 +47,15 @@ class CMakeMake(ConfigureMake): @staticmethod def extra_options(extra_vars=None): """Define extra easyconfig parameters specific to CMakeMake.""" - extra_vars = ConfigureMake.extra_options(extra_vars) - extra_vars.update({ + extra = { 'srcdir': [None, "Source directory location to provide to cmake command", CUSTOM], - 'separate_build_dir': [False, "Perform build in a separate directory", CUSTOM], - }) - return extra_vars + 'separate_build_dir': [None, "Perform build in a separate directory", CUSTOM], + } + + if extra_vars is not None: + extra.update(extra_vars) + + return ConfigureMake.extra_options(extra) def configure_step(self, srcdir=None, builddir=None): """Configure build using cmake""" @@ -67,7 +70,14 @@ def configure_step(self, srcdir=None, builddir=None): setvar("CMAKE_LIBRARY_PATH", library_paths) default_srcdir = '.' - if self.cfg.get('separate_build_dir', False): + + separate_build_dir = self.cfg['separate_build_dir'] + if self.cfg['separate_build_dir'] is None: + msg = "Easyconfig parameter 'separate_build_dir' (custom to CMakeMake easyblock) has not set explicitely " + msg += "to True or False; default value in the future will be True" + self.log.deprecated(msg, '3.0') + + if separate_build_dir: objdir = os.path.join(self.builddir, 'easybuild_obj') try: os.mkdir(objdir) diff --git a/easybuild/easyblocks/generic/cmakepythonpackage.py b/easybuild/easyblocks/generic/cmakepythonpackage.py index 6a83197b3c9..d33b8840e87 100644 --- a/easybuild/easyblocks/generic/cmakepythonpackage.py +++ b/easybuild/easyblocks/generic/cmakepythonpackage.py @@ -56,6 +56,9 @@ def configure_step(self, *args, **kwargs): PythonPackage.configure_step(self, *args, **kwargs) + # enable out-of-source build (until it becomes the default) + self.cfg['separate_build_dir'] = True + return CMakeMake.configure_step(self, *args, **kwargs) def build_step(self, *args, **kwargs): diff --git a/easybuild/easyblocks/n/netcdf.py b/easybuild/easyblocks/n/netcdf.py index a244bd43ad4..89eed8916e2 100644 --- a/easybuild/easyblocks/n/netcdf.py +++ b/easybuild/easyblocks/n/netcdf.py @@ -69,6 +69,9 @@ def configure_step(self): if hdf5: env.setvar('HDF5_ROOT', hdf5) + # enable out-of-source build (until it becomes the default) + self.cfg['separate_build_dir'] = True + CMakeMake.configure_step(self) def sanity_check_step(self): diff --git a/easybuild/easyblocks/o/openbabel.py b/easybuild/easyblocks/o/openbabel.py index f28a5bb4afa..abad647f5dd 100644 --- a/easybuild/easyblocks/o/openbabel.py +++ b/easybuild/easyblocks/o/openbabel.py @@ -36,8 +36,7 @@ class EB_OpenBabel(CMakeMake): """Support for installing the OpenBabel package.""" def configure_step(self): - # Use separate build directory - self.cfg['separate_build_dir'] = True + """Custom configure procedure for OpenBabel.""" self.cfg['configopts'] += "-DENABLE_TESTS=ON " # Needs wxWidgets @@ -60,6 +59,9 @@ def configure_step(self): else: self.log.info("Not using Eigen") + # enable out-of-source build + self.cfg['separate_build_dir'] = True + super(EB_OpenBabel, self).configure_step() def sanity_check_step(self): diff --git a/easybuild/easyblocks/p/psi.py b/easybuild/easyblocks/p/psi.py index b9fd2bf934f..ab56c6c98a4 100644 --- a/easybuild/easyblocks/p/psi.py +++ b/easybuild/easyblocks/p/psi.py @@ -58,7 +58,6 @@ def __init__(self, *args, **kwargs): @staticmethod def extra_options(): """Extra easyconfig parameters specific to PSI.""" - extra_vars = { # always include running PSI unit tests (takes about 2h or less) 'runtest': ["tests TESTFLAGS='-u -q'", "Run tests included with PSI, without interruption.", BUILD], @@ -144,6 +143,8 @@ def configure_step(self): if get_software_root('impi'): self.cfg['configopts'] += "-DENABLE_CSR=ON -DBLAS_TYPE=MKL " + # make sure out-of-source build is disabled (already done here) + self.cfg['separate_build_dir'] = False CMakeMake.configure_step(self, srcdir=self.cfg['start_dir']) def install_step(self): diff --git a/easybuild/easyblocks/t/trilinos.py b/easybuild/easyblocks/t/trilinos.py index c29881c982b..16d088602e2 100644 --- a/easybuild/easyblocks/t/trilinos.py +++ b/easybuild/easyblocks/t/trilinos.py @@ -201,13 +201,8 @@ def configure_step(self): for ext in skip_exts: self.cfg.update('configopts', "-DTrilinos_ENABLE_%s:BOOL=OFF" % ext) - # building in source dir not supported - try: - build_dir = "BUILD" - os.mkdir(build_dir) - os.chdir(build_dir) - except OSError, err: - raise EasyBuildError("Failed to create and move into build directory: %s", err) + # building in source dir not supported, so enable out-of-source build (until it becomes the default) + self.cfg['separate_build_dir'] = True # configure using cmake super(EB_Trilinos, self).configure_step(srcdir="..")