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

Rerun C++ SDK: undefined symbols (arch mismatch) when cross-compiling for macOS x64 #7248

Open
rafaelspring opened this issue Aug 20, 2024 · 3 comments
Labels
🌊 C++ API C/C++ API specific help wanted Extra attention is needed

Comments

@rafaelspring
Copy link

Describe the bug
Using the rerun C++ SDK. My machine is a MacBook Air M1 (arm64). I am including rerun in an app that (for various reasons) I need to compile to x64 architecture (using CMAKE_OSX_ARCHITECTURES = x86_64).

I'm getting tons of arch mismatch messages from the linker of this kind:

ld: warning: ignoring file '../arrow/lib/libarrow_bundled_dependencies.a[15](init.c.o)': found architecture 'arm64', required architecture 'x86_64'
ld: warning: ignoring file '../arrow/lib/libarrow_bundled_dependencies.a[14](options.c.o)': found architecture 'arm64', required architecture 'x86_64'
ld: warning: ignoring file '../arrow/lib/libarrow_bundled_dependencies.a[13](heap.c.o)': found architecture 'arm64', required architecture 'x86_64'
...

then further down many undefined symbols

Undefined symbols for architecture x86_64:
  "arrow::ExportType(arrow::DataType const&, ArrowSchema*)", referenced from:
      rerun::ComponentType::register_component() const in librerun_sdk.a[78](component_type.cpp.o)
  "arrow::ExportArray(arrow::Array const&, ArrowArray*, ArrowSchema*)", referenced from:
      rerun::ComponentBatch::to_c_ffi_struct(rr_component_batch&) const in librerun_sdk.a[76](component_batch.cpp.o)
      rerun::ComponentColumn::to_c_ffi_struct(rr_component_column&) const in librerun_sdk.a[77](component_column.cpp.o)
      rerun::TimeColumn::to_c_ffi_struct(rr_time_column&) const in librerun_sdk.a[188](time_column.cpp.o)
...

To Reproduce
Steps to reproduce the behavior:

  • Use a Mac with arm CPU.
  • Create a CMake-based project (app or shared lib) that uses the rerun C++ SDK.
  • Set CMAKE_OSX_ARCHITECTURES to x86_64
  • Use SDK in code.
  • Build.

Expected behavior
Code building without errors.

Desktop (please complete the following information):
OS: macOS Sonoma 14.6.1

Rerun version
Whatever is here: https://github.com/rerun-io/rerun/releases/latest/download/rerun_cpp_sdk.zip

@rafaelspring rafaelspring added 👀 needs triage This issue needs to be triaged by the Rerun team 🪳 bug Something isn't working labels Aug 20, 2024
@emilk emilk added 🌊 C++ API C/C++ API specific and removed 🪳 bug Something isn't working 👀 needs triage This issue needs to be triaged by the Rerun team labels Aug 22, 2024
@Wumpf
Copy link
Member

Wumpf commented Sep 9, 2024

Our CMake file is generally not set up for cross compilation and it's not something we test on CI either.
Contributions very much welcome!

@Wumpf Wumpf added the help wanted Extra attention is needed label Sep 9, 2024
@cedricnew92
Copy link

I'm running the build with -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" from an intel mac, the static library generated is just x86_64
$ lipo -info libarrow_bundled_dependencies.a
Non-fat file: libarrow_bundled_dependencies.a is architecture: x86_64

@Wumpf
Copy link
Member

Wumpf commented Oct 22, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌊 C++ API C/C++ API specific help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants