日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

fatal error: mpi.h: No such file or directory // fatal error: mkl.h: No such file or directory

作者:小果果WRT 更新時間: 2022-02-23 編程語言

在非root用戶的目錄下安裝了Intel mkl的庫,也安裝了mpich/openmpi 但是編譯程序時都出現fatal error: mpi.h: No such file or directory // fatal error: mkl.h: No such file or directory錯誤

  運行指令:mpicc -o cannon cannon.c
  1>更改程序中的#include "mpi.h" 為 include <mpi.h> 未解決

  運行 mpicc -o cannon cannon.c -I/home/wangruting/software2/mpich-3.3.2/include -L/home/wangruting/software2/mpich-3.3.2/lib
  解決了fatal error
  運行 mpirun -np 4 ./cannon
  
  2>添加環境變量到~/.bashrc文件中
        export PATH=$PATH:/home/wangruting/intel/bin
        export LD_LIBRARY_PATH=$LD_LIBRARY_LIB:/home/wangruting/intel/lib/intel64:/home/wangruting/intel/mkl/lib/intel64
        編譯時加 -I/home/wangruting/intel/mkl/include 表示優先在此路徑尋找頭文件
        加-L/home/wangruting/intel/mkl/lib/intel64 -L/home/wangruting/intel/lib/intel64 表示優先在此路徑尋找庫文件
       運行命令: gcc example.c -o example -I/home/wangruting/intel/mkl/inculde -L/home/wangruting/intel/mkl/lib/intel64 -lm -dl -lpthread -liomp5 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core(未解決)

報錯報錯

原文鏈接:https://blog.csdn.net/weixin_44542349/article/details/107640184

欄目分類
最近更新