rust-lang / rust-lang/rust

Rust 1.90.0 LLD linker: libmkl_intel_lp64.so: undefined symbol: mkl_lapack_zhesvxx

Open
#147,156 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-lld C-external-bug
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

When upgrading to rust 1.90.0, LLD cannot find a symbol that exists on Intel MKL binary.

Opting out of LLD works (-Clinker-features=-lld).

Code

I tried this code:

use petal_decomposition::RandomizedPca;

fn main() {
    let matrix_vec = vec![[1.2, 1.3], [2.2, 2.3], [3.2, 3.3]];
    let features: ndarray::Array2<f64> = matrix_vec.into();
    let mut pca: RandomizedPca<f64, _> = RandomizedPca::new(2);
    pca.fit(&features).unwrap();
    println!("{:?}", pca.components());
}

Here's the Cargo.toml file:

[package]
name = "rust190"
version = "0.1.0"
edition = "2024"

[dependencies]
ndarray = "0.15.6"
petal-decomposition = { version = "0.7.0", features = ["intel-mkl-system"] }

And some information about the OS:

$ cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"

$ apt list --installed | grep libmkl-intel-lp64
libmkl-intel-lp64/oldstable,now 2020.4.304-4 amd64 [installed]

$ nm -D /lib/x86_64-linux-gnu/libmkl_intel_lp64.so | grep  mkl_lapack_zhesvxx
                 U mkl_lapack_zhesvxx

$ nm -D /lib/x86_64-linux-gnu/libmkl_core.so | grep mkl_lapack_zhesvxx
0000000000c4c830 T mkl_lapack_zhesvxx

I expected to see this happen: the binary compiles and runs properly.

Instead, this happened:

$ cargo run
   Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.18s
     Running `target/debug/rust190`
target/debug/rust190: symbol lookup error: /lib/x86_64-linux-gnu/libmkl_intel_lp64.so: undefined symbol: mkl_lapack_zhesvxx

shell returned 127

The executable that DO NOT work doesn't list libmkl_core.so as a dependency:

$ ldd /opt/san-francisco/bin/pl-score 
        linux-vdso.so.1 (0x00007ffdbc552000)
        libmkl_intel_lp64.so => /lib/x86_64-linux-gnu/libmkl_intel_lp64.so (0x00007f01f8800000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f01f9602000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f01f9522000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f01f861e000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f01f9c0b000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f01f8619000)

On the other hand, the one that works does:

$ ldd pl-score
        linux-vdso.so.1 (0x00007ffd4bbdb000)
        libmkl_intel_lp64.so => /lib/x86_64-linux-gnu/libmkl_intel_lp64.so (0x00007f2c3dc00000)
        libmkl_sequential.so => /lib/x86_64-linux-gnu/libmkl_sequential.so (0x00007f2c3be00000)
        libmkl_core.so => /lib/x86_64-linux-gnu/libmkl_core.so (0x00007f2c37600000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2c3e9e0000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2c3db20000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2c3741e000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f2c3eff9000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2c3efd8000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2c3efd3000)
Version it worked on

It most recently worked on: 1.89.0

Version with regression

rustc --version --verbose:

rustc 1.90.0 (1159e78c4 2025-09-14)
binary: rustc
commit-hash: 1159e78c4747b02ef996e55082b704c09b970588
commit-date: 2025-09-14
host: x86_64-unknown-linux-gnu
release: 1.90.0
LLVM version: 20.1.8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with the provided Cargo.toml and Rust 1.90.0 example, then compare it with Rust 1.89.0. Inspect the generated executable with ldd and verify whether libmkl_core.so is retained as a dependency; done means the Rust 1.90.0 binary links and runs without the undefined symbol error while preserving the working dependency behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.