加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

Ubuntu下使用Intel MKL 编译安装MUMPS 数学库

(2013-01-05 18:25:56)
标签:

杂谈

分类: 软件编译
最近在学习一个全波形反演的软件,安装这个软件要用到开源稀疏矩阵直接求解器MUMPS,为了能把它装到机器上着实费了些力气,现在终于在我的笔记本上成功安装了串行版本,虽然实际测试的意义不大,但总归是一个进展。

下面摘自维基百科
MUMPS (MUltifrontal Massively Parallel sparse direct Solver) is a software application for the solution of large sparse systems of linear algebraic equations on distributed memory parallel computers. It was developed in European project PARASOL (1996–1999) by CERFACS, IRIT-ENSEEIHT and RAL. The software implements the multifrontal method, which is a version of Gaussian elimination for large sparse systems of equations, especially those arising from the finite element method. It is written in Fortran 90 with parallelism by MPI and it uses BLAS and ScaLAPACK kernels for dense matrix computations. Since 1999, MUMPS has been supported by CERFACS, IRIT-ENSEEIHT, and INRIA.

The importance of MUMPS lies in the fact that it is a rare public domain implementation of the multifrontal method, if not the only professional and supported one.

MUMPS的最新版本是4.10.0,按照软件的说明,安装串行版本需要预先安装BLAS 数学库,我的笔记本上装了intel/composer_xe_2013.1.117,里面带了MKL数学库(Intel® Math Kernel Library),因此就想到用MKL里自带的BLAS95数学库来安装MUMPS。

参照 Intel® Math Kernel Library Link Line Advisor 给出的建议,链接BLAS95的链接命令是:

$(MKLROOT)/lib/ia32/libmkl_blas95.a -Wl,--start-group  $(MKLROOT)/lib/ia32/libmkl_intel.a $(MKLROOT)/lib/ia32/libmkl_intel_thread.a $(MKLROOT)/lib/ia32/libmkl_core.a -Wl,--end-group -liomp5 -lpthread -lm

编译器选项是:

-I$(MKLROOT)/include/ia32 -I$(MKLROOT)/include

当然还要安装Metis-3.0软件,由于该软件安装比较简单,这里就不在赘述。

最后MUMUPS的Makefile.inc文件如下:

maqz@bogon:~/software/MUMPS_4.10.0$ cat Makefile.inc
#
This file is part of MUMPS 4.10.0, built on Tue May 10 12:56:32 UTC 2011
#
#Begin orderings

# NOTE that PORD is distributed within MUMPS by default. If you would like to
# use other orderings, you need to obtain the corresponding package and modify
# the variables below accordingly.
# For example, to have Metis available within MUMPS:
         1/ download Metis and compile it
         2/ uncomment (suppress # in first column) lines
            starting with LMETISDIR,  LMETIS
         3/ add -Dmetis in line ORDERINGSF
            ORDERINGSF  = -Dpord -Dmetis
         4/ Compile and install MUMPS
            make clean; make   (to clean up previous installation)
#
         Metis/ParMetis and SCOTCH/PT-SCOTCH (ver 5.1 and later) orderings are now available for MUMPS.
#

#SCOTCHDIR  = ${HOME}/scotch_5.1_esmumps
#ISCOTCH    = -I$(SCOTCHDIR)/include
# You have to choose one among the following two lines depending on
# the type of analysis you want to perform. If you want to perform only
# sequential analysis choose the first (remember to add -Dscotch in the ORDERINGSF
# variable below); for both parallel and sequential analysis choose the second
# line (remember to add -Dptscotch in the ORDERINGSF variable below)

#LSCOTCH    = -L$(SCOTCHDIR)/lib -lesmumps -lscotch -lscotcherr
#LSCOTCH    = -L$(SCOTCHDIR)/lib -lptesmumps -lptscotch -lptscotcherr


LPORDDIR = $(topdir)/PORD/lib/
IPORD    = -I$(topdir)/PORD/include/
LPORD    = -L$(LPORDDIR) -lpord

LMETISDIR = /home/maqz/software/metis-3.0/
#IMETIS    = /home/maqz/software/ParMetis-3.0 # Should be provided if you use parmetis

# You have to choose one among the following two lines depending on
# the type of analysis you want to perform. If you want to perform only
# sequential analysis choose the first (remember to add -Dmetis in the ORDERINGSF
# variable below); for both parallel and sequential analysis choose the second
# line (remember to add -Dparmetis in the ORDERINGSF variable below)

LMETIS    = -L$(LMETISDIR) -lmetis
#LMETIS    = -L$(LMETISDIR) -lparmetis -L$(LMETISDIR) -lmetis

# The following variables will be used in the compilation process.
# Please note that -Dptscotch and -Dparmetis imply -Dscotch and -Dmetis respectively.
#ORDERINGSF = -Dscotch -Dmetis -Dpord -Dptscotch -Dparmetis
ORDERINGSF  = -Dpord -Dmetis
ORDERINGSC  = $(ORDERINGSF)

LORDERINGS = $(LMETIS) $(LPORD) $(LSCOTCH)
IORDERINGSF = $(ISCOTCH)
IORDERINGSC = $(IMETIS) $(IPORD) $(ISCOTCH)

#End orderings
############################################################
############################################################

PLAT    =
LIBEXT  = .a
OUTC    = -o
OUTF    = -o
RM = /bin/rm -f
CC = icc
FC = ifort
FL = ifort
AR = ar vr
#RANLIB = ranlib
RANLIB  = echo
INCSEQ     = -I$(topdir)/libseq
LIBSEQ  = -L$(topdir)/libseq -lmpiseq
LIBBLAS = -L/opt/intel/mkl/lib/ia32/libmkl_blas95.a -Wl,--start-group /opt/intel/mkl/lib/ia32/libmkl_intel.a /opt/intel/mkl/lib/ia32/libmkl_intel_thread.a /opt/intel/mkl/lib/ia32/libmkl_core.a -Wl,--end-group -liomp5 -lpthread -lm
LIBOTHERS = -lpthread
#Preprocessor defs for calling Fortran from C (-DAdd_ or -DAdd__ or -DUPPER)
CDEFS   = -DAdd_

#Begin Optimized options
OPTF    = -O2 -DALLOW_NON_INIT -nofor_main
OPTL    = -O2 -nofor_main
OPTC    = -O2
#End Optimized options
INCS = $(INCSEQ) -I/opt/intel/mkl/include/ia32 -I/opt/intel/mkl/include
LIBS = $(LIBSEQ)
LIBSEQNEEDED = libseqneeded

修改保存Makefile.inc 文件,然后在命令行输入 make all 命令,即可完成安装,enjoy it !


0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有