My understanding is that OpenMPI built with either Intel or GNU compilers should be able to use the other compilers using the OMPI_CC and OMPI_FC environmental variables. For OpenMPI-1.8.8 built with Intel compilers, if you try to compile any code that includes mpif.h using OMPI_FC=gfortran it fails. The Intel build creates mpi-sizeof.h that dimensions arrays to more than 6 dimensions which gfortran cannot handle. The example below illustrates this. I wasn't able to find any other reports like this on the web, and I don't see any way of specifying a path to an alternate mpif.h include file. This looks to be a bug to me, but please let me know if I missed a config flag somewhere.
Dave Turner Selene cat bugtest.F ! Program to illustrate bug when OpenMPI is compiled with Intel ! compilers but run using OMPI_FC=gfortran. PROGRAM BUGTEST INCLUDE "mpif.h" END Selene cat go #!/bin/bash echo "Compile test using default ifort" mpifort --version mpifort bugtest.F -o bugtest_ifort echo "Compile test using gfortan when OpenMPI was compiled with ifort/icc" export OMPI_FC=gfortran mpifort --version mpifort bugtest.F -o bugtest_gfortran Selene ./go Compile test using default ifort ifort (IFORT) 15.0.3 20150407 Copyright (C) 1985-2015 Intel Corporation. All rights reserved. Compile test using gfortan when OpenMPI was compiled with ifort/icc GNU Fortran (Gentoo 4.9.3 p1.4, pie-0.6.4) 4.9.3 Copyright (C) 2015 Free Software Foundation, Inc. GNU Fortran comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of GNU Fortran under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING mpif-sizeof.h:75.48: Included at mpif.h:61: Included at bugtest.F:6: COMPLEX(REAL128), DIMENSION(1,1,1,1,1,1,1,*)::x 1 Error: Array specification at (1) has more than 7 dimensions mpif-sizeof.h:82.48: Included at mpif.h:61: Included at bugtest.F:6: COMPLEX(REAL128), DIMENSION(1,1,1,1,1,1,1,1,*)::x 1 Error: Array specification at (1) has more than 7 dimensions mpif-sizeof.h:89.48: Included at mpif.h:61: Included at bugtest.F:6: COMPLEX(REAL128), DIMENSION(1,1,1,1,1,1,1,1,1,*)::x 1 Error: Array specification at (1) has more than 7 dimensions [ More of the same errors have been clipped ] -- Work: davetur...@ksu.edu (785) 532-7791 2219 Durland, Manhattan KS 66502 Home: drdavetur...@gmail.com cell: (785) 770-5929