Discussion:
building mpich1.2.7p1 with gcc4.0.2/gfortran
(too old to reply)
Sean
2006-06-12 00:54:14 UTC
Permalink
I am trying to install mpich1.2.7 on my box, and I want to use the
compiler I built from source myself (instead of using the /usr/bin/f77)

So, I configure in this way, but it seems that it failed to build mpif77
mpif90 (any fortran related mpi compiler). Any suggestion?

#configure -cc=/home/sean/originalgcc402/objgcc402/bin/gcc
-fc=/home/sean/originalgcc402/objgcc402/bin/gfortran
-f90=/home/sean/originalgcc402/objgcc402/bin/gfortran
#make
#ls ./bin
clog2alog clogTOslog2 mpichversion mpireconfig.dat
mpirun_dbg.dbx mpirun_dbg.xxgdb slog2navigator tstmachines
clog2print jumpshot mpicxx mpirun
mpirun_dbg.ddd mpirun.p4shmem slog2print
clog2TOslog2 logconvertor mpiinstall mpirun.args
mpirun_dbg.gdb mpirun.pg slog2updater
clogprint mpicc mpiman mpirun.ch_p4
mpirun_dbg.ladebug mpirun.rand tarch
clog_print mpiCC mpireconfig mpirun.ch_p4.args
mpirun_dbg.totalview slog2filter tdevice
Steven G. Kargl
2006-06-12 01:16:04 UTC
Permalink
Post by Sean
I am trying to install mpich1.2.7 on my box, and I want to use the
compiler I built from source myself (instead of using the /usr/bin/f77)
So, I configure in this way, but it seems that it failed to build mpif77
mpif90 (any fortran related mpi compiler). Any suggestion?
#configure -cc=/home/sean/originalgcc402/objgcc402/bin/gcc
-fc=/home/sean/originalgcc402/objgcc402/bin/gfortran
-f90=/home/sean/originalgcc402/objgcc402/bin/gfortran
Please upgrade to at least gfortrn 4.1.1. 4.0.2 is
extremely brokenly. I know for a fact that MPICH2
works fine with gfortran 4.2.0 (ie mainline) and it
should work with 4.1.1.
--
Steve
http://troutmask.apl.washington.edu/~kargl/
s***@hotmail.com
2006-06-12 01:31:07 UTC
Permalink
Thanks for the reply. First to follow the answer, do you think it's the
compiler's problem(instead that I used a wrong configuration option?)
I guess I may not have used a correct configuration, for example, the
path of lib option "[-lib=LIBRARY] [-mpilibname=MPINAME] " looks quite
related to a non-standard configuration.

