ChakraCore cannot build on Ubuntu 15.10 (x64)

Created on 2 May 2016  Â·  12Comments  Â·  Source: chakra-core/ChakraCore

Followed the information at http://ariya.ofilabs.com/2016/01/playing-with-chakracore-on-linux.html
except that I use virtualbox as the VM and install the ubuntu15.10 from http://releases.ubuntu.com/15.10/

the error message I am seeing is:

c++: error: unrecognized command line option ‘-fdelayed-template-parsing’

pal/src/CMakeFiles/Chakra.Pal.dir/build.make:54: recipe for target 'pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/file.cpp.o' failed

make[2]: *** [pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/file.cpp.o] Error 1

CMakeFiles/Makefile2:90: recipe for target 'pal/src/CMakeFiles/Chakra.Pal.dir/all' failed

make[1]: *** [pal/src/CMakeFiles/Chakra.Pal.dir/all] Error 2

Makefile:116: recipe for target 'all' failed

make: *** [all] Error 2

Build Bug Linux

Most helpful comment

With @obastemur's PR #913 now merged in, cmake 3.5 is no longer needed either so it should build fine with Ubuntu 15.10.

All 12 comments

@flyboy9 you need clang++3.7+

sudo apt-add-repository "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.7 main"
sudo apt-get update
wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|sudo apt-key add -
sudo apt-get install clang++-3.7

You also need libicu

sudo apt-get install libicu-dev

It may ask you to install couple of more packages.

Check if you have clang++ on the path ? Otherwise

sudo ln -s /usr/bin/clang++-3.7 /usr/bin/clang++
sudo ln -s /usr/bin/clang-3.7 /usr/bin/clang

if you don't want to do that, you may set clang location using build.sh

./build.sh --cxx=/usr/bin/clang++-3.7 --cc=/usr/bin/clang-3.7

please let me know, so I can update this comment (eventually wiki)

hmm, followed you instruction, still seeing the same error

@obastemur
ling@ling-VirtualBox:~/Desktop/code/ChakraCore$ cmake . && make
Detected Linux x86_64
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ling/Desktop/code/ChakraCore
[ 1%] Building CXX object pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/file.cpp.o
c++: error: unrecognized command line option ‘-fdelayed-template-parsing’
pal/src/CMakeFiles/Chakra.Pal.dir/build.make:54: recipe for target 'pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/file.cpp.o' failed
make[2]: ** [pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/file.cpp.o] Error 1
CMakeFiles/Makefile2:90: recipe for target 'pal/src/CMakeFiles/Chakra.Pal.dir/all' failed
make[1]: *
* [pal/src/CMakeFiles/Chakra.Pal.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2
ling@ling-VirtualBox:~/Desktop/code/ChakraCore$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
ling@ling-VirtualBox:~/Desktop/code/ChakraCore$ sudo ln -s /usr/bin/clang-3.7 /usr/bin/clang
ln: failed to create symbolic link ‘/usr/bin/clang’: File exists
ling@ling-VirtualBox:~/Desktop/code/ChakraCore$ ./builds --cxx=/usr/bin/clang++-3.7 --cc=/usr/bin/clang-3.7
-bash: ./builds: No such file or directory
ling@ling-VirtualBox:~/Desktop/code/ChakraCore$ git branch

  • linux
    master
    ling@ling-VirtualBox:~/Desktop/code/ChakraCore$ git status
    On branch linux
    Your branch is up-to-date with 'origin/linux'.
    nothing to commit, working directory clean
    ling@ling-VirtualBox:~/Desktop/code/ChakraCore$

Question: is there a way for me to verify if the necessary develop environment is set up correctly?

ling@ling-VirtualBox:~/Desktop/code/ChakraCore$ cmake . && make

Could you use build.sh option above with the explicit location for clang, and clang++ ?

update: -bash: ./builds: No such file or directory could you try build.sh instead ?

from the long you have: ln: failed to create symbolic link ‘/usr/bin/clang’: File exists

where do you have the clang, and clang++ ?

update: and version of the clang installed ? clang -v ?

I also had difficulty building on Ubuntu 15.10. @digitalinfinity suggested that the version of cmake might be a problem. I tried to install the latest but ultimately updated to 16.04 LTS which included cmake 3.5.2, and was able to get a successful build.

With @obastemur's PR #913 now merged in, cmake 3.5 is no longer needed either so it should build fine with Ubuntu 15.10.

@flyboy9 can you confirm that you're able to build and then we'll close this issue? :)

I've just compiled ChakraCore on a new VM with the steps below;

  • Visited http://releases.ubuntu.com/ and download latest LTS! (x64)
    How or to where you have installed doesn't make much difference.
    !Keep in mind you will need an internet connection on this VM
  • Once you have Ubuntu is installed open a terminal window and start the update process
    Ø sudo apt-get update
    Ø sudo apt-get dist-upgrade
  • Make sure you have git is installed
    Ø sudo apt-get install -y git
  • Get the latest ChakraCore source code (ReadOnly option - Use your fork instead of Microsoft)
    Ø mkdir Github && cd Github
    Ø git clone https://github.com/Microsoft/ChakraCore
  • The next step is to install some useful packages for better development experience (OPTIONAL)
    Ø sudo apt-get install -y meld
    Ø To install VSCode visit https://code.visualstudio.com/Docs/editor/setup#_linux
  • Time to install dependencies
    Ø sudo apt-get install -y build-essential cmake clang uuid-dev libunwind-dev libicu-dev liblttng-ust-dev
  • Let's build
    Ø cd ChakraCore
    Ø git checkout linux
  • Finally
    Ø ./build.sh

Closing this issue for now. In case you are unable to compile using the steps above feel free to open this issue back. Thanks for all the details!

@Microsoft/chakra-developers what is the best way to share these steps above from our wiki on Github?

@obastemur : @liminzhu might be able to provide more guidance or integrate this into the wiki in an appropriate place.

// thanks for cc'ing me @dilijev

Great stuff @obastemur ! I was actually looking for such a guide. The most logical place in the current wiki would be Building ChakraCore and have a linux block in it. I can test it out today and add the guide there.

@liminzhu sounds great. Thanks!

@obastemur Just add the guide there with slight tweaks of words.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

basdl picture basdl  Â·  3Comments

tommyZZM picture tommyZZM  Â·  5Comments

d3x0r picture d3x0r  Â·  5Comments

dilijev picture dilijev  Â·  6Comments

kunalspathak picture kunalspathak  Â·  4Comments