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

Unable to link with HPC intel-mkl #107

Open
matthagan15 opened this issue Oct 4, 2022 · 0 comments
Open

Unable to link with HPC intel-mkl #107

matthagan15 opened this issue Oct 4, 2022 · 0 comments

Comments

@matthagan15
Copy link

matthagan15 commented Oct 4, 2022

Hi I'm trying to get a simple ndarray setup using BLAS on a HPC cluster working with intel-mkl as the BLAS library. Unfortunately even a bare bones setup is unable to find the proper library, and even a simple binary just doing a matrix multiplication fails to build. After loading the proper modules and checking that the intel-mkl library is accessible (I can navigate through the mkl folders, I can find blas libraries, and $MKLROOT points to the proper path and so does pkg-config -- variable=prefix mkl-static-lp64-seq) I try to build a basic binary with the following Cargo.toml:

[package]
name = "tester"
version = "0.1.0"
edition = "2021"

[dependencies]
ndarray = {version = "0.15.0", features = ["blas"]}
blas-src = {version = "0.8.0", features = ["intel-mkl"]}
intel-mkl-src = {version = "*"}

and I get a bunch of errors like the following:
/gpfs/fs1/home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/zstd-sys-1.4.18+zstd.1.4.7/zstd/lib/common/xxhash.c:85: undefined reference to `_intel_fast_memcpy'
with the following "help"

collect2: error: ld returned 1 exit status

  = help: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

error: could not compile `intel-mkl-src` due to previous error

I know that the HPC FAQ specifies that a -mkl flag should be passed to gcc if linking against intel-mkl with c++ but I was not sure how to add that into here or if it would be necessary. Any help would be appreciated.

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

1 participant