(see http://spin.magnet.fsu.edu/local/mpi_install/node4.html)

What makes me hesitate to try another version is: I tested some
functionality under this version for a while.

Regard,
Sean
Post by Steven G. Kargl
Post by Sean
I am trying to install mpich1.2.7 on my box, and I want to use the
compiler I built from source myself (instead of using the /usr/bin/f77)
So, I configure in this way, but it seems that it failed to build mpif77
mpif90 (any fortran related mpi compiler). Any suggestion?
#configure -cc=/home/sean/originalgcc402/objgcc402/bin/gcc
-fc=/home/sean/originalgcc402/objgcc402/bin/gfortran
-f90=/home/sean/originalgcc402/objgcc402/bin/gfortran
Please upgrade to at least gfortrn 4.1.1. 4.0.2 is
extremely brokenly. I know for a fact that MPICH2
works fine with gfortran 4.2.0 (ie mainline) and it
should work with 4.1.1.
--
Steve
http://troutmask.apl.washington.edu/~kargl/
Sean
2006-06-12 17:18:40 UTC
Permalink
I used gcc4.1.1 to build mpich again, as follows. I still can't
successfully build it.

mpich1.2.7p1>configure -cc=/home/sean/originalgcc411/objgcc411/bin/gcc
-fc=/home/sean/originalgcc411/objgcc411/bin/gfortran
-f90=/home/sean/originalgcc411/objgcc411/bin/gfortran
mpich1.2.7p1>make
mpich1.2.7p1>ls bin
clog2alog jumpshot mpiinstall mpirun.ch_p4
mpirun_dbg.totalview slog2navigator
clog2print logconvertor mpiman mpirun.ch_p4.args
mpirun_dbg.xxgdb slog2print
clog2TOslog2 mpicc mpireconfig mpirun_dbg.dbx
mpirun.p4shmem slog2updater
clogprint mpiCC mpireconfig.dat mpirun_dbg.ddd
mpirun.pg tarch
clog_print mpichversion mpirun mpirun_dbg.gdb
mpirun.rand tdevice
clogTOslog2 mpicxx mpirun.args mpirun_dbg.ladebug
slog2filter tstmachines

Here is the executables in gcc directory
mpich1.2.7p1>ls /home/sean/originalgcc411/objgcc411/bin/
c++ g++ gccbug gfortran i686-pc-linux-gnu-g++
i686-pc-linux-gnu-gcc-4.1.1
cpp gcc gcov i686-pc-linux-gnu-c++ i686-pc-linux-gnu-gcc
i686-pc-linux-gnu-gfortran
Post by s***@hotmail.com
Thanks for the reply. First to follow the answer, do you think it's the
compiler's problem(instead that I used a wrong configuration option?)
I guess I may not have used a correct configuration, for example, the
path of lib option "[-lib=LIBRARY] [-mpilibname=MPINAME] " looks quite
related to a non-standard configuration.
(see http://spin.magnet.fsu.edu/local/mpi_install/node4.html)
What makes me hesitate to try another version is: I tested some
functionality under this version for a while.
Regard,
Sean
Post by Steven G. Kargl
Post by Sean
I am trying to install mpich1.2.7 on my box, and I want to use the
compiler I built from source myself (instead of using the /usr/bin/f77)
So, I configure in this way, but it seems that it failed to build mpif77
mpif90 (any fortran related mpi compiler). Any suggestion?
#configure -cc=/home/sean/originalgcc402/objgcc402/bin/gcc
-fc=/home/sean/originalgcc402/objgcc402/bin/gfortran
-f90=/home/sean/originalgcc402/objgcc402/bin/gfortran
Please upgrade to at least gfortrn 4.1.1. 4.0.2 is
extremely brokenly. I know for a fact that MPICH2
works fine with gfortran 4.2.0 (ie mainline) and it
should work with 4.1.1.
--
Steve
http://troutmask.apl.washington.edu/~kargl/
Sean
2006-06-12 17:19:16 UTC
Permalink
I used gcc4.1.1 to build mpich again, as follows. I still can't
successfully build it.

mpich1.2.7p1>configure -cc=/home/sean/originalgcc411/objgcc411/bin/gcc
-fc=/home/sean/originalgcc411/objgcc411/bin/gfortran
-f90=/home/sean/originalgcc411/objgcc411/bin/gfortran
mpich1.2.7p1>make
mpich1.2.7p1>ls bin
clog2alog jumpshot mpiinstall mpirun.ch_p4
mpirun_dbg.totalview slog2navigator
clog2print logconvertor mpiman mpirun.ch_p4.args
mpirun_dbg.xxgdb slog2print
clog2TOslog2 mpicc mpireconfig mpirun_dbg.dbx
mpirun.p4shmem slog2updater
clogprint mpiCC mpireconfig.dat mpirun_dbg.ddd mpirun.pg
tarch
clog_print mpichversion mpirun mpirun_dbg.gdb mpirun.rand
tdevice
clogTOslog2 mpicxx mpirun.args mpirun_dbg.ladebug
slog2filter tstmachines

Here is the executables in gcc directory
mpich1.2.7p1>ls /home/sean/originalgcc411/objgcc411/bin/
c++ g++ gccbug gfortran i686-pc-linux-gnu-g++
i686-pc-linux-gnu-gcc-4.1.1
cpp gcc gcov i686-pc-linux-gnu-c++ i686-pc-linux-gnu-gcc
i686-pc-linux-gnu-gfortran
Post by Steven G. Kargl
Post by Sean
I am trying to install mpich1.2.7 on my box, and I want to use the
compiler I built from source myself (instead of using the /usr/bin/f77)
So, I configure in this way, but it seems that it failed to build mpif77
mpif90 (any fortran related mpi compiler). Any suggestion?
#configure -cc=/home/sean/originalgcc402/objgcc402/bin/gcc
-fc=/home/sean/originalgcc402/objgcc402/bin/gfortran
-f90=/home/sean/originalgcc402/objgcc402/bin/gfortran
Please upgrade to at least gfortrn 4.1.1. 4.0.2 is
extremely brokenly. I know for a fact that MPICH2
works fine with gfortran 4.2.0 (ie mainline) and it
should work with 4.1.1.
Alfredo Buttari
2006-06-12 17:24:45 UTC
Permalink
Post by Sean
I am trying to install mpich1.2.7 on my box, and I want to use the
compiler I built from source myself (instead of using the /usr/bin/f77)
So, I configure in this way, but it seems that it failed to build mpif77
mpif90 (any fortran related mpi compiler). Any suggestion?
#configure -cc=/home/sean/originalgcc402/objgcc402/bin/gcc
-fc=/home/sean/originalgcc402/objgcc402/bin/gfortran
-f90=/home/sean/originalgcc402/objgcc402/bin/gfortran
#make
#ls ./bin
clog2alog clogTOslog2 mpichversion mpireconfig.dat
mpirun_dbg.dbx mpirun_dbg.xxgdb slog2navigator tstmachines
clog2print jumpshot mpicxx mpirun
mpirun_dbg.ddd mpirun.p4shmem slog2print
clog2TOslog2 logconvertor mpiinstall mpirun.args
mpirun_dbg.gdb mpirun.pg slog2updater
clogprint mpicc mpiman mpirun.ch_p4
mpirun_dbg.ladebug mpirun.rand tarch
clog_print mpiCC mpireconfig mpirun.ch_p4.args
mpirun_dbg.totalview slog2filter tdevice
Hi Sean,
the gfortran version doesn't make any difference. The problem is that
mpich configure fails to determine the way gfortran provides command
line arguments to f90 programs. What you have to do is:

export F77_GETARGDECL=" "

before running configure.
Hope it helps.

alfredo
Craig Powers
2006-06-12 17:44:02 UTC
Permalink
Post by Alfredo Buttari
Post by Sean
I am trying to install mpich1.2.7 on my box, and I want to use the
compiler I built from source myself (instead of using the /usr/bin/f77)
So, I configure in this way, but it seems that it failed to build mpif77
mpif90 (any fortran related mpi compiler). Any suggestion?
#configure -cc=/home/sean/originalgcc402/objgcc402/bin/gcc
-fc=/home/sean/originalgcc402/objgcc402/bin/gfortran
-f90=/home/sean/originalgcc402/objgcc402/bin/gfortran
#make
#ls ./bin
clog2alog clogTOslog2 mpichversion mpireconfig.dat
mpirun_dbg.dbx mpirun_dbg.xxgdb slog2navigator tstmachines
clog2print jumpshot mpicxx mpirun
mpirun_dbg.ddd mpirun.p4shmem slog2print
clog2TOslog2 logconvertor mpiinstall mpirun.args
mpirun_dbg.gdb mpirun.pg slog2updater
clogprint mpicc mpiman mpirun.ch_p4
mpirun_dbg.ladebug mpirun.rand tarch
clog_print mpiCC mpireconfig mpirun.ch_p4.args
mpirun_dbg.totalview slog2filter tdevice
Hi Sean,
the gfortran version doesn't make any difference. The problem is that
mpich configure fails to determine the way gfortran provides command
export F77_GETARGDECL=" "
before running configure.
Hope it helps.
Alternatively, I would expect that:
configure F77_GETARGDECL=" " <other options>

would work as well, with the added benefit that the command line will
show up in the configure output.
Sean
2006-06-12 19:39:23 UTC
Permalink
Post by Alfredo Buttari
Post by Sean
I am trying to install mpich1.2.7 on my box, and I want to use the
compiler I built from source myself (instead of using the /usr/bin/f77)
So, I configure in this way, but it seems that it failed to build mpif77
mpif90 (any fortran related mpi compiler). Any suggestion?
#configure -cc=/home/sean/originalgcc402/objgcc402/bin/gcc
-fc=/home/sean/originalgcc402/objgcc402/bin/gfortran
-f90=/home/sean/originalgcc402/objgcc402/bin/gfortran
#make
#ls ./bin
clog2alog clogTOslog2 mpichversion mpireconfig.dat
mpirun_dbg.dbx mpirun_dbg.xxgdb slog2navigator tstmachines
clog2print jumpshot mpicxx mpirun
mpirun_dbg.ddd mpirun.p4shmem slog2print
clog2TOslog2 logconvertor mpiinstall mpirun.args
mpirun_dbg.gdb mpirun.pg slog2updater
clogprint mpicc mpiman mpirun.ch_p4
mpirun_dbg.ladebug mpirun.rand tarch
clog_print mpiCC mpireconfig mpirun.ch_p4.args
mpirun_dbg.totalview slog2filter tdevice
Hi Sean,
the gfortran version doesn't make any difference. The problem is that
mpich configure fails to determine the way gfortran provides command
export F77_GETARGDECL=" "
before running configure.
Hope it helps.
alfredo
Thanks a lot for the help!
It still does not work. Here I paste some log that I think may give some
hints--("cannot run Fortran 77 compiled programs.")

mpich-1.2.7p1>export F77_GETARGDECL=" "
mpich-1.2.7p1>configure -cc=/home/sean/originalgcc402/objgcc402/bin/gcc
-fc=/home/sean/originalgcc402/objgcc402/bin/gfortran >myconfigure.log 2>&1
mpich-1.2.7p1>cat myconfigure.log
.....
checking for an ANSI C-conforming const... no
checking for Fortran 77 compiler default output file name... a.out
checking whether the Fortran 77 compiler works... configure: error:
cannot run Fortran 77 compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
Error configuring the Fortran subsystem!
Turning off Fortran support
....

Also, this is the default config.log

mpich-1.2.7p1>cat config.log

configure:home/mygcc411/bin/gcc -DUSE_SOCKLEN_T -DUSE_U_INT_FOR_XDR
conftest.c -o conftest
configure: failed program was:

#define MPE_USE_EXTENSIONS 1
#define HAS_VOLATILE 1
#define HAVE_MPICH_MPID_H 1
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_gethrtime) || defined (__stub___gethrtime)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error. */
extern char gethrtime(); gethrtime();
#endif
}
conftest.c: In function 'main':
conftest.c:3: warning: incompatible implicit declaration of built-in
function 'exit'
/tmp/ccmx0vqM.o: In function `t':
conftest.c:(.text+0x24): undefined reference to `gethrtime'
collect2: ld returned 1 exit status
configure:home/mygcc411/bin/gcc -DUSE_SOCKLEN_T -DUSE_U_INT_FOR_XDR
conftest.c -o conftest
configure: failed program was:

#define MPE_USE_EXTENSIONS 1
#define HAS_VOLATILE 1
#define HAVE_MPICH_MPID_H 1
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_clock_gettime) || defined (__stub___clock_gettime)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error. */
extern char clock_gettime(); clock_gettime();
#endif
}
conftest.c: In function 'main':
conftest.c:3: warning: incompatible implicit declaration of built-in
function 'exit'
/tmp/cckXQnPY.o: In function `t':
conftest.c:(.text+0x24): undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
configure:home/mygcc411/bin/gcc -DUSE_SOCKLEN_T -DUSE_U_INT_FOR_XDR
conftest.c -o conftest
configure: failed program was:

#define MPE_USE_EXTENSIONS 1
#define HAS_VOLATILE 1
#define HAVE_MPICH_MPID_H 1
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_clock_gettime) || defined (__stub___clock_gettime)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error. */
extern char clock_gettime(); clock_gettime();
#endif
}
conftest.c: In function 'main':
conftest.c:3: warning: incompatible implicit declaration of built-in
function 'exit'
/tmp/ccUjKMl5.o: In function `t':
conftest.c:(.text+0x24): undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
configure:home/mygcc411/bin/gcc -DUSE_SOCKLEN_T -DUSE_U_INT_FOR_XDR
conftest.c -o conftest
configure: failed program was:

#define MPE_USE_EXTENSIONS 1
#define HAS_VOLATILE 1
#define HAVE_MPICH_MPID_H 1
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_clock_getres) || defined (__stub___clock_getres)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error. */
extern char clock_getres(); clock_getres();
#endif
}
conftest.c: In function 'main':
conftest.c:3: warning: incompatible implicit declaration of built-in
function 'exit'
/tmp/cc0tc7vh.o: In function `t':
conftest.c:(.text+0x24): undefined reference to `clock_getres'
collect2: ld returned 1 exit status
configure:home/mygcc411/bin/gcc -DUSE_SOCKLEN_T -DUSE_U_INT_FOR_XDR
conftest.c -o conftest
configure: failed program was:

#define MPE_USE_EXTENSIONS 1
#define HAS_VOLATILE 1
#define HAVE_MPICH_MPID_H 1
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_clock_getres) || defined (__stub___clock_getres)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error. */
extern char clock_getres(); clock_getres();
#endif
}
conftest.c: In function 'main':
conftest.c:3: warning: incompatible implicit declaration of built-in
function 'exit'
/tmp/ccIayqdo.o: In function `t':
conftest.c:(.text+0x24): undefined reference to `clock_getres'
collect2: ld returned 1 exit status
#include "confdefs.h"
#include <stdio.h>
#include <stdarg.h>
int func( int a, ... ){
int b;
va_list ap;
va_start( ap );
b = va_arg(ap, int);
printf( "%d-%d\n", a, b );
va_end(ap);
fflush(stdout);
return 0;
}
int main() { func( 1, 2 ); return 0;}
conftest.c:7:14: error: macro "va_start" requires 2 arguments, but only
1 given
conftest.c: In function 'func':
conftest.c:7: error: 'va_start' undeclared (first use in this function)
conftest.c:7: error: (Each undeclared identifier is reported only once
conftest.c:7: error: for each function it appears in.)
configure:home/mygcc411/bin/gcc -DUSE_SOCKLEN_T -DUSE_U_INT_FOR_XDR
conftest.c -o conftest
configure: failed program was:

