Skip to content

Commit b77200c

Browse files
committed
Disable Carotene for Linux aarch64 static builds
Carotene (ARM NEON optimizations) causes undefined symbol errors when statically linking OpenCV because the runtime library isn't bundled. Extend the existing macOS workaround to also apply on Linux aarch64.
2 parents 6b5f0a8 + 803552f commit b77200c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

scripts/build-opencv-static.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ CMAKE_ARGS=(
179179
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
180180
)
181181

182-
if [[ "$(uname)" == "Darwin" ]]; then
183-
echo "Detected macOS host; disabling Carotene to avoid linking issue."
182+
# Disable Carotene (ARM NEON optimizations) to avoid undefined symbol errors
183+
# when statically linking. Carotene requires runtime library that isn't bundled.
184+
if [[ "$(uname)" == "Darwin" ]] || [[ "$(uname -m)" == "aarch64" ]] || [[ "$(uname -m)" == "arm64" ]]; then
185+
echo "Detected ARM host; disabling Carotene to avoid linking issue."
184186
CMAKE_ARGS+=(
185187
-DWITH_CAROTENE=OFF
186188
)

0 commit comments

Comments
 (0)