ANTsR icon indicating copy to clipboard operation
ANTsR copied to clipboard

Installation fail with devtools

Open ptsii opened this issue 2 years ago • 5 comments

I just tried to build ANTsR from within R doing:

> library(devtools)
> install_github("stnava/cmaker")
> install_github("stnava/ANTsR")

It seemed to compile fine, but then failed on the install:

installing to /Library/Frameworks/R.framework/Versions/4.2/Resources/library/00LOCK-ANTsR/00new/ANTsR/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘ANTsR’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Library/Frameworks/R.framework/Versions/4.2/Resources/library/00LOCK-ANTsR/00new/ANTsR/libs/ANTsR.so':
  dlopen(/Library/Frameworks/R.framework/Versions/4.2/Resources/library/00LOCK-ANTsR/00new/ANTsR/libs/ANTsR.so, 0x0006): symbol not found in flat namespace (_composeDisplacementFields)
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/ANTsR’
Warning message:
In i.p(...) :
  installation of package ‘/var/folders/22/g163kh494cj0yrk3fqkc13240000gq/T//RtmpbUSmYm/file49a5753f8886/ANTsR_0.5.7.5.tar.gz’ had non-zero exit status

This is a multi-user machine (OSX), but this was done from one of the accounts that has admin privileges.

Any ideas about what might have happened?

ptsii avatar Jan 14 '23 00:01 ptsii

I'm not sure what this means (what caused the problem). It occurred twice FWIW. I ended up trying to install using Method 2 (from command line) listed here: https://github.com/ANTsX/ANTsR. That worked without errors.

ptsii avatar Jan 14 '23 19:01 ptsii

Thanks for the workaround. I've not used cmaker in a long time - what version of cmake does it provide? If it's too old, that might be the cause of compilation problems.

cookpa avatar Jan 16 '23 16:01 cookpa

I'm not sure how to check that - how do I check what version of cmaker it provides? That may well be the issue, because before trying the second method (command line install sequence using R CMD INSTALL), I in fact updated to the latest cmaker.

ptsii avatar Jan 16 '23 16:01 ptsii

Looks like CMake 3.11 from here

https://github.com/stnava/cmaker/blob/master/DESCRIPTION

I think but I'm not sure that R CMD install uses system commands, so if you have a newer cmake in your environment, that might be why it works.

cookpa avatar Jan 18 '23 22:01 cookpa

I have reproduced this error via Docker, when installing using devtools::install and remotes::install

#8 6553.4 Error: package or namespace load failed for ‘ANTsR’ in dyn.load(file, DLLpath = DLLpath, ...):
#8 6553.4  unable to load shared object '/usr/local/lib/R/site-library/00LOCK-ANTsR/00new/ANTsR/libs/ANTsR.so':
#8 6553.4   /usr/local/lib/R/site-library/00LOCK-ANTsR/00new/ANTsR/libs/ANTsR.so: undefined symbol: composeDisplacementFields
#8 6553.4 Error: loading failed
#8 6553.4 Execution halted

This is using R 4.0.5 and CMake 3.25.3, so I think it's not cmake.

cookpa avatar Mar 28 '23 18:03 cookpa