Tom,

Please use 'reply-all' so that the thread stays on the list and therefore in 
the archives where it can be of assistance to others.

My guess is that the package, which appears to not yet be on CRAN and is still 
only in development on GitHub, may require some tweaking for the shell (eg. in 
~/.bash_profile), where you can use the full 'export ...' line. So I would add 
the line to that file and see if it works.

That it works in the manner you describe is an indication that the shell 
environment is picked up for the package when you start R from within a 
terminal session, which is not entirely surprising. Presumably, it will also 
work if you simply ran text console R within the terminal session.

Of course, it could be a bug in the package in terms of how it is getting 
environment variables, at least on OSX, which is either something the authors 
need to address or at least document.

If the above does not work, you may be better off directly contacting the 
package author for assistance with this since it is still in development and 
therefore not yet "stable".

Regards,

Marc

On Aug 8, 2013, at 4:18 PM, Tom Schoenemann <[email protected]> wrote:

> Thanks Marc,
> 
> My .Renviron looks like this:
> 
> DYLD_FALLBACK_LIBRARY_PATH=/Library/Frameworks/R.framework/Resources/lib
> 
> When I restart R.app, it does seem to have this set:
> 
> > Sys.getenv()
>                                     DYLD_FALLBACK_LIBRARY_PATH 
>                "/Library/Frameworks/R.framework/Resources/lib"  
> 
> However, the package that needs to know this is still complaining that it 
> can't find the dynamic libraries it needs.  
> 
> 
> But when I do:
> 
> export 
> DYLD_FALLBACK_LIBRARY_PATH=/Library/Frameworks/R.framework/Resources/lib
> 
> on the command line, followed by:
> 
> open /Applications/R.app/
> 
> R.app starts, and I can then load the package without it complaining (i.e., 
> it found the dynamic libraries it needs).  I don't understand why…
> 
> -Tom
> 
> 
> On Aug 8, 2013, at 5:00 PM, Marc Schwartz <[email protected]> wrote:
> 
>> On Aug 8, 2013, at 3:42 PM, Tom Schoenemann <[email protected]> wrote:
>> 
>>> Hello,
>>> 
>>> I am trying to get a custom R package (from another group) to run on my 
>>> system. If I call it from the command line r, it works fine.  If I call it 
>>> from R.app, it complains with:
>>> 
>>> Error in dyn.load(file, DLLpath = DLLpath, ...) : 
>>> unable to load shared object 
>>> '/Library/Frameworks/R.framework/Versions/3.0/Resources/library/ANTsR/libs/libRantsRegistration.so':
>>> dlopen(/Library/Frameworks/R.framework/Versions/3.0/Resources/library/ANTsR/libs/libRantsRegistration.so,
>>>  6): Library not loaded: libitkdouble-conversion-4.5.1.dylib
>>> Referenced from: 
>>> /Applications/image-processing/ANTsR/src/ANTS/ANTS-build/lib/libl_antsRegistration.dylib
>>> Reason: image not found
>>> Error: package or namespace load failed for ‘ANTsR’
>>> 
>>> (ANTsR is the package I'm trying to get working)
>>> 
>>> I CAN get it to work by doing this on the command line first:
>>> 
>>> export 
>>> DYLD_FALLBACK_LIBRARY_PATH=/Library/Frameworks/R.framework/Resources/lib
>>> 
>>> and then also opening the R.app from the command line:
>>> 
>>> open /Applications/R.app/
>>> 
>>> However, I can't seem to get R.app to know about 
>>> export 
>>> DYLD_FALLBACK_LIBRARY_PATH=/Library/Frameworks/R.framework/Resources/lib
>>> unless I do it this way. 
>>> 
>>> So my questions are:
>>> 
>>> 1) how can I get R.app to know about the DYLD_FALLBACK_LIBRARY_PATH?  I 
>>> tried putting it into my .Renviron file, but it doesn't work  (maybe the 
>>> syntax is supposed to be different?)
>>> 
>>> 2) why does r on the command line know about dynamic libraries, but R.app 
>>> does not?? This seems like a bug, but maybe there is a good reason for it?
>>> 
>>> Thanks for any suggestions,
>>> 
>>> -Tom
>> 
>> 
>> In general, OSX GUI based apps do not inherit the shell environment. This is 
>> the case with Emacs on OSX for example.
>> 
>> What is the syntax that you used in .Renviron? It should be along the lines 
>> of:
>> 
>>  DYLD_FALLBACK_LIBRARY_PATH=/Library/Frameworks/R.framework/Resources/lib
>> 
>> Note, do not use 'export' before the above. I just tried it here and it 
>> worked. 
>> 
>> Take a look at ?Startup for more details.
>> 
>> Regards,
>> 
>> Marc Schwartz
>> 
>> 
> 
> _________________________________________________
> P. Thomas Schoenemann
> 
> Associate Professor
> Department of Anthropology
> Cognitive Science Program
> Indiana University
> Bloomington, IN  47405
> Phone: 812-855-8800
> E-mail: [email protected]
> 
> Open Research Scan Archive (ORSA) Co-Director
> Consulting Scholar
> Museum of Archaeology and Anthropology
> University of Pennsylvania
> 
> http://www.indiana.edu/~brainevo
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 


        [[alternative HTML version deleted]]

_______________________________________________
R-SIG-Mac mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Reply via email to