2016-09-17 16:39:34 +03:00
< a target = "_blank" href = "https://travis-ci.org/root-mirror/cling" >
2016-09-17 16:51:49 +03:00
![Travis status ](https://travis-ci.org/root-mirror/cling.svg?branch=master )
2016-09-17 16:39:34 +03:00
< / a >
< a target = "_blank" href = "https://ci.appveyor.com/project/vgvassilev/cling-j0wdg" >
2016-09-17 16:51:49 +03:00
![Appveyor status ](https://ci.appveyor.com/api/projects/status/github/vgvassilev/cling?svg=true&branch=master )
2016-09-17 16:39:34 +03:00
< / a >
2012-09-05 13:37:39 +04:00
2016-08-05 16:10:24 +03:00
Cling - The Interactive C++ Interpreter
=========================================
2014-09-25 22:44:22 +04:00
2016-08-05 15:57:56 +03:00
2016-08-05 16:10:24 +03:00
Overview
--------
2016-08-05 15:57:56 +03:00
Cling is an interactive C++ interpreter, built on top of Clang and LLVM compiler
infrastructure. Cling realizes 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
as the praised concise and expressive compiler diagnostics.
2014-05-30 13:02:36 +04:00
2016-08-05 16:10:24 +03:00
See also [cling's web page. ](https://cdn.rawgit.com/root-mirror/cling/master/www/index.html )
2016-08-05 15:57:56 +03:00
Please note that some of the resources are rather old and most of the stated
limitations are outdated.
2016-07-22 12:17:40 +03:00
* [talks ](www/docs/talks )
2014-08-04 06:05:42 +04:00
* http://blog.coldflake.com/posts/2012-08-09-On-the-fly-C++.html
* http://solarianprogrammer.com/2012/08/14/cling-cpp-11-interpreter/
* https://www.youtube.com/watch?v=f9Xfh8pv3Fs
* https://www.youtube.com/watch?v=BrjV1ZgYbbA
* https://www.youtube.com/watch?v=wZZdDhf2wDw
* https://www.youtube.com/watch?v=eoIuqLNvzFs
2014-05-30 13:02:36 +04:00
2016-08-05 15:57:56 +03:00
2016-08-05 16:10:24 +03:00
Installation
------------
### Release Notes
See our [release notes ](docs/ReleaseNotes.md ) to find what's new.
2016-08-05 15:57:56 +03:00
2016-08-05 16:10:24 +03:00
### Binaries
2016-08-05 15:57:56 +03:00
Our nightly binary snapshots can be found
2016-08-07 21:47:59 +03:00
[here ](https://root.cern.ch/download/cling/ ).
2016-08-05 15:57:56 +03:00
2012-09-05 13:37:39 +04:00
2016-08-05 15:48:18 +03:00
### Building from Source with Cling Packaging Tool
2014-08-16 14:07:20 +04:00
Cling's tree has a user-friendly, command-line utility written in Python called
Cling Packaging Tool (CPT) which can build Cling from source and generate
2016-08-05 15:57:56 +03:00
installer bundles for a wide range of platforms. CPT requires Python 2.7 or
later.
2014-08-16 14:07:20 +04:00
If you have Cling's source cloned locally, you can find the tool in
2016-08-05 15:57:56 +03:00
`tools/packaging` directory. Alternatively, you can download the script
manually, or by using `wget` :
2014-08-16 14:07:20 +04:00
```sh
2016-01-07 17:58:40 +03:00
wget https://raw.githubusercontent.com/root-mirror/cling/master/tools/packaging/cpt.py
2014-08-16 14:07:20 +04:00
chmod +x cpt.py
2016-08-05 15:48:18 +03:00
./cpt.py --check-requirements & & ./cpt.py --create-dev-env Debug --with-workdir=./cling-build/
2014-08-16 14:07:20 +04:00
```
2016-08-05 17:54:25 +03:00
Full documentation of CPT can be found in [tools/packaging ](tools/packaging ).
2016-08-05 16:10:24 +03:00
2016-08-07 20:20:59 +03:00
Usage
-----
2016-04-09 12:27:14 +03:00
```c++
2016-08-07 20:20:59 +03:00
./cling '#include < stdio.h > ' 'printf("Hello World!\n")'`
2016-04-09 12:27:14 +03:00
```
To get started run:
```bash
2016-08-07 20:20:59 +03:00
./cling --help`
2016-04-09 12:27:14 +03:00
```
or type
```
2016-08-07 20:20:59 +03:00
./cling
2016-04-09 12:27:14 +03:00
[cling]$ .help`
```
2014-03-04 18:23:17 +04:00
2016-08-05 15:57:56 +03:00
2016-08-05 16:10:24 +03:00
Jupyter
-------
2016-08-05 15:57:56 +03:00
Cling comes with a [Jupyter ](http://jupyter.org ) kernel. After building cling,
install Jupyter and run `jupyter kernelspec install cling` . It requires a fairly
new Jupyter. Make sure cling is in your PATH when you start jupyter!
2016-01-07 17:58:40 +03:00
2016-08-05 15:57:56 +03:00
See also the [tools/Jupyter ](tools/Jupyter ) subdirectory for more information.
2016-04-09 12:27:14 +03:00
2016-01-07 17:58:40 +03:00
2016-08-05 16:10:24 +03:00
Developers' Corner
==================
[Cling's latest doxygen documentation ](http://cling.web.cern.ch/cling/doxygen/ )
2016-08-05 15:57:56 +03:00
2016-01-07 17:58:40 +03:00
2016-08-05 16:10:24 +03:00
Contributions
-------------
2016-08-07 19:45:08 +03:00
Every contribution is considered a donation and its copyright and any other
related rights become exclusive ownership of the person who merged the code or
in any other case the main developers of the "Cling Project".
We warmly welcome external contributions to the Cling! By providing code,
you agree to transfer your copyright on the code to the "Cling project".
Of course you will be duly credited and your name will appear on the
contributors page, the release notes, and in the [CREDITS file ](CREDITS.txt )
shipped with every binary and source distribution. The copyright transfer is
necessary for us to be able to effectively defend the project in case of
litigation.
2016-08-05 16:30:57 +03:00
License
-------
Please see our [LICENSE ](LICENSE.TXT ).
2016-08-09 22:10:36 +03:00
Releases
--------
Our release steps to follow when cutting a new release:
1. Update [release notes ](docs/ReleaseNotes.md )
2016-08-09 22:44:01 +03:00
2. Remove `~dev` suffix from [VERSION ](VERSION )
2016-08-09 22:10:36 +03:00
3. Add a new entry in the news section of our [website ](www/news.html )
4. Commit the changes.
5. `git tag -a v0.x -m "Tagging release v0.x"`
6. Create a draft release in github and copy the contents of the release notes.
7. Wait for green builds.
8. Upload binaries to github (Travis should do this automatically).
9. Publish the tag and announce it on the mailing list.
10. Increment the current version and append `~dev` .