sdd / kiddo_v1

K-dimensional tree in Rust for fast geospatial indexing and lookup
Apache License 2.0
29 stars 11 forks source link

The library doesn't compile for ARM64 #16

Closed ababo closed 2 years ago

ababo commented 2 years ago

I get the following output:

   Compiling petgraph v0.5.1
error[E0432]: unresolved import `std::arch::x86_64`
 --> /Users/ababo/.cargo/registry/src/github.com-1ecc6299db9ec823/kiddo-0.1.6/src/distance.rs:6:16
  |
6 | use std::arch::x86_64::*;
  |                ^^^^^^ could not find `x86_64` in `arch`

error[E0412]: cannot find type `__m128` in this scope
  --> /Users/ababo/.cargo/registry/src/github.com-1ecc6299db9ec823/kiddo-0.1.6/src/distance.rs:10:11
   |
10 |     simd: __m128,
   |           ^^^^^^ not found in this scope

error[E0425]: cannot find function `dot_sse` in this scope
  --> /Users/ababo/.cargo/registry/src/github.com-1ecc6299db9ec823/kiddo-0.1.6/src/distance.rs:78:14
   |
78 |     unsafe { dot_sse(ap, bp) }
   |              ^^^^^^^ not found in this scope

error[E0425]: cannot find function `dot_sse` in this scope
  --> /Users/ababo/.cargo/registry/src/github.com-1ecc6299db9ec823/kiddo-0.1.6/src/distance.rs:82:14
   |
82 |     unsafe { dot_sse(a.as_ptr(), b.as_ptr()) }
   |              ^^^^^^^ not found in this scope

error[E0425]: cannot find function `dot_sse_aligned` in this scope
  --> /Users/ababo/.cargo/registry/src/github.com-1ecc6299db9ec823/kiddo-0.1.6/src/distance.rs:88:14
   |
88 |     unsafe { dot_sse_aligned(ap, bp) }
   |              ^^^^^^^^^^^^^^^ not found in this scope

error[E0740]: unions may not contain fields that need dropping
  --> /Users/ababo/.cargo/registry/src/github.com-1ecc6299db9ec823/kiddo-0.1.6/src/distance.rs:10:5
   |
10 |     simd: __m128,
   |     ^^^^^^^^^^^^
   |
note: `std::mem::ManuallyDrop` can be used to wrap the type
  --> /Users/ababo/.cargo/registry/src/github.com-1ecc6299db9ec823/kiddo-0.1.6/src/distance.rs:10:5
   |
10 |     simd: __m128,
   |     ^^^^^^^^^^^^

   Compiling crossbeam-channel v0.5.1

I think there should always be a fallback for the case of generic CPU architecture.

sdd commented 2 years ago

Hi - sorry, only just seen this. Which version are you using? This should have been fixed in 0.1.7 by this https://github.com/sdd/kiddo/pull/13

ababo commented 2 years ago

Oh, great! Thank you, closing the issue.