Git Product home page Git Product logo

cling's Introduction

Cling - The Interactive C++ Interpreter

The main repository is at https://github.com/root-project/cling

Overview

Cling is an interactive C++ interpreter, built on top of Clang and LLVM compiler infrastructure. Cling implements the read-eval-print loop (REPL) 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.

See also cling's web page.

Please note that some of the resources are rather old and most of the stated limitations are outdated.

Installation

Release Notes

See our release notes to find what's new.

Binaries

Our nightly binary snapshots are currently unavailable.

Building from Source

git clone https://github.com/root-project/llvm-project.git
cd llvm-project
git checkout cling-latest
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" -DCMAKE_BUILD_TYPE=Release ../llvm-project/llvm
cmake --build . --target cling

See also the instructions on the webpage.

Usage

Assuming we're in the build folder:

./bin/cling '#include <stdio.h>' 'printf("Hello World!\n")'

To get started run:

./bin/cling --help

or

./bin/cling
[cling]$ .help

Jupyter

Cling comes with a Jupyter kernel. After building cling, install Jupyter and cling's kernel by following the README.md in tools/Jupyter. Make sure cling is in your PATH when you start jupyter!

Citing Cling

% Peer-Reviewed Publication
%
% 19th International Conference on Computing in High Energy and Nuclear Physics (CHEP)
% 21-25 May, 2012, New York, USA
%
@inproceedings{Cling,
  author = {Vassilev,V. and Canal,Ph. and Naumann,A. and Moneta,L. and Russo,P.},
  title = {{Cling} -- The New Interactive Interpreter for {ROOT} 6}},
  journal = {Journal of Physics: Conference Series},
  year = 2012,
  month = {dec},
  volume = {396},
  number = {5},
  pages = {052071},
  doi = {10.1088/1742-6596/396/5/052071},
  url = {https://iopscience.iop.org/article/10.1088/1742-6596/396/5/052071/pdf},
  publisher = {{IOP} Publishing}
}

Developers' Corner

Cling's latest doxygen documentation

Contributions

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 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.

License

Please see our LICENSE.

Releases

Our release steps to follow when cutting a new release:

  1. Update release notes
  2. Remove ~dev suffix from VERSION
  3. Add a new entry in the news section of our website
  4. Commit the changes.
  5. git tag -a v0.x -m "Tagging release v0.x"
  6. Tag cling-patches of clang.git: git tag -a cling-v0.x -m "Tagging clang for cling v0.x"
  7. Create a draft release in github and copy the contents of the release notes.
  8. Wait for green builds.
  9. Upload binaries to github (Travis should do this automatically).
  10. Publish the tag and announce it on the mailing list.
  11. Increment the current version and append ~dev.

cling's People

Contributors

amadio avatar axel-naumann avatar bellenot avatar cristinacristescu avatar devajithvs avatar dpiparo avatar esakellari avatar ferdymercury avatar fonsrademakers avatar gargvaibhav64 avatar hahnjo avatar jalopezg-git avatar jiangyilism avatar linev avatar manasij7479 avatar marsupial avatar minrk avatar nneonneo avatar onyb avatar oshadura avatar pcanal avatar peremato avatar reikdas avatar saisoma123 avatar simeonehrig avatar sploving avatar teemperor avatar timurp avatar vgvassilev avatar yamaguchi1024 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cling's Issues

Maintain in debian depo?

This is a great learning tool! Any chance it might eventually make it into a debian repo? Or at the very least a ppa?

Thanks!

cpt cleanup procedure fails

Hi,

20:08:41-vvassilev~/workspace/github/cling/tools/packaging (master)$ ./cpt.py --with-llvm-url=https://github.com/vgvassilev/llvm.git --with-clang-url=https://github.com/vgvassilev/clang.git --with-cling-url=https://github.com/vgvassilev/cling.git --with-workdir=~/workspace/cling-github --current-dev=tar

I get:

┌──────────────────────────────────────────────────────────────────────────────┐
│ Clean up                                                                     │
└──────────────────────────────────────────────────────────────────────────────┘
Remove directory: /Users/vvassilev/workspace/cling-github/builddir
Remove directory: /Users/vvassilev/workspace/cling-github/cling-MacOSX-10.9.4-x86_64-0.2~dev-decffc8
Remove directory: /tmp/cling-obj/
Traceback (most recent call last):
  File "./cpt.py", line 1498, in <module>
    cleanup()
  File "./cpt.py", line 387, in cleanup
    if args['current_dev'] == 'dmg' or args['last_stable'] == 'dmg' or args['dmg_tag']:
KeyError: 'dmg_tag'

Vassil

Cling not loading Boost

This may be asking too much, but currently Cling does not load Boost headers, and just crashes.

How to configure jupyter-cling-kernel to use std=c++11?

I checked jupyter-cling-kernel --help but I failed to find any command line switch to pass arguments to cling. Can anyone help me?

