Skip to content

Commit 2f0cbd9

Browse files
committed
Fix conda build on recent Mac OS X systems.
Recent OS X versions disallow DYLD_FALLBACK_LIBRARY_PATH. Solution: add RPATH to the conda lib directory to the alltests program.
1 parent 1fc55d1 commit 2f0cbd9

4 files changed

Lines changed: 4 additions & 7 deletions

File tree

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ install:
110110
# Mac OS X must use the same deployment target as conda-build.
111111
- if $MYUSEMC && [[ "${TRAVIS_OS_NAME}" == osx ]]; then
112112
export MACOSX_DEPLOYMENT_TARGET=10.7;
113-
export DYLD_FALLBACK_LIBRARY_PATH="${MYLIB}";
114113
fi
115114

116115
# Linux ld linker requires that libraries can be resolved at link time.

conda-recipe/build.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ if [[ `uname` == Linux ]]; then
77
export LD_LIBRARY_PATH="${PREFIX}/lib"
88
fi
99

10-
if [[ `uname` == Darwin ]]; then
11-
export DYLD_FALLBACK_LIBRARY_PATH="${PREFIX}/lib"
12-
fi
13-
1410
MYNCPU=$(( (CPU_COUNT > 8) ? 8 : CPU_COUNT ))
1511

1612
# Apply sconscript.local customizations.

conda-recipe/meta.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ test:
3232
# Run unit-test program with the installed shared library.
3333
# Make sure tests cannot use library file from the source directory.
3434
- scons -C "$SRC_DIR" --clean lib
35-
- export LD_LIBRARY_PATH="${PREFIX}/lib" # [linux]
36-
- export DYLD_FALLBACK_LIBRARY_PATH="${PREFIX}/lib" # [osx]
3735
- ALLTESTSFAST=$(ls -t ${SRC_DIR}/build/fast*/tests/alltests | head -1)
3836
- "${ALLTESTSFAST}"
3937

src/tests/SConscript

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ env_test.Tool('cxxtest')
99
lib_dir = libdiffpy[0].dir.abspath
1010
env_test.PrependUnique(LIBS='diffpy', LIBPATH=lib_dir, delete_existing=1)
1111
env_test.PrependUnique(LINKFLAGS="-Wl,-rpath,%r" % lib_dir)
12+
# Ensure shared libraries will be found for conda-build.
13+
if os.environ.get('CONDA_BUILD'):
14+
conda_lib = os.environ['PREFIX'] + '/lib'
15+
env_test.AppendUnique(LINKFLAGS="-Wl,-rpath,%r" % conda_lib)
1216
pat = 'diffpy|boost_serialization|ObjCryst'
1317
keeplibs = lambda s: re.search(pat, str(s))
1418
env_test.Replace(LIBS=filter(keeplibs, env_test['LIBS']))

0 commit comments

Comments
 (0)