cannot save images from @chauffeur_afni

AFNI version info (afni -ver): Version AFNI_24.0.06 'Caracalla'
Mac OS (M1 chip): 14.2.1 Sonoma

Hi all,
I'm trying to make images using @chauffeur_afni.
I've failed to get images not only from my own code but also an example code provided here (12.12.2. Using @chauffeur_afni — AFNI, SUMA and FATCAT: v24.1.08).

Here's what I entered:

@chauffeur_afni                                                       \
    -ulay         anat+orig.HEAD                                      \
    -prefix       QC/ca000_anat_def \
    -set_xhairs   MULTI                                               \
    -montx 3 -monty 3                                                 \
    -label_mode 1 -label_size 4

Here's the terminal answers:

++ My command:
   @chauffeur_afni -ulay anat+orig.HEAD -prefix QC/ca000_anat_def -set_xhairs MULTI -montx 3 -monty 3 -label_mode 1 -label_size 4

++ Using AFNI ver : AFNI_24.0.06
++ chauffeur ver  : 6.61
\n------------------ start of optionizing ------------------\n
++ Found input file:   anat+orig.HEAD
+* Noting: you did NOT provide an overlay, and yet
           you did NOT turn off the overlay with '-olay_off'
       --> so I assume you just want to view the underlay.
++ Using blowup factor: 2
++ Using opacity:  6
++ Making temporary work directory to copy vis files: QC/__tmp_chauf_AwR6Qt1MbWj
++ Converted 0 to labels
++ Final subbrick indices: -1 -1 -1
++ Copy ulay to visualize (volumetric) within user's range:
++ Ulay to be visualized within user range:
  [0%, 98%] -> [0.000000, 1367.000000]
++ 3dcalc: AFNI version=AFNI_24.0.06 (Feb  8 2024) [64-bit]
++ Authored by: A cast of thousands
++ Output dataset ./QC/__tmp_chauf_AwR6Qt1MbWj/tmp_ulay.nii
++ No overlay viewing
++ Dimensions (xyzt): 256 256 175 1
++ (initial) Slice spacing ordered (x,y,z) is:  19 28 28
++ 3dmaskdump: AFNI version=AFNI_24.0.06 (Feb  8 2024) [64-bit]
++ Executing 3dcalc()
 argv[0]=3dcalc argv[1]=-a argv[2]=anat+orig.HEAD[0] argv[3]=-expr argv[4]=a argv[5]=-byte argv[6]=-session argv[7]=/var/folders/5t/dxm15g9d0b98vcv5xy3l5mp80000gn/T/ argv[8]=-prefix argv[9]=3dcalc_AFN_83mr-DOq8KM0spdxxAU1nA argv[10]=-verbose
++ 3dcalc: AFNI version=AFNI_24.0.06 (Feb  8 2024) [64-bit]
++ Authored by: A cast of thousands
++ Computing sub-brick 0
++ Scaling output to type byte brick(s)
++ Sub-brick 0 scale factor = 0.062029
++ Computing output statistics
++ Output dataset /var/folders/5t/dxm15g9d0b98vcv5xy3l5mp80000gn/T/3dcalc_AFN_83mr-DOq8KM0spdxxAU1nA+orig.BRIK
++ 11468800 voxels in the entire dataset (no mask)
++ 1 voxels in the boxes and/or balls
++ Using only the boxes+balls mask
++ Will have: SET_IJK 128 127 86
\n------------------- end of optionizing -------------------\n
 -- trying to start Xvfb :210 
[1] 7487

+++ Command Echo:
   afni -q -no1D -noplugins -no_detach -com SWITCH_UNDERLAY tmp_ulay.nii -com SWITCH_OVERLAY  tmp_ulay.nii -com SEE_OVERLAY     - -com OPEN_WINDOW sagittalimage opacity=6 mont=3x3:19:0:black crop=0:0,0:0  -com OPEN_WINDOW coronalimage  opacity=6 mont=3x3:28:0:black crop=0:0,0:0  -com OPEN_WINDOW axialimage    opacity=6 mont=3x3:28:0:black crop=0:0,0:0  -com SET_PBAR_ALL    -99 1 Plasma -com DO_NOTHING -com SET_SUBBRICKS   -1 -1 -1 -com SET_ULAY_RANGE A.all 0.000000 1367.000000 -com SET_FUNC_RANGE  0 -com SET_THRESHNEW   0 * -com SET_FUNC_ALPHA  No -com SET_FUNC_BOXED  No -com SET_FUNC_RESAM  NN.NN -com SET_XHAIRS      MULTI -com SET_XHAIR_GAP   -1 -com SET_IJK 128 127 86 -com SAVE_PNG axialimage    QC/ca000_anat_def.axi blowup=2 -com SAVE_PNG sagittalimage QC/ca000_anat_def.sag blowup=2 -com SAVE_PNG coronalimage  QC/ca000_anat_def.cor blowup=2 -com QUITT QC/__tmp_chauf_AwR6Qt1MbWj 

