Building root 6-14-04 from source on Windows

I use tensorflow and it complains in a python 32 bit env.
I will try to install the 32 bit and see if I can make it work. I need root more than tf tbf

so does that make it

cmake -Dall=OFF -Dmathmore=OFF -Dbuiltin_zlib=ON -Dgfal=OFF -Dbuiltin_freetype=ON -Dbuiltin_ftgl=ON -Droofit=ON -Dfftw3=ON TTTW_INCLUDE_DIR = D:\Software\fftw-3.3.5-dll32 FFTW_LIBRARY = D:\Software\fftw-3.3.5-dll32\libfftw3-3.lib D:\root

You know better than meā€¦ Juts try (and then you can use the cmake-gui to change the optionsā€¦)

Looks like python 64 is only issue now, Iā€™ll update once the build is complete

Build succeeded with 139 warnings.

How do I add root to path now, in order to run root in any directory?
Edit : I added it to the path.

D:\debajyoti_project\Practice>root
   ------------------------------------------------------------
  | Welcome to ROOT 6.15/01                  https://root.cern |
  |                               (c) 1995-2018, The ROOT Team |
  | Built for win32 on 10 11 2018, 22:58:35                    |
  | From heads/master@v6-13-04-2160-gc716de08e9                |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------

root [0]

Thanks a lot @bellenot for your patience and all the help

However convolution still doesnt work

 INFO:Eval -- RooRealVar::setRange(t) new range named 'refrange_fft_lxg' created with bounds [-10,30]
