Superbuild problem with MSVC versions

Trying to run a “superbuild” that is derived from the “superbuild” of PV 5.15.3, generating a Windows installer for a PV derived application (same version), on Windows 11.

There is a need to include a precompiled binary that was built with MSVC 2022 because only then binary compatibility between different parts also with older build tools (down to 2015) is given. Some issues could already be solved, but this one looks really hard:

[444/511] Install pybind11 for pip
FAILED: superbuild/pybind11/stamp/pybind11-pybind11-pip-install C:/dev/atgview/pack/superbuild/pybind11/stamp/pybind11-pybind11-pip-install
C:\Windows\system32\cmd.exe /C "cd /D C:\dev\atgview\pack\superbuild\pybind11\src && "C:\Program Files\CMake\bin\cmake.exe" -E env --modify PYTHONPATH=path_list_prepend:C:/dev/atgview/pack/install/Python/Lib/site-packages -- C:/dev/atgview/pack/install/Python/python.exe -m pip install --no-index --no-deps --no-build-isolation --root=C:/dev/atgview/pack/install --prefix=Python C:/dev/atgview/pack/superbuild/pybind11/src && "C:\Program Files\CMake\bin\cmake.exe" -E touch C:/dev/atgview/pack/superbuild/pybind11/stamp/pybind11-pybind11-pip-install"
Processing c:\dev\atgview\pack\superbuild\pybind11\src
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error

  Preparing metadata (pyproject.toml) did not run successfully.
  exit code: 1

  [48 lines of output]
  -- Building for: Visual Studio 14 2015
  CMake Deprecation Warning at CMakeLists.txt:13 (cmake_minimum_required):
    Compatibility with CMake < 3.10 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
    to tell CMake that the project requires at least <min> but has been updated
    to work with policies introduced by <max> or earlier.


  -- The CXX compiler identification is unknown
  CMake Error at CMakeLists.txt:49 (project):
    No CMAKE_CXX_COMPILER could be found.



  -- Configuring incomplete, errors occurred!
  Traceback (most recent call last):
    File "<string>", line 117, in remove_output
    File "<string>", line 139, in <module>
    File "C:\dev\atgview\pack\install\Python\lib\subprocess.py", line 526, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['cmake', '-S', '.', '-B', 'C:\\Users\\cornelis\\AppData\\Local\\Temp\\tmpwxr6vycd', '-DCMAKE_INSTALL_PREFIX=pybind11', '-DBUILD_TESTING=OFF', '-DPYBIND11_NOPYTHON=ON', '-Dprefix_for_pc_file=${pcfiledir}/../../']' returned non-zero exit status 1.

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "C:\dev\atgview\pack\install\Python\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "C:\dev\atgview\pack\install\Python\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "C:\dev\atgview\pack\install\Python\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 149, in prepare_metadata_for_build_wheel
      return hook(metadata_directory, config_settings)
    File "C:\dev\atgview\pack\install\Python\Lib\site-packages\setuptools\build_meta.py", line 396, in prepare_metadata_for_build_wheel
      self.run_setup()
    File "C:\dev\atgview\pack\install\Python\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup
      exec(code, locals())
    File "<string>", line 123, in <module>
    File "C:\dev\atgview\pack\install\Python\lib\contextlib.py", line 153, in __exit__
      self.gen.throw(typ, value, traceback)
    File "<string>", line 120, in remove_output
    File "C:\dev\atgview\pack\install\Python\lib\shutil.py", line 750, in rmtree
      return _rmtree_unsafe(path, onerror)
    File "C:\dev\atgview\pack\install\Python\lib\shutil.py", line 601, in _rmtree_unsafe
      onerror(os.scandir, path, sys.exc_info())
    File "C:\dev\atgview\pack\install\Python\lib\shutil.py", line 598, in _rmtree_unsafe
      with os.scandir(path) as scandir_it:
  FileNotFoundError: [WinError 3] The system cannot find the path specified: 'pybind11/include'
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

Encountered error while generating package metadata.

