I followed my (today-updated) instructions to build a 32bit emscripten with GMP/MPFR/MPC at https://stackoverflow.com/questions/41080815/compiling-gmp-mpfr-with-emscripten/43583154#43583154 but failed at the final hurdle:
$ cd mandelbrot-numerics/c/bin && make js
emcc -O2 -o m-ball-period.js m-ball-period.o /home/emscripten/opt/lib/libmandelbrot-numerics.a /home/emscripten/opt/lib/libmpc.a /home/emscripten/opt/lib/libmpfr.a /home/emscripten/opt/lib/libgmp.a
WARNING:root:m-ball-period.o is not valid LLVM bitcode
ERROR:root:emcc: cannot find binaryen js libraries (tried: ('/home/emscripten/emsdk/binaryen/tag-1.38.9_64bit_binaryen/bin', '/home/emscripten/emsdk/binaryen/tag-1.38.9_64bit_binaryen/share/binaryen'))
Makefile:35: recipe for target 'm-ball-period.js' failed
make: *** [m-ball-period.js] Error 1
Shouldn't it be looking for a 32bit binaryen? I am running in a i386 chroot on an amd64 system, in the chroot I get this:
$ uname -a
Linux eiskaffee 4.16.0-2-amd64 #1 SMP Debian 4.16.12-1 (2018-05-27) x86_64 GNU/Linux
Seems the issue is in the ~/.emscripten file created by emscripten at some point: it had a 64bit BINARYEN_ROOT. I edited the file and rebuilt all my test code, and it works now. This is what the file contains after I edited it:
$ grep BINARYEN_ROOT ~/.emscripten
BINARYEN_ROOT='/home/emscripten/emsdk/binaryen/tag-1.38.9_32bit_binaryen'
(before it was almost the same, but with 64bit instead of 32bit).
Same issue here... the generated ~/.emscripten has the wrong environment variable on 32bit systems
Edit: for reference: https://github.com/juj/emsdk/issues/170
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.
latest-32bit appears to be no longer available.
Trying to install sdk-master-32bit from source fails with:
In file included from /home/emscripten/emsdk/clang/fastcomp/src/tools/lli/lli.cpp:30:
/home/emscripten/emsdk/clang/fastcomp/src/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h: In member function 'llvm::Expected<std::vector<char> > llvm::orc::remote::OrcRemoteTargetClient<ChannelT>::readMem(char*, llvm::JITTargetAddress, uint64_t)':
/home/emscripten/emsdk/clang/fastcomp/src/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h:722:26: error: could not convert '((llvm::orc::remote::OrcRemoteTargetClient<ChannelT>*)this)->callB<llvm::orc::remote::OrcRemoteTargetRPCAPI::ReadMem>(Src, Size)' from 'Expected<vector<unsigned char,allocator<unsigned char>>>' to 'Expected<vector<char,allocator<char>>>'
return callB<ReadMem>(Src, Size);
~~~~~~~~~~~~~~^~~~~~~~~~~
Trying to install sdk-incoming-32bit from source fails with:
Manifest error: No tool by name 'node-12.9.1-32bit' found! This may indicate an internal SDK error!
Traceback (most recent call last):
File "./emsdk.py", line 2980, in <module>
sys.exit(main())
File "./emsdk.py", line 2960, in main
success = tool.install()
File "./emsdk.py", line 1695, in install
success = tool.install()
AttributeError: 'NoneType' object has no attribute 'install'
So at this point I assume 32bit is no longer supported at all, and give up.
It turns out that I no longer need 32bit after all, so my problem is solved.
Yes, sorry about that - we've created a completely new build infrastructure, and it only supports 64-bit linux, mac, and windows. For 32-bit, you need to build LLVM and Binaryen from source. However, that has gotten a lot easier since we switched to upstream LLVM, as the build instructions are just the usual upstream ones, https://emscripten.org/docs/building_from_source/index.html
(I realize you don't need 32-bit anymore, but commenting here for others that might read it.)
Most helpful comment
Seems the issue is in the
~/.emscriptenfile created byemscriptenat some point: it had a 64bitBINARYEN_ROOT. I edited the file and rebuilt all my test code, and it works now. This is what the file contains after I edited it:(before it was almost the same, but with
64bitinstead of32bit).