I am trying to write my makefile to build MPI programs, not use mpicc.<div><br><div>The gcc command line and the output error messages are below, can anyone help me? Thanks.</div><div> <br><div>gcc -Wall -O3 -g -I/usr/include/mpich2 -o cpi cpi.c -L/usr/lib -lmpich</div>
<div><div><br></div><div>/usr/lib/libmpich.so: undefined reference to `MPL_trfree'</div><div>/usr/lib/libmpich.so: undefined reference to `MPL_env2str'</div><div>/usr/lib/libmpich.so: undefined reference to `MPL_trlevel'</div>
<div>/usr/lib/libmpich.so: undefined reference to `MPL_trvalid'</div><div>/usr/lib/libmpich.so: undefined reference to `MPL_trmalloc'</div><div>/usr/lib/libmpich.so: undefined reference to `MPL_trspace'</div><div>
/usr/lib/libmpich.so: undefined reference to `MPL_env2range'</div><div>/usr/lib/libmpich.so: undefined reference to `MPL_trcalloc'</div><div>/usr/lib/libmpich.so: undefined reference to `MPL_env2int'</div><div>
/usr/lib/libmpich.so: undefined reference to `MPL_trdump'</div><div>/usr/lib/libmpich.so: undefined reference to `MPL_putenv'</div><div>/usr/lib/libmpich.so: undefined reference to `MPL_env2bool'</div><div>/usr/lib/libmpich.so: undefined reference to `MPL_trstrdup'</div>
<div>/usr/lib/libmpich.so: undefined reference to `MPL_trrealloc'</div><div>/usr/lib/libmpich.so: undefined reference to `MPL_TrSetMaxMem'</div><div>/usr/lib/libmpich.so: undefined reference to `MPL_trinit'</div>
<div>/usr/lib/libmpich.so: undefined reference to `MPL_trDebugLevel'</div><div>/usr/lib/libmpich.so: undefined reference to `MPL_trid'</div><div>collect2: ld returned 1 exit status</div><div>make: *** [mpi] Error 1</div>
</div><div><br></div></div><div>-Clara</div></div>