pyROOT on Windows11: module libcppyy* is missing (No module named 'libcppyy3_11')

Hello,

I have issues making pyROOT work on my installation.
Due to unlucky circumstances I have to work on a Windows 11 - 64 bit system and I fear this may change some things that are not documented.

In short, the problematic error message I get is:

>>> import ROOT
ModuleNotFoundError: No module named 'libcppyy3_11'

During handling of the above exception, another exception occurred:

ImportError: Failed to import libcppyy3_11. Please check that ROOT has been built for Python 3.11

Since the pre-compiled binaries didn’t work (they used Python 3.8 if I remember correctly); I attempted to compile it myself.
Here is the procedure I followed:

  1. Install all listed dependencies
    1. Newest CMake form linked Website
    2. Newest Visual Studio Code from linked Website (Community Edition)
    3. Python was already installed (3.11.2 - see post footer for full version)
  2. Clone the root repository from Github
  3. Checkout the tag v6-28-04
  4. Create new directories install_dir and build_dir in a path without spaces and set the corresponding variables, source_dir being the cloned repo itself.
  5. Compile (PowerShell 7.3.4):
cmake -G"Visual Studio 17 2022" -A x64 -Thost=x64 -DCMAKE_INSTALL_PREFIX=$install_dir $source_dir
cmake --build . --config Release --target install
  1. Move into bin subfolder: cd $install_dir/bin (PowerShell)
  2. Execute thisroot.ps1: thisroot.ps1 (PowerShell)
  3. (Start Python and try to import the package)

The compilation seems to have worked and I watched it the whole time, catching only WARN errors relevant to type-conversion. I have stored examples of those and could share them if needed.

Additional things I have tried:

  • Execute root. This works fine!
  • Add the user environment variable PYTHONPATH with the value <install_dir>\bin.
  • Add the path <install_dir>\bin to user’s PATH.
  • Restart the Computer
  • Run thisroot.bat inside a “x64 Native Tools Command Prompt for VS 2022” and start python there.
  • Read the hundreds of others posts with the same error message, but apparently other causes for it.
  • Try and find the file (using the Debian-WSL):
cd root_v6.28.04_py3.11 # (install_dir)
find . -name '*cppyy*'
./bin/cppyy
./bin/cppyy/_cpython_cppyy.py
./bin/cppyy/_pypy_cppyy.py
./bin/cppyy_backend
./bin/cppyy_backend/_cppyy_generator.py
./bindings/pyroot/cppyy
./bindings/pyroot/cppyy/cppyy
./bindings/pyroot/cppyy/cppyy-backend
./bindings/pyroot/cppyy/cppyy-backend/cppyy_backend3_11.dir
./bindings/pyroot/cppyy/cppyy-backend/cppyy_backend3_11.vcxproj
./bindings/pyroot/cppyy/cppyy-backend/cppyy_backend3_11.vcxproj.filters
./bindings/pyroot/cppyy/CPyCppyy/cppyy3_11.dir
./bindings/pyroot/cppyy/CPyCppyy/cppyy3_11.vcxproj
./bindings/pyroot/cppyy/CPyCppyy/cppyy3_11.vcxproj.filters

Things I haven’t tried:

  • Other compilation options/flags

Weird things I noticed in my attempts:

  • Compilation ignored the install_dir directive, so I ended up using the same folder for install_dir and build_dir.
  • Compilation fails more or less silently if any of the *_dir includes spaces in its path (it prints fatal error messages but does not stop and if I miss those, nothing hints at the errors in the last logged lines of execution).

Full Error behavior:

