Skip to content
Snippets Groups Projects
Commit 399f442f authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

Merge branch 'mnt/fsldevdir-rpath' into 'master'

Mnt/fsldevdir rpath

See merge request !30
parents 1f2af62d c46b0e35
No related branches found
No related tags found
1 merge request!30Mnt/fsldevdir rpath
Pipeline #11500 canceled
# FSL base project changelog
## 2111.3 (Wednesday 17th November 2021)
* The `$FSLDEVDIR/lib` directory is now added to the `rpath` entry for shared
libraries and executables, if `$FSLDEVDIR` is different from `$FSLDIR`.
## 2111.2 (Monday 15th November 2021)
* Added the `FSL_GE_606` `Makefile` flag for use by projects which need to
......
......@@ -78,17 +78,19 @@ ARCHNVCCLDFLAGS =
#
#####################################################################
# Drop -rpath flags from LDFLAGS if it is
# set in the environment - we explicitly
# add them below such that executables
# will be able to find libs in $(pwd) and
# in $FSLDIR/lib *in that order*. This is
# so that executables located in the
# project source dir can be executed in
# place with sensible behaviour (i.e. any
# shared libs located in the same dir will
# take precedence over libs of the same
# name in $FSLDIR/lib/).
# Drop -rpath flags from LDFLAGS if it is set in
# the environment - we explicitly add them below
# such that executables will be able to find libs
# in $(pwd), $FSLDEVDIR/lib, and $FSLDIR/lib *in
# that order*. This is so that executables
# located in the project source dir can be
# executed in place with sensible behaviour (i.e.
# any shared libs located in the same dir will
# take precedence over libs of the same name in
# $FSLDIR/lib/).
#
# Fortunately -Wl,-rpath is used for both g++ and
# clang, so we can cover both with one substitution.
COMMA := ,
_LDFLAGS := $(patsubst -Wl${COMMA}-rpath%,,${LDFLAGS})
LDFLAGS = ${_LDFLAGS}
......@@ -101,8 +103,12 @@ ifeq ($(SYSTYPE), Darwin)
CXX ?= clang++
CFLAGS ?= -arch x86_64 -Wall -pedantic
CXXFLAGS ?= -arch x86_64 -Wall -pedantic
LDFLAGS += -Wl,-rpath,"@executable_path/" \
-Wl,-rpath,"${FSLDIR}/lib"
LDFLAGS += -Wl,-rpath,"@executable_path/"
# Only add FSLDEVDIR if different to FSLDIR
ifneq (${FSLDEVDIR}, ${FSLDIR})
LDFLAGS += -Wl,-rpath,"${FSLDEVDIR}/lib"
endif
LDFLAGS += -Wl,-rpath,"${FSLDIR}/lib"
ARCHLIBS += -llapack -lblas -lz -lm
# On macOS, we need to change the install
......@@ -131,8 +137,15 @@ ifeq ($(SYSTYPE), Linux)
-Wall -pedantic -Wno-long-long
CXXFLAGS ?= -fexpensive-optimizations \
-Wall -pedantic -Wno-long-long
LDFLAGS += -Wl,-rpath,'$$ORIGIN:${FSLDIR}/lib' \
-Wl,-rpath-link,'$$ORIGIN:${FSLDIR}/lib'
LDFLAGS += -Wl,-rpath,'$$ORIGIN' \
-Wl,-rpath-link,'$$ORIGIN'
# Only add FSLDEVDIR if different to FSLDIR
ifneq (${FSLDEVDIR}, ${FSLDIR})
LDFLAGS += -Wl,-rpath,'${FSLDEVDIR}/lib' \
-Wl,-rpath-link,'${FSLDEVDIR}/lib'
endif
LDFLAGS += -Wl,-rpath,'${FSLDIR}/lib' \
-Wl,-rpath-link,'${FSLDIR}/lib'
ARCHLIBS += -lopenblas -lz -lm
endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment