Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid CMake fiddling with the RPATHs injected by EasyBuild via --rpath #1031

Merged
merged 3 commits into from
Nov 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions easybuild/easyblocks/generic/cmakemake.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,15 @@ def configure_step(self, srcdir=None, builddir=None):
if value is not None:
options.append("-D%s='%s'" % (option, value))

if build_option('rpath'):
# instruct CMake not to fiddle with RPATH when --rpath is used, since it will undo stuff on install...
# https://github.com/LLNL/spack/blob/0f6a5cd38538e8969d11bd2167f11060b1f53b43/lib/spack/spack/build_environment.py#L416
options.append('-DCMAKE_SKIP_RPATH=ON')

# show what CMake is doing by default
options.append("-DCMAKE_VERBOSE_MAKEFILE=ON")
options.append('-DCMAKE_VERBOSE_MAKEFILE=ON')

options_string = " ".join(options)
options_string = ' '.join(options)

command = "%s cmake %s %s %s" % (self.cfg['preconfigopts'], srcdir, options_string, self.cfg['configopts'])
(out, _) = run_cmd(command, log_all=True, simple=False)
Expand Down
10 changes: 7 additions & 3 deletions easybuild/easyblocks/m/metis.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@

from easybuild.easyblocks.generic.configuremake import ConfigureMake
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.filetools import mkdir
from easybuild.tools.config import build_option
from easybuild.tools.filetools import apply_regex_substitutions, mkdir
from easybuild.tools.run import run_cmd


Expand All @@ -47,14 +48,17 @@ class EB_METIS(ConfigureMake):
def __init__(self, *args, **kwargs):
"""Define custom class variables for METIS."""
super(EB_METIS, self).__init__(*args, **kwargs)

self.lib_exts = []

def configure_step(self, *args, **kwargs):
"""Configure build using 'make config' (only for recent versions (>= v5))."""

if LooseVersion(self.version) >= LooseVersion("5"):

if build_option('rpath'):
# patch Makefile to tell CMake not to wipe the RPATHs we inject...
apply_regex_substitutions('Makefile', [(r'^(CONFIG_FLAGS\s*=\s*)', r'\1 -DCMAKE_SKIP_RPATH=ON ')])

cmd = "make %s config prefix=%s" % (self.cfg['configopts'], self.installdir)
run_cmd(cmd, log_all=True, simple=True)

Expand All @@ -77,7 +81,7 @@ def install_step(self):
"""
Install by manually copying files to install dir, for old versions,
or by running 'make install' for new versions.

Create symlinks where expected by other applications
(in Lib instead of lib)
"""
Expand Down