#define MPE_USE_EXTENSIONS 1
#define HAS_VOLATILE 1
#define HAVE_MPICH_MPID_H 1
#define HAVE_SIGNAL_H 1
#define HAVE_SIGACTION 1
#define HAVE_PRAGMA_WEAK 1
#define HAVE_WEAK_SYMBOLS 1
#define HAS_XDR 1
#define HAVE_UNAME 1
#define HAVE_NETDB_H 1
#define HAVE_GETHOSTBYNAME 1
#define HAVE_CATOPEN 1
#define HAVE_CATCLOSE 1
#define HAVE_CATGETS 1
#define HAVE_GENCAT 1
#define HAVE_NL_TYPES_H 1
#define STDC_HEADERS 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_UNISTD_H 1
#define HAVE_STDARG_H 1
#define USE_STDARG 1
#define MALLOC_RET_VOID 1
#define HAVE_SYSTEM 1
#define HAVE_NICE 1
#define HAVE_STRDUP 1
#define HAVE_MEMORY_H 1
#define HAVE_SYS_IOCTL_H 1
#include "confdefs.h"

#include <sys/sockio.h>
int main() { exit(0); }
int t() { main(); }
conftest.c:3:24: error: sys/sockio.h: No such file or directory
conftest.c: In function 'main':
conftest.c:4: warning: incompatible implicit declaration of built-in
function 'exit'
home/mygcc411/bin/gcc -DUSE_SOCKLEN_T -DUSE_U_INT_FOR_XDR ... test for
quotes in defn
home/mygcc411/bin/gcc -DUSE_SOCKLEN_T -DUSE_U_INT_FOR_XDR conftest.o -o
conftest foo.a
Alfredo Buttari
2006-06-12 19:59:30 UTC
Permalink
Post by Sean
I am trying to install mpich1.2.7 on my box, and I want to use the
compiler I built from source myself (instead of using the /usr/bin/f77)
So, I configure in this way, but it seems that it failed to build mpif77
mpif90 (any fortran related mpi compiler). Any suggestion?
#configure -cc=/home/sean/originalgcc402/objgcc402/bin/gcc
-fc=/home/sean/originalgcc402/objgcc402/bin/gfortran
-f90=/home/sean/originalgcc402/objgcc402/bin/gfortran
You should use F90, FC and CC environment variables to specify your
compilers instead of the -fc -f90 and -cc configure flags.


alfredo
James
2006-06-14 01:31:56 UTC
Permalink
I was able to compile mpich1.2.7p1 with gcc4.0.3/gfortran with the
following

CC=gcc-4.0.3 -O2 (I don't know how "incorrect" it is to specify the
optimizations like this, but it works:))

CXX=g++-4.0.3 -O2

F90 = gfortran -ff2c (I'm pretty sure you need the -ff2c flag)
FC = g77 (I think this is your problem, my would not work if I used
gfortran for the f77 compiler. So I used the g77 found in gcc 3.x.x.

I also used the following options for config:
--enable-f90 --enable-f77 --enable-sharedlib

Hope this helps

Cheers
Biagio
2006-06-30 14:45:00 UTC
Permalink
Post by James
I was able to compile mpich1.2.7p1 with gcc4.0.3/gfortran with the
following
CC=gcc-4.0.3 -O2 (I don't know how "incorrect" it is to specify the
optimizations like this, but it works:))
CXX=g++-4.0.3 -O2
F90 = gfortran -ff2c (I'm pretty sure you need the -ff2c flag)
FC = g77 (I think this is your problem, my would not work if I used
gfortran for the f77 compiler. So I used the g77 found in gcc 3.x.x.
--enable-f90 --enable-f77 --enable-sharedlib
Hello - I had problems myself building mpich with gfortran, before I
found this nice thread. I want to add my experience, since it still
required some work until I found a working solution. I used the
following environment variables:

FC="gfortran-4.2 -O2 -ff2c -fno-underscoring"
F77_GETARGDECL=" "
CC="gcc-4.2 -O2"
CXX="g++-4.2 -O2"-
F90="gfortran-4.2 -O2 -ff2c -fno-underscoring"

I could compile mpich and run a F90 parallel code (after compiling it
with -ff2c -fno-underscoring).

Hope it helps,
Biagio
y***@gmail.com
2013-08-13 22:38:45 UTC
Permalink
This is very helpful ! For me, I've needed to use -fno-second-underscore (instead of "-fno-underscoring") to match with what my targeted code (MCNP6) is using. With this modification, the mpich compiled would just work to compile MCNP6.

So, the choice of "-fno-underscoring" or "-fno-second-underscore" depends what you use this MPICH1 for.
Loading...