{"action":"closed","issue":{"url":"https://api.github.com/repos/ropensci/redland-bindings/issues/41","repository_url":"https://api.github.com/repos/ropensci/redland-bindings","labels_url":"https://api.github.com/repos/ropensci/redland-bindings/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/ropensci/redland-bindings/issues/41/comments","events_url":"https://api.github.com/repos/ropensci/redland-bindings/issues/41/events","html_url":"https://github.com/ropensci/redland-bindings/issues/41","id":145747825,"number":41,"title":"Error loading package from R command line","user":{"login":"sbpcs59","id":6412946,"avatar_url":"https://avatars.githubusercontent.com/u/6412946?v=3","gravatar_id":"","url":"https://api.github.com/users/sbpcs59","html_url":"https://github.com/sbpcs59","followers_url":"https://api.github.com/users/sbpcs59/followers","following_url":"https://api.github.com/users/sbpcs59/following{/other_user}","gists_url":"https://api.github.com/users/sbpcs59/gists{/gist_id}","starred_url":"https://api.github.com/users/sbpcs59/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbpcs59/subscriptions","organizations_url":"https://api.github.com/users/sbpcs59/orgs","repos_url":"https://api.github.com/users/sbpcs59/repos","events_url":"https://api.github.com/users/sbpcs59/events{/privacy}","received_events_url":"https://api.github.com/users/sbpcs59/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ropensci/redland-bindings/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-04-04T17:17:36Z","updated_at":"2016-04-05T22:02:07Z","closed_at":"2016-04-05T22:02:07Z","body":"If the CRAN built OS X redland.so is installed, the redland package cannot be loading\r\nfrom the R command line on Mac OS X:\r\n\r\n> library(redland)\r\nError in dyn.load(file, DLLpath = DLLpath, ...) : \r\n  unable to load shared object '/Users/slaughter/R/x86_64-darwin-library/3.2/redland/libs/redland.so':\r\n  dlopen(/Users/slaughter/R/x86_64-darwin-library/3.2/redland/libs/redland.so, 6): Library not loaded: /private/tmp/homebrew/opt/rasqal/lib/librasqal.3.dylib\r\n  Referenced from: /Users/slaughter/R/x86_64-darwin-library/3.2/redland/libs/redland.so\r\n  Reason: image not found\r\n\r\n## Lengthy explanation of the problem\r\nThis error is not seen with R.app, Rstudio or if the redland package is installed from source and\r\nbuilt locally. The reason for this problem with the R command is that the environment variable\r\n\"DYLD_FALLBACK_LIBRARY_PATH\" is being set incorrectly to not include \"/usr/local/lib\" which is\r\nthe location of librasqal.dylib, libraptor2.dylib installed from brew. The setting of this env var is in disagreement with the Apple docs at https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/dyld.1.html\r\nwhich state:\r\n\r\n```\r\n    DYLD_FALLBACK_LIBRARY_PATH\r\n              This  is  a  colon  separated  list  of directories that contain libraries.  It is used as the\r\n              default location for libraries not found in their install path.  By  default,  it  is  set  to\r\n              $(HOME)/lib:/usr/local/lib:/lib:/usr/lib.\r\n```\r\n\r\nSince redland.so on CRAN is linked to librasql.dylib, libraptor2.dylib installed in /tmp, when this .so\r\nis downloaded to the user machine, it 'falls back' to the libraries found in the search path specified by\r\nthe env var.\r\n\r\n## Potential fixes\r\n\r\n- [ ] Change install instructions to have all OS X users install redland from source\r\n- [ ] Build CRAN binaries with libraptor*, librasqal* installed in /usr/local (not sure if CRAN will let us do this)\r\n- [ ] Have users set the DYLD_LIBRARY_PATH in ~/.Renviron\r\n- [ ] Convince CRAN to set the env var to include /usr/local\r\n\r\n"}}