[mpich-discuss] Compile error with "undefined reference"

Dave Goodell goodell at mcs.anl.gov
Thu Jun 16 09:08:04 CDT 2011


How are you building your application?  Based on skimming the error messages it looks like you are not using the compiler wrappers ("mpicc" and friends) and are instead attempting to link with the libmpich directly.

If this is the case, that will not work unless you are very careful.  MPICH2 uses several libraries internally and they must all be present and listed on the link line in the correct order.  My recommendation is to use the compiler wrappers.  If you can't or won't do that for some reason, you can try to assemble a working compile line for yourself by using "mpicc -show" to show the compile/link flags that you will need to use.

-Dave

On Jun 16, 2011, at 2:26 AM CDT, tetsuro_kikuchi at jesc.or.jp wrote:

> Hello.
> 
> I'm trying to compile an executable of a program using MPICH2 (version:
> 1.3.2p1). However, it failed with messages "undefined reference to '...'".
> The error part of the compile log ("bldit.cctm_errorlog110616.txt") is
> attached below. Could anyone teach me what is wrong and how to solve this
> problem?
> My system uses Ubuntu Linux (version 11.04 (64-bit)) as OS and Intel
> Fortran Composer XE 2011 for Linux as compiler. I also attach the configure
> log of MPICH2 ("c.txt") and a set of the related C source codes to this
> error ("initthread.c", "param_vals.c", "mpid_vc.c", "init.c" and
> "tcp_init.c") below.
> 
> Tetsuro
> 
> (See attached file: bldit.cctm_errorlog110616.txt)(See attached file:
> c.txt)(See attached file: initthread.c(mpich2-1.3.2p1&src&mpi&init).txt)
> (See attached file: param_vals.c(mpich2-1.3.2p1&src&util&param).txt)(See
> attached file: mpid_vc.c(mpich2-1.3.2p1&src&mpid&ch3&src).txt)(See attached
> file: init.c(mpich2-1.3.2p1&src&mpi&init).txt)(See attached file:
> tcp_init.c(mpich2-1.3.2p1&src&mpid&ch3&channels&nemesis&nemesis&netmod&tcp).txt)
> <bldit.cctm_errorlog110616.txt><c.txt><initthread.c(mpich2-1.3.2p1&src&mpi&init).txt><param_vals.c(mpich2-1.3.2p1&src&util&param).txt><mpid_vc.c(mpich2-1.3.2p1&src&mpid&ch3&src).txt><init.c(mpich2-1.3.2p1&src&mpi&init).txt><tcp_init.c(mpich2-1.3.2p1&src&mpid&ch3&channels&nemesis&nemesis&netmod&tcp	).txt>_______________________________________________
> mpich-discuss mailing list
> mpich-discuss at mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss



More information about the mpich-discuss mailing list