Problem Installing AFNI on Catalina (MacOS 10.15)

Good Morning,

I am working to install AFNI on a new mac with Catalina (MacOS 10.15.4). I have been able to work through the online install instructions, but I receive an error:

suma -update_env
zsh: command not found: suma

Thanks in advance for the help,

Hi, Amy-

What is the output of:

echo $0


I am going to guess it is “zsh”, which for some reason is the default shell on Macs as of OS 15.*… We typically setup for either “bash” or “tcsh” shells.

If you don’t have a strong preference of background shell, the simplest thing to do would probably be to change your default shell in terminals to one of the more common ones (bash or tcsh). To do so, open “System Preferences”, click on “Users & Groups”, click on the closed lock in the lower left of the panel (if the lock is open already, you don’t need to click on it) and enter your admin/root password to unlock it, then right-click on your username in the menu in the pale that is your “current user” and select “Advanced Options…” (which should be the only option there). Theeeeen, in the menu of options there, go to the “Login shell” one, and change what is currently there (probably “/bin/zsh”) to either “/bin/bash” or “/bin/tcsh”; your choice here doesn’t matter so much-- I use “/bin/bash”, other people in the group use “/bin/tcsh”, and the AFNI setup instructions cover both scenarios.

After doing that, you will likely have to log out and log back in for those changes to take effect. When you open a terminal now and type “echo $0”, you should see something with either “bash” or “tcsh” (depending on what you picked for your new login shell), possibly with a minus sign (fine if you do/don’t see that).

Then you should be able to run

suma -update_env

and all the other fun AFNI programs; first thing to try might be to see how happy the system check is: -check_all

and make sure everything is set well.


Thanks so much for the help,

I was able to change my shell to bash - thanks for catching that oversite. I re-ran the install commands

curl -O
sudo tcsh @update.afni.binaries -package macos_10.12_local -do_extras

and the code to set up environment variables for AFNI and SUMA, but I still receive the same error

cp $HOME/abin/AFNI.afnirc $HOME/.afnirc
suma -update_env
-bash: suma: command not found

Any other suggestions to explore?

Thanks again,

Hi, Amy-

Glad the shell changing was pretty straightforwad (sigh, Macs always try to complicate life…).

Ummm, that’s good about installing the AFNI binaries except you shouldn’t need (nor want) to use “sudo” there. The “sudo” power, enabling your command to have admin privileges, is only necessary if you install things into the system-side of things; by default, we install the AFNI binaries into a directory called “abin” that sits in your home directory-- you don’t need admin privileges to write there. The benefit of this is that it keeps things simple to update, and you don’t need to be an admin to update your local binaries.

Soooo, actually I would recommend removing the “abin” directory in your home directory, and re-running the @update* command without the “sudo”.

Once you do that, can you please copy+paste the following:

which afni


which suma

C) -check_all

and paste the outputs here?


Thanks for the info about sudo, I originally added the sudo command based on the following error that is generated during the following step

tcsh @update.afni.binaries -package macos_10.12_local -do_extras

++ extracting package macos_10.12_local.tgz…
++ backing up current binaries to auto_backup.macos_10.12_local
++ installing new binaries…
++ adding /Users/amy/abin to PATH in /Users/amy/.bash_profile …
++ setting DYLD_LIBRARY_PATH in /Users/amy/.bash_profile …
/Users/amy/.bash_profile: Permission denied.

I did go on to run the commands you recommended and the outputs are shown here
which afni
[no output]
which suma
[no output] -check_all
-bash: command not found


Hi, Amy-

Hmm, OK. I think that the the “permission denied” there means that those files are somehow owned by root now. What is the output of this?

ls -ld ~/.*rc

Re. the “which …” and “ …” not being found-- that is because your path isn’t set up, and maybe your ~/abin/ isn’t created at the moment. Getting the path set depends on being able to write to your ~/.*rc files, so let’s sort that out first (so, dealing with the stuff in the first paragraph in this note).


Ah makes sense.

ls -ld ~/.*rc
-rw-r–r-- 1 amy staff 12880 Jun 10 11:57 /Users/amy/.afnirc
-rw-r–r–@ 1 amy staff 299 Jun 10 13:30 /Users/amy/.bashrc
-rw-r–r–@ 1 amy staff 578 Jun 10 11:56 /Users/amy/.cshrc
-rw-r–r-- 1 amy staff 514 May 14 15:47 /Users/amy/.zshrc

It appears ~/abin does exist on my account (as well as an @update.afni.binaries document)

