AFNI Installation Unsuccessful (Mac M1)

-------------------------------- general ---------------------------------
architecture:         64bit 
cpu type:             i386
system:               Darwin
release:              23.2.0
version:              Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T8103
distribution:         10.16
number of CPUs:       8
apparent login shell: bash
shell RC file:        .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           :
                     : 
AFNI_version.txt     : AFNI_24.0.09, anyos_text, Feb 28 2024, local
which python         : /Users/shubhangibutta/.venv/bin/python
python version       : 3.9.6
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   (/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9)
    python2 : 0 
    python3 : 2 
      /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9
      /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 : /Users/shubhangibutta/.venv/lib/python3.9/site-packages/matplotlib/pyplot.py
   matplotlib version : 3.8.3

** 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

-- python binaries under /usr/local/bin:
    /usr/local/bin/python3 (sym link to /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9)
    /usr/local/bin/python3.9 (sym link to /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9)

-------------------------------- env vars --------------------------------
PATH                       = /Users/shubhangibutta/abin:/Users/shubhangibutta/.venv/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:/Users/shubhangibutta/.local/bin:/Users/shubhangibutta/.local/bin:/Users/shubhangibutta/.local/bin

PYTHONPATH (sub-shell) = 
R_LIBS (sub-shell) = /Users/shubhangibutta/sw/R-4.3.1
LD_LIBRARY_PATH (sub-shell) = 
DYLD_LIBRARY_PATH (sub-shell) = 
DYLD_FALLBACK_LIBRARY_PATH (sub-shell) = 
CONDA_SHLVL (sub-shell) = 
CONDA_DEFAULT_ENV (sub-shell) = 

----------------------------- eval dot files -----------------------------

----------- AFNI $HOME files -----------

    .afnirc                   : found
    .sumarc                   : missing
    .afni/help/all_progs.COMP : missing

--------- 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)
   
   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    : found TT_N27+tlrc  under .

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


** no package manager found (okay for bootcamp)

=========================  summary, please fix:  =========================
*  just be aware: login shell 'bash', but our code examples use 'tcsh'
*  shell bash: consider sourcing (non-login) .bashrc from (login) .bash_profile
*  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)

Something peculiar is that your cpu type is listed as i386 which is unexpected given that later the system lists a ARM64 kernel. Do you happen to have the terminal set to run in Rosetta emulation?

Hi, so, I looked up the way to check if my terminal is set to run in Rosetta emulation and found 2 ways. This is what I did:

  1. I ran 'sysctl -n sysctl.proc_translated' command and it returned 0.
  2. I ran 'arch' command and it returned 'arm64'.

According to my reference, both of them are supposed to mean that it's not running in Rosetta? So, I'm not sure what's going wrong.

Also, if it helps- I'm doing all this by enabling (.venv) because without it, I was getting several more errors including 'externally managed environment', and so it was not allowing the downloads correctly.

Hmmm, I wonder if your Python install is the i386 version. Did you install Python through home-brew or anaconda? The output of the following should help - feel free to swap out pipenv with whatever other venv program you used to create the environment:

which pipenv
file `which pipenv`

Regardless: I would recommend installing Anaconda (or MiniConda) because condo environments have some nice user-friendly features that are less convenient in virtual environments.

So the above code gave me the following output:

Usage: file [-bcCdEhikLlNnprsSvzZ0] [--extension] [--mime-encoding]
            [--mime-type] [-e <testname>] [-F <separator>]  [-f <namefile>]
            [-m <magicfiles>] [-M magicfiles] [-P <parameter=value>] [--exclude-quiet]
            <file> ...
       file -C [-m <magicfiles>]
       file [--help]
Try `file --help' for more information.

So, do you suggest I uninstall whatever AFNI installations have happened (because I can see many files in my abin), then install Anaconda and then try installing AFNI again?

Sorry, I'm quite new to this.

Yes that would be my recommendation. Use anaconda/miniconda instead of venv. Let us know if you get stuck.

Hi, I uninstalled, installed miniconda, reinstalled afni and again, got this.

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

--------------------- AFNI and related program tests ---------------------
which afni           :
                     : 
AFNI_version.txt     : AFNI_24.0.09, anyos_text, Feb 28 2024, local
which python         : /opt/miniconda3/bin/python
python version       : 3.12.1
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/miniconda3/bin/python3.12)
    python2 : 0 
    python3 : 3 
      /opt/miniconda3/bin/python3.12
      /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9
      /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      : FAILURE
        /bin/sh: uber_subject.py: command not found
    3dMVM                : FAILURE
        /bin/sh: 3dMVM: command not found

have failures, testing programs under implied /Users/shubhangibutta/Downloads/abin...
    afni                 : FAILURE
        /bin/sh: /Users/shubhangibutta/Downloads/abin/afni: No such file or directory
    suma                 : FAILURE
        /bin/sh: /Users/shubhangibutta/Downloads/abin/suma: No such file or directory
    3dSkullStrip         : FAILURE
        /bin/sh: /Users/shubhangibutta/Downloads/abin/3dSkullStrip: No such file or directory
    3dAllineate          : FAILURE
        /bin/sh: /Users/shubhangibutta/Downloads/abin/3dAllineate: No such file or directory
    3dRSFC               : FAILURE
        /bin/sh: /Users/shubhangibutta/Downloads/abin/3dRSFC: No such file or directory
    SurfMesh             : FAILURE
        /bin/sh: /Users/shubhangibutta/Downloads/abin/SurfMesh: No such file or directory
    3dClustSim           : FAILURE
        /bin/sh: /Users/shubhangibutta/Downloads/abin/3dClustSim: No such file or directory
    uber_subject.py      : success
    3dMVM                : success

------------------------ 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
        /bin/sh: rPkgsInstall: command not found

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

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

++ module loaded: matplotlib.pyplot
   module file : /opt/miniconda3/lib/python3.12/site-packages/matplotlib/pyplot.py
   matplotlib version : 3.8.3

** 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

-- python binaries under /usr/local/bin:
    /usr/local/bin/python3 (sym link to /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9)
    /usr/local/bin/python3.9 (sym link to /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9)

-------------------------------- env vars --------------------------------
PATH                       = /Users/shubhangibutta/abin:/opt/miniconda3/bin:/opt/miniconda3/condabin:/opt/local/bin:/opt/local/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:/Users/shubhangibutta/.local/bin:/Users/shubhangibutta/.local/bin:/Users/shubhangibutta/.local/bin

PYTHONPATH                 = 
R_LIBS                     = 
LD_LIBRARY_PATH            = 
DYLD_LIBRARY_PATH (sub-shell) = 
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 ----------

   init_user_dotfiles.py: Command not found.
------------------------------ 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 port           : /opt/local/bin/port
port version         : Version: 2.9.1


=========================  summary, please fix:  =========================
*  just be aware: login shell 'bash', but our code examples use 'tcsh'
*  shell bash: consider sourcing (non-login) .bashrc from (login) .bash_profile
*  missing program: afni
*  failure under initial "AFNI and related program tests"
*  AFNI programs show FAILURE
*  consider adding /Users/shubhangibutta/Downloads/abin to your PATH
*  missing R packages (see rPkgsInstall)
*  please run: "suma -update_env" for .sumarc
*  please run: apsearch -update_all_afni_help
*  failure running init_user_dotfiles.py -test
*  insufficient data for AFNI bootcamp
   (see "Prepare for Bootcamp" on install pages)
*  possibly missing atlases

Hello,

Looks like that did succeed in fixing the cpu type weirdness.

Are you using build_afni.py to install using these instructions?

Can you post the output of those steps?

Hello,

Yes, I am using these steps.

Posting the step-wise outputs below:

Command: curl -O https://raw.githubusercontent.com/afni/afni/master/src/other_builds/OS_notes.macos_12_ARM_a_admin_pt1.zsh

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2300  100  2300    0     0   7530      0 --:--:-- --:--:-- --:--:--  7540

Command: curl -O https://raw.githubusercontent.com/afni/afni/master/src/other_builds/OS_notes.macos_12_ARM_a_admin_pt2.zsh

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1123  100  1123    0     0   5024      0 --:--:-- --:--:-- --:--:--  5035

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

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   360  100   360    0     0   1640      0 --:--:-- --:--:-- --:--:--  1636
Command: zsh OS_notes.macos_12_ARM_a_admin_pt1.zsh

++ Beginning homebrew installation on this ARM system
==> Checking for `sudo` access (which may request your password)...
Password:
==> This script will install:
/opt/homebrew/bin/brew
/opt/homebrew/share/doc/homebrew
/opt/homebrew/share/man/man1/brew.1
/opt/homebrew/share/zsh/site-functions/_brew
/opt/homebrew/etc/bash_completion.d/brew
/opt/homebrew

Press RETURN/ENTER to continue or any other key to abort:
==> /usr/bin/sudo /usr/sbin/chown -R shubhangibutta:admin /opt/homebrew
==> Downloading and installing Homebrew...
remote: Enumerating objects: 34, done.
remote: Counting objects: 100% (34/34), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 34 (delta 25), reused 33 (delta 25), pack-reused 0
Unpacking objects: 100% (34/34), 37.58 KiB | 962.00 KiB/s, done.
From https://github.com/Homebrew/brew
 + c6c5fcdf9...b5c9651b4 build-cask-internal-json-v3 -> origin/build-cask-internal-json-v3  (forced update)
 + 178b930bc...ff5dd3330 cask_installed_version_plist -> origin/cask_installed_version_plist  (forced update)
 + 5515248be...7961069f6 memoize-installed-tap-loading -> origin/memoize-installed-tap-loading  (forced update)
HEAD is now at d55fa09d1 Merge pull request #16827 from Homebrew/dependabot/bundler/Library/Homebrew/parallel_tests-4.5.2
Installing from the API is now the default behaviour!
You can save space and time by running:
  brew untap homebrew/core
Updated 1 tap (homebrew/core).
Warning: /opt/homebrew/bin is not in your PATH.
  Instructions on how to configure your shell for Homebrew
  can be found in the 'Next steps' section below.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
No analytics data has been sent yet (nor will any be during this install run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations

==> Next steps:
- Run these two commands in your terminal to add Homebrew to your PATH:
    (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/shubhangibutta/.bash_profile
    eval "$(/opt/homebrew/bin/brew shellenv)"
- Run brew help to get started
- Further documentation:
    https://docs.brew.sh

Warning: Cask python was renamed to homebrew/core/python.
Warning: Treating cmake as a formula. For the cask, use homebrew/cask/cmake
Warning: Cask gfortran was renamed to homebrew/core/gfortran.
Warning: python@3.12 3.12.2_1 is already installed and up-to-date.
To reinstall 3.12.2_1, run:
  brew reinstall python@3.12
Warning: netpbm 11.02.07 is already installed and up-to-date.
To reinstall 11.02.07, run:
  brew reinstall netpbm
Warning: cmake 3.28.3 is already installed and up-to-date.
To reinstall 3.28.3, run:
  brew reinstall cmake
Warning: gcc 13.2.0 is already installed and up-to-date.
To reinstall 13.2.0, run:
  brew reinstall gcc

== installing XQuartz (needs sudo)

Warning: Not upgrading xquartz, the latest version is already installed
Warning: libpng 1.6.43 is already installed and up-to-date.
To reinstall 1.6.43, run:
  brew reinstall libpng
Warning: jpeg 9f is already installed and up-to-date.
To reinstall 9f, run:
  brew reinstall jpeg
Warning: expat 2.6.1 is already installed and up-to-date.
To reinstall 2.6.1, run:
  brew reinstall expat
Warning: freetype 2.13.2 is already installed and up-to-date.
To reinstall 2.13.2, run:
  brew reinstall freetype
Warning: fontconfig 2.15.0 is already installed and up-to-date.
To reinstall 2.15.0, run:
  brew reinstall fontconfig
Warning: openmotif 2.3.8_2 is already installed and up-to-date.
To reinstall 2.3.8_2, run:
  brew reinstall openmotif
libomp  is already installed but outdated (so it will be upgraded).
Warning: gsl 2.7.1 is already installed and up-to-date.
To reinstall 2.7.1, run:
  brew reinstall gsl
Warning: glib 2.78.4 is already installed and up-to-date.
To reinstall 2.78.4, run:
  brew reinstall glib
Warning: pkg-config 0.29.2_3 is already installed and up-to-date.
To reinstall 0.29.2_3, run:
  brew reinstall pkg-config
Warning: gcc 13.2.0 is already installed and up-to-date.
To reinstall 13.2.0, run:
  brew reinstall gcc
Warning: libiconv 1.17 is already installed and up-to-date.
To reinstall 1.17, run:
  brew reinstall libiconv
Warning: autoconf 2.72 is already installed and up-to-date.
To reinstall 2.72, run:
  brew reinstall autoconf
Warning: libxt 1.3.0 is already installed and up-to-date.
To reinstall 1.3.0, run:
  brew reinstall libxt
Warning: mesa 24.0.2 is already installed and up-to-date.
To reinstall 24.0.2, run:
  brew reinstall mesa
Warning: mesa-glu 9.0.3 is already installed and up-to-date.
To reinstall 9.0.3, run:
  brew reinstall mesa-glu
Warning: libxpm 3.5.17 is already installed and up-to-date.
To reinstall 3.5.17, run:
  brew reinstall libxpm
==> Downloading https://ghcr.io/v2/homebrew/core/libomp/manifests/18.1.0
######################################################################### 100.0%
==> Fetching libomp
==> Downloading https://ghcr.io/v2/homebrew/core/libomp/blobs/sha256:94d6f69b98a
######################################################################### 100.0%
==> Pouring libomp--18.1.0.arm64_sonoma.bottle.tar.gz
==> Caveats
libomp is keg-only, which means it was not symlinked into /opt/homebrew,
because it can override GCC headers and result in broken builds.

For compilers to find libomp you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/libomp/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/libomp/include"
==> Summary
🍺  /opt/homebrew/Cellar/libomp/18.1.0: 8 files, 1.7MB
==> Running `brew cleanup libomp`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /opt/homebrew/Cellar/libomp/17.0.6... (7 files, 1.7MB)
Removing: /Users/shubhangibutta/Library/Caches/Homebrew/libomp--17.0.6... (566.7KB)
Requirement already satisfied: matplotlib in /opt/miniconda3/lib/python3.12/site-packages (3.8.3)
Requirement already satisfied: contourpy>=1.0.1 in /opt/miniconda3/lib/python3.12/site-packages (from matplotlib) (1.2.0)
Requirement already satisfied: cycler>=0.10 in /opt/miniconda3/lib/python3.12/site-packages (from matplotlib) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in /opt/miniconda3/lib/python3.12/site-packages (from matplotlib) (4.49.0)
Requirement already satisfied: kiwisolver>=1.3.1 in /opt/miniconda3/lib/python3.12/site-packages (from matplotlib) (1.4.5)
Requirement already satisfied: numpy<2,>=1.21 in /opt/miniconda3/lib/python3.12/site-packages (from matplotlib) (1.26.4)
Requirement already satisfied: packaging>=20.0 in /opt/miniconda3/lib/python3.12/site-packages (from matplotlib) (23.1)
Requirement already satisfied: pillow>=8 in /opt/miniconda3/lib/python3.12/site-packages (from matplotlib) (10.2.0)
Requirement already satisfied: pyparsing>=2.3.1 in /opt/miniconda3/lib/python3.12/site-packages (from matplotlib) (3.1.1)
Requirement already satisfied: python-dateutil>=2.7 in /opt/miniconda3/lib/python3.12/site-packages (from matplotlib) (2.9.0.post0)
Requirement already satisfied: six>=1.5 in /opt/miniconda3/lib/python3.12/site-packages (from python-dateutil>=2.7->matplotlib) (1.16.0)
Command: zsh OS_notes.macos_12_ARM_a_admin_pt2.zsh

++ Beginning R installation on this ARM system
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 90.1M  100 90.1M    0     0  10.3M      0  0:00:08  0:00:08 --:--:-- 10.7M
Password:
installer: Package name is R 4.3.1 for macOS (ARM64)
installer: Upgrading at base path /
installer: The upgrade was successful.

  ... please reboot ...

Then I rebooted my system.

Command: 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  3521  100  3521    0     0  14727      0 --:--:-- --:--:-- --:--:-- 14794
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
head -n 1
cut -d   -f 3
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
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  81842      0 --:--:-- --:--:-- --:--:-- 81939
tcsh @update.afni.binaries -no_recur -package anyos_text_atlas -bindir /Users/shubhangibutta/abin
-- running @update.afni.binaries version 3.24, December 7, 2023
-- no current AFNI package found in path...
-- 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/shubhangibutta/abin...
++ creating install dir
/Users/shubhangibutta/abin

++ 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     93      0 --:--:-- --:--:-- --:--:--    93

++ update needed, installing...

++ downloading full package: curl -O -f anyos_text_atlas.tgz ...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 65.7M  100 65.7M    0     0  5594k      0  0:00:12  0:00:12 --:--:-- 4065k
++ extracting package anyos_text_atlas.tgz...
-- nothing to back up or sync
++ installing new binaries...
done, yay (binaries are under /Users/shubhangibutta/abin)
/Users/shubhangibutta/abin/init_user_dotfiles.py -shell_list bash zsh tcsh -do_updates path apsearch -dir_bin /Users/shubhangibutta/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
setenv PATH /opt/miniconda3/bin:/opt/miniconda3/condabin:/opt/local/bin:/opt/local/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:/Users/shubhangibutta/.local/bin:/Users/shubhangibutta/.local/bin:/Users/shubhangibutta/.local/bin:/Users/shubhangibutta/abin:/Users/shubhangibutta/abin
if ( 0 ) then
setenv R_LIBS /Users/shubhangibutta/sw/R-4.3.1
setenv R_LIBS /Users/shubhangibutta/sw/R-4.3.1
if ( arm64 == x86_64 ) then
set package = macos_13_ARM_clang
endif
build_afni.py -build_root /Users/shubhangibutta/afni_build -package macos_13_ARM_clang

-- current AFNI: AFNI_24.0.10, anyos_text, Mar 05 2024
-- preparing build_root dir, /Users/shubhangibutta/afni_build
-- creating build_root dir, /Users/shubhangibutta/afni_build
-- running 'git clone' on afni repo ...
   (please be patient)
-- have default git tag LAST_TAG, will checkout AFNI_24.0.10
-- checking out git tag AFNI_24.0.10
-- using repo branch (detached), tag AFNI_24.0.10
-- 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_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/shubhangibutta/Downloads
       tail -f /Users/shubhangibutta/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/shubhangibutta/afni_build/build_src/log_make.txt
** error: tail from log_make.txt:
   --------------------------------------------------
   *** GLIB 1.2.8 or better is required. The latest version of GLIB
   *** is always available from ftp://ftp.gtk.org/.
   make[2]: *** No rule to make target `clean'.  Stop.
   make[2]: *** No targets specified and no makefile found.  Stop.
   error: /Library/Developer/CommandLineTools/usr/bin/ranlib: can't open file: src/.libs/libgts.a (No such file or directory)
   cp: src/.libs/libgts.a: No such file or directory
   make[1]: *** [libgts.a] Error 1
   cp: SUMA/libgts.a: No such file or directory
   cp: SUMA/libgts.a: No such file or directory
   make: *** [libgts.a] Error 1
   --------------------------------------------------

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

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

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

rehash
setenv R_LIBS /Users/shubhangibutta/sw/R-4.3.1
echo export R_LIBS=/Users/shubhangibutta/sw/R-4.3.1
echo export R_LIBS=/Users/shubhangibutta/sw/R-4.3.1
echo setenv R_LIBS /Users/shubhangibutta/sw/R-4.3.1
mkdir -p /Users/shubhangibutta/sw/R-4.3.1
rPkgsInstall -pkgs ALL
tee out.rPkgsInstall.txt
setenv: Too many arguments.

And after that, when I run the 'afni_system_check.py -check_all' command, it gives me the same output as I posted in my previous thread.

Yes it looks like you're getting a build error so not surprising that things aren't working:

The catch seems to be with glib. Can you post the entire contents of: /Users/shubhangibutta/afni_build/build_src/log_make.txt

Hello,

Is there a way I can send the file to you? This page hangs if I try to copy and paste the contents of the file.

Sure you can click on my name and click "send message".

Or upload it to any file share and post it.

Hello, wasn't able to see the 'send message' option.

Please check the file here on this link: https://drive.google.com/file/d/1-9MYE_8RJ6cVvuVnbjYAXApczZeegE6m/view?usp=sharing

This is peculiar for sure! It looks like glib is being detected as old when building SUMA parts but was fine earlier in the process. Can you try to reinstall glib and building again?

