Trace analyzer MPI library test example link error

Trace analyzer MPI library test example link error

Hello,

when copying the manual example of the trace analyzer and collector

in test directory (containing test.c, test.cpp etc) I did the following:

set VT_LOGFILE_PREFIX=test_inst

mkdir %VT_LOGFILE_PREFIX%

both

C:Program Files (x86)IntelICTCE3.1mpi3.1 est>icl /Fetestc /I"%I_MPI_ROOT%
"em64tinclude test.c /link /LIBPATH:"%VT_LIB_DIR%" VT.lib Ws2_32.lib /LIBPATH:
"%I_MPI_ROOT%em64tlib impi.lib /NODEFAULTLIB:LIBCMTD.lib

and

C:Program Files (x86)IntelICTCE3.1mpi3.1 est>icl /Fetestcpp /I"%I_MPI_ROOT%"em64tinclude test.cpp /link /LIBPATH:"%VT_LIB_DIR%" VT.lib Ws2_32.lib /LIBPATH:
"%I_MPI_ROOT%em64tlib impi.lib impicxx.lib /NODEFAULTLIB:LIBCMTD.lib

yield link error about unresolved external symbol "class MPI::something..."

Build 20070913 Package ID: w_cc_p_10.1.011
Copyright (C) 1985-2007 Intel Corporation. All rights reserved.
test.cpp
Microsoft Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.

-out:testcpp.exe
"/LIBPATH:c:Program Files (x86)IntelICTCE3.1itac7.1in..libimpi64"
Ws2_32.lib
VT.lib
"/LIBPATH:C:Program Files (x86)IntelICTCE3.1mpi3.1em64tlib impi.lib impi
cxx.lib /NODEFAULTLIB:LIBCMTD.lib"
test.obj
Creating library testcpp.lib and object testcpp.exp
test.obj : error LNK2019: unresolved external symbol "class MPI::Intracomm MPI::
COMM_WORLD" (?COMM_WORLD@MPI@@3VIntracomm@1@A) referenced in function main
test.obj : error LNK2019: unresolved external symbol "void __cdecl MPI::Init(int
&,char * * &)" (?Init@MPI@@YAXAEAHAEAPEAPEAD@Z) referenced in function main
test.obj : error LNK2019: unresolved external symbol "void __cdecl MPI::Get_proc
essor_name(char *,int &)" (?Get_processor_name@MPI@@YAXPEADAEAH@Z) referenced in
function main[ to be continued... ]

Any hint why, please?

Best regards

Martin

ps: Why the linker is not from Intel but from Microsoft?

7 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

Moreover,

in FAQ's to Intel Trace Analyzer for Windows I've just found the following issue:

Do the Intel Trace Analyzer and Collector run on Microsoft* Windows* operating environment?

The tracing part of the tool (Intel Trace Collector) does not run on Windows. It consists of Linux* libraries that are linked to applications that you want to trace. The analysis part of the tool (Intel Trace Analyzer) is implemented as a GUI that exists both for Windows XP and for Linux*.

What does it mean? Why is there then a Windows tracing example in the user-guide?

Best regards

Martin

Hi Martin,

> "/LIBPATH:C:Program Files (x86)IntelICTCE3.1mpi3.1em64tlib impi.lib impicxx.lib /NODEFAULTLIB:LIBCMTD.lib"

Please check your command line. It seems that you messed up quotas when specifying /LIBPATH - library names became a part of the path name.

Also please notice compiler wrapper scripts provided with Intel MPI 3.1 for Windows, named mpiicc, mpiicpc and mpiifort. Drivers will automatically provide you with proper linker command as well.

Simply call "mpiicc -trace foo.c" go get same result.

> Why the linker is not from Intel but from Microsoft?

Intel does not provide binary tools like linker of dumpbin.

- Grigory

> (Intel Trace Collector) does not run on Windows

ITC does run on Windows. FAQ would be updated properly in a while.

- Grigory

More accurate: Intel Trace Collector 7.1 does run on Windows.

Thanks a lot. Cmd line, correct VT_ libs set. Solved! It works pretty well.

Btw, what's inside LIBCMTD.lib that it is ignored by /NODEFAULTLIB?

LIBCMTD.lib is one of Microsoft C language runtime support library, debug version. This option should not affect target applications.

Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!