Error when setting up afni

Hi all! I am getting this error when trying to install afni. Do you have any suggestions? Thank you

========================= 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)

forsales-Air:~ forsale$ afni_system_check.py -check_all > out.afni_system_check.txt
forsales-Air:~ forsale$
forsales-Air:~ forsale$
forsales-Air:~ forsale$ afni
Precompiled binary macos_10.12_local: Sep 12 2018 (Version AFNI_18.2.16)

Thanks go to N Vanello for much encouragement

Initializing: X11
++ 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
  • This command is best put in your startup ~/.cshrc file, so that
  • it will be invoked for every (t)csh shell you open.

++ AFNI is detached from terminal.
forsales-Air:~ forsale$ suma[The X.Org Foundation v 11804000].
Fatal Signal 11 (SIGSEGV) received
ISQ_record_button
open_MCW_imseq
SPLASH_popup_image
AFNI_splashup
MAIN_workprocess
AFNI:main
Bottom of Debug Stack
** AFNI version = AFNI_18.2.16 Compile date = Sep 12 2018
** [[Precompiled binary macos_10.12_local: Sep 12 2018]]
** 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/forsale/.afni.crashlog
DYLD_LIBRARY_PATH /opt/X11/lib/flat_namespace
-bash: sumaDYLD_LIBRARY_PATH: command not found
forsales-Air:~ forsale$ rPkgsInstall -pkgs ALL

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

Error in dyn.load(ll) :
unable to load shared object ‘/Users/forsale/abin/R_io.so’:
dlopen(/Users/forsale/abin/R_io.so, 6): Library not loaded: /sw/lib/libjpeg.9.dylib
Referenced from: /Users/forsale/abin/R_io.so
Reason: image not found
Calls: source … withVisible → eval → eval → set_R_io → dyn.load
Execution halted
forsales-Air:~ forsale$ sudo rPkgsInstall -pkgs ALL
Password:

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

Error in dyn.load(ll) :
unable to load shared object ‘/Users/forsale/abin/R_io.so’:
dlopen(/Users/forsale/abin/R_io.so, 6): Library not loaded: /sw/lib/libjpeg.9.dylib
Referenced from: /Users/forsale/abin/R_io.so
Reason: image not found
Calls: source … withVisible → eval → eval → set_R_io → dyn.load
Execution halted
forsales-Air:~ forsale$

It seems likely that you do not have DYLD_LIBRARY_PATH set up correctly yet.

Have you logged out and logged back since updating the dot files?
To be more sure, try opening a new Terminal window and running afni again.

What is the contents of out.afni_system_check.txt?

  • rick

Hi Rick,

I’m having the same problem with the R libraries. (I had to reinstall afni because I suddenly was having a bunch of issues that I couldn’t figure out.) Upon reinstalling and doing the check, I get the issue below.

Any input would be much appreciated!
-Nancy

[OBYL100MAC:~] canlabuser% afni_system_check.py -check_all
-------------------------------- general ---------------------------------
architecture: 64bit
system: Darwin
release: 17.7.0
version: Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64
distribution: 10.13.6 x86_64
number of CPUs: 12
apparent login shell: tcsh
shell RC file: .cshrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /Users/canlabuser/abin/afni
afni version : Precompiled binary macos_10.12_local: Sep 27 2018
: AFNI_18.2.19
AFNI_version.txt : AFNI_18.2.19, macos_10.12_local, Sep 27 2018
which python : /usr/bin/python
python version : 2.7.10
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/canlabuser/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
Error in dyn.load(ll) :
unable to load shared object ‘/Users/canlabuser/abin/R_io.so’:
dlopen(/Users/canlabuser/abin/R_io.so, 6): Library not loaded: /sw/lib/libXt.6.dylib
Referenced from: /Users/canlabuser/abin/R_io.so
Reason: image not found
Calls: source … withVisible → eval → eval → set_R_io → dyn.load
Execution halted

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

