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
- ArrayFire version: 3.8 branch
- Devices installed on the system: X86 CPU and MKL 2021.3
Checklist
- Using the latest available ArrayFire release
- GPU drivers are up to date
Reactions are currently unavailable
Static linking afcpu with MKL does nt work anymore fro some examples/unittests.
Description
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
Checklist