Skip to content

Commit

Permalink
Update build guide for cling (#15972)
Browse files Browse the repository at this point in the history
  • Loading branch information
LiAuTraver authored and jenkins committed Jul 11, 2024
1 parent 3e59d62 commit 3a9ada1
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The main repository is at [https://github.com/root-project/cling](https://github
Overview
--------
Cling is an interactive C++ interpreter, built on top of Clang and LLVM compiler
infrastructure. Cling realizes the [read-eval-print loop
infrastructure. Cling implements the [read-eval-print loop
(REPL)](http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop)
concept, in order to leverage rapid application development. Implemented as a
small extension to LLVM and Clang, the interpreter reuses their strengths such
Expand All @@ -33,35 +33,38 @@ See our [release notes](docs/ReleaseNotes.md) to find what's new.


### Binaries
Our nightly binary snapshots can be found
[here](https://root.cern.ch/download/cling/).
Our nightly binary snapshots are currently unavailable.


### Building from Source

```sh
```bash
git clone https://github.com/root-project/llvm-project.git
cd llvm-project
git checkout cling-latest
cd ../
git clone <cling>
cd ..
git clone https://github.com/root-project/cling.git
mkdir cling-build && cd cling-build
cmake -DLLVM_EXTERNAL_PROJECTS=cling -DLLVM_EXTERNAL_CLING_SOURCE_DIR=../cling/ -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_TARGETS_TO_BUILD="host;nvptx" ../llvm-project/llvm
cmake -DLLVM_EXTERNAL_PROJECTS=cling -DLLVM_EXTERNAL_CLING_SOURCE_DIR=../cling/ -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_TARGETS_TO_BUILD="host;NVPTX" -DCMAKE_BUILD_TYPE=Release ../llvm-project/llvm
cmake --build . --target cling
```

See also the instructions [on the webpage](https://root.cern/cling/cling_build_instructions/).

Usage
-----
```c++
./cling '#include <stdio.h>' 'printf("Hello World!\n")'
Assuming we're in the build folder:
```bash
./bin/cling '#include <stdio.h>' 'printf("Hello World!\n")'
```

To get started run:
```bash
./cling --help
./bin/cling --help
```
or type
```
./cling
or
```bash
./bin/cling
[cling]$ .help
```

Expand Down

0 comments on commit 3a9ada1

Please sign in to comment.