+/Users/minsunpark/AFNI_data6/afni/QC/__tmp_chauf_AwR6Qt1MbWj
AFNI QUITTs!
\n+* Removing temporary image directory 'QC/__tmp_chauf_AwR6Qt1MbWj'.\n
[1]    Done                          Xvfb :210 -screen 0 1024x768x24

++ DONE (good exit)
   see: QC/ca000_anat_def*

I've also seen the post (preproc QC missing image - #18 by ptaylor). And I got '3.8.4' from the command [python -c "import matplotlib as mmm; print(mmm.version)"].

Thanks for your support!
MP

Hi, MP-

Hmm, OK, that is odd. I just ran that command on my macOS, and it worked for me.

What is the output of afni_system_check.py -check_all on your computer?

--pt

ps: on a Message Board posting note, you can put multi-line code output between blocks of triple-backticks, like this:
```
code
more code
...
```
... and it will appear in nicely formatted monospace. More details are here. I actually edited the original question here to include backticks, so the provided terminal text was easier to read.

Hi pt,
Thanks for your reply and the comments regarding posting note.
Here's the output of afni_system_check.py -check_all.

-------------------------------- general ---------------------------------
architecture:         64bit 
cpu type:             arm
system:               Darwin
release:              23.2.0
version:              Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000
distribution:         14.2.1
number of CPUs:       10
apparent login shell: zsh
shell RC file:        .zshrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           : /Users/minsunpark/abin/afni
afni version         : Precompiled binary macos_10.12_local: Feb  8 2024 
                     : AFNI_24.0.06 'Caracalla'
AFNI_version.txt     : AFNI_24.0.06, macos_10.12_local, Feb 08 2024, official
which python         : /Users/minsunpark/fsl/bin/python
python version       : 3.11.8
which R              : /usr/local/bin/R
R version            : R version 4.3.0 (aarch64-apple-darwin20)

instances of various programs found in PATH:
    afni    : 1   (/Users/minsunpark/abin/afni)
    R       : 1   (/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/bin/R)
    python  : 2 
      /Users/minsunpark/fsl/bin/python3.11
      /opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/bin/python3.9
    python2 : 0 
    python3 : 2 
      /Users/minsunpark/fsl/bin/python3.11
      /usr/bin/python3

** have python3 but not python2

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
        dyn.load(ll)에서 다음과 같은 에러가 발생했습니다:
          공유된 객체 '/Users/minsunpark/abin/R_io.so'를 로드 할 수 없습니다:
          dlopen(/Users/minsunpark/abin/R_io.so, 0x0006): tried: '/Users/minsunpark/abin/R_io.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/minsunpark/abin/R_io.so' (no such file), '/Users/minsunpark/abin/R_io.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
        호출: source ... withVisible -> eval -> eval -> set_R_io -> dyn.load
        실행이 정지되었습니다

------------------------ 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
        dyn.load(ll)에서 다음과 같은 에러가 발생했습니다:
          공유된 객체 '/Users/minsunpark/abin/R_io.so'를 로드 할 수 없습니다:
          dlopen(/Users/minsunpark/abin/R_io.so, 0x0006): tried: '/Users/minsunpark/abin/R_io.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/minsunpark/abin/R_io.so' (no such file), '/Users/minsunpark/abin/R_io.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
        호출: source ... withVisible -> eval -> eval -> set_R_io -> dyn.load
        실행이 정지되었습니다

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

------------------------------ python libs -------------------------------

++ module loaded: matplotlib.pyplot
   module file : /Users/minsunpark/fsl/lib/python3.11/site-packages/matplotlib/pyplot.py
   matplotlib version : 3.8.4

++ module loaded: flask
   module file : /Users/minsunpark/fsl/lib/python3.11/site-packages/flask/__init__.py
   flask version : 3.0.3

** failed to load module flask_cors
-- flask_cors is not required, but is desirable

-------------------------------- env vars --------------------------------
PATH = /Users/minsunpark/freesurfer/bin:/Users/minsunpark/freesurfer/fsfast/bin:/Users/minsunpark/fsl/bin:/Users/minsunpark/fsl/share/fsl/bin:/Users/minsunpark/freesurfer/mni/bin:/Users/minsunpark/fsl/share/fsl/bin:/Users/minsunpark/fsl/share/fsl/bin:/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:/opt/homebrew/opt/python/libexec/bin:/Library/Frameworks/R.framework/Resources:/usr/local/gfortran/bin:/Users/minsunpark/abin

PYTHONPATH = 
R_LIBS = 
LD_LIBRARY_PATH = 
DYLD_LIBRARY_PATH (sub-shell) = /Users/minsunpark/freesurfer/lib/gcc/lib:/opt/X11/lib/flat_namespace
DYLD_FALLBACK_LIBRARY_PATH (sub-shell) = 

----------------------------- 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, flatdir, 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 3 files:
   
      file             path  flatdir  apsearch        follower
      ---------------  ----  -------  --------        --------
      .cshrc           0     0        1               0     
      .tcshrc          0     0        0               1     
      .zshrc           0     0        0               0     
   
------------------------------ data checks -------------------------------
data dir : found AFNI_data6   under $HOME (471482M Avail)
           top history: ... 2024 [rickr]: 3drefit -newid FT/SUMA/FT_SurfVol.nii
data dir : missing AFNI_demos
data dir : missing suma_demo
data dir : missing afni_handouts
atlas    : found TT_N27+tlrc  under /Users/minsunpark/abin

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


** no package manager found (okay for bootcamp)
++ found 1 dylib files under '/opt/X11/lib/flat_namespace'
   -- found 'libXt' dylib files:
      /opt/X11/lib/flat_namespace/libXt.6.dylib
-- recent OS X, cheating to check DYLD_LIBRARY_PATH in cur shell 'zsh'...
++ found evar DYLD_LIBRARY_PATH = /Users/minsunpark/freesurfer/lib/gcc/lib:/opt/X11/lib/flat_namespace
-- recent OS X, cheating to check DYLD_LIBRARY_PATH in shell 'tcsh'...
++ found evar DYLD_LIBRARY_PATH = /opt/X11/lib/flat_namespace:/opt/X11/lib/flat_namespace:/opt/X11/lib/flat_namespace

=========================  summary, please fix:  =========================
*  just be aware: login shell 'zsh', but our code examples use 'tcsh'
*  AFNI programs show FAILURE
*  missing R packages (see rPkgsInstall)
*  dot file test : want 1 modifications across 3 files:
*  insufficient data for AFNI bootcamp
   (see "Prepare for Bootcamp" on install pages)

As for some contents written in korean, it says The following error occurred in dyn.load(ll): Unable to load shared object '/Users/minsunpark/abin/R_io.so': and : source ... withVisible -> eval -> eval -> set_R_io -> dyn.load Execution has been stopped.

After receiving your reply, I turned off and restarted my mac, and I tried the same example code. But I got an error message this time like this:

   @chauffeur_afni -ulay anat+orig.HEAD -prefix QC/ca000_anat_def -set_xhairs MULTI -montx 3 -monty 3 -label_mode 1 -label_size 4

++ Using AFNI ver : AFNI_24.0.06
++ chauffeur ver  : 6.61
\n------------------ start of optionizing ------------------\n
++ Found input file:   anat+orig.HEAD
+* Noting: you did NOT provide an overlay, and yet
           you did NOT turn off the overlay with '-olay_off'
       --> so I assume you just want to view the underlay.
++ Using blowup factor: 2
++ Using opacity:  6
++ Making temporary work directory to copy vis files: QC/__tmp_chauf_WMHpI8XGsKe
++ Converted 0 to labels
++ Final subbrick indices: -1 -1 -1
++ Copy ulay to visualize (volumetric) within user's range:
++ Ulay to be visualized within user range:
  [0%, 98%] -> [0.000000, 1367.000000]
++ 3dcalc: AFNI version=AFNI_24.0.06 (Feb  8 2024) [64-bit]
++ Authored by: A cast of thousands
++ Output dataset ./QC/__tmp_chauf_WMHpI8XGsKe/tmp_ulay.nii
++ No overlay viewing
++ Dimensions (xyzt): 256 256 175 1
++ (initial) Slice spacing ordered (x,y,z) is:  19 28 28
++ 3dmaskdump: AFNI version=AFNI_24.0.06 (Feb  8 2024) [64-bit]
++ Executing 3dcalc()
 argv[0]=3dcalc argv[1]=-a argv[2]=anat+orig.HEAD[0] argv[3]=-expr argv[4]=a argv[5]=-byte argv[6]=-session argv[7]=/var/folders/5t/dxm15g9d0b98vcv5xy3l5mp80000gn/T/ argv[8]=-prefix argv[9]=3dcalc_AFN_JX1D8S0jVSeiRLSGJe9phQ argv[10]=-verbose
