First iterations comments/suggestions.
This commit is contained in:
parent
78e082199d
commit
ca884c0cb9
@ -1,6 +1,10 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
|
||||
<link rel="stylesheet" href="http://cdn.jsdelivr.net/highlight.js/9.2.0/styles/railscasts.min.css">
|
||||
<script src="http://cdn.jsdelivr.net/highlight.js/9.2.0/highlight.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
<head>
|
||||
<title>Cling Website</title>
|
||||
<meta name="description" content="Official website of Cling" />
|
||||
@ -24,8 +28,8 @@
|
||||
<div id="mainmenubar">
|
||||
<ul id="mainmenu">
|
||||
<!-- put class="selected" in the li tag for the selected page - to highlight which page you're on -->
|
||||
<li class="selected"><a class="tab_link" href="newindex.html">Home</a></li>
|
||||
<li><a class="tab_link" href="build.html">Build</a></li>
|
||||
<li><a class="tab_link" href="newindex.html">Home</a></li>
|
||||
<li class="selected"><a class="tab_link" href="build.html">Build</a></li>
|
||||
<li><a class="tab_link" href="contribute.html">Contribuite</a></li>
|
||||
<li><a class="tab_link" href="jupyter.html">Jupyter</a></li>
|
||||
</ul>
|
||||
@ -57,9 +61,7 @@
|
||||
|
||||
You can download and run this <a href= "https://raw.githubusercontent.com/karies/cling-all-in-one/master/clone.sh" target="_blank">build script</a>.
|
||||
|
||||
<h3> Manual build </h3>
|
||||
|
||||
Alternatively, you can build manually.
|
||||
<h3> Building with CMake </h3>
|
||||
|
||||
<ul><b>Prerequisites</b>
|
||||
<li>See <a href="http://llvm.org/docs/GettingStarted.html#requirements" target="_blank">Getting Started with the LLVM System - Requirements</a>
|
||||
@ -67,8 +69,16 @@
|
||||
<li>
|
||||
Note also that <a href= "http://www.python.org/download" target = "_blank" >Python</a> is needed for running the test suite.
|
||||
</li>
|
||||
<br/>
|
||||
<b> And extra for Windows</b>
|
||||
<li><b>cmake</b> - http://www.cmake.org/cmake/resources/software.html</li>
|
||||
<li><b>Python</b> - http://www.python.org/download/</li>
|
||||
<li><b>GnuWin32 Tools</b> - http://getgnuwin32.sourceforge.net/</li>
|
||||
<li><b>Visual Studio</b> - <a href="http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express" target="_blank">VS Express should work as well</a></li>
|
||||
</ul>
|
||||
<pre>
|
||||
|
||||
<p>Start by checking out llvm, clang and cling: </p>
|
||||
<pre><code>
|
||||
git clone http://root.cern.ch/git/llvm.git src
|
||||
cd src
|
||||
git checkout cling-patches
|
||||
@ -77,65 +87,23 @@ git clone http://root.cern.ch/git/cling.git
|
||||
git clone http://root.cern.ch/git/clang.git
|
||||
cd clang
|
||||
git checkout cling-patches
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Now follow the procedure described at the clang web page (link is external) for ./configure --enable-cxx11; make- or CMake-based build instructions.
|
||||
Don't forget to make install. You will get a binary called cling: that's your interactive C++ interpreter!
|
||||
</code></pre>
|
||||
|
||||
<p>
|
||||
Now follow the procedure described at the <a href = "http://clang.llvm.org/get_started.html" target = "_blank">clang web page</a> for ./configure --enable-cxx11; make- or CMake-based build instructions.
|
||||
Don't forget to make install. You will get a binary called cling: that's your interactive C++ interpreter!
|
||||
</p>
|
||||
<pre>make && make install</pre>
|
||||
|
||||
<p>The executables could be found in your installation folder.
|
||||
</p>
|
||||
|
||||
<p> Then use CMake to configure & build cling: </p>
|
||||
|
||||
|
||||
<h3>Building with CMake (e.g. on Windows)</h3>
|
||||
|
||||
<ul><b><i>Prerequisites</i></b>
|
||||
<li><b>Subversion client</b> - http://subversion.tigris.org/getting.html</li>
|
||||
<li><b>cmake</b> - http://www.cmake.org/cmake/resources/software.html</li>
|
||||
<li><b>Python</b> - http://www.python.org/download/</li>
|
||||
<li><b>GnuWin32 Tools</b> - http://getgnuwin32.sourceforge.net/</li>
|
||||
<li><b>Visual Studio</b> - <a href="http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express" target="_blank">VS Express should work as well</a></li>
|
||||
</ul>
|
||||
|
||||
<p> As previously described, clone llvm, clang, and cling: </p>
|
||||
|
||||
<pre>
|
||||
git clone http://root.cern.ch/git/llvm.git src
|
||||
cd src
|
||||
git checkout cling-patches
|
||||
cd tools
|
||||
git clone http://root.cern.ch/git/cling.git
|
||||
git clone http://root.cern.ch/git/clang.git
|
||||
cd clang
|
||||
git checkout cling-patches
|
||||
cd ..
|
||||
</pre>
|
||||
<p> Then use CMake to configure & build cling: </p>
|
||||
<pre>
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_INSTALL_PREFIX=[Install Path] ..\src
|
||||
cmake --build . --config [Release/Debug] --target clang
|
||||
cmake --build . --config [Release/Debug] --target cling
|
||||
</pre>
|
||||
|
||||
<h3> Building ROOT6: cling as part of ROOT </h3>
|
||||
|
||||
Cling, llvm and clang are part of the trunk of ROOT. Simply run
|
||||
<pre>
|
||||
git clone https://root.cern.ch/git/root.git src
|
||||
<pre><code>
|
||||
mkdir obj
|
||||
cd obj
|
||||
../src/configure
|
||||
make -j4
|
||||
|
||||
</pre>
|
||||
<p> and you will get a preview of ROOT 6: ROOT using cling! </p>
|
||||
|
||||
cmake -DCMAKE_INSTALL_PREFIX=[Install Path] ..\src
|
||||
cmake --build . --config [Release/Debug] --target cling
|
||||
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,6 +1,10 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
|
||||
<link rel="stylesheet" href="http://cdn.jsdelivr.net/highlight.js/9.2.0/styles/railscasts.min.css">
|
||||
<script src="http://cdn.jsdelivr.net/highlight.js/9.2.0/highlight.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
<head>
|
||||
<title>Cling Website</title>
|
||||
<meta name="description" content="Official website of Cling" />
|
||||
@ -24,9 +28,9 @@
|
||||
<div id="mainmenubar">
|
||||
<ul id="mainmenu">
|
||||
<!-- put class="selected" in the li tag for the selected page - to highlight which page you're on -->
|
||||
<li class="selected"><a class="tab_link" href="newindex.html">Home</a></li>
|
||||
<li><a class="tab_link" href="newindex.html">Home</a></li>
|
||||
<li><a class="tab_link" href="build.html">Build</a></li>
|
||||
<li><a class="tab_link" href="contribute.html">Contribuite</a></li>
|
||||
<li class="selected"><a class="tab_link" href="contribute.html">Contribuite</a></li>
|
||||
<li><a class="tab_link" href="jupyter.html">Jupyter</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -50,16 +54,20 @@
|
||||
</div>
|
||||
<div id="main">
|
||||
<!-- insert the page content here -->
|
||||
<h2> Collaborate With Us </h2>
|
||||
<h3> Collaborate With Us </h3>
|
||||
<p>
|
||||
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 and in the CREDITS (link is external) file 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.
|
||||
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 and in the <a href= "https://raw.githubusercontent.com/root-mirror/root/master/README/CREDITS" target = "_blank">CREDITS</a> file 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.
|
||||
</p>
|
||||
<p>
|
||||
You can send us a patch or a pull request with <a href="https://github.com/root-mirror/cling" target = "_blank">Github</a>, provided that you follow these two simple rules:
|
||||
|
||||
Make sure you follow the Cling coding conventions in your code
|
||||
Make sure you provide a set of tests for your feature/bug fix
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
Make sure you follow the Cling coding conventions in your code.
|
||||
</li>
|
||||
<li>
|
||||
Make sure you provide a set of tests for your feature/bug fix.
|
||||
</li>
|
||||
</ul>
|
||||
Often it is useful to contact us first to discuss the code you want to develop or the bug you want to fix.
|
||||
|
||||
</p>
|
||||
|
@ -1,6 +1,10 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
|
||||
<link rel="stylesheet" href="http://cdn.jsdelivr.net/highlight.js/9.2.0/styles/railscasts.min.css">
|
||||
<script src="http://cdn.jsdelivr.net/highlight.js/9.2.0/highlight.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
<head>
|
||||
<title>Cling Website</title>
|
||||
<meta name="description" content="Official website of Cling" />
|
||||
@ -24,10 +28,10 @@
|
||||
<div id="mainmenubar">
|
||||
<ul id="mainmenu">
|
||||
<!-- put class="selected" in the li tag for the selected page - to highlight which page you're on -->
|
||||
<li class="selected"><a class="tab_link" href="newindex.html">Home</a></li>
|
||||
<li><a class="tab_link" href="newindex.html">Home</a></li>
|
||||
<li><a class="tab_link" href="build.html">Build</a></li>
|
||||
<li><a class="tab_link" href="contribute.html">Contribuite</a></li>
|
||||
<li><a class="tab_link" href="jupyter.html">Jupyter</a></li>
|
||||
<li class="selected"><a class="tab_link" href="jupyter.html">Jupyter</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@ -51,10 +55,13 @@
|
||||
<div id="main">
|
||||
<!-- insert the page content here -->
|
||||
|
||||
<h2> Jupyter Kernel </h2>
|
||||
<h3> Jupyter Kernel </h3>
|
||||
<p>Cling is now integrated with the <a href = "http://jupyter.org/" target = "_blank"> Jupyter</a> technology through the Jupyter kernel. You can take advantage of creating a Jupyter notebook on top of runtime interpretation, you have runtime visualisation!
|
||||
</p>
|
||||
|
||||
<img id = "jupyterscreenshot"
|
||||
src="JupyterScreenshot.png" alt="Cling Jupyter Screenshot" style=""/>
|
||||
|
||||
<h3>Prerequisites</h3>
|
||||
<ul>
|
||||
<li>
|
||||
@ -63,7 +70,7 @@
|
||||
</ul>
|
||||
<h3>Install </h3>
|
||||
To install the kernel with sources in src/tools/cling:
|
||||
<pre>
|
||||
<pre><code>
|
||||
export PATH=/path/to/cling/bin:$PATH
|
||||
cd src/tools/cling/tools/Jupyter/kernel/
|
||||
|
||||
@ -73,13 +80,15 @@ To install the kernel with sources in src/tools/cling:
|
||||
# register the kernelspec:
|
||||
jupyter-kernelspec install [--user] cling
|
||||
# or: jupyter kernelspec install [--user] cling
|
||||
</pre>
|
||||
|
||||
</code></pre>
|
||||
|
||||
To run it:
|
||||
<pre>
|
||||
<pre><code>
|
||||
jupyter-notebook
|
||||
# or: jupyter notebook
|
||||
</pre>
|
||||
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,6 +1,11 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="http://cdn.jsdelivr.net/highlight.js/9.2.0/styles/railscasts.min.css">
|
||||
<script src="http://cdn.jsdelivr.net/highlight.js/9.2.0/highlight.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
|
||||
<head>
|
||||
<title>Cling Website</title>
|
||||
<meta name="description" content="Official website of Cling" />
|
||||
@ -50,14 +55,27 @@
|
||||
</div>
|
||||
<div id="main">
|
||||
<!-- insert the page content here -->
|
||||
<h1>Cling is ..</h1>
|
||||
<h1>Cling.. interprets C++</h1>
|
||||
<p>
|
||||
<pre><code class = "cpp">
|
||||
****************** CLING ******************
|
||||
* Type C++ code and press enter to run it *
|
||||
* Type .q to exit *
|
||||
*******************************************
|
||||
[cling]$ #include <string>
|
||||
[cling]$ std::string s("abc");
|
||||
[cling]$ s.find('b')
|
||||
(std::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type) 1
|
||||
[cling]$
|
||||
</code></pre>
|
||||
</p>
|
||||
<p>
|
||||
An interactive C++ interpreter, built on the top of LLVM and Clang libraries. In addition to standard interpreters it has a command line prompt and uses just-in-time (JIT) compiler. This kind of software application is commonly known as an interactive compiler.
|
||||
Cling is built on the top of LLVM and Clang libraries. In addition to standard interpreters it has a command line prompt and uses just-in-time (JIT) compiler. This kind of software application is commonly known as an interactive compiler.
|
||||
<br/>
|
||||
Cling started off as a contemporary, high-performance alternative of the current C++ interpreter in the ROOT project - CINT.
|
||||
</p>
|
||||
|
||||
<h2>Interpreting C++ with Cling</h2>
|
||||
<h3>Why interpreting C++ with Cling?</h3>
|
||||
|
||||
<ul style="list-style-type:none">
|
||||
<li>Learning C++
|
||||
@ -69,9 +87,9 @@
|
||||
<li>Creating scripts
|
||||
<p>
|
||||
The power of an interpreter lays as well in the compactness and ease of repeatedly running a small snippet of code - aka a script. This can be done in cling by inserting the bash-like style line:
|
||||
<pre>
|
||||
<pre><code>
|
||||
#!/usr/bin/cling
|
||||
</pre>
|
||||
</code></pre>
|
||||
</p>
|
||||
</li>
|
||||
|
||||
@ -84,22 +102,24 @@
|
||||
|
||||
<li>Runtime-Generated Code
|
||||
<p>
|
||||
|
||||
Sometime it's convenient to create code as a reaction to input
|
||||
(user/network/configuration).
|
||||
Runtime-generated code can interface with C++ libraries.
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2> Embedding Cling </h2>
|
||||
<h3> Embedding Cling </h3>
|
||||
<p>
|
||||
The functionality of an application can be neriched by embedding Cling.
|
||||
The functionality of an application can be enriched by embedding Cling.
|
||||
|
||||
To embed Cling, the main program has to be provided. One of the things this main program has to do is initialize the Cling interpreter. There are optional calls to pass command line arguments to Cling. Afterwards, you can call the interpreter from any anywhere within the application.
|
||||
</p>
|
||||
<p>
|
||||
For compilation and linkage the application needs the path to the clang and llvm libraries and the invocation is order dependent since the linker cannot do backward searches. This is done automatically if you system has a make/cmake file.
|
||||
For compilation and linkage the application needs the path to the clang and llvm libraries and the invocation is order dependent since the linker cannot do backward searches.
|
||||
|
||||
<pre>
|
||||
g++ embeddcling.cxx -std=c++11 -L/usr/local/lib
|
||||
<pre><code>
|
||||
g++ embedcling.cxx -std=c++11 -L/usr/local/lib
|
||||
-lclingInterpreter -lclingUtils
|
||||
-lclangFrontend -lclangSerialization -lclangParse -lclangSema
|
||||
-lclangAnalysis -lclangEdit -lclangLex -lclangDriver -lclangCodeGen
|
||||
@ -108,13 +128,13 @@ g++ embeddcling.cxx -std=c++11 -L/usr/local/lib
|
||||
--libs bitwriter mcjit orcjit native option
|
||||
ipo profiledata instrumentation objcarcopts`
|
||||
-lz -pthread -ldl -ltinfo
|
||||
-o embeddcling
|
||||
</pre>
|
||||
-o embedcling
|
||||
</code></pre>
|
||||
</p>
|
||||
<p>
|
||||
Embedding cling requires the creation of the interpreter which can swallow the arguments provided to the application and passing the resource directory of llvm. An example is the following:
|
||||
Embedding cling requires the creation of the interpreter. Optionally compiler arguments and the resource directory of llvm can be passed. An example is the following:
|
||||
|
||||
<pre>
|
||||
<pre><code>
|
||||
#include "cling/Interpreter/Interpreter.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
@ -123,19 +143,19 @@ int main(int argc, char** argv) {
|
||||
|
||||
interp.declare("int p=0;");
|
||||
}
|
||||
</pre>
|
||||
</code></pre>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<h2> Download </h2>
|
||||
<h3> Download </h3>
|
||||
<p>
|
||||
We are developing Cling according to the principle of Release early and release often. Binaries are created on a monthly basis and are available for <a href="https://root.cern.ch/download/cling/" target="_blank">download</a>.
|
||||
We are developing Cling according to the principle of Release early and release often. Binaries are available for <a href="https://root.cern.ch/download/cling/" target="_blank">download</a>.
|
||||
|
||||
</p>
|
||||
|
||||
<h2> Support </h2>
|
||||
<p> Support is provided through a fast-response <a href="https://root.cern.ch/phpBB3/viewforum.php?f=21 and cling-dev@cern.ch" target="_blank">forum</a>, where questions of all levels are welcomed.
|
||||
<h3> Support </h3>
|
||||
<p> Support is provided through a fast-response <a href="https://root.cern.ch/phpBB3/viewforum.php?f=21" target="_blank">forum</a>, where questions of all levels are welcomed. Queries can also be sent to our mailing list: cling-dev@cern.ch.
|
||||
</p>
|
||||
|
||||
|
||||
|
@ -298,6 +298,11 @@ ol li {
|
||||
letter-spacing: normal;
|
||||
}
|
||||
|
||||
#jupyterscreenshot {
|
||||
width: 70%;
|
||||
margin-left: 14%;
|
||||
}
|
||||
|
||||
.search {
|
||||
color: #5D5D5D;
|
||||
border: 1px solid #BBB;
|
||||
|
Loading…
x
Reference in New Issue
Block a user