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

I need help building the demo #17

Open
ThanosFisherman opened this issue Aug 30, 2024 · 2 comments
Open

I need help building the demo #17

ThanosFisherman opened this issue Aug 30, 2024 · 2 comments

Comments

@ThanosFisherman
Copy link

Hello, I need some assistance on building the sample on my Arch linux. I follow the instructions but I ran into the following error while running setup_native_build.sh

setup_native_build.sh: line 19: gclient: command not found

I then ignored it and moven on to building with cmake as per instructions. Then I also got the following errors

-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.12.5", minimum required is "3")
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
Doxygen not found. Skipping documentation
-- Dawn: using SPIRV-Headers at /home/thanos/CLionProjects/webgpu-cross-platform-demo/third_party/dawn/third_party/vulkan-deps/spirv-headers/src
CMake Error at third_party/dawn/third_party/CMakeLists.txt:23 (add_subdirectory):
  add_subdirectory given source
  "/home/thanos/CLionProjects/webgpu-cross-platform-demo/third_party/dawn/third_party/vulkan-deps/spirv-headers/src"
  which is not an existing directory.


-- Dawn: using SPIRV-Tools at /home/thanos/CLionProjects/webgpu-cross-platform-demo/third_party/dawn/third_party/vulkan-deps/spirv-tools/src
CMake Error at third_party/dawn/third_party/CMakeLists.txt:48 (add_subdirectory):
  add_subdirectory given source
  "/home/thanos/CLionProjects/webgpu-cross-platform-demo/third_party/dawn/third_party/vulkan-deps/spirv-tools/src"
  which is not an existing directory.


-- Dawn: using GLFW at /home/thanos/CLionProjects/webgpu-cross-platform-demo/third_party/dawn/third_party/glfw
CMake Error at third_party/dawn/third_party/CMakeLists.txt:62 (add_subdirectory):
  add_subdirectory given source
  "/home/thanos/CLionProjects/webgpu-cross-platform-demo/third_party/dawn/third_party/glfw"
  which is not an existing directory.


-- Dawn: using Abseil at /home/thanos/CLionProjects/webgpu-cross-platform-demo/third_party/dawn/third_party/abseil-cpp
CMake Error at third_party/dawn/third_party/CMakeLists.txt:76 (add_subdirectory):
  add_subdirectory given source
  "/home/thanos/CLionProjects/webgpu-cross-platform-demo/third_party/dawn/third_party/abseil-cpp"
  which is not an existing directory.


-- Dawn: using Vulkan-Headers at /home/thanos/CLionProjects/webgpu-cross-platform-demo/third_party/dawn/third_party/vulkan-deps/vulkan-headers/src
CMake Error at third_party/dawn/third_party/CMakeLists.txt:81 (add_subdirectory):
  add_subdirectory given source
  "/home/thanos/CLionProjects/webgpu-cross-platform-demo/third_party/dawn/third_party/vulkan-deps/vulkan-headers/src"
  which is not an existing directory.

Any help would be appreciated.

@kainino0x
Copy link
Owner

The gclient step is required. You can get it from depot_tools, see here: https://chromium.googlesource.com/chromium/src/+/main/docs/linux/build_instructions.md#install

You might want to try https://github.com/beaufortfrancois/webgpu-cross-platform-app instead as it's very similar but a bit more maintained, and I think it takes advantage of git submodules instead of requiring gclient. (I think.)

@ThanosFisherman
Copy link
Author

I cloned depot_tools and added gclient to PATH. I executed the setup_native_build.sh once again and everything seemed to build fine. However I got a bunch of new errors upon running make.

/home/thanos/CLionProjects/webgpu-cross-platform-demo/main.cpp:80:48: error: conflicting declaration ‘std::unique_ptr<dawn::native::Instance> instance’
   80 | static std::unique_ptr<dawn::native::Instance> instance;
      |                                                ^~~~~~~~
/home/thanos/CLionProjects/webgpu-cross-platform-demo/main.cpp:35:23: note: previous declaration as ‘wgpu::Instance instance’
   35 | static wgpu::Instance instance;
      |                       ^~~~~~~~
/home/thanos/CLionProjects/webgpu-cross-platform-demo/main.cpp: In function ‘void GetDevice(void (*)(wgpu::Device))’:
/home/thanos/CLionProjects/webgpu-cross-platform-demo/main.cpp:327:57: error: no match for ‘operator=’ (operand types are ‘wgpu::Instance’ and ‘std::__detail::__unique_ptr_t<dawn::native::Instance>’)
  327 |     instance = std::make_unique<dawn::native::Instance>();
      |                                                         ^
