Issue Running RBA on Cluster

Hi AFNI team,

I'm having some trouble running RBA. I'm working on a cluster using the most up-to-date versions available, which are AFNI version 24.1.16 and R version 4.5.2.

The following error message appears:

Error in dyn.load(ll) : 
  unable to load shared object '/opt/afni/24.1.16/R_io.so':
  libR.so: cannot open shared object file: No such file or directory
Calls: source ... withVisible -> eval -> eval -> set_R_io -> dyn.load
Execution halted

Any guidance you have on navigating this would be greatly appreciated. Thank you!

Could you run the following command to check the AFNI installation situation and share the output?

afni_system_check.py -check_all

Gang Chen

Hi Gang, the output of system check is below.

-------------------------------- general ---------------------------------
architecture:         64bit ELF
cpu type:             x86_64
system:               Linux
release:              3.10.0-1160.31.1.el7.x86_64
version:              #1 SMP Thu Jun 10 13:32:12 UTC 2021
distribution:         CentOS Linux 7.9.2009 Core
number of CPUs:       32
apparent login shell: bash
shell RC file:        .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           : /opt/afni/24.1.16/afni
afni version         : Precompiled binary linux_centos_7_64: May 30 2024 
                     : AFNI_24.1.16 'Publius Septimius Geta'
AFNI_version.txt     : AFNI_24.1.16, linux_centos_7_64, May 30 2024, official
which python         : /usr/bin/python
python version       : 2.7.5
which R              : /opt/r/4.5.2/bin/R
R version            : WARNING: ignoring environment value of R_HOME

instances of various programs found in PATH:
    afni    : 1   (/opt/afni/24.1.16/afni)
    R       : 1   (/opt/r/4.5.2/bin/R)
    python  : 1   (/usr/bin/python2.7)
    python2 : 1   (/usr/bin/python2.7)
    python3 : 1   (/usr/bin/python3.6)


testing ability to start various programs...
    afni                 : success
    suma                 : success
    3dSkullStrip         : success
    3dAllineate          : success
    3dRSFC               : success
    SurfMesh             : success
    3dClustSim           : success
    uber_subject.py      : success
    3dMVM                : FAILURE
        Error in dyn.load(ll) : 
          unable to load shared object '/opt/afni/24.1.16/R_io.so':
          libR.so: cannot open shared object file: No such file or directory
        Calls: source ... withVisible -> eval -> eval -> set_R_io -> dyn.load
        Execution halted
()
** missing binary library 'libR.so' in program R_io.so
()
------------------------ dependent program tests -------------------------
checking for dependent programs...

which tcsh           : /usr/bin/tcsh
tcsh version         : 6.18.01
which Xvfb           : /usr/bin/Xvfb

checking for R packages...
    rPkgsInstall -pkgs ALL -check : FAILURE
        Error in dyn.load(ll) : 
          unable to load shared object '/opt/afni/24.1.16/R_io.so':
          libR.so: cannot open shared object file: No such file or directory
        Calls: source ... withVisible -> eval -> eval -> set_R_io -> dyn.load
        Execution halted

R RHOME : WARNING: ignoring environment value of R_HOME
/opt/r/4.5.2/lib64/R

------------------------------ python libs -------------------------------

** failed to load module matplotlib.pyplot
-- matplotlib.pyplot is required

** failed to load module flask
-- flask is not required, but is desirable

** failed to load module flask_cors
-- flask_cors is not required, but is desirable

-------------------------------- env vars --------------------------------
PATH                       = /opt/afni/24.1.16:/opt/r/4.5.2/bin:/opt/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64:/opt/hdf5/1.10.6/intel/bin:/opt/netcdf-c/4.7.4/intel/bin:/opt/geos/3.13.0/gcc-10.2.0-multilib/bin:/opt/gcc/10.2.0/gcc-multilib/bin:/opt/curl/8.11.1/gcc/bin:/opt/gdal/2.4.2/gcc/bin:/opt/jags/4.3.1/gcc-10.2.0-multilib/lib:/opt/jags/4.3.1/gcc-10.2.0-multilib/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/home/zcohen/bin