I am setting up C++ kernel for Jupyter. I want students to be able to use iostream library - but this requires c++11 compatibility, which is not by default.

I use headless Ubuntu 16.04 server.

cpt should check if subprocess calls fail

Currently, if a make step fails, cpt rather happily tries to keep going. I'm attempting to build a dmg with cling, and it's failing to build cling. Instead of quitting, it keeps going and attempts to build an empty dmg, which breaks in even more surprising ways.

Suggested patch: use check_output and check_call instead of Popen in exec_subprocess_call/exec_subprocess_check_output; the check methods will throw an exception if the called process returned a non-zero exit code. check_output is new to Python 2.7; if compatibility with Python 2.6 is needed, you can use a drop-in replacement like this one.

Integrating cling into existing application.

Hi there, I got interested in cling due to the fact I would like to integrate cling into my existing game engine, the project is just a learning toy nothing serious, for the time being i need some really basic stuff and I would rather avoid to go down the path of integrating a fully fledged scripting language.
Would it be possible to achieve that result with cling? I tried to have a look at the doc but is a bit overwhelming since is basically class documentation and not really a library documentation on the overall project.
If what I am after is possible (i would assume so), would you be able to point me to the relevant classes needed ?

Please bear with me, I am new to this jit world so If I ask stupid things let me know.

Cheers

M.

cpt --with-workdir= doesn't work

