https://emscripten.org/docs/tools_reference/emsdk.html#emsdk-howto
says:
To switch to using the latest upstream git development branch (incoming), run the following:
./emsdk install sdk-incoming-64bit
but doing that just complains:
$ ./emsdk install sdk-incoming-64bit
Error: No tool or SDK found by name 'sdk-incoming-64bit'.
I think this may have just been fixed by @juj's change to the emsdk to allow building from source again? https://github.com/emscripten-core/emsdk/pull/401
Yeah, this changed just recently.
To build legacy fastcomp based Emscripten from source, issue ./emsdk install sdk-fastcomp-incoming-64bit.
To build upstream wasm backend based Emscripten from source, issue ./emsdk install sdk-upstream-incoming-64bit.
Looks like docs need an update (also the wording on the docs is misleading, "... latest upstream git ..." now has the overloaded meaning that upstream generally now refers to the llvm git based backend, but the old sdk-incoming-64bit did not refer to the upstream llvm backend, but the old fastcomp backend)
no dice yet... what am I doing wrong?
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install sdk-upstream-incoming-64bit
gives:
Error: No tool or SDK found by name 'sdk-upstream-incoming-64bit'.
Oh, for Linux and macOS users, https://github.com/emscripten-core/emsdk/pull/413 is needed. (just coming hot off the press)
Thanks! Although I had to also add binaryen separately.. I guess this is right?
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install sdk-upstream-incoming-64bit
./emsdk install binaryen-master-64bit
./emsdk activate sdk-upstream-incoming-64bit
./emsdk activate binaryen-master-64bit
Hm, this combo doesn't work, I get the error below at link time. Is this a separate bug, or a mismatch between the sdk-upstream-incoming and the binaryen-master? should I have installed a different binaryen? I'm also not sure if the the compile flags are still good, the last time I installed emscripten was perhaps May 2019, pre-llvm, it seems a lot has changed since then.
[ 92%] Building CXX object CMakeFiles/SpinDrops.dir/src/OpenUrl.cpp.o
/scrap/tesch/local/emsdk/emscripten/incoming/em++ -DCMAKE_CONFIG=Debug -DCPPDUALS_LIBFMT=1 -DEIGENLAB_MAXMATRIX=8388608 -DEIGEN_DEFAULT_IO_FORMAT="IOFormat(FullPrecision, DontAlignCols, \", \", \";\\n\", \"\", \"\", \"[\", \"]\")" -DGLM_ENABLE_EXPERIMENTAL -DHAVE_SDL=2 -DSTBI_ONLY_JPEG -DSTBI_ONLY_PNG @CMakeFiles/SpinDrops.dir/includes_CXX.rsp --std=c++14 -O2 -fno-rtti -Wno-unused-parameter -Wno-deprecated-declarations --shell-file /scrap/tesch/src/resources-webgl/shell_minimal.html -s USE_SDL=2 -s FULL_ES2=1 -s EVAL_CTORS=1 -s ALLOW_MEMORY_GROWTH=1 --no-heap-copy -s NO_EXIT_RUNTIME=1 -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -s DEMANGLE_SUPPORT=1 -g -D_GLIBCXX_DEBUG -g -O0 -s ASSERTIONS=1 -s ABORTING_MALLOC=1 -Wall -Wextra -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-unknown-pragmas -s DISABLE_EXCEPTION_CATCHING=0 -s USE_SDL=2 -s USE_FREETYPE=1 -std=c++14 -o CMakeFiles/SpinDrops.dir/src/OpenUrl.cpp.o -c /scrap/tesch/src/src/OpenUrl.cpp
[ 92%] Linking CXX executable SpinDrops.html
/usr/bin/cmake3 -E cmake_link_script CMakeFiles/SpinDrops.dir/link.txt --verbose=1
/scrap/tesch/local/emsdk/emscripten/incoming/em++ --std=c++14 -O2 -fno-rtti -Wno-unused-parameter -Wno-deprecated-declarations --shell-file /scrap/tesch/src/resources-webgl/shell_minimal.html -s USE_SDL=2 -s FULL_ES2=1 -s EVAL_CTORS=1 -s ALLOW_MEMORY_GROWTH=1 --no-heap-copy -s NO_EXIT_RUNTIME=1 -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 -s DEMANGLE_SUPPORT=1 -g -D_GLIBCXX_DEBUG -g -O0 -s ASSERTIONS=1 -s ABORTING_MALLOC=1 --memory-init-file 1 --preload-file /scrap/tesch/src/Android/app/src/main/assets@/ -lidbfs.js -s USE_SDL=2 -s USE_FREETYPE=1 @CMakeFiles/SpinDrops.dir/objects1.rsp -o SpinDrops.html @CMakeFiles/SpinDrops.dir/linklibs.rsp
no symbols
no symbols
no symbols
no symbols
no symbols
no symbols
no symbols
no symbols
no symbols
no symbols
no symbols
no symbols
no symbols
no symbols
no symbols
no symbols
no symbols
no symbols
no symbols
no symbols
no symbols
no symbols
no symbols
no symbols
Fatal: Module::getFunction: __invoke_%\22class.std::__2::__compressed_pair.21\22*_%\22class.std::__2::__compressed_pair.21\22* does not exist
shared:ERROR: '/scrap/tesch/local/emsdk/binaryen/master_64bit_binaryen/bin/wasm-emscripten-finalize --detect-features -g --global-base=1024 --check-stack-overflow /tmp/emscripten_temp_hvyy_jwz/SpinDrops.wasm -o /tmp/emscripten_temp_hvyy_jwz/SpinDrops.wasm.o.wasm' failed (1)
It could be that you are simply running into an issue that exists on ToT. There is known issue with binaryen right now.
Can you build with a pre-built SDK: ./emsdk install latest?
I'm on this quest to compile a stable working version because none of the pre-built binaries work for me (#6252) because I'm on CentOS 7.7, which is super stable but comes with old GLIBCXX_3.4.19, and the downloadable emsdk binaries are linked against a newer GLIBCXX_3.4.20/21.
Basically I'm just trying to get a working recent version of Emcsripten. Either downloadable binaries that dont require .20/.21 or an easy way (sequence of commands) to compile an entire working toolchain.
Can you try the above build again? I think the above error might have been due to binaryen bug, for which the culprit was reverted yesterday.
it works now, thanks! (commands below)
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install sdk-upstream-incoming-64bit
./emsdk activate sdk-upstream-incoming-64bit
In the docs, there's a "How do I just get the latest SDK?" , maybe the solution to this ticket would be adding a section "How do I just compile the latest (working) SDK?"
Sounds good @tesch1 , thanks, I opened https://github.com/emscripten-core/emsdk/pull/420
Most helpful comment
It could be that you are simply running into an issue that exists on ToT. There is known issue with binaryen right now.
Can you build with a pre-built SDK:
./emsdk install latest?