Emscripten: llvm instaled but not detected

Created on 11 May 2017  路  19Comments  路  Source: emscripten-core/emscripten

trying to build helloworld.c to web assembly, i get:

emcc hello.c -s WASM=1 -o hello.html
WARNING:root:(Emscripten: unknown: cannot concatenate 'str' and 'NoneType' objects, clearing cache)
CRITICAL:root:Could not verify LLVM version: argument of type 'NoneType' is not iterable
/home/elmapul/Downloads/Instaladores/emsdk/clang/e1.37.9_64bit/llc: relocation error: /home/elmapul/Downloads/Instaladores/emsdk/clang/e1.37.9_64bit/llc: symbol _ZNKSt3_V214error_category10_M_messageB5cxx11Ei, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference

CRITICAL:root:fastcomp in use, but LLVM has not been built with the JavaScript backend as a target, llc reports:

(no targets could be identified: need more than 1 value to unpack)

CRITICAL:root:you can fall back to the older (pre-fastcomp) compiler core, although that is not recommended, see http://kripken.github.io/emscripten-site/docs/building_from_source/LLVM-Backend.html
INFO:root:(Emscripten: Running sanity checks)

CRITICAL:root:failing sanity checks due to previous fastcomp failure

trying to call llvm from command line, it says not found.
but if i try to install it, it says already installed.

Most helpful comment

Hi there, I'm having similar issues. I downloaded and unpacked the package:

emsdk-portable.tar.gz

and I followed the instructions here:

http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#platform-notes-installation-instructions-sdk

I used the commands:

./emsdk update
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh

... in the root folder that I unpacked to. Once I'd done this, the file:

/home/pete/.emscripten

looked like this:

import os
LLVM_ROOT='/home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit'
EMSCRIPTEN_NATIVE_OPTIMIZER='/home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit/optimizer'
BINARYEN_ROOT='/home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit/binaryen'
NODE_JS='/home/pete/Programming/Emscripten/emsdk-portable/node/4.1.1_64bit/bin/node'
EMSCRIPTEN_ROOT='/home/pete/Programming/Emscripten/emsdk-portable/emscripten/1.37.22'
SPIDERMONKEY_ENGINE = ''
V8_ENGINE = ''
TEMP_DIR = '/tmp'
COMPILER_ENGINE = NODE_JS
JS_ENGINES = [NODE_JS]

When checking the version of ./emcc, I got the same output as above:

pete@PetesUbu:~/Programming/Emscripten/emsdk-portable/emscripten/1.37.22$ ./emcc -v
INFO:root:generating system asset: is_vanilla.txt... (this will be cached in "/home/pete/.emscripten_cache/is_vanilla.txt" for subsequent builds)
/home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit/llc: relocation error: /home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit/llc: symbol _ZNKSt3_V214error_category10_M_messageB5cxx11Ei, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference
INFO:root: - ok
WARNING:root:(Emscripten: unknown: cannot concatenate 'str' and 'NoneType' objects, clearing cache)
CRITICAL:root:Could not verify LLVM version: argument of type 'NoneType' is not iterable
/home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit/llc: relocation error: /home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit/llc: symbol _ZNKSt3_V214error_category10_M_messageB5cxx11Ei, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference
CRITICAL:root:fastcomp in use, but LLVM has not been built with the JavaScript backend as a target, llc reports:
===========================================================================
(no targets could be identified: need more than 1 value to unpack)
===========================================================================
CRITICAL:root:you can fall back to the older (pre-fastcomp) compiler core, although that is not recommended, see http://kripken.github.io/emscripten-site/docs/building_from_source/LLVM-Backend.html
INFO:root:(Emscripten: Running sanity checks)
CRITICAL:root:failing sanity checks due to previous fastcomp failure

The first warning looks to be python related, and I noticed python wasn't set up in the envirenment variables... so I added it to ./emscripten to look like this:

import os
LLVM_ROOT='/home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit'
EMSCRIPTEN_NATIVE_OPTIMIZER='/home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit/optimizer'
BINARYEN_ROOT='/home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit/binaryen'
NODE_JS='/home/pete/Programming/Emscripten/emsdk-portable/node/4.1.1_64bit/bin/node'
EMSCRIPTEN_ROOT='/home/pete/Programming/Emscripten/emsdk-portable/emscripten/1.37.22'
SPIDERMONKEY_ENGINE = ''
V8_ENGINE = ''
TEMP_DIR = '/tmp'
COMPILER_ENGINE = NODE_JS
JS_ENGINES = [NODE_JS]
PYTHON = 'python'

