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

Multi Arch build (arm64 x86_64) on MacOS to support ARM Mac Devices (Universal Binary) #1496

Closed
1 task done
Sunil-P opened this issue Oct 12, 2020 · 4 comments
Closed
1 task done
Labels
bug This issue is a bug. closed-for-staleness dependencies This issue is a problem in a dependency.

Comments

@Sunil-P
Copy link

Sunil-P commented Oct 12, 2020

Confirm by changing [x] to [] below:

Platform/OS/Hardware/Device
What are you running the sdk on?
Mac OS 10.15 Catalina, using Xcode12
Describe the question
Upcoming ARM Macs have following requirements to build to ensure universal compatibility.
https://developer.apple.com/documentation/xcode/building_a_universal_macos_binary

I use the following command to build aws sdk (As an example, take into account only cognito and kinesis.

cmake -DBUILD_ONLY="cognito-identity;kinesis" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -G Xcode
xcodebuild -project AWSSDK.xcodeproj

The resulting .dylib files upon running Apple's compatibility checker, I get the following output

lipo libaws-cpp-sdk-access-management.dylib -archs
x86_64

My expectation was, it should show both x86_64 and arm64. Can anyone tell me why this is occurring. Perhaps apple's implementation is to build these two architectures separately and merge them together using the lipo tool.

Logs/output
If applicable, add logs or error output.
None
To enable logging, set the following system properties:

REMEMBER TO SANITIZE YOUR PERSONAL INFO

options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Trace;
Aws::InitAPI(options)
@Sunil-P Sunil-P added guidance Question that needs advice or information. needs-triage This issue or PR still needs to be triaged. labels Oct 12, 2020
@KaibaLopez
Copy link
Contributor

Hi @Sunil-P , sorry for the delayed response
I've tested this and you are right the arm64 build fails. It does so silently because cmake is happy to have x86_64 build and just ignores building arm.
It seems to be related mostly to the sdk's dependencies, but we'll look more into it
thanks fro bringing this up to us.

@KaibaLopez KaibaLopez added bug This issue is a bug. dependencies This issue is a problem in a dependency. and removed guidance Question that needs advice or information. needs-triage This issue or PR still needs to be triaged. labels Oct 28, 2020
@Sunil-P
Copy link
Author

Sunil-P commented Nov 23, 2020

Any update on this, guys ? Anyone working on this

@Sunil-P
Copy link
Author

Sunil-P commented Nov 26, 2020

Ive managed to build an arm version of my required libs, and managed to combine them using lipo tool.
As of this moment, Cmake is broken with latest version, use Cmake 3.18.4 to build aws.
https://gitlab.kitware.com/cmake/cmake/-/issues/21425

Homebrew can't downgrade, so if uve installed Cmake via home-brew,
brew remove cmake
install via pip
pip install cmake
check Cmake version using
cmake --version

Rest of the build step

git clone https://github.com/aws/aws-sdk-cpp
cd aws-sdk-cpp
cmake ../aws-sdk-cpp -G Xcode -DBUILD_ONLY="cognito-identity;kinesis" -DTARGET_ARCH="APPLE" -DCMAKE_OSX_ARCHITECTURES="arm64"
xcodebuild -project AWSSDK.xcodeproj -target "aws-cpp-sdk-core" -target "aws-cpp-sdk-kinesis" -target "testing-resources" -target "aws-cpp-sdk-iam" -target "aws-cpp-sdk-access-management" -target "aws-cpp-sdk-cognito-identity"

@github-actions
Copy link

Greetings! Sorry to say but this is a very old issue that is probably not getting as much attention as it deservers. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to open a new one.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Nov 27, 2021
@github-actions github-actions bot closed this as completed Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closed-for-staleness dependencies This issue is a problem in a dependency.
Projects
None yet
Development

No branches or pull requests

2 participants