You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to compile some basic clipper functions to WASM, to use as a bridge to Javascript. This is on a Mac M1, which might have something to do with the issue I am seeing.
(FYI, I have compiled various other Rust code and crates to WASM without issue on this same M1 computer, so I think I have the basics down. Just not sure how to address this compiler error.)
When using the default Mac clang compiler, I get this error:
[INFO]: 🌀 Compiling to Wasm...
Compiling clipper-sys v0.7.2
The following warnings were emitted during compilation:
warning: In file included from clipper/clipper.cpp:41:
warning: clipper/clipper.hpp:52:10: fatal error: 'vector' file not found
warning: #include
warning: ^~~~~~~~
warning: 1 error generated.
error: failed to run custom build command for clipper-sys v0.7.2
error occurred: Command "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=wasm32-unknown-unknown" "-Wall" "-Wextra" "-o" "/Users/rhead/git/fvtt-test-ccw/intersections/target/wasm32-unknown-unknown/release/build/clipper-sys-527f62cc4ff17778/out/clipper/clipper.o" "-c" "clipper/clipper.cpp" with args "clang" did not execute successfully (status code exit status: 1).
Error: Compiling your crate to WebAssembly failed
Caused by: failed to execute cargo build: exited with exit status: 101
full command: "cargo" "build" "--lib" "--release" "--target" "wasm32-unknown-unknown"
I would guess that clang is trying to compile "clipper/clipper.hpp" as a c file, not a c++ file. But if so, I don't know why, and don't know how to fix it.
I also tried installing gcc in homebrew, and then forced it to use that compiler instead, i.e, by passing environmental variables to the compile script: CC=/opt/homebrew/bin/gcc-11 CXX=/opt/homebrew/bin/g++-11 ./build_wasm.sh
I still get a compile error, albeit a different one:
[INFO]: 🌀 Compiling to Wasm...
Compiling clipper-sys v0.7.2
error: failed to run custom build command for clipper-sys v0.7.2
--- stderr
thread 'main' panicked at 'not implemented: target_os: unknown, target_env: ', /Users/rhead/.cargo/registry/src/github.com-1ecc6299db9ec823/clipper-sys-0.7.2/build.rs:23:14
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Error: Compiling your crate to WebAssembly failed
Caused by: failed to execute cargo build: exited with exit status: 101
full command: "cargo" "build" "--lib" "--release" "--target" "wasm32-unknown-unknown"
Any insights would be much appreciated! Thanks!
The text was updated successfully, but these errors were encountered:
I cannot easily reproduce this as the CI is building but I merged the fix from #27 and it seems related. Can you try master and see if it fix your issue ?
I am trying to compile some basic clipper functions to WASM, to use as a bridge to Javascript. This is on a Mac M1, which might have something to do with the issue I am seeing.
(FYI, I have compiled various other Rust code and crates to WASM without issue on this same M1 computer, so I think I have the basics down. Just not sure how to address this compiler error.)
When using the default Mac clang compiler, I get this error:
I would guess that clang is trying to compile "clipper/clipper.hpp" as a c file, not a c++ file. But if so, I don't know why, and don't know how to fix it.
I also tried installing gcc in homebrew, and then forced it to use that compiler instead, i.e, by passing environmental variables to the compile script:
CC=/opt/homebrew/bin/gcc-11 CXX=/opt/homebrew/bin/g++-11 ./build_wasm.sh
I still get a compile error, albeit a different one:
Any insights would be much appreciated! Thanks!
The text was updated successfully, but these errors were encountered: