mymonero / mymonero-core-js

The JS library containing the Monero crypto plus lightwallet functions behind the official MyMonero apps
BSD 3-Clause "New" or "Revised" License
101 stars 103 forks source link

Linking issue when building 'mymonero-core-js' from scratch #84

Closed cutcoin closed 5 years ago

cutcoin commented 5 years ago

I'm trying to build mymonero-core-js from scratch in my Ubuntu 16.04 x64 and follow the steps from README file. Building looks fine till it reaches 50%, then it fails with the message

[ 50%] Linking CXX executable MyMoneroCoreCpp_ASMJS.js shared:WARNING: --separate-asm works best when compiling to HTML. Otherwise, you must yourself load the '.asm.js' file that is emitted separately, and must do so before loading the main '.js' file. [-Wseparate-asm] shared:ERROR: Assigning a non-existent settings attribute "BINARYEN_METHOD" shared:ERROR: - did you mean one of BINARYEN_TRAP_MODE, BINARYEN_ROOT, BINARYEN_PASSES? shared:ERROR: - perhaps a typo in emcc's -s X=Y notation? shared:ERROR: - (see src/settings.js for valid values) CMakeFiles/MyMoneroCoreCpp_ASMJS.dir/build.make:1585: recipe for target 'MyMoneroCoreCpp_ASMJS.js' failed make[2]: [MyMoneroCoreCpp_ASMJS.js] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/MyMoneroCoreCpp_ASMJS.dir/all' failed make[1]: [CMakeFiles/MyMoneroCoreCpp_ASMJS.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

I've tried to google this error, but without any success. Hopefully you can help fix it. Thank you, Cutcoin team

paulshapiro commented 5 years ago

What version of emscripten sdk are you using?

cutcoin commented 5 years ago

Thank you for response! My versions are:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 1.38.24 clang version 6.0.1 (emscripten 1.38.24 : 1.38.24) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /home/emsdk/clang/e1.38.24_64bit Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.3.0 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8 Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.3.0 Candidate multilib: .;@m64 Selected multilib: .;@m64

paulshapiro commented 5 years ago

Hmm could you check with emscripten to see if BINARYEN_METHOD has been deprecated?

cutcoin commented 5 years ago

From emscripten changelog:

v1.38.23: 01/10/2019 Remove BINARYEN_METHOD: no more support for interpret modes, and if you want non-wasm, use WASM=0. Support specifying multiple possible ENVIRONMENTs (#7809)

and the command that I run in terminal produces pretty the same result:

emcc -s BINARYEN=1 -s "BINARYEN_METHOD='native-wasm,asmjs'" hello.c -o hello.js shared:ERROR: Assigning a non-existent settings attribute "BINARYEN_METHOD" shared:ERROR: - did you mean one of BINARYEN_TRAP_MODE, BINARYEN_ROOT, BINARYEN_PASSES? shared:ERROR: - perhaps a typo in emcc's -s X=Y notation? shared:ERROR: - (see src/settings.js for valid values)

So looks you are right

paulshapiro commented 5 years ago

Gotcha, thanks for that. Would you like to do a PR? Should be very straightforward. If so, make sure to add yourself to authors!

cutcoin commented 5 years ago

Here is the PR, not sure about your workflow, created it against master, probably you would like to merge it into dev.