Skip to content

Commit da7ee0d

Browse files
plexoosCopilot
andauthored
Enable optional floating point exception (FPE) trapping in rootlogon.C (star-bnl#768)
The lines come directly form /afs/rhic.bnl.gov/star/ROOT/5.34.38/root/etc/rootlogon.C --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 520bbbe commit da7ee0d

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

StRoot/macros/rootlogon.C

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
{
2+
// set FloatPointException trap
3+
bool star_rootlogon_fpe = TString(gSystem->Getenv("STAR_VERSION")) == ".DEV";
4+
const char* star_rootlogon_fpe_env = gSystem->Getenv("STARFPE");
5+
6+
if (star_rootlogon_fpe_env) {
7+
if (strcmp(star_rootlogon_fpe_env,"YES")==0) star_rootlogon_fpe=true;
8+
if (strcmp(star_rootlogon_fpe_env,"NO" )==0) star_rootlogon_fpe=false;
9+
}
10+
if (star_rootlogon_fpe) {
11+
gSystem->SetFPEMask(kInvalid | kDivByZero | kOverflow );
12+
printf("*** Floating Point Exception is ON ***\n");
13+
} else {
14+
printf("*** Floating Point Exception is OFF ***\n");
15+
}
16+
217
gSystem->Load("libStarClassLibrary");
318
gSystem->Load("libGeom");
419
gSystem->Load("libTable");

0 commit comments

Comments
 (0)