And I checked the version agian, to get this output:

pete@PetesUbu:~/Programming/Emscripten/emsdk-portable/emscripten/1.37.22$ ./emcc -v
WARNING:root:(Emscripten: settings file has changed, clearing cache)
CRITICAL:root:Could not verify LLVM version: argument of type 'NoneType' is not iterable
/home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit/llc: relocation error: /home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit/llc: symbol _ZNKSt3_V214error_category10_M_messageB5cxx11Ei, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference
CRITICAL:root:fastcomp in use, but LLVM has not been built with the JavaScript backend as a target, llc reports:
===========================================================================
(no targets could be identified: need more than 1 value to unpack)
===========================================================================
CRITICAL:root:you can fall back to the older (pre-fastcomp) compiler core, although that is not recommended, see http://kripken.github.io/emscripten-site/docs/building_from_source/LLVM-Backend.html
INFO:root:(Emscripten: Running sanity checks)
CRITICAL:root:failing sanity checks due to previous fastcomp failure

Any ideas what my next move is here? Cheers in advance,

Pete

All 19 comments

Looks like the LLVM defined in ~/.emscripten can't run due to that link error, the build may be incompatible with your local system. Might need to build llvm+clang locally.

@Elmapul Could you confirm whether below error matches with yours?
llvm_error

OS : windows 7
Visual Studio : 2015

@kripken Can you guide me for some workarounds?

Might need to build llvm+clang locally.
@kripken how to do it ?

@imvetri
looks like this:

CRITICAL:root:Could not verify LLVM version: argument of type 'NoneType' is not iterable
/home/elmapul/Downloads/Instaladores/emsdk/clang/e1.37.10_64bit/llc: relocation error: 
/home/elmapul/Downloads/Instaladores/emsdk/clang/e1.37.10_64bit/llc: symbol _ZNKSt3_V214error_category10_M_messageB5cxx11Ei, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference
CRITICAL:root:fastcomp in use, but LLVM has not been built with the JavaScript backend as a target, llc reports:
===========================================================================
(no targets could be identified: need more than 1 value to unpack)
===========================================================================
CRITICAL:root:you can fall back to the older (pre-fastcomp) compiler core, although that is not recommended, see http://kripken.github.io/emscripten-site/docs/building_from_source/LLVM-Backend.html
INFO:root:(Emscripten: Running sanity checks)
CRITICAL:root:failing sanity checks due to previous fastcomp failure


The last message looks like a mismatching libstdc++. To build latest Git repository content from source, try

./emsdk install --build=Release sdk-incoming-64bit binaryen-master-64bit
./emsdk activate --build=Release sdk-incoming-64bit binaryen-master-64bit
source ./emsdk_env.sh --build=Release
cd $EMSCRIPTEN
emcc -s WASM=1 tests/hello_world.c -o hello_world.html

Another thread suggested that we packaged LLVM with LDFLAGS=-static-libgcc -static-libstdc++ in environment variables, though I need to set up a local virtual Linux environment to verify the fix. Which Linux distribution are you on?

I am on windows

@juj im on Ubuntu 14.04

@Elmapul

Were you able to fix it? I have the exact same problem

If running on Windows, what does the following print out?

git clone https://github.com/juj/emsdk.git  (or download https://github.com/juj/emsdk/archive/master.zip and unzip to emsdk)
cd emsdk
emsdk install --build=Release sdk-incoming-64bit binaryen-master-64bit
emsdk activate --build=Release sdk-incoming-64bit binaryen-master-64bit
cd emscripten\incoming
where clang
clang -v
emcc -v
emcc -s WASM=1 tests/hello_world.c -o hello_world.html

See the attached log for an expected output. If you are seeing an issue, please paste a log for more diagnostic.

emsdk_install_log_windows.txt

I had exactly same problem in windows 10. clang -v didn't worked, printed out no errors etc in git bash.. but in windows command line, it showed popup errors about missing .dll files (api-ms-win-crt-* and also some other what I can't recall now). Finally got it working by installing Microsoft Visual studio 2015 redistributables (x64 & x86).

@PFCGeraldes
nope =/
i found another compiler, but it turns out that i still need this compiler.
using the other compiler i would need to adapt a lot of code to make it build.
and godot 3 is being developed with emscripten in mind

