Cling Download
Description: Official Website of Cling
Keywords: download cling, svn, make, build

# Cling Website

## Interactive Compiler Interface

- Home
- Download
- News
- Docs
  Documentation
  Developer
  - Doxygen
  - Extensions
  - Error Recovery
  - Late Binding
  End User
  - User Manual
  - Status of ObjectiveC[++]
- Get Involved

# Download & Build Instructions

This page is shows how to download and build the project cling as a standalone C++ interpreter in few steps

If you want to download and build cling within ROOT please follow the tutorial here

## Build

### Unix systems

Prerequisites
- See Getting Started with the LLVM System - Requirements
- Note also that Python is needed for running the test suite. Get it at: http://www.python.org/download

1. Checkout LLVM:

       svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm/src

2. Checkout Clang:

       cd llvm/src/tools/
       svn co http://llvm.org/svn/llvm-project/cfe/trunk clang

3. Checkout Cling (next to clang):

       svn co http://root.cern.ch/svn/root/branches/dev/cling cling

4. Allow Cling to hook into LLVM's build system:

       cat tools/cling/patches/*.diff | patch -p0

5. Configure in your build folder (preferably out of the source code). For example:

       cd ../../obj
       ../src/configure --prefix=Where\to\be\installed\

6. Now compile and install:

       make && make install

The executables could be found in your installation folder.

### Using Visual Studio

Prerequisites
- Subversion client - http://subversion.tigris.org/getting.html
- cmake - http://www.cmake.org/cmake/resources/software.html
- Python - http://www.python.org/download/
- GnuWin32 Tools - http://getgnuwin32.sourceforge.net/
- Visual Studio - VS Express should work as well

1. Checkout LLVM

       svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm/src/

2. Checkout Clang

       cd llvm\src\tools\
       svn co http://llvm.org/svn/llvm-project/cfe/trunk clang

3. Checkout Cling (next to Clang)

       svn co http://root.cern.ch/svn/root/branches/dev/cling cling

4. Allow Cling to hook into LLVM's build system: apply the two patches located in the cling\patches folder.
5. Open up cmake and enter the path to the 'src' folder in the 'Where is the source code' field and the path to the 'build' folder in the 'Where to build the binaries' field (mkdir llvm\obj - next to src).
6. Click the Configure button and in the newly popped up window choose Visual Studio version that you have, then click Finish.
7. After the configuring completes many red entries should appear in the Cmake window. You may want to change CMAKE_INSTALL_PREFIX to 'inst' (next to next to src and obj, otherwise the default is Program Files). Click Generate.
   Note: You may have to do it twice (on 2.8.5) in case after clicking Generate the box is still red.
8. Navigate to your 'build' folder and open LLVM.sln using Visual Studio and build it.
9. Navigate to CMakePredefined project in Visual Studio and right click INSTALL. Choose Project Only -> Build only INSTALL.

The executables could be found in your CMAKE_INSTALL_PREFIX/bin/

More information about cmake in LLVM and Clang could be found here and here.