KhronosGroup / Vulkan-Tools

Vulkan Development Tools
Apache License 2.0
361 stars 153 forks source link

Volk present but not detected #1021

Open juanitotc opened 3 weeks ago

juanitotc commented 3 weeks ago

Building vulkan-tools-1.3.292, volk is not detected even though present in /usr/local.

-Dvolk_dir=/usr/local/lib/cmake/volk does not help.

-DUPDATES=ON downloads volk, but it is still not detected.

charles-lunarg commented 3 weeks ago

It's -DUPDATE_DEPS=ON and you need to delete your cache to make sure it is getting populated. I'm not sure off the top of my head where volk_dir points to - it might be the root of the install directory, so setting it to /usr/local may work, or it may need /usr/local/lib.

juanitotc commented 3 weeks ago

Thanks - yes, it’s DUPDATE_DEPS=ON, I checked volk, vulkan-headers, etc were downloaded - vulkan-headers, etc are detected, but not volk.

I’ve set -Dvolk_DIR to /usr/local, /usr/local/lib, /usr/local/lib/cmake as well, but none work.

juanitotc commented 3 weeks ago

Using volk-3.1.2 and Vulkan-Tools-1.3.292, If find_package(volk QUIET REQUIRED CONFIG) is changed to find_package(Volk QUIET REQUIRED CONFIG) then volk is found.

Configuring still fails with errors of the form:

CMake Error at cube/CMakeLists.txt:246 (target_link_libraries):
  Target "vkcube" links to:

    volk::volk_headers

It looks like the target should be Volk::volk - this allows configuring to finish, but then there are many "make" errors of the form:

/usr/local/bin/cc -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe CMakeFiles/vkcube.dir/cube.c.o -o vkcube  -Wl,-rpath,/usr/local/lib: -lm -lrt /usr/local/lib/libvolk.so.3.1.2 /usr/local/lib/libxcb.so -ldl -lm 
/usr/local/bin/ld: CMakeFiles/vkcube.dir/cube.c.o: in function `demo_name_object':
cube.c:(.text+0xa50): undefined reference to `vkSetDebugUtilsObjectNameEXT'
charles-lunarg commented 3 weeks ago

So looking at my own build, I see that

VOLK_INSTALL_DIR:STRING=/home/cdgiessen/lunarg/Vulkan-Tools/external/Release/64/volk/build/install
volk_DIR:PATH=/home/cdgiessen/lunarg/Vulkan-Tools/external/Release/64/volk/build/install/lib/cmake/volk

Looking at the CMake code, you should be setting VOLK_INSTALL_DIR, not volk_DIR. I'm not sure who/what volk_DIR is or comes from, but it seems to be an internal variable, not the one that the user should set.

juanitotc commented 3 weeks ago

IT looks like the problem is small "v" versus capital "V".

If I use VOLK_INSTALL_DIR=/usr/local/lib, I get the error:

CMake Error at CMakeLists.txt:59 (find_package):
  Could not find a package configuration file provided by "volk" with any of
  the following names:

    volkConfig.cmake
    volk-config.cmake

  Add the installation prefix of "volk" to CMAKE_PREFIX_PATH or set
  "volk_DIR" to a directory containing one of the above files.  If "volk"
  provides a separate development package or SDK, be sure it has been
  installed.

..but I have:

ls /usr/local/lib/cmake/volk
VolkConfig.cmake           VolkTargets-release.cmake
VolkConfigVersion.cmake    VolkTargets.cmake

As mentioned above, if I change the search from volk to Volk, volk is found, but the are still problems of volk versus Volk.