[#1] INFO:NumericIntegration -- RooRealIntegral::init(lx_Int[t]) using numeric integrator RooIntegrator1D to calculate Int(t)
Error in <TVirtualFFT::FFT>: handler not found
Error in <TVirtualFFT::FFT>: handler not found
Error in <TVirtualFFT::FFT>: handler not found

when I run the tutorial

#include "RooRealVar.h"
#include "RooDataSet.h"
#include "RooGaussian.h"
#include "RooLandau.h"
#include "RooFFTConvPdf.h"
#include "RooPlot.h"
#include "TCanvas.h"
#include "TAxis.h"
#include "TH1.h"
using namespace RooFit ;



void rf208_convolution()
{
   // S e t u p   c o m p o n e n t   p d f s 
   // ---------------------------------------

   // Construct observable
   RooRealVar t("t","t",-10,30) ;

   // Construct landau(t,ml,sl) ;
   RooRealVar ml("ml","mean landau",5.,-20,20) ;
   RooRealVar sl("sl","sigma landau",1,0.1,10) ;
   RooLandau landau("lx","lx",t,ml,sl) ;

   // Construct gauss(t,mg,sg)
   RooRealVar mg("mg","mg",0) ;
   RooRealVar sg("sg","sg",2,0.1,10) ;
   RooGaussian gauss("gauss","gauss",t,mg,sg) ;


   // C o n s t r u c t   c o n v o l u t i o n   p d f 
   // ---------------------------------------

   // Set #bins to be used for FFT sampling to 10000
   t.setBins(10000,"cache") ; 

   // Construct landau (x) gauss
   RooFFTConvPdf lxg("lxg","landau (X) gauss",t,landau,gauss) ;



   // S a m p l e ,   f i t   a n d   p l o t   c o n v o l u t e d   p d f 
   // ----------------------------------------------------------------------

   // Sample 1000 events in x from gxlx
   RooDataSet* data = lxg.generate(t,10000) ;

   // Fit gxlx to data
   lxg.fitTo(*data) ;

   // Plot data, landau pdf, landau (X) gauss pdf
   RooPlot* frame = t.frame(Title("landau (x) gauss convolution")) ;
   data->plotOn(frame) ;
   lxg.plotOn(frame) ;
   landau.plotOn(frame,LineStyle(kDashed)) ;


   // Draw frame on canvas
   new TCanvas("rf208_convolution","rf208_convolution",600,600) ;
   gPad->SetLeftMargin(0.15) ; frame->GetYaxis()->SetTitleOffset(1.4) ; frame->Draw() ;

}

I tried copying the fftw3 files to the root bin, and also adding the fftw3 dir in path. The problem is still there

try to call D:\wherever\root\bin\thisroot.bat before starting root, this will properly set the necessary environment variables

The folder where root is built is buildroot.

So I call D:\buildroot\bin\thisroot.bat
but the problem still remains :

D:\debajyoti_project\Practice>D:\buildroot\bin\thisroot.bat

D:\debajyoti_project\Practice>root
   ------------------------------------------------------------
  | Welcome to ROOT 6.15/01                  https://root.cern |
  |                               (c) 1995-2018, The ROOT Team |
  | Built for win32 on 10 11 2018, 22:58:35                    |
  | From heads/master@v6-13-04-2160-gc716de08e9                |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------

root [0] .x roofit.C

e[1mRooFit v3.60 -- Developed by Wouter Verkerke and David Kirkbye[0m
                Copyright (C) 2000-2013 NIKHEF, University of California & Stanford University
                All rights reserved, please read http://roofit.sourceforge.net/license.txt

warning: cannot find function 'roofit()'; falling back to .L
root [1] rf208_convolution()
[#1] INFO:Eval -- RooRealVar::setRange(t) new range named 'refrange_fft_lxg' created with bounds [-10,30]
[#1] INFO:NumericIntegration -- RooRealIntegral::init(lx_Int[t]) using numeric integrator RooIntegrator1D to calculate Int(t)
Error in <TVirtualFFT::FFT>: handler not found
Error in <TVirtualFFT::FFT>: handler not found
Error in <TVirtualFFT::FFT>: handler not found

D:\debajyoti_project\Practice>

Iā€™ll check tomorrow and let you know

Can you check if the libFFTW.dll is in your D:\buildroot\bin\ directory?

The only files matching that name are here : Screenshot%20(39)

But there is no file named libFFTW.dll

So FFTW was not built. Please open the cmake-gui and check that the fftw options and variables are properly set

Dear @bellenot,

I started cmake-gui and found out that builtin_fftw3 was unchecked, so I checked it and configured : That gave me this output

ROOT default compression algorithm is zlib
Vc does not support AMD64. Support for Vc disabled.
ROOT Platform: win32
ROOT Architecture: win32
Build Type: RelWithDebInfo
Compiler Flags: -nologo -ID:/root/build/win -FIw32pragma.h -FIsehmap.h -Zc:__cplusplus -MD -GR -EHsc- -W3 -wd4141 -wd4291 -wd4244 -wd4049 -D_WIN32 -D_XKEYCHECK_H -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS  -std=c++14 
Building freetype version 2.6.1 included in ROOT itself
Building pcre version 8.37 included in ROOT itself
Building LZMA version 5.2.1 included in ROOT itself
Could NOT find GIF (missing: GIF_LIBRARY GIF_INCLUDE_DIR) 
Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR) 
Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR) 
Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR) 
Looking for OpenGL
Downloading and building FFTW version 3.1.2
Enabled support for:  asimage astiff builtin_afterimage builtin_fftw3 builtin_freetype builtin_ftgl builtin_gl2ps builtin_glew builtin_llvm builtin_clang builtin_lzma builtin_lz4 builtin_pcre builtin_xxhash builtin_zlib clad cling cxx14 exceptions explicitlink fftw3 gdml http opengl pch python roofit shared thread
Could NOT find Backtrace (missing: Backtrace_LIBRARY Backtrace_INCLUDE_DIR) 
Native target architecture is X86
Threads disabled.
Doxygen disabled.
Go bindings disabled.
LLVM host triple: i686-pc-win32
LLVM default target triple: i686-pc-win32
Using MinSizeRel VC++ CRT: MD
Constructing LLVMBuild project information
LLVMHello ignored -- Loadable modules not supported on this platform.
Targeting X86
Clang version: 5.0.0
PrintFunctionNames ignored -- Loadable modules not supported on this platform.
AnnotateFunctions ignored -- Loadable modules not supported on this platform.
BugpointPasses ignored -- Loadable modules not supported on this platform.
Cling version (from VERSION file): ROOT_0.6~dev
Configuring done

Then I clicked on generate and it gave me no error. However the Error in <TVirtualFFT::FFT>: handler not found is still there and I donā€™t see the libFFTW.dll in the bin.

OK, my bad, please uncheck builtin_fftw, check fftw3, and specify the correct path for FFTW_INCLUDE_DIR and FFTW_LIBRARY
Then configure, generate, and build again.

I checked fftw3.
How do i set environment variables inside cmake?
Also, after generating, do I start a terminal and type the cmake build command?

Or should I start again from scratch from terminal?

FFTW_INCLUDE_DIR and FFTW_LIBRARY are not environment variables, they are cmake options.

Yes

No, just go on with your current set-up

after

cmake -Dall=OFF -Dmathmore=OFF -Dbuiltin_zlib=ON -Dgfal=OFF -Dbuiltin_freetype=ON -Dbuiltin_ftgl=ON -Droofit=ON -Dfftw3=ON FFTW_DIR=D:\Software\fftw-3.3.5-dll32\ FFTW_INCLUDE_DIR=D:\Software\fftw-3.3.5-dll32\fftw3.h FFTW_LIBRARY=D:\Software\fftw-3.3.5-dll32\libfftw3-3.lib D:\root

when I configure, it cannot find the FFTW3 files

-- FFTW3 not found. Set [environment] variable FFTW_DIR to point to your FFTW3 installation
--                  Alternatively, you can also enable the option 'builtin_fftw3' to build FFTW3 internally'
--                  For the time being switching OFF 'fftw3' option

Oh pleaseā€¦ use the gui (where you can see those variables and fill them correctly), or type them correctly:

cmake -Dall=OFF -Dmathmore=OFF -Dbuiltin_zlib=ON -Dgfal=OFF -Dbuiltin_freetype=ON -Dbuiltin_ftgl=ON -Droofit=ON -Dfftw3=ON -DFFTW_INCLUDE_DIR=D:\Software\fftw-3.3.5-dll32\ -DFFTW_LIBRARY=D:\Software\fftw-3.3.5-dll32\libfftw3-3.lib D:\root

I apologise, I was doing it wrong. I should have confirmed before doing so. Also I think the commands were wrong

Even after

thereā€™s this new error


"D:\buildroot\ALL_BUILD.vcxproj" (default target) (1) ->
"D:\buildroot\graf2d\asimage\ASImage.vcxproj" (default target) (5) ->
"D:\buildroot\core\Core.vcxproj" (default target) (6) ->
"D:\buildroot\core\base\Base.vcxproj" (default target) (7) ->
"D:\buildroot\PCRE.vcxproj" (default target) (207) ->
(CustomBuild target) ->
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code
1. [D:\buildroot\PCRE.vcxproj]

    4 Warning(s)
    1 Error(s)

Time Elapsed 00:03:41.01

Apparently the PCRE build failed. Check if one of the .log files in the D:\buildroot\PCRE-prefix\src\PCRE-stamp directory contain any error messageā€¦