❯ python
Python 3.11.2 (tags/v3.11.2:878ead1, Feb  7 2023, 16:38:35) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
Traceback (most recent call last):
  File "C:\ProgramShares\root_v6.28.04_py3.11\bin\cppyy\__init__.py", line 60, in <module>
    importlib.import_module(libcppyy_mod_name)
  File "C:\Users\utrfh\AppData\Local\Programs\Python\Python311\Lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1142, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'libcppyy3_11'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\ProgramShares\root_v6.28.04_py3.11\bin\ROOT\__init__.py", line 25, in <module>
    import cppyy
  File "C:\ProgramShares\root_v6.28.04_py3.11\bin\cppyy\__init__.py", line 62, in <module>
    raise ImportError(
ImportError: Failed to import libcppyy3_11. Please check that ROOT has been built for Python 3.11

I will now attempt to install it in the WSL in the hopes that this will do. Therefore, in the hope that we can find a solution, this post is also meant as a log of my attempts for others to cross-check any difficulties they may have.
Thank you for reading so far.


Please read tips for efficient and successful posting and posting code

ROOT Version: 6.28.04
Platform: Windows 11 - 64 bit
Compiler: cmake (“Visual Studio 17 2022”)
Python Version: 3.11.2 (tags/v3.11.2:878ead1, Feb 7 2023, 16:38:35) [MSC v.1934 64 bit (AMD64)] on win32


I’ll have to try with Python 3.11, but in the meanwhile, can you check if there is a libcppyy3_11.pyd in the C:\ProgramShares\root_v6.28.04_py3.11\bin directory?

Hi @bellenot,
thank you for taking a look.
I could not find libcppyy3_11.pyd in C:\ProgramShares\root_v6.28.04_py3.11\bin:
(again using find from the WSL)

❯ pwd
/mnt/c/ProgramShares/root_v6.28.04_py3.11
❯ find ./bin/ -name 'libcppyy3_11.pyd'
❯ find . -name '*.pyd'

The Windows search from Windows Explorer also returns nothing.
I also checked the message examples I saved from the compilation attempt, but there was nothing matching “.pyd”, “3_11” or “cppyy”.

Then something in the configuration/compilation went wrong. Please check the output of:

cmake -G"Visual Studio 17 2022" -A x64 -Thost=x64 -DCMAKE_INSTALL_PREFIX=$install_dir $source_dir

There should be something like this for Python (3.11 in your case):

-- Looking for Python
-- Found Python3: C:/Python39/python.exe (found version "3.9.6") found components: Interpreter Development NumPy Development.Module Development.Embed
-- Could NOT find Python2 (missing: Python2_EXECUTABLE Python2_LIBRARIES Python2_INCLUDE_DIRS Python2_NumPy_INCLUDE_DIRS Interpreter Development NumPy Development.Module Development.Embed)
    Reason given by package:
        Interpreter: Wrong major version for the interpreter "C:/Python39/python.exe"

And at the end:

-- Enabled support for:  asimage builtin_afterimage builtin_cfitsio builtin_clang builtin_cling builtin_freetype builtin_ftgl builtin_gl2ps builtin_glew builtin_gtest builtin_llvm builtin_lz4 builtin_lzma builtin_nlohmannjson builtin_openui5 builtin_pcre builtin_tbb builtin_unuran builtin_xxhash builtin_zlib builtin_zstd clad dataframe exceptions fftw3 fitsio gdml http imt mathmore mlp minuit2 odbc opengl pyroot pythia6 pythia8 roofit webgui root7 shared sqlite tmva tmva-cpu tmva-pymva spectrum unuran xml
-- Configuring done

(look for the pyroot option)

(I do not have python2 installed)

Here is the procedure:

$source_dir = "C:\ProgramShares\root"
$install_dir = "C:\ProgramShares\root_v6.28.04_py3.11"
$build_dir = $install_dir
cd $build_dir

cmake -G"Visual Studio 17 2022" -A x64 -Thost=x64 -DCMAKE_INSTALL_PREFIX=$install_dir $source_dir

And at the end I get:

-- Enabled support for:  asimage builtin_afterimage builtin_clang builtin_cling builtin_freetype builtin_ftgl builtin_gl2ps builtin_glew builtin_gtest builtin_llvm builtin_lz4 builtin_lzma builtin_nlohmannjson builtin_openui5 builtin_pcre builtin_tbb builtin_xxhash builtin_zlib builtin_zstd clad dataframe exceptions gdml http imt mlp minuit2 opengl pyroot roofit webgui root7 shared tmva tmva-pymva spectrum
-- Configuring done (42.0s)
-- Generating done (32.3s)
-- Build files have been written to: C:/ProgramShares/root_v6.28.04_py3.11

So pyroot is indeed there: ...opengl pyroot roofit...!
I have attached the full output for completeness and better readability.
root_forum_help_CMAKE-G.txt (5.5 KB)

OK, thanks. But I think you should not use the same location to build and to install ROOT. I.e. NOT $build_dir = $install_dir

Okay, I will try it again using a separate build_dir and report back.

I may have misinterpreted the results of my first attempts as “the install_dir is being ignored” and therefore skipping that step afterwards, while I had other problems. I think I may not have tried it again after fixing those (paths with spaces to be precise), so that could very well be the cause for my problems.

Recompiling did not help.
The $install_dir is empty and all files, including the bin folder, have been written into $build_dir.
I suppose that setting the DCMAKE_INSTALL_PREFIX does not work correctly with those PowerShell variables (I also noted that the instructions use a relative path, which may also change things).

I therefore redid an attempt following exactly the procedure given by the installation instructions, where I used the “x64 Native Tools Command Prompt for VS 2022”:

cd C:\ProgramShares
git clone --branch latest-stable --depth=1 https://github.com/root-project/root.git root_src
mkdir root_build root_install && cd root_build
cmake -G"Visual Studio 17 2022" -A x64 -Thost=x64 -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=../root_install ../root_src
cmake --build . --config Release --target install

This did not change anything:

find root_install/bin/ -name '*cppy*'
find root_build/bin/ -name '*cppy*'
./bin/cppyy
./bin/cppyy/_cpython_cppyy.py
./bin/cppyy/_pypy_cppyy.py
./bin/cppyy_backend
./bin/cppyy_backend/_cppyy_generator.py

And the build finished with 350 warnings and 1 Error:

the custom build for ... [C:\ProgramShares\root_build\TBB.vcxproj] exited with code 1.

I then retried it once with inverted slashes (cmake -G"Vis... -DCMAKE_INSTALL_PREFIX=..\root_install ..\root_src) but this does not seem to change anything.

OK, never seen such failure. I’ll have to debug it, once I can set-up a dedicated VM…

1 Like

So I followed almost exactly your example (I had to disable root7 since it doesn’t compile with the latest version of Visual Studio, and it’s on Windows 10, but that shouldn’t make any difference), and here is what I got at configure time:

C:\ProgramShares\root_build>cmake -G"Visual Studio 17 2022" -A x64 -Thost=x64 -Droot7=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=../root_install ../root_src
CMake Deprecation Warning at CMakeLists.txt:16 (cmake_policy):
  The OLD behavior for policy CMP0091 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.36.32532.0
-- The CXX compiler identification is MSVC 19.36.32532.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.29.2.windows.3")
-- Detected ROOT_VERSION 6.28.04
-- Checking internet connectivity
-- Checking internet connectivity - found
-- Looking for Python
-- Found Python3: C:/Python311/python.exe (found version "3.11.3") found components: Interpreter Development NumPy Development.Module Development.Embed
-- Could NOT find Python2: Found unsuitable major version "3", but required major version is exact version "2"
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
-- Performing Test GLIBCXX_USE_CXX11_ABI
-- Performing Test GLIBCXX_USE_CXX11_ABI - Failed
-- ROOT Platform: win32
-- ROOT Compiler: MSVC 19.36.32532.0
-- ROOT Processor: AMD64
-- ROOT Architecture: win64
-- Build Type: '' (flags = '')
-- Compiler Flags: -nologo -IC:/ProgramShares/root_src/build/win -FIw32pragma.h -FIsehmap.h -Zc:__cplusplus -std:c++17 -MD -GR -EHsc- -W3 -wd4141 -wd4291 -wd4244 -wd4049 -wd4146 -D_WIN32 -wd4267 -D_WIN64 -D_XKEYCHECK_H -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING -D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
-- ROOT default compression algorithm: zlib
CMake Deprecation Warning at cmake/modules/RootBuildOptions.cmake:428 (message):
  >>> Option 'gfal' is deprecated and will be removed in the next release of
  ROOT.  Please contact root-dev@cern.ch should you still need it.
Call Stack (most recent call first):
  CMakeLists.txt:166 (include)


-- PyROOT will be built for version 3.11.3
-- Looking for ZLib
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Zlib not found. Switching on builtin_zlib option
-- Looking for nlohmann/json.hpp
-- nlohmann/json.hpp not found. Switching on builtin_nlohmannjson 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.12.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
-- Looking for LZMA
-- Could NOT find LibLZMA (missing: LIBLZMA_LIBRARY LIBLZMA_INCLUDE_DIR LIBLZMA_HAS_AUTO_DECODER LIBLZMA_HAS_EASY_ENCODER LIBLZMA_HAS_LZMA_PRESET)
-- LZMA not found. Switching on builtin_lzma option
-- Building LZMA version 5.2.4 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 ZSTD
-- Could NOT find ZSTD (missing: ZSTD_LIBRARIES ZSTD_INCLUDE_DIR ZSTD_VERSION)
-- ZSTD not found. Switching on builtin_zstd option
-- Performing Test C_FLAG_MP
-- Performing Test C_FLAG_MP - Success
-- Performing Test CXX_FLAG_MP
-- Performing Test CXX_FLAG_MP - Success
-- Performing Test C_FLAG_D_UNICODE
-- Performing Test C_FLAG_D_UNICODE - Success
-- Performing Test CXX_FLAG_D_UNICODE
-- Performing Test CXX_FLAG_D_UNICODE - Success
-- Performing Test C_FLAG_DUNICODE
-- Performing Test C_FLAG_DUNICODE - Success
-- Performing Test CXX_FLAG_DUNICODE
-- Performing Test CXX_FLAG_DUNICODE - Success
-- 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 AfterImage
-- Could NOT find AfterImage (missing: AFTERIMAGE_INCLUDE_DIR AFTERIMAGE_LIBRARIES)
-- AfterImage not found. Switching on builtin_afterimage option
-- Looking for GSL
-- Found GSL: C:/libs/x64/GSL/2.7/include (found suitable version "2.7", minimum required is "1.10")
-- Looking for OpenGL
-- Found OpenGL: opengl32
-- Looking for GLEW
-- Could NOT find GLEW (missing: GLEW_LIBRARIES) (found version "2.1.0")
-- GLEW not found. Switching on builtin_glew option
-- 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_LIBRARY 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 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_LIBRARY PostgreSQL_INCLUDE_DIR)
-- 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
-- Found Pythia8: C:/libs/x64/pythia8/8.3.03/include
-- 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_LIBRARY CFITSIO_INCLUDE_DIR)
-- CFITSIO not found. You can enable the option 'builtin_cfitsio' to build the library internally'
--                    For the time being switching off 'fitsio' 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
-- Could NOT find FTGL (missing: FTGL_INCLUDE_DIR FTGL_LIBRARY)
-- ftgl library not found. Set variable FTGL_ROOT_DIR to point to your installation
-- For the time being switching ON 'builtin_ftgl' option
-- Looking for TBB
-- Could NOT find TBB (missing: TBB_ROOT_DIR TBB_INCLUDE_DIR) (Required is at least version "2018")
-- TBB not found, enabling 'builtin_tbb' option
-- Cannot select cudnn without selecting cuda or tmva-gpu. Option is ignored
-- Looking for BLAS for optional parts of TMVA
-- Looking for sgemm_
-- Looking for sgemm_ - not found
-- Could NOT find BLAS (missing: BLAS_LIBRARIES)
-- Using GSL CBLAS for optional parts of TMVA
-- Performing Test ROOT_HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test ROOT_HAVE_CXX_ATOMICS_WITHOUT_LIB - Success
-- Building LLVM in 'Release' mode.
-- The ASM compiler identification is MSVC
-- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x64/cl.exe
-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
-- 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.
-- Could NOT find Python module pygments
-- Could NOT find Python module pygments.lexers.c_cpp
-- Could NOT find Python module yaml
-- LLVM host triple: x86_64-pc-windows-msvc
-- LLVM default target triple: x86_64-pc-windows-msvc
-- Found Python3: C:/Python311/python.exe (found suitable version "3.11.3", minimum required is "3.0") found components: Interpreter
-- LLVMHello ignored -- Loadable modules not supported on this platform.
-- Targeting X86
-- Targeting NVPTX
-- Clang version: 13.0.0
-- Not building amdgpu-arch: hsa-runtime64 not found
-- PrintFunctionNames ignored -- Loadable modules not supported on this platform.
-- AnnotateFunctions ignored -- Loadable modules not supported on this platform.
-- Attribute ignored -- Loadable modules not supported on this platform.
-- CallSuperAttr ignored -- Loadable modules not supported on this platform.
-- BugpointPasses ignored -- Loadable modules not supported on this platform.
-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
-- Cling version (from VERSION file): ROOT_1.0~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
-- Looking for m
-- Looking for m - not found
-- Performing Test GCC_HAS_BIDI_CHARS_FLAG
-- Performing Test GCC_HAS_BIDI_CHARS_FLAG - Failed
-- Performing Test CXX_HAS_Wno_delete_non_virtual_dtor
-- Performing Test CXX_HAS_Wno_delete_non_virtual_dtor - Failed
-- Performing Test CXX_HAS_Wno_misleading_indentation
-- Performing Test CXX_HAS_Wno_misleading_indentation - Failed
-- Performing Test CXX_HAS_Wno_overloaded_virtual
-- Performing Test CXX_HAS_Wno_overloaded_virtual - Failed
-- Distributed RDataFrame enabled
-- Performing Test found_setresuid
-- Performing Test found_setresuid - Failed
-- Performing Test found_stdstringview
-- Performing Test found_stdstringview - Success
-- Performing Test found_stod_stringview
-- Performing Test found_stod_stringview - Failed
-- Performing Test found_opplusequal_stringview
-- Performing Test found_opplusequal_stringview - Success
-- Performing Test found_stdapply
-- Performing Test found_stdapply - Success
-- 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
-- Performing Test has_found_attribute_noinline
-- Performing Test has_found_attribute_noinline - Failed
-- Performing Test found_hardware_interference_size
-- Performing Test found_hardware_interference_size - Failed
-- ROOT Configuration