brew reinstall glib
build_afni.py -build_root $HOME/afni_build -package macos_13_ARM_clang

Pinging @rickr and @dglen to see if they have further ideas.

This seems like a problem with pkg-config. This line needs to succeed to be able to built the libgts library for suma programs.

pkg-config --cflags --libs glib-2.0 
-I/opt/homebrew/Cellar/glib/2.78.4/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.78.4/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre2/10.42/include -L/opt/homebrew/Cellar/glib/2.78.4/lib -L/opt/homebrew/opt/gettext/lib -lglib-2.0 -lintl

This should be installed with homebrew.

which pkg-config
/opt/homebrew/bin/pkg-config

pkg-config --version
0.29.2

Try doing a reinstall of pkg-config. If you have an older version of pkg-config on your system earlier in your path, that might block the building of this part. pkg-config is provided in FSL distributions (at least on my system), so that might be a culprit. You can check with which pkg-config. To install pkg-config with homebrew,

brew reinstall pkg-config
1 Like

Hello @pmolfese @dglen

The issue is finally resolved. I think it was all fine. As it turned out, the problem was with my shell.

But on the positive side, it's working fine now. Thank you so much for all your help. Really appreciate it.

Ensure your .venv has all the necessary dependencies and that your Python version matches your system's architecture (ARM64). If you're facing 'externally managed environment' errors, it could be a conflict with your package manager. Double-check it's aligned with ARM64 settings. Hope this nudges you in the right direction! :+1:

Hope this helps someone save time with Mac install...
Spent the day trying to install AFNI on MacBook Pro, Apple M1-Pro, Sonoma 14.4.
In the end it was a problem with the .tcshrc added by teh afni scripts.
The offending command : setenv PATH ${PATH}:/Users/callaci/abin
generates an error "setenv: Too Many arguments"
The replacement that is working now: set PATH = ( $PATH /Users/callaci/abin)

Hmmm, I don't see anything odd there, except in the replacement command. It suggests that there are other problems with how the path is being set. Note that generally $PATH is set via "setenv", while $path is set via "set". The working replacement is setting the environment variable PATH via the shell variable path syntax.

If you would like to, perhaps it would be good to send me any .cshrc and/or .tcshrc files (via a private message would be fine), and I will see what might be going on. You could also use

afni_system_check.py -dot_file_pack my_dotfiles

if you would like to mail me all of them. If so, let me know and I will send you an address (via PM).

  • rick

Hello everyone, this issue had gotten fixed for me a while ago (check the 15th reply on the thread). So this thread can be closed now if the need be.