Skip to content

vulkan: set cmake minimum and project name in vulkan-shaders #12744

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

Merged
merged 1 commit into from
Apr 4, 2025

Conversation

jeffbolznv
Copy link
Collaborator

I forced the CMAKE_CROSSCOMPILING path in ggml-vulkan/CMakeLists.txt and was able to build it with these minor changes. Without them, the errors were:

3>CMake Warning (dev) in CMakeLists.txt:
3>  No project() command is present.  The top-level CMakeLists.txt file must
3>  contain a literal, direct call to the project() command.  Add a line of
3>  code such as
3>
3>    project(ProjectName)
3>
3>  near the top of the file, but after cmake_minimum_required().
3>
3>  CMake is pretending there is a "project(Project)" command on the first
3>  line.
3>This warning is for project developers.  Use -Wno-dev to suppress it.
3>
3>CMake Warning (dev) in CMakeLists.txt:
3>  cmake_minimum_required() should be called prior to this top-level project()
3>  call.  Please see the cmake-commands(7) manual for usage documentation of
3>  both commands.
3>This warning is for project developers.  Use -Wno-dev to suppress it.
3>
3>-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
3>CMake Error in CMakeLists.txt:
3>  No cmake_minimum_required command is present.  A line of code such as
3>
3>    cmake_minimum_required(VERSION 4.0)
3>
3>  should be added at the top of the file.  The version specified may be lower
3>  if you wish to support older CMake versions for this project.  For more
3>  information run "cmake --help-policy CMP0000".
3>
3>
3>-- Configuring incomplete, errors occurred!

I did this experiment with cmake 4.0.0. I didn't get these warnings/errors with the normal build, but I guess they're required when vulkan-shaders-gen is treated as an external project?

This also makes me wonder whether we really need a separate path for cross compiles, or if we could force normal builds down the ExternalProject_Add path. But I didn't attempt to do that in this change.

@jeffbolznv jeffbolznv requested review from 0cc4m and bandoti April 3, 2025 21:45
@github-actions github-actions bot added Vulkan Issues specific to the Vulkan backend ggml changes relating to the ggml tensor library for machine learning labels Apr 3, 2025
Copy link
Collaborator

@bandoti bandoti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the version match looks good.

@bandoti
Copy link
Collaborator

bandoti commented Apr 3, 2025

This also makes me wonder whether we really need a separate path for cross compiles, or if we could force normal builds down the ExternalProject_Add path.

I think we do need separate path as tempting as it is to change, it works as it is now! Unless an issue comes up probably best to let it be 😀

@0cc4m 0cc4m merged commit 35e592e into ggml-org:master Apr 4, 2025
48 checks passed
timwu pushed a commit to timwu/llama.cpp that referenced this pull request May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ggml changes relating to the ggml tensor library for machine learning Vulkan Issues specific to the Vulkan backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants