villano-lab / nrCascadeSim

calculating the NR spectrum resulting from neutron-capture cascades.
MIT License
0 stars 1 forks source link

seg fault on OSX 10.14.6 (Mojave) with ROOT 6.24.04 installed through homebrew #32

Closed villaa closed 2 years ago

villaa commented 2 years ago

I often (but not always!?) get strange errors when running with the setup (although everything compiles thanks to the PR #28).

The errors look like:

(base) Anthonys-MacBook-Pro:bin villaa$ ./realizeCascades -n 10000 -o output.root ../levelfiles/allge_ngam_WFast.txt 
Seed used: 16807
MTRand: 0x7f803b831c00
**************../levelfiles/allge_ngam_WFast.txt***************

Cascade ID: 1/74
Fraction of this cascade: 0
Neutron separation: 6.92625e-310
Mass number: 4
Number of steps: 0

Energy Levels (keV) |   tau (fs)
------------------------------------------------
      *****              ***** 

Cascade ID: 2/74
Fraction of this cascade: 4.743e-322
Neutron separation: 2.1565e-314
Mass number: 96
Number of steps: 0

Energy Levels (keV) |   tau (fs)
------------------------------------------------
      *****              ***** 

Cascade ID: 3/74
Fraction of this cascade: 0
Neutron separation: 2.1565e-314
Mass number: 488
Number of steps: 7632997

Energy Levels (keV) |   tau (fs)
------------------------------------------------
      *****              ***** 

 *** Break *** segmentation violation
      -5.1932e+214               [/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[<unknown binary>] (no debug info)
[/usr/lib/system/libdyld.dylib] start (no debug info)

It's clear that something is going wrong with reading the file because of the whack values for the neutron separation energy in the first record.

villaa commented 2 years ago

I have tried to roll back the c++ standard, trying -std=c++98 which failed to compile, and -std=c++11 which compiled but also gave errors.

villaa commented 2 years ago

I am now trying to rollback my version of ROOT, which is apparently not easy with brew. Apparently you used to be able to just directly use a URL from the brew repository of an old commit. I tried that, and it failed b/c this is no longer allowed.

There are actually now what seem to be better ways to do this, so I am trying the method here in the first answer.

Note that this is all supposed to be done in a terminal (any terminal) and it seems like the TAP variable is largely arbitrary. I used:

(base) Anthonys-MacBook-Pro:~ villaa$ TAP="villano-lab/homebrew-old"
(base) Anthonys-MacBook-Pro:~ villaa$ MODULE="root"
(base) Anthonys-MacBook-Pro:~ villaa$ VERS="6.22.08"

which might be working??

villaa commented 2 years ago

BTW the version I used to link to was 6.22.08 the direct URL is in this link.

villaa commented 2 years ago

Installed the older version of ROOT and got it working by doing source /usr/local/Cellar/root\@6.22.08/6.22.08_2/bin/thisroot.sh

villaa commented 2 years ago

version 6.22.08 actually also forces the -std=c=++17 flag:


(base) Anthonys-MacBook-Pro:nrCascadeSim villaa$ root-config --cflags --glibs
-stdlib=libc++ -pthread -std=c++17 -m64 -I/usr/local/Cellar/root@6.22.08/6.22.08_2/include/root -L/usr/local/Cellar/root@6.22.08/6.22.08_2/lib/root -lGui -lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lROOTVecOps -lTree -lTreePlayer -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -lROOTDataFrame -stdlib=libc++ -lpthread -lm -ldl

So, I guess I have to go back even further to test a previous version than c++17

villaa commented 2 years ago

So I made this post to the ROOT forum to try to figure out how far in versions I have to go back to get something compatible with c++14. It's hard to tell from the ROOT release pages.

villaa commented 2 years ago

See issue #10 for some related stuff about ROOT installs.

villaa commented 2 years ago

Note: found out that ROOT 6.16/00 uses C++14

villaa commented 2 years ago

Addressed by PR #61 -- we decided to support ROOT versions 6.20.00 through 6.24.06.