Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake selects the wrong MSVC compiler #323

Closed
ypoissant opened this issue Mar 27, 2022 · 2 comments
Closed

cmake selects the wrong MSVC compiler #323

ypoissant opened this issue Mar 27, 2022 · 2 comments

Comments

@ypoissant
Copy link

Vc version / revision Operating System Compiler & Version Compiler Flags Assembler & Version CPU
origin/1.4 Windows 10 MSVC 14.31.31103 i7 8700

I followed the instruction for installing Vc. When running "cmake -DCMAKE_INSTALL_PREFIX=/opt/Vc -DBUILD_TESTING=OFF .." in the build folder, the first output I get is "Building for: Visual Studio 16 2019" and a little bit later, I get this: "WARNING! MSVC starting with 19.20 uses a new optimizer that has a bug causing Vc::exp() to return slighly wrong results. ..."

I have two VS versions installed: VS 16 2019 and VS 17 2022. I would like to build for VS 2022 hoping this would fix the "wrong results" issue. I checked that the "path" variable and all related environment variables all point to the VS 2022 toolset folder but somehow, cmake still finds the wrong compiler. How can I explicitly direct cmake to use the proper compiler? Which file do I need to modify and how? Or do I need to uninstall VS 2019?

@bernhardmgruber
Copy link
Collaborator

Hi! The instructions in the README.md are Linux oriented. I updated it to add some hints for Windows as well: #324

In your case, you will need to pass a generator argument to CMake:

cmake -G "Visual Studio 16 2019" -DBUILD_TESTING=OFF ..

Also note, that we have not added VS 2022 to the CI yet, because the compiler crashes compiling the unit tests. You can give it a try though!

@amadio
Copy link
Collaborator

amadio commented May 6, 2022

Closing this, since #324 has been merged already. Thank you @bernhardmgruber!

@amadio amadio closed this as completed May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants