linker - Link Errors when compiling OpenMPI Application on windows -


i keep encountering link error when compiling application:

error lnk2001: unresolved external symbol "public: __cdecl mpi::comm::comm(void)" (??0comm@mpi@@qeaa@xz)    e:\users\ut1jvt\tanoshii\eden\inceptor2\inceptor2\node.obj  inceptor2 

if compile twice in row, changes (probably bec of incremental linking?):

error lnk2019: unresolved external symbol "public: __cdecl mpi::comm::comm(void)" (??0comm@mpi@@qeaa@xz) referenced in function "public: __cdecl mpi::intracomm::intracomm(struct ompi_communicator_t *)" (??0intracomm@mpi@@qeaa@peauompi_communicator_t@@@z)  e:\users\ut1jvt\tanoshii\eden\inceptor2\inceptor2\node.obj  inceptor2 

i have tried in both x64 , 32bit mode matching mpi libraries no avail. have defined: ompi_imports, opal_imports , orte_imports (which fixed of previous link errors) still can't rid of one.

the offending line is:

_rolelocalcomm = &mpi::comm_world.split(_roleid,_nodeid); 

if remove line (all code creates comm groups), error goes away. have built same source in linux (open mpi v1.6.5) , works fine.

here's compile command:

/zi /nologo /w3 /wx- /od /d "_debug" /d "_console" /d "ompi_imports" /d "opal_imports" /d "orte_imports" /d "_unicode" /d "unicode" /gm /ehsc /rtc1 /gs /fp:precise /zc:wchar_t /zc:forscope /fp"x64\debug\testx64.pch" /fa"x64\debug\" /fo"x64\debug\" /fd"x64\debug\vc100.pdb" /gd /errorreport:queue  

update: tried stripping down bare bones , using mpic++ compile still same exact problem. here's command line:

mpic++ entrypoint.cpp -showme cl.exe entrypoint.cpp /d "ompi_imports" /i"c:\program files\openmpi_v1.6.2-x64\include" /tp /ehsc /link /libpath:"c:\program files\openmpi_v1.6.2-x64\lib" libmpi_cxx.lib libmpi.lib libopen-pal.lib libopen-rte.lib advapi32.lib ws2_32.lib shlwapi.lib 

couldn't work @ first (tons of link errors) realized ompi_imports not defined edited %openmpi%/share/openmpi/mpic++-wrapper-data.txt add /d "ompi_imports"

also, might both mentioning getting link failure mpi::datatype::free() seems known issue. made workaround adding following code. imagine won't cause me of problem since datatypes won't cleaned until job completes.

void mpi::datatype::free(void) { } 

i don't know reason problem, think ran unmaintained code:


Comments