Compilation error (root-argparse.py, rootcling-argparse.py) on Windows with VS2022

Dear experts,
I have a problem compiling roon on Windows with VS2022. I followed the installation manual
(root.cern/install) and the most of the compilation was done successfully, except for 2 errors; root-argparse.py, rootcling-argparse.py. It looks something related to the command and/or options. I’m not familier with vcproj files. Could you suggested me to what to do? The error messages are below.
Cheers, Aki

----------------------------------------
CustomBuild:
  Generating ../../ginclude/TApplicationCommandLineOptionsHelp.h
  '-B' is not recognized as an internal or external command,
  operable program or batch file.
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB8066: Custom build for 'C:\root6
\root_src\core\base\src\root-argparse.py' exited with code 9009. [C:\root6\root_build\core\base\Base.vcxproj]
Done Building Project "C:\root6\root_build\core\base\Base.vcxproj" (default targets) -- FAILED.
----------------------------------------
CustomBuild:
  Generating ../../ginclude/rootclingCommandLineOptionsHelp.h
  '-B' is not recognized as an internal or external command,
  operable program or batch file.
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB8066: Custom build for 'C:\root6
\root_src\core\dictgen\src\rootcling-argparse.py' exited with code 9009. [C:\root6\root_build\core\dictgen\Dictgen.vcxproj]
Done Building Project "C:\root6\root_build\core\dictgen\Dictgen.vcxproj" (default targets) -- FAILED.
----------------------------------------

Please fill also the fields below. Note that root -b -q will tell you this info, and starting from 6.28/06 upwards, you can call .forum bug from the ROOT prompt to pre-populate a topic.

_ROOT Version:v6-28-06
_Platform: Windows
_Compiler: Visual Studio 2022


Welcome to the ROOT Forum!
May I ask why you build from source? Why not taking a pre-built binary?

I need to make my own root classes on Windows, with ROOT6. So far it is not successful (compilation can be done, but dll loading fails. This can be another problem.) To make sure my working environment, I’m trying to install ROOT itself from source.

OK, so can you provide the exact command you used to configure ROOT, with the output log, and the exact command you used to build ROOT, also with the output log?

Thanks. If you mean the command cmake. It is as follows.
cmake -G"Visual Studio 17 2022" -A Win32 -Thost=x64 -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=…/root_install …/root_src
cmake --build . --config Release --target install

Sorry, which output log should I put? All the output on the command prompt?

Yes, please. At least for this one: cmake -G"Visual Studio 17 2022" -A Win32 -Thost=x64 -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=…/root_install …/root_src, starting from scratch (ie.e from an empty directory)

The output of the second cmake is attached.
hoge.txt (240.2 KB)
OK. I’m working on the first cmake…

This is the output of the 1st cmake.
cmake1.txt (13.0 KB)

Also on the stderr. A few outputs as follows. Could be due to python development package?

CMake Warning at cmake/modules/SearchRootCoreDeps.cmake:223 (message):
No supported Python 2 or 3 development packages were found; PyROOT will not
be built.
Call Stack (most recent call first):
CMakeLists.txt:164 (include)

CMake Deprecation Warning at cmake/modules/RootBuildOptions.cmake:434 (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)

Yes, Python (3) is needed by the build system, even if you don’t need pyROOT. Please install it and try again

Thank you. I was struggling…
I had Python 3.11, but faced problem. I anyway tried to reinstall python 3.12. And then tried to install python-dev-tools (without success).
Meanwhile, the errors on the above disappeared(!?).

I still get another 2 errors

Build FAILED.

“C:\root6\root_build4\install.vcxproj” (default target) (1) →
“C:\root6\root_build4\ALL_BUILD.vcxproj” (default target) (3) →
“C:\root6\root_build4\hsimple.vcxproj” (default target) (475) →
“C:\root6\root_build4\onepcm.vcxproj” (default target) (477) →
(CustomBuild target) →
CUSTOMBUILD : error : Parsing Linkdef file etc\dictpch\allLinkDefs.h [C:\root6\root_build4\onepcm.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB8066: Custom build for ‘C:
root6\root_build4\CMakeFiles\b882e10d692558c1c8a6499242d37c95\allDict.cxx.pch.rule;C:\root6\root_build4\CMakeFiles\1ceaa174419630c30bd6403e5d73dfb8\onepcm.r
ule’ exited with code 1. [C:\root6\root_build4\onepcm.vcxproj]

0 Warning(s)
2 Error(s)

This seemed similar to Compilation failed: V6.19/01(github master) with VS2019
I re-reinstalled python to c:\python3 (No space in path name). Then, the compilation was successful.

Thank you for your time, Bellenot!

Cheers,
Aki

1 Like

You’re very welcome! And glad to see you solved the issue!

Cheers,
Bertrand

2 Likes

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