System          Windows-10.0.19045
Processor       8 core 2899 MHz GenuineIntel Unknown P6 family (AMD64)
Build type
Install path    C:/ProgramShares/root_install
Compiler        MSVC 19.36.32532.0
Compiler flags:
C               -nologo -IC:/ProgramShares/root_src/build/win -FIw32pragma.h -FIsehmap.h -MD -EHsc- -W3 -D_WIN32 -wd4267 -D_WIN64 -DNOMINMAX
C++             -nologo -IC:/ProgramShares/root_src/build/win -FIw32pragma.h -FIsehmap.h -Zc:__cplusplus -std:c++17 -MD -GR -EHsc- -W3 -wd4141 -wd4291 -wd4244 -wd4049 -wd4146 -D_WIN32 -wd4267 -D_WIN64 -D_XKEYCHECK_H -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING -D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
Linker flags:
Executable      /machine:x64
Module          /machine:x64 -ignore:4049,4206,4217,4221 -incremental:no
Shared          /machine:x64 -ignore:4049,4206,4217,4221 -incremental:no

-- Enabled support for:  asimage builtin_afterimage builtin_clang builtin_cling builtin_freetype builtin_ftgl builtin_gl2ps builtin_glew builtin_gtest builtin_llvm builtin_lz4 builtin_lzma builtin_nlohmannjson builtin_openui5 builtin_pcre builtin_tbb builtin_xxhash builtin_zlib builtin_zstd clad dataframe exceptions gdml http imt mathmore mlp minuit2 opengl pyroot pythia8 roofit webgui shared tmva tmva-cpu tmva-pymva spectrum
-- Configuring done (135.9s)
-- Generating done (15.5s)
-- Build files have been written to: C:/ProgramShares/root_build

