Compilation on M1 Mac

Hello,

I recently tried to recompiled afni on my M1 computer to prepare for the next bootcamp; However, it seems some of the program where not able to compile:

tail -f /Users/edelaire1/afni_build/build_src/log_test.txt shows me:

failed progs: 1dRplot 3dICC 3dISC 3dLME 3dLMEr 3dMEMA 3dMEPFM 3dMSS 3dMVM 3dPFM 3dRprogDemo 3dSignatures ExamineXmat MBA PTA RBA TRR

Also, interestingly, if I run 'afni_system_check.py -check_all' from bash; I get some error:

-------------------------------- general ---------------------------------
architecture:         64bit 
cpu type:             i386
system:               Darwin
release:              23.0.0
version:              Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:34 PDT 2023; root:xnu-10002.1.13~1/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           : /Users/edelaire1/abin/afni
afni version         : Precompiled binary macos_13_ARM_clang: Mar 22 2024 
                     : AFNI_24.0.16 'Caracalla'
AFNI_version.txt     : AFNI_24.0.16, macos_13_ARM_clang, Mar 22 2024, build
which python         : /Users/edelaire1/miniconda3/bin/python
python version       : 3.7.6
which R              : /usr/local/bin/R
R version            : R version 4.3.3 (aarch64-apple-darwin20)

instances of various programs found in PATH:
    afni    : 1   (/Users/edelaire1/abin/afni)
    R       : 1   (/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/bin/R)
    python  : 1   (/Users/edelaire1/miniconda3/bin/python3.7)
    python2 : 0 
    python3 : 4 
      /Library/Frameworks/Python.framework/Versions/3.12/bin/python3.12
      /opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/bin/python3.12
      /Users/edelaire1/miniconda3/bin/python3.7
      /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
        Erreur dans library(data.table) : 
          aucun package nommĂ© ‘data.table’ n'est trouvĂ©
        Appels : source ... suppressPackageStartupMessages -> withCallingHandlers -> library
        ExĂ©cution arrĂȘtĂ©e

------------------------ 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
        
        oo Warning: 
           These packages are not installed on the computer: afex!
        These packages are not installed on the computer: phia!
        These packages are not installed on the computer: snow!
        These packages are not installed on the computer: lme4!
        These packages are not installed on the computer: lmerTest!
        These packages are not installed on the computer: gamm4!
        These packages are not installed on the computer: data.table!
        These packages are not installed on the computer: paran!
        These packages are not installed on the computer: psych!
        These packages are not installed on the computer: brms!
        These packages are not installed on the computer: corrplot!
        These packages are not installed on the computer: metafor!
        

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

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

++ module loaded: matplotlib.pyplot
   module file : /Users/edelaire1/miniconda3/lib/python3.7/site-packages/matplotlib/pyplot.py
   matplotlib version : 3.4.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.12/bin/python3.12)
    /usr/local/bin/python3.8 (sym link to /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8)

-------------------------------- env vars --------------------------------
PATH                       = /Library/Frameworks/Python.framework/Versions/3.12/bin:/Users/edelaire1/.local/bin:/Users/edelaire1/VulkanSDK/1.3.275.0/macOS/lib/:/Applications/MATLAB_R2023b.app/bin:/Applications/BrainSuite21a/bdp/:/Applications/BrainSuite21a/bin/:/Users/edelaire1/fsl/share/fsl/bin:/Users/edelaire1/fsl/share/fsl/bin:/Applications/freesurfer/7.3.2/bin:/Applications/freesurfer/7.3.2/fsfast/bin:/Applications/freesurfer/7.3.2/mni/bin:/Users/edelaire1/.local/bin/:/opt/homebrew/opt/ruby@3.0/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/edelaire1/miniconda3/bin:/Users/edelaire1/miniconda3/condabin:/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:/Users/edelaire1/abin

PYTHONPATH (sub-shell) = 
R_LIBS (sub-shell) = /Users/edelaire1/sw/R-4.3.3
LD_LIBRARY_PATH            = /Users/edelaire1/VulkanSDK/1.3.275.0/macOS/lib/:
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                   : found
    .afni/help/all_progs.COMP : found

--------- 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 /Users/edelaire1/abin

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

which brew           : /opt/homebrew/bin/brew
brew version         : Homebrew 4.2.14


=========================  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
*  AFNI programs show FAILURE
*  missing R packages (see rPkgsInstall)
*  insufficient data for AFNI bootcamp
   (see "Prepare for Bootcamp" on install pages)
*  consider installing gcc under homebrew
*  consider installing glib under homebrew

But they disappear if I switch to tcsh :


-------------------------------- general ---------------------------------
architecture:         64bit 
cpu type:             i386
system:               Darwin
release:              23.0.0
version:              Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:34 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T8103
distribution:         10.16
number of CPUs:       8
apparent login shell: bash  (current shell is csh)
shell RC file:        .tcshrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           : /Users/edelaire1/abin/afni
afni version         : Precompiled binary macos_13_ARM_clang: Mar 22 2024 
                     : AFNI_24.0.16 'Caracalla'
AFNI_version.txt     : AFNI_24.0.16, macos_13_ARM_clang, Mar 22 2024, build
which python         : /Users/edelaire1/miniconda3/bin/python
python version       : 3.7.6
which R              : /usr/local/bin/R
R version            : R version 4.3.3 (aarch64-apple-darwin20)

