GithubHelp home page GithubHelp logo

After 0.26, cmake configuration has fail with 'Unable identify compiler architecture for CMAKE_SYSTEM_PROCESSOR' about project_options HOT 16 CLOSED

hihig2001 avatar hihig2001 commented on June 3, 2024
After 0.26, cmake configuration has fail with 'Unable identify compiler architecture for CMAKE_SYSTEM_PROCESSOR'

from project_options.

Comments (16)

aminya avatar aminya commented on June 3, 2024 2

I have reported the issue upstream.

from project_options.

hihig2001 avatar hihig2001 commented on June 3, 2024 1

I found difference in log.
In v0.25.2
-- Using Windows MSVC toolchain
after v0.26.x
-- Using Windows Windows toolchain
maybe it is related issue I don't know. 🤷

from project_options.

Nosenzor avatar Nosenzor commented on June 3, 2024 1

0.32 does not fix this issue, but here is what I discovered after debugging a bit.
I think the issue is in the generator issue, maybe related to CLION.
If I run cmake like this please notice the -G option, then it works fine :
"C:\Program Files\JetBrains\CLion 2023.2\bin\cmake\win\x64\bin\cmake.exe" -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "CodeBlocks - MinGW Makefiles" -S C:\Users\Shadow\CLionProjects\PhotoTools -B C:\Users\Shadow\CLionProjects\PhotoTools\cmake-build-relwithdebinfo-mingw"

While if I run it like this it does not work (the issue, here), note that's how Clion is setting the Generator by default :
"C:\Program Files\JetBrains\CLion 2023.2\bin\cmake\win\x64\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Release -G "CodeBlocks - NMake Makefiles" -S C:\Users\Shadow\CLionProjects\PhotoTools -B C:\Users\Shadow\CLionProjects\PhotoTools\cmake-build-release
Removing the "-G" (ie let's cmake decide what generator to use) like this also lead to the issue :
"C:\Program Files\JetBrains\CLion 2023.2\bin\cmake\win\x64\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Release -S C:\Users\Shadow\CLionProjects\PhotoTools -B C:\Users\Shadow\CLionProjects\PhotoTools\cmake-build-release

And this works too :
"C:\Program Files\JetBrains\CLion 2023.2\bin\cmake\win\x64\bin\cmake.exe" -G "Visual Studio 17 2022" -S C:\Users\Shadow\CLionProjects\PhotoTools -B C:\Users\Shadow\CLionProjects\PhotoTools\cmake-build-debug

So it sounds there's a combination of Generator/platform (windows) that lead to the issue, not sure it is a project_options issue

from project_options.

abeimler avatar abeimler commented on June 3, 2024

I have the same problem with my Windows 10 and visual studio 2022 17.
Tried to move the include(${_project_options_SOURCE_DIR}/Index.cmake) under the project() (so it could find the CMAKE_SYSTEM_PROCESSOR), but got some other error...

My workaround right now is just not using CMakePresets.json.

from project_options.

hihig2001 avatar hihig2001 commented on June 3, 2024

My workaround is using v0.25.2 :)

from project_options.

aminya avatar aminya commented on June 3, 2024

I don't understand the root of the problem. Why is the value of CMAKE_SYSTEM_PROCESSOR not given in the logs? Is it a string?

from project_options.

hihig2001 avatar hihig2001 commented on June 3, 2024

Thanks a lot :D

from project_options.

Nosenzor avatar Nosenzor commented on June 3, 2024

I have the same problem. Should I return to 0.25 in the meanwhile ? BTW : I love project options

from project_options.

Nosenzor avatar Nosenzor commented on June 3, 2024

Also found that using CLION you may have to check that the compiler is pointing to the right version of "cl" (there's two cl installed one for x32 and other one for x64).
like this C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\cl.exe
Setting project_option to v25 and resetting this seems to fix the problem (quite odd)

from project_options.

Nosenzor avatar Nosenzor commented on June 3, 2024

Issue reproduced today with 0.31 on Windows

- Using Windows Windows toolchain
CMake Error at cmake-build-release/_deps/_msvc_toolchain-src/Windows.MSVC.toolchain.cmake:166 (message):
  **Unable identify compiler architecture for CMAKE_SYSTEM_PROCESSOR**
Call Stack (most recent call first):
  cmake-build-release/_deps/_project_options-src/src/VCEnvironment.cmake:65 (include)
  cmake-build-release/_deps/_project_options-src/src/Index.cmake:38 (msvc_toolchain)
  cmake-build-release/_deps/_project_options-src/CMakeLists.txt:3 (include)

while version 0.25.2 correctly set this variable :

-- Running vcpkg install - done
BUILD TYPE : Release USING :MSVC version : 19.36.32537.0
CMAKE_SYSTEM_PROCESSOR = x64
CMAKE_SYSTEM_NAME = Windows
CMAKE_SYSTEM_VERSION = 
CMAKE_SYSTEM = Windows
CMAKE_CXX_COMPILER = C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x64/cl.exe
CMAKE_CXX_COMPILER_VERSION = 19.36.32537.0
CMAKE_CXX_COMPILER_ID = MSVC
CMAKE_CXX_COMPILER_FRONTEND_VARIANT = MSVC
CMAKE_CXX_COMPILER_TARGET = 
CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN = 
CMAKE_CXX_COMPILER_LAUNCHER = 
CMAKE_CXX_COMPILER_WORKS = TRUE

from project_options.

aminya avatar aminya commented on June 3, 2024

Merged #237 which disables the msvc toolchain if CMAKE_TOOL_CHAIN is already specified. I hope it fixes this issue.

from project_options.

aminya avatar aminya commented on June 3, 2024

Now, that I look at this again, I noticed that I didn't use CMAKE_TOOLCHAIN_FILE as the variable to bypass the MSVC toolchain. That might be why it doesn't fix the issue.

Could you try v0.32.1 and see if it fixes the issue?

from project_options.

aminya avatar aminya commented on June 3, 2024

0.32 does not fix this issue, but here is what I discovered after debugging a bit. I think the issue is in the generator issue, maybe related to CLION. If I run cmake like this please notice the -G option, then it works fine.

@Nosenzor Not specifying -G on Windows means Cmake will use the Visual Studio* generator, which I specifically guard against. Maybe CMAKE_GENERATOR is not set yet at that point.

WIN32 AND NOT CMAKE_GENERATOR MATCHES "Visual Studio*"

from project_options.

Nosenzor avatar Nosenzor commented on June 3, 2024

Now, that I look at this again, I noticed that I didn't use CMAKE_TOOLCHAIN_FILE as the variable to bypass the MSVC toolchain. That might be why it doesn't fix the issue.

Could you try v0.32.1 and see if it fixes the issue?

Hey, very happy to help here so tested with 0.32.1 on windows, mac and linux. The good news is no more issue ! Well done !
BTW I suggest you try to automate test (like trying to build your example) using github actions on the three platforms FYI, I'm using project options with Lukka's vcpkg

from project_options.

aminya avatar aminya commented on June 3, 2024

Awesome! Closing this then

from project_options.

aminya avatar aminya commented on June 3, 2024

BTW I suggest you try to automate test (like trying to build your example) using github actions on the three platforms FYI, I'm using project options with Lukka's vcpkg

We already have a very comprehensive CI suite. We use setup-cpp.

https://github.com/aminya/project_options/actions
image
image

from project_options.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.