Skip to content

Commit

Permalink
Help delocate find dylibs on OS X on travis
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jokva committed Jan 3, 2018
1 parent 6b0225a commit 239a694
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 239a694

Please sign in to comment.