#This compiled and runs a C example just fine mpif77 -Wall t1.c -o ex1 /usr/lib64/openmpi/lib/libscalapack.a /usr/lib64/openmpi/lib/libmpiblacs.a /usr/lib64/openmpi/lib/libmpiblacsCinit.a /usr/lib64/openmpi/lib/libmpiblacsF77init.a #with C++ , note this is a C++ example from the web and it is not using the depreciated MPI C++ syntax rather the standard C syntax mpif77 -Wall ex3.cpp -o ex3 /usr/lib64/openmpi/lib/libscalapack.a /usr/lib64/openmpi/lib/libmpiblacs.a /usr/lib64/openmpi/lib/libmpiblacsCinit.a /usr/lib64/openmpi/lib/libmpiblacsF77init.a -llapack -lblas -lm -lgfortran /usr/lib64/openmpi/lib/libmpiblacs.a -lstdc++ /tmp/ccHwpoGA.o: In function `MPI::Intracomm::Intracomm()': ex3.cpp:(.text._ZN3MPI9IntracommC2Ev[_ZN3MPI9IntracommC5Ev]+0x14): undefined reference to `MPI::Comm::Comm()' /tmp/ccHwpoGA.o: In function `MPI::Intracomm::Intracomm(ompi_communicator_t*)': ex3.cpp:(.text._ZN3MPI9IntracommC2EP19ompi_communicator_t[_ZN3MPI9IntracommC5EP19ompi_communicator_t]+0x19): undefined reference to `MPI::Comm::Comm()' /tmp/ccHwpoGA.o: In function `MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&), bool)': ex3.cpp:(.text._ZN3MPI2Op4InitEPFvPKvPviRKNS_8DatatypeEEb[_ZN3MPI2Op4InitEPFvPKvPviRKNS_8DatatypeEEb]+0x24): undefined reference to `ompi_mpi_cxx_op_intercept' /tmp/ccHwpoGA.o:(.rodata._ZTVN3MPI3WinE[_ZTVN3MPI3WinE]+0x48): undefined reference to `MPI::Win::Free()' /tmp/ccHwpoGA.o:(.rodata._ZTVN3MPI8DatatypeE[_ZTVN3MPI8DatatypeE]+0x78): undefined reference to `MPI::Datatype::Free()' collect2: error: ld returned 1 exit status #with Mpic++ mpic++ -Wall ex3.cpp -o ex3 /usr/lib64/openmpi/lib/libscalapack.a /usr/lib64/openmpi/lib/libmpiblacs.a /usr/lib64/openmpi/lib/libmpiblacsCinit.a /usr/lib64/openmpi/lib/libmpiblacsF77init.a -llapack -lblas -lm -lgfortran /usr/lib64/openmpi/lib/libmpiblacs.a -lstdc++ /usr/lib64/openmpi/lib/libmpiblacs.a(dgesd2d_.oo): In function `Cdgesd2d': (.text+0x8e): undefined reference to `mpi_type_free_' /usr/lib64/openmpi/lib/libmpiblacs.a(dgerv2d_.oo): In function `Cdgerv2d': (.text+0x93): undefined reference to `mpi_type_free_' /usr/lib64/openmpi/lib/libmpiblacs.a(dgebs2d_.oo): In function `Cdgebs2d': (.text+0x133): undefined reference to `mpi_type_free_' /usr/lib64/openmpi/lib/libmpiblacs.a(dgebs2d_.oo): In function `Cdgebs2d': (.text+0x2ea): undefined reference to `mpi_bcast_' /usr/lib64/openmpi/lib/libmpiblacs.a(dgebr2d_.oo): In function `Cdgebr2d': (.text+0x13b): undefined reference to `mpi_type_free_' /usr/lib64/openmpi/lib/libmpiblacs.a(dgebr2d_.oo): In function `Cdgebr2d': (.text+0x2fb): undefined reference to `mpi_bcast_' /usr/lib64/openmpi/lib/libmpiblacs.a(dgsum2d_.oo): In function `Cdgsum2d': (.text+0x45a): undefined reference to `mpi_reduce_' /usr/lib64/openmpi/lib/libmpiblacs.a(dgsum2d_.oo): In function `Cdgsum2d': (.text+0x4e5): undefined reference to `mpi_allreduce_' /usr/lib64/openmpi/lib/libmpiblacs.a(Cblacs_gridmap_.oo): In function `Cblacs_gridmap': (.text+0x2dc): undefined reference to `mpi_comm_dup_' /usr/lib64/openmpi/lib/libmpiblacs.a(Cblacs_gridmap_.oo): In function `Cblacs_gridmap': (.text+0x2f0): undefined reference to `mpi_comm_rank_' /usr/lib64/openmpi/lib/libmpiblacs.a(Cblacs_gridmap_.oo): In function `Cblacs_gridmap': (.text+0x31f): undefined reference to `mpi_comm_split_' /usr/lib64/openmpi/lib/libmpiblacs.a(Cblacs_gridmap_.oo): In function `Cblacs_gridmap': (.text+0x33c): undefined reference to `mpi_comm_split_' /usr/lib64/openmpi/lib/libmpiblacs.a(Cblacs_gridexit_.oo): In function `Cblacs_gridexit': (.text+0x56): undefined reference to `mpi_comm_free_' /usr/lib64/openmpi/lib/libmpiblacs.a(Cblacs_gridexit_.oo): In function `Cblacs_gridexit': (.text+0x64): undefined reference to `mpi_comm_free_' /usr/lib64/openmpi/lib/libmpiblacs.a(Cblacs_gridexit_.oo): In function `Cblacs_gridexit': (.text+0x71): undefined reference to `mpi_comm_free_' /usr/lib64/openmpi/lib/libmpiblacs.a(Cblacs_gridexit_.oo): In function `Cblacs_gridexit': (.text+0x7f): undefined reference to `mpi_comm_free_' /usr/lib64/openmpi/lib/libmpiblacs.a(Cblacs_barrier_.oo): In function `Cblacs_barrier': (.text+0x4a): undefined reference to `mpi_barrier_' /usr/lib64/openmpi/lib/libmpiblacs.a(Cblacs_barrier_.oo): In function `Cblacs_barrier': (.text+0x62): undefined reference to `mpi_barrier_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_Ssend.o): In function `BI_Ssend': (.text+0x32): undefined reference to `mpi_send_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_Srecv.o): In function `BI_Srecv': (.text+0x41): undefined reference to `mpi_recv_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_Asend.o): In function `BI_Asend': (.text+0x56): undefined reference to `mpi_isend_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_Asend.o): In function `BI_Asend': (.text+0x86): undefined reference to `mpi_error_class_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_Asend.o): In function `BI_Asend': (.text+0x101): undefined reference to `mpi_isend_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_Arecv.o): In function `BI_Arecv': (.text+0x56): undefined reference to `mpi_irecv_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_Arecv.o): In function `BI_Arecv': (.text+0x86): undefined reference to `mpi_error_class_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_Arecv.o): In function `BI_Arecv': (.text+0x101): undefined reference to `mpi_irecv_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_BeComb.o): In function `BI_BeComb': (.text+0x17e): undefined reference to `mpi_sendrecv_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_BlacsAbort.o): In function `BI_BlacsAbort': (.text+0x3f): undefined reference to `mpi_abort_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_BuffIsFree.o): In function `BI_BuffIsFree': (.text+0x60): undefined reference to `mpi_waitall_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_Pack.o): In function `BI_Pack': (.text+0x76): undefined reference to `mpi_pack_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_Pack.o): In function `BI_Pack': (.text+0xe0): undefined reference to `mpi_pack_size_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_GetMpiGeType.o): In function `BI_GetMpiGeType': (.text+0x38): undefined reference to `mpi_type_vector_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_GetMpiGeType.o): In function `BI_GetMpiGeType': (.text+0x47): undefined reference to `mpi_type_commit_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_MPI_F77_to_c_trans_comm.o): In function `BI_MPI_F77_to_c_trans_comm': (.text+0x27): undefined reference to `mpi_comm_size_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_MPI_F77_to_c_trans_comm.o): In function `BI_MPI_F77_to_c_trans_comm': (.text+0x4c): undefined reference to `mpi_comm_group_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_MPI_F77_to_c_trans_comm.o): In function `BI_MPI_F77_to_c_trans_comm': (.text+0x65): undefined reference to `mpi_comm_group_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_MPI_F77_to_c_trans_comm.o): In function `BI_MPI_F77_to_c_trans_comm': (.text+0xa3): undefined reference to `mpi_group_translate_ranks_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_MPI_F77_to_c_trans_comm.o): In function `BI_MPI_F77_to_c_trans_comm': (.text+0xc3): undefined reference to `mpi_group_free_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_MPI_F77_to_c_trans_comm.o): In function `BI_MPI_F77_to_c_trans_comm': (.text+0xd2): undefined reference to `mpi_group_free_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_TransUserComm.o): In function `BI_TransUserComm': (.text+0xab): undefined reference to `mpi_comm_group_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_TransUserComm.o): In function `BI_TransUserComm': (.text+0xc7): undefined reference to `mpi_group_incl_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_TransUserComm.o): In function `BI_TransUserComm': (.text+0xe0): undefined reference to `mpi_comm_create_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_TransUserComm.o): In function `BI_TransUserComm': (.text+0xef): undefined reference to `mpi_group_free_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_TransUserComm.o): In function `BI_TransUserComm': (.text+0xfe): undefined reference to `mpi_group_free_' /usr/lib64/openmpi/lib/libmpiblacs.a(bi_f77_mpi_attr_get.o): In function `bi_f77_mpi_attr_get_': (.text+0x13): undefined reference to `mpi_attr_get_' /usr/lib64/openmpi/lib/libmpiblacs.a(bi_f77_mpi_testall.o): In function `bi_f77_mpi_testall_': (.text+0x13): undefined reference to `mpi_testall_' /usr/lib64/openmpi/lib/libmpiblacs.a(dwalltime00_.o): In function `dwalltime00_': (.text+0x7): undefined reference to `mpi_wtime_' /usr/lib64/openmpi/lib/libmpiblacs.a(BI_Rsend.o): In function `BI_Rsend': (.text+0x32): undefined reference to `mpi_rsend_' /usr/lib64/openmpi/lib/libmpiblacsCinit.a(Cblacs_pinfo.o): In function `Cblacs_pinfo': (.text+0xda): undefined reference to `mpi_comm_size_' /usr/lib64/openmpi/lib/libmpiblacsCinit.a(Cblacs_pinfo.o): In function `Cblacs_pinfo': (.text+0xf6): undefined reference to `mpi_comm_rank_' collect2: error: ld returned 1 exit status