In file included from /home/thanos/CLionProjects/webgpu-cross-platform-demo/main.cpp:18:
/home/thanos/CLionProjects/webgpu-cross-platform-demo/out/native/third_party/dawn/gen/include/dawn/webgpu_cpp.h:728:18: note: candidate: ‘Derived& wgpu::ObjectBase<Derived, CType>::operator=(std::nullptr_t) [with Derived = wgpu::Instance; CType = WGPUInstanceImpl*; std::nullptr_t = std::nullptr_t]’
  728 |         Derived& operator=(std::nullptr_t) {
      |                  ^~~~~~~~
/home/thanos/CLionProjects/webgpu-cross-platform-demo/out/native/third_party/dawn/gen/include/dawn/webgpu_cpp.h:728:28: note:   no known conversion for argument 1 from ‘std::__detail::__unique_ptr_t<dawn::native::Instance>’ to ‘std::nullptr_t’
  728 |         Derived& operator=(std::nullptr_t) {
      |                            ^~~~~~~~~~~~~~
/home/thanos/CLionProjects/webgpu-cross-platform-demo/out/native/third_party/dawn/gen/include/dawn/webgpu_cpp.h:717:18: note: candidate: ‘Derived& wgpu::ObjectBase<Derived, CType>::operator=(wgpu::ObjectBase<Derived, CType>&&) [with Derived = wgpu::Instance; CType = WGPUInstanceImpl*]’
  717 |         Derived& operator=(ObjectBase&& other) {
      |                  ^~~~~~~~
/home/thanos/CLionProjects/webgpu-cross-platform-demo/out/native/third_party/dawn/gen/include/dawn/webgpu_cpp.h:717:41: note:   no known conversion for argument 1 from ‘std::__detail::__unique_ptr_t<dawn::native::Instance>’ to ‘wgpu::ObjectBase<wgpu::Instance, WGPUInstanceImpl*>&&’
  717 |         Derived& operator=(ObjectBase&& other) {
      |                            ~~~~~~~~~~~~~^~~~~
/home/thanos/CLionProjects/webgpu-cross-platform-demo/out/native/third_party/dawn/gen/include/dawn/webgpu_cpp.h:703:18: note: candidate: ‘Derived& wgpu::ObjectBase<Derived, CType>::operator=(const wgpu::ObjectBase<Derived, CType>&) [with Derived = wgpu::Instance; CType = WGPUInstanceImpl*]’
  703 |         Derived& operator=(ObjectBase const& other) {
      |                  ^~~~~~~~
/home/thanos/CLionProjects/webgpu-cross-platform-demo/out/native/third_party/dawn/gen/include/dawn/webgpu_cpp.h:703:46: note:   no known conversion for argument 1 from ‘std::__detail::__unique_ptr_t<dawn::native::Instance>’ to ‘const wgpu::ObjectBase<wgpu::Instance, WGPUInstanceImpl*>&’
  703 |         Derived& operator=(ObjectBase const& other) {
      |                            ~~~~~~~~~~~~~~~~~~^~~~~
/home/thanos/CLionProjects/webgpu-cross-platform-demo/out/native/third_party/dawn/gen/include/dawn/webgpu_cpp.h:976:11: note: candidate: ‘wgpu::Instance& wgpu::Instance::operator=(const wgpu::Instance&)’
  976 |     class Instance : public ObjectBase<Instance, WGPUInstance> {
      |           ^~~~~~~~
/home/thanos/CLionProjects/webgpu-cross-platform-demo/out/native/third_party/dawn/gen/include/dawn/webgpu_cpp.h:976:11: note:   no known conversion for argument 1 from ‘std::__detail::__unique_ptr_t<dawn::native::Instance>’ to ‘const wgpu::Instance&’
/home/thanos/CLionProjects/webgpu-cross-platform-demo/out/native/third_party/dawn/gen/include/dawn/webgpu_cpp.h:976:11: note: candidate: ‘wgpu::Instance& wgpu::Instance::operator=(wgpu::Instance&&)’
/home/thanos/CLionProjects/webgpu-cross-platform-demo/out/native/third_party/dawn/gen/include/dawn/webgpu_cpp.h:976:11: note:   no known conversion for argument 1 from ‘std::__detail::__unique_ptr_t<dawn::native::Instance>’ to ‘wgpu::Instance&&’
/home/thanos/CLionProjects/webgpu-cross-platform-demo/main.cpp:328:13: error: base operand of ‘->’ has non-pointer type ‘wgpu::Instance’
  328 |     instance->DiscoverDefaultAdapters();
      |             ^~
/home/thanos/CLionProjects/webgpu-cross-platform-demo/main.cpp:330:29: error: base operand of ‘->’ has non-pointer type ‘wgpu::Instance’
  330 |     auto adapters = instance->GetAdapters();
      |                             ^~
/home/thanos/CLionProjects/webgpu-cross-platform-demo/main.cpp: In function ‘void init()’:
/home/thanos/CLionProjects/webgpu-cross-platform-demo/main.cpp:394:18: error: ‘struct wgpu::ShaderModuleWGSLDescriptor’ has no member named ‘code’
  394 |         wgslDesc.code = shaderCode;
      |                  ^~~~
In file included from /usr/include/X11/Xlib.h:44,
                 from /home/thanos/CLionProjects/webgpu-cross-platform-demo/third_party/dawn/third_party/glfw/include/GLFW/glfw3native.h:102,
                 from /home/thanos/CLionProjects/webgpu-cross-platform-demo/window.h:17,
                 from /home/thanos/CLionProjects/webgpu-cross-platform-demo/main.cpp:21:
/home/thanos/CLionProjects/webgpu-cross-platform-demo/main.cpp:427:65: error: expected unqualified-id before numeric constant
  427 |         depthStencilState.depthCompare = wgpu::CompareFunction::Always;
      |                                                                 ^~~~~~
/home/thanos/CLionProjects/webgpu-cross-platform-demo/main.cpp: In function ‘void run()’:
/home/thanos/CLionProjects/webgpu-cross-platform-demo/main.cpp:713:43: error: base operand of ‘->’ has non-pointer type ‘wgpu::Instance’
  713 |     surface = window_init_surface(instance->Get(), native_window);
      |                                           ^~
make[2]: *** [CMakeFiles/hello.dir/build.make:76: CMakeFiles/hello.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1363: CMakeFiles/hello.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

I'll also give a try to the other repo as you suggested.

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

2 participants