[Newbie] Getting started with emsdk on Ubuntu 15.04 64 bit

239 views
Skip to first unread message

Flix

unread,
Oct 17, 2015, 9:03:07 AM10/17/15
to emscripten-discuss
Hi everybody.

I'd like to be able to compile the hello_word tutorial on Ubuntu.

What I've tried so far is:
1) Downloading emscripten 1.2 from Synaptic => not working.

I removed it and downloaded emsdk looking for an embedded and portable (or better "movable") installation.
Then I tried:
2) ./emsdk install emscripten-1.34.1
./emsdk activate --embedded emscripten-1.34.1
 But after that and after setting the new $PATH environment variables, emcc -v gave me an error similiar to 1).
3) ./emsdk ununstall emscripten-1.34.1
./emsdk install sdk-tag-1.34.1-64bit
After nearly a hour (where my 4 cores went more than 70° C hot) I could write:
./emsdk activate --embedded sdk-tag-1.34.1-64bit
I saw that in the new $PATH now was present the path of Clang3.7 and I thought: now it should work, but after setting the new $PATH, emcc -v still gives me a similiar error to 1) and 2):

 WARNING  root: (Emscripten: system change: 1.34.1|asmjs-unknown-emscripten|/usr/bin|3.6 vs 1.22.1|le32-unknown-nacl|/usr/bin|3.6.0-2ubuntu1, clearing cache)
WARNING  root: LLVM version appears incorrect (seeing "3.6", expected "3.7")
CRITICAL root: fastcomp in use, but LLVM has not been built with the JavaScript backend as a target, llc reports:
===========================================================================
LLVM (http://llvm.org/):
  LLVM version 3.6.0
 
  Optimized build.
  Built Mar 13 2015 (21:22:31).
  Default target: x86_64-pc-linux-gnu
  Host CPU: core-avx2

  Registered Targets:
    aarch64    - AArch64 (little endian)
    aarch64_be - AArch64 (big endian)
    amdgcn     - AMD GCN GPUs
    arm        - ARM
    arm64      - ARM64 (little endian)
    armeb      - ARM (big endian)
    cpp        - C++ backend
    hexagon    - Hexagon
    mips       - Mips
    mips64     - Mips64 [experimental]
    mips64el   - Mips64el [experimental]
    mipsel     - Mipsel
    msp430     - MSP430 [experimental]
    nvptx      - NVIDIA PTX 32-bit
    nvptx64    - NVIDIA PTX 64-bit
    ppc32      - PowerPC 32
    ppc64      - PowerPC 64
    ppc64le    - PowerPC 64 LE
    r600       - AMD GPUs HD2XXX-HD6XXX
    sparc      - Sparc
    sparcv9    - Sparc V9
    systemz    - SystemZ
    thumb      - Thumb
    thumbeb    - Thumb (big endian)
    x86        - 32-bit X86: Pentium-Pro and above
    x86-64     - 64-bit X86: EM64T and AMD64
    xcore      - XCore
===========================================================================
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

Basically what I think is happening is that emcc still uses the system Clang3.6, instead the new compiled version 3.7, even if its bin path has been added to $PATH.

Any hint please ?



Aidan Hobson Sayers

unread,
Oct 17, 2015, 9:53:18 AM10/17/15
to emscripte...@googlegroups.com

I'm not clear from your message, have you sourced 'emsdk_env.sh' or not?

That will set up your environment and path correctly.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Flix

unread,
Oct 17, 2015, 11:28:29 AM10/17/15
to emscripten-discuss

Solved!

I had to delete all the files in my HOME directory starting with .emscripten and rerun (twice): ./emcc -v.
Now my output is:


    INFO     root: (Emscripten: Running sanity checks)
    emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 1.34.1
    clang version 3.7.0
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
    Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.2
    Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.0.1
    Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
    Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.2
    Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.0.1
    Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
    Candidate multilib: .;@m64
    Selected multilib: .;@m64

    INFO     root: (Emscripten: Running sanity checks)


 However I think it's not possible to have an embedded and movable emscripten installation, since now I got new ".emscripten files" in my HOME folder (and thus: emsdk activate --embedded XXX, that should create a "local" configuration, becomes useless).

Floh

unread,
Oct 17, 2015, 6:20:51 PM10/17/15
to emscripten-discuss
AFAIK, if you use the --embedded installation option you also need to call emcc etc. with the --em-config option to tell the tools where the .emscripten file is.

If you're just getting started with emscripten I would recommend not installing with --embedded, this is only really useful if you need to manage several emscripten installations in parallel on the same machine.

Cheers,
-Floh

Flix

unread,
Oct 18, 2015, 8:42:06 AM10/18/15
to emscripten-discuss

AFAIK, if you use the --embedded installation option you also need to call emcc etc. with the --em-config option to tell the tools where the .emscripten file is.
If you're just getting started with emscripten I would recommend not installing with --embedded, this is only really useful if you need to manage several emscripten installations in parallel on the same machine.

Good to know. However now I'm still using the .emscripten file in the $HOME.
My main concern was the presence of an incompatible Clang on my system and the (non-working) emscripten 1.22 package I had installed (and then removed).

Now I must set the $PATH variable (as described in the emsdk) manually and then I can still use .emscripten in my home folder.
That's good for me (an official, working, system-wide, emsdk for Ubuntu would probably be better but I'm still happy this way).

Thank you all for your answers (and to emscripten's developers that are putting such a big effort in this project!).

Jukka Jylänki

unread,
Oct 20, 2015, 1:36:56 PM10/20/15
to emscripte...@googlegroups.com
In your earlier email, you wrote that you installed "./emsdk install emscripten-1.34.1". However, that is not the complete compiler toolchain, but it's only the emscripten package. See the README.md, or latest version of the README online at https://github.com/juj/emsdk , or try e.g. the following:

./emsdk install sdk-master-64bit
./emsdk activate sdk-master-64bit     # This sets up .emscripten, only needed once to change the sdk.
source ./emsdk_env.sh                      # This adds to $PATH, but only for this shell, e.g. after you start a new shell instance, you need to do this again (or set your profile)
which emcc
which clang
emcc -v
clang -v

This should find emcc and clan under emsdk path, and print Emscripten 1.35.0 and Clang 3.7.0.

--
Reply all
Reply to author
Forward
0 new messages