3dMVM R_io error

Hi AFNI Gurus,

I recently updated my AFNI binaries, and now can no longer run 3dMVM. When I run afni_system_check.py -check_all I get the following error for the 3dMVM check:


3dMVM                : FAILURE
        Error in dyn.load(ll) : 
          unable to load shared object '/Users/laurenlebois/abin/R_io.so':
          dlopen(/Users/laurenlebois/abin/R_io.so, 6): Library not loaded: /sw/lib/libjpeg.9.dylib
          Referenced from: /Users/laurenlebois/abin/R_io.so
          Reason: Incompatible library version: R_io.so requires version 12.0.0 or later, but libjpeg.9.dylib provides version 11.0.0
        Calls: source ... withVisible -> eval -> eval -> set_R_io -> dyn.load
        Execution halted

Any advice on how to address this? I’ve checked several other threads about this, but my error seems slightly different.

In case it is helpful, here is the rest of the afni_system_check.py output:


~ % afni_system_check.py -check_all
-------------------------------- general ---------------------------------
architecture:         64bit 
system:               Darwin
release:              18.7.0
version:              Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64
distribution:         10.14.6 x86_64
number of CPUs:       8
apparent login shell: csh
shell RC file:        .cshrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           : /Users/laurenlebois/abin/afni
afni version         : Precompiled binary macos_10.12_local: Mar 30 2020 
                     : AFNI_20.0.24 'Galba'
AFNI_version.txt     : AFNI_20.0.24, macos_10.12_local, Mar 30 2020
which python         : /sw/bin/python
python version       : 2.7.11
which R              : /usr/local/bin/R
R version            : R version 3.5.3 (2019-03-11) -- "Great Truth"
which tcsh           : /bin/tcsh

instances of various programs found in PATH:
    afni    : 1   (/Users/laurenlebois/abin/afni)
    R       : 1   (/Library/Frameworks/R.framework/Versions/3.5/Resources/bin/R)
    python  : 2 
      /sw/bin/python2.7
      /usr/bin/python
    python2 : 0 
    python3 : 0 

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                : FAILURE
        Error in dyn.load(ll) : 
          unable to load shared object '/Users/laurenlebois/abin/R_io.so':
          dlopen(/Users/laurenlebois/abin/R_io.so, 6): Library not loaded: /sw/lib/libjpeg.9.dylib
          Referenced from: /Users/laurenlebois/abin/R_io.so
          Reason: Incompatible library version: R_io.so requires version 12.0.0 or later, but libjpeg.9.dylib provides version 11.0.0
        Calls: source ... withVisible -> eval -> eval -> set_R_io -> dyn.load
        Execution halted

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 -------------------------------
++ module loaded: PyQt4
   module file : /usr/local/lib/python2.7/site-packages/PyQt4/__init__.pyc

** failed to load module matplotlib.pyplot
-- matplotlib.pyplot is not required, but is desirable

-- python binaries under /sw/bin:
    /sw/bin/python       (sym link to /sw/bin/python2.7)
    /sw/bin/python2.7   

-------------------------------- env vars --------------------------------
PATH = /opt/local/bin:/opt/local/sbin:/usr/local/fsl/bin:/opt/local/bin:/opt/local/sbin:/sw/bin:/sw/sbin:/Applications/freesurfer/bin:/Applications/freesurfer/fsfast/bin:/Applications/freesurfer/tktools:/usr/local/fsl/bin:/Applications/freesurfer/mni/bin:/sw/bin:/opt/local/bin:/opt/local/sbin:/usr/local/fsl/bin:/opt/local/bin:/opt/local/sbin:/Applications/freesurfer/bin:/Applications/freesurfer/fsfast/bin:/Applications/freesurfer/tktools:/usr/local/fsl/bin:/Applications/freesurfer/mni/bin:/sw/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/laurenlebois/abin:/Users/laurenlebois/Programs_Misc:/Users/laurenlebois/scripts:/opt/local/bin:opt/local/sbin:/bin:/Applications/gedit.app/Contents/MacOS:/opt/local/bin:/opt/local/sbin:/Users/laurenlebois/osx:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/laurenlebois/abin:/Applications/mricron:/Applications/mricron/dcm2niix:/Applications/freesurfer:/Applications/R:/opt/X11/bin:/Users/laurenlebois/abin:/Users/laurenlebois/Programs_Misc:/Users/laurenlebois/scripts:/opt/local/bin:opt/local/sbin:/bin:/Applications/gedit.app/Contents/MacOS:/opt/local/bin:/opt/local/sbin:/Users/laurenlebois/osx:/usr/local/bin:/opt/local/bin:/opt/local/sbin:/usr/local/fsl/bin:/opt/local/bin:/opt/local/sbin:/Applications/freesurfer/bin:/Applications/freesurfer/fsfast/bin:/Applications/freesurfer/tktools:/usr/local/fsl/bin:/Applications/freesurfer/mni/bin:/sw/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/laurenlebois/abin:/Users/laurenlebois/Programs_Misc:/Users/laurenlebois/scripts:/opt/local/bin:opt/local/sbin:/bin:/Applications/gedit.app/Contents/MacOS:/opt/local/bin:/opt/local/sbin:/Users/laurenlebois/osx:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/laurenlebois/abin:/Applications/mricron:/Applications/mricron/dcm2niix:/Applications/freesurfer:/Applications/R:/opt/X11/bin:/Users/laurenlebois/abin:/Applications/mricron:/Applications/mricron/dcm2niix:/Applications/freesurfer:/Applications/R

