Home | News | Documentation | Download

Compiling ROOT on Windows 10

Hi all,

I know you guys are doing progress on supporting ROOT on Windows, so I decided to go ahead and test out and see how this whole experience is :slight_smile: I have cloned the master branch and made a rootbuild directory. However, after running cmake ..\root, CMake complains that it cannot find headers related to pthread. My guess is that I don’t have everything installed to build ROOT on my box. So part of my question is then also what are the prerequisites for Windows? (I can’t seem to find this documented anywhere).
I’m running CMake 3.11.2, Windows 10 build 1803, and the latest version of Visual Studio 2017 Enterprise. MSBuild is at version version “15.7.179.6572 for .NET Framework”.

Hi,

Make sure you start from within a “x86 Native Tools Command Prompt for VS 2017”, and specify the “Visual Studio 15 2017” generator. It should look like:

C:\Users\bellenot\build\test>cmake -G"Visual Studio 15 2017" ..\..\git\master
-- The C compiler identification is MSVC 19.14.26429.4
-- The CXX compiler identification is MSVC 19.14.26429.4
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x86/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x86/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x86/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- ROOT default compression algorithm is lz4
-- Vc does not support AMD64. Support for Vc disabled.
-- Performing Test HAS_CXX14
-- Performing Test HAS_CXX14 - Success
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Performing Test GLIBCXX_USE_CXX11_ABI
-- Performing Test GLIBCXX_USE_CXX11_ABI - Failed
-- ROOT Platform: win32
-- ROOT Architecture: win32
-- Build Type: RelWithDebInfo
-- Compiler Flags: -nologo -IC:/Users/bellenot/git/master/build/win -FIw32pragma.h -FIsehmap.h -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
-- Looking for ZLib
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Zlib not found. Switching on builtin_zlib option
-- Looking for Freetype
-- Could NOT find Freetype (missing: FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS)
-- FreeType not found. Switching on builtin_freetype option
-- Building freetype version 2.6.1 included in ROOT itself
-- Looking for PCRE
-- Could NOT find PCRE (missing: PCRE_INCLUDE_DIR PCRE_PCRE_LIBRARY)
-- PCRE not found. Switching on builtin_pcre option
-- Building pcre version 8.37 included in ROOT itself
-- Looking for LZMA
-- LZMA not found. Switching on builtin_lzma option
-- Building LZMA version 5.2.1 included in ROOT itself
-- Looking for xxHash
-- Could NOT find xxHash (missing: xxHash_LIBRARY xxHash_INCLUDE_DIR)
-- xxHash not found. Switching on builtin_xxhash option
-- Looking for LZ4
-- Could NOT find LZ4 (missing: LZ4_LIBRARY LZ4_INCLUDE_DIR)
-- LZ4 not found. Switching on builtin_lz4 option
-- 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 GSL
-- Could NOT find GSL (missing: GSL_INCLUDE_DIR GSL_LIBRARY) (Required is at least version "1.10")
-- GSL not found. Set variable GSL_DIR to point to your GSL installation
--                Alternatively, you can also enable the option 'builtin_gsl' to build the GSL libraries internally'
--                For the time being switching OFF 'mathmore' option
-- Found PythonInterp: C:/Python27/python.exe (found version "2.7.5")
-- Found PythonLibs: C:/Python27/libs/python27.lib (found version "2.7.5")
-- Looking for OpenGL
-- Found OpenGL: opengl32
-- Looking for gl2ps
-- Could NOT find GL2PS (missing: GL2PS_LIBRARY GL2PS_INCLUDE_DIR)
-- gl2ps not found. Switching on builtin_gl2ps option
-- Looking for LibXml2
-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
-- LibXml2 not found. Switching off xml option
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)
-- Switching OFF 'ssl' option.
-- Looking for Castor
-- Could NOT find CASTOR (missing: CASTOR_shift_LIBRARY CASTOR_INCLUDE_DIR)
-- Castor not found. Switching off castor option
-- Looking for MySQL
-- Could NOT find MYSQL (missing: MYSQL_INCLUDE_DIR MYSQL_LIBRARIES)
-- MySQL not found. Switching off mysql option
-- Looking for Oracle
-- Oracle not found.
-- Oracle: You can specify includes: -DORACLE_PATH_INCLUDES=/usr/include/oracle/10.2.0.3/client
--    currently found includes:
-- Oracle: You can specify libs: -DORACLE_PATH_LIB=/usr/lib/oracle/10.2.0.3/client/lib
--    currently found libs: ORACLE_LIBRARY_OCCI-NOTFOUND;ORACLE_LIBRARY_CLNTSH-NOTFOUND;ORACLE_LIBRARY_LNNZ-NOTFOUND
-- Oracle not found. Switching off oracle option
-- Looking for PostgreSQL
-- Could NOT find PostgreSQL (missing: POSTGRESQL_INCLUDE_DIR POSTGRESQL_LIBRARY)
-- PostgreSQL not found. Switching off pgsql option
-- Looking for SQLite
-- Could NOT find Sqlite (missing: SQLITE_INCLUDE_DIR SQLITE_LIBRARIES)
-- SQLite not found. Switching off sqlite option
-- Looking for Pythia6
-- Pythia6 not found. Switching off pythia6 option
-- Looking for Pythia8
-- Could NOT find Pythia8 (missing: PYTHIA8_INCLUDE_DIR PYTHIA8_LIBRARY)
-- Pythia8 not found. Switching off pythia8 option
-- Looking for FFTW3
-- 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
-- Looking for CFITSIO
-- Could NOT find CFITSIO (missing: CFITSIO_INCLUDE_DIR CFITSIO_LIBRARY)
-- CFITSIO not found. You can enable the option 'builtin_cfitsio' to build the library internally'
--                    For the time being switching off 'fitsio' option
-- Looking for XROOTD
-- XROOTD not found. Set environment variable XRDSYS to point to your XROOTD installation
--                   Alternatively, you can also enable the option 'builtin_xrootd' to build XROOTD internally
--                   For the time being switching OFF 'xrootd' option
-- Could NOT find GFAL (missing: GFAL_INCLUDE_DIR SRM_IFCE_INCLUDE_DIR GFAL_LIBRARY)
-- GFAL library not found. Set variable GFAL_DIR to point to your gfal installation
                      and the variable SRM_IFCE_DIR to the srm_ifce installation
