← 返回首页
Static linking afcpu with MKL does nt work anymore with the 3.8 branch · Issue #3242 · arrayfire/arrayfire · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Static linking afcpu with MKL does nt work anymore with the 3.8 branch #3242

New issue
New issue

Description

Static linking afcpu with MKL does nt work anymore fro some examples/unittests.

Description

  • Did you build ArrayFire yourself or did you use the official installers: ourself, 3.8 branch
  • Which backend is experiencing this issue? CPU
  • Do you have a workaround? no
  • Can the bug be reproduced reliably on your system? yes
  • A clear and concise description of what you expected to happen.
    afcpu to link statically with mkl and have no runtime deps with a mkl .so lib

It seems that all cpu tests and examples will fail to link when building with static MKL due to them depending on libmkl_rt.so, which has the two symbols MKL_Set_Threading_Layer, MKL_Set_Interface_Layer that a number of these executables depend on.

Looking at the PR that supported linking with MKL statically
https://github.com/arrayfire/arrayfire/pull/2877/files
we don't see any tests that had depended on the runtime lib...
It looks like this issue was introduced with
cd78885
which creates a dependency on libmkl_rt.so for all MKL builds;
the issue stems from src/api/c/device.cpp, but the MKL specific code is extraneous for a static build and can be deleted without issue.
So, deleting that extra stuff in device.cpp gets everything working.

Reproducible Code and/or Steps

Just try to build 3.8 with static MKL

System Information

  1. ArrayFire version: 3.8 branch
  2. Devices installed on the system: X86 CPU and MKL 2021.3

Checklist

  • Using the latest available ArrayFire release
  • GPU drivers are up to date

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Footer

      © 2026 GitHub, Inc.