[R-pkg-devel] Linking Problem on MacOS

Sameh Abdulah @@meh@@bdu|@h @end|ng |rom k@u@t@edu@@@
Thu May 25 13:57:07 CEST 2023


Hi,

We are developing an R-C++ package that relies on several libraries, including Rcpp, blas, lapack, blaspp, and lapackpp. The flow of our package is as follows:
When running the package, we only require Rcpp. If any other necessary libraries are not found, they will be automatically downloaded and linked with our library during the package compilation process. While this flow functions smoothly on Linux, we are encountering an issue on macOS.

When we link to MKL or any other required library found on the system using the DYLD_LIBRARY_PATH environment variable, the package can be compiled, linked, and built successfully during the R CMD INSTALL process. However, during the final step of "checking if the package can be loaded from temporary location," a new process is spawned to load the package.

According to the latest System Integrity Protection guide for macOS, spawning a child process will clear any dynamic linker environment settings, including DYLD_LIBRARY_PATH. As a result, the newly generated dynamic library fails to load, causing the installation of the R package to fail.


Best,
--Sameh



-- 

This message and its contents, including attachments are intended solely 
for the original recipient. If you are not the intended recipient or have 
received this message in error, please notify me immediately and delete 
this message from your computer system. Any unauthorized use or 
distribution is prohibited. Please consider the environment before printing 
this email.

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list