Skip to content

Intel Fortran for Linux

Intel Fortran for Linux published on No Comments on Intel Fortran for Linux

1. 下载

http://software.intel.com/en-us/articles/non-commercial-software-download/

可以在官网上免费下载non-commercial版

2.安装比较简单,就不多说了

3.编译选项

mkllib=/opt/intel/Compiler/11.1/064/mkl/lib/em64t
mklinc=/opt/intel/Compiler/11.1/064/mkl/include
foo: foo.o
           ifort -o foo foo.o -I$(mklinc) -L$(mkllib) -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_lapack95_lp64 -liomp5 -lpthread

在连接MKL程序时,要在每一个“LAYER”中选择一个库,

1 interface layer:提供程序接口,即libmkl_intel{lp64},其中lp64是对em64t或ia64版本。

2 threading layer:线程接口。一般都是libmkl_intel_thread。注意,有了它后,一定要加上iomp5和pthread库,不然会出现连接错误。

3 computational layer,计算接口,即libmkl_core和你所需要的,如lapack的libmkl_lapack95_lp64或者线性方程组的libmkl_solver_lp64等等。

4 RTL接口,即pthread等等。

贴一段我的makefile

mkllib=/opt/intel/compilerpro-12.0.2.137/mkl/lib/ia32
mklinc=/opt/intel/compilerpro-12.0.2.137/mkl/include
FC = ifort
FLAGL = -I$(mklinc) -L$(mkllib)\
         -lmkl_intel -lmkl_intel_thread -liomp5 -lpthread \
         -lmkl_core -lmkl_lapack95 -lmkl_blas95 -O3 -pg
FLAGC = -c -O3 \
        -double_size 64 -funroll-loops -pg

PS: 若需要在未安装ifort的服务器上跑程序,需要拷贝以下几个动态连接库至服务器端/usr/lib

/opt/intel/compilerpro-12.0.2.137/mkl/lib/ia32/libmkl_p4m3.so

/opt/intel/compilerpro-12.0.2.137/mkl/lib/ia32/libmkl_def.so

/opt/intel/compilerpro-12.0.2.137/mkl/lib/ia32/libmkl_intel_thread.so

/opt/intel/compilerpro-12.0.2.137/mkl/lib/ia32/libmkl_intel.so

/opt/intel/compilerpro-12.0.2.137/mkl/lib/ia32/libmkl_core.so

/opt/intel/lib/ia32/libiomp5.so

 

Leave a Reply

Your email address will not be published. Required fields are marked *