PYTHONPATH = /usr/local/lib/python2.7/site-packages

R_LIBS = 
LD_LIBRARY_PATH = 
DYLD_LIBRARY_PATH (sub-shell) = /opt/X11/lib/flat_namespace
DYLD_FALLBACK_LIBRARY_PATH (sub-shell) = FSL_DIR           /usr/local/fsl

------------------------------ data checks -------------------------------
data dir : found AFNI_data6   under $HOME
           top history: ... [rickr]: updated FT_white.nii w/out 16 (brain stem)
data dir : found AFNI_demos   under $HOME
           top history: ... [pault]: remove rank from FATCAT_DEMO, FAT_MVM_DEMO
data dir : found suma_demo    under $HOME
           top history: .../SUMA_data/Build_tmp on Wed Aug 20 10:04:23 EDT 2014
data dir : missing afni_handouts
atlas    : found TT_N27+tlrc  under .

------------------------------ OS specific -------------------------------
XQuartz version      : 2.7.11

which fink           : /sw/bin/fink
fink version         : Package manager version: 0.39.2
which brew           : /usr/local/bin/brew
brew version         : Homebrew 2.2.11
which port           : /opt/local/bin/port
port version         : Error: Current platform "darwin 18" does not match expected platform "darwin 14"

++ found 'brew' at /usr/local/bin/brew
++ 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 'csh'...
++ found evar DYLD_LIBRARY_PATH = /opt/X11/lib/flat_namespace

=========================  summary, please fix:  =========================
*  AFNI programs show FAILURE
*  insufficient data for AFNI bootcamp


Thanks for your time and guidance!

Hello all,

I had a back and forth with Rick Reynolds about this - here is the summary:

I updated my Xcode, XCode Command Tools and Fink - but the R_io / lib/libjpeg.9.dylib error remained. Rick recommended to first test the output of the following:

"This should fail, but still, what is the complete output of:
3dMVM -help

Also, what is the output from:
otool -L ~/abin/R_io.so
ls -l ~/abin/lib*.dylib

To some degree, you shouldn’t need fink unless, for example, you want to be able to run the uber_*.py programs that require PyQt4. But either way, I would expect R_io.so to find libjpeg.9.dylib from your abin. Let’s see what you say about the above commands."

These commands had the following output:

Here is the output of 3dMVM -help:

~ % 3dMVM -help
updating R_LD_LIBRARY_PATH …

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

Error in dyn.load(ll) :
unable to load shared object ‘/Users/laurenlebois/abin/R_io.so’:
dlopen(/Users/laurenlebois/abin/R_io.so, 6): Library not loaded: /sw/lib/libjpeg.9.dylib
Referenced from: /Users/laurenlebois/abin/R_io.so
Reason: Incompatible library version: R_io.so requires version 12.0.0 or later, but libjpeg.9.dylib provides version 11.0.0
Calls: source … withVisible → eval → eval → set_R_io → dyn.load
Execution halted

Here is the output from the otool -L ~/abin/R_io.so :

