-
Notifications
You must be signed in to change notification settings - Fork 651
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
Numerous build issues with newer CMake, Python, virtual environments #2376
Comments
Hi @nhubbard thanks for raising this issue. (@TobyRoseman correct me if I'm wrong) we are also experiencing build failures when trying to support python 3.12, once we resolve that we should have more clarity |
No build failure with Python 3.12. We do have plenty of test failures, mostly related to the dependency versions we're using. |
Our 8.1 release has added python 3.12 support 🎊 Please try it out |
Can confirm, the 8.1 release is wonderful! There's still a few more issues, like the build script options being midocumented, the fragile Python finding process in the CMakeLists, and the pinned Numpy version. Should we keep this issue open for those or open PRs to fix them? I'm more concerned about opening multiple PRs to fix the individual issues and wanted to collect feedback before doing that. |
Sure 🙏 Thanks for pointing out those issues |
🐞Describing the bug
I'm on macOS 15.1 RC 2, Python 3.12.7 provided by
pyenv
, and CMake 3.30.5 provided by Homebrew.I'm trying to use Python 3.12 with the latest 8.3 release of Ultralytics and
coremltools
to export my YOLO11 models. Due to the distributedcoremltools
not being compatible with 3.12, and my desire to build both NumPy and Torch from source to get maximum performance, I elected to buildcoremltools
from source.When building
coremltools
, I ran into several issues with CMake failing to detect the Python and NumPy include libraries in my virtual environment, along with some other issues that may need to be addressed.I found the following problems, in no particular order:
build.sh
script mis-documents the--num-procs
option as--num_procs
.FindPythonInterp
andFindPythonLibs
CMake modules have been deprecated since CMake 3.12, and are considered as no-ops since CMake 3.27.conda
is available. Commenting out the uses ofconda
may also have caused some of the issues in 3.coremltools
on Python 3.12.7 caused the distributed wheel file to be calledcoremltools-8.0-cp-none-macosx_11_0_arm64.whl
, which isn't compliant with the PyPI file name convention. This caused Pip to refuse installation of the wheel file. I had to rename the wheel tocoremltools-8.0-py3-none-macosx_11_0_arm64.whl
to allow installation.How to fix the issues
I would open a PR with my fixes, but some of them are more specific to my needs, so they would need to be cherry picked based on the needs of the general project.
Instead, I've chosen to list all of the fixes here, and provide a diff showing the changes I made to fix some of the issues, so the maintainers can discuss the changes first.
I also feel that if I were to preemptively split the changes up, it would cause discussion about the changes, some of which are inherently linked to one another, to be split in multiple places.
CMake
FindPython3
module and theNumPy
component. CMake 3.10.2 is woefully out of date. Homebrew, Anaconda, and PyPI provide far more up to date versions of CMake in a readily accessible manner.FindPython3
module to get the interpreter, development, and NumPy variables automatically.Python3_EXECUTABLE
,Python3_VERSION_STRING
,Python3_INCLUDE_DIRS
, andPython3_NumPy_INCLUDE_DIRS
result variables.Dependencies
coremltools
with PyTorch 2.5.0. As far as I can tell, there's nothing different, but I don't use all of the possible options, so this may be more difficult than I expect.Build script
build.sh
script so that--num-procs
is documented correctly.conda
executable, and potentially an environment variable to skip usingconda
to create a new environment for users that don't want to use it (with the note of no support if it causes issues).Patches
This diff should fix issues 1-4 for CMake, issue 4 for the dependencies, and issue 1 for the build script.
System environment (please complete the following information):
main
branchThe text was updated successfully, but these errors were encountered: