[mpich-discuss] issues when writing a simple makefile to build MPI programs

Pavan Balaji balaji at mcs.anl.gov
Thu Jun 23 21:33:59 CDT 2011


Please see "mpicc -show" for the list of libraries you need to link with.

  -- Pavan

On 06/23/2011 09:26 PM, clara wrote:
> I am trying to write my makefile to build MPI programs, not use mpicc.
>
> The gcc command line and the output error messages are below, can anyone
> help me? Thanks.
>
> gcc -Wall -O3 -g -I/usr/include/mpich2  -o cpi cpi.c  -L/usr/lib -lmpich
>
> /usr/lib/libmpich.so: undefined reference to `MPL_trfree'
> /usr/lib/libmpich.so: undefined reference to `MPL_env2str'
> /usr/lib/libmpich.so: undefined reference to `MPL_trlevel'
> /usr/lib/libmpich.so: undefined reference to `MPL_trvalid'
> /usr/lib/libmpich.so: undefined reference to `MPL_trmalloc'
> /usr/lib/libmpich.so: undefined reference to `MPL_trspace'
> /usr/lib/libmpich.so: undefined reference to `MPL_env2range'
> /usr/lib/libmpich.so: undefined reference to `MPL_trcalloc'
> /usr/lib/libmpich.so: undefined reference to `MPL_env2int'
> /usr/lib/libmpich.so: undefined reference to `MPL_trdump'
> /usr/lib/libmpich.so: undefined reference to `MPL_putenv'
> /usr/lib/libmpich.so: undefined reference to `MPL_env2bool'
> /usr/lib/libmpich.so: undefined reference to `MPL_trstrdup'
> /usr/lib/libmpich.so: undefined reference to `MPL_trrealloc'
> /usr/lib/libmpich.so: undefined reference to `MPL_TrSetMaxMem'
> /usr/lib/libmpich.so: undefined reference to `MPL_trinit'
> /usr/lib/libmpich.so: undefined reference to `MPL_trDebugLevel'
> /usr/lib/libmpich.so: undefined reference to `MPL_trid'
> collect2: ld returned 1 exit status
> make: *** [mpi] Error 1
>
> -Clara
>
>
>
> _______________________________________________
> mpich-discuss mailing list
> mpich-discuss at mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss

-- 
Pavan Balaji
http://www.mcs.anl.gov/~balaji


More information about the mpich-discuss mailing list