Hello,
I’m running into a very strange set fault when I compile my program with the OS X native compiler. The following code reproduced my problem:
#include <iostream>
#include "RooRealVar.h"
int main(){
Double_t omegaMass = 782.65;
Double_t omegaWidth = 8.49;
RooRealVar testsss("sdf","sadf",1.23456,1.0,2.0);
std::cout<<testsss.getMin()<<std::endl;
std::cout<<testsss.getVal()<<std::endl;
std::cout<<testsss.getMax()<<std::endl;
std::cout<<omegaMass<<std::endl;
return 1;
}
Compiling with gcc 4.5.4 from Macports:
/opt/local/bin/g++ -I$ROOTSYS/include -L$ROOTSYS/lib -lRooFitCore -lRooFit -lCore bugTest.cxx
/opt/local/bin/g++ --version
g++ (MacPorts gcc45 4.5.4_9) 4.5.4 (snip)
And I get the correct result:
1
1.23456
2
782.65
When I use the OSX native complier I run into problems:
/usr/bin/g++ -I$ROOTSYS/include -L$ROOTSYS/lib -lRooFitCore -lRooFit -lCore bugTest.cxx
/usr/bin/g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
The output is:
1
1.23456
2
6.94864e-310
*** Break *** segmentation violation
I’m running OSX 10.9 and root v5.34.09. Any suggestions?
Thanks in advance!
Best wishes, Peter