Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Ifc80 gmake problem

jjqq
Beginner
588 Views
Hi,
I useifc80 to compile my programs by 'gmake' ,but when I run the csh script to compile them, it stops with the following output:
fortcom: Error: lnpsbcal.F, line 31: Cannot open include file 'mpif.h'
include 'mpif.h'
..............^
If I run the script again, it'll compile thefunction successfully.But maybe stop at anotherfunction which usually includes " include 'mpif.h' " .
I have been puzzled for a long time.
Thank you for your help.
0 Kudos
3 Replies
TimP
Honored Contributor III
588 Views

This looks like a problem either with your configuration of the mpi compiler driver, or with -I option.

Depending on which mpi you use, typically you must rebuild and install it, using ifort as the Fortran compiler. Then, if you use your new mpif77 or mpif90 to drive the compile, it should find those .h files. If you want to use ifort directly, you will need a -I (uppercase I for Include) option pointing to your mpi include file directory.

A typicalMakefile for building an mpi application will set the compiler to mpif77, e.g. by setting

FC = mpif77

and using

$(FC)as the compiler.

If you take a standard linux installation, installing thelam-mpi .rpm which comes with it,that will invoke g77. It won'tsupport linkingwith ifort, as you need the mpi libraries built with ifort.

0 Kudos
jjqq
Beginner
588 Views

Thank you!

My Makefile has set the compiler to mpif90 :

FC := /export/mpi/mpich-gm-ifc80/bin/mpif90
FFLAGS := -c -r8 -i4 -quiet -convert big_endian

Maybe I need to rebuild and install mpi .

0 Kudos
TimP
Honored Contributor III
588 Views
It looks like your makefile is set up for a system on which someone has alreadyinstalled a build of mpich, using ifort as the f90 compiler. You might find it useful to get setup instructions from that someone.
0 Kudos
Reply