Skip to content

Commit

Permalink
Ensure .so install name & filename match on OSX (fixes #1144)
Browse files Browse the repository at this point in the history
OS X convention requires that the basename part of a shared library's
install name (i.e., install name minus directory components) match the
actual filename of said shared library. Otherwise, the dynamic linker
(and related tools) could get confused when trying to find, process,
and/or load the dynamic library.

On OS X, the "mv" command at the end of the build process changes the
shared library filename to "datatable.so" while leaving the install name
as "data.table.so", so we need to run install_name_tool(1) to fix the
install name to match the filename. Currently not a big issue for most
users (since not much else links to this shared library), but not doing
this causes issues with build systems (e.g., conda) that end up
modifying the .so's RPATH for some reason.
  • Loading branch information
Cheng H. Lee committed Dec 1, 2015
1 parent 6a675fe commit 0234b38
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@

13. GForce is optimised for `.SD[val]` and `col[val]` where `val` is a positive length-1 value. Partly addresses [#523](https://github.com/Rdatatable/data.table/issues/523).

14. Run `install_name_tool` when building on OS X to ensure that the install name for datatable.so matches its filename. Fixes [#1144](https://github.com/Rdatatable/data.table/issues/1144). Thanks to @chenghlee for the PR.

#### BUG FIXES

1. Now compiles and runs on IBM AIX gcc. Thanks to Vinh Nguyen for investigation and testing, [#1351](https://github.com/Rdatatable/data.table/issues/1351).
Expand Down
1 change: 1 addition & 0 deletions src/Makevars
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

all: $(SHLIB)
mv $(SHLIB) datatable$(SHLIB_EXT)
if [ `uname -s` = 'Darwin' ]; then install_name_tool -id datatable$(SHLIB_EXT) datatable$(SHLIB_EXT); fi


0 comments on commit 0234b38

Please sign in to comment.