Hi there, I'm having similar issues. I downloaded and unpacked the package:

emsdk-portable.tar.gz

and I followed the instructions here:

http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#platform-notes-installation-instructions-sdk

I used the commands:

./emsdk update
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh

... in the root folder that I unpacked to. Once I'd done this, the file:

/home/pete/.emscripten

looked like this:

import os
LLVM_ROOT='/home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit'
EMSCRIPTEN_NATIVE_OPTIMIZER='/home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit/optimizer'
BINARYEN_ROOT='/home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit/binaryen'
NODE_JS='/home/pete/Programming/Emscripten/emsdk-portable/node/4.1.1_64bit/bin/node'
EMSCRIPTEN_ROOT='/home/pete/Programming/Emscripten/emsdk-portable/emscripten/1.37.22'
SPIDERMONKEY_ENGINE = ''
V8_ENGINE = ''
TEMP_DIR = '/tmp'
COMPILER_ENGINE = NODE_JS
JS_ENGINES = [NODE_JS]

When checking the version of ./emcc, I got the same output as above:

pete@PetesUbu:~/Programming/Emscripten/emsdk-portable/emscripten/1.37.22$ ./emcc -v
INFO:root:generating system asset: is_vanilla.txt... (this will be cached in "/home/pete/.emscripten_cache/is_vanilla.txt" for subsequent builds)
/home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit/llc: relocation error: /home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit/llc: symbol _ZNKSt3_V214error_category10_M_messageB5cxx11Ei, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference
INFO:root: - ok
WARNING:root:(Emscripten: unknown: cannot concatenate 'str' and 'NoneType' objects, clearing cache)
CRITICAL:root:Could not verify LLVM version: argument of type 'NoneType' is not iterable
/home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit/llc: relocation error: /home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit/llc: symbol _ZNKSt3_V214error_category10_M_messageB5cxx11Ei, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference
CRITICAL:root:fastcomp in use, but LLVM has not been built with the JavaScript backend as a target, llc reports:
===========================================================================
(no targets could be identified: need more than 1 value to unpack)
===========================================================================
CRITICAL:root:you can fall back to the older (pre-fastcomp) compiler core, although that is not recommended, see http://kripken.github.io/emscripten-site/docs/building_from_source/LLVM-Backend.html
INFO:root:(Emscripten: Running sanity checks)
CRITICAL:root:failing sanity checks due to previous fastcomp failure

The first warning looks to be python related, and I noticed python wasn't set up in the envirenment variables... so I added it to ./emscripten to look like this:

import os
LLVM_ROOT='/home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit'
EMSCRIPTEN_NATIVE_OPTIMIZER='/home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit/optimizer'
BINARYEN_ROOT='/home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit/binaryen'
NODE_JS='/home/pete/Programming/Emscripten/emsdk-portable/node/4.1.1_64bit/bin/node'
EMSCRIPTEN_ROOT='/home/pete/Programming/Emscripten/emsdk-portable/emscripten/1.37.22'
SPIDERMONKEY_ENGINE = ''
V8_ENGINE = ''
TEMP_DIR = '/tmp'
COMPILER_ENGINE = NODE_JS
JS_ENGINES = [NODE_JS]
PYTHON = 'python'

And I checked the version agian, to get this output:

pete@PetesUbu:~/Programming/Emscripten/emsdk-portable/emscripten/1.37.22$ ./emcc -v
WARNING:root:(Emscripten: settings file has changed, clearing cache)
CRITICAL:root:Could not verify LLVM version: argument of type 'NoneType' is not iterable
/home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit/llc: relocation error: /home/pete/Programming/Emscripten/emsdk-portable/clang/e1.37.22_64bit/llc: symbol _ZNKSt3_V214error_category10_M_messageB5cxx11Ei, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference
CRITICAL:root:fastcomp in use, but LLVM has not been built with the JavaScript backend as a target, llc reports:
===========================================================================
(no targets could be identified: need more than 1 value to unpack)
===========================================================================
CRITICAL:root:you can fall back to the older (pre-fastcomp) compiler core, although that is not recommended, see http://kripken.github.io/emscripten-site/docs/building_from_source/LLVM-Backend.html
INFO:root:(Emscripten: Running sanity checks)
CRITICAL:root:failing sanity checks due to previous fastcomp failure

Any ideas what my next move is here? Cheers in advance,

Pete

                                  Thank
                 you.

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.

