Opened 4 years ago

Last modified 3 years ago

#2070 new bug

Trivial patch for MPE's configure

Reported by: Lisandro Dalcin <dalcinl@…> Owned by: balaji
Priority: major Milestone: future
Component: mpich Keywords:
Cc:

Description

I'm attaching a trivial patch to configure.ac, please review and
commit. With this patch, I'm able to build MPE with mpich 3.0.4 as
packaged in Fedora 20.

Automatic detection of fortran compilers is not working so well, I had
to configure like this to get it work (ignore the -fPIC flags, this is
a particular requeriment):

$ ./configure --prefix=/home/devel/mpe CFLAGS=-fPIC FFLAGS=-fPIC
LDFLAGS=-fPIC MPI_CC=mpicc MPI_F77=mpif77 F77=gfortran

Attachments (1)

mpe-configure.diff (988 bytes) - added by balaji 4 years ago.

Download all attachments as: .zip

Change History (6)

Changed 4 years ago by balaji

comment:1 Changed 4 years ago by balaji

  • Milestone changed from mpich-3.1.4 to mpich-3.2

Milestone mpich-3.1.4 deleted

comment:2 Changed 3 years ago by balaji

  • Milestone changed from mpich-3.2 to future

comment:3 Changed 3 years ago by robl

Lisandro, is this patch still needed? First, the #include mpi.h line is already part of PAC_MPI_COMPILE_CC_FUNC. Second, I don't have a redhat-provided mpich-3.0.4, but do have mpich-3.1-4 on a Centos-6.6 image, and that all built fine out of the box (or, well, git clone from master).

comment:4 Changed 3 years ago by dalcinl@…

The usage of PAC_MPI_COMPILE_CC_FUNC in src/wrappers/configure.ac is still broken. Please look carefully at how PAC_MPI_COMPILE_CC_FUNC is implemented in aclocal_mpi.m4, then you will realize that the invocation in src/wrappers/configure.ac is generating test code where the definition of int MPI_Send(...) { return 0; } is within the definition of main(), i.e. something like:

#include "mpi.h"

int main(argc,argv) {

  MPI_Init(&argc,&argv);

  int MPI_Send(...)
  { 
     return 0;
  }

  MPI_Finalize();
}

Perhaps the code path configure takes no longer trigger the issue, but anyway I believe the code is wrong.

comment:5 Changed 3 years ago by dalcinl@…

Well, GCC seems to compile this code (I got the fragment from src/wrappers/configure).

However, with -pedantic, I get:

$ mpicc -Wno-long-long -pedantic tmp.c
tmp.c: In function ‘main’:
tmp.c:12:1: warning: ISO C forbids nested functions [-Wpedantic]
 int MPI_Send(const void *buf, int count, MPI_Datatype datatype,
 ^
tmp.c:12:1: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
Note: See TracTickets for help on using tickets.