【发布时间】:2022-01-28 08:23:44
【问题描述】:
我为 Fortran OS X*(学生版)全新安装了英特尔® Parallel Studio XE Composer 版。它带有数学内核库,这就是我购买它的原因。我很难开始使用 MKL。这是我一步一步完成的。
1) 为 Fortran OS X* 安装了英特尔® Parallel Studio XE Composer 版(没问题)。我可以使用ifort 运行“hello world”脚本,并在最后毫无问题地抛出-mkl 链接命令(目前还没有调用任何mkl 命令)。
2) 在these instructions 之后,我使用 intel 提供的脚本(准确地说,位于 opt/intel/bin 中)设置了我的环境变量。我有英特尔 64 位架构(根据ifort -V),所以我使用bash mklvars.sh intel64 mod ilp64。它运行没有错误(或任何输出)。
3) 我编写了以下代码来使用 MKL 的 gemm fortran95 命令。只需乘以 2 个矩阵。
program test
implicit none
real, dimension(2,2) :: testA, testB, testC
testA = 1
testB = 1
testC = 0 ! I don't think I need this line, but it shouldn't matter
call gemm(testA, testB, testC)
write(*,*) testC
end program test
4) 我用ifort test_mkl.f90 -o test -mkl 编译。我收到以下错误:
Undefined symbols for architecture x86_64:
"_gemm_", referenced from:
_MAIN__ in ifortSTVOrB.o
ld: symbol(s) not found for architecture x86_64
5) 我尝试ifort test_mkl.f90 -o test -L/opt/intel/mkl/lib -mkl 并得到相同的结果。
我注意到很多使用 MKL 的人的代码都以 USE mkl95_blas, ONLY: gemm 开头,所以我在上面的两个示例中都将其放在 implicit none 上面并得到:
test_mkl.f90(4): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [MKL95_BLAS]
USE mkl95_blas, ONLY: gemm
--------^
test_mkl.f90(12): error #6406: Conflicting attributes or multiple declaration of name. [GEMM]
call gemm(testA, testB, testC )
---------^
test_mkl.f90(4): error #6580: Name in only-list does not exist. [GEMM]
USE mkl95_blas, ONLY: gemm
--------------------------^
compilation aborted for test_mkl.f90 (code 1)
关于问题是什么或如何解决这个问题的任何想法?我已经成功使用 MKL run a simple script in XCODE,所以这绝对是我正在做的事情,而不是我的安装。
【问题讨论】:
-
看看能不能找到那个模块的路径...
-
您必须为 rigjt 包含路径设置环境。这是您应该在英特尔支持论坛上提出的典型问题,您需要为支持付费。
-
感谢 Vladimir,在看到您的评论后,我尝试了 MKL 的英特尔支持论坛并在那里找到了一些帮助。
标签: xcode command-line fortran intel-fortran intel-mkl