Hi,
I have a MPICH2 library compiled using GNU compiler. I could use g++ to successfully compile a user MPI program:
[lgl@pexserv02 src]$ g++ hello.cpp -m64 -D__64BIT__ -Wl,–allow-shlib-undefined -Wl,–enable-new-dtags -Wl,-rpath,/opt/ibmhpc/pe1200/mpich2/gnu/lib64 -Wl,-rpath,/opt/ibmhpc/pe1200/pempi/gnu/lib64 -Wl,-rpath,/usr/lib64 -I/opt/ibmhpc/pe1200/mpich2/gnu/include64 -I/opt/ibmhpc/pe1200/ppe.pami/include64 -L/opt/ibmhpc/pe1200/mpich2/gnu/lib64 -lcxxmpich -lmpich -lopa -lmpl -ldl -L/opt/ibmhpc/pe1200/pempi/gnu/lib64 -lpoe -L/usr/lib64 -lpami -lpthread -lrt
But when I tried to use pgc++ instead of g++, I got some errors:
[lgl@pexserv02 src]$ pgc++ hello.cpp -m64 -D__64BIT__ -Wl,–allow-shlib-undefined -Wl,–enable-new-dtags -Wl,-rpath,/opt/ibmhpc/pe1200/mpich2/gnu/lib64 -Wl,-rpath,/opt/ibmhpc/pe1200/pempi/gnu/lib64 -Wl,-rpath,/usr/lib64 -I/opt/ibmhpc/pe1200/mpich2/gnu/include64 -I/opt/ibmhpc/pe1200/ppe.pami/include64 -L/opt/ibmhpc/pe1200/mpich2/gnu/lib64 -lcxxmpich -lmpich -lopa -lmpl -ldl -L/opt/ibmhpc/pe1200/pempi/gnu/lib64 -lpoe -L/usr/lib64 -lpami -lpthread -lrt
NOTE: your trial license will expire in 12 days, 2.97 hours.
/tmp/pgc++YgJgwgS3FrFo.o: In function main': /home/lgl/src/./lgl_mpi.cpp:6: undefined reference to
MPI::Init(int &, char **&)’
/home/lgl/src/./lgl_mpi.cpp:6: undefined reference to MPI::COMM_WORLD(void)' /home/lgl/src/./lgl_mpi.cpp:6: undefined reference to
MPI::COMM_WORLD(void)’
/home/lgl/src/./lgl_mpi.cpp:6: undefined reference to MPI::Finalize(void)' /tmp/pgc++YgJgwgS3FrFo.o: In function
MPI::Status::Is_cancelled( const(void))’:
/opt/ibmhpc/pe1200/mpich2/gnu/include64/mpicxx.h:536: undefined reference to MPI::MPIR_Call_world_errhand(int)' /tmp/pgc++YgJgwgS3FrFo.o: In function
MPI::Status::Get_elements( const(MPI::Datatype const &))’:
/opt/ibmhpc/pe1200/mpich2/gnu/include64/mpicxx.h:542: undefined reference to MPI::MPIR_Call_world_errhand(int)' /tmp/pgc++YgJgwgS3FrFo.o: In function
MPI::Status::Get_count( const(MPI::Datatype const &))’:
/opt/ibmhpc/pe1200/mpich2/gnu/include64/mpicxx.h:548: undefined reference to MPI::MPIR_Call_world_errhand(int)' /tmp/pgc++YgJgwgS3FrFo.o: In function
MPI::Status::Set_cancelled( (bool))’:
/opt/ibmhpc/pe1200/mpich2/gnu/include64/mpicxx.h:555: undefined reference to MPI::MPIR_Call_world_errhand(int)' /tmp/pgc++YgJgwgS3FrFo.o: In function
MPI::Status::Set_elements( (MPI::Datatype const &, int))’:
/opt/ibmhpc/pe1200/mpich2/gnu/include64/mpicxx.h:559: undefined reference to `MPI::MPIR_Call_world_errhand(int)’
[lgl@pexserv02 src]$
Is there a way to make pgc++ to link with the GNU library? I searched the man page and tried to use “–gcc” option:
–gcc Generate GNU-compatible C++ code and link with the GNU libraries.
But I got an error of:
pgc+±Error-Unknown switch: --gcc
Thanks in advance for your help