I tried to install on a new Mac mini with M2 chip. I run into errors when running the commend "tcsh OS_notes.macos_12_ARM_b_user.tcsh". I run into error at here:
build_afni.py -build_root /Users/li.14492/afni_build -package macos_13_ARM_clang
-- current AFNI: AFNI_24.1.03, anyos_text, Apr 18 2024
-- cleaning old build root dir, /Users/li.14492/afni_build
-- preparing build_root dir, /Users/li.14492/afni_build
-- have default git tag LAST_TAG, will checkout AFNI_24.1.03
-- checking out git tag AFNI_24.1.03
-- using repo branch (detached), tag AFNI_24.1.03
-- removing old atlas dir, prev/afni_atlases_dist
-- moving old atlas dir afni_atlases_dist to prev/afni_atlases_dist
-- downloading AFNI atlas package, afni_atlases_dist.tgz
-- unpacking atlas package, afni_atlases_dist
-- removing old NiiVue backup, prev/niivue_afni.umd.js
-- moving old niivue niivue_afni.umd.js to prev/niivue_afni.umd.js
-- downloading NiiVue, niivue_afni.umd.js
-- preparing to run 'make' build of package macos_13_ARM_clang
-- copying README files
-- copying other_builds/Makefile.macos_13_ARM_clang to Makefile
-- building make target 'itall'
-- consider monitoring the build in a separate window with:
cd /Users/li.14492/Documents
tail -f /Users/li.14492/afni_build/build_src/log_make.txt
# use ctrl-c to terminate 'tail' command (not the build)
++ building (please be patient)...
** error: failed run_cmd: make AFNI_WHOMADEIT=build itall >& log_make.txt
-- status: building FAILURE
see 'make' log file /Users/li.14492/afni_build/build_src/log_make.txt
** error: tail from log_make.txt:
--------------------------------------------------
| ~~~~~~^~~
/bin/rm -f pbar_color_defs.o
/opt/homebrew/bin/gcc-13 -arch arm64 -DDARWIN -DARM_M1 -O1 -m64 -Wall -Wno-deprecated-declarations -Wcomment -Wformat -DUSE_TRACING -DHAVE_XDBE -DDONT_USE_MCW_MALLOC -c pbar_color_defs.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
In file included from afni.h:11,
from pbar_color_defs.c:1:
imseq.h:20:10: fatal error: Xm/Xm.h: No such file or directory
20 | #include <Xm/Xm.h>
| ^~~~~~~~~
compilation terminated.
make: *** [pbar_color_defs.o] Error 1
--------------------------------------------------
** warning: in conda environment
CONDA_SHLVL = 0, CONDA_DEFAULT_ENV = base
-- shell/system command history is in:
/Users/li.14492/afni_build/hist_commands.txt
++ screen text history is in:
/Users/li.14492/afni_build/hist_messages.txt
rehash
setenv R_LIBS /Users/li.14492/sw/R-4.3.1
echo export R_LIBS=/Users/li.14492/sw/R-4.3.1
echo export R_LIBS=/Users/li.14492/sw/R-4.3.1
echo setenv R_LIBS /Users/li.14492/sw/R-4.3.1
mkdir -p /Users/li.14492/sw/R-4.3.1
rPkgsInstall -pkgs ALL
tee out.rPkgsInstall.txt
I also run afni_system_check.py -check_all and have the outputs below:
-------------------------------- general ---------------------------------
architecture: 64bit
cpu type: arm
system: Darwin
release: 23.3.0
version: Darwin Kernel Version 23.3.0: Wed Dec 20 21:33:31 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T8112
distribution: 14.3.1
number of CPUs: 8
apparent login shell: zsh
shell RC file: .zshrc (exists)
--------------------- AFNI and related program tests ---------------------
which afni :
:
AFNI_version.txt : AFNI_24.1.03, anyos_text, Apr 18 2024, local
which python : /opt/anaconda3/bin/python
python version : 3.11.7
which R : /usr/local/bin/R
R version : R version 4.3.1 (aarch64-apple-darwin20)
instances of various programs found in PATH:
afni : 0
R : 1 (/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/bin/R)
python : 1 (/opt/anaconda3/bin/python3.11)
python2 : 0
python3 : 3
/opt/anaconda3/bin/python3.11
/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/bin/python3.12
/usr/bin/python3
** have python3 but not python2
testing ability to start various programs...
afni : FAILURE
/bin/sh: afni: command not found
suma : FAILURE
/bin/sh: suma: command not found
3dSkullStrip : FAILURE
/bin/sh: 3dSkullStrip: command not found
3dAllineate : FAILURE
/bin/sh: 3dAllineate: command not found
3dRSFC : FAILURE
/bin/sh: 3dRSFC: command not found
SurfMesh : FAILURE
/bin/sh: SurfMesh: command not found
3dClustSim : FAILURE
/bin/sh: 3dClustSim: command not found
uber_subject.py : success
3dMVM : FAILURE
setenv: Too many arguments.
------------------------ dependent program tests -------------------------
checking for dependent programs...
which tcsh : /bin/tcsh
which Xvfb : /opt/X11/bin/Xvfb
checking for R packages...
rPkgsInstall -pkgs ALL -check : FAILURE
setenv: Too many arguments.
R RHOME : /Library/Frameworks/R.framework/Resources
------------------------------ python libs -------------------------------
++ module loaded: matplotlib.pyplot
module file : /opt/anaconda3/lib/python3.11/site-packages/matplotlib/pyplot.py
matplotlib version : 3.8.0
++ module loaded: flask
module file : /opt/anaconda3/lib/python3.11/site-packages/flask/__init__.py
flask version : 2.2.5
** failed to load module flask_cors
-- flask_cors is not required, but is desirable
-------------------------------- env vars --------------------------------
PATH = /opt/anaconda3/bin:/opt/anaconda3/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/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:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/Privileges.app/Contents/Resources:/usr/local/laps:/Users/li.14492/abin
PYTHONPATH =
R_LIBS = /Users/li.14492/sw/R-4.3.1
LD_LIBRARY_PATH =
DYLD_LIBRARY_PATH (sub-shell) = :/opt/X11/lib/flat_namespace
DYLD_FALLBACK_LIBRARY_PATH (sub-shell) =
CONDA_SHLVL = 1
CONDA_DEFAULT_ENV = base
----------------------------- eval dot files -----------------------------
----------- AFNI $HOME files -----------
.afnirc : found
.sumarc : missing
.afni/help/all_progs.COMP : missing
--------- shell startup files ----------
-- good: .cshrc seems to contain 'source .tcshrc'
-- 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 3 dot files
------------------------------ data checks -------------------------------
data dir : missing AFNI_data6
data dir : missing AFNI_demos
data dir : missing suma_demo
data dir : missing afni_handouts
atlas : did not find TT_N27+tlrc
------------------------------ OS specific -------------------------------
XQuartz version : 2.8.5
which brew : /opt/homebrew/bin/brew
brew version : Homebrew 4.2.19
========================= summary, please fix: =========================
* just be aware: login shell 'zsh', but our code examples use 'tcsh'
* missing program: afni
* failure under initial "AFNI and related program tests"
* AFNI programs show FAILURE
* missing R packages (see rPkgsInstall)
* please run: "suma -update_env" for .sumarc
* please run: apsearch -update_all_afni_help
* insufficient data for AFNI bootcamp
(see "Prepare for Bootcamp" on install pages)
* possibly missing atlases
* consider installing gcc under homebrew
* consider installing glib under homebrew
Not sure why it says "consider installing gcc under homebrew" and "consider installing glib under homebrew". I already have them installed with homebrew.
It will be extremely helpful if you can give any advice. Thanks.
I have made some progress and moved the installation forward by a bit, but still fail at installing afni. The current error messages are at below. Will share the entire log files if needed :
I end up installing afni successfully. There are several rounds of error messages / debugs, and they are solved by installing these packages by homebrew: openmotif, libomp and gsl.
The only glitch now is that when I use afni commend in the terminal to open the afni GUI, it shows an error saying
Initializing: X11Error: Can't open display: :0.0.
This can not be solved by setting different display variables in the startup script. I found that for me to open afni GUI, I have to manually open XQuartz first, and then run the afni commend. I didn't have to in the other of my older Mac.
You might want to reboot once, and see if that behavior continues. Sometimes a /tmp/.x11... file needs to be created, but that usually happens when running the afni GUI.
Can you try a reboot, just this one time (and after any XQuartz upgrade/install)?
Then let us know if it persists.
(1) I reboot the Mac, and also made sure that the XQuartz is updated. The issue persist. I can open afni GUI only if I first open XQuartz myself; otherwise, I am not able to open the GUI, with an error message "Initializing: X11Error: Can't open display: :0.0."
(2) I also run into error when trying to open SUMA GUI. I am not able to open suma GUI even if already opened XQuartz. I received error message
suma:
No input specified, loading some toy surfaces...
Use '.' and ',' to cycle between them.
See suma -help for assistance.
trying lame single buffer visual
++ Notice SUMA_XtWarn_handler (SUMA_display.c:4152 @15:04:30):
X11 Warning 1:trying lame single buffer visual
Have 1 X11 warnings so far, see Help-->Message Log if curious.
This notice is shown once for each additional 10 warnings.
Error: no good visual
My current folder doesn't have any surface files. However, in the other of my old Mac, suma gui will still open with a toy surface, but now the GUI does not open at all.
% otool -L ~/abin/afni
/Users/li.14492/abin/afni:
/opt/homebrew/opt/openmotif/lib/libXm.4.dylib (compatibility version 5.0.0, current version 5.4.0)
/opt/homebrew/opt/libxt/lib/libXt.6.dylib (compatibility version 7.0.0, current version 7.0.0)
/opt/homebrew/opt/libxft/lib/libXft.2.dylib (compatibility version 6.0.0, current version 6.8.0)
/opt/homebrew/opt/fontconfig/lib/libfontconfig.1.dylib (compatibility version 14.0.0, current version 14.1.0)
/opt/homebrew/opt/libpng/lib/libpng16.16.dylib (compatibility version 60.0.0, current version 60.0.0)
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/opt/homebrew/opt/libxmu/lib/libXmu.6.dylib (compatibility version 9.0.0, current version 9.0.0)
/opt/homebrew/opt/libxp/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/homebrew/opt/libxext/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
/opt/homebrew/opt/libx11/lib/libX11.6.dylib (compatibility version 11.0.0, current version 11.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.12)
/usr/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 8.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1345.100.2)
To add, I am not able to open suma even after I open XQuartz. I received error messages like this:
bash-3.2$ suma
suma:
No input specified, loading some toy surfaces...
Use '.' and ',' to cycle between them.
See suma -help for assistance.
trying lame single buffer visual
++ Notice SUMA_XtWarn_handler (SUMA_display.c:4152 @16:02:35):
X11 Warning 1:trying lame single buffer visual
Have 1 X11 warnings so far, see Help-->Message Log if curious.
This notice is shown once for each additional 10 warnings.
Error: no good visual
Those directories and permissions under /tmp/.X11-unix seem right. The problem with suma may or may not be related.
Focusing on suma for a moment, what does 'otool -L' show for it?
Also, just to be sure, would you try running suma after completely deactivating conda? I haven't seen a problem like that, but want to be sure.
Were you in a conda environment when you compiled the AFNI package?
regarding suma, if I do 'otool -L' on suma, it shows this:
(base) li.14492@ascpsy-nc304484 analysis_fmri % otool -L /Users/li.14492/abin/suma
/Users/li.14492/abin/suma:
/opt/homebrew/opt/openmotif/lib/libXm.4.dylib (compatibility version 5.0.0, current version 5.4.0)
/opt/homebrew/opt/jpeg-turbo/lib/libjpeg.8.dylib (compatibility version 8.0.0, current version 8.3.2)
/opt/homebrew/opt/libxt/lib/libXt.6.dylib (compatibility version 7.0.0, current version 7.0.0)
/opt/homebrew/opt/libxft/lib/libXft.2.dylib (compatibility version 6.0.0, current version 6.8.0)
/opt/homebrew/opt/fontconfig/lib/libfontconfig.1.dylib (compatibility version 14.0.0, current version 14.1.0)
/opt/homebrew/opt/libpng/lib/libpng16.16.dylib (compatibility version 60.0.0, current version 60.0.0)
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/opt/homebrew/opt/libxmu/lib/libXmu.6.dylib (compatibility version 9.0.0, current version 9.0.0)
/opt/homebrew/opt/libxp/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/homebrew/opt/libxext/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
/opt/homebrew/opt/libx11/lib/libX11.6.dylib (compatibility version 11.0.0, current version 11.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.12)
/usr/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 8.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1345.100.2)
/opt/X11/lib/libGLU.1.dylib (compatibility version 5.0.0, current version 5.1.0)
/opt/X11/lib/libGL.1.dylib (compatibility version 4.0.0, current version 4.0.0)
/opt/homebrew/opt/glib/lib/libglib-2.0.0.dylib (compatibility version 8001.0.0, current version 8001.0.0)
I'm not under conda environment when compiled the AFNI package. But the python version I current use is the one in conda
@rickr Hello I wonder whether there is any advice regarding this issue. It's been a while, but finally, i am attempting to use suma to resume some analyses that I've done in the past, but not able to do it on the new Mac mini M2chip.
Have you tried reinstalling XQuartz? Maybe something went wrong with that.
-rick
The
National Institute of Mental Health (NIMH) is part of the National Institutes of
Health (NIH), a component of the U.S. Department of Health and Human
Services.