darling icon indicating copy to clipboard operation
darling copied to clipboard

[Build Issue]: vkFormat is causing issues with variables names

Open lexi-the-cute opened this issue 2 years ago • 5 comments

Build Log What is the build error?

/usr/include/vulkan/vulkan_core.h:10779:26: note: 'PFN_vkCmdSetCullModeEXT' declared here
typedef void (VKAPI_PTR *PFN_vkCmdSetCullModeEXT)(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode);
                         ^
In file included from /home/alexis/Desktop/darling/src/external/cocotron/QuartzCore/CAMetalLayer.mm:22:
In file included from /home/alexis/Desktop/darling/src/external/cocotron/QuartzCore/CAMetalDrawableInternal.h:28:
In file included from /home/alexis/Desktop/darling/src/external/metal/deps/indium/private-include/indium/indium.private.hpp:11:
In file included from /home/alexis/Desktop/darling/src/external/metal/deps/indium/private-include/indium/compute-command-encoder.private.hpp:5:
In file included from /home/alexis/Desktop/darling/src/external/metal/deps/indium/private-include/indium/command-encoder.private.hpp:16:
/home/alexis/Desktop/darling/src/external/metal/deps/indium/private-include/indium/dynamic-vk.hpp:181:37: error: unknown type name 'PFN_vkCmdSetDepthBiasEnable'; did you mean 'PFN_vkCmdSetDepthBias'?
                INDIUM_DYNAMICVK_FUNCTION_FOREACH(INDIUM_DYNAMICVK_FUNCTION_DECL)
                                                  ^
/usr/include/vulkan/vulkan_core.h:3212:26: note: 'PFN_vkCmdSetDepthBias' declared here
typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBias)(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor);
                         ^
In file included from /home/alexis/Desktop/darling/src/external/cocotron/QuartzCore/CAMetalLayer.mm:22:
In file included from /home/alexis/Desktop/darling/src/external/cocotron/QuartzCore/CAMetalDrawableInternal.h:28:
In file included from /home/alexis/Desktop/darling/src/external/metal/deps/indium/private-include/indium/indium.private.hpp:11:
In file included from /home/alexis/Desktop/darling/src/external/metal/deps/indium/private-include/indium/compute-command-encoder.private.hpp:5:
In file included from /home/alexis/Desktop/darling/src/external/metal/deps/indium/private-include/indium/command-encoder.private.hpp:16:
/home/alexis/Desktop/darling/src/external/metal/deps/indium/private-include/indium/dynamic-vk.hpp:181:37: error: unknown type name 'PFN_vkCmdSetDepthBoundsTestEnable'; did you mean 'PFN_vkCmdSetDepthBoundsTestEnableEXT'?
                INDIUM_DYNAMICVK_FUNCTION_FOREACH(INDIUM_DYNAMICVK_FUNCTION_DECL)
                                                  ^
/usr/include/vulkan/vulkan_core.h:10788:26: note: 'PFN_vkCmdSetDepthBoundsTestEnableEXT' declared here
typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBoundsTestEnableEXT)(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable);
                         ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
[496/3693] Linking C shared library src/native/libGL.dylib
ld: warning: static initializer found in 'src/native/CMakeFiles/GL.dir/GL.c.o'. Use -no_inits to make this an error.  Use -no_warn_inits to suppress warning
ld: warning: static initializer found in 'src/native/CMakeFiles/GL.dir/GL.c.o'. Use -no_inits to make this an error.  Use -no_warn_inits to suppress warning
ninja: build stopped: subcommand failed.

This error occurs regardless of if using ninja or make.

System Information What system are you building with?

Software Version
Clang 11.0.1-2
CMake 3.26.3
Linux Kernel 5.10.178-3
Darling dec20ddf3892ff35f0a688a047d8931faf4471c4
~/Desktop/darling/build   master  clang --version                                    
Debian clang version 11.0.1-2
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
# ---
~/Desktop/darling/build   master  cmake --version 
cmake version 3.26.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).
# ---
~/Desktop/darling/build   master  uname -a
Linux laptop 5.10.0-22-amd64 #1 SMP Debian 5.10.178-3 (2023-04-22) x86_64 GNU/Linux

It appears that Indium does not like Debian's latest version of the apt package libvulkan-dev.

lexi-the-cute avatar May 17 '23 05:05 lexi-the-cute

Yeah, it seems that Debian's version of the Vulkan headers is missing some required declarations. What version of libvulkan-dev do you have installed? (i.e. apt list libvulkan-dev)

For now, if you just want to build Darling and don't particularly need Metal (there's not much of it implemented right now anyways), you can add -DENABLE_METAL=OFF to the CMake configuration command.

facekapow avatar May 17 '23 10:05 facekapow

~/Desktop/game   main  apt list libvulkan-dev
Listing... Done
libvulkan-dev/stable,now 1.2.162.0-1 amd64 [installed]
libvulkan-dev/stable,now 1.2.162.0-1 i386 [installed]

lexi-the-cute avatar May 17 '23 14:05 lexi-the-cute

It appears your suggestion has worked.

The below commands are what I used to build Darling on my Debian system.

# Install Build Packages (Modified From https://docs.darlinghq.org/build-instructions.html)
sudo apt install cmake clang bison flex xz-utils libfuse-dev libudev-dev pkg-config \
libc6-dev-i386 libcap2-bin git git-lfs python2 libglu1-mesa-dev libcairo2-dev \
libgl1-mesa-dev libtiff5-dev libfreetype6-dev libxml2-dev libegl1-mesa-dev libfontconfig1-dev \
libbsd-dev libxrandr-dev libxcursor-dev libgif-dev libpulse-dev libavformat-dev libavcodec-dev \
libswresample-dev libdbus-1-dev libxkbfile-dev libssl-dev llvm-dev checkinstall

# Clone Darling
git clone --recursive https://github.com/darlinghq/darling.git
cd darling

# Update Sources Due To Spotty Internet Halting Cloning
git lfs install
git pull
git submodule update --init --recursive

# Make a build directory
mkdir build && cd build

# Configure Build
cmake .. -GNinja -DENABLE_METAL=OFF

# Build
ninja

# Build Deb Package To Install (This will take quite a few hours, so run it in a screen session and walk away)
#sudo checkinstall -D cmake --install .
sudo checkinstall --fstrans=yes --install=no -d 2 -D cmake --install .

lexi-the-cute avatar May 17 '23 15:05 lexi-the-cute

So, it successfully builds, I just don't know if it works as I have problems like not being able to find shellspawn.sock and I had to symlink to my /proc directory.

lexi-the-cute avatar May 17 '23 18:05 lexi-the-cute

Sorry for the long delay on the response, but what issues were you getting that led you to symlink the /proc directory? That would actually cause issues with Darling since we mount our own /proc within the container (so it needs to be an empty directory).

Could you try again with the latest commit on master and see if you get the same issues?

facekapow avatar Oct 16 '23 02:10 facekapow