CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

error C3861: 'MPI_Iallreduce': identifier not found

Open Chunde opened this issue 10 years ago • 10 comments

Hi. I am trying to compile the CNTK on Windows 10, VS2013, and I got this message

\git\cntk\source\sgdlib\SimpleDistGradAggregator.h(283): error C3861: 'MPI_Iallreduce': identifier not found

MSDN says I should include mpi.h and mpif.h(https://msdn.microsoft.com/en-us/library/vs/alm/mt629167(v=vs.85).aspx?f=255&mspperror=-2147217396)

But mpif.h seems wrong for C++ as it is not in C++/C.

Chunde avatar May 18 '16 08:05 Chunde

Hi @xmuhcd, can you check whether you've MS-MPI v7 installed, cf. here https://github.com/Microsoft/CNTK/wiki/Setup-CNTK-on-Windows#ms-mpi ?

mahilleb-msft avatar May 18 '16 19:05 mahilleb-msft

Hi @mahilleb-msft many thanks for your reply. Yes, I did have MS-MPI installed. What I have on my windows 10 is : Microsoft MPI(7.0.12437.6) and MPI SDK(5.0.12435.6), I am not sure if I need to configure the system variable for that.

Chunde avatar May 19 '16 03:05 Chunde

Normally the installer should configure environment variable like these: Name Value


MSMPI_LIB32 C:\Program Files (x86)\Microsoft SDKs\MPI\Lib\x86
MSMPI_LIB64 C:\Program Files (x86)\Microsoft SDKs\MPI\Lib\x64
MSMPI_BIN C:\Program Files\Microsoft MPI\Bin
MSMPI_INC C:\Program Files (x86)\Microsoft SDKs\MPI\Include\

Can you check these are there and close / re-open VS [or even log-out / log-in] to make sure that they are visible in VisualStudio as well?

Thanks, Mark

mahilleb-msft avatar May 19 '16 06:05 mahilleb-msft

Oh sorry, on second look it seems your MPI SDK is too old. It should match your MPI version number (7.0.12437.6). Make sure to install both packages available from the MPI install link.

Thanks, Mark

mahilleb-msft avatar May 19 '16 06:05 mahilleb-msft

Hello @mahilleb-msft Thanks a lot. Yes, I might at some point installed an old MPI SDK, now I uninstalled it and installed the new one, things works well now.

By the way, I got couples of error messages such as: `C:\Program Files (x86)\Microsoft SDKs\MPI\Include\mpi.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss

C:\Program Files (x86)\Microsoft SDKs\MPI\Include\mpi.h : error C2220: warning treated as error - no 'object' file generated`

I have to run the VS 2013 as administrator in order to save those files as Unicode, or it can never get through.

Chunde avatar May 19 '16 06:05 Chunde

@xmuhcd thanks for noticing. I'll check what might be the best way to work around this. (mpi.h has a couple of special space characters [0xa0] in it).

mahilleb-msft avatar May 19 '16 07:05 mahilleb-msft

@xmuhcd do you get the warnings only for MPI-related files, or also other headers? Are you doing a GPU or CPU-only build? [In addition to the fix above, we may need to suppress these warnings at other places for headers that have the same problem]

mahilleb-msft avatar May 19 '16 09:05 mahilleb-msft

@mahilleb-msft I remember I got some more from CUDA: such as device_functions_decls.h, device_double_functions.h device_functions.h and math_funtions.h. and may be the file at "..\CNTK\Source\Common\Include\Config.h"

Chunde avatar May 19 '16 16:05 Chunde

Thanks for taking a look, I'll investigate...

mahilleb-msft avatar May 20 '16 07:05 mahilleb-msft

This is more pervasive than expected (MPI, CUDA, Boost, OpenCV headers all have this). On Branch mahilleb/MpiEncodingFix I have these fixes but I can't yet well validate them.

mahilleb-msft avatar Jun 07 '16 12:06 mahilleb-msft