现在的位置: 首页 > 综合 > 正文

编译安装基于ifort的MPICH2

2013年08月29日 ⁄ 综合 ⁄ 共 1183字 ⁄ 字号 评论关闭

下载  mpich2-1.4.1p1.tar.gz

首先引入ifort环境变量。

export FC=ifort
export F90=ifort

(若要使用icc作为C编译器,则export CC=icc,否则不需设置,默认使用gcc)

提示如下错误:

configure: error: F90 and F90FLAGS are replaced by FC and FCFLAGS respectively in this configure, please unset F90/F90FLAGS and set FC/FCFLAGS instead and rerun configure again.

[root@glnode05 mpich2-1.4.1p1]# unset F90
[root@glnode05 mpich2-1.4.1p1]# export FCFLAGS=ifort;
[root@glnode05 mpich2-1.4.1p1]# export FC=ifort;
[root@glnode05 mpich2-1.4.1p1]# export F77=ifort;
[root@glnode05 mpich2-1.4.1p1]# ./configure --prefix=/opt/mpich2/mpich2 && make && make install

./configure --help 查看帮助

编译完毕,mpich2安装在 /opt/mpich2/mpich2/目录下,查看目录下的bin目录,发现只有mpif77,不过mpif77等同于mpi ifort,使用它同样可以编译 fortran 90 或者 95 程序。

测试:

/opt/mpich2/mpich2/bin/mpif77 rand2.f90

----------------------------------
! rand2.f90
! 使用gfortran不能编译通过,使用ifort可以编译通过
program my_random 
CALL SEED(RND$TIMESEED)
CALL RANDOM(rand)
print *, rand
end program my_random
-----------------------------------

参考:
http://cache.baidu.com/c?m=9f65cb4a8c8507ed4fece763104297314e4380147780911f7cc3933fcf331d5c0c31a2b1243f545f84806b6777a84a5dede736056d457fe98f8dd50a8bb4cd6a74d97d23716c865612a242fb960663&p=882a964392995af30be2977e54498d&user=baidu&fm=sc&query=MPICH2++ifort&qid=f3b81b87111dd593&p1=3

抱歉!评论已关闭.