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

Apple silicon compile error: "ld: Undefined symbols" #373

Open
abroy77 opened this issue Feb 19, 2024 · 1 comment
Open

Apple silicon compile error: "ld: Undefined symbols" #373

abroy77 opened this issue Feb 19, 2024 · 1 comment

Comments

@abroy77
Copy link

abroy77 commented Feb 19, 2024

Failing to compile the example script from the docs:

use ndarray::prelude::*;
use ndarray_linalg::Solve;

  fn main() {
      
      let a: Array2<f64> = array![[3., 2., -1.], [2., -2., 4.], [-2., 1., -2.]];
      let b: Array1<f64> = array![1., -2., 0.];
      let x = a.solve_into(b).unwrap();
      assert!(x.abs_diff_eq(&array![1., -2., -2.], 1e-9));
  
  }

MacOS version: 14.3.1
Device: Apple Macbook Pro M3 Pro
Rust version:

rustc 1.76.0 (07dca489a 2024-02-04)
binary: rustc
commit-hash: 07dca489ac2d933c78d3c5158e3f43beefeb02ce
commit-date: 2024-02-04
host: aarch64-apple-darwin
release: 1.76.0
LLVM version: 17.0.6

Cargo.toml dependencies:

[dependencies]
ndarray = "0.15.6"
ndarray-linalg = "0.16.0"

Main Error message:

note: ld: Undefined symbols:
            _dgetrf_, referenced from:
                lapack::dgetrf::h0fc923a6c9987636 in liblax-f78efd393904881d.rlib[10](lax-f78efd393904881d.lax.c010234ea3c8cc9-cgu.7.rcgu.o)
            _dgetrs_, referenced from:
                lapack::dgetrs::h997874d0f9aec842 in liblax-f78efd393904881d.rlib[10](lax-f78efd393904881d.lax.c010234ea3c8cc9-cgu.7.rcgu.o)
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

Output for cargo build -v
output.txt

@ivnsch
Copy link

ivnsch commented Jun 16, 2024

Same error here. Mac book pro m1, 14.5, rust 1.81.0-nightly,

ndarray = "0.15.6"
ndarray-linalg = "0.16.0"

ivnsch added a commit to ivnsch/linalg that referenced this issue Jun 16, 2024
nalgebra seems not to work to solve 4x3 matrix?

ndarray c dependencies error
rust-ndarray/ndarray-linalg#373
ivnsch added a commit to ivnsch/linalg that referenced this issue Jun 16, 2024
nalgebra seems not to work to solve 4x3 matrix?

ndarray c dependencies error
rust-ndarray/ndarray-linalg#373
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants