[mpich-discuss] Compile error with "undefined reference"
Anthony Chan
chan at mcs.anl.gov
Fri Jun 17 10:27:07 CDT 2011
Since we don't have your source code, so looking your build scripts isn't
easy for us to spot the errors. Given you are still getting unresolved reference
of MPICH2's internal symbols, my guess is that your linking is still wrong.
Could you send us the output of your Makefiles (as seen on your terminal) which
could be easier for us to spot the errors.
A.Chan
----- Original Message -----
> Thank you very much for your advice, Mr. Dave Goodell.
>
> I have tried again to build my program. I used the latest version of
> MPICH2
> (mpich2-1.4) this time. I have configured it as follows to let the
> compiler
> flags being included in the wrappers (the configure log
> ("c_mpich2-1.4.txt") is attached below):
>
> ./configure --disable-fast CFLAGS=-O2 FFLAGS=-O2 CXXFLAGS=-O2
> FCFLAGS=-O2
>
> My program, called "CCTM", uses two kinds of library for parallel
> processing (named "STENEX" and "PARIO"). These libraries are compiled
> using
> the wrapper of MPICH (mpif90). (Please refer to the part "#> Set full
> path
> of Fortran 90 compiler" in "User Input Section" of the attached
> compile
> scripts for these libraries ("bldit.se_script.txt" and
> "bldit.pario_script.txt").)
> I run the build script of CCTM after recompiling the two
> above-mentioned
> libraries using the new MPICH wrapper. However, it failed again with
> messages "undefined reference to '...'". The C source codes for which
> "undefined reference" errors were annouced were a little bit different
> from
> the previous ones. The error part of the build log
> ("bldit.cctm_errorlog110617.txt") is attached below.
> Then, I assembled the working compile line of the build script by
> using
> "mpif90 -show". (Please refer to "mpif90 -show.txt" attached below.)
> The
> modified build script ("bldit.cctm_script_modified110617.txt") is also
> attached below. The modifications in the build script I made were as
> follows (all in "User Input Section"):
>
> 1. "-lopa -lmpl -lrt" was added to "LINK_FLAGS".
> 2. "-O2" was added to "C_FLAGS".
> 3. The line "set FC_FLAGS = "-O2"" was added.
>
> This build script could not also build the executable of CCTM with the
> same
> error messages as the first trial this time.
>
> Could you provide the suggestion for solving this problem?
>
> Kind regards,
>
> Tetsuro
>
> (See attached file: c_mpich2-1.4.txt) (See attached file:
> bldit.se_script.txt)(See attached file: bldit.pario_script.txt)(See
> attached file: bldit.cctm_errorlog110617.txt)(See attached file:
> mpif90
> -show.txt)(See attached file: bldit.cctm_script_modified110617.txt)
>
>
>
>
>
>
> 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¶m).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¶m).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
>
> _______________________________________________
> mpich-discuss mailing list
> mpich-discuss at mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
>
>
>
>
> _______________________________________________
> 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