Skip to content

nikhedonia/docker-cling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

docker-cling

CERN's cling is a Just-in-time compiler which empowers you to write and execute C++14 scripts.

#how to use the container:

##interactive mode

docker run -it --rm nikhedonia/cling cling

##use file

cat myfile.cpp | docker run -it --rm nikhedonia/cling cling

##note

cling runs in a container, so it has no access to files of your machine unless you explicitly mount them.

eg:

docker run -v /path/to/my/Project:/src -it --rm nikhedonia/cling cling -I/src

for more info i suggest visiting docker.com

links

https://root.cern.ch/drupal/content/cling-brief https://root.cern.ch/drupal/content/cling-goes-public

Example usage of cling:

//test.cpp
#include<iostream>
using namespace std;
int main(){
  cout << "hello Cern" <<endl
}
cat test.cpp | cling -std=c++14
#!/usr/bin/cling
#include <cmath>
double x = std::sin(3.1)
//no ';' -> prints 4.158066e-02
.L libz
// .L metacommand => links libz at runntime
#include "zlib.h"
zlibVersion()
// prints (const char * const) "1.2.3.4"

#ToDo

  • discover best practices
  • write a script to allow a convinient usage eg: 'cling test.cpp'

About

dockerized c++ interpreter based on clang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published