Repository navigation
Add macOS x64/arm64 CI and runtime packages (port of #1947 to 5.x) - #1955
Merged
Merged
Conversation
Port the macOS support added on main (4.x) in #1947 to the 5.x branch, adapted for OpenCV 5 and the OpenCvSharp5 package naming: - .github/workflows/macos.yml: build_x64 (macos-26-intel), build_arm64 (macos-26), test (arm64), and nuget jobs. Builds OpenCV 5.0.0 from source via vcpkg + CMake/Ninja, then OpenCvSharpExtern, and packs both runtime NuGet packages. OPENCV_VERSION=5.0.0, triggers on push to 5.x. - cmake/triplets/{x64,arm64}-osx-static.cmake: static macOS vcpkg triplets. - vcpkg.json: add ffmpeg/hdf5/freetype/harfbuzz/eigen3 for osx. - src/OpenCvSharpExtern/CMakeLists.txt: * add /opt/homebrew/lib to APPLE link_directories (Apple Silicon) * pre-resolve Eigen3 and HDF5 before OpenCV config on APPLE * link Tesseract on macOS too (drop the NOT APPLE guard) - nuget: rename OpenCvSharp5.runtime.osx.10.15-x64 -> OpenCvSharp5.runtime.osx.x64 and add OpenCvSharp5.runtime.osx.arm64; target netstandard2.0/2.1/net8.0. - .github/workflows/publish_nuget.yml: enable macOS artifact download and add osx.x64 / osx.arm64 package validation. - docs: update package list and supported platforms for macOS arm64. Note: include_opencv.h needs no change on 5.x (text.hpp is already included unconditionally). The macOS-5 build specifics (find_package deps, linker flags) may need iteration against the macOS runners. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add the macOS badge (now that macos.yml exists on this branch) and convert all CI badges to the modern actions/workflows/<file> URL format, matching the fix already applied on main. The file-path format matches on filename and links to each workflow's own run history. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Both build_x64 and build_arm64 failed linking OpenCvSharpExtern with: Undefined symbols ... "MlasHGemmSupported(CBLAS_TRANSPOSE, CBLAS_TRANSPOSE)" referenced from compute.cpp.o in libopencv_dnn.a. OpenCV 5.0.0's vendored MLAS builds in "SGEMM-only" mode here, but its FP16/GQA path declares and calls MlasHGemmSupported() without ever defining it, breaking the static link. windows.yml and linux-arm64.yml already work around this by denying CMake an ASM compiler so MLAS turns off and DNN falls back to its built-in SGEMM. Apply the same fix to macOS (-D CMAKE_ASM_COMPILER="") in both Configure OpenCV steps. Image codecs come from vcpkg, so no ASM language is needed otherwise. Also drop the hardcoded -D OpenCV_DIR=.../lib/cmake/opencv4: OpenCV 5 installs its config to lib/cmake/opencv5, and find_package already resolves it via CMAKE_PREFIX_PATH (opencv_artifacts). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the macOS support added on
main(4.x) in #1947 to the5.xbranch, adapted for OpenCV 5 and the OpenCvSharp5 package naming.What's included
.github/workflows/macos.yml—build_x64(macos-26-intel),build_arm64(macos-26),test(arm64), andnugetjobs. Builds OpenCV 5.0.0 from source via vcpkg + CMake/Ninja, then OpenCvSharpExtern, runs arm64 tests, and packs both runtime packages.OPENCV_VERSION=5.0.0, push trigger on5.x.cmake/triplets/{x64,arm64}-osx-static.cmake— static macOS vcpkg triplets.vcpkg.json— addffmpeg/hdf5/freetype/harfbuzz/eigen3(osx platform only).src/OpenCvSharpExtern/CMakeLists.txt—/opt/homebrew/libfor Apple Silicon; pre-resolve Eigen3/HDF5 before OpenCV config on APPLE; link Tesseract on macOS (dropNOT APPLE).OpenCvSharp5.runtime.osx.10.15-x64→OpenCvSharp5.runtime.osx.x64, addOpenCvSharp5.runtime.osx.arm64; TFMnetstandard2.0/2.1/net8.0.publish_nuget.yml— enable macOS artifact download +osx.x64/osx.arm64validation.Differences from the 4.x port (#1947)
OpenCvSharp4→OpenCvSharp5;OPENCV_VERSION4.13.0→5.0.0; branchmain→5.x.include_opencv.hneeds no change on 5.x —opencv2/text.hppis already included unconditionally (noNO_TEXTguard).OpenCV_DIRstayslib/cmake/opencv4, matching the 5.x full-build convention (seemanylinux.yml).Status
Draft. The mechanical port is complete, but the OpenCV-5-specific macOS build details (the
find_package(Eigen3/HDF5)set and the static transitive linker flags) were carried over from the 4.x recipe and may need iteration against the macOS runners. Opening as draft to let the macOS CI surface any OpenCV 5 deltas.🤖 Generated with Claude Code