Line 36 in GEN.wrapper_posixio.c is clearly nonsense:
FILE* __real_fopen(MPI3CONST char path, MPI3CONST char mode);
MPI3CONST should not appear anywhere in the source file because the
POSIX I/O wrappers have nothing to do with MPI. We can fix the problem
by preventing the MPI3CONST substitution in the ipm_key_posixio
template source file. Apply the patch below to the top level IPM
directory:
$ cd IPM/
$ patch -b -p1 < /path/to/ipm-16c494310b_fix_mpi3_subst.diff
$ cat ipm-16c494310b_fix_mpi3_subst.diff
diff -uNr IPM-orig/bin/make_wrappers IPM/bin/make_wrappers
--- IPM-orig/bin/make_wrappers 2014-07-28 14:06:40.000047718 -0700
+++ IPM/bin/make_wrappers 2014-07-28 14:08:02.545538825 -0700
@@ -118,7 +118,11 @@
$call{$id}{car} =~ s/\(//;
$call{$id}{car} =~ s/\)//;
- $call{$id}{cai} =~ s/const/MPI3CONST/g;
+ # The I/O functions in ipm_key_posixio, e.g. fwrite, have nothing to
+ # do with MPI and so we avoid the MPI3CONST substitution.
+ if (index("$IPM_KEYFILE", "ipm_key_posixio") == -1) {
+ $call{$id}{cai} =~ s/const/MPI3CONST/g;
+ }
#
# cufft
After a configure step with --enable-posixio and then a make step, we get the following build error
GEN.wrapper_posixio.c:36:30: error: expected ')' before 'char' make[2]: *\ [libipm_la-GEN.wrapper_posixio.lo] Error 1
Line 36 in GEN.wrapper_posixio.c is clearly nonsense: FILE* __real_fopen(MPI3CONST char path, MPI3CONST char mode);
MPI3CONST should not appear anywhere in the source file because the POSIX I/O wrappers have nothing to do with MPI. We can fix the problem by preventing the MPI3CONST substitution in the ipm_key_posixio template source file. Apply the patch below to the top level IPM directory:
$ cd IPM/ $ patch -b -p1 < /path/to/ipm-16c494310b_fix_mpi3_subst.diff
$ cat ipm-16c494310b_fix_mpi3_subst.diff
Full steps to reproduce the error:
$ git clone https://github.com/nerscadmin/IPM.git $ cd IPM/ $ autoreconf -f -i $ ./configure --disable-mpi --enable-posixio $ make
/bin/sh ../libtool --tag=CC --mode=compile mpicc -DHAVE_CONFIG_H -I. -I.. -I../include -DMPI_STATUS_COUNT=_ucount -DHAVE_POSIXIO -g -O2 -DHAVE_DYNLOAD -DOS_LINUX -c -o libipm_la-mod_posixio.lo
test -f 'mod_posixio.c' || echo './'
mod_posixio.c libtool: compile: mpicc -DHAVE_CONFIG_H -I. -I.. -I../include -DMPI_STATUS_COUNT=_ucount -DHAVE_POSIXIO -g -O2 -DHAVE_DYNLOAD -DOS_LINUX -c mod_posixio.c -fPIC -DPIC -o .libs/libipm_la-mod_posixio.o libtool: compile: mpicc -DHAVE_CONFIG_H -I. -I.. -I../include -DMPI_STATUS_COUNT=_ucount -DHAVE_POSIXIO -g -O2 -DHAVE_DYNLOAD -DOS_LINUX -c mod_posixio.c -o libipm_la-mod_posixio.o >/dev/null 2>&1 /bin/sh ../libtool --tag=CC --mode=compile mpicc -DHAVE_CONFIG_H -I. -I.. -I../include -DMPI_STATUS_COUNT=_ucount -DHAVE_POSIXIO -g -O2 -DHAVE_DYNLOAD -DOS_LINUX -c -o libipm_la-GEN.wrapper_posixio.lotest -f 'GEN.wrapper_posixio.c' || echo './'
GEN.wrapper_posixio.c libtool: compile: mpicc -DHAVE_CONFIG_H -I. -I.. -I../include -DMPI_STATUS_COUNT=_ucount -DHAVE_POSIXIO -g -O2 -DHAVE_DYNLOAD -DOS_LINUX -c GEN.wrapper_posixio.c -fPIC -DPIC -o .libs/libipm_la-GEN.wrapper_posixio.o GEN.wrapper_posixio.c:36:30: error: expected ')' before 'char' GEN.wrapper_posixio.c:57:23: error: expected ')' before 'char' GEN.wrapper_posixio.c:175:29: error: unknown type name 'MPI3CONST' GEN.wrapper_posixio.c:196:22: error: unknown type name 'MPI3CONST' GEN.wrapper_posixio.c:314:32: error: expected ')' before 'char' GEN.wrapper_posixio.c:335:25: error: expected ')' before 'char' GEN.wrapper_posixio.c:870:32: error: expected ')' before 'void' GEN.wrapper_posixio.c:891:25: error: expected ')' before 'void' GEN.wrapper_posixio.c:1565:34: error: unknown type name 'MPI3CONST' GEN.wrapper_posixio.c:1586:27: error: unknown type name 'MPI3CONST' GEN.wrapper_posixio.c:2260:30: error: unknown type name 'MPI3CONST' GEN.wrapper_posixio.c:2281:23: error: unknown type name 'MPI3CONST' GEN.wrapper_posixio.c:2399:27: error: expected ')' before 'char' GEN.wrapper_posixio.c:2420:20: error: expected ')' before 'char' GEN.wrapper_posixio.c:2538:29: error: expected ')' before 'char' GEN.wrapper_posixio.c:2559:22: error: expected ')' before 'char' GEN.wrapper_posixio.c:2677:28: error: expected ')' before 'char' GEN.wrapper_posixio.c:2698:21: error: expected ')' before 'char' GEN.wrapper_posixio.c:2955:31: error: expected ')' before 'char' GEN.wrapper_posixio.c:2976:24: error: expected ')' before 'char' GEN.wrapper_posixio.c:3233:33: error: expected ')' before 'char' GEN.wrapper_posixio.c:3254:26: error: expected ')' before 'char' make[2]: *\ [libipm_la-GEN.wrapper_posixio.lo] Error 1