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

fail to build and run simple example on mac OS mojave #336

Closed
bwanaaa opened this issue Jun 11, 2019 · 7 comments · Fixed by #452
Closed

fail to build and run simple example on mac OS mojave #336

bwanaaa opened this issue Jun 11, 2019 · 7 comments · Fixed by #452

Comments

@bwanaaa
Copy link

bwanaaa commented Jun 11, 2019

installed as per instructions.
executed:
cargo run --release --example simple_draw

and got

 Compiling shaderc-sys v0.5.0
error: failed to run custom build command for `shaderc-sys v0.5.0`
process didn't exit successfully: `/Users/stefankaros/nannou/target/release/build/shaderc-sys-e82b860417991dd8/build-script-build` (exit code: 101)
--- stdout
cargo:warning=Pre-built library not found.  Falling back to from-source build
running: "cmake" "/Users/stefankaros/.cargo/registry/src/github.com-1ecc6299db9ec823/shaderc-sys-0.5.0/build" "-DCMAKE_POSITION_INDEPENDENT_CODE=ON" "-DSPIRV_SKIP_EXECUTABLES=ON" "-DSPIRV_WERROR=OFF" "-DSHADERC_SKIP_TESTS=ON" "-DCMAKE_INSTALL_LIBDIR=lib" "-DCMAKE_INSTALL_PREFIX=/Users/stefankaros/nannou/target/release/build/shaderc-sys-ed5557fe760f0878/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_BUILD_TYPE=Release"
-- Building SPIRV-Header examples
-- SPIRV-Tools: nosetests found - python support code will be tested
-- Google Mock was not found - tests based on that will not build
-- optimizer enabled
-- Shaderc: build type is "Release".
-- Configuring Shaderc to avoid building tests.
-- asciidoctor was not found - no documentation will be generated
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/stefankaros/nannou/target/release/build/shaderc-sys-ed5557fe760f0878/out/build
running: "cmake" "--build" "." "--target" "install" "--config" "Release" "--"
[  1%] Built target core_tables
[  1%] Built target SPIRV-Headers-example-1.1
[  1%] Built target enum_string_mapping
[  2%] Built target spirv-tools-spv-amd-shader-explicit-vertex-parameter
[  2%] Built target spirv-tools-spv-amd-gcn-shader
[  3%] Built target SPIRV-Headers-example
[  3%] Built target spirv-tools-shared-pkg-config
[  3%] Built target spirv-tools-pkg-config
[  3%] Built target spirv-tools-spv-amd-shader-trinary-minmax
[  3%] Built target spirv-tools-spv-amd-shader-ballot
[  4%] Built target spirv-tools-debuginfo
[  5%] Built target OSDependent
[  5%] Built target spirv-tools-header-DebugInfo
[  7%] Built target HLSL
[  7%] Built target OGLCompiler
[  8%] Built target glslang-default-resource-limits
[  9%] Check copyright
[ 10%] Built target SPVRemapper
[ 10%] Update build-version.inc in the Shaderc build directory (if necessary).
[ 10%] Built target shaderc-pkg-config
[ 10%] Built target shaderc_static-pkg-config
[ 10%] Built target shaderc_combined-pkg-config
[ 10%] Built target extinst_tables
[ 18%] Built target glslang
[ 42%] Built target check-copyright
[ 55%] Built target SPIRV-Tools
[ 56%] Built target SPIRV-Tools-shared
[ 56%] Built target build-version
[ 82%] Built target SPIRV-Tools-opt
[ 84%] Built target SPIRV
[ 85%] Built target SPIRV-Tools-link
[ 91%] Built target SPIRV-Tools-reduce
[ 92%] Built target spirv-remap
[ 93%] Built target glslangValidator
[ 95%] Built target shaderc_util
[ 97%] Built target shaderc
[ 97%] Built target shaderc_shared
[ 97%] Generating libshaderc_combined.a
[ 97%] Built target shaderc-online-compile
[ 98%] Built target glslc
Scanning dependencies of target glslc_exe
Usage: /usr/local/bin/libtool [OPTION]... [MODE-ARG]...
Try 'libtool --help' for more information.
[100%] Building CXX object shaderc/glslc/CMakeFiles/glslc_exe.dir/src/main.cc.o
[100%] Linking CXX executable glslc
[100%] Built target glslc_exe

--- stderr
CMake Warning (dev):
 Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
 --help-policy CMP0042" for policy details.  Use the cmake_policy command to
 set the policy and suppress this warning.

 MACOSX_RPATH is not specified for the following targets:

  SPIRV-Tools-shared
  shaderc_shared

This warning is for project developers.  Use -Wno-dev to suppress it.

libtool:   error: unrecognised option: '-static'
make[2]: *** [shaderc/libshaderc/libshaderc_combined.a] Error 1
make[1]: *** [shaderc/libshaderc/CMakeFiles/shaderc_combined_genfile.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2
thread 'main' panicked at '
command did not execute successfully, got: exit code: 2

build script failed, must exit now', /Users/stefankaros/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.40/src/lib.rs:832:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

I tried

cargo run --release --RUST_BACKTRACE=1 --example simple_draw

but got

error: Found argument '--RUST_BACKTRACE' which wasn't expected, or isn't valid in this context

USAGE:
    cargo run --release

For more information try --help
@freesig
Copy link
Collaborator

freesig commented Jun 11, 2019

This is a bit odd.
Can you please post the output of which libtool

@bwanaaa
Copy link
Author

bwanaaa commented Jun 11, 2019

(base) %which libtool
/usr/local/bin/libtool
(base) %

@freesig
Copy link
Collaborator

freesig commented Jun 12, 2019

You could try this nodejs/node#2341 (comment)
Looks like it might be an old homebrew version of libtool

@freesig
Copy link
Collaborator

freesig commented Jun 13, 2019

Let me know if that doesn't work and we can try to dig into this a bit more

@dimitre
Copy link

dimitre commented Jul 7, 2019

Issues here in macOs 10.14.5

   Compiling shaderc-sys v0.5.0
error: failed to run custom build command for `shaderc-sys v0.5.0`
process didn't exit successfully: `/Users/z/Desktop/nannou/target/debug/build/shaderc-sys-98ba102728455a23/build-script-build` (exit code: 101)
--- stdout
cargo:warning=Pre-built library not found.  Falling back to from-source build

--- stderr
thread 'main' panicked at '

couldn't find required command: "cmake"

', /Users/z/.cargo/registry/src/github.com-1ecc6299db9ec823/shaderc-sys-0.5.0/build/cmd_finder.rs:45:13
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

@mitchmindtree
Copy link
Member

@dimitre it looks like you might be running into a different error:

couldn't find required command: "cmake"

Unfortunately cmake is required the first time shaderc is built. shaderc is necessary in order to compile GLSL to SPIR-V (the low level shader language representation used by Vulkan). Make sure to check the "All Platforms" and "macOS" sections of the platform-specific setup chapter of the guide.

@kdamball
Copy link
Contributor

kdamball commented Nov 9, 2019

You might need to do brew install cmake before running the example draw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants