问题描述
我在/ex文件夹中有一个main.f90. f77子例程文件位于/ex/src中.子例程文件再次使用BLAS和LAPACK库.对于BLAS和LAPACK,我必须使用Intel Math Kernel Library.
I have a main.f90 in the folder /ex. And the f77 subroutine files are in /ex/src. And the subroutine files again use BLAS and LAPACK libraries. For the BLAS and LAPACK, I have to use Intel Math Kernel Library.
Intel fortran和mkl文件夹如下:
The Intel fortran and the mkl folders look like:
/opt/intel$
ActivationTool composer_xe_2011_sp1 intel_sdp_products.db man
bin composer_xe_2011_sp1.11.339 lib mkl
composerxe include licenses
/opt/intel/mkl$
benchmarks bin examples include interfaces lib tests tools
/opt/intel/mkl/lib/ia32$
libmkl_avx.so libmkl_gnu_thread.so libmkl_scalapack_core.so
libmkl_blacs.a libmkl_intel.a libmkl_sequential.a
libmkl_blacs_intelmpi.a libmkl_intel.so libmkl_sequential.so
libmkl_blacs_intelmpi.so libmkl_intel_thread.a libmkl_solver.a
... (a bunch of files) ...
要在/ex中进行编译的main.f90的makefile代码是什么?谢谢!
What's the makefile code for the main.f90 in /ex to be compiled? Thanks!
推荐答案
我猜您正在使用版本12(来自/opt/intel中composer_xe_2011_sp1.11.339
的猜测),因此在链接时,您可以简单地使用-mkl
选项这个:
I guess you're using version 12 (guess from composer_xe_2011_sp1.11.339
in /opt/intel), so you can simply use -mkl
option when linking like this:
ifort main.o sub1.o sub2.o -o a.out -mkl
(请参阅: http ://software.intel.com/zh-CN/articles/using-mkl-in-intel-compiler-mkl-qmkl-options )
这篇关于Makefile:Intel fortran,文件夹中的源文件和Intel Math Kernel Library的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!