Possible to skip "Generating G_[...].cxx [..etc..].rootmap" during compilation?

When building ROOT (6), is it possible to skip the “Generating G_[…].cxx, …/…/lib/lib[…]_rdict.pcm, …/…/lib/lib[…].rootmap” steps or somehow make them faster?

Are you building a ‘debug’ or ‘optimized’ version? Are you using multiple core to do the build?

I am usually building a Debug version. Does a Release configuration compile these things faster (I thought it was the other way around)? I use multiple cores, but this does not help.

My problem is: I’m doing (RooFit) development, so I’m recompiling a lot. Often these are only small changes, and most of the times this “Generating G_[…].cxx…” step takes a minute or so, whereas the actual compilation of the cxx file I changed only takes seconds. This is really interfering with my development iteration cycle.

By the way, I am building on macOS with clang (5.0.0), if that makes a difference.

You can ‘skip’ the generation of the pch by specifying explicitly the target “RooFit” (as a parameter of ninja and/or make).
This will be okay unless you change the content of the header files (in which you might get a message about mismatch at run-time).
As far as the G__ they should only rebuild if the header have changed. If it runs more often than that then they might be a deficiency in the dependency tracking. (i.e. we would need to dwelve into more details).


That works, thanks!

Indeed, when I try to make all targets, I almost always get the G__ generation step for RooFitCore.cxx. For instance, just now I only changed a small thing in one of the Minuit2 cxx files, and it started with the G__ step for RooFitCore and some time later the whole RooFit stack gets rebuilt:

Scanning dependencies of target RooFitCore
[ 95%] Building CXX object roofit/roofitcore/CMakeFiles/RooFitCore.dir/G__RooFitCore.cxx.o
[ 95%] Linking CXX shared library ../../lib/libRooFitCore.so
[ 97%] Built target RooFitCore
[ 97%] Generating G__RooFit.cxx, ../../lib/libRooFit_rdict.pcm, ../../lib/libRooFit.rootmap
[ 97%] Built target G__RooFit
Scanning dependencies of target RooFit
[ 97%] Building CXX object roofit/roofit/CMakeFiles/RooFit.dir/G__RooFit.cxx.o
[ 97%] Linking CXX shared library ../../lib/libRooFit.so
[ 97%] Built target RooFit
[ 97%] Generating G__RooStats.cxx, ../../lib/libRooStats_rdict.pcm, ../../lib/libRooStats.rootmap
[ 97%] Built target G__RooStats
Scanning dependencies of target RooStats
[ 97%] Building CXX object roofit/roostats/CMakeFiles/RooStats.dir/G__RooStats.cxx.o
[ 97%] Linking CXX shared library ../../lib/libRooStats.so
[ 98%] Built target RooStats
[ 98%] Generating G__HistFactory.cxx, ../../lib/libHistFactory_rdict.pcm, ../../lib/libHistFactory.rootmap
[ 98%] Built target G__HistFactory
[ 98%] Generating etc/dictpch/allLinkDefs.h, etc/dictpch/allHeaders.h, etc/dictpch/allCppflags.txt
Scanning dependencies of target HistFactory
[ 98%] Building CXX object roofit/histfactory/CMakeFiles/HistFactory.dir/G__HistFactory.cxx.o

Generating PCH for core/base core/clingutils core/imt core/multiproc core/rint core/thread graf2d/asimage graf2d/cocoa graf2d/gpad graf2d/graf graf2d/postscript graf2d/quartz graf3d/g3d graf3d/gl gui/fitpanel gui/gui hist/hist hist/histpainter hist/spectrum hist/spectrumpainter hist/unfold io/io math/genetic math/genvector math/mathcore math/mathmore math/matrix math/minuit math/minuit2 math/physics math/smatrix math/splot net/net roofit/histfactory roofit/roofit roofit/roofitcore roofit/roostats tmva/tmva tmva/tmvagui tree/tree tree/treeplayer tree/treeviewer

[ 98%] Generating etc/allDict.cxx.pch
[ 98%] Linking CXX shared library ../../lib/libHistFactory.so
[100%] Built target HistFactory
[100%] Linking CXX executable ../../bin/hist2workspace
[100%] Built target hist2workspace

Indeed perhaps some issue in the RooFit etc cmake files? If you feel like tracking down the issue, I’d be happy to help.


We are aware of this limitation where the dictionary are rebuild upon change in either the header or the source of the used/dependent libraries are changed. Ideally it would be just the headers but we have had some trouble tweaking the cmake files to do it properly.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.