Closed OlivierArgentieri closed 2 years ago
Try adding a dependency to pthread
The other error happens here: https://github.com/Kitware/CMake/blob/master/Modules/FindPython/Support.cmake#L609
Hi @OlivierArgentieri
Thanks for posting this issue.
Seems you didn't use the latest version. Could you please try to update to the latest vcpkg to rebuild this? I can build it successfully on my machine.
Hi @NancyLi1013
Thanks for your answer.
I'm using the latest version of VCPKG : 2021.05.12 I have retest with the latest version 2021.05.12 and with the master And yes it works, it works because i forgot something...
Sorry, but i forgot some step in "To Reproduce"
So, i will give you an update here : To Reproduce Edit \ports\pybind11\CONTROL and replace "Build-Depends: python3" to "Build-Depends: python2" Edit \ports\pybind11\portfile.cmake and replace all python3 by python2 :
# ports/pybind11/portfile.cmake
# ...
vcpkg_find_acquire_program(PYTHON2)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DPYBIND11_TEST=OFF
-DPYBIND11_FINDPYTHON=ON
-DPython2_EXECUTABLE=${PYTHON2}
OPTIONS_RELEASE
-DPYTHON_IS_DEBUG=OFF
OPTIONS_DEBUG
-DPYTHON_IS_DEBUG=ON
)
# ...
Edit \ports\openimageio\portfile.cmake and replace all python3 by python2 to:
#ports/openimageio/portfile.cmake
# ...
vcpkg_find_acquire_program(PYTHON2)
get_filename_component(PYTHON2_DIR "${PYTHON2}" DIRECTORY)
vcpkg_add_to_path("${PYTHON2_DIR}")
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS ${FEATURE_OPTIONS}
-DOIIO_BUILD_TESTS=OFF
-DHIDE_SYMBOLS=ON
-DUSE_DCMTK=OFF
-DUSE_NUKE=OFF
-DUSE_QT=OFF
-DUSE_PTEX=OFF
-DLINKSTATIC=${LINKSTATIC}
-DBUILD_MISSING_FMT=OFF
-DBUILD_MISSING_ROBINMAP=OFF
-DBUILD_MISSING_DEPS=OFF
-DSTOP_ON_WARNING=OFF
-DVERBOSE=ON
)
# ...
And now you can run ./vcpkg install openimageio[pybind11]:x64-windows
Because if you do not edit .cmake file, vcpkg will install the latest version of python for openimageio, it will ignore previous python2 installation
And honestly I don't remember how I got to the pthread error, because I did a lot of testing but now i dont have this error anymore but i got this LINK : fatal error LNK1104: cannot open file 'python37_d.lib'
Sorry again for this mistake.
Full log :
[1/2] cmd.exe /C "cd . && D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\downloads\tools\cmake-3.20.2-windows\cmake-3.20.2-windows-i386\bin\cmake.exe -E vs_link_dll --intdir=src\python\CMakeFiles\PyOpenImageIO.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\mt.exe --manifests -- C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1427~1.291\bin\Hostx64\x64\link.exe src\python\CMakeFiles\PyOpenImageIO.dir\py_colorconfig.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_deepdata.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_imagebuf.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_imagebufalgo.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_imagecache.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_imageinput.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_imageoutput.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_imagespec.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_oiio.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_paramvalue.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_roi.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_typedesc.cpp.obj /out:lib\python\site-packages\OpenImageIO_d.pyd /implib:lib\python\site-packages\OpenImageIO_d.lib /pdb:lib\python\site-packages\OpenImageIO_d.pdb /dll /version:0.0 /machine:x64 /debug /INCREMENTAL -LIBPATH:D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\lib -LIBPATH:D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib D:\Program_Files\Python_3.7.7\libs\python37.lib lib\OpenImageIO.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\IlmImfUtil-2_5_d.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\IlmImf-2_5_d.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\Imath-2_5_d.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\Half-2_5_d.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\IlmThread-2_5_d.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\zlibd.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\IexMath-2_5_d.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\Iex-2_5_d.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
FAILED: lib/python/site-packages/OpenImageIO_d.pyd
cmd.exe /C "cd . && D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\downloads\tools\cmake-3.20.2-windows\cmake-3.20.2-windows-i386\bin\cmake.exe -E vs_link_dll --intdir=src\python\CMakeFiles\PyOpenImageIO.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\mt.exe --manifests -- C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1427~1.291\bin\Hostx64\x64\link.exe src\python\CMakeFiles\PyOpenImageIO.dir\py_colorconfig.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_deepdata.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_imagebuf.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_imagebufalgo.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_imagecache.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_imageinput.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_imageoutput.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_imagespec.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_oiio.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_paramvalue.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_roi.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_typedesc.cpp.obj /out:lib\python\site-packages\OpenImageIO_d.pyd /implib:lib\python\site-packages\OpenImageIO_d.lib /pdb:lib\python\site-packages\OpenImageIO_d.pdb /dll /version:0.0 /machine:x64 /debug /INCREMENTAL -LIBPATH:D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\lib -LIBPATH:D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib D:\Program_Files\Python_3.7.7\libs\python37.lib lib\OpenImageIO.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\IlmImfUtil-2_5_d.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\IlmImf-2_5_d.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\Imath-2_5_d.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\Half-2_5_d.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\IlmThread-2_5_d.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\zlibd.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\IexMath-2_5_d.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\Iex-2_5_d.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK Pass 1: command "C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1427~1.291\bin\Hostx64\x64\link.exe src\python\CMakeFiles\PyOpenImageIO.dir\py_colorconfig.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_deepdata.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_imagebuf.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_imagebufalgo.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_imagecache.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_imageinput.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_imageoutput.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_imagespec.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_oiio.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_paramvalue.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_roi.cpp.obj src\python\CMakeFiles\PyOpenImageIO.dir\py_typedesc.cpp.obj /out:lib\python\site-packages\OpenImageIO_d.pyd /implib:lib\python\site-packages\OpenImageIO_d.lib /pdb:lib\python\site-packages\OpenImageIO_d.pdb /dll /version:0.0 /machine:x64 /debug /INCREMENTAL -LIBPATH:D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\lib -LIBPATH:D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib D:\Program_Files\Python_3.7.7\libs\python37.lib lib\OpenImageIO.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\IlmImfUtil-2_5_d.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\IlmImf-2_5_d.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\Imath-2_5_d.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\Half-2_5_d.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\IlmThread-2_5_d.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\zlibd.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\IexMath-2_5_d.lib D:\Projet\Temp\vcpkg_test\aaa\vcpkg-2021.05.12\installed\x64-windows\debug\lib\Iex-2_5_d.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:src\python\CMakeFiles\PyOpenImageIO.dir/intermediate.manifest src\python\CMakeFiles\PyOpenImageIO.dir/manifest.res" failed (exit code 1104) with the following output:
Microsoft (R) Incremental Linker Version 14.27.29111.0
Copyright (C) Microsoft Corporation. All rights reserved.
LINK : fatal error LNK1104: cannot open file 'python37_d.lib'
ninja: build stopped: subcommand failed.
And Thank you @autoantwort for your answer, i will remember this tip.
The latest vcpkg version is 2021-08-12-85ab112d5ee102bc6eac8cdbbfdd173a71374e04.
The CONTROL file has been updated as vcpkg.json file in pybind11
.
So please use git pull
to update vcpkg and run .\bootstrap-vcpkg.bat
before you build this again.
Ok, thank you for your answer.
After git pull i got the same result as before :
LINK : fatal error LNK1104: cannot open file 'python37_d.lib'
ninja: build stopped: subcommand failed.
If you want to use python2
, you just need to update python3
as python2
. Why do you add these codes for pybind11/portfile.cmake
?
vcpkg_find_acquire_program(PYTHON2)
-DPython2_EXECUTABLE=${PYTHON2}
But, how can i update python3 as python2 ? Are the versions of python not present in the dependencies of portfile?
Sorry but if you have an example of wich file i need to update to change the versions of python, it would be very usefull for me.
I add these code to try to switch to python2 because these keyword are list in : https://vcpkg.readthedocs.io/en/latest/maintainers/vcpkg_find_acquire_program/
Thanks
Hi @OlivierArgentieri
I also try to build this with the latest vcpkg and it failed with the error like this:
-- pybind11 v2.7.1
-- CMake 3.21.1
CMake Error at F:/vcpkg_new/vcpkg/downloads/tools/cmake-3.21.1-windows/cmake-3.21.1-windows-i386/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Python (missing: Python_EXECUTABLE Interpreter) (found
version "2.7.18")
Call Stack (most recent call first):
F:/vcpkg_new/vcpkg/downloads/tools/cmake-3.21.1-windows/cmake-3.21.1-windows-i386/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
F:/vcpkg_new/vcpkg/downloads/tools/cmake-3.21.1-windows/cmake-3.21.1-windows-i386/share/cmake-3.21/Modules/FindPython.cmake:556 (find_package_handle_standard_args)
F:/vcpkg_new/vcpkg/scripts/buildsystems/vcpkg.cmake:784 (_find_package)
tools/pybind11NewTools.cmake:35 (find_package)
tools/pybind11Common.cmake:200 (include)
CMakeLists.txt:191 (include)
I updated these places:
Since there is no executable generated in python2
port.
So we need to add executable if using python2
.
After adding the following codes for pybind11/portfile.cmake, I can build successfully now.
vcpkg_find_acquire_program(PYTHON2)
get_filename_component(PYTHON2_DIR "${PYTHON3}" DIRECTORY)
vcpkg_add_to_path("${PYTHON2_DIR}")
Thank you for your answer. I have test the build with :
vcpkg_find_acquire_program(PYTHON2)
get_filename_component(PYTHON2_DIR "${PYTHON3}" DIRECTORY)
vcpkg_add_to_path("${PYTHON2_DIR}")
And yes it built successfully, but the output .pyd is for python39, and my goal is to generate this .pyd for python2. But maybe i have made something wrong. Can you confirm that your .pyd has been generated for python2 ?
Other things, in my previous test, python2 appeared on start of command, in the requires list, and now i no longer see this dependency.
Thank you again for your help
Sorry guys but default (python 3) openimageio[pybind11]:x64-windows also not building for long time
` Building package openimageio[core,pybind11]:x64-windows... -- Downloading https://github.com/OpenImageIO/oiio/archive/9f74cf4d9813bfdcad5bca08b4ff75a25d056cb0.tar.gz -> OpenImageIO-oiio-9f74cf4d9813bfdcad5bca08b4ff75a25d056cb0.tar.gz... -- Cleaning sources at E:/VisualStudio/vcpkg/buildtrees/openimageio/src/a25d056cb0-36fa00c6d2.clean. Use --editable to skip cleaning for the packages you specify. -- Extracting source E:/VisualStudio/vcpkg/downloads/OpenImageIO-oiio-9f74cf4d9813bfdcad5bca08b4ff75a25d056cb0.tar.gz -- Applying patch fix-config-cmake.patch -- Applying patch fix_static_build.patch -- Applying patch disable-test.patch -- Applying patch fix-dependencies.patch -- Using source at E:/VisualStudio/vcpkg/buildtrees/openimageio/src/a25d056cb0-36fa00c6d2.clean -- Found external ninja('1.10.2'). -- Configuring x64-windows -- Building x64-windows-dbg CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:155 (message): Command failed: "C:/Program Files/CMake/bin/cmake.exe" --build . --config Debug --target install -- -v -j33 Working Directory: E:/VisualStudio/vcpkg/buildtrees/openimageio/x64-windows-dbg See logs for more information: E:\VisualStudio\vcpkg\buildtrees\openimageio\install-x64-windows-dbg-out.log
Call Stack (most recent call first): installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_build.cmake:102 (vcpkg_execute_build_process) installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_install.cmake:41 (vcpkg_cmake_build) ports/openimageio/portfile.cmake:67 (vcpkg_cmake_install) scripts/ports.cmake:141 (include)
Error: Building package openimageio:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with .\vcpkg update
, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
Package: openimageio:x64-windows
Vcpkg version: 2021-09-10-2059ef11aa6067e6f59b0d939c5d17e3c5c47d3e
Additionally, attach any relevant sections from the log files above.
E:\VisualStudio\vcpkg>vcpkg update
Using local portfile versions. To update the local portfiles, use git pull
.
No packages need updating.
`
Hi @ssh4net
Did you encounter the problem like this?
F:\openimageoio\vcpkg\buildtrees\openimageio\src\a25d056cb0-36fa00c6d2\src\python\py_oiio.cpp(77): error C3861: 'ssize_t': identifier not found
If yes, please open a new issue to report this problem. Since this is not the same issue with the original one.
@OlivierArgentieri
Sorry for the long delay. I will check this again on my machine and update the status here.
@OlivierArgentieri
Sorry, I was blocked by the error now. I cannot build this successfully. So I'm not sure if the output .pyd is for python39.
F:\openimageoio\vcpkg\buildtrees\openimageio\src\a25d056cb0-36fa00c6d2\src\python\py_oiio.cpp(77): error C3861: 'ssize_t': identifier not found
@NancyLi1013
Sorry for my response time.
But i wanted to thank you for your investigations. Even if i don't watch often at this issue, this subject stills interest me because i still have not found a way to build OpenImageIO in python2 with vcpkg.
And thank you also @JackBoosY for the label update
I think nobody will add a change so deal with EOL python2. Can this issue be closed as wont-fix?
@Cheney-W I think this can be closed now.
Host Environment
To Reproduce Steps to reproduce the behavior: Edit \ports\pybind11\CONTROL and replace "Build-Depends: python3" to "Build-Depends: python2" then
./vcpkg install openimageio[pybind11]:x64-windows
Failure logs Console Log :
config-x64-windows-out.log:
./buildtrees/openimageio/x64-windows-dbg/CMakeFiles/CMakeError.log:
I'm just trying to build OpenImageIO with python binding but for Python2.7, not for Python3.
Thank You