------------------------------ python libs -------------------------------
++ module ‘PyQt4’ found at /usr/local/lib/python2.7/site-packages/PyQt4
++ module loaded: PyQt4

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

-------------------------------- env vars --------------------------------
PATH = /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/canlabuser/abin

PYTHONPATH =
R_LIBS =
LD_LIBRARY_PATH =
DYLD_LIBRARY_PATH (sub-shell) = /opt/X11/lib/flat_namespace
DYLD_FALLBACK_LIBRARY_PATH (sub-shell) =

------------------------------ data checks -------------------------------
data dir : found AFNI_data6 under $HOME
top history: 20 Jun 2016 [rickr]: optional de-mean in PPI
data dir : found AFNI_demos under $HOME
top history: 26 Sep 2014 [ziad] : added Do_11 to FATCAT_DEMO
data dir : found suma_demo under $HOME
top history: …/SUMA_data/Build_tmp on Wed Aug 20 10:04:23 EDT 2014
data dir : found afni_handouts under $HOME
atlas : found TT_N27+tlrc under /Users/canlabuser/abin

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

++ found existent library /usr/local/lib/libgomp.1.dylib
++ found valid link /usr/local/lib/libglib-2.0.dylib
to …/Cellar/glib/2.58.0/lib/libglib-2.0.dylib
++ 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 ‘tcsh’…
++ found evar DYLD_LIBRARY_PATH = /opt/X11/lib/flat_namespace

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

  • missing R packages (see rPkgsInstall)

Hi Nancy,

It is not yet clear how to build that in a good way for the
newer mac systems, so for now we will steal the version
from the 10.7 package. Anyway, that detail is hidden
under the hood for now.

Update that one file, and see if it works better:

@update.afni.binaries -prog_list R_io.so

Thanks,

  • rick

Hi again,

So, I used @update.afni.binaries -prog_list R_io.so to update the file, and then I tried to install the R packages, but got another error:

[OBYL100MAC:~] canlabuser% rPkgsInstall -pkgs ALL

*** caught segfault ***
address 0x0, cause ‘memory not mapped’

Traceback:
1: .Call(“R_SUMA_HistString”, ExecName, args, ohist)
2: AFNI.command.history(ExecName, args, NULL)
3: read.rPkgsInstall.opts.batch(args, verb = 0)
An irrecoverable exception occurred. R is aborting now …
Segmentation fault

Hi Nancy,

Strange, was that right away, or after some processing?

Turn off memory mapping and try again (not that I know
where memory mapping would actually be applied in your
command):

setenv AFNI_NOMMAP YES

Does that help?

  • rick

Hi Rick,

I don’t think I ran any processing in between - I’m almost positive it was right away.

I just used the setenv AFNI_NOMMAP YES command and then ran rPkgsInstall -pkgs ALL (both in the same window and in a new window), and still get the same error:

[OBYL100MAC:~] canlabuser% rPkgsInstall -pkgs ALL

*** caught segfault ***
address 0x0, cause ‘memory not mapped’

Traceback:
1: .Call(“R_SUMA_HistString”, ExecName, args, ohist)
2: AFNI.command.history(ExecName, args, NULL)
3: read.rPkgsInstall.opts.batch(args, verb = 0)
An irrecoverable exception occurred. R is aborting now …
Segmentation fault

Not sure what is wrong…
-Nancy

Hi Nancy,

Maybe we can work together off-line next week (after our bootcamp),
and figure this out. If you would like to get aside some time for this,
let me know (maybe via email). Sorry for the trouble.

  • rick

Hi Rick,

I’m dealing with the same errors with the R packages in my Mac using macOS Mojave version 10.14.1

This is occurring in any attempt to use any R-based command, for example

cesars-MacBook-Pro:~ cesar$ rPkgsInstall -pkgs ALL

*** caught segfault ***
address 0x0, cause ‘memory not mapped’

Traceback:
1: .Call(“R_SUMA_HistString”, ExecName, args, ohist)
2: AFNI.command.history(ExecName, args, NULL)
3: read.rPkgsInstall.opts.batch(args, verb = 0)
An irrecoverable exception occurred. R is aborting now …
Segmentation fault

Did you find any solution?

Best,
Cesar

Hello,

I’m having this error too after upgrading to Catalina and also updating R, which won’t let me run MVM and other commands requiring R packages. I cannot install these packages because I get an error (see below).
All was working prior o these updates…

Any idea how to fix this?
Thanks!!
Pascale

Here is the output of afni_system_check.py -check_all

[Echinacee:IRM/Scripts/fMRI] pascaletremblay% afni_system_check.py -check_all
-------------------------------- general ---------------------------------
architecture: 64bit
system: Darwin
release: 19.6.0
version: Darwin Kernel Version 19.6.0: Sun Jul 5 00:43:10 PDT 2020; root:xnu-6153.141.1~9/RELEASE_X86_64
distribution: 10.15.6 x86_64
number of CPUs: 8
apparent login shell: tcsh
shell RC file: .cshrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /Users/pascaletremblay/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.16
which R : /usr/local/bin/R
R version : R version 3.6.3 (2020-02-29) – “Holding the Windsock”
which tcsh : /bin/tcsh

instances of various programs found in PATH:
afni : 1 (/Users/pascaletremblay/abin/afni)
R : 1 (/Library/Frameworks/R.framework/Versions/3.6/Resources/bin/R)
python : 1 (/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7)
python2 : 1 (/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7)
python3 : 1 (/usr/bin/python3)

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

     *** caught segfault ***
    address 0x0, cause 'memory not mapped'

    Traceback:
     1: .Call("R_SUMA_HistString", ExecName, args, ohist)
     2: AFNI.command.history(ExecName, args, NULL)
     3: read.rPkgsInstall.opts.batch(args, verb = 0)
    An irrecoverable exception occurred. R is aborting now ...
    Segmentation fault

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

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

PYTHONPATH = /sw/lib/qt4-x11/lib/python2.7/site-packages

R_LIBS =
LD_LIBRARY_PATH =
DYLD_LIBRARY_PATH = /opt/X11/lib/flat_namespace

DYLD_FALLBACK_LIBRARY_PATH = /Users/pascaletremblay/abin

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

------------------------------ OS specific -------------------------------
which brew : /usr/local/bin/brew
brew version : Homebrew 0.9.5 (git revision 8109; last commit 2016-03-01)

++ found PyQt4 under /usr/local/lib/python2.7/site-packages
++ found valid link /usr/local/lib/libgomp.1.dylib
to /Users/pascaletremblay/abin/libgomp.1.dylib
++ found valid link /usr/local/lib/libglib-2.0.dylib
to …/Cellar/glib/2.46.2/lib/libglib-2.0.dylib
++ 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: =========================

  • missing R packages (see rPkgsInstall)
  • insufficient data for AFNI bootcamp
  • consider adding /usr/local/lib/python2.7/site-packages to PYTHONPATH

########### R install error ####################

[Echinacee:IRM/Scripts/fMRI] pascaletremblay% sudo rPkgsInstall -pkgs ALL
Password:

*** caught segfault ***
address 0x0, cause ‘memory not mapped’

Traceback:
1: .Call(“R_SUMA_HistString”, ExecName, args, ohist)
2: AFNI.command.history(ExecName, args, NULL)
3: read.rPkgsInstall.opts.batch(args, verb = 0)
An irrecoverable exception occurred. R is aborting now …
Segmentation fault

From what I recall, this was because of an incompatibility between the old libraries that R_io.so was linked against, and the newer ones on your system.

But the 10.7_local package is no longer being compiled in any case (you can see that it is more than 2 years old). Upgrade to 10.12_local and see how that works.

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

It worked! (tu)

Thanks!
Pascale

Great, thanks!

  • rick