-- For the time being switching OFF 'gfal' option
-- Enabled support for:  asimage astiff builtin_afterimage builtin_freetype builtin_ftgl builtin_gl2ps builtin_glew builtin_llvm builtin_clang builtin_lzma builtin_lz4 builtin_pcre builtin_xxhash builtin_zlib cling cxx14 exceptions explicitlink gdml genvector http opengl pch python shared thread
CMake Warning at interpreter/llvm/src/CMakeLists.txt:48 (message):
  Visual Studio generators use the x86 host compiler by default, even for
  64-bit targets.  This can result in linker instability and out of memory
  errors.  To use the 64-bit host compiler, pass -Thost=x64 on the CMake
  command line.


-- The ASM compiler identification is MSVC
-- Found assembler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x86/cl.exe
-- Warning: Did not find file Compiler/MSVC-ASM
-- Looking for backtrace
-- Looking for backtrace - not found
-- Could NOT find Backtrace (missing: Backtrace_LIBRARY Backtrace_INCLUDE_DIR)
-- Native target architecture is X86
-- Threads disabled.
-- Doxygen disabled.
-- Go bindings disabled.
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- OCaml 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
-- Performing Test CXX_HAS_fno_rtti
-- Performing Test CXX_HAS_fno_rtti - Failed
-- Performing Test C_HAS_Wno_strict_overflow
-- Performing Test C_HAS_Wno_strict_overflow - Failed
-- Performing Test C_HAS_Wno_maybe_uninitialized
-- Performing Test C_HAS_Wno_maybe_uninitialized - Failed
-- Performing Test C_HAS_Wno_parentheses_equality
-- Performing Test C_HAS_Wno_parentheses_equality - Failed
-- Performing Test CXX_HAS_fno_strict_aliasing
-- Performing Test CXX_HAS_fno_strict_aliasing - Failed
-- Performing Test CXX_HAS_Wno_parentheses_equality
-- Performing Test CXX_HAS_Wno_parentheses_equality - Failed
-- Performing Test found_setresuid
-- Performing Test found_setresuid - Failed
-- Performing Test found_stdstringview
-- Performing Test found_stdstringview - Failed
-- Performing Test found_stdexpstringview
-- Performing Test found_stdexpstringview - Failed
-- Performing Test found_stdapply
-- Performing Test found_stdapply - Failed
-- Performing Test found_stdinvoke
-- Performing Test found_stdinvoke - Success
-- Performing Test found_stdindexsequence
-- Performing Test found_stdindexsequence - Success
-- Performing Test found_attribute_always_inline
-- Performing Test found_attribute_always_inline - Failed
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/bellenot/build/test

Cheers, Bertrand.

1 Like

Thanks, it seems that it is able to pass the configure step now. I now assume the next step is to run msbuild ROOT.sln? In that case, MSBuild complains that there are multiple projects named Cling in the solution file. :thinking:

Try:

cmake --build . --config Release -- /maxcpucount

or

cmake --build . --config Debug -- /maxcpucount

Cheers, Bertrand.

Thanks a lot! Works like a charm (Except it took 2 hours for me to get a failed build :slight_smile: Maybe this is worth documenting somewhere and link it in the readme on Github? I’m building this in a small VM I set up with a pretty minimal setup (Git, CMake, Python, and VS Build tools), we will see how the next build goes.

Cheers,
Martin

Edit:
Had to turn off Python in the configure stage, then everything works.

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