R package installation

Hi there,

I checked for AFNI updates and a message appeared indicating that I did not have the relevant R packages installed (I had everything previously). I ran “rPkgsInstall -pkgs ALL” and it seems like it could not be installed properly. I was wondering whether you have any solutions to these errors am receiving?

Thank you,
Tamara

TERMINAL OUTPUT

ttavare@MitchellLabImage2:~$ rPkgsInstall -pkgs ALL
Installing package into ‘/home/ttavare/R’
(as ‘lib’ is unspecified)
Warning: dependency ‘cmdstanr’ is not available
also installing the dependencies ‘igraph’, ‘StanHeaders’, ‘RcppParallel’, ‘threejs’, ‘gsl’, ‘sf’, ‘rstan’, ‘rstantools’, ‘shinystan’, ‘projpred’, ‘rtdists’, ‘spdep’

trying URL ‘http://cloud.r-project.org/src/contrib/igraph_1.2.6.tar.gz
Content type ‘application/x-gzip’ length 2715500 bytes (2.6 MB)

downloaded 2.6 MB

trying URL ‘http://cloud.r-project.org/src/contrib/StanHeaders_2.21.0-7.tar.gz
Content type ‘application/x-gzip’ length 1402572 bytes (1.3 MB)

downloaded 1.3 MB

trying URL ‘http://cloud.r-project.org/src/contrib/RcppParallel_5.1.4.tar.gz
Content type ‘application/x-gzip’ length 1967752 bytes (1.9 MB)

downloaded 1.9 MB

trying URL ‘http://cloud.r-project.org/src/contrib/threejs_0.3.3.tar.gz
Content type ‘application/x-gzip’ length 866293 bytes (845 KB)

downloaded 845 KB

trying URL ‘http://cloud.r-project.org/src/contrib/gsl_2.1-7.tar.gz
Content type ‘application/x-gzip’ length 213803 bytes (208 KB)

downloaded 208 KB

trying URL ‘http://cloud.r-project.org/src/contrib/sf_1.0-2.tar.gz
Content type ‘application/x-gzip’ length 3645982 bytes (3.5 MB)

downloaded 3.5 MB

trying URL ‘http://cloud.r-project.org/src/contrib/rstan_2.21.2.tar.gz
Content type ‘application/x-gzip’ length 1152008 bytes (1.1 MB)

downloaded 1.1 MB

trying URL ‘http://cloud.r-project.org/src/contrib/rstantools_2.1.1.tar.gz
Content type ‘application/x-gzip’ length 91668 bytes (89 KB)

downloaded 89 KB

trying URL ‘http://cloud.r-project.org/src/contrib/shinystan_2.5.0.tar.gz
Content type ‘application/x-gzip’ length 2400413 bytes (2.3 MB)

downloaded 2.3 MB

trying URL ‘http://cloud.r-project.org/src/contrib/projpred_2.0.2.tar.gz
Content type ‘application/x-gzip’ length 175415 bytes (171 KB)

downloaded 171 KB

trying URL ‘http://cloud.r-project.org/src/contrib/rtdists_0.11-2.tar.gz
Content type ‘application/x-gzip’ length 867210 bytes (846 KB)

downloaded 846 KB

trying URL ‘http://cloud.r-project.org/src/contrib/spdep_1.1-11.tar.gz
Content type ‘application/x-gzip’ length 4281099 bytes (4.1 MB)

downloaded 4.1 MB

trying URL ‘http://cloud.r-project.org/src/contrib/brms_2.16.1.tar.gz
Content type ‘application/x-gzip’ length 4954887 bytes (4.7 MB)

downloaded 4.7 MB

ERROR: failed to lock directory ‘/home/ttavare/R’ for modifying
Try removing ‘/home/ttavare/R/00LOCK-igraph’

  • installing source package ‘RcppParallel’ …
    ** package ‘RcppParallel’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** preparing to configure package ‘RcppParallel’ …
    *** configured file: ‘src/Makevars.in’ => ‘src/Makevars’
    ** finished configure for package ‘RcppParallel’
    ** libs
    (tbb) Building TBB using bundled sources …
    make[1]: Entering directory ‘/tmp/RtmphUKw5D/R.INSTALL639c5dd5d197/RcppParallel/src/tbb/src’
    …/build/common.inc:74: *** “” is not supported. Add build/.inc file with os-specific settings . Stop.
    make[1]: Leaving directory ‘/tmp/RtmphUKw5D/R.INSTALL639c5dd5d197/RcppParallel/src/tbb/src’
    make: *** [Makevars:152: tbb] Error 2
    ERROR: compilation failed for package ‘RcppParallel’
  • removing ‘/home/ttavare/R/RcppParallel’
  • installing source package ‘gsl’ …
    ** package ‘gsl’ successfully unpacked and MD5 sums checked
    ** using staged installation
    checking for gsl-config… no
    configure: error: gsl-config not found, is GSL installed?
    ERROR: configuration failed for package ‘gsl’
  • removing ‘/home/ttavare/R/gsl’
  • installing source package ‘sf’ …
    ** package ‘sf’ successfully unpacked and MD5 sums checked
    ** using staged installation
    configure: CC: gcc -std=gnu99
    configure: CXX: g++ -std=gnu++11
    checking for gdal-config… no
    no
    configure: error: gdal-config not found or not executable.
    ERROR: configuration failed for package ‘sf’
  • removing ‘/home/ttavare/R/sf’
    ERROR: dependency ‘RcppParallel’ is not available for package ‘StanHeaders’
  • removing ‘/home/ttavare/R/StanHeaders’
    ERROR: dependency ‘igraph’ is not available for package ‘threejs’
  • removing ‘/home/ttavare/R/threejs’
    ERROR: dependency ‘RcppParallel’ is not available for package ‘rstantools’
  • removing ‘/home/ttavare/R/rstantools’
    ERROR: dependency ‘gsl’ is not available for package ‘rtdists’
  • removing ‘/home/ttavare/R/rtdists’
    ERROR: dependency ‘sf’ is not available for package ‘spdep’
  • removing ‘/home/ttavare/R/spdep’
    ERROR: dependencies ‘StanHeaders’, ‘RcppParallel’ are not available for package ‘rstan’
  • removing ‘/home/ttavare/R/rstan’
    ERROR: dependency ‘rstantools’ is not available for package ‘projpred’
  • removing ‘/home/ttavare/R/projpred’
    ERROR: dependencies ‘rstan’, ‘threejs’ are not available for package ‘shinystan’
  • removing ‘/home/ttavare/R/shinystan’
    ERROR: dependencies ‘rstan’, ‘rstantools’, ‘shinystan’, ‘projpred’ are not available for package ‘brms’
  • removing ‘/home/ttavare/R/brms’

The downloaded source packages are in
‘/tmp/RtmpRiNTN4/downloaded_packages’

++ Note: @ 14:55:40
This package has been installed on the computer: brms

There were 13 warnings (use warnings() to see them)
ttavare@MitchellLabImage2:~$

For the first error - “Failed to lock …”, you can try the solutions posted here:

https://stackoverflow.com/questions/14382209/r-install-packages-returns-failed-to-create-lock-directory

They recommend deleting or unlinking the lock file and an R package install with the --no-lock option.

Thank you very much. I have these remaining errors when I attempt to install the R packages for AFNI (see below last parts of the output).
Apologies for the novice questions, but are these errors specific to R or is there something within the AFNI installations I can do? I tried to uninstall and re-installed R, but I am still getting this problem. I have also included the output for the afni_check all below.

Thank you,
Tamara

Terminal output from R installation (rPkgsInstall)

checking for gdal-config… no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘sf’

  • removing ‘/home/ttavare/R/sf’
    ERROR: dependency ‘RcppParallel’ is not available for package ‘StanHeaders’
  • removing ‘/home/ttavare/R/StanHeaders’
    ERROR: dependency ‘igraph’ is not available for package ‘threejs’
  • removing ‘/home/ttavare/R/threejs’
    ERROR: dependency ‘RcppParallel’ is not available for package ‘rstantools’
  • removing ‘/home/ttavare/R/rstantools’
    ERROR: dependency ‘gsl’ is not available for package ‘rtdists’
  • removing ‘/home/ttavare/R/rtdists’
    ERROR: dependency ‘sf’ is not available for package ‘spdep’
  • removing ‘/home/ttavare/R/spdep’
    ERROR: dependencies ‘StanHeaders’, ‘RcppParallel’ are not available for package ‘rstan’
  • removing ‘/home/ttavare/R/rstan’
    ERROR: dependency ‘rstantools’ is not available for package ‘projpred’
  • removing ‘/home/ttavare/R/projpred’
    ERROR: dependencies ‘rstan’, ‘threejs’ are not available for package ‘shinystan’
  • removing ‘/home/ttavare/R/shinystan’
    ERROR: dependencies ‘rstan’, ‘rstantools’, ‘shinystan’, ‘projpred’ are not available for package ‘brms’
  • removing ‘/home/ttavare/R/brms’

The downloaded source packages are in
‘/tmp/RtmpUgR1of/downloaded_packages’

++ Note: @ 15:05:29
This package has been installed on the computer: brms

ttavare@MitchellLabImage2:/usr/lib/R$ afni_system_check.py -check_all
-------------------------------- general ---------------------------------
architecture: 64bit ELF
system: Linux
release: 5.4.0-80-generic
version: #90-Ubuntu SMP Fri Jul 9 22:49:44 UTC 2021
distribution: Ubuntu 20.04.3 LTS
number of CPUs: 8
apparent login shell: bash
shell RC file: .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /home/ttavare/abin/afni
afni version : Precompiled binary linux_ubuntu_16_64: Sep 1 2021
: AFNI_21.2.06 ‘Nerva’
AFNI_version.txt : AFNI_21.2.06, linux_ubuntu_16_64, Sep 01 2021
which python : /software/anaconda3/bin/python
python version : 3.8.3
which R : /usr/bin/R
R version : R version 3.6.3 (2020-02-29) – “Holding the Windsock”
which tcsh : /usr/bin/tcsh

instances of various programs found in PATH:
afni : 1 (/home/ttavare/abin/afni)
R : 1 (/usr/bin/R)
python : 2
/software/anaconda3/bin/python3.8
/usr/bin/python2.7
python2 : 1 (/usr/bin/python2.7)
python3 : 2
/software/anaconda3/bin/python3.8
/usr/bin/python3.8

testing ability to start various programs…
afni : success
suma : success
3dSkullStrip : success
uber_subject.py : success
3dAllineate : success
3dRSFC : success
SurfMesh : success
3dClustSim : success
3dMVM : success

checking for R packages…
rPkgsInstall -pkgs ALL -check : FAILURE

    oo Warning: 
       These packages are not installed on the computer: brms!

R RHOME : /usr/lib/R

checking for $HOME files…
.afnirc : found
.sumarc : found
.afni/help/all_progs.COMP : found

------------------------------ python libs -------------------------------
** failed to load module PyQt4
– PyQt4 is no longer needed for an AFNI bootcamp

++ module loaded: matplotlib.pyplot
module file : /software/anaconda3/lib/python3.8/site-packages/matplotlib/pyplot.py

-------------------------------- env vars --------------------------------
PATH = /software/anaconda3/bin:/software/anaconda3/condabin:/software/BrainSuite/BrainSuite19b/bin:/software/itksnap/3.8.0/bin:/software/ANTs/2.1.0/bin:/software/3D-Slicer/4.11.2:/software/MeVisLab/MeVisLab3.4GCC-7/bin:/software/workbench/1.4.2/bin_linux64:/software/MRIcroGL:/software/mricron:/software/MRIConvert-2.0.7/usr/bin:/software/Mango:/software/nifty_reg-1.3.9/bin:/software/matlab/R2020a/bin:/software/palm:/software/freesurfer/6.0.0/bin:/software/fsl/6.0.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/ttavare/abin

PYTHONPATH =
R_LIBS = /home/ttavare/R

LD_LIBRARY_PATH = /software/freesurfer/6.0.0/lib

DYLD_LIBRARY_PATH =
DYLD_FALLBACK_LIBRARY_PATH =

------------------------------ data checks -------------------------------
data dir : found AFNI_data6 under $HOME
top history: 20 Feb 2020 [rickr]: updated FT_analysis examples
data dir : found AFNI_demos under $HOME
top history: …ct 2020 [taylorp]: updated scripts under FATCAT_DEMO
data dir : found suma_demo under $HOME
top history: …s_New/data/Build_tmp on Mon Mar 4 11:56:45 EST 2013
data dir : found afni_handouts under $HOME
atlas : found TT_N27+tlrc under /home/ttavare/abin

------------------------------ OS specific -------------------------------
which apt-get : /usr/bin/apt-get
apt-get version : apt 2.0.6 (amd64)

have Ubuntu system: Ubuntu 20.04.3 LTS
have Ubuntu afni : Precompiled binary linux_ubuntu_16_64: Sep 1 2021

========================= summary, please fix: =========================

  • just be aware: login shell ‘bash’, but our code examples use ‘tcsh’
  • missing R packages (see rPkgsInstall)

ttavare@MitchellLabImage2:/usr/lib/R$

Tamara, check out this thread:

https://afni.nimh.nih.gov/afni/community/board/read.php?1,166861,166861#msg-166861