unable to load R_io.so on intel imac

Screen Shot 2023-06-12 at 2.55.05 PM

Hi I am using an iMac and get the following error when I try to source reco.R.

How do I fix this ?

Many thanks

Ri

-----------------------------------------------------------
source('<path>/R/reco.R')

++ Note NSB.path.set(...):  NSB.path.set(getsrc) 
       -->eval(ei, envir)
       -->eval(ei, envir)
       -->withVisible(eval)
       -->source("<path>/R/reco.R") 
   Loading profile from <path>/profile.csv
Sourcing from <path>/R 

oo Warning: 
   Failed to load R_io.so with this error message:

Error in dyn.load(ll) : 
  unable to load shared object '/Users/rdatta4/abin/R_io.so':
  dlopen(/Users/rdatta4/abin/R_io.so, 6): Library not loaded: /sw/lib/libjpeg.9.dylib
  Referenced from: /Users/rdatta4/abin/R_io.so
  Reason: image not found

** Error NSB.afni.io.src(...):  NSB.afni.io.src() 
       -->eval(ei, envir)
       -->eval(ei, envir)
       -->withVisible(eval(ei, envir))
       -->source("<path>/R/reco.R")
   Failed to source /Users/rdatta4/abin/AFNIio.R AFNI R/W functions will not work



rPkgsInstall -pkgs ALL -check
updating R_LD_LIBRARY_PATH ...

++ Note:  @ 14:57:49
   	This package has been verified on the computer: afex
	This package has been verified on the computer: phia
	This package has been verified on the computer: snow
	This package has been verified on the computer: nlme
	This package has been verified on the computer: lmerTest
	This package has been verified on the computer: paran
	This package has been verified on the computer: psych
	This package has been verified on the computer: brms
	This package has been verified on the computer: corrplot
	This package has been verified on the computer: metafor
afni_system_check.py -check_all
-------------------------------- general ---------------------------------
architecture:         64bit 
system:               Darwin
release:              20.6.0
version:              Darwin Kernel Version 20.6.0: Mon Apr 24 23:00:57 PDT 2023; root:xnu-7195.141.49.701.3~1/RELEASE_X86_64
distribution:         10.16
number of CPUs:       16
apparent login shell: bash
shell RC file:        .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           : /Users/rdatta4/abin/afni
afni version         : Precompiled binary macos_10.12_local: Aug 19 2022 
                     : AFNI_22.2.07 'Marcus Aurelius'
AFNI_version.txt     : AFNI_22.2.07, macos_10.12_local, Aug 19 2022
which python         : /usr/bin/python
python version       : 2.7.16
which R              : /usr/local/bin/R
R version            : R version 4.3.0 (2023-04-21) -- "Already Tomorrow"
which tcsh           : /bin/tcsh

instances of various programs found in PATH:
    afni    : 1   (/Users/rdatta4/abin/afni)
    R       : 2 
      /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/bin/R
      /Users/rdatta4/anaconda3/envs/rnsbiom4/bin/R
    python  : 2 
      /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
      /Users/rdatta4/anaconda3/envs/rnsbiom4/bin/python3.11
    python2 : 1   (/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7)
    python3 : 3 
      /usr/bin/python3
      /usr/local/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/bin/python3.11
      /Users/rdatta4/anaconda3/envs/rnsbiom4/bin/python3.11


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 : success

R RHOME : /Library/Frameworks/R.framework/Resources

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 : /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/pyplot.pyc
   matplotlib version : 1.3.1
** need maptplotlib version 2.2+ for APQC


-- python binaries under /usr/local/bin:
    /usr/local/bin/python3 (sym link to /usr/local/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/bin/python3.11)
    /usr/local/bin/python3.7 (sym link to /usr/local/Cellar/python@3.7/3.7.16/Frameworks/Python.framework/Versions/3.7/bin/python3.7)
    /usr/local/bin/python3.9 (sym link to /usr/local/Cellar/python@3.9/3.9.16/Frameworks/Python.framework/Versions/3.9/bin/python3.9)

-------------------------------- env vars --------------------------------
PATH = /usr/local/fsl/bin:/Applications/ANTs/install/bin:/usr/local/opt/python@3.7/bin:/Applications/ITK-SNAP.app/Contents/bin:/Applications/MATLAB_R2021a.app/bin:/bin:/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/Applications/freesurfer/7.3.2/bin:/Applications/freesurfer/7.3.2/fsfast/bin:/usr/local/fsl/bin:/Applications/freesurfer/7.3.2/mni/bin:/Users/rdatta4/anaconda3/envs/rnsbiom4/bin:/Users/rdatta4/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/aria2/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Users/rdatta4/gproj/nsbiom/scr:/Users/rdatta4/abin

PYTHONPATH = 
R_LIBS = 
LD_LIBRARY_PATH = 
DYLD_LIBRARY_PATH (sub-shell) = :/opt/X11/lib/flat_namespace
DYLD_FALLBACK_LIBRARY_PATH (sub-shell) = 

------------------------------ 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 /Users/rdatta4/abin

------------------------------ OS specific -------------------------------
XQuartz version      : 2.8.5

which brew           : /usr/local/bin/brew
brew version         : Homebrew 4.0.16

-- for PyQt4 under brew, consider running:
   brew install cartr/qt4/pyqt
** consider linking /usr/local/Cellar/gcc/13.1.0/lib/gcc/current/libgomp.1.dylib under /usr/local/lib
++ found valid link /usr/local/lib/libglib-2.0.dylib
   to ../Cellar/glib/2.76.2/lib/libglib-2.0.dylib
++ found 1 dylib files under '/opt/X11/lib/flat_namespace'
   -- found 'libXt' dylib files:
      /opt/X11/lib/flat_namespace/libXt.6.dylib
-- recent OS X, cheating to check DYLD_LIBRARY_PATH in cur shell 'bash'...
++ found evar DYLD_LIBRARY_PATH = :/opt/X11/lib/flat_namespace
-- recent OS X, cheating to check DYLD_LIBRARY_PATH in shell 'tcsh'...
++ found evar DYLD_LIBRARY_PATH = /opt/X11/lib/flat_namespace

=========================  summary, please fix:  =========================
*  just be aware: login shell 'bash', but our code examples use 'tcsh'
*  check for partial install of PyQt4
*  insufficient data for AFNI bootcamp
   (see "Prepare for Bootcamp" on install pages)

Hi Ri,

If you are going to apply R_io.so in an external R program (or at the R shell), it will be necessary to do what is done in the short 3dMVM script (for example). Do something like:

export R_LD_LIBRARY_PATH=$(R RHOME)/lib:$HOME/abin

That allows R to find dependent libraries under ~/abin.

  • rick