mkl库配置


cmake卸载旧版本,并升级


https://blog.csdn.net/weixin_41010198/article/details/109343347

pip install -U cmake==3.25.2
BUILDMODE=DEBUG . build.sh

安装mkl


https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-download.html?operatingsystem=linux&distributions=aptpackagemanager

wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt update
sudo apt install intel-oneapi-mkl

pip install mkl-devel

mkl安装目录是:

/opt/intel/oneapi/mkl/2023.2.0
vim ~/.bashrc
export MKL_DIR=/opt/intel/oneapi/mkl/2023.2.0
export MKL_ROOT=/opt/intel/oneapi/mkl/2023.2.0
soource ~/.bashrc

cmake


创建cmake文件,找到MKLConfig.cmake并cp到该目录

在MKLconfig.cmake中

# Set MKL_ROOT directory
set(MKL_ROOT "/opt/intel/oneapi/mkl/2023.2.0")

如果还有其他错误,修改cmakelist.txt或者是MKLconfig.cmake

MKLconfig.cmake属于输入本地环境变量,然后输出用于链接的变量,该文件有利于自动找到和配置本地的mkl库

你可能感兴趣的:(折腾日记,配置,linux库)