Skip to content

Unable to link on Apple M1 #108

@matthagan15

Description

@matthagan15

I have installed intel mkl and verified it can be found with pkg-config, as running pkg-config --variable=prefix mkl-static-lp64-seq results in the output /opt/intel/oneapi/mkl/latest/lib/pkgconfig/../.. . However, when running a barebones binary setup with the following lines in my Cargo.toml:

ndarray = {version = "*", features = ["blas"]}
ndarray-linalg = {version = "*", git="https://github.com/matthagan15/ndarray-linalg.git", branch="stable_expm"}
blas-src = {version = "*", features = ["intel-mkl"]}

I get the following output when trying to build a tester binary:

error: linking with `cc` failed: exit status: 1
  = note: Undefined symbols for architecture x86_64:
            "_cblas_cgemm", referenced from:
                ndarray::linalg::impl_linalg::mat_mul_impl::ha9237a4a1bfa42c4 in expm_test-0790de8f547e9cbd.4kiz8b0v0q92ql7g.rcgu.o
            "_cblas_ddot", referenced from:
                ndarray::linalg::impl_linalg::_$LT$impl$u20$ndarray..ArrayBase$LT$S$C$ndarray..dimension..dim..Dim$LT$$u5b$usize$u3b$$u20$1$u5d$$GT$$GT$$GT$::dot_impl::h6cc7f6400866deb3 in expm_test-0790de8f547e9cbd.4unh5nyr6the737r.rcgu.o
            "_cblas_dgemm", referenced from:
                ndarray::linalg::impl_linalg::mat_mul_impl::ha9237a4a1bfa42c4 in expm_test-0790de8f547e9cbd.4kiz8b0v0q92ql7g.rcgu.o
            "_cblas_dgemv", referenced from:
                ndarray::linalg::impl_linalg::general_mat_vec_mul_impl::hb2c5d2f9aa4fb833 in expm_test-0790de8f547e9cbd.4kiz8b0v0q92ql7g.rcgu.o
            "_cblas_sdot", referenced from:
                ndarray::linalg::impl_linalg::_$LT$impl$u20$ndarray..ArrayBase$LT$S$C$ndarray..dimension..dim..Dim$LT$$u5b$usize$u3b$$u20$1$u5d$$GT$$GT$$GT$::dot_impl::h6cc7f6400866deb3 in expm_test-0790de8f547e9cbd.4unh5nyr6the737r.rcgu.o
            "_cblas_sgemm", referenced from:
                ndarray::linalg::impl_linalg::mat_mul_impl::ha9237a4a1bfa42c4 in expm_test-0790de8f547e9cbd.4kiz8b0v0q92ql7g.rcgu.o
            "_cblas_sgemv", referenced from:
                ndarray::linalg::impl_linalg::general_mat_vec_mul_impl::hb2c5d2f9aa4fb833 in expm_test-0790de8f547e9cbd.4kiz8b0v0q92ql7g.rcgu.o
            "_cblas_zgemm", referenced from:
                ndarray::linalg::impl_linalg::mat_mul_impl::ha9237a4a1bfa42c4 in expm_test-0790de8f547e9cbd.4kiz8b0v0q92ql7g.rcgu.o
            "_dlange_", referenced from:
                _$LT$lax..opnorm..OperatorNormWork$LT$f64$GT$$u20$as$u20$lax..opnorm..OperatorNormWorkImpl$GT$::calc::h89516ca1d11135c0 in liblax-5a109cea01c73e90.rlib(lax-5a109cea01c73e90.lax.dffd72c6-cgu.13.rcgu.o)
            "_zgeev_", referenced from:
                _$LT$lax..eig..EigWork$LT$num_complex..Complex$LT$f64$GT$$GT$$u20$as$u20$lax..eig..EigWorkImpl$GT$::new::h1a01750a222090a0 in liblax-5a109cea01c73e90.rlib(lax-5a109cea01c73e90.lax.dffd72c6-cgu.8.rcgu.o)
                _$LT$lax..eig..EigWork$LT$num_complex..Complex$LT$f64$GT$$GT$$u20$as$u20$lax..eig..EigWorkImpl$GT$::calc::h9f18ee0eac259059 in liblax-5a109cea01c73e90.rlib(lax-5a109cea01c73e90.lax.dffd72c6-cgu.8.rcgu.o)
            "_zgetrf_", referenced from:
                _$LT$num_complex..Complex$LT$f64$GT$$u20$as$u20$lax..solve..LuImpl$GT$::lu::h30148031dbbcc1c8 in liblax-5a109cea01c73e90.rlib(lax-5a109cea01c73e90.lax.dffd72c6-cgu.4.rcgu.o)
            "_zgetri_", referenced from:
                _$LT$lax..solve..InvWork$LT$num_complex..Complex$LT$f64$GT$$GT$$u20$as$u20$lax..solve..InvWorkImpl$GT$::new::h0035c072560db9c9 in liblax-5a109cea01c73e90.rlib(lax-5a109cea01c73e90.lax.dffd72c6-cgu.15.rcgu.o)
                _$LT$lax..solve..InvWork$LT$num_complex..Complex$LT$f64$GT$$GT$$u20$as$u20$lax..solve..InvWorkImpl$GT$::calc::h95f3108d9f561f38 in liblax-5a109cea01c73e90.rlib(lax-5a109cea01c73e90.lax.dffd72c6-cgu.15.rcgu.o)
            "_zlange_", referenced from:
                _$LT$lax..opnorm..OperatorNormWork$LT$num_complex..Complex$LT$f64$GT$$GT$$u20$as$u20$lax..opnorm..OperatorNormWorkImpl$GT$::calc::hd0a09b3056028cc0 in liblax-5a109cea01c73e90.rlib(lax-5a109cea01c73e90.lax.dffd72c6-cgu.13.rcgu.o)
          ld: symbol(s) not found for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)


warning: `expm_test` (bin "expm_test") generated 2 warnings
error: could not compile `expm_test` due to previous error; 2 warnings emitted

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions