From 3a9ada1138701898259cde68cfea5f95a5c2367d Mon Sep 17 00:00:00 2001 From: LiAuTraver <63725840+LiAuTraver@users.noreply.github.com> Date: Thu, 11 Jul 2024 14:30:10 +0800 Subject: [PATCH] Update build guide for cling (#15972) --- README.md | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 7015dbf199..f5edb7f1c7 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 +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 ' 'printf("Hello World!\n")' +Assuming we're in the build folder: +```bash +./bin/cling '#include ' 'printf("Hello World!\n")' ``` To get started run: ```bash -./cling --help +./bin/cling --help ``` -or type -``` -./cling +or +```bash +./bin/cling [cling]$ .help ```