Open bldrvnlw opened 3 days ago
Testing locally :
arm test
arch -arm64 conan profile detect
detect_api: Found apple-clang 15.0
detect_api: apple-clang>=13, using the major as version
Detected profile:
[settings]
arch=armv8
build_type=Release
compiler=apple-clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=15
os=Macos
x86_64 test
arch -x86_64 conan profile detect -f
detect_api: Found apple-clang 15.0
detect_api: apple-clang>=13, using the major as version
Detected profile:
[settings]
arch=x86_64
build_type=Release
compiler=apple-clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=15
os=Macos
Hi @bldrvnlw thanks a lot for taking the time to sumbit your question, we appreciate it. I'm moving this to the main Conan repo as a more general "cross-compilation" question not necessarily limited to CCI :)
Thanks for your question @bldrvnlw
This approach is implied in https://github.com/conan-io/conan/issues/15892 and in https://github.com/conan-io/conan/issues/15973. Should it be considered/documented as the best practice for cross-compiling?
I am not 100% sure it is really necessary to use the arch -<value>
prefix always.
Once the profiles are defined, I think you might be able to just use conan build . -pr=myx86_64_profile
(assuming the default profile is armv8
with the auto-detection), as Conan does not do any auto-detection while running, and assumes the one from the profile.
But I don't know enough about the Apple ecosystem, I'll ping some colleagues to check.
Hi @bldrvnlw
Cross-compiling from ARM to Intel, you don't need to execute it every time. It's enough to know both profiles and save them locally or wherever you want:
arm-profile
[settings]
arch=armv8
build_type=Release
compiler=apple-clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=15
os=Macos
x86-64-profile
[settings]
arch=x86_64
build_type=Release
compiler=apple-clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=15
os=Macos
Building from ARM to Intel: conan build . -pr:h x86-64-profile -pr:b arm-profile
What is your question?
Hi! I'm using the latest macos arm64 images on github actions and we are still supporting x86_64. Therefore cross-compiling from arm to the x86_64 target.
Am I correct in thinking that the recommended way to cross-compiler to x86_64 on an arm macos is as follows:
arch -x86_64 python -m pip
arch -x86_64 conan build
with the x86_64 profiles.This approach is implied in #15892 and in #15973. Should it be considered/documented as the best practice for cross-compiling?
An additional question: will using the Brew (from _SystemPackageManagerTool) in this x86_64 python context also result in brew installing x86_64 binaries? For example for libomp?