instances of various programs found in PATH:
    afni    : 1   (/Users/edelaire1/abin/afni)
    R       : 1   (/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/bin/R)
    python  : 1   (/Users/edelaire1/miniconda3/bin/python3.7)
    python2 : 0 
    python3 : 4 
      /Library/Frameworks/Python.framework/Versions/3.12/bin/python3.12
      /opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/bin/python3.12
      /Users/edelaire1/miniconda3/bin/python3.7
      /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                : 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 : success

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

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

++ module loaded: matplotlib.pyplot
   module file : /Users/edelaire1/miniconda3/lib/python3.7/site-packages/matplotlib/pyplot.py
   matplotlib version : 3.4.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.12/bin/python3.12)
    /usr/local/bin/python3.8 (sym link to /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8)

-------------------------------- env vars --------------------------------
PATH                       = /Library/Frameworks/Python.framework/Versions/3.12/bin:/Users/edelaire1/.local/bin:/Users/edelaire1/VulkanSDK/1.3.275.0/macOS/lib/:/Applications/MATLAB_R2023b.app/bin:/Applications/BrainSuite21a/bdp/:/Applications/BrainSuite21a/bin/:/Users/edelaire1/fsl/share/fsl/bin:/Users/edelaire1/fsl/share/fsl/bin:/Applications/freesurfer/7.3.2/bin:/Applications/freesurfer/7.3.2/fsfast/bin:/Applications/freesurfer/7.3.2/mni/bin:/Users/edelaire1/.local/bin/:/opt/homebrew/opt/ruby@3.0/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/edelaire1/miniconda3/bin:/Users/edelaire1/miniconda3/condabin:/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:/Users/edelaire1/abin:/Users/edelaire1/abin:/Users/edelaire1/abin

PYTHONPATH (sub-shell) = 
R_LIBS                     = /Users/edelaire1/sw/R-4.3.3
LD_LIBRARY_PATH            = /Users/edelaire1/VulkanSDK/1.3.275.0/macOS/lib/:
DYLD_LIBRARY_PATH (sub-shell) = /opt/X11/lib/flat_namespace:/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                   : found
    .afni/help/all_progs.COMP : found

--------- 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 /Users/edelaire1/abin

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

which brew           : /opt/homebrew/bin/brew
brew version         : Homebrew 4.2.14

-- consider installing gcc under homebrew
-- consider installing glib under homebrew

=========================  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
*  insufficient data for AFNI bootcamp
   (see "Prepare for Bootcamp" on install pages)

is there any issue with my installation ? the fact that the second afni check shows no error make me thing it's ok; but I want to be sure :)

Edouard

Hi, Eduouard-

There are a few things here:

  1. Your login shell is bash, which is fine. I think you just need to source your ~/.bashrc from your login ~/.bash_profile, which is suggested in the "please fix" at the bottom of the output.

    From the note at the bottom of the output, you might also want to source ~/.bashrc from ~/.bash_profile. To do this, first open the latter file in a text editor:

       open -t ~/.bash_profile &
    

    ... and then copy+paste the following into that file:

      source ~/.bashrc
    

    After that, if you open a new terminal, you shouldn't see that comment in the bottom section and I suspect your R will work.

  2. I see that you do not have the Flask and Flask-cors modules for Python. You are using conda, so you should be able to add it to your environment with:

         conda install conda-forge::flask
    conda install conda-forge::flask-cors
    
  3. You don't appear to have the Bootcamp data downloaded+unpacked. Can you please follow the steps here for that, namely:

    curl -O https://afni.nimh.nih.gov/pub/dist/edu/data/CD.tgz
    tar xvzf CD.tgz
    cd CD
    tcsh s2.cp.files . ~
    cd ..
    

Please let us know how that goes.

--pt

Thank you. it worked :slight_smile:

I think this is because I installed them in a different location. I ran :
tcsh s2.cp.files . /Volumes/CrucialX8/data/ to unpack the data. (I am not a huge fan of having data sitting directly in my home folder)

So I can safely ignore the log_test showing error for 1dRplot 3dICC 3dISC 3dLME 3dLMEr 3dMEMA 3dMEPFM 3dMSS 3dMVM 3dPFM 3dRprogDemo 3dSignatures ExamineXmat MBA PTA RBA TRR ?

thanks; it worked :)

Looking forward to the bootcamp

Hi, Edouard-

Glad that cleared up most items. Indeed, about the Bootcamp data items---as long as you know where they are and are happy navigating there, that is fine.

Re:

I'm a bit confused, because your system check shows:

    rPkgsInstall -pkgs ALL -check : success

for the tcsh case---I assumed that after sourcing ~/.bashrc from ~/.bash_profile those programs similarly showed success in your system check output. Is that not the case? Hmm. What is the output of this from your login bash shell (edited now to correct variable name):

echo $R_LIBS

?

--pt

Hmm, you are right. I re-executed

cd /Users/edelaire1/afni_build/build_src
tcsh scripts_install/test_afni_prog_help.tcsh -bin_dir macos_13_ARM_clang

and it shows :

found 625 good progs and 1 issues out of 626
failed progs: 3dSignatures

(edit: corrected command)

It shows :

[edelaire1@home-imglab01:~]$ echo $R_LIBS
/Users/edelaire1/sw/R-4.3.3

Edit: trying to run 3dSignatures shows me the same message as displayed here: AFNI program: 3dSignatures

Hi, Eduoard-

I was typing too carelessly above. I meant to ask the output of:

echo $R_LIBS

(I have edited this above, so anyone in the future doesn't type the wrong command, but also made a note of the edit).

Re. 3dSignatures- that is fine, it won't matter for the Bootcamp, and thanks for pointing out that it is broken because of a dependency, I hadn't noticed that (it isn't a widely used program).

So, I think you are set for the Bootcamp.

--pt

1 Like