wbirkett has asked for the wisdom of the Perl Monks concerning the following question:
Hello, I built an XS module that interfaces the Rmath statistics library. This was straightforward, and works fine, when installed in the normal location (/Library/Perl/5.18 on my Mac, the Rmath library is in /usr/local/lib). Now, I want to relocate the module and library to another location, in this case a TextMate bundle at ~/Library/Application Support/TextMate/Pristine Copy/Bundles. With the library in /usr/local/lib, the module works fine. But when I move the library to another location, the loading fails with this message:
Can't load '/Users/wbirkett/Library/Application Support/TextMate/Prist +ine Copy/Bundles/PressCal.tmbundle/Support/lib/perl5/darwin-thread-mu +lti-2level/auto/ICC/Support/Rmath/Rmath.bundle' for module ICC::Suppo +rt::Rmath: dlopen(/Users/wbirkett/Library/Application Support/TextMat +e/Pristine Copy/Bundles/PressCal.tmbundle/Support/lib/perl5/darwin-th +read-multi-2level/auto/ICC/Support/Rmath/Rmath.bundle, 1): Library no +t loaded: libRmath.dylib Referenced from: /Users/wbirkett/Library/Application Support/TextMat +e/Pristine Copy/Bundles/PressCal.tmbundle/Support/lib/perl5/darwin-th +read-multi-2level/auto/ICC/Support/Rmath/Rmath.bundle Reason: image not found at /System/Library/Perl/5.18/XSLoader.pm lin +e 71. at /Users/wbirkett/Library/Application Support/TextMate/Pristine Copy +/Bundles/PressCal.tmbundle/Support/lib/perl5/darwin-thread-multi-2lev +el/ICC/Support/Rmath.pm line 183. Compilation failed in require at /Users/wbirkett/Desktop/Rmath_test.pl + line 1. BEGIN failed--compilation aborted at /Users/wbirkett/Desktop/Rmath_tes +t.pl line 1.
From the documentation for XSLoader.pm, "To reduce the overhead as much as possible, only one possible location is checked to find the extension DLL (this location is where make install would put the DLL). If not found, the search for the DLL is transparently delegated to DynaLoader , which looks for the DLL along the @INC list." The library is definitely located in an @INC location, and the delegation to DynaLoader fails. I've tried many ideas to get this working, including setting the @DynaLoader::dl_library_path variable, and using DynaLoader.pm rather that XSLoader.pm, with no success.
I am completely stumped, and appeal to your monk wisdom for a solution.
|
|---|