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

Fix macOS arm64 build #1434

Merged
merged 1 commit into from
May 26, 2023

Conversation

Vertexwahn
Copy link
Contributor

@Vertexwahn Vertexwahn commented May 26, 2023

Commit 7c40603 introduced with PR #1402 a break of bazel build //... on macOS with arm64:

ERROR: /Users/vertexwahn/dev/openexr/BUILD.bazel:147:11: Compiling src/lib/OpenEXRCore/internal_dwa.c failed: (Exit 1): wrapped_clang failed: error executing command (from target //:OpenEXRCore) external/local_config_cc/wrapped_clang '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -O0 -DDEBUG 'DEBUG_PREFIX_MAP_PWD=.' ... (remaining 55 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from src/lib/OpenEXRCore/internal_dwa.c:121:
In file included from src/lib/OpenEXRCore/internal_dwa_helpers.h:61:
src/lib/OpenEXRCore/internal_dwa_simd.h:338:9: error: use of undeclared identifier 'float32x4x2_t'
        float32x4x2_t vec_fp32 = vld1q_f32_x2 (src + i);
        ^
src/lib/OpenEXRCore/internal_dwa_simd.h:339:9: error: implicit declaration of function 'vst1q_u16' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        vst1q_u16 (
        ^
src/lib/OpenEXRCore/internal_dwa_simd.h:341:13: error: implicit declaration of function 'vcombine_u16' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            vcombine_u16 (
            ^
src/lib/OpenEXRCore/internal_dwa_simd.h:342:17: error: implicit declaration of function 'vreinterpret_u16_f16' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                vreinterpret_u16_f16 (vcvt_f16_f32 (vec_fp32.val[0])),
                ^
src/lib/OpenEXRCore/internal_dwa_simd.h:342:39: error: implicit declaration of function 'vcvt_f16_f32' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                vreinterpret_u16_f16 (vcvt_f16_f32 (vec_fp32.val[0])),
                                      ^
src/lib/OpenEXRCore/internal_dwa_simd.h:342:53: error: use of undeclared identifier 'vec_fp32'
                vreinterpret_u16_f16 (vcvt_f16_f32 (vec_fp32.val[0])),
                                                    ^
src/lib/OpenEXRCore/internal_dwa_simd.h:343:53: error: use of undeclared identifier 'vec_fp32'
                vreinterpret_u16_f16 (vcvt_f16_f32 (vec_fp32.val[1]))));
                                                    ^
src/lib/OpenEXRCore/internal_dwa_simd.h:766:5: error: unknown type name 'uint8x16_t'; did you mean 'uint16_t'?
    uint8x16_t res_tbl[4] = {
    ^~~~~~~~~~

This PR fixes the issue (I assume similar behavior with CMake build)

Signed-off-by: Julian Amann <julian.amann@tum.de>
Copy link
Contributor

@meshula meshula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thank you. It doesn't seem to failing on CI for CMake though, I assume something else might be including arm_neon.h indirectly and not from Bazel.

@Vertexwahn
Copy link
Contributor Author

@meshula It does not fail on CI since GitHub action only run on macOS Intel - not macOS arm64 (e.g. M1 or M2 processors)

@cary-ilm
Copy link
Member

I'm going to merge this into 3.1.8, since it seems likely to be a problem. Thanks.

@cary-ilm cary-ilm merged commit 4d49374 into AcademySoftwareFoundation:main May 26, 2023
@Vertexwahn Vertexwahn deleted the fix-macos-arm64 branch May 26, 2023 19:59
cary-ilm pushed a commit that referenced this pull request May 27, 2023
Signed-off-by: Julian Amann <julian.amann@tum.de>
@kmilos
Copy link

kmilos commented Feb 2, 2024

FYI, macOS arm64 runners are now available for CI.

@Vertexwahn
Copy link
Contributor Author

@kmilos I tried runs-on: macos-13-arm64 but runner does never start - which label do we have to use?

@kmilos
Copy link

kmilos commented Feb 2, 2024

@Vertexwahn
Copy link
Contributor Author

@kmilos Thanks for the pointer. OpenEXR Bazel build works works already: https://github.com/AcademySoftwareFoundation/openexr/actions/runs/7762614654/job/21173364638?pr=1626

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

Successfully merging this pull request may close these issues.

4 participants