AFNI problem when installing all R packages
I see this error when installing AFNI with all R packages:
+ echo 'Downloading AFNI ...'
Downloading AFNI ...
+ mkdir -p /opt/afni-latest
+ curl -fsSL --retry 5 https://afni.nimh.nih.gov/pub/dist/tgz/linux_openmp_64.tgz
+ tar -xz -C /opt/afni-latest --strip-components 1
+ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/afni-latest
+ rPkgsInstall -pkgs ALL
R: Command not found.
This is the invocation:
podman run --rm repronim/neurodocker:master generate singularity --afni version=latest method=binaries install_r_pkgs='true' install_python3='true' --miniconda create_env=neuro conda_install='python=3.6' -b centos:7 -p yum > afni-r-python3-centos-7-2020-05-17-Singularity
Dear @verdurin - I reproduced your problem, and I currently think it is a Centos specific problem where R is not correctly installed. A first work-around would be to use e.g. debian:stretch and apt - would this be suitable work-around for you?
Ok, I found the problem and a solution: R is not included in the standard Centos 7 repository and has to be downloaded via the epel-release repository. I am now trying to build this into the recipe :)
Thanks, let me know when there is something to test.
Hi @verdurin,
I found one solution for your issue and submitted a pull request. If it gets accepted the problem should be solved. If you need a working image now, you could try the one I built to test your issue:
curl -v -s -S -X GET https://swift.rc.nectar.org.au:8888/v1/AUTH_d6165cc7b52841659ce8644df1884d5e/singularityImages/afni_20.1.06_20200522.sif -O
All the best Steffen
Hi @stebo85 ,
I'm a bit late to the party, but I wanted to revive this thread. I saw your PR for this issue wasn't accepted, and the link for the container in your last post is now dead. Is there anywhere this container is still available? we would like to test it out as we are having the issue discussed in this thread
Dear @AlexBowring,
I created a new image for you:
curl -v -s -S -X GET https://swift.rc.nectar.org.au:8888/v1/AUTH_d6165cc7b52841659ce8644df1884d5e/singularityImages/afni_20.2.16_20200905.sif -O
Does this work?
Alternatively you can build you own container using the fork where I merged the proposed change: https://github.com/NeuroDesk/neurodocker
Cheers Steffen
Thanks very much @stebo85 , we'll be testing this soon and will get back to you on how it goes!
Hi @stebo85 ,
We tried with this build but unfortunately, we are still getting errors about missing packages. We tried to run a group analysis with AFNI's 3dMVM through the container, and in the error logs of my shell script I got:
Error in library("afex") : there is no package called ‘afex’
Execution halted
I then ran AFNI's rPkgsInstall command from within the container, which checks to see that all the required R libraries are installed, and it found that a number of packages are missing:
(py3) [bas627@rescomp2 group]$ singularity shell /apps/singularity/afni-r-python3-centos-7-2020-10-13.sif
Singularity> rPkgsInstall -pkgs ALL -check
oo Warning:
These packages are not installed on the computer: afex!
These packages are not installed on the computer: phia!
These packages are not installed on the computer: lmerTest!
These packages are not installed on the computer: brms!
Hello,
Here are some of the relevant warnings from the container build using this fork:
ERROR: dependencies 'lme4', 'pbkrtest', 'lmerTest', 'car' are not available for package 'afex'
* removing '/usr/lib64/R/library/afex'
ERROR: dependency 'car' is not available for package 'phia'
* removing '/usr/lib64/R/library/phia'
ERROR: dependency 'rstatix' is not available for package 'ggpubr'
* removing '/usr/lib64/R/library/ggpubr'
ERROR: dependencies 'rsconnect', 'rstan' are not available for package 'shinystan'
* removing '/usr/lib64/R/library/shinystan'
ERROR: dependencies 'lme4', 'Hmisc' are not available for package 'arm'
* removing '/usr/lib64/R/library/arm'
ERROR: dependencies 'lme4', 'rstan', 'shinystan' are not available for package 'rstanarm'
* removing '/usr/lib64/R/library/rstanarm'
ERROR: dependencies 'rstan', 'shinystan' are not available for package 'brms'
* removing '/usr/lib64/R/library/brms'
Dear @verdurin and @AlexBowring,
I have a look at this and see if there is a good solution :)
Cheers Steffen
Thanks @stebo85!
Please let us know what you have any updates on this :)
Dear @AlexBowring and @verdurin,
I had a look at the missing R packages and I think it's mainly missing dependencies. I now added a few and got past a few errors, but one error I don't understand. It seems to be related to gsl and possibly a version mismatch:
ellint.c: In function ‘ellint_D_e’: ellint.c:82:5: warning: passing argument 4 of ‘gsl_sf_ellint_D_e’ makes integer from pointer without a cast [enabled by default] status[i] = gsl_sf_ellint_D_e(phi[i], k[i], sf_mode[*mode], &result) ; ^ In file included from ellint.c:1:0: /usr/include/gsl/gsl_sf_ellint.h:84:5: note: expected ‘gsl_mode_t’ but argument is of type ‘struct gsl_sf_result *’ int gsl_sf_ellint_D_e(double phi, double k, double n, gsl_mode_t mode, gsl_sf_result * result); ^ ellint.c:82:5: error: too few arguments to function ‘gsl_sf_ellint_D_e’ status[i] = gsl_sf_ellint_D_e(phi[i], k[i], sf_mode[*mode], &result) ; ^ In file included from ellint.c:1:0: /usr/include/gsl/gsl_sf_ellint.h:84:5: note: declared here int gsl_sf_ellint_D_e(double phi, double k, double n, gsl_mode_t mode, gsl_sf_result * result); ^ make: *** [ellint.o] Error 1 ERROR: compilation failed for package ‘gsl’
- removing ‘/usr/lib64/R/library/gsl’
Any ideas :?
Here the dev-branch where I am trying a few things, would be great if anyone has an idea how to get around this. pip install --no-cache-dir https://github.com/NeuroDesk/neurodocker/tarball/fix_afni_R_missingPackages_based_on_upstream_master --upgrade
The afni documentation doesn't seem to do anything special - or am I missing something? https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/background_install/install_instructs/steps_linux_Fed_RH.html
Sorry @stebo85, @AlexBowring and I can't think of where this error might be coming from. @kaczmarj is this something you have seen before? (This issue is related to https://github.com/ReproNim/neurodocker/pull/353). Thank you!
I just saw that there was a pull request with a potential solution to the problem:
gsl2_path="$(find / -name 'libgsl.so.*' || printf '')"
https://github.com/ReproNim/neurodocker/pull/409
I submitted a pull request that fixes this issue :) https://github.com/ReproNim/neurodocker/pull/455
you can also use the new AFNI container directly from www.Neurodesk.org container library: https://hub.docker.com/r/vnmd/afni_22.1.14
Or use it directly in neurodesk in the browser: https://play.neurodesk.org/v2/gh/neurodesk/jupyter-neurodesktop-image/main?urlpath=neurodesktop
Fantastic! Thank you @stebo85 🎉
i believe that was solved with #456