Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7944 Discussions

Unable to compile by Intel Compiler MFC project in Microsoft Visual Studio 2019

dmitry_k
Novice
4,995 Views
 
 
I am trying to compile my MFC project in Microsoft Visual Studio 2019. Intel Parallel studio 2020 is used (Compiler 19.1). 
I am getting error - unable to obtain mapped memory (see pch_diag.txt) in all configurations(x86/x64/Release/Debug).
Known workaround (compiler key /Qoption,cpp,--pch_control=60000000 ) isn't work.
 
0 Kudos
23 Replies
IntelSupport
Community Manager
4,414 Views

Hi Dmitry,


Thank you for posting in Intel C++ compiler forum. Could you share us with the following details to reproduce the issue from our end.

1. Details about the application 

2. Error log and

3. Steps to reproduce


Regards

Gopika


0 Kudos
dmitry_k
Novice
4,391 Views

Hi Gopika,

Thanks for your attention. The attachment includes  files with compiler's logs and an archived test project. An error appears during building. All  settings are default.

Cordially yours,

Dmitry

0 Kudos
IntelSupport
Community Manager
4,383 Views

Hi Dmitry

 

Thank you for sharing the details. We tried building the MFC_Intel_test.cpp from our end. It built successfully. We were unable to reproduce the issue. After reading the thread :- https://community.intel.com/t5/Intel-C-Compiler/error-unable-to-obtain-mapped-memory-see-pch-diag-txt/td-p/1075920

The error is due to an implementation restriction in the Intel precompiled headers. When the Intel compiler restores precompiled headers (the /Yu option) it needs to obtain a big chunk of memory at a particular address. If that chunk of memory is being used by a different process then you will see that message.

We’ve seen that you already tried a workaround and it didn’t work :

 

(compiler key /Qoption,cpp,--pch_control=60000000 )

 

Please try removing the precompiled headers and try again.

( https://community.intel.com/t5/Intel-C-Compiler/Intel-C-16-0-Error-Unable-to-Obtain-mapped-memory-see-pch-diag/td-p/1118558 )

We’re forwarding this issue to the concerned internal team who can help you out.

Regards

Gopika

 

0 Kudos
Viet_H_Intel
Moderator
4,374 Views

What Visual Studio 2019 version are you using? And what IPSXE2020 Update version?


Can you see how pch.cpp was compiled? then create a preprocess file for us to investigate?


Thanks,



0 Kudos
dmitry_k
Novice
4,341 Views

Microsoft Visual Studio Professional 2019 Version 16.6.5

Intel® C++ Compiler – extension version 19.1.0.16, Package ID: w_comp_lib_2020.2.254

0 Kudos
dmitry_k
Novice
4,338 Views

1>------ Build started: Project: MFC_Intel_test, Configuration: Release x64 ------
1>pch.cpp
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\d3d9types.h(182): error : unable to obtain mapped memory (see pch_diag.txt)
1> D3DLIGHT_SPOT = 2,
1> ^
1>
1>compilation aborted for pch.cpp (code 4)
1>Done building project "MFC_Intel_test.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

0 Kudos
Viet_H_Intel
Moderator
4,334 Views

Can you upgrade the compiler to IPSXE2020 Update 4 to see if it solves your issue? if not, can you give us pch.i file?

Thanks,


0 Kudos
dmitry_k
Novice
4,326 Views

Ok. I'm starting to download trial version of to IPSXE2020 Update 4  rigth now. Please expect results on Monday (may be). 

0 Kudos
dmitry_k
Novice
4,284 Views

Problem still exists.

Intel® C++ Compiler – extension version 19.1.0.16, Package ID: w_comp_lib_2020.4.311.

Zipped ipch file is attachment.

 

0 Kudos
Viet_H_Intel
Moderator
4,301 Views

Or better to download and use the C++ Compiler Classic in https://software.intel.com/content/www/us/en/develop/tools/oneapi/hpc-toolkit.html

Thanks,


0 Kudos
Viet_H_Intel
Moderator
4,276 Views

What is the attached file? is it a preprocess file of pch.cpp? I can't compile the file you attached.

Just to make sure, is this a compiler version you have:

C:\Programs Files (x86)\IntelSWTools> icl

Intel(R) C++ Intel (R) 64 Compiler for applications running on Intel(R), Version 19.1.3.311 Build 20201010_000000


Thanks,



0 Kudos
dmitry_k
Novice
4,265 Views

@Viet_H_Intel wrote:
...if not, can you give us pch.i file?
...
It depends what you mean by "pch.i file". I can't find it in MSVS project structure. 
I had sent *.iphc file.
This is the only one that looks like a "pch.i file" from your request.



0 Kudos
Viet_H_Intel
Moderator
4,256 Views

From your output.txt, you have a compilation aborted for pch.cpp, but we couldn't reproduce it with your zip file.


Can you look into your buildlog to see how pch.cpp was compiled? then replace /C with /E, run it from the command line and send us the output. That is the preprocess file of pch.cpp?


Thanks,


0 Kudos
dmitry_k
Novice
4,242 Views

Ok. Requested files is attached.

0 Kudos
Viet_H_Intel
Moderator
4,233 Views

Normally I should be able to compile from the preprocess file, but I got so many errors with your attached file.

C:\temp>icl test.cpp /C /w

test.cpp(1744): error: expected an expression

    {

    ^

 

test.cpp(1744): error: expected a ">"

    {

    ^

 

test.cpp(2437): error #1292: unknown attribute "no_init_all"

  typedef struct __declspec(align(16)) __declspec(no_init_all) _CONTEXT {

                          ^

....

 

I've attached your Output_with_E_key.txt (after clean up), can you try to see if you can compile from the command line?

What are the compiler options you use?

 

Thanks,

 

0 Kudos
dmitry_k
Novice
4,215 Views

I don't use command line compilation. I'm interested in integration Intel's compiler in my MSVC projects for AI. I had add test.cpp in my project and had compiled only that file.

1>------ Build started: Project: MFC_Intel_test, Configuration: Release x64 ------
1>pch.cpp
1>compilation aborted for pch.cpp (code -1073741571)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Platforms\x64\PlatformToolsets\Intel C++ Compiler 19.1\Toolset.targets(198,5): error MSB6006: "icl.exe" exited with code -1073741571.
1>Done building project "MFC_Intel_test.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Keys for compilation were default:

/Yu"pch.h" /GS /W3 /Gy /Zc:wchar_t /Zi /O2 /Fd"x64\Release\vc142.pdb" /Zc:inline /fp:precise /D "_WINDOWS" /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /D "_AFXDLL" /Qipo /Zc:forScope /Oi /MD /FC /Fa"x64\Release\" /EHsc /nologo /Fo"x64\Release\" /Qprof-dir "x64\Release\" /Fp"x64\Release\MFC_Intel_test.pch"

If you provide to me some scripts for command line compilation, i will run them with my pleasure.

0 Kudos
Viet_H_Intel
Moderator
4,206 Views

From VS:

 

Project->Properties->C/C++->All Options. 

On the right panel, Edit "Additional Options with /E", scroll down and select "Yes /P" for Preprocess to a File. Click Apply and OK

Build->Clean Solution, Build->Compile

You should see a same_source_file_name.i file under project_name/Release folder. 

 

Please provide us that .i file.

 

Thanks,

 

 

0 Kudos
dmitry_k
Novice
4,183 Views

Unfortunately I can't find any *.i files in project structure. May by your mean *.log file? I had attached zipped project after making all yours advises.

0 Kudos
Viet_H_Intel
Moderator
4,177 Views

yes, that test.log is the one I wanted.

However, I couldn't reproduce the error that you saw with VS and command line using your test.cpp (test.log)

icl test.cpp /c /w /GS /Gy /Zc:wchar_t /Zi /O2 /Zc:inline /fp:precise /Qipo /Zc:forScope /Oi /MD /FC

Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.1.3.311 Build 20201010_000000

Copyright (C) 1985-2020 Intel Corporation. All rights reserved.

 

test.cpp

dir test.*

 Volume in drive C is IntelBuild

 Volume Serial Number is 3604-F065

 

11/23/2020 04:25 AM     8,912,411 test.cpp

11/23/2020 04:58 AM    14,261,215 test.obj

 

Can you: Start->Intel Parallel Studio XE 2020 -> Compiler 19.1 for Intel64 to open a command Window and run:

>icl test.cpp /c /w /GS /Gy /Zc:wchar_t /Zi /O2 /Zc:inline /fp:precise /Qipo /Zc:forScope /Oi /MD /FC

 

test.cpp is attached.

 

Thanks,

 

 

0 Kudos
dmitry_k
Novice
3,756 Views

Compiler's output was:

E:\Dima\_Progs\_Test\MFC_Intel_test>icl test.cpp /c /w /GS /Gy /Zc:wchar_t /Zi /
O2 /Zc:inline /fp:precise /Qipo /Zc:forScope /Oi /MD /FC
Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.1.3.311 Build 20201010_000000
Copyright (C) 1985-2020 Intel Corporation. All rights reserved.

test.cpp

E:\Dima\_Progs\_Test\MFC_Intel_test>

May be *.obj file will be interested. I had attached it.

 

0 Kudos
Reply