LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Tim Prince (tprince_at_[hidden])
Date: 2004-10-28 09:04:42


At 06:30 AM 10/28/2004, Jeff Squyres wrote:

>On Oct 28, 2004, at 6:21 AM, Nelson Brito wrote:
>
>>I am trying to compile lam-mpi with intel compilers but i can't build some of
>>the stuff under the tools dir... i compiled with gnu compilers but i need
>>intel
>>because i want to compile amber (a software for molecular dinamics)!!
>>
>>I get lots of errors for some simbols not found!! here is an example:
>>
>>laminfo.o(.text+0x856c): In function `out(std::string const&, std::string
>>const&, std::string const&)':
>>: undefined reference to `std::ostream::operator<<(std::ostream&
>>(*)(std::ostream&))'
>
> From this error message, this looks like it might be a problem with your
> C++ compiler...?
>
>Can you compile/link/run a simple (non-MPI) C++ program that uses
>cout? Perhaps something like:
>
>-----
>#include <iostream>
>using namespace std;
>int main(int argc, char **argv) {
> cout << "Hello, world" << endl;
> return 0;
>}

 From what little is shown here, little but SWAGs can be supplied. It
looks like C++ code has been fed to the C compiler, or the compiler has not
been informed about which C++ support library is wanted. It's possible
that the C++ "hello world" could be fed to the C compiler without
reproducing such a problem. Recall that Intel recently changed to a
scheme more parallel to g++, where icpc is the Intel linux C++ compiler, as
well as the command which specifies C++ libraries to the linker. If you
use bare ld to link, or maybe use Fortran to link, you take on the
responsibility of knowing which libraries to specify.
In a simple case, if C++ code built against gnu libstdc++ is linked into a
Fortran program,
ifort *.o -lstdc++ should be sufficient, provided that a compatible
installation of g++ was visible from the time when ifort was installed. I
would expect g77 or gfortran to work much the same.
If the full context was supplied here, the original questioner is leaving
out a great deal of necessary information; Windows or linux, which compiler
versions, etc, just as it seems the problem is caused by not giving the
linker enough information.

Tim Prince