I do Have a Similar kind of issue, any work around?

[root@localhost gcc-9.1.0]# emcc -v
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 1.39.3
clang version 10.0.0 (/b/s/w/ir/cache/git/chromium.googlesource.com-external-github.com-llvm-llvm--project cb47b8783017a76c5f2e4b974cfd6b22c9f1d5ff)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /root/emsdk/upstream/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
shared:WARNING: LLVM version appears incorrect (seeing "10.0", expected "6.0")
shared:CRITICAL: fastcomp in use, but LLVM has not been built with the JavaScript backend as a target, llc reports:
===========================================================================

    wasm32 - WebAssembly 32-bit
    wasm64 - WebAssembly 64-bit
    x86    - 32-bit X86: Pentium-Pro and above
    x86-64 - 64-bit X86: EM64T and AMD64

===========================================================================
shared:ERROR: failing sanity checks due to previous llvm failure

@linuxserver2016 can you run that command with EMCC_DEBUG=1. In particular I'd like to know why fastcomp in use is being reported. It should be choosing to use the llvm backend.

This is from a clean Debian Stretch via Docker:

$ emsdk install 1.39.5
$ emsdk activate 1.39.5
$ source emsdk_env.sh
$ EMCC_DEBUG=1 emcc -v
shared:DEBUG: EM_CONFIG is located in /root/.emscripten
shared:DEBUG: JAVA not defined in /root/.emscripten, using "java"
cache:DEBUG: PID 4371 acquiring multiprocess file lock to Emscripten cache at /root/.emscripten_cache
cache:DEBUG: done
cache:DEBUG: PID 4371 released multiprocess file lock to Emscripten cache at /root/.emscripten_cache
shared:DEBUG: check tells us to use asm.js backend
emcc:WARNING: invocation: /emsdk/upstream/emscripten/emcc.py -v  (in /trail/pigeoneer/build/tmp)
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 1.39.5
clang version 10.0.0 (/b/s/w/ir/cache/git/chromium.googlesource.com-external-github.com-llvm-llvm--project be2b7ea89ab43d6827634fbdbbd2661e1f242527)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /emsdk/upstream/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.3.0
shared:DEBUG: executed /emsdk/upstream/bin/clang -v
shared:DEBUG: successfully executed /emsdk/upstream/bin/clang++ --version
shared:WARNING: LLVM version appears incorrect (seeing "10.0", expected "6.0")
root:DEBUG: Checking JS engine ['/emsdk/node/12.9.1_64bit/bin/node']
shared:DEBUG: successfully executed /emsdk/node/12.9.1_64bit/bin/node --version
shared:DEBUG: successfully executed /emsdk/upstream/bin/llc --version
shared:CRITICAL: fastcomp in use, but LLVM has not been built with the JavaScript backend as a target, llc reports:
===========================================================================

    wasm32 - WebAssembly 32-bit
    wasm64 - WebAssembly 64-bit
    x86    - 32-bit X86: Pentium-Pro and above
    x86-64 - 64-bit X86: EM64T and AMD64

===========================================================================
shared:ERROR: failing sanity checks due to previous llvm failure

1.39.5-fastcomp seems to work fine.

The suspicious thing there is "check tells us to use asm.js backend". This means that the /root/.emscripten_cache/is_vanilla.txt file is saying that you are using fastcomp and not the llvm backend.

Can you run ./emcc --clear-cache and try again? If you are insteresed in debugging this you could also cat /root/.emscripten_cache/is_vanilla.txt beforehand. Normally this file gets regenerted when you configure a new SDK (is looks at the timestamp of /root/.emscripten).

If you can reliably reproduce this using a docker commands could you post them so that I can reproduce it and fix it?

Sure!

Steps to reproduce:

$ docker run -it --rm debian:stretch /bin/bash
$ apt-get update
$ apt-get install -y git python
$ git clone https://github.com/emscripten-core/emsdk.git
$ cd emsdk
$ ./emsdk install 1.39.5
$ ./emsdk activate 1.39.5
$ source emsdk_env.sh
$ emcc -v
# See that libxml2 is missing! (important)
$ apt-get install -y libxml2
$ emcc -v

Thanks! Got a fix on the way for that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

answer1103 picture answer1103  路  4Comments

JCash picture JCash  路  3Comments

kripken picture kripken  路  4Comments

rpellerin picture rpellerin  路  3Comments

juj picture juj  路  3Comments