See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
[

On line 13, this message (from ninja) tells me that it is trying to “build” something with MSVC 2015, and then it does not find an appropriate compiler. Well yes: no MSVC 2015 compiler is present on that computer. Now I guess I have two options:

  • Either try to change the request for that old compiler “somehow”. Problem: I tried for several days now, but I did not find out where this request is really coming from
  • Or install a MSVC 2015 build system. Which however is no longer supported and is “deprecated since October 2025”

Actually I would prefer to go for the first version, because I assume that the code should compile also with newer (and installed) compilers, but as I said: So far I did not succeed to find out where that request is coming from! Somehow the entire process is in a nested call that tries to do a build through a python function that is called by… whatever… - the entire thing being the result of a cmake run that again is nested in many complicated ways

I’m confused, why not just using MSVC 2022 ?

This is exactly what I am doing! So I am also confused why in that specific location I am seeing that message, and so far I was not able to detangle the different levels of calls within calls within etc. that finally lead to that request. For ninja, this is “step 444 out of 511”, and the intention seems to be “Install pybind11 for pip”.

Actually I am having MSVC 2019, 2022 and 2026 on that computer, and for each of them I have a CMD with an automatic call to the necessary environment settings etc., and I am starting both cmake and ninja from the MSVC 2022 command line, so if I am e.g. starting cmake-gui from there, it will always find all the compiler, linker, rc etc tools from MSVC 2022.

Now if I read “pybind11” and “pip”, this is of course about compiling some Python related stuff, and I know that Windows has currently also some Python in it’s “MS Store”, that is not altogether “standard”. After I had the above trouble, I made sure that MS variant is completely deinstalled, and instead I installed some Python from python.org. Which did not help yet as far as I can see

Just one thing that comes to mind which I could possibly try: See what the MSVC2022 command line is adding to the regular path, and make sure that all these settings are added to the global PATH variable. With this I would of course “kill” the two others, but since I do not really need them for anything, and if it would solve my problem, I could probably live with it…

I’m afraid I usually have a single MSVC installation on my Windows computer, so you may be in uncharted waters there.

That’s what I am afraid I am anyway!

Actually I am having a new computer, and currently installing the “current Visual Studio” will give you 2026. Then I thought that I should best go with 2019, because PV 5.15.3 was done with that, but then I was running into that issue with the precompiled binary that I have to include, so I had to add 2022 on top of that.

Now I did what I proposed above: make sure that all 2022 related environment stuff is “hard coded” into the global PATH. Indeed I can now type “cl” in just any cmd command line, with no extra initialization, and I am getting the C/C++ compiler for MSVC 2022.

BUT STILL NOT FOR THAT pybind11 thing: The error log that I am getting is unchanged!

So first I have that line:

– Building for: Visual Studio 14 2015

and further down I have

– The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:49 (project):
No CMAKE_CXX_COMPILER could be found.

The CMakeLists.txt that it is referring to can be found - I guess! - in the build directory tree of the superbuild at /superbuild/PyBind11/src, and at line 49 there is a “project…” command. My guess is based on the fact that at line 13 I have indeed some “cmake_minimum_required(3.5)”, triggering a warning about all pre 3.10 stuff being removed in the future.

What I do not see is: Which is the process environment of that cmake call that does not find a proper compiler, because it should now ALWAYS find a compiler, because of the global PATH setting! But of course if it insists on finding an old version that is not installed… In that case I should find out WHY it insists, i.e., where sits the code that does this version check, etc.

can you share this pybind11.cmake you are using ?

pybind11.cmake (1.3 KB)

That should be the thing: untouched from the superbuild/projects folder of a ParaView superbuild version 5.15.

It says “copyright 2016…”, so it is indeed from a time when MSVC 2015 was the most recent version. Maybe I should check if in more recent ParaView superbuilds there is a more recent variant…!?

…looks like I cannot avoid starting for the long, long expedition - finding the way how starting with this .cmake file, through all the cmake steps that are generating new code and intermediate files, and finally ninja, this situation is generated where a cmake run tries to configure a pybind11 build and does not find a compiler!

So far I was more or less guessing and trying, but now I have to go step by step, again trying to understand another part of this huge labyrinthic building called “superbuild” :laughing:

Actually its pretty easy to fix, look at the boost.cmake file and how it handles MSVC versions.

Thanks - I will give it a try! And report if I was successful

Looks like that’s not the right thing yet!

Ok, first of all I did not really understand your hint, because I did not see much handling of MSVC versions in either boost.common.cmake or boost.system.cmake.

And second it is clear that the failure happens inside a “pip install” call that is supposed to do some “building” step, using available build tools.

After the “ninja” call of the superbuild terminates with error, inside the target folder I find a folder /superbuild/pybind11/ and inside that subfolders named src, build, stamp and tmp. Inside src, there is a complete set of source code, including a CMakeLists.txt, and inside build there are files that point to an already successfully run cmake.

If now within that build subfolder I look at the defined CMake variables, e.g. with cmake-gui, everything looks perfectly fine! There are CMAKE_ variables defined for the correct compiler, linker and everything that is normal for working with MSVC 2022 in any other project.

Except one “strange” setting: the variable “pc_for_prefix_file” is defined as being “${pcfiledir}/../..“, which looks to me like some variable should have been evaluated and is not. Could that be a hint!? hmm…

If now I do a “configure” and “generate”, then leave cmake-gui and do a “ninja”, I am getting the message that it has nothing left to do. This looks like a dead end road thus.

Now I can also extract the command that is failing and that is:

C:\Windows\system32\cmd.exe /C "cd /D C:\dev\atgview\pack\superbuild\pybind11\src && "C:\Program Files\CMake\bin\cmake.exe" -E env --modify PYTHONPATH=path_list_prepend:C:/dev/atgview/pack/install/Python/Lib/site-packages -- C:/dev/atgview/pack/install/Python/python.exe -m pip install --no-index --no-deps --no-build-isolation --root=C:/dev/atgview/pack/install --prefix=Python C:/dev/atgview/pack/superbuild/pybind11/src && "C:\Program Files\CMake\bin\cmake.exe" -E touch C:/dev/atgview/pack/superbuild/pybind11/stamp/pybind11-pybind11-pip-install"

Also this I can do “manually”: First switch do that indicated folder, and then the next command is that “famous” pip install command. Which tells me this:

C:\dev\atgview\pack\superbuild\pybind11\src>"C:\Program Files\CMake\bin\cmake.exe" -E env --modify PYTHONPATH=path_list_prepend:C:/dev/atgview/pack/install/Python/Lib/site-packages -- C:/dev/atgview/pack/install/Python/python.exe -m pip install --no-index --no-deps --no-build-isolation --root=C:/dev/atgview/pack/install --prefix=Python C:/dev/atgview/pack/superbuild/pybind11/src
Processing c:\dev\atgview\pack\superbuild\pybind11\src
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [48 lines of output]
      -- Building for: Visual Studio 14 2015
      CMake Deprecation Warning at CMakeLists.txt:13 (cmake_minimum_required):
        Compatibility with CMake < 3.10 will be removed from a future version of
        CMake.

        Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
        to tell CMake that the project requires at least <min> but has been updated
        to work with policies introduced by <max> or earlier.


      -- The CXX compiler identification is unknown
      CMake Error at CMakeLists.txt:49 (project):
        No CMAKE_CXX_COMPILER could be found.



      -- Configuring incomplete, errors occurred!
      Traceback (most recent call last):
        File "<string>", line 117, in remove_output
        File "<string>", line 139, in <module>
        File "C:\dev\atgview\pack\install\Python\lib\subprocess.py", line 526, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['cmake', '-S', '.', '-B', 'C:\\Users\\cornelis\\AppData\\Local\\Temp\\tmplgz3od3n', '-DCMAKE_INSTALL_PREFIX=pybind11', '-DBUILD_TESTING=OFF', '-DPYBIND11_NOPYTHON=ON', '-Dprefix_for_pc_file=${pcfiledir}/../../']' returned non-zero exit status 1.

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "C:\dev\atgview\pack\install\Python\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\dev\atgview\pack\install\Python\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "C:\dev\atgview\pack\install\Python\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 149, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
        File "C:\dev\atgview\pack\install\Python\Lib\site-packages\setuptools\build_meta.py", line 396, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "C:\dev\atgview\pack\install\Python\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup
          exec(code, locals())
        File "<string>", line 123, in <module>
        File "C:\dev\atgview\pack\install\Python\lib\contextlib.py", line 153, in __exit__
          self.gen.throw(typ, value, traceback)
        File "<string>", line 120, in remove_output
        File "C:\dev\atgview\pack\install\Python\lib\shutil.py", line 750, in rmtree
          return _rmtree_unsafe(path, onerror)
        File "C:\dev\atgview\pack\install\Python\lib\shutil.py", line 601, in _rmtree_unsafe
          onerror(os.scandir, path, sys.exc_info())
        File "C:\dev\atgview\pack\install\Python\lib\shutil.py", line 598, in _rmtree_unsafe
          with os.scandir(path) as scandir_it:
      FileNotFoundError: [WinError 3] The system cannot find the path specified: 'pybind11/include'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

And here, thus “inside” the pip install, I am getting the error message “No CMAKE_CXX_COMPILER could be found”. But as I already said: it is present in the CMakeCache.txt of the pybuild11 build folder, and it points to the MSVC 2022 compiler!

But a few lines before the strange error message it also says: “Building for: Visual Studio 14 2015“ - and well yes, I do not have these build tools installed. So the problem is: Why does the “pip install” try to find it?

At the end, it is explicitly stated that the problem is not with pip, but comes from the package.

So basically I am turning in circles here, and my guess is that maybe pip has some way to find a “current” set of MS build tools, but MS has again changed some little thing in the way how it can be found. Then it does not find anything, and looking for MSVC 2015 is some kind of “default” - and again no success because indeed not present.

Trying my good luck with asking some “Brave” search AI stuff finally points to the same direction, giving the one or other hint to be tried.

And indeed one thing brought me one step further: Include the following settings in the environment somehow:

set DISTUTILS_USE_SDK=1
set MSSdk=1

With this, “pip install” is supposed to use another method to find MS build tools, and indeed the pybind11 step was now working indeed! Correctly stating “The CXX compiler identification is MSVC 19.44.35224.0“

Now the “superbuild” hangs at the next step, which is pythonpillow.

But I am not going to investigate that one right now, but rather also look after my pillow :slight_smile:

superbuild/projects/win32/boost.cmake:

# 8.0 and below unsupported anyways.
if (NOT MSVC_VERSION VERSION_GREATER 1400)
  message(FATAL_ERROR "At least Visual Studio 9.0 is required")
elseif (NOT MSVC_VERSION VERSION_GREATER 1500)
  set(msvc_ver 9.0)
elseif (NOT MSVC_VERSION VERSION_GREATER 1600)
  set(msvc_ver 10.0)
elseif (NOT MSVC_VERSION VERSION_GREATER 1700)
  set(msvc_ver 11.0)
elseif (NOT MSVC_VERSION VERSION_GREATER 1800)
  set(msvc_ver 12.0)
elseif (NOT MSVC_VERSION VERSION_GREATER 1900)
  set(msvc_ver 14.0)
elseif (NOT MSVC_VERSION VERSION_GREATER 1919)
  set(msvc_ver 14.1)
elseif (NOT MSVC_VERSION VERSION_GREATER 1930)
  set(msvc_ver 14.2)
elseif (NOT MSVC_VERSION VERSION_GREATER 1949)
  set(msvc_ver 14.3)
else ()
  message(FATAL_ERROR "Unrecognized MSVC version: ${MSVC_VERSION}")
endif ()

Starting again and again, but not much further in the meantime…

For whatever reason, the two mentioned above environment settings did not work any more after some time (…hard not to become superstitous with Windows…), but by adding the proposed lines from Mathieu into pybind11.cmake did the trick indeed!

But not for pythonpillow…

Here the issue is that at some point it cannot find io.h

This is part of some extra installable part of the Windows SDK, but after this is installed, it is still not part of any INCLUDE path that is part of the MS provided environment setup. I simply added an INCLUDE and LIB entry to the global environment, and now they are always part of these variables during whatever build I am doing.

Except for pythonpillow!

Adding the “Mathieu lines” also to pythonpillow.cmake does not help either. And this is how the pythonpillow is supposed to be built inside the superbuild (see pythonpillow.cmake)

superbuild_add_project_python(pythonpillow
  PACKAGE
    PIL
  DEPENDS
    pythonsetuptools
    libjpegturbo
    zlib
  LICENSE_FILES
    LICENSE
  SPDX_LICENSE_IDENTIFIER
    HPND
  SPDX_COPYRIGHT_TEXT
    "Copyright © 1997-2011 by Secret Labs AB"
    "Copyright © 1995-2011 by Fredrik Lundh"
    "Copyright © 2010-2023 by Jeffrey A. Clark (Alex) and contributors"
  PROCESS_ENVIRONMENT
    ZLIB_ROOT <INSTALL_DIR>
    ${pythonpillow_process_environment})

The pythonpillow_process_environment turns out to be

INCLUDE;<INSTALL_DIR>/include;LIB;<INSTALL_DIR>/lib

in this call, but making sure that both INCLUDE and LIB would include also the proper paths to the io.h file etc. does not really change anything. But possibly I am doing it incorrectly??

This just as an intermediate status, with currently no end of the way in sight.

What error do you have with pythonpillow ?

This is the “ninja” step that fails:

[421/511] Performing build step for 'pythonpillow'
FAILED: superbuild/pythonpillow/stamp/pythonpillow-build C:/dev/atgview/pack/superbuild/pythonpillow/stamp/pythonpillow-build
C:\Windows\system32\cmd.exe /C "cd /D C:\dev\atgview\pack\superbuild\pythonpillow\src && "C:\Program Files\CMake\bin\cmake.exe" -P C:/dev/atgview/pack/superbuild/sb-pythonpillow-build.cmake && "C:\Program Files\CMake\bin\cmake.exe" -E touch C:/dev/atgview/pack/superbuild/pythonpillow/stamp/pythonpillow-build"
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-310
creating build\lib.win-amd64-cpython-310\PIL
copying src\PIL\BdfFontFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\BlpImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\BmpImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\BufrStubImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ContainerIO.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\CurImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\DcxImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\DdsImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\EpsImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ExifTags.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\features.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\FitsImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\FliImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\FontFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\FpxImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\FtexImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\GbrImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\GdImageFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\GifImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\GimpGradientFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\GimpPaletteFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\GribStubImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\Hdf5StubImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\IcnsImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\IcoImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\Image.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageChops.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageCms.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageColor.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageDraw.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageDraw2.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageEnhance.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageFilter.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageFont.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageGrab.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageMath.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageMode.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageMorph.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageOps.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImagePalette.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImagePath.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageQt.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageSequence.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageShow.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageStat.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageTk.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageTransform.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageWin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImtImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\IptcImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\Jpeg2KImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\JpegImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\JpegPresets.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\McIdasImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\MicImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\MpegImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\MpoImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\MspImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PaletteFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PalmImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PcdImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PcfFontFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PcxImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PdfImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PdfParser.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PixarImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PngImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PpmImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PsdImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PSDraw.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PyAccess.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\QoiImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\SgiImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\SpiderImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\SunImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\TarIO.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\TgaImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\TiffImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\TiffTags.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\WalImageFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\WebPImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\WmfImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\XbmImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\XpmImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\XVThumbImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\_binary.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\_deprecate.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\_tkinter_finder.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\_util.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\_version.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\__init__.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\__main__.py -> build\lib.win-amd64-cpython-310\PIL
running egg_info
writing src\Pillow.egg-info\PKG-INFO
writing dependency_links to src\Pillow.egg-info\dependency_links.txt
writing requirements to src\Pillow.egg-info\requires.txt
writing top-level names to src\Pillow.egg-info\top_level.txt
reading manifest file 'src\Pillow.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.c'
warning: no files found matching '*.h'
warning: no files found matching '*.sh'
warning: no files found matching '*.txt'
warning: no previously-included files found matching '.appveyor.yml'
warning: no previously-included files found matching '.clang-format'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.readthedocs.yml'
warning: no previously-included files found matching 'codecov.yml'
warning: no previously-included files found matching 'renovate.json'
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
no previously-included directories found matching '.ci'
adding license file 'LICENSE'
writing manifest file 'src\Pillow.egg-info\SOURCES.txt'
running build_ext
building 'PIL._imaging' extension
building 'PIL._imagingtk' extension
building 'PIL._imagingmath' extension
creating build\temp.win-amd64-cpython-310
building 'PIL._imagingft' extension
creating build\temp.win-amd64-cpython-310\Release
creating build\temp.win-amd64-cpython-310\Release
creating build\temp.win-amd64-cpython-310\Release
creating build\temp.win-amd64-cpython-310\Release\src
creating build\temp.win-amd64-cpython-310\Release\src
"C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\dev\atgview\pack\install\include\freetype2 -IC:\dev\atgview\pack\install\include -IC:\dev\atgview\pack\install\Python\include -IC:\dev\atgview\pack\install\Python\include -IC:\dev\atgview\pack\install\Python\Include -IC:/dev/atgview/pack/install/include /Tcsrc/_imagingft.c /Fobuild\temp.win-amd64-cpython-310\Release\src/_imagingft.obj
creating build\temp.win-amd64-cpython-310\Release\src\Tk
creating build\temp.win-amd64-cpython-310\Release\src\libImaging
"C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\dev\atgview\pack\install\include\freetype2 -IC:\dev\atgview\pack\install\include -IC:\dev\atgview\pack\install\Python\include -IC:\dev\atgview\pack\install\Python\include -IC:\dev\atgview\pack\install\Python\Include -IC:/dev/atgview/pack/install/include /Tcsrc/Tk/tkImaging.c /Fobuild\temp.win-amd64-cpython-310\Release\src/Tk/tkImaging.obj
"C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\dev\atgview\pack\install\include\freetype2 -IC:\dev\atgview\pack\install\include -IC:\dev\atgview\pack\install\Python\include -IC:\dev\atgview\pack\install\Python\include -IC:\dev\atgview\pack\install\Python\Include -IC:/dev/atgview/pack/install/include /Tcsrc/_imagingmath.c /Fobuild\temp.win-amd64-cpython-310\Release\src/_imagingmath.obj
"C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DUSE_WIN32_FILEIO -DPILLOW_VERSION=\"10.0.0\" -IC:\dev\atgview\pack\install\include\freetype2 -IC:\dev\atgview\pack\install\include -IC:\dev\atgview\pack\install\Python\include -IC:\dev\atgview\pack\install\Python\include -IC:\dev\atgview\pack\install\Python\Include -IC:/dev/atgview/pack/install/include /Tcsrc/_imaging.c /Fobuild\temp.win-amd64-cpython-310\Release\src/_imaging.obj
tkImaging.c
_imagingft.c
_imaging.c
_imagingmath.c
C:\dev\atgview\pack\install\Python\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
C:\dev\atgview\pack\install\Python\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
C:\dev\atgview\pack\install\Python\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
C:\dev\atgview\pack\install\Python\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
building 'PIL._imagingmorph' extension
"C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\dev\atgview\pack\install\include\freetype2 -IC:\dev\atgview\pack\install\include -IC:\dev\atgview\pack\install\Python\include -IC:\dev\atgview\pack\install\Python\include -IC:\dev\atgview\pack\install\Python\Include -IC:/dev/atgview/pack/install/include /Tcsrc/_imagingmorph.c /Fobuild\temp.win-amd64-cpython-310\Release\src/_imagingmorph.obj
_imagingmorph.c
C:\dev\atgview\pack\install\Python\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
error: command 'C:\\Program Files\\Microsoft Visual Studio\\18\\Community\\VC\\Tools\\MSVC\\14.44.35207\\bin\\HostX64\\x64\\cl.exe' failed with exit code 2
CMake Error at C:/dev/atgview/pack/superbuild/sb-pythonpillow-build.cmake:48 (message):
  Failed with exit code 1



What jumps to my eye is that it does not find “io.h” - somewhere!

I am starting the entire process (cmake and ninja) from a cmd.exe where the INCLUDE variable is defined as follows:

C:\dev\atgview\pack>echo %INCLUDE%
C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.44.35207\include;C:\Program Files\Microsoft Visual Studio\18\Community\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt

The last path in this sequence is

C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt

and this is where io.h definitely exists!

Once more I ran the same thing with “maximum verbosity” (in the CMake settings I turned on “CMAKE_VERBOSE_MAKEFILE”, and ninja I started with ninja -v), and this is the outcome:

[421/511] C:\Windows\system32\cmd.exe /C "cd /D C:\dev\atgview\pack\superbuild\pythonpillow\src && "C:\Program Files\CMake\bin\cmake.exe" -P C:/dev/atgview/pack/superbuild/sb-pythonpillow-build.cmake && "C:\Program Files\CMake\bin\cmake.exe" -E touch C:/dev/atgview/pack/superbuild/pythonpillow/stamp/pythonpillow-build"
FAILED: superbuild/pythonpillow/stamp/pythonpillow-build C:/dev/atgview/pack/superbuild/pythonpillow/stamp/pythonpillow-build
C:\Windows\system32\cmd.exe /C "cd /D C:\dev\atgview\pack\superbuild\pythonpillow\src && "C:\Program Files\CMake\bin\cmake.exe" -P C:/dev/atgview/pack/superbuild/sb-pythonpillow-build.cmake && "C:\Program Files\CMake\bin\cmake.exe" -E touch C:/dev/atgview/pack/superbuild/pythonpillow/stamp/pythonpillow-build"
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-310
creating build\lib.win-amd64-cpython-310\PIL
copying src\PIL\BdfFontFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\BlpImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\BmpImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\BufrStubImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ContainerIO.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\CurImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\DcxImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\DdsImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\EpsImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ExifTags.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\features.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\FitsImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\FliImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\FontFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\FpxImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\FtexImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\GbrImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\GdImageFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\GifImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\GimpGradientFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\GimpPaletteFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\GribStubImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\Hdf5StubImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\IcnsImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\IcoImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\Image.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageChops.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageCms.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageColor.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageDraw.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageDraw2.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageEnhance.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageFilter.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageFont.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageGrab.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageMath.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageMode.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageMorph.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageOps.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImagePalette.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImagePath.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageQt.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageSequence.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageShow.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageStat.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageTk.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageTransform.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImageWin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\ImtImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\IptcImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\Jpeg2KImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\JpegImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\JpegPresets.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\McIdasImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\MicImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\MpegImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\MpoImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\MspImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PaletteFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PalmImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PcdImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PcfFontFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PcxImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PdfImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PdfParser.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PixarImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PngImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PpmImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PsdImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PSDraw.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\PyAccess.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\QoiImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\SgiImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\SpiderImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\SunImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\TarIO.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\TgaImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\TiffImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\TiffTags.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\WalImageFile.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\WebPImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\WmfImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\XbmImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\XpmImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\XVThumbImagePlugin.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\_binary.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\_deprecate.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\_tkinter_finder.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\_util.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\_version.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\__init__.py -> build\lib.win-amd64-cpython-310\PIL
copying src\PIL\__main__.py -> build\lib.win-amd64-cpython-310\PIL
running egg_info
writing src\Pillow.egg-info\PKG-INFO
writing dependency_links to src\Pillow.egg-info\dependency_links.txt
writing requirements to src\Pillow.egg-info\requires.txt
writing top-level names to src\Pillow.egg-info\top_level.txt
reading manifest file 'src\Pillow.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.c'
warning: no files found matching '*.h'
warning: no files found matching '*.sh'
warning: no files found matching '*.txt'
warning: no previously-included files found matching '.appveyor.yml'
warning: no previously-included files found matching '.clang-format'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.readthedocs.yml'
warning: no previously-included files found matching 'codecov.yml'
warning: no previously-included files found matching 'renovate.json'
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
no previously-included directories found matching '.ci'
adding license file 'LICENSE'
writing manifest file 'src\Pillow.egg-info\SOURCES.txt'
running build_ext
building 'PIL._imaging' extension
building 'PIL._imagingtk' extension
building 'PIL._imagingmath' extension
building 'PIL._imagingft' extension
creating build\temp.win-amd64-cpython-310
creating build\temp.win-amd64-cpython-310
creating build\temp.win-amd64-cpython-310\Release
creating build\temp.win-amd64-cpython-310\Release
creating build\temp.win-amd64-cpython-310\Release\src
creating build\temp.win-amd64-cpython-310\Release\src
creating build\temp.win-amd64-cpython-310\Release\src\Tk
"C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\dev\atgview\pack\install\include\freetype2 -IC:\dev\atgview\pack\install\include -IC:\dev\atgview\pack\install\Python\include -IC:\dev\atgview\pack\install\Python\include -IC:\dev\atgview\pack\install\Python\Include -IC:/dev/atgview/pack/install/include /Tcsrc/_imagingft.c /Fobuild\temp.win-amd64-cpython-310\Release\src/_imagingft.obj
"C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\dev\atgview\pack\install\include\freetype2 -IC:\dev\atgview\pack\install\include -IC:\dev\atgview\pack\install\Python\include -IC:\dev\atgview\pack\install\Python\include -IC:\dev\atgview\pack\install\Python\Include -IC:/dev/atgview/pack/install/include /Tcsrc/Tk/tkImaging.c /Fobuild\temp.win-amd64-cpython-310\Release\src/Tk/tkImaging.obj
creating build\temp.win-amd64-cpython-310\Release\src\libImaging
"C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\dev\atgview\pack\install\include\freetype2 -IC:\dev\atgview\pack\install\include -IC:\dev\atgview\pack\install\Python\include -IC:\dev\atgview\pack\install\Python\include -IC:\dev\atgview\pack\install\Python\Include -IC:/dev/atgview/pack/install/include /Tcsrc/_imagingmath.c /Fobuild\temp.win-amd64-cpython-310\Release\src/_imagingmath.obj
"C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -DUSE_WIN32_FILEIO -DPILLOW_VERSION=\"10.0.0\" -IC:\dev\atgview\pack\install\include\freetype2 -IC:\dev\atgview\pack\install\include -IC:\dev\atgview\pack\install\Python\include -IC:\dev\atgview\pack\install\Python\include -IC:\dev\atgview\pack\install\Python\Include -IC:/dev/atgview/pack/install/include /Tcsrc/_imaging.c /Fobuild\temp.win-amd64-cpython-310\Release\src/_imaging.obj
_imagingft.c
_imagingmath.c
tkImaging.c
_imaging.c
C:\dev\atgview\pack\install\Python\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
C:\dev\atgview\pack\install\Python\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
C:\dev\atgview\pack\install\Python\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
C:\dev\atgview\pack\install\Python\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
building 'PIL._imagingmorph' extension
"C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\dev\atgview\pack\install\include\freetype2 -IC:\dev\atgview\pack\install\include -IC:\dev\atgview\pack\install\Python\include -IC:\dev\atgview\pack\install\Python\include -IC:\dev\atgview\pack\install\Python\Include -IC:/dev/atgview/pack/install/include /Tcsrc/_imagingmorph.c /Fobuild\temp.win-amd64-cpython-310\Release\src/_imagingmorph.obj
_imagingmorph.c
C:\dev\atgview\pack\install\Python\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
error: command 'C:\\Program Files\\Microsoft Visual Studio\\18\\Community\\VC\\Tools\\MSVC\\14.44.35207\\bin\\HostX64\\x64\\cl.exe' failed with exit code 2
CMake Error at C:/dev/atgview/pack/superbuild/sb-pythonpillow-build.cmake:48 (message):
  Failed with exit code 1

The additional information compared to the version above is that the cl.exe calls were all done with these extra “include” parameters:

-IC:\dev\atgview\pack\install\include\freetype2
-IC:\dev\atgview\pack\install\include
-IC:\dev\atgview\pack\install\Python\include
-IC:\dev\atgview\pack\install\Python\include
-IC:\dev\atgview\pack\install\Python\Include
-IC:/dev/atgview/pack/install/include

This is good and nice for the python environment, but actually it would be nice to still also see what the INCLUDE variable in the environment actually is at the moment of this call!

Now I erased Visual Studio, SDKs, MSVC etc. as completely as possible. Then rebooted. Then tried to only install MSVC 2022 and the Windows 11 SDK, with the Visual Studio 2022 installer (NOT 2026, like is the default right now!). Another reboot.

If now I open a “x64 Native Tools Command Prompt for VS 2022”, I get a command prompt where io.h is indeed in the INCLUDE path!

Tomorrow I will erase all my (successful) attempts to build ParaView (my own slightly patched 5.13 version), then my own software (that was also already built successfully before), and then again restart the entire “superbuild” exercise!

And I wish myself “good luck” with this new, hopefully more “clean” attempt!!

Done all the above, everything now building and running on a much more cleaned up MSVC setup, with only MSVC 2022 and SDK available.

(Side remark: experience from earlier years was proven correct again, which is that Visual Studio Installer is messing up the system if you add or remove features, and even if you do a “repair” run! At the end I had not even any proper command prompts for the build tools left: they were all somehow “killed” by a “repair”…)

However: the pythonpillow still runs into the same old problem as before! Which is: “io.h” not found. But now I found out why it is happening; only missing is an explanation for it!

  1. With the cmake configure and generate steps, a /superbuild/sb-pythonpillow-build.cmake file is generated that is responsible for this build step
  2. With ninja, that .cmake file is called and first sets up an environment, then runs a “build” command that is a python script: python.py

The problem is that within the .cmake script, an environment is generated with an INCLUDE variable that does not contain most standard stuff, thus also no io.h. This is the .cmake file, with some remarks (marked with >>>>>) about where it happens:

# Handle the environment when running a primary step (configure, build,
# install) of a project.

>>>>> this "environment" variable defines directories to be either prepended to an existing environment variable or entirely replace it:

set(environment "ZLIB_ROOT;C:/dev/atgview/pack/install;INCLUDE;C:/dev/atgview/pack/install/include;LIB;C:/dev/atgview/pack/install/lib;PATH;C:/dev/atgview/pack/install/bin;PKG_CONFIG_PATH;;PYTHONPATH;C:/dev/atgview/pack/install/Python/Lib/site-packages")
set(list_separator "-+-")
set(command "C:/dev/atgview/pack/install/Python/python.exe;setup.py;build")

set(env_separator ":")

>>>>> The "prepend_envvars" is a list of environment variables that should be kept, thus the above folders will only be prepended.
NOTE that it does NOT include the INCLUDE and LIB environment variables! And the result is that indeed the active INCLUDE during the following "build" is only that folder specified above in the "environment" variable

# These environment variables are prepended to using `env_separator`.
set(prepend_envvars
  PATH CMAKE_PREFIX_PATH PKG_CONFIG_PATH PYTHONPATH)
if (WIN32)
  set(env_separator ";")
elseif (APPLE)
  list(APPEND prepend_envvars
    DYLD_LIBRARY_PATH)
elseif (UNIX)
  list(APPEND prepend_envvars
    LD_LIBRARY_PATH)
endif ()

set(key)
foreach (arg IN LISTS environment)
  if (NOT key)
    set(key "${arg}")
  else ()
    list(FIND prepend_envvars "${key}" index)
    set(value "$ENV{${key}}")
    if (index EQUAL "-1" OR value STREQUAL "")
      set(value "${arg}")
    else ()
      string(PREPEND value "${arg}${env_separator}")
    endif ()
    string(REPLACE "${list_separator}" ";" value "${value}")
    set("ENV{${key}}" "${value}")

    unset(key)
  endif ()
endforeach ()

string(REPLACE "${list_separator}" "\;" command "${command}")

execute_process(
  COMMAND ${command}
  RESULT_VARIABLE rv)

if (rv)
  message(FATAL_ERROR "Failed with exit code ${rv}")
endif ()

So adding INCLUDE and LIB to the “prepend_envvars” variable above will immediately allow the pythonpillow to build properly.

Problem: The above .cmake is generated from an input template file named superbuild_handle_environment.cmake.in, and any change that should persist has to be applied there, not in the above file. With the effect that not only the above file will have the added two environment variables in that list, but almost 100 others as well!

In my case it turned out that this did not hurt, but maybe this is only due to the fact that I have now a more nicely cleaned up MSVC build system? Which leaves me with quite a number of open questions:

Why did it work for the almost 100 other project parts?
Why did it work even for pythonpillow for me in earlier versions?

Because calling the C++ compiler without including standard libraries is normally not such a good idea!(??)

Anyway: I am one HUGE step further now, still running into a next problem, not analyzed yet.

Good news: Finally the superbuild went through, the “ctest” step as well, and the software could be installed successfully!

Only the “paraview config” step failed at first, with some cmake processor test somehow not finding a temporary file, but on restarting ninja, this one was skipped and the rest went through smoothly.

It took a rather long time, and without that one helpful hint from Mathieu it would have taken even much longer, I assume. So thanks again Mathieu!

1 Like