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

Unable to build with cmake FetchContent #42

Open
kagurazaka-ayano opened this issue Aug 9, 2024 · 6 comments
Open

Unable to build with cmake FetchContent #42

kagurazaka-ayano opened this issue Aug 9, 2024 · 6 comments

Comments

@kagurazaka-ayano
Copy link
Contributor

kagurazaka-ayano commented Aug 9, 2024

Expected: Use FetchContent_Delcare to declare the dependency and then use FetchContent_MakeAvailable and the built library and headers will be in the _deps/gpucpp-{build/subbuild/src}

Actual: The generating process ends up with an error. Error message and minimal reproducible CMakeLists.txt is inside the gist

The dawn library file doesn't appear in the third_party/lib directory. After I built this and put the libdawn.dylib into the third_party/lib directory the cmake command works.

@austinvhuang
Copy link
Contributor

austinvhuang commented Aug 9, 2024

tagging @MichealReed as well - it's been a minute since i've played with cmake builds. From a quick look I think we need to include dawn either/both transitive fetchcontent dependence or make use of the prebuilt binaries:

can take a closer look over the weekend. would probably good if we have a separate template starter repo in the future if anyone's interesting in taking a stab at that.

@kagurazaka-ayano
Copy link
Contributor Author

tagging @MichealReed as well - it's been a minute since i've played with cmake builds. From a quick look I think we need to include dawn either/both transitive fetchcontent dependence or make use of the prebuilt binaries:

can take a closer look over the weekend. would probably good if we have a separate template starter repo in the future if anyone's interesting in taking a stab at that.

Downloading prebuilt library can be done in FetchContent since it accepts url.

@austinvhuang
Copy link
Contributor

If you're up for taking a first stab at it, happy to review+merge a PR. Can check the dawnlib target of the top-level Makefile and the setup.py script for the logic (could either call out to setup.py or replicate the setup.py logic in CMakeLists, whatever's cleaner).

@MichealReed
Copy link
Contributor

tagging @MichealReed as well - it's been a minute since i've played with cmake builds. From a quick look I think we need to include dawn either/both transitive fetchcontent dependence or make use of the prebuilt binaries:

* incorporate functionality to download the prebuilt dylib similarly to the makefile + setup.py script

* transitive via fetchcontent like https://github.com/AnswerDotAI/gpu.cpp/blob/main/examples/webgpu_from_scratch/CMakeLists.txt

* transitive shared library with fetchcontent. + jspanchu repo

can take a closer look over the weekend. would probably good if we have a separate template starter repo in the future if anyone's interesting in taking a stab at that.

Yes this makes sense, our makefile was the component that downloaded the libs before calling cmake. Nothing is in CMake currently to download libs and the python script must be ran first. Adding it via fetch seems like a good addition 👍

@MichealReed
Copy link
Contributor

This looks like it's working great but my install step fails with

CMake Error at src/dawn/native/cmake_install.cmake:51 (file):
  file INSTALL cannot find
  'gpu.cpp/third_party/local/dawn/build/Release/webgpu_dawn.dll":
  No error.
Call Stack (most recent call first):
  src/dawn/cmake_install.cmake:42 (include)
  cmake_install.cmake:80 (include)

I'm not sure I've seen a webgpu_dawn.dll so not sure why it's looking for that as a part of this install.

@kagurazaka-ayano
Copy link
Contributor Author

This looks like it's working great but my install step fails with

CMake Error at src/dawn/native/cmake_install.cmake:51 (file):
  file INSTALL cannot find
  'gpu.cpp/third_party/local/dawn/build/Release/webgpu_dawn.dll":
  No error.
Call Stack (most recent call first):
  src/dawn/cmake_install.cmake:42 (include)
  cmake_install.cmake:80 (include)

I'm not sure I've seen a webgpu_dawn.dll so not sure why it's looking for that as a part of this install.

seems like the problem with windows build. Unfortunately I don't have a windows device so I might not be able to test this.

Or is it because find_library works in a different way on windows?

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

3 participants