Then, after a successful cmake --build . --config Release --target install (but with 538 Warnings), testing PyROOT just works:

**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.6.1
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

C:\root-dev>cd \ProgramShares

C:\ProgramShares>setenv x64
C:\ProgramShares>cd root_install

C:\ProgramShares\root_install>bin\thisroot.bat

C:\ProgramShares\root_install>python
Python 3.11.3 (tags/v3.11.3:f3909b8, Apr  4 2023, 23:49:59) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
>>>

Thank you very much for attempting this on your side.
I ran a diff over your configuration results and mine. The resulting compiler flags are identical.
However, your logs include more “Detecting”, “Looking For” and “Performing Test” messages than mine, but I don’t know how to weigh those.
I suppose the error or problem lies somewhere else… I’ll try with deactivated root7 next week when I have some time for this, but I can’t see how and why that would change anything.

It’s most probably because I started from scratch (in an empty directory). If you configure again in a non-empty build directory you got less output. And the root7 error I got is unrelated. If you don’t have any build error, then you can keep it.

I sadly didn’t have time to look at the issue again, but I don’t see any other way than trying from scratch again.
(I could obviously use other methods like Anaconda, installing in the subsystem for Linux, installing the pre-compiled release and corresponding python version… but that wouldn’t solve the problem here.)

Before I make further attempts for nothing, I wanted to know if there is a way to make the compilation abort at the first error, and if the generated logs are stored in a file or if I have to redirect them myself. That way I could maybe find what is missing.

AFAIK, there is no way of stopping at first error (especially with parallel builds). And you have to redirect the output to a file yourself.

Alright, thank you, I’ll try again this week and see what I can find. :slight_smile: