Error using @SUMA_Make_Spec_FS

Hi AFNI/SUMA users:

I’m having problems running: @SUMA_Make_Spec_FS -NIFTI -sid subject1
I am using macOS Sierra 10.12.5.

When I run this, it creates SUMA folder and start adding files in the folder. At some point it stops with the following message:

writing to /Applications/freesurfer/subjects/TacFreqEnc01/./SUMA/wm.seg.nii…
– running ‘mris_convert lh.smoothwm lh.smoothwm.asc’
Abort
dyld: lazy symbol binding failed: Symbol not found: ___emutls_get_address
Referenced from: /Applications/freesurfer/bin/…/lib/gcc/lib/libgomp.1.dylib
Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: ___emutls_get_address
Referenced from: /Applications/freesurfer/bin/…/lib/gcc/lib/libgomp.1.dylib
Expected in: /usr/lib/libSystem.B.dylib

dyld: lazy symbol binding failed: Symbol not found: ___emutls_get_address
Referenced from: /Applications/freesurfer/bin/…/lib/gcc/lib/libgomp.1.dylib
Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: ___emutls_get_address
Referenced from: /Applications/freesurfer/bin/…/lib/gcc/lib/libgomp.1.dylib
Expected in: /usr/lib/libSystem.B.dylib

Abort
c_ras: Subscript out of range.
c_ras: Subscript out of range.

I tried several options recommended from previous posts, including the ones here:
https://mail.nmr.mgh.harvard.edu/pipermail/freesurfer/2017-November/054992.html
https://afni.nimh.nih.gov/afni/community/board/read.php?1,153929,153933#msg-153933

None of them worked. Any recommendation is highly appreciated!

Thanks in advance!

Hi-

Can you please copy+paste the output of:


afni_system_check.py -check_all

?

–pt

Thanks Paul!
Here are the outputs after executing command: afni_system_check.py -check_all

-------------------------------- general ---------------------------------
architecture: 64bit
system: Darwin
release: 16.6.0
version: Darwin Kernel Version 16.6.0: Fri Apr 14 16:13:31 PDT 2017; root:xnu-3789.60.24~4/RELEASE_X86_64
distribution: 10.12.5 x86_64
number of CPUs: 4
apparent login shell: bash
shell RC file: .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /Users/shoaibur/abin/afni
afni version : Precompiled binary macosx_10.7_local: Aug 28 2018
: AFNI_18.2.15
AFNI_version.txt : AFNI_18.2.15, macosx_10.7_local, Aug 28 2018
which python : /usr/bin/python
python version : 2.7.10
which R : /usr/local/bin/R
R version : R version 3.4.2 (2017-09-28) – “Short Summer”
which tcsh : /bin/tcsh

instances of various programs found in PATH:
afni : 1 (/Users/shoaibur/abin/afni)
R : 1 (/Library/Frameworks/R.framework/Versions/3.4/Resources/bin/R)
python : 1 (/usr/bin/python)
python2 : 0
python3 : 0

testing ability to start various programs…
afni : success
suma : success
3dSkullStrip : success
uber_subject.py : success
3dAllineate : success
3dRSFC : success
SurfMesh : success
3dClustSim : success

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

    oo Warning: 
       These packages are not installed on the computer: brms!

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

------------------------------ python libs -------------------------------
** python module not found: PyQt4
– PyQt4 is no longer needed for an AFNI bootcamp

python binaries under /sw/bin:
/sw/bin/python (sym link to /sw/bin/python2.7)
/sw/bin/python2.7

-------------------------------- env vars --------------------------------
PATH = /Applications/freesurfer/bin:/Applications/freesurfer/fsfast/bin:/Applications/freesurfer/tktools:/Applications/freesurfer/mni/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/shoaibur/abin

PYTHONPATH =
R_LIBS =
LD_LIBRARY_PATH =
DYLD_LIBRARY_PATH = /Applications/freesurfer/lib/gcc/lib:/opt/X11/lib/flat_namespace

DYLD_FALLBACK_LIBRARY_PATH (sub-shell) =

------------------------------ 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/shoaibur/abin

------------------------------ OS specific -------------------------------
which brew : /usr/local/bin/brew
brew version : Homebrew 1.5.14

++ found PyQt4 under /sw/lib/qt4-mac/lib/python2.7/site-packages
– consider installing gcc under homebrew
++ found 1 dylib files under ‘/opt/X11/lib/flat_namespace’
– found ‘libXt’ dylib files:
/opt/X11/lib/flat_namespace/libXt.6.dylib
++ yay, env var DYLD_LIBRARY_PATH contains /opt/X11/lib/flat_namespace

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

  • login shell ‘bash’, trusting user to translate from ‘tcsh’
  • shell bash: consider sourcing (non-login) .bashrc from (login) .bash_profile
  • missing R packages (see rPkgsInstall)
  • insufficient data for AFNI bootcamp
  • consider adding /sw/lib/qt4-mac/lib/python2.7/site-packages to PYTHONPATH
  • consider linking /usr/local/Cellar/glib/2.56.0/lib/libglib-2.0.dylib under /usr/local/lib

Hi-

I think if you update your AFNI binaries to the “10.12_local” from the “10.7_local” that you are using, your problem will be solved. To do this, run the following a terminal:


@update.afni.binaries -defaults -package macos_10.12_local

That will just: 1) update your AFNI version to the most recent, and 2) give you the new 10.12_local version in place of the 10.7_local (no paths or anything else need to be changed).

If that doesn’t sort it out, then you might also have to do one of the suggested linking operations (written at the bottom of the afni_system_check.py output); that isn’t bad to do, but it might not be necessary with the 10.12_local binaries.

–pt

Perfect! Executing @update.afni.binaries -defaults -package macos_10.12_local solved the problem!

Thanks so much, Paul!

I have a similar problem. It seems that I upgraded to 10.12, which is not right?
Here is the information:

afni_system_check.py -check_all
-------------------------------- general ---------------------------------
architecture: 64bit
system: Darwin
release: 18.6.0
version: Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64
distribution: unknown Darwin
number of CPUs: 8
apparent login shell: bash
shell RC file: .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /Users/fanglab/abin/afni
afni version : Precompiled binary macos_10.12_local: Aug 10 2020
: AFNI_20.2.11 ‘Aulus Vitellius’
AFNI_version.txt : AFNI_20.2.11, macos_10.12_local, Aug 10 2020
which python : /opt/anaconda3/bin/python
python version : 3.8.3
which R : /usr/local/bin/R
R version : R version 3.4.1 (2017-06-30) – “Single Candle”
which tcsh : /bin/tcsh

instances of various programs found in PATH:
afni : 1 (/Users/fanglab/abin/afni)
R : 1 (/Library/Frameworks/R.framework/Versions/3.4/Resources/bin/R)
python : 2
/opt/anaconda3/bin/python3.8
/usr/bin/python
python2 : 0
python3 : 2
/opt/anaconda3/bin/python3.8
/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/bin/python3.8

** have python3 but not python2

testing ability to start various programs…
afni : success
suma : success
3dSkullStrip : success
uber_subject.py : success
3dAllineate : success
3dRSFC : success
SurfMesh : success
3dClustSim : success
3dMVM : FAILURE
Error in dyn.load(ll) :
unable to load shared object ‘/Users/fanglab/abin/R_io.so’:
dlopen(/Users/fanglab/abin/R_io.so, 6): Library not loaded: /sw/Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libR.dylib
Referenced from: /Users/fanglab/abin/R_io.so
Reason: Incompatible library version: R_io.so requires version 3.6.0 or later, but libR.dylib provides version 3.4.0
Calls: source … withVisible → eval → eval → set_R_io → dyn.load
Execution halted

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

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

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

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

++ module loaded: matplotlib.pyplot
module file : /opt/anaconda3/lib/python3.8/site-packages/matplotlib/pyplot.py

– python binaries under /usr/local/bin:
/usr/local/bin/python3 (sym link to /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/bin/python3.8)
/usr/local/bin/python3.8 (sym link to /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/bin/python3.8)

-------------------------------- env vars --------------------------------
PATH = /opt/anaconda3/bin:/opt/anaconda3/condabin:/path/to/my/anaconda3/lib/Python3.7/site-packages/mripy/scripts:/Applications/freesurfer/bin:/Applications/freesurfer/fsfast/bin:/Applications/freesurfer/tktools:/Applications/freesurfer/mni/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/fanglab/abin

PYTHONPATH =
R_LIBS =
LD_LIBRARY_PATH =
DYLD_LIBRARY_PATH =
DYLD_FALLBACK_LIBRARY_PATH =

------------------------------ 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/fanglab/abin

------------------------------ OS specific -------------------------------
XQuartz version : 2.7.11

which brew : /usr/local/bin/brew
brew version : Homebrew 2.4.9

– for PyQt4 under brew, consider running:
brew install cartr/qt4/pyqt
++ found 1 dylib files under ‘/opt/X11/lib/flat_namespace’
– found ‘libXt’ dylib files:
/opt/X11/lib/flat_namespace/libXt.6.dylib
** env var DYLD_LIBRARY_PATH is not set to contain /opt/X11/lib/flat_namespace
(so afni and suma may fail)

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

  • just be aware: login shell ‘bash’, but our code examples use ‘tcsh’
  • have python version 3.8.3, but a few programs need 2.7.x
  • AFNI programs show FAILURE
  • insufficient data for AFNI bootcamp
  • OS X version might be old
  • consider setting DYLD_LIBRARY_PATH to /opt/X11/lib/flat_namespace

Hi there,

Here is the original error information:

  • @SUMA_Make_Spec_FS -fspath /Applications/freesurfer/subjects/CRF_S01_TPL -sid CRF_S01_TPL -NIFTI
    ++ Running @SUMA_Make_Spec_FS version: 2.2.1
    ** apparent failure to run mris_convert
    mris_convert --help starts with:

dyld: lazy symbol binding failed: Symbol not found: ___emutls_get_address
Referenced from: /Applications/freesurfer/bin/…/lib/gcc/lib/libgomp.1.dylib
Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: ___emutls_get_address
Referenced from: /Applications/freesurfer/bin/…/lib/gcc/lib/libgomp.1.dylib
Expected in: /usr/lib/libSystem.B.dylib

Abort


** if this requires SetUpFreeSurfer.csh, consider option:
-fs_setup

1 program(s) not found
program failure: exiting…

Hi-

A couple things.

I think that Mac OS version 10.12 should still be OK to use.

The main issue is that you need to set an environment variable noted in the last section of your afni_system_check.py output (this is necessary for Macs). Could you please copy past the following in a terminal:


echo "" >> ~/.bashrc
echo "export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/opt/X11/lib/flat_namespace" >> ~/.bashrc

echo "" >> ~/.cshrc
echo "setenv DYLD_LIBRARY_PATH /opt/X11/lib/flat_namespace" >> ~/.cshrc

That should set the variable in both your bash and tcsh shells. If you open up a new terminal, you should be able to run the @SUMA_Make_Spec_FS program. (I think probably at the moment even opening the “suma” and “afni” GUIs is probably broken on your computer, without this variable being set?)

Second, the afni_system_check.py output reports that 3dMVM fails because your R version is too old – there is a link to the currently recommended R version number here:
https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/background_install/install_instructs/steps_mac.html#install-r
… and subsequent libraries that will have to be installed (the second part is slow, because of the compilation process by R, unfortunately).

–pt

Hi Sarah,

Just to add one more point to Paul’s, it looks like you are not able to run mris_convert from the @SUMA_Make_Spec_FS script. Please try the suggestion and add -fs_setup to that command, and let us know if it helps.

Thanks,

  • rick

Hi Paul and Rick,

Thanks a bunch!
I tried to upgrade the R and also followed the steps from Paul, which could get the AFNI and SUMA work better, like 3dMVM fixs now.

But when I run the @SUMA_Make_Spec_FS script again, it still stopped and gave error information like:
[i]+ @SUMA_Make_Spec_FS -fspath /Applications/freesurfer/subjects/CRF_S05_TPL -sid CRF_S05_TPL -NIFTI
++ Running @SUMA_Make_Spec_FS version: 2.2.1
** apparent failure to run mris_convert
mris_convert --help starts with:

dyld: lazy symbol binding failed: Symbol not found: ___emutls_get_address
Referenced from: /Applications/freesurfer/bin/…/lib/gcc/lib/libgomp.1.dylib
Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: ___emutls_get_address
Referenced from: /Applications/freesurfer/bin/…/lib/gcc/lib/libgomp.1.dylib
Expected in: /usr/lib/libSystem.B.dylib

Abort


** if this requires SetUpFreeSurfer.csh, consider option:
-fs_setup

1 program(s) not found
program failure: exiting…[/i]

Then I added -fs_setup, it works now! So it’s like something regarding fs. Should I re-install the freesurfer? Or need to set up anything more?

Many thanks,
S

Yes, this has to do with the FreeSurfer setup. But there is no real problem to necessarily fix.

You probably have something set to run SetUpFreeSurfer.sh, which sets up environment variables and such. That file sets your DYLD_LIBRARY_PATH variable to access the shared libraries that FreeSurfer provides with their software.

But you do not have that automatically run when starting tcsh, which led to that dyld error, because @SUMA_Make_Spec_FS is a tcsh script. One option would be to set up your .cshrc similar to what is being done in .bashrc/.bash_profile, to source $FREESURFER_HOME/SetUpFreeSurfer.csh.

That is what -fs_setup option does. It has @SUMA_Make_Spec_FS runsthe SetUpFreeSurfer.csh script (source it, to be specific), if FREESURFER_HOME is set.

So you do not need to do anything but apply the -fs_setup option for the Make_Spec script. Alternatively, update your .cshrc file, though that might not be preferable.

  • rick