Skip to content
Prev 12376 / 15075 Next

Problems with runtime linking of R-extension

Unfortunately setting these variables (or LD_LIBRARY_PATH) to /usr/local/lib does not help with the error message.
This helps to some extend, similar to adding ?-rpath /usr/local/lib? to PKG_LIBS. I am then able to load the library. However, ArrayFire does not find/load its backend libraries libafcpu.dynlib and libafopencl.dynlib, which are also located in /usr/local/lib and therefore reports ?backends: 0". This does not happen with the plain C program that correctly finds two available backends.

To make things even stranger, the above is true when I start R from the Terminal. When using R.app or RStudio, I can load minimal.so (even without rpath option or manipulating the install name)  and calling the count_backends function gives the correct result. 

What does R.app and RStudio to differently from R in the Terminal?

Thanks
Ralf