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

Builds for wrong-architecture on M1 macs #458

Closed
jherico opened this issue Mar 8, 2024 · 3 comments
Closed

Builds for wrong-architecture on M1 macs #458

jherico opened this issue Mar 8, 2024 · 3 comments
Assignees
Labels
Milestone

Comments

@jherico
Copy link

jherico commented Mar 8, 2024

A user reported a problem building the Vulkan Sample repository after an update to the most recent release of ASTC.

The linker errors shown indicate that the file is being built for an x86_64 architecture even though it's building on an arm64 arch.

I was able to reproduce this by executing the following

ec2-user@ip-172-31-45-6 astc % cmake -B build -DASTCENC_ISA_NATIVE=ON -DASTCENC_UNIVERSAL_BUILD=OFF
--   AVX2 backend     - OFF
--   SSE4.1 backend   - OFF
--   SSE2 backend     - OFF
--   NEON backend     - OFF
--   NONE backend     - OFF
--   NATIVE backend   - ON
--   Universal bin    - OFF
--   Invariance       - ON
--   Shared libs      - OFF
--   Decompressor     - OFF
--   Diagnostics      - OFF
--   ASAN             - OFF
--   Unit tests       - OFF
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/ec2-user/Vulkan-Samples/third_party/astc/build
ec2-user@ip-172-31-45-6 astc % cmake --build build --parallel
[  3%] Building CXX object Source/CMakeFiles/astcenc-native-veneer.dir/astcenccli_entry.cpp.o
<snip>
[100%] Linking CXX executable astcenc-native
[100%] Built target astcenc-native

ec2-user@ip-172-31-45-6 astc % file ./build/Source/astcenc-native
./build/Source/astcenc-native: Mach-O 64-bit executable x86_64
ec2-user@ip-172-31-45-6 astc % uname -a
Darwin ip-172-31-45-6.ec2.internal 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:33:31 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T8112 arm64

I've got a fix that works around it by forcing the OSX_ARCHITECTURES property of the target to arm64 in the case where we're building on Apple and running on M1 hardware or later.

@ARM-software ARM-software deleted a comment from Dreamer1 Mar 11, 2024
@solidpixel
Copy link
Contributor

Thanks - will take a look, but might not get around to it until later in the month.

@solidpixel solidpixel self-assigned this Mar 11, 2024
@solidpixel solidpixel added the bug label Mar 11, 2024
@solidpixel solidpixel added this to the 4.8.0 milestone Mar 11, 2024
@KaperD
Copy link

KaperD commented Mar 15, 2024

I think that there should be elseif(NOT ${ASTCENC_ISA_SIMD} MATCHES "none" AND NOT ${ASTCENC_ISA_SIMD} MATCHES "native")

@solidpixel
Copy link
Contributor

Fixed in 71a55e7

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

No branches or pull requests

3 participants