R package brms installation error

AFNI experts,

I am trying to install R’s brms package so I can use the newly introduced afni function RBA. Following the installation step mentioned in RBA documentation, I tried to install the brms package using the following command: rPkgsInstall -pkgs “brms” -site “http://cran.us.r-project.org”.

However, I got several errors (see below). Any help in order to fix this problem will be highly appreciated. Thank you.

Error: package or namespace load failed for ‘igraph’ in dyn.load(file, DLLpath = DLLpath, …):
unable to load shared object ‘/usr/lib64/R/library/igraph/libs/igraph.so’:
libicui18n.so.58: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed

  • removing ‘/usr/lib64/R/library/igraph’
  • installing source package ‘sf’ …
    ** package ‘sf’ successfully unpacked and MD5 sums checked
    configure: CC: gcc -m64 -std=gnu99
    configure: CXX: g++ -m64 -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 ‘/usr/lib64/R/library/sf’

Hi-

What OS is your computer? and what version of R do you have?

Having the output of this copy+pasted:


afni_system_check.py -check_all

would be useful.

–pt

Hello Mr. Taylor,

Thank you for your reply.

I am using CentOS 7. Following is the output for afni_system_check.py -check_all:

-------------------------------- general ---------------------------------
architecture: 64bit
system: Linux
release: 3.10.0-957.1.3.el7.x86_64
version: #1 SMP Thu Nov 29 14:49:43 UTC 2018
distribution: CentOS Linux 7.6.1810 Core
number of CPUs: 16
apparent login shell: bash
shell RC file: .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /home/lceuser/abin/afni
afni version : Precompiled binary linux_centos_7_64: May 30 2019
: AFNI_19.1.14 ‘Caligula’
AFNI_version.txt : AFNI_19.1.14, linux_centos_7_64, May 30 2019
which python : /home/lceuser/anaconda3/bin/python
python version : 3.7.2
which R : /usr/bin/R
R version : R version 3.5.2 (2018-12-20) – “Eggshell Igloo”
which tcsh : /usr/bin/tcsh

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

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

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

    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: brms!

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

------------------------------ python libs -------------------------------
** python module not found: PyQt4
– PyQt4 is no longer needed for an AFNI bootcamp

-------------------------------- env vars --------------------------------
PATH = /usr/local/fsl/bin:/home/lceuser/anaconda3/bin:/home/lceuser/anaconda3/condabin:/home/lceuser/anaconda3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/lceuser/abin:/home/lceuser/.local/bin:/home/lceuser/bin:/home/lceuser/abin

PYTHONPATH =
R_LIBS = /home/lceuser/R

LD_LIBRARY_PATH =
DYLD_LIBRARY_PATH =
DYLD_FALLBACK_LIBRARY_PATH =

------------------------------ data checks -------------------------------
data dir : missing AFNI_data6
data dir : missing AFNI_demos
data dir : missing suma_demo
data dir : missing afni_handouts
atlas : found TT_N27+tlrc under /home/lceuser/abin

------------------------------ OS specific -------------------------------
which yum : /usr/bin/yum
yum version : 3.4.3

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

  • login shell ‘bash’, trusting user to translate code examples from ‘tcsh’
  • have python version 3.7.2, some programs need 2.7.x
  • missing R packages (see rPkgsInstall)
  • insufficient data for AFNI bootcamp
  • consider running: yum install PyQt4

Howdy-

I will assume that running “rPkgsInstall -pkgs ALL” as described here:
https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/background_install/install_instructs/steps_linux_Fed_RH.html#install-r
doesn’t work to update things.

It might be that if you have updated your R version, then you need to update the existing packages before installing more. So, to try this, start by typing this in a terminal to enter the R environment:


R

And then copy+paste of each of these there individually:


update.packages(installed.packages(priority="NA"), checkBuilt=TRUE, ask=FALSE)
install.packages("afex")
install.packages("phia")
install.packages("brms")

How does your system check look after that?

–pt

Hi,

install.packages(“brms”) still gives me the same error as that I originally posted. My system check looks as follows:

-------------------------------- general ---------------------------------
architecture: 64bit
system: Linux
release: 3.10.0-957.1.3.el7.x86_64
version: #1 SMP Thu Nov 29 14:49:43 UTC 2018
distribution: CentOS Linux 7.6.1810 Core
number of CPUs: 16
apparent login shell: bash
shell RC file: .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /home/lceuser/abin/afni
afni version : Precompiled binary linux_centos_7_64: May 30 2019
: AFNI_19.1.14 ‘Caligula’
AFNI_version.txt : AFNI_19.1.14, linux_centos_7_64, May 30 2019
which python : /home/lceuser/anaconda3/bin/python
python version : 3.7.2
which R : /usr/bin/R
R version : R version 3.5.2 (2018-12-20) – “Eggshell Igloo”
which tcsh : /usr/bin/tcsh

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

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

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

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

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

------------------------------ python libs -------------------------------
** python module not found: PyQt4
– PyQt4 is no longer needed for an AFNI bootcamp

-------------------------------- env vars --------------------------------
PATH = /usr/local/fsl/bin:/home/lceuser/anaconda3/bin:/home/lceuser/anaconda3/condabin:/home/lceuser/anaconda3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/lceuser/abin:/home/lceuser/.local/bin:/home/lceuser/bin:/home/lceuser/abin

PYTHONPATH =
R_LIBS = /home/lceuser/R

LD_LIBRARY_PATH =
DYLD_LIBRARY_PATH =
DYLD_FALLBACK_LIBRARY_PATH =

------------------------------ data checks -------------------------------
data dir : missing AFNI_data6
data dir : missing AFNI_demos
data dir : missing suma_demo
data dir : missing afni_handouts
atlas : found TT_N27+tlrc under /home/lceuser/abin

------------------------------ OS specific -------------------------------
which yum : /usr/bin/yum
yum version : 3.4.3

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

  • login shell ‘bash’, trusting user to translate code examples from ‘tcsh’
  • have python version 3.7.2, some programs need 2.7.x
  • missing R packages (see rPkgsInstall)
  • insufficient data for AFNI bootcamp
  • consider running: yum install PyQt4

Oh, it looks like this issue of getting R’s brms on CentOS has already been solved by an AFNI user, and the solution is posted here:
https://afni.nimh.nih.gov/afni/community/board/read.php?1,160090,160120#msg-160120
(you might want to look at the earlier parts of the thread, too).

–pt

Hi,

I had tried that solution earlier, but it did not work for me. Thank you though

Hm, I see. I am a bit stuck for ideas, then, unfortunately. We are teaching an AFNI Bootcamp this week and there is the OHBM conference next week, so I am away from any CentOS system to try anything else.

Looking online, it seems that R v3.6 is not available for CentOS yet, so updating the R version further won’t be an option. I don’t know if any other user with more experience with CentOS will be able to suggest anything?

–pt

No problem. I will keep looking. Thank you anyway.

Hi,
Can you try installing gdal separately? (Geospatial Data Abstraction Library)


yum install gdal-devel

That is needed for iGraphs, but iGraphs is not really necessary for what we do with brms.
Unfortunately, the brms library has a lot of extra stuff for visualization that bloats the install and has nothing to do with just doing the analysis.
Could be handy, but not really for us at the moment.
Give gdal-devel a try and the run the brms install again.

Thanks, Justin