Can't compile when using ROOT::Math::chisquared_cdf

Dear ROOT experts,

I’m trying to use ROOT::Math::chisquared_cdf in my compiled macro on my windows ROOT installation, but can not compile the code. The function is available at the CINT command line:

[quote]C:\root520\v5-20-00\bin>root -l
Laptop rootlogon.c running from ROOT’s (bin) dir
My working plot style initialized
root [0] ROOT::Math::chisquared_cdf(2, 3)

But even when I get ACLiC to see the header file (by putting

[quote]ACLiC.IncludePaths: -I$(ROOTSYS)\math\mathcore\inc\Math[/quote] in system.rootrc), I get errors like:

[quote]C:\root520\v5-20-00\math\mathcore\inc\Math\math.h(70) : error C2039: ‘log’ : is
not a member of 'std’
C:\root520\v5-20-00\math\mathcore\inc\Math\math.h(98) : error C2039: ‘exp’ : is
not a member of ‘std’
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\cmath(18) : error C2039: ‘
acosf’ : is not a member of ‘`global namespace’’

That print out is from running the compiler at the command
line, after using gDebug=7 to get the command line:

[quote]C:\root520\v5-20-00\bin>cl -O2 -nologo -TP -c -nologo -FIw32pragma.h -MD -GR -EHsc- -W3 -wd4244 -Iinclude -D_WIN32_WINNT=0x0400 -I/C/root520/v5-20-00/include -I"C:\root520\v5-20-00/include" -IC:\cygwin\home\AmnonHarel\cms\macros -IC:\root520\v5-20-00\bin -IC:\root520\v5-20-00\math\mathcore\inc\Math C:\cygwin\home\AmnonHarel\cms\macros\pri.c -FoC:\cygwin\home\AmnonHarel\cms\macros\s66c_56334.obj

As you may recognize, this is uses Microsoft’s compiler, which I used to
build ROOT following Gordon’s Watts instructions and installation package
(“ROOT Builder”?) a while back. It’s ROOT 5.20, so it can’t have been that
far back.

If I don’t add that line to the include path, or in fact, even
when I do but run ACLiC from the CINT prompt, I get the error:

[quote]C:\cygwin\home\AmnonHarel\cms\macros\pri.c(15) : fatal error C1083: Cannot
open include file: ‘ProbFuncMathMore.h’: No such file or directory
Error: external preprocessing failed. (0)

(so I need to change something else to hack the include used in dictionary creation, and the hack doesn’t work anyway).

Any help is appreciated. I was hoping to present the results of this study
in two days and just wasted half a day on this technicality…

BTW: I need chisquared_cdf and not TMath::Prob since my “NDF” argument is not an integer.


A sufficient work-around is to call ROOT::Math::inc_gamma directly

[quote]#include “Math/SpecFuncMathCore.h”

… ROOT::Math::inc_gamma( X, Y );



for using ROOT::Math::chisquared_cdf in compiled mode, you just need to include the file

#include "Math/ProbFunc.h"

This file include all the cumulative distributions (_cdf) available.
If you need to use also other statistical functions (like pdf’s), you can include
also the file Math/DistFunc.h which contains all the types : pdf, cdf and inverse functions.

In principle you don’t need to set any include PATH in ACLIC, it should be able to find the header file from the default include, $ROOTSYS/include.

You should not set in ACLIC the include to $(ROOTSYS)\math\mathcore\inc\Math. It will produce some errors

Best Regards