brson / miri

An experimental compiler from Rust to WebAssembly (inactive - do not use)
Apache License 2.0
209 stars 15 forks source link

Not able to "cargo build" successfully #64

Open AchalaSB opened 6 years ago

AchalaSB commented 6 years ago

I am running cargo build command after cloning the repo. But getting this build error. gcc, cmake, build-essential are installed & in the PATH. All help appreciated, thanks in advance.

error: failed to run custom build command for `mir2wasm v0.1.0 (file:///home/achala/GIT/mir2wasm)`
process didn't exit successfully: `/home/achala/GIT/mir2wasm/target/debug/build/mir2wasm-241ea3cc3cdec5b2/build-script-build` (exit code: 101)
--- stdout
running: "cmake" "/home/achala/GIT/mir2wasm/binaryen" "-DBUILD_STATIC_LIB=ON" "-DCMAKE_INSTALL_PREFIX=/home/achala/GIT/mir2wasm/target/debug/build/mir2wasm-c85cca1db59b112c/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=Debug"
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Building with -std=c++11
-- Building with -msse2
-- Building with -mfpmath=sse
-- Building with -Wall
-- Building with -Werror
-- Building with -Wextra
-- Building with -Wno-unused-parameter
-- Building with -fno-omit-frame-pointer
-- Building with -fPIC
-- Building with -O0
-- Building with -g3
-- Configuring done
-- Generating done
-- Build files have been written to: /home/achala/GIT/mir2wasm/target/debug/build/mir2wasm-c85cca1db59b112c/out/build
running: "cmake" "--build" "." "--target" "install" "--config" "Debug" "--"
Scanning dependencies of target emscripten-optimizer
Scanning dependencies of target asmjs
Scanning dependencies of target ast
Scanning dependencies of target wasm
[  1%] Building CXX object src/asmjs/CMakeFiles/asmjs.dir/asm_v_wasm.cpp.o
[  2%] Building CXX object src/emscripten-optimizer/CMakeFiles/emscripten-optimizer.dir/optimizer-shared.cpp.o
[  4%] Building CXX object src/ast/CMakeFiles/ast.dir/ExpressionAnalyzer.cpp.o
[  5%] Building CXX object src/wasm/CMakeFiles/wasm.dir/wasm.cpp.o
src/emscripten-optimizer/CMakeFiles/emscripten-optimizer.dir/build.make:62: recipe for target 'src/emscripten-optimizer/CMakeFiles/emscripten-optimizer.dir/optimizer-shared.cpp.o' failed
CMakeFiles/Makefile2:485: recipe for target 'src/emscripten-optimizer/CMakeFiles/emscripten-optimizer.dir/all' failed
[  7%] Building CXX object src/wasm/CMakeFiles/wasm.dir/wasm-binary.cpp.o
[  8%] Building CXX object src/asmjs/CMakeFiles/asmjs.dir/shared-constants.cpp.o
[  9%] Building CXX object src/wasm/CMakeFiles/wasm.dir/wasm-io.cpp.o
[ 11%] Building CXX object src/ast/CMakeFiles/ast.dir/ExpressionManipulator.cpp.o
src/asmjs/CMakeFiles/asmjs.dir/build.make:86: recipe for target 'src/asmjs/CMakeFiles/asmjs.dir/shared-constants.cpp.o' failed
CMakeFiles/Makefile2:430: recipe for target 'src/asmjs/CMakeFiles/asmjs.dir/all' failed
[ 12%] Building CXX object src/wasm/CMakeFiles/wasm.dir/wasm-s-parser.cpp.o
[ 14%] Linking CXX static library ../../lib/libast.a
[ 14%] Built target ast
[ 15%] Linking CXX static library ../../lib/libwasm.a
[ 15%] Built target wasm
Makefile:129: recipe for target 'all' failed

--- stderr
/home/achala/GIT/mir2wasm/binaryen/src/emscripten-optimizer/optimizer-shared.cpp: In function ‘AsmSign detectSign(cashew::Ref, cashew::IString)’:
/home/achala/GIT/mir2wasm/binaryen/src/emscripten-optimizer/optimizer-shared.cpp:157:9: error: this statement may fall through [-Werror=implicit-fallthrough=]
         if (op == TRSHIFT) return ASM_UNSIGNED;
         ^~
/home/achala/GIT/mir2wasm/binaryen/src/emscripten-optimizer/optimizer-shared.cpp:160:7: note: here
       case '|': case '&': case '^': case '<': case '=': case '!': return ASM_SIGNED;
       ^~~~
cc1plus: all warnings being treated as errors
make[2]: *** [src/emscripten-optimizer/CMakeFiles/emscripten-optimizer.dir/optimizer-shared.cpp.o] Error 1
make[1]: *** [src/emscripten-optimizer/CMakeFiles/emscripten-optimizer.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /home/achala/GIT/mir2wasm/binaryen/src/emscripten-optimizer/istring.h:32:0,
                 from /home/achala/GIT/mir2wasm/binaryen/src/asmjs/shared-constants.h:20,
                 from /home/achala/GIT/mir2wasm/binaryen/src/asmjs/shared-constants.cpp:17:
/home/achala/GIT/mir2wasm/binaryen/src/support/threads.h:51:8: error: ‘function’ in namespace ‘std’ does not name a template type
   std::function<ThreadWorkState ()> doWork = nullptr;
        ^~~~~~~~
/home/achala/GIT/mir2wasm/binaryen/src/support/threads.h:59:18: error: ‘std::function’ has not been declared
   void work(std::function<ThreadWorkState ()> doWork);
                  ^~~~~~~~
/home/achala/GIT/mir2wasm/binaryen/src/support/threads.h:59:26: error: expected ‘,’ or ‘...’ before ‘<’ token
   void work(std::function<ThreadWorkState ()> doWork);
                          ^
/home/achala/GIT/mir2wasm/binaryen/src/support/threads.h:93:30: error: ‘function’ is not a member of ‘std’
   void work(std::vector<std::function<ThreadWorkState ()>>& doWorkers);
                              ^~~~~~~~
/home/achala/GIT/mir2wasm/binaryen/src/support/threads.h:93:30: note: suggested alternative: ‘is_function’
   void work(std::vector<std::function<ThreadWorkState ()>>& doWorkers);
                              ^~~~~~~~
                              is_function
/home/achala/GIT/mir2wasm/binaryen/src/support/threads.h:93:30: error: ‘function’ is not a member of ‘std’
/home/achala/GIT/mir2wasm/binaryen/src/support/threads.h:93:30: note: suggested alternative: ‘is_function’
   void work(std::vector<std::function<ThreadWorkState ()>>& doWorkers);
                              ^~~~~~~~
                              is_function
/home/achala/GIT/mir2wasm/binaryen/src/support/threads.h:93:56: error: template argument 1 is invalid
   void work(std::vector<std::function<ThreadWorkState ()>>& doWorkers);
                                                        ^
/home/achala/GIT/mir2wasm/binaryen/src/support/threads.h:93:56: error: template argument 2 is invalid
/home/achala/GIT/mir2wasm/binaryen/src/support/threads.h:93:57: error: expected ‘,’ or ‘...’ before ‘>’ token
   void work(std::vector<std::function<ThreadWorkState ()>>& doWorkers);
                                                         ^~
make[2]: *** [src/asmjs/CMakeFiles/asmjs.dir/shared-constants.cpp.o] Error 1
make[1]: *** [src/asmjs/CMakeFiles/asmjs.dir/all] Error 2
make: *** [all] Error 2
thread '<unnamed>' panicked at '
command did not execute successfully, got: exit code: 2

build script failed, must exit now', /home/achala/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.33/src/lib.rs:773:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Any', libcore/result.rs:945:5
0zAND1z commented 6 years ago

Same here for MAC OSX. Should there be a Makefile in the target definition. Someone please help. TIA

brson commented 6 years ago

Since it's a problem building binaryan maybe updating the binaryan submodule would help.

I'm afraid I don't maintain this repo anymore (and it never accomplished anything particularly useful) but if somebody else wants it I'd be happy to transfer it to them.

kripken commented 6 years ago

There are Binaryen bindings for Rust here, maybe that can help: https://github.com/pepyakin/binaryen-rs

eddyb commented 6 years ago

Would it be possible to add a note in README saying that if you do want WASM, you should "just" use the nightly? (and maybe link to a guide for this, if one exists)

cc @steveklabnik @fitzgen

EDIT: link is https://rustwasm.github.io/book/

brson commented 6 years ago

Would it be possible to add a note in README saying that if you do want WASM, you should "just" use the nightly?

I've done so, and changed the repo description to warn people away.