Hi,
packaging (master)$ ./cpt.py --with-llvm-url=https://github.com/vgvassilev/llvm.git --with-clang-url=https://github.com/vgvassilev/clang.git --with-cling-url=https://github.com/vgvassilev/cling.git --with-workdir=/workspace/cling-github --current-dev=dmg
Cling Packaging Tool (CPT)
Arguments vector: ['./cpt.py', '--with-llvm-url=https://github.com/vgvassilev/llvm.git', '--with-clang-url=https://github.com/vgvassilev/clang.git', '--with-cling-url=https://github.com/vgvassilev/cling.git', '--with-workdir=
/workspace/cling-github', '--current-dev=dmg']

Even if I pass in --with-workdir it says later:
Cloning into '/Users/vvassilev/ec/build/cling-src'...
remote: Counting objects: 869137, done.

Vassil

make install doesn't work on Mac OS El Capitan

make install gives me the following error message.

/Users/xxxx/cling/src/include/llvm/ADT/StringRef.h:13:10: fatal error: 
  'algorithm' file not found
#include <algorithm>
         ^
1 error generated.

Meet a bug when encountering errors

Hey, I found something unexpected when I write some wrong codes, like this:

typedef mpl::range_c<int, 0, 10> ran;
typedef mpl::plus<_1, mpl::int_<2> > add2;
/* this line will get some errors when template instantiation */
typedef mpl::transform<ran, add2>::type newran;  
/* but when I type in the same line, there will be no errors. */
typedef mpl::transform<ran, add2>::type newran;  

Besides, after the second line, the type "newran" will becomes int.

Maybe you should do something to fix this. Thank you!

Update root ReadMe.md

Hi,
Once we have #29 we should update the build instructions in cling's ReadMe.md
Cheers,
Vassil

Implement cpt build environment

Hi,
We discussed this before, but lets just iterate once more:
I'd like to download only the cpt.py and tell it to build a development environment for me.
Vassil

New Error

Hi @vgvassilev,

I have a new error that I never had when I last built a few months ago.

In file included from llvm/tools/cling/lib/Interpreter/ValuePrinter.cpp:10:0: llvm/tools/cling/lib/Interpreter/../../include/cling/Interpreter/Value.h: In instantiation of 'static T cling::Value::CastFwd<T>::cast(const cling::Value&) [with T = long double]': llvm/tools/cling/lib/Interpreter/../../include/cling/Interpreter/Value.h:209:36: required from 'T cling::Value::simplisticCastAs() const [with T = long double]' llvm/tools/cling/lib/Interpreter/ValuePrinter.cpp:213:48: required from here llvm/tools/cling/lib/Interpreter/../../include/cling/Interpreter/Value.h:104:53: error: cast from 'void*' to 'long unsigned int' loses precision [-fpermissive] return (T) (unsigned long) V.getAs<void*>();

Seems like the header is wrong ?

Why is this cast from 'void_' to 'long unsigned int'
include/cling/Interpreter/Value.h:104:53:
return (T) (unsigned long) V.getAs<void_>();

Should this not be size_t and not unsigned long ?

Forward decl printer: bad ordering

class CastorElectronicsMap{
   public:
      class PrecisionItem{};
      typedef PrecisionItem TheTypedef;
};

class A{};
typedef A TheTypedef;

class B{};
namespace ns {
typedef B TheTypedef;
class C{};
}

causes the following forward decls:

extern int __Cling_Autoloading_Map;
class __attribute__((annotate(\"nestedClasses.h\")))  CastorElectronicsMap;
namespace ns {
typedef B TheTypedef __attribute__((annotate(\"nestedClasses.h\"))) ;
class __attribute__((annotate(\"nestedClasses.h\")))  C;
}

This causes the following error:

error: unknown type name 'B'
typedef B TheTypedef __attribute__((annotate("nestedClasses.h"))) ;
        ^

Could this be fixed, please?

Cheers, Axel.

Cannot make an ofstream

I just tried this

#include <fstream>
#include <iostream>
#include <string>
using namespace std;
ofstream ofs("test.txt");

and Cling gave me a "no matching constructor" error

How to modify

Hi I created my own programming language with flex and bison, now how can i put this in your interpreter? Thanks in advanced

Build process (as described in README.md) not working

Hi,

I'm trying to build cling from source using exactly the method
you described in the README.md of this repository. I'd rather
like to download ready-to-play binaries, but I read, that's not
possible right now because of your infrastructure refactoring.

I also tried to build the package using this build script that is linked also in the
documentation. No success either. CMake threw a very
strange error claiming that a "SetTheory" Module might be
missing or simply corrupt(?). Then I tried to use onyb's
uploaded binaries, but since they've been build specifically for Ubuntu, I can't
run them, because I'm currently running Arch.

My CMake version is 3.4.3

Am I missing an obvious step?
Could you update your build instructions?

Interactive interpreter does not exit on EOF

On linux, when you're on a terminal, you can use Ctrl+D to send EOF to the program.

For example, in python, typing Ctrl+D in the terminal exits the interpreter.

The following snippet also exists on EOF.

#include <iostream>
#include <string>

int main(int argc, char *argv[])
{
    std::string str;

    while (std::getline(std::cin, str))
        std::cout << "You typed : " << str << std::endl;

    return 0;
}

Is there a reason why cling ignores my Ctrl+D ?

Making use of the compilation database

Many thanks for a very useful project. This is more of a question than a issue. Does Cling support the compilation database? It would be great if one could load up a compilation database for a given project, and then be able to include any of the files on that project and use them from cling.

cpt /bin/sh: line 1: tell: command not found

Hi,
Running:

./cpt.py  --with-workdir=~/workspace/cling-root --current-dev=dmg

I get:

┌──────────────────────────────────────────────────────────────────────────────┐
│ Building Apple Disk Image                                                    │
└──────────────────────────────────────────────────────────────────────────────┘
Create directory: /Users/vvassilev/workspace/cling-root/Cling.app
Populate directory: /Users/vvassilev/workspace/cling-root/Cling.app/Contents/Resources
Copy APP Bundle to staging area: /Users/vvassilev/workspace/cling-root/Install
Stripping file: cling.app/contents/macos/cling
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: can't open file: cling.app/contents/macos/cling (No such file or directory)
Estimated size of application bundle: 46.0MB
Building temporary Apple Disk Image
........................................................................................................................................................................................
.....................................................................................................................................................................................
created: /Volumes/MacintoshHD/Users/vvassilev/workspace/cling-root/cling-0.2~dev-decffc8-temp.dmg
Created Apple Disk Image: cling-0.2~dev-decffc8-temp.dmg
Wating for device to unmount...
Executing AppleScript...
tell application Finder
/bin/sh: line 1: tell: command not found
Usage: open [-e] [-t] [-f] [-W] [-R] [-n] [-g] [-h] [-b <bundle identifier>] [-a <application>] [filenames] [--args arguments]
Help: Open opens files from a shell.
      By default, opens each file using the default application for that file.  
      If the file is in the form of a URL, the file will be opened as a URL.
Options: 
      -a                Opens with the specified application.
      -b                Opens with the specified application bundle identifier.
      -e                Opens with TextEdit.
      -t                Opens with default text editor.
      -f                Reads input from standard input and opens with TextEdit.
      -F  --fresh       Launches the app fresh, that is, without restoring windows. Saved persistent state is lost, excluding Untitled documents.
      -R, --reveal      Selects in the Finder instead of opening.
      -W, --wait-apps   Blocks until the used applications are closed (even if they were already running).
          --args        All remaining arguments are passed in argv to the application's main() function instead of opened.
      -n, --new         Open a new instance of the application even if one is already running.
      -j, --hide        Launches the app hidden.
      -g, --background  Does not bring the application to the foreground.
      -h, --header      Searches header file locations for headers matching the given filenames, and opens them.
/bin/sh: line 13: close: command not found
Usage: open [-e] [-t] [-f] [-W] [-R] [-n] [-g] [-h] [-b <bundle identifier>] [-a <application>] [filenames] [--args arguments]
Help: Open opens files from a shell.
      By default, opens each file using the default application for that file.  
      If the file is in the form of a URL, the file will be opened as a URL.
Options: 
      -a                Opens with the specified application.
      -b                Opens with the specified application bundle identifier.
      -e                Opens with TextEdit.
      -t                Opens with default text editor.
      -f                Reads input from standard input and opens with TextEdit.
      -F  --fresh       Launches the app fresh, that is, without restoring windows. Saved persistent state is lost, excluding Untitled documents.
      -R, --reveal      Selects in the Finder instead of opening.
      -W, --wait-apps   Blocks until the used applications are closed (even if they were already running).
          --args        All remaining arguments are passed in argv to the application's main() function instead of opened.
      -n, --new         Open a new instance of the application even if one is already running.
      -j, --hide        Launches the app hidden.
      -g, --background  Does not bring the application to the foreground.
      -h, --header      Searches header file locations for headers matching the given filenames, and opens them.
/bin/sh: line 15: update: command not found
/bin/sh: line 16: delay: command not found
/bin/sh: line 17: end: command not found
/bin/sh: line 18: end: command not found
Performing sync...
Detach device: /dev/disk4

"disk4" unmounted.
"disk4" ejected.
Creating compressed Apple Disk Image...
Preparing imaging engine…
Reading Protective Master Boot Record (MBR : 0)…
   (CRC32 $1F3159D0: Protective Master Boot Record (MBR : 0))
Reading GPT Header (Primary GPT Header : 1)…
   (CRC32 $F9CCBD4D: GPT Header (Primary GPT Header : 1))
Reading GPT Partition Data (Primary GPT Table : 2)…
   (CRC32 $B873B626: GPT Partition Data (Primary GPT Table : 2))
Reading  (Apple_Free : 3)…
   (CRC32 $00000000:  (Apple_Free : 3))
Reading disk image (Apple_HFS : 4)…
.......................................................................................................................................................................................
   (CRC32 $7ED55C86: disk image (Apple_HFS : 4))
Reading  (Apple_Free : 5)…
.......................................................................................................................................................................................
   (CRC32 $00000000:  (Apple_Free : 5))
Reading GPT Partition Data (Backup GPT Table : 6)…
.......................................................................................................................................................................................
   (CRC32 $B873B626: GPT Partition Data (Backup GPT Table : 6))
Reading GPT Header (Backup GPT Header : 7)…
........................................................................................................................................................................................
   (CRC32 $92A6DA4C: GPT Header (Backup GPT Header : 7))
Adding resources…
........................................................................................................................................................................................
Elapsed Time:  4.352s
File size: 14481988 bytes, Checksum: CRC32 $6084D287
Sectors processed: 94208, 94172 compressed
Speed: 10.6Mbytes/sec
Savings: 70.0%
created: /Volumes/MacintoshHD/Users/vvassilev/workspace/cling-root/cling-0.2~dev-decffc8.dmg
Remove directory: /Users/vvassilev/workspace/cling-root/Install
Done



┌──────────────────────────────────────────────────────────────────────────────┐
│ Clean up                                                                     │
└──────────────────────────────────────────────────────────────────────────────┘
Remove directory: /Users/vvassilev/workspace/cling-root/builddir
Remove directory: /Users/vvassilev/workspace/cling-root/cling-MacOSX-10.9.4-x86_64-0.2~dev-decffc8
Remove directory: /tmp/cling-obj/
Remove file: /Users/vvassilev/workspace/cling-root/cling-0.2~dev-decffc8-temp.dmg
Traceback (most recent call last):
  File "./cpt.py", line 1530, in <module>
    cleanup()
  File "./cpt.py", line 393, in cleanup
    print "Remove directory: " + Cling.app
NameError: global name 'Cling' is not defined

Cleanup for running threads

Code:
[cling]$ #include
[cling]$ auto f = [] () {while(1);};
[cling]$ std::thread t(f);
[cling]$ .q
terminate called without an active exception
Aborted (core dumped)

This can be considered reasonable behaviour for a compiler.
But since cling is an interactive environment, I think it should handle active threads in some special manner at exit.

Example use case:
In my code the thread is a display window.
I would prefer if the user could exit with the .q meta command instead of closing the window separately.

Any idea where to look for this?
Standard C++ doesn't allow terminating threads manually, afaik.

cpt too many arguments on Windows

Hi,
After installing git on windows (issue #36 ) I ran into:

C:\Documents and Settings\vv\My Documents\Downloads>cpt.py --with-llvm-url=https://github.com/vgvassilev/llvm.git --with
-clang-url=https://github.com/vgvassilev/clang.git --with-cling-url=https://github.com/vgvassilev/cling.git --with-workd
ir="C:\Documents and Settings\vv\My Documents\Downloads\cling" --current-dev=nsys
Cling Packaging Tool (CPT)
Arguments vector: ['C:\\Documents and Settings\\vv\\My Documents\\Downloads\\cpt.py', '--with-llvm-url=https://github.co
m/vgvassilev/llvm.git', '--with-clang-url=https://github.com/vgvassilev/clang.git', '--with-cling-url=https://github.com
/vgvassilev/cling.git', '--with-workdir=C:\\Documents and Settings\\vv\\My Documents\\Downloads\\cling', '--current-dev=
nsys']

+=============================================================================+
| cling (x86)                                  Tue, 05 Aug 2014 20:27:47 +0300|
+=============================================================================+
Thread Model: NT
Operating System: Windows
Distribution: N/A
Release: Windows XP
Revision: 5.1.2600
Architecture: x86

+-----------------------------------------------------------------------------+
| Fetch source files                                                          |
+-----------------------------------------------------------------------------+
Last known good LLVM revision is: 202469
Current working directory is: C:\Documents and Settings\vv\My Documents\Downloads\cling

Too many arguments.

usage: git clone [options] [--] <repo> [<dir>]

    -v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --progress            force progress reporting
    -n, --no-checkout     don't create a checkout
    --bare                create a bare repository
    --mirror              create a mirror repository (implies bare)
    -l, --local           to clone from a local repository
    --no-hardlinks        don't use local hardlinks, always copy
    -s, --shared          setup as shared repository
    --recursive           initialize submodules in the clone
    --recurse-submodules  initialize submodules in the clone
    --template <template-directory>
                          directory from which templates will be used
    --reference <repo>    reference repository
    -o, --origin <name>   use <name> instead of 'origin' to track upstream
    -b, --branch <branch>
                          checkout <branch> instead of the remote's HEAD
    -u, --upload-pack <path>
                          path to git-upload-pack on the remote
    --depth <depth>       create a shallow clone of that depth
    --single-branch       clone only one branch, HEAD or --branch
    --separate-git-dir <gitdir>
                          separate git dir from working tree
    -c, --config <key=value>
                          set config inside the new repository

Traceback (most recent call last):
  File "C:\Documents and Settings\vv\My Documents\Downloads\cpt.py", line 1482, in <module>
    fetch_llvm()
  File "C:\Documents and Settings\vv\My Documents\Downloads\cpt.py", line 177, in fetch_llvm
    get_fresh_llvm()
  File "C:\Documents and Settings\vv\My Documents\Downloads\cpt.py", line 161, in get_fresh_llvm
    exec_subprocess_call('git checkout ROOT-patches-r%s'%(LLVMRevision), srcdir)
  File "C:\Documents and Settings\vv\My Documents\Downloads\cpt.py", line 52, in exec_subprocess_call
    stderr=subprocess.STDOUT).communicate()
  File "C:\Python27\lib\subprocess.py", line 679, in __init__
    errread, errwrite)
  File "C:\Python27\lib\subprocess.py", line 893, in _execute_child
    startupinfo)
WindowsError: [Error 267] The directory name is invalid

Vassil

cpt fails to produce a package on MacOS

Hi,
Maybe this is unsupported yet but I got:

┌──────────────────────────────────────────────────────────────────────────────┐
│ Building Apple Disk Image                                                    │
└──────────────────────────────────────────────────────────────────────────────┘
Create directory: /Users/vvassilev/workspace/cling-github/Cling.app
Populate directory: /Users/vvassilev/workspace/cling-github/Cling.app/Contents/Resources
Copy APP Bundle to staging area: /Users/vvassilev/workspace/cling-github/Install
Stripping file: Cling.app/Contents/MacOS/Cling
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: can't open file: Cling.app/Contents/MacOS/Cling (No such file or directory)
Estimated size of application bundle: 46.0
Building temporary Apple Disk Image
........................................................................................................................................................................................
.....................................................................................................................................................................................
created: /Volumes/MacintoshHD/Users/vvassilev/workspace/cling-github/cling-0.2~dev-decffc8-temp.dmg
Created Apple Disk Image: cling-0.2~dev-decffc8-temp.dmg
Wating for device to unmount...
Executing AppleScript...
tell application Finder
/bin/sh: line 1: tell: command not found
Usage: open [-e] [-t] [-f] [-W] [-R] [-n] [-g] [-h] [-b <bundle identifier>] [-a <application>] [filenames] [--args arguments]
Help: Open opens files from a shell.
      By default, opens each file using the default application for that file.  
      If the file is in the form of a URL, the file will be opened as a URL.
Options: 
      -a                Opens with the specified application.
      -b                Opens with the specified application bundle identifier.
      -e                Opens with TextEdit.
      -t                Opens with default text editor.
      -f                Reads input from standard input and opens with TextEdit.
      -F  --fresh       Launches the app fresh, that is, without restoring windows. Saved persistent state is lost, excluding Untitled documents.
      -R, --reveal      Selects in the Finder instead of opening.
      -W, --wait-apps   Blocks until the used applications are closed (even if they were already running).
          --args        All remaining arguments are passed in argv to the application's main() function instead of opened.
      -n, --new         Open a new instance of the application even if one is already running.
      -j, --hide        Launches the app hidden.
      -g, --background  Does not bring the application to the foreground.
      -h, --header      Searches header file locations for headers matching the given filenames, and opens them.
/bin/sh: line 13: close: command not found
Usage: open [-e] [-t] [-f] [-W] [-R] [-n] [-g] [-h] [-b <bundle identifier>] [-a <application>] [filenames] [--args arguments]
Help: Open opens files from a shell.
      By default, opens each file using the default application for that file.  
      If the file is in the form of a URL, the file will be opened as a URL.
Options: 
      -a                Opens with the specified application.
      -b                Opens with the specified application bundle identifier.
      -e                Opens with TextEdit.
      -t                Opens with default text editor.
      -f                Reads input from standard input and opens with TextEdit.
      -F  --fresh       Launches the app fresh, that is, without restoring windows. Saved persistent state is lost, excluding Untitled documents.
      -R, --reveal      Selects in the Finder instead of opening.
      -W, --wait-apps   Blocks until the used applications are closed (even if they were already running).
          --args        All remaining arguments are passed in argv to the application's main() function instead of opened.
      -n, --new         Open a new instance of the application even if one is already running.
      -j, --hide        Launches the app hidden.
      -g, --background  Does not bring the application to the foreground.
      -h, --header      Searches header file locations for headers matching the given filenames, and opens them.
/bin/sh: line 15: update: command not found
/bin/sh: line 16: delay: command not found
/bin/sh: line 17: end: command not found
/bin/sh: line 18: end: command not found
Performing sync...
Detach device: /dev/disk4

"disk4" unmounted.
"disk4" ejected.
Creating compressed Apple Disk Image...
Preparing imaging engine…
Reading Protective Master Boot Record (MBR : 0)…
   (CRC32 $1F3159D0: Protective Master Boot Record (MBR : 0))
Reading GPT Header (Primary GPT Header : 1)…
   (CRC32 $27EDA161: GPT Header (Primary GPT Header : 1))
Reading GPT Partition Data (Primary GPT Table : 2)…
   (CRC32 $4D3BADCE: GPT Partition Data (Primary GPT Table : 2))
Reading  (Apple_Free : 3)…
   (CRC32 $00000000:  (Apple_Free : 3))
Reading disk image (Apple_HFS : 4)…
.......................................................................................................................................................................................
   (CRC32 $8C59440F: disk image (Apple_HFS : 4))
Reading  (Apple_Free : 5)…
.......................................................................................................................................................................................
   (CRC32 $00000000:  (Apple_Free : 5))
Reading GPT Partition Data (Backup GPT Table : 6)…
.......................................................................................................................................................................................
   (CRC32 $4D3BADCE: GPT Partition Data (Backup GPT Table : 6))
Reading GPT Header (Backup GPT Header : 7)…
........................................................................................................................................................................................
   (CRC32 $4C87C660: GPT Header (Backup GPT Header : 7))
Adding resources…
........................................................................................................................................................................................
Elapsed Time:  2.285s
File size: 14483709 bytes, Checksum: CRC32 $195BA79A
Sectors processed: 94208, 94172 compressed
Speed: 20.1Mbytes/sec
Savings: 70.0%
created: /Volumes/MacintoshHD/Users/vvassilev/workspace/cling-github/cling-0.2~dev-decffc8.dmg
Remove directory: /Users/vvassilev/workspace/cling-github/Install
Done



┌──────────────────────────────────────────────────────────────────────────────┐
│ Clean up                                                                     │
└──────────────────────────────────────────────────────────────────────────────┘
Remove directory: /Users/vvassilev/workspace/cling-github/builddir
Remove directory: /Users/vvassilev/workspace/cling-github/cling-MacOSX-10.9.4-x86_64-0.2~dev-decffc8
Remove directory: /tmp/cling-obj/
Remove file: /Users/vvassilev/workspace/cling-github/cling-0.2~dev-decffc8-temp.dmg
Traceback (most recent call last):
  File "./cpt.py", line 1530, in <module>
    cleanup()
  File "./cpt.py", line 393, in cleanup
    print "Remove directory: " + Cling.app
NameError: global name 'Cling' is not defined

Vassil

Clearing Cling Shell

I have a doubt about clearing the window of Cling. I used Ctrl+L on my Linux machine but it didn't worked.

Is there other commands like ".q" in Cling shell ?? How can I get the list of commands in shell ??

Also is there any way to clear the variables ??

int a = 23;

#include<string>
string a = "Something";

#include<iostream> causes: !DD && Handlers.empty() && "Debug/EH info didn't get finalized"

I've successfully built cling on Windows7 with cmake & vs2013. While I was trying to include some cpp headers, the following error occurred:

[cling]$ .L iostream
Assertion failed: !DD && Handlers.empty() && "Debug/EH info didn't get finalized", fi
le E:\ABOUT-C++\cling\src\lib\CodeGen\AsmPrinter\AsmPrinter.cpp, line 113

shit

Am I doing it the wrong way? Or it's a bug of cling with Windows?

Warning when starting up on Ubuntu 16

When firing up latest binary snapshot, I get:

Warning in cling::IncrementalParser::CheckABICompatibility():
C++ ABI mismatch, compiled with __GLIBCXX__ v20160413 running with v20160609

cpt thinks git is installed on Windows

Hi,

+-----------------------------------------------------------------------------+
| Fetch source files                                                          |
+-----------------------------------------------------------------------------+
Last known good LLVM revision is: 202469
Current working directory is: C:\Documents and Settings\vv\My Documents\Downloads\cling

'git' is not recognized as an internal or external command,

But:

C:\Documents and Settings\vv\My Documents\Downloads>cpt.py -c
Cling Packaging Tool (CPT)
Arguments vector: ['C:\\Documents and Settings\\vv\\My Documents\\Downloads\\cpt.py', '-c']

+=============================================================================+
| cling (x86)                                  Tue, 05 Aug 2014 20:01:38 +0300|
+=============================================================================+
Thread Model: NT
Operating System: Windows
Distribution: N/A
Release: Windows XP
Revision: 5.1.2600
Architecture: x86

+-----------------------------------------------------------------------------+
| Check availability of required softwares                                    |
+-----------------------------------------------------------------------------+
git                 [OK]
python              [OK]
SSL                 [SUPPORTED]
msvc                [OK]

Refer to the documentation of CPT for information on setting up your Windows environment.
[tools/packaging/README.md]


C:\Documents and Settings\vv\My Documents\Downloads>git
'git' is not recognized as an internal or external command,
operable program or batch file.

Vassil

cpt fails on Mac

Hi,
I get this:

23:10:57-vvassilev~/workspace/github/cling/tools/packaging (master)$ ./cpt.py --with-llvm-url=https://github.com/vgvassilev/llvm.git --with-clang-url=https://github.com/vgvassilev/clang.git --with-cling-url=https://github.com/vgvassilev/cling.git --with-workdir=~/workspace/cling-github --current-deb=dmg
usage: cpt.py [-h] [-c] [--current-dev CURRENT_DEV]
              [--last-stable LAST_STABLE] [--tarball-tag TARBALL_TAG]
              [--deb-tag DEB_TAG] [--rpm-tag RPM_TAG] [--nsis-tag NSIS_TAG]
              [--with-llvm-url WITH_LLVM_URL]
              [--with-clang-url WITH_CLANG_URL]
              [--with-cling-url WITH_CLING_URL] [--with-workdir WITH_WORKDIR]
              [--make-proper MAKE_PROPER]
cpt.py: error: unrecognized arguments: --current-deb=dmg
23:11:21-vvassilev~/workspace/github/cling/tools/packaging (master)$ ./cpt.py --with-llvm-url=https://github.com/vgvassilev/llvm.git --with-clang-url=https://github.com/vgvassilev/clang.git --with-cling-url=https://github.com/vgvassilev/cling.git --with-workdir=~/workspace/cling-github --current-dev=dmg
Cling Packaging Tool (CPT)
Arguments vector: ['./cpt.py', '--with-llvm-url=https://github.com/vgvassilev/llvm.git', '--with-clang-url=https://github.com/vgvassilev/clang.git', '--with-cling-url=https://github.com/vgvassilev/cling.git', '--with-workdir=~/workspace/cling-github', '--current-dev=dmg']

╔══════════════════════════════════════════════════════════════════════════════╗
║ cling (x86_64)                               Mon, 04 Aug 2014 23:11:29 +0200 ║
╚══════════════════════════════════════════════════════════════════════════════╝
Thread Model: POSIX
Operating System: Darwin
Distribution: MacOSX
Release: 13.3.0
Revision: 10.9.4
Architecture: x86_64


┌──────────────────────────────────────────────────────────────────────────────┐
│ Fetch source files                                                           │
└──────────────────────────────────────────────────────────────────────────────┘
Last known good LLVM revision is: 202469

Cloning into '/Users/vvassilev/ec/build/cling-src'...
remote: Counting objects: 869137, done.
remote: Compressing objects: 100% (161071/161071), done.
remote: Total 869137 (delta 711796), reused 861230 (delta 703998)
Receiving objects: 100% (869137/869137), 148.38 MiB | 1.30 MiB/s, done.
Resolving deltas: 100% (711796/711796), done.
Checking connectivity... done.
Checking out files: 100% (14025/14025), done.
Checking out files: 100% (4630/4630), done.
Note: checking out 'ROOT-patches-r202469'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 2bc5930... First bunch of changes to fix the CMake build of the new llvm/cling version
Cloning into 'clang'...
remote: Counting objects: 476851, done.
remote: Compressing objects: 100% (74612/74612), done.
remote: Total 476851 (delta 401170), reused 472320 (delta 396722)
Receiving objects: 100% (476851/476851), 76.55 MiB | 340.00 KiB/s, done.
Resolving deltas: 100% (401170/401170), done.
fatal: object of unexpected type
fatal: index-pack failed
Traceback (most recent call last):
  File "./cpt.py", line 1484, in <module>
    fetch_clang()
  File "./cpt.py", line 275, in fetch_clang
    get_fresh_clang()
  File "./cpt.py", line 259, in get_fresh_clang
    exec_subprocess_call('git checkout ROOT-patches-r%s'%(LLVMRevision), os.path.join(srcdir, 'tools', 'clang'))
  File "./cpt.py", line 142, in exec_subprocess_call
    stderr=subprocess.STDOUT).communicate()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1308, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory: '/Users/vvassilev/ec/build/cling-src/tools/clang'

Maybe it is connected to issue #27
Cheers,
Vassil

CPT Cling Packaging does not build stable release

Ive tried to build deb packages on Ubuntu 15.10, with the cpt.py --last-stable deb command.

unfortunately, this ended with:

llvm[4]: Compiling CheckEmptyTransactionTransformer.cpp for Release+Asserts build
In file included from /home/mvklingeren/ec/build/cling-src/tools/cling/lib/MetaProcessor/Display.cpp:12:
/home/mvklingeren/ec/build/cling-src/tools/cling/lib/MetaProcessor/../../include/cling/Interpreter/Interpreter.h:15:10: fatal error: 'llvm/ADT/OwningPtr.h' file not found

include "llvm/ADT/OwningPtr.h"

     ^

In file included from /home/mvklingeren/ec/build/cling-src/tools/cling/lib/Interpreter/CheckEmptyTransactionTransformer.cpp:13:
/home/mvklingeren/ec/build/cling-src/tools/cling/lib/Interpreter/../../include/cling/Interpreter/Transaction.h:18:10: fatal error: 'llvm/ADT/OwningPtr.h' file not found

include "llvm/ADT/OwningPtr.h"

     ^

1 error generated.
/bin/rm: cannot remove ‘/home/mvklingeren/ec/build/builddir/tools/cling/lib/Interpreter/Release+Asserts/CheckEmptyTransactionTransformer.d.tmp’: No such file or directory
/home/mvklingeren/ec/build/cling-src/Makefile.rules:1519: recipe for target '/home/mvklingeren/ec/build/builddir/tools/cling/lib/Interpreter/Release+Asserts/CheckEmptyTransactionTransformer.o' failed
make[4]: *** [/home/mvklingeren/ec/build/builddir/tools/cling/lib/Interpreter/Release+Asserts/CheckEmptyTransactionTransformer.o] Error 1
make[4]: Leaving directory '/home/mvklingeren/ec/build/builddir/tools/cling/lib/Interpreter'
/home/mvklingeren/ec/build/cling-src/Makefile.rules:937: recipe for target 'Interpreter/.makeall' failed
make[3]: *** [Interpreter/.makeall] Error 2
make[3]: *** Waiting for unfinished jobs....
llvm[4]: Compiling InputValidator.cpp for Release+Asserts build
1 error generated.
/bin/rm: cannot remove ‘/home/mvklingeren/ec/build/builddir/tools/cling/lib/MetaProcessor/Release+Asserts/Display.d.tmp’: No such file or directory
/home/mvklingeren/ec/build/cling-src/Makefile.rules:1519: recipe for target '/home/mvklingeren/ec/build/builddir/tools/cling/lib/MetaProcessor/Release+Asserts/Display.o' failed
make[4]: *** [/home/mvklingeren/ec/build/builddir/tools/cling/lib/MetaProcessor/Release+Asserts/Display.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory '/home/mvklingeren/ec/build/builddir/tools/cling/lib/MetaProcessor'
/home/mvklingeren/ec/build/cling-src/Makefile.rules:937: recipe for target 'MetaProcessor/.makeall' failed
make[3]: *** [MetaProcessor/.makeall] Error 2
make[3]: Leaving directory '/home/mvklingeren/ec/build/builddir/tools/cling/lib'
/home/mvklingeren/ec/build/cling-src/Makefile.rules:878: recipe for target 'all' failed
make[2]: *** [all] Error 1
make[2]: Leaving directory '/home/mvklingeren/ec/build/builddir/tools/cling'
/home/mvklingeren/ec/build/cling-src/Makefile.rules:963: recipe for target 'all' failed
make[1]: *** [all] Error 1
make[1]: Leaving directory '/home/mvklingeren/ec/build/builddir/tools'
/home/mvklingeren/ec/build/cling-src/Makefile.rules:878: recipe for target 'all' failed
make: *** [all] Error 1
subprocess.CalledProcessError: Command 'make -j2' returned non-zero exit status 2

┌──────────────────────────────────────────────────────────────────────────────┐
│ Clean up │
└──────────────────────────────────────────────────────────────────────────────┘
Remove directory: /home/mvklingeren/ec/build/builddir
Remove directory: /tmp/cling-obj/
Create output directory: /home/mvklingeren/ec/build/cling-0.1-1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.