Hey everyone,

I have some weird issue with using multithreaded data.table in macOS and I am 
trying to figure out, if it’s connected to my libomp.dylib. I started using 
libomp as stated here: https://mac.r-project.org/openmp/
 
Everything worked fine till beginning of this year, but all of a sudden, I get 
random fatal errors, when using data.table with multithreading. I figured that 
R (used in RStudio) is not loading this libomp.dylib (located at 
/usr/local/lib/libomp.dylib), but the one bundled with R 
(/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libomp.dylib).
 I sued this command to check for this:

system(paste("lsof -p", Sys.getpid(), "| grep dylib"))
 
I never checked, which one was used before, but this raised some questions for 
me:
 
1. Was libomp.dylib always bundled with R and if yes, what’s the point of this 
separate libomp.dylib from this page (https://mac.r-project.org/openmp/)?
2. Is there a way to set the libomp.dylib to another path and does this even 
make sense or should I always use the one bundled with R?
3. Could it be that one of the libraries is used for installing packages by 
Xcode’s clang and the other is used during usage of the package?
 
Maybe someone could shed some light onto this topic :).
 
P.S.: If you need some more details about the actual issue with data.table you 
can also check here (https://github.com/rstudio/rstudio/issues/14517) and here 
(https://github.com/Rdatatable/data.table/issues/5957). Or you can of course 
ask me, but it would be a little overkill to share everything that has been 
tried yet :).

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to