Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Windows CMake build problems ...
From: cjohnson_at_[hidden]
Date: 2010-01-26 06:55:32


Was able to build and run all the c examples from the tutorial at <http://ci-tutor.ncsa.illinois.edu/index.php>

However, none of the extended or simple c++ examples work, they all die with the same link error.

For instance: mpi_gather.cc
______________________________________________

#include <stdio.h>
#include <mpi.h>
#include <math.h>

using namespace MPI;

int main(int argc, char* argv[]) {
  int rank;
  int recvcount,sendcount;
  int reap[8];
  int sow[2];

  Init(argc,argv);
  rank=COMM_WORLD.Get_rank();
  sendcount=2;
  sow[0]=rank; sow[1]=-rank;
  if(rank==1) {
    recvcount=2;
  }
  COMM_WORLD.Gather(sow,sendcount,INT,reap,recvcount,INT,1);
  if(rank==1) {
    printf("P:%d",rank);
    for(int i=0;i<8;++i) {
      printf(" %2d ",reap[i]);
    }
    printf("\n");
  }
  Finalize();
}
______________________________________

Here's the compile output from mpic++:

C:\prog\mon\examples>mpic++ mpi_gather.cc
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

mpi_gather.cc
Microsoft (R) Incremental Linker Version 8.00.50727.762
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:mpi_gather.exe
"/LIBPATH:C:\Program Files\OpenMPI_v1.4-win32\lib"
libmpid.lib
libopen-pald.lib
libopen-rted.lib
libmpi_cxxd.lib
libmpid.lib
libopen-pald.lib
libopen-rted.lib
advapi32.lib
Ws2_32.lib
shlwapi.lib
mpi_gather.obj
mpi_gather.obj : error LNK2019: unresolved external symbol "void __cdecl MPI::InitializeIntercepts(void)" (?InitializeIntercepts@MPI@@YAXXZ)
referenced in function "void __cdecl MPI::Real_init(void)" (?Real_init@MPI@@YAXXZ)mpi_gather.exe : fatal error LNK1120: 1 unresolved externals

Every c++ dies with this link error.

Charlie ...
-------- Original Message --------
Subject: RE: [OMPI users] Windows CMake build problems ...
From: cjohnson@valverdecomputing.com
Date: Tue, January 26, 2010 2:10 am
To: fan@hlrs.de
Cc: "Open MPI Users" <users@open-mpi.org>

Yeah, that was it. Thanks.

Charlie ...
-------- Original Message --------
Subject: Re: [OMPI users] Windows CMake build problems ...
From: Shiqing Fan <fan@hlrs.de>
Date: Tue, January 26, 2010 1:57 am
To: cjohnson@valverdecomputing.com
Cc: Open MPI Users <users@open-mpi.org>


Hi Charlie ,

Did you run the mpicc command in the Visual Studio Command Prompt? Is it
possible for you to call cl.exe from there? Because it sounds like the
VS compiler was not found.


Regards,
Shiqing