++ 3dcalc: AFNI version=AFNI_24.0.06 (Feb  8 2024) [64-bit]
++ Authored by: A cast of thousands
++ Computing sub-brick 0
++ Scaling output to type byte brick(s)
++ Sub-brick 0 scale factor = 0.062029
++ Computing output statistics
++ Output dataset /var/folders/5t/dxm15g9d0b98vcv5xy3l5mp80000gn/T/3dcalc_AFN_JX1D8S0jVSeiRLSGJe9phQ+orig.BRIK
++ 11468800 voxels in the entire dataset (no mask)
++ 1 voxels in the boxes and/or balls
++ Using only the boxes+balls mask
++ Will have: SET_IJK 128 127 86
\n------------------- end of optionizing -------------------\n
 -- trying to start Xvfb :304 
[1] 3239
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
_XSERVTransSocketUNIXCreateListener: mkdir(/tmp/.X11-unix) failed, errno = 2
_XSERVTransMakeAllCOTSServerListeners: failed to create listener for local
(EE) 
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE) 
[1]  + Exit 1                        Xvfb :304 -screen 0 1024x768x24
 -- trying to start Xvfb :317 
[1] 3244
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
_XSERVTransSocketUNIXCreateListener: mkdir(/tmp/.X11-unix) failed, errno = 2
_XSERVTransMakeAllCOTSServerListeners: failed to create listener for local
(EE) 
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE) 
^F[1]  + Exit 1                        Xvfb :317 -screen 0 1024x768x24
 -- trying to start Xvfb :593 
[1] 3249
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
_XSERVTransSocketUNIXCreateListener: mkdir(/tmp/.X11-unix) failed, errno = 2
_XSERVTransMakeAllCOTSServerListeners: failed to create listener for local
(EE) 
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE) 
[1]  + Exit 1                        Xvfb :593 -screen 0 1024x768x24
 -- trying to start Xvfb :85 
[1] 3254
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
_XSERVTransSocketUNIXCreateListener: mkdir(/tmp/.X11-unix) failed, errno = 2
_XSERVTransMakeAllCOTSServerListeners: failed to create listener for local
(EE) 
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE) 
^C

Always thanks for your support!
MP

Hi, MP-

Thanks for sharing that information. I will make a reply post first about the new errors that have crept in:

_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
_XSERVTransSocketUNIXCreateListener: mkdir(/tmp/.X11-unix) failed, errno = 2
_XSERVTransMakeAllCOTSServerListeners: failed to create listener for local

etc., that is an annoyance with macOS, but one which is manageable. We have a note on it here in the @chauffeur_afni help file. You can copy+paste the following into your terminal:

mkdir /tmp/.X11-unix
sudo chmod 1777 /tmp/.X11-unix
sudo chown root /tmp/.X11-unix/

... and actually, I believe that just opening the AFNI GUI once will make it go away (that is, opening the GUI starts X11 and essentially creates the /tmp/.X11-unix file with correct permissions).

Does either of those steps that make that set of errors go away, hopefully?

--pt

Hi again, MP-

Back to the system_check output stuff:

For the R errors, I think the issue is that you are using precompiled AFNI binaries on the macOS computer, and if the R version you have on your computer does not match the R version we have on our local build machine, there can be unhappiness with the R_io.so library.

That is one reason that we recommend that users get AFNI by building the from source code on their local machine---that avoids that issue (as well as possible "signing" issues that executables that were not downloaded from the Apple Store can have). You have an Apple Silicon/ARM architecture on your computer, so the instruction scripts for building locally are here. You will likely just need to do Step E, first getting the script from within the Step A download:

cd
curl -O https://raw.githubusercontent.com/afni/afni/master/src/other_builds/OS_notes.macos_12_ARM_b_user.tcsh
tcsh OS_notes.macos_12_ARM_b_user.tcsh

You have most all of the Python dependencies necessary (so you might likely not need the extra Conda install instructions listed after that), though for some of the afni_proc.py QC HTML viewing it will be useful to have Flask-Cors (in addition to Flask, which you already have). Are you able to add Python libraries to your FSL-installed Python? Is that by chance using a conda environment? If so, you could add flask-cors to it.

--pt

Hi (again)^2, MP-

OK, those previous two posts might touch on some things that will help with @chauffeur_afni. I don't see why no image is being created, still. It is possible that building AFNI locally on that computer will help, though I don't have a deep explanation of why that would be.

And to check also, I assume that you can open the AFNI GUI fine and view datasets, is that right? If you do open the GUI, in each image window there is a row of buttons at the bottom, and one called Sav1.jpg for saving images. Can you left-click that and just provide some "Prefix" as the base name of an image, and see if that image gets saved successfully to your computer (it should be in that same directory that you just ran the GUI from)?

thanks,
pt

Thanks for the detailed instruction!!
For "/tmp/.X11-unix" , your suggestion perfectly worked, thanks!
And I also can open AFNI GUI and save an image as jpg, which is good.

But, I couldn't download R through the code you gave, and I got the same error message like before:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3521  100  3521    0     0  39218      0 --:--:-- --:--:-- --:--:-- 39561
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.0
R ver : 4.3.0
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
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 53097  100 53097    0     0   132k      0 --:--:-- --:--:-- --:--:--  132k
tcsh @update.afni.binaries -no_recur -package anyos_text_atlas -bindir /Users/minsunpark/abin
-- running @update.afni.binaries version 3.24, December 7, 2023
-- have AFNI binaries under /Users/minsunpark/abin
-- have current build label local
-- 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/minsunpark/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    42  100    42    0     0    319      0 --:--:-- --:--:-- --:--:--   320
++ no update needed
/Users/minsunpark/abin/init_user_dotfiles.py -shell_list bash zsh tcsh -do_updates path apsearch -dir_bin /Users/minsunpark/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

source ~/.cshrc
if ( 0 ) then
setenv DYLD_LIBRARY_PATH /opt/X11/lib/flat_namespace
endif
if ( 1 ) then
setenv DYLD_LIBRARY_PATH /opt/X11/lib/flat_namespace:/opt/X11/lib/flat_namespace
else
set path = ( /Users/minsunpark/freesurfer/bin /Users/minsunpark/freesurfer/fsfast/bin /Users/minsunpark/fsl/bin /Users/minsunpark/fsl/share/fsl/bin /Users/minsunpark/freesurfer/mni/bin /Users/minsunpark/fsl/share/fsl/bin /Users/minsunpark/fsl/share/fsl/bin /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 /opt/homebrew/opt/python/libexec/bin /Library/Frameworks/R.framework/Resources /usr/local/gfortran/bin /Users/minsunpark/abin /Users/minsunpark/abin /Users/minsunpark/abin /Users/minsunpark/abin )
set filec
set autolist
set nobeep
alias ls ls -G
alias ll ls -lG
alias ltr ls -lGtr
if ( 0 ) then
setenv R_LIBS /Users/minsunpark/sw/R-4.3.0
if ( arm64 == x86_64 ) then
set package = macos_13_ARM_clang
endif
build_afni.py -build_root /Users/minsunpark/afni_build -package macos_13_ARM_clang

-- current AFNI: AFNI_24.1.08, anyos_text, May 02 2024
-- cleaning old build root dir, /Users/minsunpark/afni_build
-- backing up dir build_src
-- preparing build_root dir, /Users/minsunpark/afni_build
-- have default git tag LAST_TAG, will checkout AFNI_24.1.09
-- checking out git tag AFNI_24.1.09
-- using repo branch (detached), tag AFNI_24.1.09
-- 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
-- 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/minsunpark
       tail -f /Users/minsunpark/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/minsunpark/afni_build/build_src/log_make.txt
** error: tail from log_make.txt:
   --------------------------------------------------
   echo '#define AFNI_VERSION_PLATFORM "'macos_13_ARM_clang'"'              \
   >> AFNI_version.h ;
   ( cd niml/ ; make all 'CC=/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  ' ; /bin/mv -f *.o .. ; )
   make[1]: Entering directory '/Users/minsunpark/afni_build/build_src/niml'
   /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   -I../f2c -c niml_b64.c
   make[1]: /opt/homebrew/bin/gcc-13: No such file or directory
   make[1]: *** [Makefile:4: niml_b64.o] Error 127
   make[1]: Leaving directory '/Users/minsunpark/afni_build/build_src/niml'
   mv: rename *.o to ../*.o: No such file or directory
   make: *** [Makefile.INCLUDE:3320: niml_b64.o] Error 1
   --------------------------------------------------


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

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

rehash
setenv R_LIBS /Users/minsunpark/sw/R-4.3.0
echo export R_LIBS=/Users/minsunpark/sw/R-4.3.0
echo export R_LIBS=/Users/minsunpark/sw/R-4.3.0
echo setenv R_LIBS /Users/minsunpark/sw/R-4.3.0
mkdir -p /Users/minsunpark/sw/R-4.3.0
rPkgsInstall -pkgs ALL
tee out.rPkgsInstall.txt

oo Warning: 
   Failed to load R_io.so with this error message:

dyn.load(ll)에서 다음과 같은 에러가 발생했습니다:
  공유된 객체 '/Users/minsunpark/abin/R_io.so'를 로드 할 수 없습니다:
  dlopen(/Users/minsunpark/abin/R_io.so, 0x0006): tried: '/Users/minsunpark/abin/R_io.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/minsunpark/abin/R_io.so' (no such file), '/Users/minsunpark/abin/R_io.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
호출: source ... withVisible -> eval -> eval -> set_R_io -> dyn.load
실행이 정지되었습니다

Also,
After getting the error, I tried the example code using the chauffeur_afni one more, and I got new error message:

++ My command:
   @chauffeur_afni -ulay anat+orig.HEAD -prefix QC/anat_test -set_xhairs MULTI -montx 3 -monty 3 -label_mode 1 -label_size 4

++ Using AFNI ver : AFNI_24.0.06
++ chauffeur ver  : 6.7
\n------------------ start of optionizing ------------------\n
++ Found input file:   anat+orig.HEAD
+* Noting: you did NOT provide an overlay, and yet
           you did NOT turn off the overlay with '-olay_off'
       --> so I assume you just want to view the underlay.
++ Using blowup factor: 2
++ Using opacity:  6
++ Making temporary work directory to copy vis files: QC/__tmp_chauf_H5VkL8gzlam
++ Converted 0 to labels
++ Final subbrick indices: -1 -1 -1
++ Copy ulay to visualize (volumetric) within user's range:
++ Ulay to be visualized within user range:
  [0%, 98%] -> [0.000000, 1367.000000]
++ 3dcalc: AFNI version=AFNI_24.0.06 (Feb  8 2024) [64-bit]
++ Authored by: A cast of thousands
++ Output dataset ./QC/__tmp_chauf_H5VkL8gzlam/tmp_ulay.nii
++ No overlay viewing
++ Dimensions (xyzt): 256 256 175 1
++ (initial) Slice spacing ordered (x,y,z) is:  19 28 28
++ 3dmaskdump: AFNI version=AFNI_24.0.06 (Feb  8 2024) [64-bit]
++ Executing 3dcalc()
 argv[0]=3dcalc argv[1]=-a argv[2]=anat+orig.HEAD[0] argv[3]=-expr argv[4]=a argv[5]=-byte argv[6]=-session argv[7]=/var/folders/5t/dxm15g9d0b98vcv5xy3l5mp80000gn/T/ argv[8]=-prefix argv[9]=3dcalc_AFN_xIp0dWVCLjF8o--YBLGIqQ argv[10]=-verbose
++ 3dcalc: AFNI version=AFNI_24.0.06 (Feb  8 2024) [64-bit]
++ Authored by: A cast of thousands
++ Computing sub-brick 0
++ Scaling output to type byte brick(s)
++ Sub-brick 0 scale factor = 0.062029
++ Computing output statistics
++ Output dataset /var/folders/5t/dxm15g9d0b98vcv5xy3l5mp80000gn/T/3dcalc_AFN_xIp0dWVCLjF8o--YBLGIqQ+orig.BRIK
++ 11468800 voxels in the entire dataset (no mask)
++ 1 voxels in the boxes and/or balls
++ Using only the boxes+balls mask
++ Will have: SET_IJK 128 127 86
\n------------------- end of optionizing -------------------\n
count_afni: Command not found.
count_afni: Command not found.
 -- trying to start Xvfb : 
[1] 5789
Bad display name: 
use: X [:<display>] [option]
-a #                   default pointer acceleration (factor)
-ac                    disable access control restrictions
-audit int             set audit trail level
-auth file             select authorization file
-br                    create root window with black background
+bs                    enable any backing store support
-bs                    disable any backing store support
-c                     turns off key-click
c #                    key-click volume (0-100)
-cc int                default color visual class
-nocursor              disable the cursor
-core                  generate core dump on fatal error
-displayfd fd          file descriptor to write display number to when ready to connect
-dpi int               screen resolution in dots per inch
-dpms                  disables VESA DPMS monitor control
-deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs
-f #                   bell base (0-100)
-fakescreenfps #       fake screen default fps (1-600)
-fp string             default font path
-help                  prints message with these options
+iglx                  Allow creating indirect GLX contexts
-iglx                  Prohibit creating indirect GLX contexts (default)
-I                     ignore all remaining arguments
-ld int                limit data space to N Kb
-lf int                limit number of open files to N
-ls int                limit stack space to N Kb
-nolock                disable the locking mechanism
-maxclients n          set maximum number of clients (power of two)
-nolisten string       don't listen on protocol
-listen string         listen on protocol
-noreset               don't reset after last client exists
-background [none]     create root window with no background
-reset                 reset after last client exists
-p #                   screen-saver pattern duration (minutes)
-pn                    accept failure to listen on all ports
-nopn                  reject failure to listen on all ports
-r                     turns off auto-repeat
r                      turns on auto-repeat 
-render [default|mono|gray|color] set render color alloc policy
-retro                 start with classic stipple and cursor
-s #                   screen-saver timeout (minutes)
-seat string           seat to run on
-t #                   default pointer threshold (pixels/t)
-terminate [delay]     terminate at server reset (optional delay in sec)
-tst                   disable testing extensions
ttyxx                  server started from init on /dev/ttyxx
v                      video blanking for screen-saver
-v                     screen-saver without video blanking
-wr                    create root window with white background
-maxbigreqsize         set maximal bigrequest size 
+xinerama              Enable XINERAMA extension
-xinerama              Disable XINERAMA extension
-dumbSched             Disable smart scheduling and threaded input, enable old behavior
-schedInterval int     Set scheduler interval in msec
-sigstop               Enable SIGSTOP based startup
+extension name        Enable extension
-extension name        Disable extension
 Only the following extensions can be run-time enabled/disabled:
	Generic Event Extension
	MIT-SHM
	XTEST
	XINERAMA
	XFIXES
	RENDER
	RANDR
	COMPOSITE
	DAMAGE
	MIT-SCREEN-SAVER
	DOUBLE-BUFFER
	RECORD
	DPMS
	X-Resource
	XVideo
	XVideo-MotionCompensation
	GLX
-query host-name       contact named host for XDMCP
-broadcast             broadcast for XDMCP
-multicast [addr [hops]] IPv6 multicast for XDMCP
-indirect host-name    contact named host for indirect XDMCP
-port port-num         UDP port number to send messages to
-from local-address    specify the local address to connect from
-once                  Terminate server after one session
-class display-class   specify display class to send in manage
-cookie xdm-auth-bits  specify the magic cookie for XDMCP
-displayID display-id  manufacturer display ID for request
[+-]accessx [ timeout [ timeout_mask [ feedback [ options_mask] ] ] ]
                       enable/disable accessx key sequences
-ardelay               set XKB autorepeat delay
-arinterval            set XKB autorepeat interval
-screen scrn WxHxD     set screen's width, height, depth
-pixdepths list-of-int support given pixmap depths
+/-render		   turn on/off RENDER extension support(default on)
-linebias n            adjust thin line pixelization
-blackpixel n          pixel value for black
-whitepixel n          pixel value for white
-fbdir directory       put framebuffers in mmap'ed files in directory
-shmem                 put framebuffers in shared memory
(EE) 
Fatal server error:
(EE) Bad display name, exiting: 
(EE) 
[1]  + Exit 1                        Xvfb : -screen 0 1024x768x24
count_afni: Command not found.
 -- trying to start Xvfb : 
[1] 5794
Bad display name: 
use: X [:<display>] [option]

Bad display name error is going on and on.

Sorry for the long error message again!
I really don't know what's happening to my mac :smiling_face_with_tear:

MP

Hi again,

One update is here related to the error message for @chauffeur_afni. There are still errors but the error contents has been changed like this:

++ My command:
   @chauffeur_afni -ulay anat+orig.HEAD -prefix QC/ca000_anat_def -set_xhairs MULTI -montx 3 -monty 3 -label_mode 1 -label_size 4

++ Using AFNI ver : AFNI_24.1.09
++ chauffeur ver  : 6.7
\n------------------ start of optionizing ------------------\n
++ Found input file:   anat+orig.HEAD
+* Noting: you did NOT provide an overlay, and yet
           you did NOT turn off the overlay with '-olay_off'
       --> so I assume you just want to view the underlay.
++ Using blowup factor: 2
++ Using opacity:  6
++ Making temporary work directory to copy vis files: QC/__tmp_chauf_oluYmRdhaW7
++ Converted 0 to labels
++ Final subbrick indices: -1 -1 -1
++ Copy ulay to visualize (volumetric) within user's range:
++ Ulay to be visualized within user range:
  [0%, 98%] -> [0.000000, 1367.000000]
++ 3dcalc: AFNI version=AFNI_24.1.09 (May  9 2024) [64-bit]
++ Authored by: A cast of thousands
++ Output dataset ./QC/__tmp_chauf_oluYmRdhaW7/tmp_ulay.nii
++ No overlay viewing
Illegal variable name.
++ Dimensions (xyzt): 256 256 175 1
++ (initial) Slice spacing ordered (x,y,z) is:  19 28 28
Illegal variable name.
Illegal variable name.
++ 3dmaskdump: AFNI version=AFNI_24.1.09 (May  9 2024) [64-bit]
++ Executing 3dcalc()
 argv[0]=3dcalc argv[1]=-a argv[2]=anat+orig.HEAD[0] argv[3]=-expr argv[4]=a argv[5]=-byte argv[6]=-session argv[7]=/var/folders/5t/dxm15g9d0b98vcv5xy3l5mp80000gn/T/ argv[8]=-prefix argv[9]=3dcalc_AFN_c1rnfo7YlOheFtUMxqWY0g argv[10]=-verbose
++ 3dcalc: AFNI version=AFNI_24.1.09 (May  9 2024) [64-bit]
++ Authored by: A cast of thousands
++ Computing sub-brick 0
++ Scaling output to type byte brick(s)
++ Sub-brick 0 scale factor = 0.062029
++ Computing output statistics
++ Output dataset /var/folders/5t/dxm15g9d0b98vcv5xy3l5mp80000gn/T/3dcalc_AFN_c1rnfo7YlOheFtUMxqWY0g+orig.BRIK
++ 11468800 voxels in the entire dataset (no mask)
++ 1 voxels in the boxes and/or balls
++ Using only the boxes+balls mask
++ Will have: SET_IJK 128 127 86
\n------------------- end of optionizing -------------------\n
 -- trying to start Xvfb :920 
[1] 1782

+++ Command Echo:
   afni -q -no1D -noplugins -no_detach -com SWITCH_UNDERLAY tmp_ulay.nii -com SWITCH_OVERLAY  tmp_ulay.nii -com SEE_OVERLAY     - -com OPEN_WINDOW sagittalimage opacity=6 mont=3x3:19:0:black crop=0:0,0:0  -com OPEN_WINDOW coronalimage  opacity=6 mont=3x3:28:0:black crop=0:0,0:0  -com OPEN_WINDOW axialimage    opacity=6 mont=3x3:28:0:black crop=0:0,0:0  -com SET_PBAR_ALL    -99 1 Plasma -com DO_NOTHING -com SET_SUBBRICKS   -1 -1 -1 -com SET_ULAY_RANGE A.all 0.000000 1367.000000 -com SET_FUNC_RANGE  0 -com SET_THRESHNEW   0 * -com SET_FUNC_ALPHA  No -com SET_FUNC_BOXED  No -com SET_FUNC_RESAM  NN.NN -com SET_XHAIRS      MULTI -com SET_XHAIR_GAP   -1 -com SET_IJK 128 127 86 -com SAVE_PNG axialimage    QC/ca000_anat_def.axi blowup=2 -com SAVE_PNG sagittalimage QC/ca000_anat_def.sag blowup=2 -com SAVE_PNG coronalimage  QC/ca000_anat_def.cor blowup=2 -com QUITT QC/__tmp_chauf_oluYmRdhaW7 


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ If you are using XQuartz 2.7.10 (or later), and AFNI crashes when
 + opening windows, or you cannot type text into AFNI popup windows,
 + you might need to set an environment variable to solve this problem:
 +   setenv DYLD_LIBRARY_PATH /opt/X11/lib/flat_namespace    # tcsh
 +   export DYLD_LIBRARY_PATH=/opt/X11/lib/flat_namespace    # bash
 + This command is best put in your startup ~/.cshrc file, so that
 + it will be invoked for every (t)csh shell you open (mutatis mutandis
 + for the bash shell, of course).
 +
 + If things are OK and you want to avoid having this warning message
 + pollute your terminal, use this:
 +   setenv AFNI_SKIP_DYLD_WARNING YES                       # tcsh
 +   export AFNI_SKIP_DYLD_WARNING=YES                       # bash

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Warning: Widget must be a VendorShell.

Fatal Signal 11 (SIGSEGV) received
Last STATUS: creating top_form
     AFNI_make_widgets
    new_AFNI_controller
   MAIN_workprocess
  AFNI:main
 Bottom of Debug Stack
** AFNI version = AFNI_24.1.09  Compile date = May  9 2024
** [[Precompiled binary macos_10.12_local: May  9 2024]]
** Program Death **
** If you report this crash to the AFNI message board,
** please copy the error messages EXACTLY, and give
** the command line you used to run the program, and
** any other information needed to repeat the problem.
** You may later be asked to upload data to help debug.
** Crash log is appended to file /Users/minsunpark/.afni.crashlog
\n+* Removing temporary image directory 'QC/__tmp_chauf_oluYmRdhaW7'.\n
[1]  + Done                          Xvfb :920 -screen 0 1024x768x24

++ DONE (good exit)
   see: QC/ca000_anat_def*

Thanks for your supports.
MP