Error with R_io.so file - removed

AFNI version info (afni -ver): Precompiled binary macos_13_ARM: Nov 11 2024 (Version AFNI_24.3.06 'Elagabalus')

code text  # or delete if not needed

Dear AFNI users and developers,

I was running into an issue with my /usr/local/AFNI/bin/abin/R_io.so file when I was running 3dMVM (after upgrading to Tahoe on my apple M3 max).

Error in dyn.load(ll) :
unable to load shared object '/usr/local/AFNI/bin/abin/R_io.so':
dlopen(/usr/local/AFNI/bin/abin/R_io.so, 0x0006): symbol not found in flat namespace '_EDIT_floatize_dataset'
Calls: source ... withVisible -> eval -> eval -> set_R_io -> dyn.load

As a result and after some troubleshooting, I deleted my R_io.so file. However, now I am unable to determine the best way to get the file back since the rInstallPkgs command no longer works for me. Will this be fixed if I re-install R or is there a way to just get a new R_io.so file?

Any guidance would be much appreciated!

Best,

Carissa

Howdy-

Sometimes that error happens when there is a version mismatch between the AFNI binaries or installed R with the OS's chip architecture. Like, if the AFNI were made for an Intel processor, but the computer is ARM architecture.

Just to be sure of the setup and system info before making recommendations on the next step, could you please copy+paste the output of this command, for running the system check report:

afni_system_check.py -check_all

Or, if easier, you can dump the output to a text file first, and then copy+paste trom there:

afni_system_check.py -check_all > log_system_check.txt