~ % otool -L ~/abin/R_io.so
/Users/laurenlebois/abin/R_io.so:
R_io.so (compatibility version 0.0.0, current version 0.0.0)
/sw/Library/Frameworks/R.framework/Versions/3.3/Resources/lib/libR.dylib (compatibility version 3.3.0, current version 3.3.2)
/sw/lib/libjpeg.9.dylib (compatibility version 12.0.0, current version 12.0.0)
/sw/lib/libXt.6.dylib (compatibility version 7.0.0, current version 7.0.0)
/opt/X11/lib/libXft.2.dylib (compatibility version 6.0.0, current version 6.2.0)
/opt/X11/lib/libfontconfig.1.dylib (compatibility version 11.0.0, current version 11.2.0)
/opt/X11/lib/libpng16.16.dylib (compatibility version 43.0.0, current version 43.0.0)
/sw/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.1.0)
/opt/X11/lib/libXmu.6.dylib (compatibility version 9.0.0, current version 9.0.0)
/opt/X11/lib/libXp.6.dylib (compatibility version 9.0.0, current version 9.0.0)
/opt/X11/lib/libXpm.4.dylib (compatibility version 16.0.0, current version 16.0.0)
/opt/X11/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
/opt/X11/lib/libX11.6.dylib (compatibility version 10.0.0, current version 10.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8)
/usr/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 8.0.0)
/sw/lib/python2.7/config/libpython2.7.dylib (compatibility version 2.7.0, current version 2.7.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)
/sw/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.5.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1349.8.0)
/sw/lib/gcc7/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)

Here is the output from ls -l ~/abin/lib*.dylib :

~ % ls -l ~/abin/lib*.dylib
-rwxr-xr-x 1 laurenlebois staff 3035636 Mar 30 23:25 /Users/laurenlebois/abin/libXm.4.dylib
-rwxr-xr-x 1 laurenlebois staff 77656 Mar 30 23:25 /Users/laurenlebois/abin/libbz2.1.dylib
-rwxr-xr-x 1 laurenlebois staff 867420 Mar 30 23:25 /Users/laurenlebois/abin/libfreetype.6.dylib
-rw-r–r-- 1 laurenlebois staff 255712 Mar 30 23:25 /Users/laurenlebois/abin/libgcc_s.1.dylib
-rwxr-xr-x 1 laurenlebois staff 841172 Mar 30 23:25 /Users/laurenlebois/abin/libglib-2.0.0.dylib
-rwxr-xr-x 1 laurenlebois staff 257608 Mar 30 23:25 /Users/laurenlebois/abin/libgomp.1.dylib
-rwxr-xr-x 1 laurenlebois staff 2763820 Mar 30 23:25 /Users/laurenlebois/abin/libgsl.0.dylib
-rwxr-xr-x 1 laurenlebois staff 313404 Mar 30 23:25 /Users/laurenlebois/abin/libgslcblas.0.dylib
-rw-r–r-- 1 laurenlebois staff 1124448 Mar 30 23:25 /Users/laurenlebois/abin/libiconv.2.dylib
-rw-r–r-- 1 laurenlebois staff 46084 Mar 30 23:25 /Users/laurenlebois/abin/libintl.8.dylib
-rwxr-xr-x 1 laurenlebois staff 284432 Mar 30 23:25 /Users/laurenlebois/abin/libjpeg.9.dylib
-rwxr-xr-x 1 laurenlebois staff 253372 Mar 30 23:25 /Users/laurenlebois/abin/libpng16.16.dylib
-rwxr-xr-x 1 laurenlebois staff 2040952 Mar 30 23:25 /Users/laurenlebois/abin/libpython2.7.dylib

According to Rick, this revealed that:
“There is some aspect of this that is not working the way I would expect. Have R_LD_LIBRARY_PATH set, R_io.so should be finding libjpeg.9.dylib in your abin, yet it is complaining about the fink version.”

Recommended a test of this theory: “I would like you to temporarily rename your /sw directory, try the command again, and then change the sw name back. That will enable us to see how it behaves as if you did not have fink installed.”
sudo mv /sw /sw.rename
3dMVM -help
sudo mv /sw.rename /sw

This test showed that if I renamed my sw directory, R_io.so did appear to find libjpeg.9.dylib in my abin (3dMVM -help worked).

Rick said, that this means “R_LD_LIBRARY_PATH variable is not working the way it should (or at least not the way the name suggests it should)…This little aspect will make dealing with R more difficult for us. R_LD_LIBRARY_PATH suggests that our libraries get priority, but it seems it is more like LD_FALLBACK_LIBRARY_PATH, unfortunately.”

For the time being, I decided to keep my fink tree (/sw) renamed so I could successfully run 3dMVM, and since I don’t use the uber_* programs that require the fink tree.