Skip to content

Unable to link with HPC intel-mkl #107

@matthagan15

Description

@matthagan15

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/git.colasdn.top-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.

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