rerun-io / rerun

Visualize streams of multimodal data. Free, fast, easy to use, and simple to integrate. Built in Rust.
https://rerun.io/
Apache License 2.0
6.53k stars 331 forks source link

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

Open rafaelspring opened 2 months ago

rafaelspring commented 2 months ago

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:

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

Wumpf commented 2 months ago

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!

cedricnew92 commented 1 month ago

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 commented 2 weeks ago

Related to: