Report: experience building 5.34.24 with CMake on Windows

After unpacking version 5.34.24 files into C:\RootBuild folder on my Windows 8 machine I run CMake 3.1.0 like this:

C:\RootBuild>cmake.exe -G "Visual Studio 12 2013" .\root_v5.34.24
Initially, I did run CMake at the root of the unpacked source tree, i.e. inside root_v5.34.24 folder, but CMake complained that it wants to protect original source code, so I moved up, to its parent folder RootBuild.

CMake couldn’t determine if GSL is present (it wasn’t on my machine) and apparently got stuck looking for it. After about half an hour of waiting for CMake to not find it, I cancelled the command and added CMake option declaring that GSL is present (-Dbuiltin_gsl=ON to the command above), rerun CMake and finally got my Visual Studio 2013 solution created.

Opening it in Visual Studio and not knowing exactly what to build, in which order, I picked “Rebuild solution” menu option.

This resulted in many errors related to missing liblzma. LZMA folder had liblzma.dll, but was missing export library needed by the linker for other modules.

However, liblzma.def file was available in LZMA doc folder so it was easy to regenerate export library
using the lib program that comes with Visual Studio compiler:

lib /def:liblzma.def /out:liblzma.lib /machine:x86
After that, I got only a few linker errors for modules that need GSL libraries, but I can tolerate not having advanced math for the time being.
Other than that, hundreds of programs built just fine producing executables and dlls in bin folder.

root.exe run for the first time and I was able to draw a few graphs and histograms typing few lines of code
from the documentation. After running tutorials I was really impressed with what I got in a few hours work.

Many thanks Root team!

I tried to repeat the same with Root version 6.02.02 but I run into compilation errors.
Visual C++ wasn’t happy about quite a few things. I knew about some issues already, like the support for constexpr, but in other cases it looks like GCC is way more tolerant than VC++.

I will report details on some of these errors in my next posts.

Hi,

The problems you describe look very strange to me. They might be due to a corrupted build (e.g. a previously failed one), since we build ROOT on several Windows machines, and never got such problems. I would suggest to re-try from scratch with a proper out of source build.
For example, I just tried on my own machine, configuring like this:

cmake -G"Visual Studio 12 2013" c:\Users\bellenot\git\v5-34-00-patches
Gives as result

-- Enabled support for:  asimage astiff builtin_afterimage builtin_ftgl builtin_freetype builtin_glew builtin_pcre builtin_zlib builtin_lzma cintex exceptions explicitlink fortran genvector odbc opengl python reflex shared thread tmva
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/bellenot/Temp/test_build

And then, building with:

cmake --build . --config Debug

Results in:

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:13:49.29

Then, don’t spend any time trying ROOT 6 on Windows, it is not yet supported. You will be free to try as soon as we announce its availability on Windows (hopefully soon)

Cheers, Bertrand.

Hi Bertrand,

I just downloaded 5.34.25 and tried to follow the procedure you suggested.

You were right - no issues with libzma anymore.

I also found out that my problems with CMake lockup on looking for GSL seems to be OS related.

On Windows 7 CMake figures out that GSL is not installed as fast as it does for other modules (for example FFTW, which I haven’t installed either).

On Windows 8, however, it locked up again. I guess I should report this to CMake (or just install GSL and be done with that).

Thanks,
Tony