NB: when you copy+paste that text into the Message Board window, you will probably want to surround it with triple backticks (```), above and below it, for formatting purposes, as described here.

thanks,
pt

Thank you for your quick response!

I ran the command and have copied and pasted the output below:

\-------------------------------- general ---------------------------------
architecture:         64bit
cpu type:             arm64
system:               Darwin
release:              25.6.0
version:              Darwin Kernel Version 25.6.0: Fri Jul 31 19:18:53 PDT 2026; root:xnu-12377.161.14\~5/RELEASE_ARM64_T6031
distribution:         26.6.2
number of CPUs:       14
apparent login shell: tcsh
shell RC file:        .tcshrc (exists)

\--------------------- AFNI and related program tests ---------------------
which afni           : /usr/local/AFNI/bin/abin/afni
afni version         : Precompiled binary macos_13_ARM: Nov 11 2024
: AFNI_24.3.06 'Elagabalus'
AFNI_version.txt     : AFNI_24.3.06, macos_13_ARM, Nov 11 2024, build
which python         : /opt/homebrew/Cellar/python@2/2.7.18/Frameworks/Python.framework/Versions/2.7/bin/python
python version       : 2.7.18
which R              : /usr/local/bin/R
R version            : R version 3.6.3 (x86_64-apple-darwin15.6.0)

instances of various programs found in PATH:
afni    : 1   (/usr/local/AFNI/bin/abin/afni)
R       : 1   (/Library/Frameworks/R.framework/Versions/3.6/Resources/bin/R)
python  : 2
/Users/philippic/fsl/python
/opt/homebrew/Cellar/python@2/2.7.18/Frameworks/Python.framework/Versions/2.7/bin/python2.7
python2 : 1   (/opt/homebrew/Cellar/python@2/2.7.18/Frameworks/Python.framework/Versions/2.7/bin/python2.7)
python3 : 1   (/usr/bin/python3)

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 '/usr/local/AFNI/bin/abin/R_io.so':
dlopen(/usr/local/AFNI/bin/abin/R_io.so, 0x0006): tried: '/usr/local/AFNI/bin/abin/R_io.so' (), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/AFNI/bin/abin/R_io.so' (no such file), '/usr/local/AFNI/bin/abin/R_io.so' ()
Calls: source ... withVisible -> eval -> eval -> set_R_io -> dyn.load
Execution halted
()
------------------------ dependent program tests -------------------------
checking for dependent programs...

which tcsh           : /bin/tcsh
tcsh version         : 6.21.00
which Xvfb           : /opt/X11/bin/Xvfb

checking for R packages...
rPkgsInstall -pkgs ALL -check : FAILURE
Error in dyn.load(ll) :
unable to load shared object '/usr/local/AFNI/bin/abin/R_io.so':
dlopen(/usr/local/AFNI/bin/abin/R_io.so, 0x0006): tried: '/usr/local/AFNI/bin/abin/R_io.so' (), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/AFNI/bin/abin/R_io.so' (no such file), '/usr/local/AFNI/bin/abin/R_io.so' ()
Calls: source ... withVisible -> eval -> eval -> set_R_io -> dyn.load
Execution halted

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

\------------------------------ 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                       = /Users/philippic/Library/Python/3.9/bin:/Users/philippic/fsl:bin:/Users/philippic/fsl/share/fsl/bin:/Users/philippic/fsl/share/fsl/bin:/Users/philippic/fsl/share/fsl/bin:/Users/philippic/fsl/share/fsl/bin:/Users/philippic/fsl/share/fsl/bin:/Users/philippic/fsl/share/fsl/bin:/Users/philippic/fsl/share/fsl/bin:/Users/philippic/fsl/share/fsl/bin:/Users/philippic/fsl/share/fsl/bin:/users/philippic/ANTs/bin:/Applications/freesurfer/8.0.0/bin:/Applications/freesurfer/8.0.0/fsfast/bin:/Applications/freesurfer/8.0.0/mni/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/AFNI/bin/abin:/opt/homebrew/Cellar/python@2/2.7.18/Frameworks/Python.framework/Versions/2.7/bin:/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/pkg/env/global/bin:/opt/X11/bin:/usr/local/laps:/usr/local/AFNI/bin/abin

PYTHONPATH                 =
R_LIBS                     =
LD_LIBRARY_PATH            =
DYLD_LIBRARY_PATH (sub-shell) = /Applications/freesurfer/8.0.0/lib/gcc/lib:/Applications/freesurfer/8.0.0/lib/gcc/lib:/opt/X11/lib/flat_namespace
DYLD_FALLBACK_LIBRARY_PATH (sub-shell) = /usr/local/AFNI/bin/abin
CONDA_SHLVL                =
CONDA_DEFAULT_ENV          =
CC                         =

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

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

\-- good: .tcshrc seems to contain 'source .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 1 modifications across 2 files:

  file             path  flatdir  apsearch        follower
  ---------------  ----  -------  --------        --------
  .tcshrc          0     0        0               1     
  .cshrc           0     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 /usr/local/AFNI/bin/abin

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

\*\* no package manager found (okay for bootcamp)

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

* AFNI programs show FAILURE
* missing R packages (see rPkgsInstall)
* python library matplotlib is required
  (see AFNI install docs for details)
* dot file test : want 1 modifications across 2 files:
* insufficient data for AFNI bootcamp
  (see "Prepare for Bootcamp" on install pages)

Hi, Carissa-

Great, thanks.

And that does show what I suspected: your computer is a macOS with an ARM processor (see line 6), and your AFNI binaries are for ARM (good) in line 14-16 (though, they are 2 years old, so could definitely do with being updated, as a separate note); but the R version is for an Intel processor---see line 20, the "x86" signifies that. I guess before that might have worked with Rosetta or something, but I guess that mapping functionality is now broken on Tahoe?

So, I think it would be good to go through the AFNI installation instructions for a macOS with ARM architecture, which are here. That should update your R and have the correct/matching ARM-compatible version.

** One thing to note, (perhaps before doing any update) is that it seems like you are using Python v2.7 as your main Python. That is very old, and has reached deprecation and end of life a while back. Most AFNI Python programs should still run there, but there are more modern functionality ones, too, that might not. It might be worth considering updating your Python, too. I am a little surprised that it is still possible to install Python v2.7. Is there a necessary software that you need to run with that Python version?

--pt

Hi Paul,

Thank you so much for these suggestions! In terms of Python, I appreciate you catching that it was an old version. I am not sure how that older version ended up being the main Python since I see that Python v3.9.6 is also installed and the computer is only 3 years old. For some context, I am working on a university administered computer, which has meant that all of my programs had to be installed by folks in our ITS department and updates also have to be done by our IT folks, so I've had less control over the process.

I plan to connect with my IT department to follow your recommendations and to get Python updated.

Thanks again for your help!

Best,
Carissa

Hi, Carissa-

OK, I guess maybe the IT admins had some default things they installed, which hadn't changed in a (very long) while? Not sure. But hope the update sorts this, please let us know how it goes.

--pt

Hi Paul,

I installed the most recent version of python (3.14.7) and then went through the steps for an administered computer to re-install afni. However, I came to an error when running this step in my user profile in the terminal: tcsh OS_notes.macos_12_ARM_b_user.tcsh

Here is the output of the terminal and the error message I received at the end:

tcsh OS_notes.macos_12_ARM_b_user.tcsh         
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100  5341  100  5341    0     0  43673      0 --:--:-- --:--:-- --:--:-- 43778
++ num brew shellenv found : 1
++ start building...
set os = `uname -s`
uname -s
if ( 0 ) then
if ( Darwin != Darwin ) then
set cpu = `uname -m`
uname -m
if ( 0 ) then
set rver = `R --version | head -n 1 | cut -d ' ' -f 3`
R --version
cut -d   -f 3
head -n 1
if ( 0 ) then
echo OS    : Darwin
OS    : Darwin
echo CPU   : arm64
CPU   : arm64
echo R ver : 4.5.2
R ver : 4.5.2
echo

defaults write org.macosforge.xquartz.X11 wm_ffm -bool true
defaults write org.x.X11 wm_ffm -bool true
defaults write com.apple.Terminal FocusFollowsMouse -string YES
if ( ! -f /Users/philippic/abin/afni ) then
echo ++ installing AFNI anyos_text_atlas
++ installing AFNI anyos_text_atlas
curl -O https://afni.nimh.nih.gov/pub/dist/bin/misc/@update.afni.binaries
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100 62565  100 62565    0     0   258k      0 --:--:-- --:--:-- --:--:--  257k
tcsh @update.afni.binaries -no_recur -package anyos_text_atlas -bindir /Users/philippic/abin
-- running @update.afni.binaries version 3.31, January 9, 2025
-- no current AFNI package found in path...
++ updating build label from 'NONE' to 'default'
-- any downloads will be from https://afni.nimh.nih.gov via curl -O -f

\-- attempting to install package anyos_text_atlas under
install dir: /Users/philippic/abin ...
-- have install dir
++ working in new temp dir, .tmp.install
-- skipping update of @update.afni.binaries
++ downloading test file: curl -O -f anyos_text_atlas/AFNI_version.txt ...
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100    48  100    48    0     0    327      0 --:--:-- --:--:-- --:--:--   328
++ no update needed
else
echo ++ setting up user dotfiles
++ setting up user dotfiles
/Users/philippic/abin/init_user_dotfiles.py -shell_list bash zsh tcsh -do_updates path apsearch -dir_bin /Users/philippic/abin
Traceback (most recent call last):
File "/Users/philippic/abin/init_user_dotfiles.py", line 10, in 
from afnipy import option_list as OL
File "/Users/philippic/abin/afnipy/option_list.py", line 10, in 
from afnipy import afni_base as BASE
File "/Users/philippic/abin/afnipy/afni_base.py", line 1538
print(out, flush=flush)
^
SyntaxError: invalid syntax

I went into the init_user_dotfiles.py file to the error lines and I guess I'm wondering whether there's an issue with my profile files (dot files) or if it is an issue with my python installation?

Any suggestions would be appreciated!

Best,

Carissa

Hi Carissa,

You are probably still using python 2.7 in your PATH and that version is too old for the command that fails. I am inclined to fix that on our end either way, but if you have a newer version installed, it would be good to be sure it is being used.

What is the output of :

which python
python --version
afni_system_check.py -check_all | grep python

Thanks,

-rick

Hi Rick,

Yes, I think you're correct on that. I do see that if I type python it still uses the old version. When I tried updating with homebrew it just installed a new instance of python (which only referenced with specific request of which python3.14).

Here is the output of the commands you sent:
[S-FS24U-41Q7G":~] philippic% which python
/opt/homebrew/Cellar/python@2/2.7.18/Frameworks/Python.framework/Versions/2.7/bin/python
python --version
[S-FS24U-41Q7G":~] philippic% python --version
Python 2.7.18
[S-FS24U-41Q7G":~] philippic% afni_system_check.py -check_all | grep python
afni_system_check.py: Command not found.

Hmmm, you ran afni_system_check.py earlier, but now it isn't in your PATH? Since you are on an ARM mac, we can check to see what is under /opt/homebrew:

ls -l /opt/homebrew/opt/python/libexec/bin/py*

Looking at the earlier system_check, you should have a version of python 3 first thing in your PATH. There are some mistakes in your PATH though, like /Users/philippic/fsl:bin which should probably be /Users/philippic/fsl/bin. That might have led to many later duplications in PATH entries as you re-tried things.

I will send you a private message so that we can try to update your .cshrc and/or .tcshrc files. It might start with afni_system_check.py -dot_file_pack ... but if you cannot current run afni_system_check.py, that won't get far.

Anyway, I will send you a message.

-rick

Just to follow up on this thread for the search history...

After fixing some minor PATH issues we were able to download and run the macos_13_ARM package. Good news. R 4.5.2 (.3?) worked for R_io.so, even though the distributed R_io.so was built against 4.3.1.

Compiling locally did not work - there are some cases where macos CommandLineTools/homebrew/gcc compilers get out of sync, and it isn't clear how to resolve it (aside from reinstalling everything under and including the sun). I did not recall to try /bin/gcc (via build_afni.py ... -cc_path /bin/gcc) to try getting homebrew more out of the picture.

-rick