AFNI installation issues M3 (2025)

Hello,
I need some help with installation. This did not happen when I tried to install on M2 laptop. It also seems like my device is macOS 14? I checked others' post on this installation issue and have updated commandlinetools and install again accordingly, but I still have error messages when I run
tcsh OS_notes.macos_12_ARM_b_user.tcsh

% 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  5083  100  5083    0     0  10307      0 --:--:-- --:--:-- --:--:-- 10289
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.3.1
R ver : 4.3.1
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/ssuhan/abin/init_user_dotfiles.py ) then
echo -- skipping install of AFNI anyos_text_atlas
-- skipping install of AFNI anyos_text_atlas
endif
echo ++ setting up user dotfiles
++ setting up user dotfiles
/Users/ssuhan/abin/init_user_dotfiles.py -shell_list bash zsh tcsh -do_updates path apsearch -dir_bin /Users/ssuhan/abin
-- 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)

no modifications needed across 4 dot files

which init_user_dotfiles.py
/Users/ssuhan/abin/init_user_dotfiles.py
if ( 0 ) then
if ( arm64 == x86_64 ) then
set package = macos_13_ARM
endif
echo ++ compiling AFNI package macos_13_ARM
++ compiling AFNI package macos_13_ARM
echo ++ running: build_afni.py -build_root ~/afni_build -package macos_13_ARM
++ running: build_afni.py -build_root ~/afni_build -package macos_13_ARM
build_afni.py -build_root /Users/ssuhan/afni_build -package macos_13_ARM

-- build_afni.py, version 0.14, November 17, 2024
-- current AFNI: AFNI_25.1.11, anyos_text_atlas, May 23 2025
-- preparing build_root dir, /Users/ssuhan/afni_build
-- creating build_root dir, /Users/ssuhan/afni_build
-- running 'git clone' on afni repo ...
   (please be patient)
-- have default git tag LAST_TAG, will checkout AFNI_25.1.11
-- checking out git tag AFNI_25.1.11
-- using repo branch (detached), tag AFNI_25.1.11
-- downloading AFNI atlas package, afni_atlases_dist.tgz
-- unpacking atlas package, afni_atlases_dist
-- downloading NiiVue, niivue_afni.umd.js

-- preparing to run 'make' build of package macos_13_ARM
-- copying README files
-- copying Makefile.macos_13_ARM to Makefile
-- building make target 'itall'

-- consider monitoring the build in a separate window with:
       cd /Users/ssuhan
       tail -f /Users/ssuhan/afni_build/build_src/log_make.txt
       # use ctrl-c to terminate 'tail' command (not the build)
++ building (please be patient)...

++ need alternate compiler, trying /opt/homebrew/bin/gcc-15
   (if this fails, try passing one via -cc_path)

** error: failed run_cmd: make AFNI_WHOMADEIT=build  LOCAL_CC_PATH=/opt/homebrew/bin/gcc-15 itall >& log_make.txt
-- status: building FAILURE
   see 'make' log file /Users/ssuhan/afni_build/build_src/log_make.txt
** error: tail from log_make.txt:
   --------------------------------------------------
   vecmat.h:67:18: warning: 'tempA_ivec3' defined but not used [-Wunused-variable]
   67 | static THD_ivec3 tempA_ivec3 , tempB_ivec3 ;  /* temps for macros below */
   |                  ^~~~~~~~~~~
   /bin/rm -f mcw_glob.o
   /opt/homebrew/bin/gcc-15 -arch arm64 -DDARWIN -DARM_M1 -O1 -m64 -Wall -Wno-deprecated-declarations -Wcomment -Wformat -DUSE_TRACING -DHAVE_XDBE -DDONT_USE_MCW_MALLOC  -c mcw_glob.c -I. -I/opt/homebrew/include -I/opt/X11/include -I/usr/include -Icoxplot -Inifti/nifti2 -Inifti/niftilib -Inifti/nifticdf -Inifti/znzlib -I3DEdge/src -Irickr -Ileej3 -DHAVE_ZLIB -DHAVE_GIFTI  -If2c
   mcw_glob.c: In function 'afni_glob':
   mcw_glob.c:342:23: error: assignment to 'int (*)(void)' from incompatible pointer type 'int (*)(char *, int)' [-Wincompatible-pointer-types]
   342 |     pglob->gl_errfunc = errfunc;
   |                       ^
   make: *** [mcw_glob.o] Error 1
   --------------------------------------------------

** warning: in conda environment
   CONDA_SHLVL = 0, CONDA_DEFAULT_ENV = base

-- shell/system command history is in:
      /Users/ssuhan/afni_build/hist_commands.txt

++ screen text history is in:
      /Users/ssuhan/afni_build/hist_messages.txt

rehash
if ( ! 0 ) then
echo ++ setting R_LIBS=/Users/ssuhan/sw/R-4.3.1
++ setting R_LIBS=/Users/ssuhan/sw/R-4.3.1
setenv R_LIBS /Users/ssuhan/sw/R-4.3.1
echo export R_LIBS=/Users/ssuhan/sw/R-4.3.1
echo export R_LIBS=/Users/ssuhan/sw/R-4.3.1
echo setenv R_LIBS /Users/ssuhan/sw/R-4.3.1
else
if ( ! -d /Users/ssuhan/sw/R-4.3.1/data.table ) then
echo ++ building R libraries: rPkgsInstall -pkgs ALL
++ building R libraries: rPkgsInstall -pkgs ALL
mkdir -p /Users/ssuhan/sw/R-4.3.1
rPkgsInstall -pkgs ALL
tee out.rPkgsInstall.txt

** ERROR: Failed to load R_io.so

Thank you!

Hello,
It worked after I run
build_afni.py -build_root /Users/ssuhan/afni_build -package macos_13_ARM -cc_path /usr/bin/clang

tcsh OS_notes.macos_12_ARM_b_user.tcsh
then run the original script again! I dont know exactly why but just leave this here.

That's great! Each time homebrew updates the gcc version, the compiler decides to call new things errors. And we have yet to deal with gcc-15. Soon, though...

Thanks,

-rick

Okay, since every install should get gcc-15 right now, the build_afni.py command has been updated to use /usr/bin/gcc instead. We will revert the instructions once the gcc-15 issues are resolved. That should have been done weeks ago, but I never verified that brew was always coming with 15.

Thanks,

-rick