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

Example from guide build fails #691

Open
bcbroom opened this issue Dec 18, 2020 · 4 comments
Open

Example from guide build fails #691

bcbroom opened this issue Dec 18, 2020 · 4 comments

Comments

@bcbroom
Copy link

bcbroom commented Dec 18, 2020

I'm unable to run the example cargo run --release --example draw on macOS 10.15.7 (Catalina), and get

Compiling glsl-to-spirv v0.1.7
error: failed to run custom build command for `glsl-to-spirv v0.1.7`

Caused by:
  process didn't exit successfully: `/Users/broom/Documents/code/rust/nannou/target/release/build/glsl-to-spirv-6de94febe694eea4/build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-changed=build/glslangValidator.exe
  running: "cmake" "/Users/broom/.cargo/registry/src/github.com-1ecc6299db9ec823/glsl-to-spirv-0.1.7/glslang" "-DCMAKE_INSTALL_PREFIX=/Users/broom/Documents/code/rust/nannou/target/release/build/glsl-to-spirv-f1f9973f393be420/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Release"

  --- stderr
  fatal: not a git repository (or any of the parent directories): .git
  thread 'main' panicked at '
  failed to execute command: No such file or directory (os error 2)
  is `cmake` not installed?

  build script failed, must exit now', /Users/broom/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.45/src/lib.rs:894:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

I also tried

broom@Brian-Secondary-MBP nannou % rustup update
info: syncing channel updates for 'stable-x86_64-apple-darwin'
info: checking for self-updates

  stable-x86_64-apple-darwin unchanged - rustc 1.48.0 (7eac88abb 2020-11-16)

info: cleaning up downloads & tmp directories
broom@Brian-Secondary-MBP nannou % xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
@coka
Copy link

coka commented Jan 18, 2021

@bcbroom You need to install CMake. If you install CMake.app using the .dmg from that website, you can check out Tools > How to Install For Command Line Use in the menu bar for details on how to make sure that the cmake command is available from your shell.

@JoshuaBatty (sorry, don't know who to ping) Should CMake installation instructions be added to the guide?

@bcbroom
Copy link
Author

bcbroom commented Jan 18, 2021

That works - thanks.
I installed using brew install cmake

I think adding this to the directions would be a good idea, the directions for macOS say the Xcode command line tools are all you need.

@dimitre
Copy link

dimitre commented Feb 27, 2021

same issue here. +1 for adding on instructions

@mitchmindtree
Copy link
Member

Thanks for digging into this folks - I believe it's only a couple of the examples that require glsl-to-spirv (and in turn cmake), however currently the way that the examples are collected in the repo requires that all their dependencies are to be built before one of them can be run which is a little unfortunate.

I don't remember off the top of my head exactly which dependency uses glsl-to-spirv, but ideally I think we replace it with naga which seems to be maturing fairly well lately (though I think it's GLSL front-end is in the process of getting a re-write). Using naga (a pure-rust shader translator) should remove the need for cmake altogether.

Similarly, the WIP update from wgpu 0.7 to 0.8 should remove the need for spirv-cross, a c++ dependency that was previously used to go from SPIRV -> Metal on macOS (also in favour of naga).

mitchmindtree added a commit that referenced this issue May 22, 2021
Issue #691 Adding cmake to OS X setup directions
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

4 participants