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!
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)
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,
Thanks for the suggestion.
Unfortunately this can't be a solution for us for several reasons:
- 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.
- 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).
- 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.
I found that the decision which compiler version to use comes from the following Registry key:
... 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,
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.
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.
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.