PYTHONPATH                 = 
R_LIBS                     = 
LD_LIBRARY_PATH            = /opt/r/4.5.2/lib64/R/lib:/opt/intel/compilers_and_libraries_2018.1.163/linux/compiler/lib/intel64:/opt/intel/compilers_and_libraries_2018.1.163/linux/compiler/lib/intel64_lin:/opt/intel/compilers_and_libraries_2018.1.163/linux/ipp/lib/intel64:/opt/intel/compilers_and_libraries_2018.1.163/linux/mkl/lib/intel64_lin:/opt/intel/compilers_and_libraries_2018.1.163/linux/tbb/lib/intel64/gcc4.7:/opt/intel/debugger_2018/iga/lib:/opt/intel/debugger_2018/libipt/intel64/lib:/opt/intel/compilers_and_libraries_2018.1.163/linux/daal/lib/intel64_lin:/opt/intel/compilers_and_libraries_2018.1.163/linux/daal/../tbb/lib/intel64_lin/gcc4.4:/opt/zlib/1.2.11/intel/lib:/opt/hdf5/1.10.6/intel/lib:/opt/netcdf-c/4.7.4/intel/lib:/opt/geos/3.13.0/gcc-10.2.0-multilib/lib64:/opt/gcc/10.2.0/gcc-multilib/lib/gcc/x86_64-pc-linux-gnu/10.2.0/plugin:/opt/gcc/10.2.0/gcc-multilib/libexec/gcc/x86_64-pc-linux-gnu/10.2.0:/opt/gcc/10.2.0/gcc-multilib/lib64:/opt/gcc/10.2.0/gcc-multilib/lib:/opt/curl/8.11.1/gcc/lib:/opt/gdal/2.4.2/gcc/lib:/opt/jags/4.3.1/gcc-10.2.0-multilib/lib/JAGS/modules-4:/opt/jags/4.3.1/gcc-10.2.0-multilib/lib

DYLD_LIBRARY_PATH          = 
DYLD_FALLBACK_LIBRARY_PATH = 
CONDA_SHLVL                = 
CONDA_DEFAULT_ENV          = 

----------------------------- eval dot files -----------------------------
()
----------- AFNI $HOME files -----------
()
    .afnirc                   : missing
    .sumarc                   : missing
    .afni/help/all_progs.COMP : missing

--------- shell startup files ----------

   -- no .tcshrc, will create one as a follower of .cshrc
   -- considered operations: path, apsearch
   
   -- note: followers should not need edits, so edit flags should be 0
      (have 1 follower(s), which can be ignored)
   
   dot file test : want 4 modifications across 3 files:
   
      file             path  flatdir  apsearch        follower
      ---------------  ----  -------  --------        --------
      .tcshrc          0     0        0               1     
      .cshrc           1     0        1               0     
      .bashrc          1     0        1               0     
   
------------------------------ 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 /opt/afni/24.1.16

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


=========================  summary, please fix:  =========================
*  just be aware: login shell 'bash', but our code examples use 'tcsh'
*  'afni' executable is owned by root
*  AFNI programs show FAILURE
*  missing binary library: libR.so
*  missing R packages (see rPkgsInstall)
*  python library matplotlib is required
   (see AFNI install docs for details)
*  please run: cp /opt/afni/24.1.16/AFNI.afnirc ~/.afnirc
*  please run: "suma -update_env" for .sumarc
*  please run: apsearch -update_all_afni_help
*  dot file test : want 4 modifications across 3 files:
*  insufficient data for AFNI bootcamp
   (see "Prepare for Bootcamp" on install pages)

While that R version is different from the one our distributed R_io.so is built against (on that CentOS 7 system), I would still expect it to work. However, the error message says the file is not even there. That suggests the admins put the .so files somewhere else.

What is the output from:

find /opt/afni/24.1.16 -name R_io.so

Thanks,

-rick

This is all that pops up:

/opt/afni/24.1.16/R_io.so

Oh, they did not partition the package into directories, that file is indeed in the right place.

So maybe I cannot read the original error message well enough. It is not R_io.so that is not found, but the actual libR.so library file. Does that exist under /opt/r/4.5.2?

find /opt/r/4.5.2 -name libR.so

But given that any found directory should be in LD_LIBRARY_PATH, and that you already have /opt/r/4.5.2/lib64/R/lib in yours, that should be the output from the find command. So would you please include the output from some extra commands?

file /opt/afni/24.1.16/R_io.so
file /opt/r/4.5.2/lib64/R/lib/libR.so

ldd /opt/afni/24.1.16/R_io.so

Thanks,

-rick

find /opt/r/4.5.2 -name libR.so
---no output here, returns a blank line---
file /opt/afni/24.1.16/R_io.so
/opt/afni/24.1.16/R_io.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=f6bc7f6c793e9169430bcdcd2e7098f2584b1b72, not stripped
file /opt/r/4.5.2/lib64/R/lib/libR.so
/opt/r/4.5.2/lib64/R/lib/libR.so: cannot open (No such file or directory)
ldd /opt/afni/24.1.16/R_io.so
	linux-vdso.so.1 =>  (0x00007ffe1cdf5000)
	libmri.so => /opt/afni/24.1.16/libmri.so (0x00002b4c54969000)
	libf2c.so => /opt/afni/24.1.16/libf2c.so (0x00002b4c553b2000)
	libpng15.so.15 => /lib64/libpng15.so.15 (0x00002b4c555cf000)
	libjpeg.so.62 => /lib64/libjpeg.so.62 (0x00002b4c557fa000)
	libz.so.1 => /opt/zlib/1.2.11/intel/lib/libz.so.1 (0x00002b4c55a4f000)
	libexpat.so.1 => /lib64/libexpat.so.1 (0x00002b4c55c70000)
	libm.so.6 => /lib64/libm.so.6 (0x00002b4c55e9a000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00002b4c5619c000)
	libc.so.6 => /lib64/libc.so.6 (0x00002b4c563a0000)
	libR.so => not found
	libimf.so => /opt/intel/compilers_and_libraries_2018.1.163/linux/compiler/lib/intel64/libimf.so (0x00002b4c5676e000)
	libsvml.so => /opt/intel/compilers_and_libraries_2018.1.163/linux/compiler/lib/intel64/libsvml.so (0x00002b4c56cfc000)
	libirng.so => /opt/intel/compilers_and_libraries_2018.1.163/linux/compiler/lib/intel64/libirng.so (0x00002b4c583af000)
	libgcc_s.so.1 => /opt/gcc/10.2.0/gcc-multilib/lib64/libgcc_s.so.1 (0x00002b4c58723000)
	libintlc.so.5 => /opt/intel/compilers_and_libraries_2018.1.163/linux/compiler/lib/intel64/libintlc.so.5 (0x00002b4c5893b000)
	/lib64/ld-linux-x86-64.so.2 (0x00002b4c5453f000)

file /opt/afni/24.1.16/R_io.so
/opt/afni/24.1.16/R_io.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=f6bc7f6c793e9169430bcdcd2e7098f2584b1b72, not stripped

file /opt/r/4.5.2/lib64/R/lib/libR.so
/opt/r/4.5.2/lib64/R/lib/libR.so: cannot open (No such file or directory)

ldd /opt/afni/24.1.16/R_io.so
	linux-vdso.so.1 =>  (0x00007ffe4d3cf000)
	libmri.so => /opt/afni/24.1.16/libmri.so (0x00002aea48fcb000)
	libf2c.so => /opt/afni/24.1.16/libf2c.so (0x00002aea49a14000)
	libpng15.so.15 => /lib64/libpng15.so.15 (0x00002aea49c31000)
	libjpeg.so.62 => /lib64/libjpeg.so.62 (0x00002aea49e5c000)
	libz.so.1 => /opt/zlib/1.2.11/intel/lib/libz.so.1 (0x00002aea4a0b1000)
	libexpat.so.1 => /lib64/libexpat.so.1 (0x00002aea4a2d2000)
	libm.so.6 => /lib64/libm.so.6 (0x00002aea4a4fc000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00002aea4a7fe000)
	libc.so.6 => /lib64/libc.so.6 (0x00002aea4aa02000)
	libR.so => not found
	libimf.so => /opt/intel/compilers_and_libraries_2018.1.163/linux/compiler/lib/intel64/libimf.so (0x00002aea4add0000)
	libsvml.so => /opt/intel/compilers_and_libraries_2018.1.163/linux/compiler/lib/intel64/libsvml.so (0x00002aea4b35e000)
	libirng.so => /opt/intel/compilers_and_libraries_2018.1.163/linux/compiler/lib/intel64/libirng.so (0x00002aea4ca11000)
	libgcc_s.so.1 => /opt/gcc/10.2.0/gcc-multilib/lib64/libgcc_s.so.1 (0x00002aea4cd85000)
	libintlc.so.5 => /opt/intel/compilers_and_libraries_2018.1.163/linux/compiler/lib/intel64/libintlc.so.5 (0x00002aea4cf9d000)
	/lib64/ld-linux-x86-64.so.2 (0x00002aea48ba1000)

I think that's everything. This last one looks like it repeated some of the previous commands.

Well at least that is more understandable, thanks. libR.so is not under the tree where it should be.

You will have to ask the cluster sysadmins about libR.so. It should come with the r-base-dev package on Ubuntu, and would apparently be expected under /opt/r/4.5.2/lib64/R/lib. So maybe the admins just need to install that package.

You will need it for any of Gang's glorious R-based group analysis programs.

Thanks,

-rick