From 239a694366099ee2e2ad6da89d52f8fb4fb4b378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Kvalsvik?= Date: Wed, 3 Jan 2018 09:05:53 +0100 Subject: [PATCH] Help delocate find dylibs on OS X on travis delocate is used to build wheels on travis, and the logic that looks up run-time dependencies could not figure out where the correct .dylib was from @rpath/libsegyio.1.dylib. This is apparently expected behaviour. From delocate's readme: > where the first line is the install name id that the linker picked up > when linking myext.so to libme.dylib. You job is to fix the build > process so that libme.dylib has install name id /path/to/libme.dylib. > This is not a problem specific to delocate; you will need to do this > to make sure that myext.so can load libme.dylib without libme.dylib > being in the current working directory. For CMAKE builds you may want > to check out CMAKE_INSTALL_NAME_DIR. https://pypi.python.org/pypi/delocate By passing CMAKE_INSTALL_NAME_DIR to cmake (which does nothing on linux as far as I'm aware), multibuild is able to pick up the correct dylib and build it into the wheel. --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 86777acb3..8f4e88939 100644 --- a/.travis.yml +++ b/.travis.yml @@ -88,6 +88,7 @@ before_script: - $SCAN cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release + -DCMAKE_INSTALL_NAME_DIR=/usr/local/lib $enabled .. - cppcheck --language=c --std=c99 @@ -102,13 +103,17 @@ before_script: # distutils/setuptools on macos ignores the --rpath argument, so set # DYLD_LIBRARY_PATH so that the freshly-built image is picked up on for the -# tests +# tests. +# +# segyio is configured with CMAKE_INSTALL_NAME_DIR so that the wheel build on +# OS X so the delocate tool can figure out what dylib to include. script: - pushd build - export DYLD_LIBRARY_PATH=$PWD/lib - $SCAN make && ctest --output-on-failure - sudo make install - popd + - sudo rm -rf build - build_wheel . $PLAT - install_run $PLAT - mv wheelhouse dist