Compile and install ifort-based mpich2

Source: Internet
Author: User

Download mpich2-1.4.1p1.tar.gz

First, introduce the ifort environment variable.

Export fc = ifort
Export f90 = ifort

(If you want to use ICC as the C compiler, export cc = ICC. Otherwise, you do not need to set it. GCC is used by default)

The following error is prompted:

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 install

./Configure -- help to view help

After compilation, mpich2 is installed in the/opt/mpich2/directory and the bin directory under the directory is viewed. Only mpif77 is found, but mpif77 is equivalent to MPI ifort, it can also be used to compile Fortran 90 or 95Program.

Test:

/Opt/mpich2/mpich2/bin/mpif77 rand2.f90

----------------------------------
! Rand2.f90
! Gfortran cannot be compiled, and ifort can be compiled
Program my_random
Call seed (RND $ timeseed)
Call random (RAND)
Print *, Rand
End program my_random
-----------------------------------

Refer:
Http://cache.baidu.com/C? M = queue & P = 882a964392995af30be2977e54498d & User = Baidu & fm = SC & query = mpich2 ++ ifort & qid = f3b81b87111dd593 & p1 = 3

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.