@sswarper Error

Good Afternoon,

We had recently updated our AFNI binaries a little bit ago:
afni -ver
Precompiled binary linux_openmp_64: May 8 2023 (Version AFNI_23.1.05 ‘Publius Helvius Pertinax’)

When I run @sswarper using this command:
@SSwarper -input sub1065_anatPU2.nii.gz -base MNI152_2009_template_SSW.nii.gz -subid sub1065 -SSopt ‘-blur_fwhm 2’ -odir anatwarp2/

I get the following error:
++ 3dNwarpApply: AFNI version=AFNI_23.1.05 (May 8 2023) [64-bit]
++ Authored by: Zhark the Warped
** FATAL ERROR: can’t open -master dataset ‘anatwarp2//anatS.sub1065.nii’ :frowning:
** Program compile date = May 8 2023
** ERROR: program failed in Step 5a

Looking at the files it created in the ‘anatwarp2’ directory, I confirmed that the file it says it can’t open is not present in the directory. I do not know what the Step 5a is referring to here either, so I don’t know how to fix the problem.

Any advice or pointers to find the issue?



Hi, Danny-

Hmm, OK.

First to note: those “Step …” references are just to help pinpoint in the code which step failed, for someone looking through the @SSwarper tcsh script itself. That particular step is inverting a warp… Do you happen to have log file of the full terminal output from running that command?

Also, if I shared instructions, would you be able to send me that dataset to check out?


I am re-running the command now to produce the full command output from the terminal. While doing this, I did notice this early on:

3dSkullStrip: error while loading shared libraries: libgsl.so.0: cannot open shared object file: No such file or directory
++ SSW Step 3
++ OpenMP thread count = 15

Maybe it is due to not having all of the libraries updated?



Hm, what is the output of

afni_system_check.py -check_all


Also, the program should exit at the first failure. I see that the status checks weren’t in optimal places, and I have tweaked that in the program now, so future versions should be easier to diagnose.

Thanks for bringing that issue up.


It looks like some commands/functions didn’t update properly when we updated our binaries:

-------------------------------- general ---------------------------------
architecture: 64bit
cpu type: x86_64
system: Linux
release: 5.4.0-148-generic
version: #165-Ubuntu SMP Tue Apr 18 08:53:12 UTC 2023
distribution: Ubuntu 20.04 focal
number of CPUs: 52
apparent login shell: tcsh
shell RC file: .cshrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /software/afni_23_1_02/abin//afni
afni version : Precompiled binary linux_openmp_64: May 8 2023
: AFNI_23.1.05 ‘Publius Helvius Pertinax’
AFNI_version.txt : AFNI_23.1.05, linux_openmp_64, May 08 2023
which python : /usr/bin/python
python version : 2.7.18
which R : /usr/bin/R
R version : R version 4.3.0 (2023-04-21) – “Already Tomorrow”
which tcsh : /usr/bin/tcsh

instances of various programs found in PATH:
afni : 1 (/software/afni_23_1_02/abin/afni)
R : 1 (/usr/bin/R)
python : 1 (/usr/bin/python2.7)
python2 : 1 (/usr/bin/python2.7)
python3 : 1 (/usr/bin/python3.8)

testing ability to start various programs…
afni : success
suma : success
3dSkullStrip : FAILURE
3dSkullStrip: error while loading shared libraries: libgsl.so.0: cannot open shared object file: No such file or directory
uber_subject.py : success
3dAllineate : success
3dRSFC: error while loading shared libraries: libgsl.so.0: cannot open shared object file: No such file or directory
SurfMesh : success
3dClustSim : success
3dMVM : success

checking for R packages…
rPkgsInstall -pkgs ALL -check : success

R RHOME : /usr/lib/R

checking for $HOME files…
.afnirc : missing
.sumarc : missing
.afni/help/all_progs.COMP : missing

------------------------------ python libs -------------------------------
** failed to load module PyQt4
– PyQt4 is no longer needed for an AFNI bootcamp

** failed to load module matplotlib.pyplot
– matplotlib.pyplot is required

-------------------------------- env vars --------------------------------
PATH = /software/freesurfer/bin:/software/freesurfer/fsfast/bin:/software/freesurfer/tktools:/software/fsl/fsl6/bin:/software/freesurfer/mni/bin:/software/fsl/fsl6/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/software/afni_23_1_02/abin/:/software/freesurfer_6.0.0/freesurfer/:/software/dsi-studio/:/software/cfmri/pipelines/fmritools/:/software/cfmri/pipelines/topup_scripts/:/software/cfmri/pipelines/generic_recon_release/:/software/cfmri/pipelines/topup_scripts_siemens/:/software/cfmri/pipelines/mux_epi_recon_cfmri/:/data/asimmons_group/data/scripts/


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

– no .tcshrc, will create one as a follower of .cshrc
– considered operations: path, flatdir, apsearch
(not on a mac, should skip flatdir)

– 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 2 files:

  file             path  flatdir  apsearch        follower
  ---------------  ----  -------  --------        --------
  .tcshrc          0     0        0               1     
  .cshrc           0     0        1               0     

------------------------------ data checks -------------------------------
data dir : found AFNI_data6 under $HOME/data/random/AFNIexample (15940320M Avail)
top history: …Nov 2022 [rickr]: s05: added align_unifize_epi local
data dir : missing AFNI_demos
data dir : missing suma_demo
data dir : missing afni_handouts
atlas : found TT_N27+tlrc under /software/afni_23_1_02/abin/

------------------------------ OS specific -------------------------------
which apt-get : /usr/bin/apt-get
apt-get version : apt 2.0.9 (amd64)

have Ubuntu system: Ubuntu 20.04 focal

========================= summary, please fix: =========================

  • AFNI programs show FAILURE
  • please run: cp /software/afni_23_1_02/abin//AFNI.afnirc ~/.afnirc
  • please run: “suma -update_env” for .sumarc
  • please run: apsearch -update_all_afni_help
  • python library matplotlib is required
    (see AFNI install docs for details)
  • dot file test : want 1 modifications across 2 files:
  • insufficient data for AFNI bootcamp
    (see “Prepare for Bootcamp” on install pages)

Okeydoke. Just to note the Ubuntu 20.04 installation instructions are here:

For the GSL, I would run this to install it:

sudo apt-get install gsl

… and then this to link it (sigh):

sudo ln -s /usr/lib/x86_64-linux-gnu/libgsl.so.23 /usr/lib/x86_64-linux-gnu/libgsl.so.19

For Matplotlib, I would make sure Python 3 is there, and say numpy, but oddly the default installation version number of Matplotlib on Ubuntu 20.04 is quite old (less than requisite v2.2.3), so it should be installed using pip:

# install Python and numpy, as well as pip, and have "python" be recognized as a command, not just "python3"
sudo apt-get install -y python3-numpy python-is-python3 pip
# remove that matplotlib from aptitude, if it was installed
sudo apt-get remove  -y python3-matplotlib

# now, note that sudo should *not* be used here:
pip install matplotlib

You can verify your Matplotlib versions with:

python -c "import matplotlib; print(matplotlib.__version__)"

… which should be >=2.2.3.

And these “Please fix” items are pretty straightforward:

cp /software/afni_23_1_02/abin//AFNI.afnirc ~/.afnirc
suma -update_env
apsearch -update_all_afni_help

After that, you can check “afni_system_check.py -check_all” again, to verify that those issues have been happily resolved.


Great, thank you! We got @sswarper command to work. If we run into additional problems with other functions in afni_proc.py, we’ll reinstall these other functions as you indicate.

Thank you,


Hi, Danny-

Running “afni_system_check.py -check_all” will tell you pretty clearly if everything that is needed, is installed. One decision point that could be kicked on down the road could be the R-based programs, which are mainly for group level processing. But it would probably be best to have all the other checks passing, to avoid any weird and/or possibly subtle issues.