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

IDE integration for VS2022 breaks VS2019

gil_moses
Beginner
1,205 Views

I'm trying to set up two environments, VS2019 using Intel oneAPI toolkits 2021.1.1, and VS2022 using 2022.1.0.

Before installing the 2022 oneAPI HPC toolkit, the projects in VS2019 build fine, and the Intel solution variables point to the correct locations of the 2021 tools. 

For example: $(ICLibDir) == "C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1.1\windows\compiler\lib\intel64_win"

And so with the other Intel solution variables.

 

When installing the 2022 oneAPI HPC toolkit, the installer prompts for the desired IDE integration. Here I check only the VS2022 integration, leaving VS2019 unchecked.

 

After installation completes, the VS2019 solution variables for Intel (all of them) wrongfully point to the 2022 installation, e.g.:

$(ICLibDir) == "C:\Program Files (x86)\Intel\oneAPI\compiler\2022.1.0\windows\compiler\lib\intel64_win".

 

Needless to say, the wrong compiler is used for the builds and fails.

 

Please advise, thanks!

Gil.

Labels (1)
0 Kudos
7 Replies
NoorjahanSk_Intel
Moderator
1,175 Views

Hi,

Thanks for reaching out to us.

 

By default, Microsoft Visual Studio will select the latest compiler.

If we want to select the required version of oneAPI we need to change the settings in the Microsoft Visual Studio project under the path

"Project Properties->Configuration Properties->VC++ Directories"

 

Please find the below screenshot to change the path:(we have 2021.4 older version of oneAPI in VS2019)

NoorjahanSk_Intel_2-1660821312493.png

Hope this helps to resolve your issue, if not please provide us with a sample reproducer(steps if any) and compiler being used.

 

Thanks & Regards,

Noorjahan.

 

0 Kudos
gil_moses
Beginner
1,145 Views

 

Hi Noorjahan,

 

Thanks for the suggestion.

 

VSProps.png

 

Unfortunately this can't be a solution for us for several reasons:

  1. Scalability: as far as I could see, the changes for the directories can be done only at the project level.
    The pic above shows the property settings for one project. As you can see, $(ICLibDir) is inherited from a property file that is not under my control (I guess it comes from the Toolset.props under the VS2019 installation directory which, in turn, takes it from the registry). So I didn't find a way to override this in a common property file for all our projects. And, changing the 100 projects one by one isn't an option.
  2. Group usage: placing a hardcoded path may be good for my specific installation of oneAPI, but not for another developer (if she chooses a different installation location).
  3. Usability: once choosing the hardcoded path solution, you can't use the variables in scripts, since they point to the wrong location. Thus all the variables for oneAPI become useless, and you have to use the hardcoded path everywhere.

 

This also raises a question: what is the meaning of the IDE integration during installation, if by selecting to integrate ONLY to VS2022 and NOT to VS2019 – the wrong compiler paths are used eventually?

The correct behavior should be to have $(ICLibDir) and the other vars – point to the correct version of oneAPI, depending on the Visual Studio version used.

 

I'm sorry to say that I can't use the above solution, and I hope you can suggest something else for me to use.

Thanks,

Gil.

 

 

 

0 Kudos
gil_moses
Beginner
1,111 Views

Hi,

I found that the decision which compiler version to use comes from the following Registry key:

 

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Intel\Suites\19.2\Defaults\C++\EM64T

 

... where the SubKey is the GUID of the newly installed compiler. Again, the expectation is that Visual Studio would always use the version it was integrated with.

 

Still waiting for your reply,

Thanks!

Gil.

 

0 Kudos
NoorjahanSk_Intel
Moderator
1,070 Views

Hi,


We are working on your issue. We will get back to you soon.


Thanks & Regards,

Noorjahan.


0 Kudos
cw_intel
Moderator
1,046 Views

Hi,

 

If you install oneAPI 2022.1.0 packages on the machine which has already installed oneAPI 2021.1 packages, the registry key(Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Intel\Suites\19.2\Defaults\C++\EM64T) will be changed to the path of oneAPI 2022.1.0 packages. This is an expected behavior.

As for your scenario, you could select the proper compiler in Tools -> Options page, please see the picture below.  Using this method will take effect for all solutions opened in a newly open VS.

image-2022-08-30-11-30-43-676.png

 

Thanks

0 Kudos
gil_moses
Beginner
1,037 Views

Hi,

 

Well, that worked!

 

Two important things to notice though:

- The correct Target Platform must be selected from the top drop-down menu in this settings page. In my case x64.

- The solution must be reloaded for the changes to take effect.

 

Thanks,

Gil.

0 Kudos
cw_intel
Moderator
1,021 Views

Hi,


Glad to solve your issue. And thank you for letting us know about these two important things. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.



Thanks


0 Kudos
Reply