I will revive this thread since I ran into the same (or into a very similiar problem).
My aim: I wanted to use 3dLME for a second-level analysis. AFNIs 3dLME explanation (https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dLME.html) explains that it is required to upgrade R via the following terminal code: “rPkgsInstall -pkgs ALL”.
The problem: Using the command above, the terminal gives me the following error message below:
oo Warning:
Failed to load R_io.so with this error message:
Error in dyn.load(ll) :
cannot load shared object ‘/Users/Philipp/abin/R_io.so’:
dlopen(/Users/Philipp/abin/R_io.so, 6): Library not loaded: /sw/Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libR.dylib
Referenced from: /Users/Philipp/abin/R_io.so
Reason: image not found
Ruft auf: source … withVisible → eval → eval → set_R_io → dyn.load
Ausführung angehalten
Two things:
- The file “load R_io.so” really exists in its correct place (/Users/Philipp/abin/).
- Then I did a quick “afni_system_check.py -check_all” AFNI check. This lead to one problem: “please set DYLD_LIBRARY_PATH to include /opt/X11/lib/flat_namespace”
My computer:
- 2013 Macbook, OS Big Sur 11.6.1
- R Version: R 4.1.1 GUI 1.77 High Sierra build (7985). If you wonder why I use the High Sierra R version on Big Sur: the “R 4.1.1 binary for macOS 11 (Big Sur) and higher, Apple silicon arm64 build” does not work on my intel Macbook (it does not even allow me the installation).
- AFNI and XQuartz are up to date. I even reinstalled AFNI because I thought that may helps me to solve this problem. Interestingly I ran into the same problem while reinstalling AFNI. More precisely, the part where R should be installed (https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/background_install/install_instructs/steps_mac.html) and the command “sudo rPkgsInstall -pkgs ALL” has to be copied into the terminal. Here, the terminal also complains about the “R_io.so” file so that it cannot update the R specific packages for AFNI.
My first question would be how I can set the DYLD_LIBRARY_PATH to include /opt/X11/lib/flat_namespace?
And my second question is what I can do to solve the problem with the “R_io.so” file for installing the R updates required to run several AFNI programs such as 3dLME.
Thanks,
Philipp
An update:
I realized that the error message “please set DYLD_LIBRARY_PATH to include /opt/X11/lib/flat_namespace” for “afni_system_check.py -check_all” only occurs because I am running Zsh as a shell instead of either bash or tcsh. Is there a way to adjust AFNIs following script from this source (https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/background_install/install_instructs/steps_mac.html#setup-mac-env-variables) to Zsh? I am refering to the following script:
[quote="script: touch ~/.cshrcscript: touch ~/.cshrc
echo ‘if ( $?DYLD_LIBRARY_PATH ) then’ >> ~/.cshrc
echo ’ setenv DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH}:/opt/X11/lib/flat_namespace’ >> ~/.cshrc
echo ‘else’ >> ~/.cshrc
echo ’ setenv DYLD_LIBRARY_PATH /opt/X11/lib/flat_namespace’ >> ~/.cshrc
echo ‘endif’ >> ~/.cshrc
touch ~/.bashrc
echo ‘export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/opt/X11/lib/flat_namespace’ >> ~/.bashrc
echo ‘if ( $?DYLD_LIBRARY_PATH ) then’ >> ~/.cshrc
echo ’ setenv DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH}:/opt/X11/lib/flat_namespace’ >> ~/.cshrc
echo ‘else’ >> ~/.cshrc
echo ’ setenv DYLD_LIBRARY_PATH /opt/X11/lib/flat_namespace’ >> ~/.cshrc
echo ‘endif’ >> ~/.cshrc
touch ~/.bashrc
echo ‘export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/opt/X11/lib/flat_namespace’ >> ~/.bashrc"]
[/quote]
I guess that adjusting and applying this script once to Zsh would solve my first problem?