Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build openexr with python bindings via cmake #1610

Open
CGStirk opened this issue Jan 7, 2024 · 4 comments
Open

Unable to build openexr with python bindings via cmake #1610

CGStirk opened this issue Jan 7, 2024 · 4 comments

Comments

@CGStirk
Copy link

CGStirk commented Jan 7, 2024

I'm trying to build openexr with python 3.11 bindings on windows 11 with cmake, but I am running into issues. While build files are generated and it appears to complete without failing, no exe or py files are created. I'm not experienced with cmake or building from source so this may be user-error.

I first tried this via the VS 2022 command prompt, but it tries to use PkgConfig, which is not included, so I'm using msys2 mingw64. I then built boost from source and built boost python, but cmake cannot find boost python. I'm unclear on how to show where it is. I've provided the terminal log here: msys2_terminal.txt

I'm also assuming it's looking for "libboost_python311-vc143-mt-x64-1_84.lib", which by default was built here: ..\boost_1_84_0\stage\lib.

The other approach I tried was building an x64 release of openexr in Visual Studio directly, following the instructions provided here #1374. This successfully created the exe files, but I don't know how to build the python bindings with this method if that's even possible to do. Any assistance would be most appreciated.

@cary-ilm
Copy link
Member

cary-ilm commented Jan 9, 2024

Are you attempting to build the python bindings for OpenEXR or for Imath? The OpenEXR bindings don't use boost, so that shouldn't be a problem.

Can you include the log file of the build?

@CGStirk
Copy link
Author

CGStirk commented Jan 10, 2024

I'm trying to build the python bindings for openexr, not for Imath. Here is the CMakeConfigureLog.yaml file (converted to txt for uploading) CMakeConfigureLog.txt. This is the only log I see besides the terminal output I provided, but please let me know if you need something else.

@cary-ilm
Copy link
Member

I'm not sure how to interpret the CMakeConfigureLog.txt, except that a step is failing to find pthread.h.

The msys2_terminal.txt log you included above is for the cmake configuration but not the build itself. If you're new to cmake, you generally run it twice: once to generating the configuration files, and second time to actually do the compilation, something like cmake --build .

I think the complaints about boost are a red herring you can ignore, although I have no experience with Windows so I'm not entirely sure what's going on.

@CGStirk
Copy link
Author

CGStirk commented Jan 10, 2024

Apologies. I did not realize there was an additional step to build, but that now makes sense given that I could build the exe’s in Visual Studio after the initial cmake command and I was confused as to why I had to use VS to generate them.

I also now realize I have been using the wrong flag -DPYTHON, which is for Imath, not for openexr. I believe I should be using
-DOPENEXR_BUILD_PYTHON which is listed in the root CMakeCache.txt file. This did not solve the problem though.

Running cmake --build . by using a standard install of Windows CMake fails due to an issue with libdeflate.h. Here is the terminal log: cmake_log_failed.txt

I then switched to msys2’s cmake with ninja, which did not report any failures as far as I can tell. This generated exe’s in the bin folder but no python files. I don’t know whether to expect a whl file or py files. Here are the terminal logs for that: msys2_cmake_log.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants