lance icon indicating copy to clipboard operation
lance copied to clipboard

linker errors on arm64(macos m1)

Open reymondzzzz opened this issue 1 year ago • 15 comments

I am trying to use your lib in my project, but I have linker errors:

            "_dot_f16", referenced from:
                _$LT$core..iter..adapters..map..Map$LT$I$C$F$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::fold::h080d748cdf7deb0a in liblance-84f7e467743007a2.rlib(lance-84f7e467743007a2.lance.7b369cbc9584cb07-cgu.03.rcgu.o)
                _$LT$core..iter..adapters..map..Map$LT$I$C$F$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h746e81f2c7f3050b (.llvm.14035103181559843495) in liblance-84f7e467743007a2.rlib(lance-84f7e467743007a2.lance.7b369cbc9584cb07-cgu.09.rcgu.o)
                core::iter::traits::iterator::Iterator::advance_by::h750353b719bcffc1 (.llvm.14035103181559843495) in liblance-84f7e467743007a2.rlib(lance-84f7e467743007a2.lance.7b369cbc9584cb07-cgu.09.rcgu.o)
                core::iter::traits::iterator::Iterator::nth::hea7ee519afa021d0 (.llvm.14035103181559843495) in liblance-84f7e467743007a2.rlib(lance-84f7e467743007a2.lance.7b369cbc9584cb07-cgu.09.rcgu.o)
                _$LT$core..iter..adapters..map..Map$LT$I$C$F$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h241a9f2b31720224 (.llvm.5599426574168741917) in liblance_index-b8c275b537c21ba8.rlib(lance_index-b8c275b537c21ba8.lance_index.6f9ed82d0e9bc5f-cgu.06.rcgu.o)
                core::iter::traits::iterator::Iterator::advance_by::hfbca56ea3612e73d (.llvm.5599426574168741917) in liblance_index-b8c275b537c21ba8.rlib(lance_index-b8c275b537c21ba8.lance_index.6f9ed82d0e9bc5f-cgu.06.rcgu.o)
                core::iter::traits::iterator::Iterator::nth::hb201e278bfc81459 (.llvm.5599426574168741917) in liblance_index-b8c275b537c21ba8.rlib(lance_index-b8c275b537c21ba8.lance_index.6f9ed82d0e9bc5f-cgu.06.rcgu.o)
                ...
            "_l2_f16", referenced from:
                _$LT$core..iter..adapters..map..Map$LT$I$C$F$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::hb15835e904d90602 (.llvm.10025790976382166874) in liblance-84f7e467743007a2.rlib(lance-84f7e467743007a2.lance.7b369cbc9584cb07-cgu.10.rcgu.o)
                core::iter::traits::iterator::Iterator::advance_by::had24c9cacc7c209a (.llvm.10025790976382166874) in liblance-84f7e467743007a2.rlib(lance-84f7e467743007a2.lance.7b369cbc9584cb07-cgu.10.rcgu.o)
                core::iter::traits::iterator::Iterator::nth::h58ee762c27a277ad (.llvm.10025790976382166874) in liblance-84f7e467743007a2.rlib(lance-84f7e467743007a2.lance.7b369cbc9584cb07-cgu.10.rcgu.o)
                _$LT$core..iter..adapters..map..Map$LT$I$C$F$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::try_fold::h4554b8c0e4ab2a99 in liblance-84f7e467743007a2.rlib(lance-84f7e467743007a2.lance.7b369cbc9584cb07-cgu.03.rcgu.o)
                _$LT$core..iter..adapters..flatten..FlatMap$LT$I$C$U$C$F$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h414704e4be8ef32a (.llvm.14035103181559843495) in liblance-84f7e467743007a2.rlib(lance-84f7e467743007a2.lance.7b369cbc9584cb07-cgu.09.rcgu.o)
                _$LT$core..iter..adapters..map..Map$LT$I$C$F$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h0a4e1745d83059b7 (.llvm.5599426574168741917) in liblance_index-b8c275b537c21ba8.rlib(lance_index-b8c275b537c21ba8.lance_index.6f9ed82d0e9bc5f-cgu.06.rcgu.o)
                _$LT$core..iter..adapters..flatten..FlatMap$LT$I$C$U$C$F$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::hb95d010e575fe310 (.llvm.5599426574168741917) in liblance_index-b8c275b537c21ba8.rlib(lance_index-b8c275b537c21ba8.lance_index.6f9ed82d0e9bc5f-cgu.06.rcgu.o)
                ...
          ld: symbol(s) not found for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)```

reymondzzzz avatar Feb 07 '24 12:02 reymondzzzz

Hi, could you provide the version of lance you are trying to use. Also, steps to reproduce would be helpful.

chebbyChefNEQ avatar Feb 08 '24 18:02 chebbyChefNEQ

lance = "=0.9.0" lance-linalg = "=0.9.0" lance-index = "=0.9.0"

hope you see it https://github.com/smallcloudai/refact-lsp/actions/runs/7868826396/job/21466743659

reymondzzzz avatar Feb 12 '24 09:02 reymondzzzz

Just to help you with more deta-points for debugging this, we are facing this too at:

https://github.com/tensorlakeai/indexify/actions/runs/7940336554/job/21681480626

rakshith-ravi avatar Feb 17 '24 09:02 rakshith-ravi

Hi @reymondzzzz @rakshith-ravi I believe the GHA runner you are using are both intel macs, which we don't support. Could you try running on macos-14?

https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources

chebbyChefNEQ avatar Feb 18 '24 05:02 chebbyChefNEQ

But all packages with cross compile flag are built fine, except lance. Unfortunately, we cannot try macos-14

reymondzzzz avatar Feb 18 '24 11:02 reymondzzzz

https://github.com/lancedb/lance/issues/1621 This is relevant.

eddyxu avatar Feb 23 '24 07:02 eddyxu

I've tested the cross compile on an intel mac

cargo build --release --target=aarch64-apple-darwin it works after https://github.com/lancedb/lance/pull/1979 change

eddyxu avatar Feb 24 '24 07:02 eddyxu

Great, when release?

reymondzzzz avatar Feb 25 '24 16:02 reymondzzzz

And release of lancedb? I tried to build on macos-11, macos-12 and macos-13. It didn't build with error https://github.com/reymondzzzz/lance/actions/runs/8052424280 Is it normal?

reymondzzzz avatar Feb 26 '24 17:02 reymondzzzz

macos-{11, 12, 13} is on intel CPU macos-14 is Apple silicon only.

We had a release yesterday https://github.com/lancedb/lance/releases/tag/v0.9.19. Does it work for you

eddyxu avatar Feb 26 '24 17:02 eddyxu

crate was not released. https://github.com/lancedb/lance/actions/runs/8043923206

reymondzzzz avatar Feb 26 '24 17:02 reymondzzzz

I used git repo in my Cargo.yml and it works. But I don't like this way

reymondzzzz avatar Feb 26 '24 17:02 reymondzzzz

macos-{11, 12, 13} is on intel CPU

Cross compile for arm64 with flag --target aarch64-apple-darwin? Before attaching lance to my project I used cross compile successfully, but lance has some cross compile problems....

reymondzzzz avatar Feb 26 '24 17:02 reymondzzzz

@reymondzzzz Did you manage to solve this ?

In case this is useful to someone else...

I first had lance-linalg compile errors ( Mac M1 Max - Sonoma 14.3.1 )

error: failed to run custom build command for lance-linalg v0.10.2

Turns out it crashed on " let rust_toolchain = env::var("RUSTUP_TOOLCHAIN").unwrap(); " in build.rs:18:55

The problem went away when I uninstalled rust & rustup - and started over ( not using brew ) and instead installed using curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh as described on https://www.rust-lang.org/tools/install

oddpxl avatar Mar 06 '24 21:03 oddpxl

No... I switched to macos-14(honestly I didn't know what GH made m1 free) and that's all

reymondzzzz avatar Mar 07 '24 11:03 reymondzzzz

Close this as it is resolved by switching GHA runner

eddyxu avatar Jul 03 '24 16:07 eddyxu