[mpich2-dev] I would like to ask a question about the mpibzip2

Anthony Chan chan at mcs.anl.gov
Fri Apr 3 02:10:01 CDT 2009


----- "陈炜钊" <chenweizhaoup at 139.com> wrote:

> [nisuser1 at master mpibzip2-0.6]$ mpicc -c -O2 -o mpibzip2 mpibzip2.cpp
> -lbz2 -lmpi -lpthread
> gcc: -lbz2: linker input file unused because linking not done
> gcc: -lmpi: linker input file unused because linking not done
> gcc: -lpthread: linker input file unused because linking not done

you don't use -c and -o at the same time.

mpicc is wrapper that links with mpi library, so no -lmpi is needed.
I assume mpibzip2.cpp is a C++ code, so use mpicxx instead of mpicc.
Try "mpicxx -O2 -o mpibzip2 mpibzip2.cpp -lbz2" instead.

A.Chan


More information about the mpich2-dev mailing list