Skip to content

Commit 4606da6

Browse files
committed
use relative path to rpath_args.py script when creating RPATH wrapper scripts
1 parent c863497 commit 4606da6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

easybuild/scripts/rpath_wrapper_template.sh.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ function log {
4242

4343
# command name
4444
CMD=`basename $0`
45+
TOPDIR=`dirname $0`
4546

4647
log "found CMD: $CMD | original command: %(orig_cmd)s | orig args: '$(echo \"$@\")'"
4748

easybuild/tools/toolchain/toolchain.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,13 +1019,16 @@ def prepare_rpath_wrappers(self, rpath_filter_dirs=None, rpath_include_dirs=None
10191019
# must also wrap compilers commands, required e.g. for Clang ('gcc' on OS X)?
10201020
c_comps, fortran_comps = self.compilers()
10211021

1022-
# copy rpath_args.py script along RPATH wrappers,
1023-
# to avoid that they rely on an script that's located elsewhere;
1022+
# copy rpath_args.py script along RPATH wrappers
1023+
# and use path for %(rpath_args)s template value relative to location of the RPATH wrapper script,
1024+
# to avoid that the RPATH wrapper scripts rely on a script that's located elsewhere;
10241025
# that's mostly important when RPATH wrapper scripts are retained to be used outside of EasyBuild
10251026
rpath_args_py = find_eb_script('rpath_args.py')
10261027
mkdir(wrappers_dir, parents=True)
10271028
copy_file(rpath_args_py, wrappers_dir)
1028-
rpath_args_py = os.path.join(wrappers_dir, os.path.basename(rpath_args_py))
1029+
# here we assume that each RPATH wrapper script is created in a separate subdirectory (see wrapper_dir below);
1030+
# ${TOPDIR} is defined in template RPATH wrapper script, refers to parent dir in which wrapper script is located
1031+
rpath_args_py = os.path.join('${TOPDIR}', '..', os.path.basename(rpath_args_py))
10291032

10301033
rpath_wrapper_template = find_eb_script('rpath_wrapper_template.sh.in')
10311034

0 commit comments

Comments
 (0)