DYLD_LIBRARY_PATH seems to be set appropriately in .bashrc, but not in .bash_profile

thanks for the help.


Hi, Amy-

Your ~/.*rc files appear to be owned by you “amy” (and not by root), and you have read+write permissions on it. So that is good.

I guess I forgot to ask about similar info for ~/.bash_profile, which is the problem file… what is the output of:

ls -ld ~/.bash_profile



Ah, yes like you expected, the .bash_profile is owned by root

ls -ld ~/.bash_profile
-rw-r–r-- 1 root staff 592 Jun 10 11:56 /Users/amy/.bash_profile

could you recommend how to change the ownership of this file?


HI, Amy-

Can you run this:

chown --reference=~/.bashrc ~/.bash_profile

… and I think likely it will actually have to be done with:

sudo chown --reference=~/.bashrc ~/.bash_profile

After that, what does:

ls -ld ~/.bash_profile



Great, yes that seemed to solve the problem.

ls -ld ~/.bash_profile
-rw-r–r-- 1 amy staff 592 Jun 10 11:56 /Users/amy/.bash_profile

From here, I would assume I need to just re-run the command, is this correct?
tcsh @update.afni.binaries -package macos_10.12_local -do_extras



Yep, give that a go now:

tcsh @update.afni.binaries -package macos_10.12_local -do_extras

and let’s see what happens.


Great, thanks for the advice, after also changing the ownership of ~/.afni I was able to successfully run the command:

tcsh @update.afni.binaries -package macos_10.12_local -do_extras

And the suma -update env command also successfully ran.

I have now moved on to installing R, and have run into another error. I installed R3.5.3 and confirmed I can open and run R from the terminal, but I receive the following error when running the command:

sudo rPkgsInstall -pkgs ALL
updating R_LD_LIBRARY_PATH …

oo Warning:
Failed to load with this error message:

Error in dyn.load(ll) :
unable to load shared object ‘/Users/amy/abin/’:
dlopen(/Users/amy/abin/, 6): Library not loaded: /sw/Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libR.dylib
Referenced from: /Users/amy/abin/
Reason: Incompatible library version: requires version 3.6.0 or later, but libR.dylib provides version 3.5.0
Calls: source … withVisible → eval → eval → set_R_io → dyn.load
Execution halted

I do have another version of R installed in a different enviornment, is this causing the problem?

Hmm, I am not certain.

Rick noted here in another recent case of woe:,164026,164033#msg-164033
… that, “The 3.6 version is what the library and R programs currently work with.”

As he asked there, what is the output of:

ls -l /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libR*



It looks like the directory /Library/Frameworks/R.framework/Versions/3.6 does not exist

ls -l /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libR*
ls: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libR*: No such file or directory

navigating to the Versions Directory (there are two subdirectories: 3.5 and Current)

ls -l /Library/Frameworks/R.framework/Versions
total 0
drwxrwxr-x 6 root admin 192 Jun 11 12:49 3.5
lrwxr-xr-x 1 root admin 3 Jun 11 12:49 Current → 3.5


Try the following:

cd /Library/Frameworks/R.framework/Versions
rm -rf 3.5

Then download R 3.6.3 from

Great, installing the newer version of R did the trick.


Ahoy amigos!

I hope you are healthy and sane.

Related to Catalina installations. AFNI binaries installed fine for me, but loading fails to load with the following:
Error in dyn.load(ll) :
unable to load shared object ‘/Users/zsaad/abin/’:
dlopen(/Users/zsaad/abin/, 6): Library not loaded: /sw/Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libR.dylib
Referenced from: /Users/zsaad/abin/
Reason: image not found

I am using R version 4.01.1, so my R library is /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib any chance I can get AFNI’s to work with it?

Would compiling locally solve the problem and if so, what is the latest recommended makefile for a build?


I am using R version 4.01.1, so my R library is /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib
any chance I can get AFNI’s to work with it?

Greetings, Chairman Z-

Rick is trying to build an for Mac OS 10.15, and hopefully it will be available soon. In the meantime, if you’re in a hurry, get R 3.6.3 ( and it should solve the problem.

Yes, it is probably enough to also have 3.6 installed for now, even if it is not your “current”. We will try to handle this more usefully soon.

Building yourself would work, too. But we are still using the 10.12 Makefile, which is fink-based. We will probably make a 10.14 build system that is based on homebrew. There is a current 10.14 Makefile from Peter, which is based on homebrew and conda. Maybe that is useful for now.

  • rick