bvieth / powsimR

Power analysis is essential to optimize the design of RNA-seq experiments and to assess and compare the power to detect differentially expressed genes. PowsimR is a flexible tool to simulate and evaluate differential expression from bulk and especially single-cell RNA-seq data making it suitable for a priori and posterior power analyses.
https://bvieth.github.io/powsimR/
Artistic License 2.0
103 stars 23 forks source link

problems with the DLL max issue #1

Closed oeco28 closed 6 years ago

oeco28 commented 6 years ago

Hello Beate, I am trying to install powsimR and I am running into the max loaded DLL issues that you mentioned. If I restart R after installing dependencies, and I look at the number of DLL loaded >length(getLoadedDLLs()) 12 there are only 12. I even unload stats and tools: dyn.unload("/Library/Frameworks/R.framework/Versions/3.4/Resources/library/stats/libs/stats.so") dyn.unload("/Library/Frameworks/R.framework/Versions/3.4/Resources/library/tools/libs/tools.so")

but I still get the same problem: devtools::install_github("bvieth/powsimR") Downloading GitHub repo bvieth/powsimR@master from URL https://api.github.com/repos/bvieth/powsimR/zipball/master Installing powsimR '/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \ '/private/var/folders/tw/kcbwlvs56ys_x3xnslrmfhrr0000gn/T/Rtmp4QyPQa/devtools1304d1c481da6/bvieth-powsimR-876dd55' \ --library='/Library/Frameworks/R.framework/Versions/3.4/Resources/library' --install-tests

Error : .onLoad failed in loadNamespace() for 'mnormt', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/mnormt/libs/mnormt.so': `maximal number of DLLs reached... ERROR: lazy loading failed for package ‘powsimR’

how many dependencies is powsimR loading? Do you have any additional recommendations?

thank you! Omar

bvieth commented 6 years ago

Dear Omar,

thank you for trying out powsimR :)

I am assuming you are using a MAC based on your library path structure.

Starting with R 3.4, you can change the number of DLLs to a higher number. To do so, you first need to locate your Renviron file where the environmental variables are defined ( this file is called for Sys.getenv() in R for example). On my Ubuntu machine this file is in R_HOME/etc/ where R_HOME is /usr/lib/R. On a Mac it can be in /Library/Frameworks/R.framework/Versions/3.4/Resources/etc/. In that file add the following line R_MAX_NUM_DLLS=153. Then restart your R and check the output of Sys.getenv("R_MAX_NUM_DLLS"). After that, installation should be possible without an error.

I hope this helps and please contact me if you encounter any error / have questions.

Best Beate

swvanderlaan commented 6 years ago

Awesome instructions @bvieth, but how do you get to the number "153"?

bvieth commented 6 years ago

Dear Sander,

that number was the highest I could set without issue on the MAC of my colleague. It is an older machine, so I guess a higher number is possible on newer machines but actually not needed for powsimR installation.

Kind regards Beate

swvanderlaan commented 6 years ago

Excellent. Thank you for the information @bvieth.