矢量统计库 - 数学内核库
谁能用简单的英语向我解释一下如何将矢量统计库(包含在数学核心库中)链接到使用 Linux 版英特尔 Fortran 编译器编译的 Fortran 90 源代码?
我的 makefile 如下所示:
f90comp = ifort
libdir = /home/project/
mklpath = /opt/intel/mkl/10.0.5.025/lib/32/
mklinclude = /opt/intel/mkl/10.0.5.025/include/
exec: AAA.o
$(f90comp) -o AAA -L$(mklpath) -I$(mklinclude) AAA.o -libmkl_ia32.a -lguide -lpthread
AAA.o: $(libdir)AAA.f90
$(f90comp) -c -L$(mklpath) -I$(mklinclude) $(libdir)AAA.f90 -libmkl_ia32.a -lguide -lpthread
它产生以下错误:
ld: cannot find -libmkl_ia32.a
make: *** Error 1
但是,该文件存在于指定的目录 (mklpath) 中。
谢谢!!
Could anyone explain me (in plain English) how to link the Vector Statistical Library (included in the Math Kernel Library) to a Fortran 90 source code compiling with Intel Fortran compiler for Linux?
My makefile looks as follows:
f90comp = ifort
libdir = /home/project/
mklpath = /opt/intel/mkl/10.0.5.025/lib/32/
mklinclude = /opt/intel/mkl/10.0.5.025/include/
exec: AAA.o
$(f90comp) -o AAA -L$(mklpath) -I$(mklinclude) AAA.o -libmkl_ia32.a -lguide -lpthread
AAA.o: $(libdir)AAA.f90
$(f90comp) -c -L$(mklpath) -I$(mklinclude) $(libdir)AAA.f90 -libmkl_ia32.a -lguide -lpthread
It produces the following error:
ld: cannot find -libmkl_ia32.a
make: *** Error 1
However, the file exists in the specified directory (mklpath).
Thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该文件到底是如何调用的? 链接器的 -l 并不意味着采用真实的文件名。 它的意思是取[x],而要找到的文件称为lib[x].{so,a}。
如果你想给出真实的目标文件名,你可以直接附加它而不使用 -l 并使用绝对路径,或者使用 -l:[文件名]。
不过,我认为为您做到这一点的正确方法是
-lmkl_ia32
。 仅当库不名为 lib[x].{so,a} 时,原始文件名才有用How is the file really called? -l to the linker is not meant to take a real file name. It is meant to take [x], while the file to be found then is called lib[x].{so,a}.
If you want to give the real object file name, you may either just append it without using -l and using the absolute path, or use -l:[filename].
I assume the right way to do it for you is
-lmkl_ia32
however. Raw filenames are only useful if the lib is not called lib[x].{so,a}