I have one program which was written in c++, it also uses public software
package including lapack, blas and blitz++. I have compiled the code and run
the program successfully by mpich. The compiling command is as following:
g++ -c gibbsreg.cpp -I/usr/lib/*mpich*/include
mpif77 -lstdc++ gibbsreg.o -lblas -llapack -lg2c -lm
But when I tried to compile this code by using lam/mpi (on another machine,
which has both lam/mpi and mpich installed), it failed.
g++ -c gibbsreg.cpp -I/usr/lib/*lam*/include
mpif77 -lstdc++ gibbsreg.o -lblas -llapack -lg2c -lm
The compling comes with the following error. Anybody has any idea about this
lam/mpi problem? Why it successed with mpich, but failed with lam/mpi? I
guess it is because the mixture using of Fortran and c++ in the code. Many
thanks in advance.
gibbsreg.o(.gnu.linkonce.r._ZTVN3MPI2OpE+0x10): undefined reference to
`MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&),
bool)'
gibbsreg.o(.gnu.linkonce.r._ZTVN3MPI2OpE+0x14): undefined reference to
`MPI::Op::Free()'
gibbsreg.o(.gnu.linkonce.t._ZN4PMPI4Comm4FreeEv+0x29): In function
`PMPI::Comm::Free()':
: undefined reference to `PMPI::Comm::mpi_comm_map'
gibbsreg.o(.gnu.linkonce.t._ZN4PMPI4Comm4FreeEv+0x41): In function
`PMPI::Comm::Free()':
: undefined reference to `PMPI::Comm::mpi_comm_map'
gibbsreg.o(.gnu.linkonce.t._ZN4PMPI4Comm4FreeEv+0x5e): In function
`PMPI::Comm::Free()':
: undefined reference to `PMPI::Comm::mpi_comm_map'
gibbsreg.o(.gnu.linkonce.t._ZN4PMPI4Comm14Set_errhandlerERKNS_10ErrhandlerE+0x1e):
In function `PMPI::Comm::Set_errhandler(PMPI::Errhandler const&)':
: undefined reference to `PMPI::Comm::mpi_err_map'
gibbsreg.o(.gnu.linkonce.t._ZNK4PMPI4Comm8Set_attrEiPKv+0x78): In function
`PMPI::Comm::Set_attr(int, void const*) const':
: undefined reference to `PMPI::Comm::mpi_comm_map'
gibbsreg.o(.gnu.linkonce.t._ZNK4PMPI4Comm8Set_attrEiPKv+0xbc): In function
`PMPI::Comm::Set_attr(int, void const*) const':
: undefined reference to `PMPI::Comm::mpi_comm_map'
gibbsreg.o(.gnu.linkonce.t._ZNK4PMPI9Intracomm6ReduceEPKvPviRKNS_8DatatypeERKNS_2OpEi+0xb):
In function `PMPI::Intracomm::Reduce(void const*, void*, int, P
MPI::Datatype const&, PMPI::Op const&, int) const':
: undefined reference to `PMPI::Intracomm::current_op'
gibbsreg.o(.gnu.linkonce.t._ZNK4PMPI9Intracomm6ReduceEPKvPviRKNS_8DatatypeERKNS_2OpEi+0x5f):
In function `PMPI::Intracomm::Reduce(void const*, void*, int, PMPI::Datatype
const&, PMPI::Op const&, int) const':
: undefined reference to `PMPI::Intracomm::current_op'
gibbsreg.o(.gnu.linkonce.t._ZNK4PMPI9Intracomm9AllreduceEPKvPviRKNS_8DatatypeERKNS_2OpE+0xb):
In function `PMPI::Intracomm::Allreduce(void const*, void*, i nt,
PMPI::Datatype const&, PMPI::Op const&) const':
: undefined reference to `PMPI::Intracomm::current_op'
gibbsreg.o(.gnu.linkonce.t._ZNK4PMPI9Intracomm9AllreduceEPKvPviRKNS_8DatatypeERKNS_2OpE+0x58):
In function `PMPI::Intracomm::Allreduce(void const*, void*, int,
PMPI::Datatype const&, PMPI::Op const&) const':
: undefined reference to `PMPI::Intracomm::current_op'
gibbsreg.o(.gnu.linkonce.t._ZNK4PMPI9Intracomm14Reduce_scatterEPKvPvPiRKNS_8DatatypeERKNS_2OpE+0xb):
In function `PMPI::Intracomm::Reduce_scatter(void cons t*, void*, int*,
PMPI::Datatype const&, PMPI::Op const&) const':
: undefined reference to `PMPI::Intracomm::current_op'
gibbsreg.o(.gnu.linkonce.t._ZNK4PMPI9Intracomm14Reduce_scatterEPKvPvPiRKNS_8DatatypeERKNS_2OpE+0x58):
more undefined references to `PMPI::Intracomm::curren t_op' follow
gibbsreg.o(.gnu.linkonce.t._ZN4PMPI2Op4InitEPFvPKvPviRKNS_8DatatypeEEb+0x21):
In function `PMPI::Op::Init(void (*)(void const*, void*, int, PMPI::Datatype
const&), bool)':
: undefined reference to `op_intercept'
gibbsreg.o(.gnu.linkonce.t._ZN4PMPI9IntracommC1ERKP5_comm+0x1b): In function
`PMPI::Intracomm::Intracomm[in-charge](_comm* const&)':
: undefined reference to `MPI::Is_initialized()'
gibbsreg.o(.gnu.linkonce.t._ZN4PMPI8CartcommC1ERKP5_comm+0x1b): In function
`PMPI::Cartcomm::Cartcomm[in-charge](_comm* const&)':
: undefined reference to `MPI::Is_initialized()'
gibbsreg.o(.gnu.linkonce.t._ZN4PMPI9GraphcommC1ERKP5_comm+0x1b): In function
`PMPI::Graphcomm::Graphcomm[in-charge](_comm* const&)':
: undefined reference to `MPI::Is_initialized()'
collect2: ld returned 1 exit status
mpif77: No such file or directory
|