Coder Social home page Coder Social logo

jupyter-xeus / xeus-cling Goto Github PK

View Code? Open in Web Editor NEW
3.0K 67.0 292.0 10.61 MB

Jupyter kernel for the C++ programming language

License: BSD 3-Clause "New" or "Revised" License

CMake 13.57% C++ 73.56% Python 1.41% Jupyter Notebook 11.46%
c-plus-plus-14 jupyter-kernels

xeus-cling's People

Contributors

anutosh491 avatar ax3l avatar bluescarni avatar dimitry-ishenko avatar dokempf avatar gouarin avatar hahnjo avatar hind-m avatar invokes-su avatar joelsjogren avatar johanmabille avatar jtpio avatar lingxuxiong avatar marcono1234 avatar martinrenou avatar minrk avatar nthiery avatar r9y9 avatar sean-parent avatar serge-sans-paille avatar simeonehrig avatar sylvaincorlay avatar thomasjm avatar wolfv avatar xgdgsc 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

xeus-cling's Issues

Notebook output

Notebook output fixing implies:

  • redirect std::cout and std::err of the process to the notebook
  • ensures the result of an execution is not output in presence of a semicolon. This may require to work directly with clingInterpreter instead of MetaProcessor.

[Packaging]

Meta issue to be completed on packaging

  • build-time dependence on cppzmq, pugixml (to upload on QuantStack channel.)

Kernel automatic restarts

I set up xeus-cling within a docker image (built on top of ubuntu 16.04, installed on top of clean miniconda). In a certain cell that executes a function call the kernel restarts with no error message. The same notebook executes just fine in a local conda environment (outside the docker container). I haven't been able to find root cause for this any suggestions? Also the c++ code compiles and runs just fine outside the notebook, within the docker container.

'xeus C++11' kernel not appear in the jupyter notebook menu.

Hi,
I installed the xeus-cling followed by the instruction of following:

conda create -n cling
source activate cling

conda install cling -c QuantStack -c conda-forge
conda install xeus-cling -c QuantStack -c conda-forge
conda install notebook -c conda-forge

But the 'xeus C++11' kernel does not appear in the jupyter notebook menu.

Here is some debug informations:

(cling) root@7bac7e6baf53:/notebooks# which jupyter
/root/miniconda3/bin/jupyter
(cling) root@7bac7e6baf53:/notebooks# ll /root/miniconda3/envs/cling/share/jupyter/kernels/
total 16
drwxr-xr-x 4 root root 4096 Feb  1 22:45 ./
drwxr-xr-x 4 root root 4096 Feb  1 22:45 ../
drwxr-xr-x 2 root root 4096 Feb  1 22:45 xeus-cling-cpp11/
drwxr-xr-x 2 root root 4096 Feb  1 22:45 xeus-cling-cpp14/

Can anyone tell me why?
Thanks very much!

Docker image

Having a docker image built would make it a lot simpler to deploy this kernel in environments where it doesn't yet work easily (osx etc)

Cells missing a closing brace are silently ignored.

Cells containing non-closing braced are silently ignored:
image
This is confusing to our students that often forget to close some brace and wonder why their function/... is not defined after.
Having such cells be legal to enable opening a new lexical context could possibly make sense (and actually be a way to enable redefining variables/functions. But otherwise raising an error would be best.
cc: @gouarin

PackageNotFoundError MacOS

I attempted to download -xeus-cling using both the commands

conda install -c quantstack xeus-cling

and

conda install xeus-cling -c QuantStack -c conda-forge

Both of these resulted in the following output:

Fetching package metadata .............
PackageNotFoundError: Packages missing in current channels:
xeus-cling
We have searched for the packages in the following channels:
https://conda.anaconda.org/quantstack/osx-64
https://conda.anaconda.org/quantstack/noarch
https://repo.continuum.io/pkgs/main/osx-64
https://repo.continuum.io/pkgs/main/noarch
https://repo.continuum.io/pkgs/free/osx-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/osx-64
https://repo.continuum.io/pkgs/r/noarch
https://repo.continuum.io/pkgs/pro/osx-64
https://repo.continuum.io/pkgs/pro/noarch

What can I do to download xeus-cling successfully?

Windows support

Hello!
I followed the installation instructions in the README and I also verified that I had the appropriate dependencies installed according to the table posted at the end of the README file. Everything looks fine.

Then, I opened Jupyter and created a notebook selecting xeus-C++14 from the drop-down menu, but as soon as the notebook opens and the Kernel is initialized, a pop-up window is shown with the message: xeus-cling.exe has stopped working, and I can't do anything else.

In the console, it generates the following Error:

ERROR in cling::CIFactory::createCI():
resource directory C:/bld/xeus-cling_1517845693970/_b_env/Library\lib\clang\5.0.0 not found!
input_line_1:1:10: fatal error: 'new' file not found
#include

I read that by December 2017 you were working on Xeus-cling for Windows and that you were solving some issues... I couldn't find if you solved them or not, and if Xeus-cling is working fine in Windows now.

Is this one of this issues? Do you know a way to solve it?

Thanks!

pip install from PyPI into virtualenv

This is a feature request for:

pip install xeus-cling

I would love to use xeus-cling without Conda by simply installing it from PyPI into a virtualenv.

Mac OSX and introspection

The pager output is not opened when we have the command

?std::vector

whereas if we use SHIFT+TAB and click on ^, it works.

Failing to load a dynamic library that loads in plain cling

I am trying to load a dynamic library, and am getting a failure:
image

The same commands work with plain cling from the same conda environment, in the same directory.
MLV is from debian package libmlv0-dev. One thing that may have an influence is that MLV.h is not in the system dir but in the same directory as the notebook. In any cases, the error message looks dubious.

I could try with other libraries if useful.

Add a mechanism to plug in third-party magics

I would like to add a magic word to xeus-cling to implement a fairly domain-specific feature. As such, it would not make sense to propose a patch upstream, and it would be cumbersome to have to deploy and maintain a patched version of xeus-cling.

Python-based kernel implementations allow plugging in custom magic words by adding the corresponding module to the PYTHONPATH.

As far as I understand the current mechanism to add magics in xeus-cling is to book them in xcpp_interpreter::init_magic and implement them as classes inheriting from xmagics::line/cell/line_cell. To allow the addition of third-party magics I guess one would need to add a method like

void xcpp_interpreter::add_magic(const string& magic_name, xmagic_type magic) {
      auto &mgr = preamble_manager["magics"].get_cast<xmagics_manager>();
      mgr.register_magic(magic_name, magic);
}

And some smart way to call that from third-party magics implementations -- which I cannot guess because I don't know enough about a kernel's internals.

Feature request: traceback on segfaults or exceptions (dreaming aloud)

Currently, a segmentation fault in the code results in the kernel dying. While this is a fair enough behavior (after all, this is a segfault of the whole kernel process, and there is not much to do to recover from it), some clue for the reader would be helpful. A minimum would be something like "Segmentation fault" or "the code run by the kernel triggered a segmentation fault". In case of an exception, a printout of the exception itself. Really nice would be a stack trace. Full dream would be a (optional?, post-mortem) debugger prompt.

Of course this is much lower-level, and thus presumably harder than in IPython. In particular there is the question of whether to systematicaclly interpret with debugging symbols on. And once again, this might really be a cling issue rather than xeus-cling.

Context: our students where learning 2D vectors this week, and got a lot of such segfaults. They had no clue on what to do when the kernel crashed. A stacktrace would be a super useful information for them to analyse their code and fix the bug.

failed to start on miniconda3

on Ubuntu 16.04 64bit I did the standard conda installation(the 3 steps conda install at the homepage here), when I run 'jupyter notebook" I got a backtrace:
/home/xx/miniconda3/compiler_compat/ld: cannot find -lpthread
/home/xx/miniconda3/compiler_compat/ld: cannot find -lc
collect2: error: ld returned 1 exit status
Traceback (most recent call last):
File "/home/xx/miniconda3/bin/jupyter-notebook", line 4, in
import notebook.notebookapp
File "/home/xx/miniconda3/lib/python3.6/site-packages/notebook/notebookapp.py", line 42, in
from zmq.eventloop import ioloop
File "/home/xx/miniconda3/lib/python3.6/site-packages/zmq/init.py", line 34, in
from zmq import backend
File "/home/xx/miniconda3/lib/python3.6/site-packages/zmq/backend/init.py", line 40, in
reraise(*exc_info)
File "/home/xx/miniconda3/lib/python3.6/site-packages/zmq/utils/sixcerpt.py", line 34, in reraise
raise value
File "/home/xx/miniconda3/lib/python3.6/site-packages/zmq/backend/init.py", line 27, in
_ns = select_backend(first)
File "/home/xx/miniconda3/lib/python3.6/site-packages/zmq/backend/select.py", line 26, in select_backend
mod = import(name, fromlist=public_api)
File "/home/xx/miniconda3/lib/python3.6/site-packages/zmq/backend/cython/init.py", line 6, in
from . import (constants, error, message, context,
ImportError: libzmq.so.5.1.2: cannot open shared object file: No such file or directory

Note, this is not a fresh new miniconda3, the existing packages are:

packages in environment at /home/xx/miniconda3:

asn1crypto 0.22.0 py36h265ca7c_1
bash_kernel 0.7.1
bleach 2.0.0 py36h688b259_0
ca-certificates 2017.08.26 h1d4fec5_0
certifi 2017.7.27.1 py36h8b7b77e_0
cffi 1.10.0 py36had8d393_1
chardet 3.0.4 py36h0f667ec_1
clangdev 3.9.1 cling_5 [cling] QuantStack
cling 0.3.post2 cling_4 [cling] QuantStack
cling-patches 1 0 QuantStack
conda 4.3.30 py36h5d9f9f4_0
conda-env 2.6.0 0 conda-forge
cppzmq 4.2.1 0 QuantStack
cryptography 2.0.3 py36ha225213_1
cryptopp 5.6.5 3 QuantStack
cycler 0.10.0 py36h93f1223_0
dbus 1.10.22 h3b5a359_0
decorator 4.1.2 py36hd076ac8_0
entrypoints 0.2.3 py36h1aec115_2
expat 2.2.4 h6ea4f2b_2
fontconfig 2.12.4 h88586e7_1
freetype 2.8 h52ed37b_0
gcc-6 6.1.0 0 QuantStack
glib 2.53.6 hc861d11_1
gmp 6.1.2 hb3b607b_0
gst-plugins-base 1.12.2 he3457e5_0
gstreamer 1.12.2 h4f93127_0
html5lib 0.999999999 py36h2cfc398_0
icu 58.2 h211956c_0
idna 2.6 py36h82fb2a8_1
intel-openmp 2018.0.0 h15fc484_7
ipykernel 4.6.1 py36hbf841aa_0
ipython 6.1.0 py36hc72a948_1
ipython_genutils 0.2.0 py36hb52b0d5_0
ipywidgets 7.0.0 py36h7b55c3a_0
isl 0.16.1 0 QuantStack
jedi 0.10.2 py36h552def0_0
jinja2 2.9.6 py36h489bce4_1
jpeg 9b h376031c_1
jsonschema 2.6.0 py36h006f8b5_0
jupyter 1.0.0 py36h9896ce5_0
jupyter_client 5.1.0 py36h614e9ea_0
jupyter_console 5.2.0 py36he59e554_1
jupyter_core 4.3.0 py36h357a921_0
libcxx 3.9.1 0 QuantStack
libedit 3.1 heed3624_0
libffi 3.2.1 h4deb6c0_3
libgcc-6 6.2.0 2 QuantStack
libgcc-ng 7.2.0 h7cc24e2_2
libgfortran-ng 7.2.0 h9f7466a_2
libpng 1.6.32 hda9c8bc_2
libsodium 1.0.13 h31c71d8_2
libstdcxx-ng 7.2.0 h7a57d05_2
libxcb 1.12 h84ff03f_3
libxml2 2.9.4 h6b072ca_5
llvmdev 3.9.1 cling_5 [cling] QuantStack
markupsafe 1.0 py36hd9260cd_1
matplotlib 2.1.0 py36hba5de38_0
mistune 0.7.4 py36hbab8784_0
mkl 2018.0.0 hb491cac_4
mpc 1.0.3 4 QuantStack
mpfr 3.1.5 0 QuantStack
nbconvert 5.3.1 py36hb41ffb7_0
nbformat 4.4.0 py36h31c9010_0
ncurses 6.0 h06874d7_1
notebook 5.2.2 py36_0 conda-forge
numpy 1.13.3 py36ha12f23b_0
openssl 1.0.2l h077ae2c_5
pandas 0.20.3 py36h842e28d_2
pandoc 1.19.2.1 hea2e7c5_1
pandocfilters 1.4.2 py36ha6701b7_1
patsy 0.4.1 py36ha3be15e_0
pcre 8.41 hc71a17e_0
pexpect 4.2.1 py36h3b9d41b_0
pickleshare 0.7.4 py36h63277f8_0
pip 9.0.1 py36h8ec8b28_3
prompt_toolkit 1.0.15 py36h17d85b1_0
ptyprocess 0.5.2 py36h69acd42_0
pycosat 0.6.2 py36h1a0ea17_1
pycparser 2.18 py36hf9f622e_1
pygments 2.2.0 py36h0d3125c_0
pyopenssl 17.2.0 py36h5cc804b_0
pyparsing 2.2.0 py36hee85983_1
pyqt 5.6.0 py36h0386399_5
pysocks 1.6.7 py36hd97a5b1_1
python 3.6.3 hc9025b9_1
python-dateutil 2.6.1 py36h88d3b88_1
pytz 2017.2 py36hc2ccc2a_1
pyzmq 16.0.2 py36h3b0cf96_2
qt 5.6.2 h974d657_12
qtconsole 4.3.1 py36h8f73b5b_0
readline 7.0 hac23ff0_3
redis-kernel 0.5.2
requests 2.18.4 py36he2e5f8d_1
ruamel_yaml 0.11.14 py36ha2fb22d_2
scikit-learn 0.19.1 py36h7aa7ec6_0
scipy 0.19.1 py36h9976243_3
seaborn 0.8.0 py36h197244f_0
setuptools 36.5.0 py36he42e2e1_0
simplegeneric 0.8.1 py36h2cb9092_0
sip 4.18.1 py36h51ed4ed_2
six 1.10.0 py36hcac75e4_1
sqlite 3.20.1 h6d8b0f3_1
statsmodels 0.8.0 py36h8533d0b_0
system 5.8 2 QuantStack
terminado 0.6 py36ha25a19f_0
testpath 0.3.1 py36h8cadb63_0
tk 8.6.7 h5979e9b_1
tornado 4.5.2 py36h1283b2a_0
traitlets 4.3.2 py36h674d592_0
urllib3 1.22 py36hbe7ace6_0
util-linux 2.21 0 QuantStack
wcwidth 0.1.7 py36hdf4376a_0
webencodings 0.5.1 py36h800622e_1
wheel 0.29.0 py36he7f4e38_1
widgetsnbextension 3.0.2 py36hd01bb71_1
xeus 0.8.0 0 QuantStack
xeus-cling 0.0.7 0 QuantStack
xtl 0.3.6 0 QuantStack
xz 5.2.3 h2bcbf08_1
yaml 0.1.7 h96e3832_1
zeromq 4.2.1 1 QuantStack
zlib 1.2.11 hfbfcf68_1

Package Missing - can't install

On macOS 10.13.1:
I've installed jupyter by installing Anaconda, installing cling when fine. But when I try to install xeus-cling I get the following:

$ conda install xeus-cling -c QuantStack -c conda-forge
Fetching package metadata ...............

PackageNotFoundError: Packages missing in current channels:
            
  - xeus-cling

We have searched for the packages in the following channels:
            
  - https://conda.anaconda.org/QuantStack/osx-64
  - https://conda.anaconda.org/QuantStack/noarch
  - https://conda.anaconda.org/conda-forge/osx-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://repo.continuum.io/pkgs/main/osx-64
  - https://repo.continuum.io/pkgs/main/noarch
  - https://repo.continuum.io/pkgs/free/osx-64
  - https://repo.continuum.io/pkgs/free/noarch
  - https://repo.continuum.io/pkgs/r/osx-64
  - https://repo.continuum.io/pkgs/r/noarch
  - https://repo.continuum.io/pkgs/pro/osx-64
  - https://repo.continuum.io/pkgs/pro/noarch

Running cells with declarations multiple times: redefinition error - any workarounds?

If I run a cell where I am defining a variable or function multiple times, I get an error for redefinition of that variable or function, which makes sense. But in Jupyter it is nice to quickly test a few variations of a function without restarting the entire kernel. Is there a clever way around this? Python has a magic function to reset specific variables or the whole namespace, is some version of this available?

jupyter notebook crashes on Linux Mint 18.2

Setup:

0> conda info
Current conda install:

               platform : linux-64
          conda version : 4.3.30
       conda is private : False
      conda-env version : 4.3.30
    conda-build version : 3.0.27
         python version : 2.7.14.final.0
       requests version : 2.18.4
       root environment : /home/username/local/share/ana2  (writable)
    default environment : /home/username/local/share/ana2
       envs directories : /home/username/local/share/ana2/envs
                          /home/username/.conda/envs
          package cache : /home/username/local/share/ana2/pkgs
                          /home/username/.conda/pkgs
           channel URLs : https://conda.anaconda.org/anaconda-fusion/linux-64
                          https://conda.anaconda.org/anaconda-fusion/noarch
                          https://repo.continuum.io/pkgs/main/linux-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
            config file : /home/username/.condarc
             netrc file : None
           offline mode : False
             user-agent : conda/4.3.30 requests/2.18.4 CPython/2.7.14 Linux/4.8.0-58-generic debian/stretch/sid glibc/2.23    
                UID:GID : 1000:1000

Error:

0> jupyter notebook
/home/username/local/share/ana2/compiler_compat/ld: cannot find -lpthread
/home/username/local/share/ana2/compiler_compat/ld: cannot find -lc
collect2: error: ld returned 1 exit status
Traceback (most recent call last):
  File "/home/username/local/share/ana2/bin/jupyter-notebook", line 4, in <module>
    import notebook.notebookapp
  File "/home/username/local/share/ana2/lib/python2.7/site-packages/notebook/notebookapp.py", line 42, in <module>
    from zmq.eventloop import ioloop
  File "/home/username/local/share/ana2/lib/python2.7/site-packages/zmq/__init__.py", line 34, in <module>
    from zmq import backend
  File "/home/username/local/share/ana2/lib/python2.7/site-packages/zmq/backend/__init__.py", line 40, in <module>
    reraise(*exc_info)
  File "/home/username/local/share/ana2/lib/python2.7/site-packages/zmq/backend/__init__.py", line 27, in <module>
    _ns = select_backend(first)
  File "/home/username/local/share/ana2/lib/python2.7/site-packages/zmq/backend/select.py", line 26, in select_backend
    mod = __import__(name, fromlist=public_api)
  File "/home/username/local/share/ana2/lib/python2.7/site-packages/zmq/backend/cython/__init__.py", line 6, in <module>
    from . import (constants, error, message, context,
ImportError: libzmq.so.5.1.2: cannot open shared object file: No such file or directory

This is a vanilla install. The only thing applied is:

> conda install cling -c QuantStack -c conda-forge
> conda install xeus-cling -c QuantStack -c conda-forge
> conda install notebook -c conda-forge

I already checked my ~/.zshrc and removed PYTHONPATH and the customizations in LD_LIBRARY_PATH.

Further, there seems to be a similar issue with R: ContinuumIO/anaconda-issues#506

And I'm not willing to link libzmq into /lib right now... Any ideas?

problem running

hafez@hafez-pc:~$ jupyter notebook
/home/hafez/anaconda3/compiler_compat/ld: cannot find -lpthread
/home/hafez/anaconda3/compiler_compat/ld: cannot find -lc
collect2: error: ld returned 1 exit status
Traceback (most recent call last):
File "/home/hafez/anaconda3/bin/jupyter-notebook", line 7, in
from notebook.notebookapp import main
File "/home/hafez/anaconda3/lib/python3.6/site-packages/notebook/notebookapp.py", line 42, in
from zmq.eventloop import ioloop
File "/home/hafez/anaconda3/lib/python3.6/site-packages/zmq/init.py", line 34, in
from zmq import backend
File "/home/hafez/anaconda3/lib/python3.6/site-packages/zmq/backend/init.py", line 40, in
reraise(*exc_info)
File "/home/hafez/anaconda3/lib/python3.6/site-packages/zmq/utils/sixcerpt.py", line 34, in reraise
raise value
File "/home/hafez/anaconda3/lib/python3.6/site-packages/zmq/backend/init.py", line 27, in
_ns = select_backend(first)
File "/home/hafez/anaconda3/lib/python3.6/site-packages/zmq/backend/select.py", line 26, in select_backend
mod = import(name, fromlist=public_api)
File "/home/hafez/anaconda3/lib/python3.6/site-packages/zmq/backend/cython/init.py", line 6, in
from . import (constants, error, message, context,
ImportError: libzmq.so.5.1.2: cannot open shared object file: No such file or directory

regex limitation for enclosed braces

We use the standard regex of C++ implementation. The problem of this implementation is that it is not possible to use recursive pattern.

One of the main problem of this is for introspection. It is not possible to have a well defined pattern for enclosed braces.

For example if we have this line

foo(bar(a, b)

and we use SHIFT+TAB in a notebook to have the documentation, instead of having the documentation of bar(a, b), the code try to find the documentation of foo(bar(a,b) which is not possible.

The actual pattern for braces is

\(.*\)

But it should be

\((?:(?>[^()]+|(?R))*)\)

std::regex doesn't provide the recursion. If we use boost, we can have a such pattern but we include a big dependency.

nb_conda support

It would be cool if xeus-cling kernel would be detectable via nb_conda.

Destroyed root environment

I destroyed my root environment by doing:
conda install cling -c QuantStack -c conda-forge
conda install xeus-cling -c QuantStack -c conda-forge
conda install notebook -c conda-forge

Now I cannot use my jupyter notebook anymore: #79

How can I undo it?

introspection on `std::string`

The introspection on std::string doesn't work because it refers to a file in the xml tag file.

std::string is an example but there certainly exists other cases which not work.

So, we have to improve the implementation and check file tag if we don't find a result for other tags.

Missing Functionality

I have been trying to test out the '?' operator in terms of using it to search up classes on cppreference however it has not been working for any of the classes I have tried it on such as std::vector and std::string (I included them before using the '?' operator). The other functionality that isn't working is attempting to include any of the xwidgets. I used

#include "xwidgets/xbutton.hpp"

however it couldn't find the file. I am mentioning both of them here because it seems to me that maybe I didn't fulfill a dependency. The instructions I followed to download xeus-cling are those on the readme so if there is something that isn't on the readme that would enable this functionality that might be the reason.

zeus-cling quit unexpectedly when kernel shutdown

After shutting down the jupyter notebook, zeus-cling crashed.

Here is the terminal information.

[I 14:38:46.793 NotebookApp] Accepting one-time-token-authenticated connection from ::1
[I 14:38:52.434 NotebookApp] Creating new notebook in 
[I 14:38:53.395 NotebookApp] Kernel started: 
[W 14:38:53.422 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20180125143845 (::1) 12.34ms referer=http://localhost:8888/notebooks/Untitled2.ipynb?kernel_name=xeus-cling-cpp14
Warning in cling::IncrementalParser::CheckABICompatibility():
  Possible C++ standard library mismatch, compiled with _LIBCPP_VERSION '4000'
  Extraction of runtime standard library version was: '5000'
[I 14:38:54.990 NotebookApp] Adapting to protocol v5.1 for kernel 
[I 14:38:59.457 NotebookApp] Starting buffering for 

^C[I 14:39:43.747 NotebookApp] interrupted

Serving notebooks from local directory: /Volumes/Samsung_T1
1 active kernel
The Jupyter Notebook is running at:
http://localhost:8888/?token=
Shutdown this notebook server (y/[n])? y
[C 14:39:47.976 NotebookApp] Shutdown confirmed
[I 14:39:47.976 NotebookApp] Shutting down 1 kernel
[I 14:39:48.079 NotebookApp] Kernel shutdown: 92546cfd-a853-4af8-b9d0-1a45e4b2733b

Here is the crash report.

Process:               xeus-cling [80146]
Path:                  /Volumes/VOLUME/*/xeus-cling
Identifier:            xeus-cling
Version:               0
Code Type:             X86-64 (Native)
Parent Process:        python3.5 [80137]
Responsible:           xeus-cling [80146]
User ID:               502

Date/Time:             2018-01-25 14:39:48.034 -0800
OS Version:            Mac OS X 10.13.3 (17D47)
Report Version:        12
Anonymous UUID:        4086B637-2CA9-5596-AEC8-EE109D22D750


Time Awake Since Boot: 170000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Illegal instruction: 4
Termination Reason:    Namespace SIGNAL, Code 0x4
Terminating Process:   exc handler [0]

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   xeus-cling                    	0x000000010cb1a75c xeus::xholder_preamble::~xholder_preamble() + 12
1   xeus-cling                    	0x000000010cb032c2 std::__1::__tree<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, xeus::xholder_preamble>, std::__1::__map_value_compare<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, xeus::xholder_preamble>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::allocator<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, xeus::xholder_preamble> > >::destroy(std::__1::__tree_node<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, xeus::xholder_preamble>, void*>*) + 50
2   xeus-cling                    	0x000000010cb032ad std::__1::__tree<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, xeus::xholder_preamble>, std::__1::__map_value_compare<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, xeus::xholder_preamble>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::allocator<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, xeus::xholder_preamble> > >::destroy(std::__1::__tree_node<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, xeus::xholder_preamble>, void*>*) + 29
3   xeus-cling                    	0x000000010cafb967 xeus::xcpp_interpreter::~xcpp_interpreter() + 247
4   xeus-cling                    	0x000000010cafbb4e xeus::xcpp_interpreter::~xcpp_interpreter() + 14
5   xeus-cling                    	0x000000010cae9bf9 main + 361
6   libdyld.dylib                 	0x00007fff5ee99115 start + 1

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000052  rbx: 0x00007f93224136f0  rcx: 0x0000000000000008  rdx: 0x000000010f949240
  rdi: 0x00007f9322413728  rsi: 0x0000000000000000  rbp: 0x00007ffee3118380  rsp: 0x00007ffee3118380
   r8: 0x0000000000000002   r9: 0x00007f93226b3de0  r10: 0x00007ffee31187f8  r11: 0x000000010f8d0fc0
  r12: 0x0000000000000000  r13: 0x0000000000000000  r14: 0x00007f93240012a0  r15: 0x000000010f096328
  rip: 0x000000010cb1a75c  rfl: 0x0000000000010202  cr2: 0x000000010fc6a600
  
Logical CPU:     6
Error Code:      0x00000000
Trap Number:     6


Binary Images:
       0x10cae7000 -        0x10eea4ff7 +xeus-cling (0) <B9EA9E34-C272-35FB-8200-EF6E895996FC> /Volumes/VOLUME/*/xeus-cling
       0x10f8bf000 -        0x10f942fff +libc++.1.dylib (0) <B676C7A9-B57C-3310-8AC7-928098D5FC41> /Volumes/VOLUME/*/libc++.1.dylib
       0x10f99d000 -        0x10fad3fff +libxeus.dylib (0) <E9594B70-739C-37B3-8847-7DC7A56AB3F9> /Volumes/VOLUME/*/libxeus.dylib
       0x10fbe5000 -        0x10fc01ff7 +libz.1.dylib (0) <BEA2C953-806B-3A07-9BB6-3B59EF6388C7> /Volumes/VOLUME/*/libz.1.dylib
       0x10fc0b000 -        0x10fc49fff +libc++abi.1.dylib (0) <914E8080-B76B-3341-9592-D7701E6CCC5F> /Volumes/VOLUME/*/libc++abi.1.dylib
       0x10fc5b000 -        0x10fcc9ff7 +libzmq.5.1.1.dylib (0) <CC71CE4C-5074-367C-8FC0-A7B3F18FEBD9> /Volumes/VOLUME/*/libzmq.5.1.1.dylib
       0x114d0c000 -        0x114d5698f  dyld (519.2.2) <6695F30B-4E88-3C0B-9867-7D738C44A3E6> /usr/lib/dyld
    0x7fff37462000 -     0x7fff378fbfff  com.apple.CoreFoundation (6.9 - 1451) <739D6558-3DF3-3181-AA07-BBE3882D3B7F> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x7fff5c703000 -     0x7fff5c736fff  libclosured.dylib (519.2.2) <48051216-5647-3643-B979-B77D0FD20011> /usr/lib/closure/libclosured.dylib
    0x7fff5c8ad000 -     0x7fff5c8aeff3  libDiagnosticMessagesClient.dylib (104) <9712E980-76EE-3A89-AEA6-DF4BAF5C0574> /usr/lib/libDiagnosticMessagesClient.dylib
    0x7fff5cc15000 -     0x7fff5cc16ff3  libSystem.B.dylib (1252) <47329E26-DC23-3EBA-9461-37755368327D> /usr/lib/libSystem.B.dylib
    0x7fff5cecb000 -     0x7fff5cf21fff  libc++.1.dylib (400.9) <FCF5E1F6-2B04-3545-8004-F3AB32FED172> /usr/lib/libc++.1.dylib
    0x7fff5cf22000 -     0x7fff5cf46ff7  libc++abi.dylib (400.7) <217656D5-BC40-37FF-B322-91CB2AAD4F34> /usr/lib/libc++abi.dylib
    0x7fff5d9f4000 -     0x7fff5dc1bffb  libicucore.A.dylib (59152.0.1) <E628882C-6F83-3DCD-B62A-2FE6F77EF6F7> /usr/lib/libicucore.A.dylib
    0x7fff5e298000 -     0x7fff5e6893b7  libobjc.A.dylib (723) <37A7D77E-952C-3F5D-970B-3CDE349B2322> /usr/lib/libobjc.A.dylib
    0x7fff5ec80000 -     0x7fff5ec92ffb  libz.1.dylib (70) <48C67CFC-940D-3857-8DAD-857774605352> /usr/lib/libz.1.dylib
    0x7fff5ed30000 -     0x7fff5ed34ff7  libcache.dylib (80) <354F3B7D-404E-3398-9EBF-65CA2CE65211> /usr/lib/system/libcache.dylib
    0x7fff5ed35000 -     0x7fff5ed3fff3  libcommonCrypto.dylib (60118.30.2) <674286D3-7744-36A3-9AAA-49DFCD97A986> /usr/lib/system/libcommonCrypto.dylib
    0x7fff5ed40000 -     0x7fff5ed47fff  libcompiler_rt.dylib (62) <4487CFBA-A5D7-3282-9E6B-94CAD7BE507E> /usr/lib/system/libcompiler_rt.dylib
    0x7fff5ed48000 -     0x7fff5ed50ffb  libcopyfile.dylib (146.30.2) <2C7C67D7-562B-3FFA-973D-BACF4C10E1EC> /usr/lib/system/libcopyfile.dylib
    0x7fff5ed51000 -     0x7fff5edd6fff  libcorecrypto.dylib (562.30.10) <8A53EFE1-AFCA-3676-BEE1-FA5ED9F0E222> /usr/lib/system/libcorecrypto.dylib
    0x7fff5ee5e000 -     0x7fff5ee97ff7  libdispatch.dylib (913.30.4) <7D0E3183-282B-3FEE-A734-2C0ADC092084> /usr/lib/system/libdispatch.dylib
    0x7fff5ee98000 -     0x7fff5eeb5ff7  libdyld.dylib (519.2.2) <C50D02BC-A333-3313-B787-02F255A6783F> /usr/lib/system/libdyld.dylib
    0x7fff5eeb6000 -     0x7fff5eeb6ffb  libkeymgr.dylib (28) <6D84A96F-C65B-38EC-BDB5-21FD2C97E7B2> /usr/lib/system/libkeymgr.dylib
    0x7fff5eec4000 -     0x7fff5eec4ff7  liblaunch.dylib (1205.30.29) <E66F58ED-C15E-3DFB-BC22-A861E13918C6> /usr/lib/system/liblaunch.dylib
    0x7fff5eec5000 -     0x7fff5eec9ffb  libmacho.dylib (900.0.1) <756F2553-07B6-3B42-ACEA-2F0F1A5E8D0F> /usr/lib/system/libmacho.dylib
    0x7fff5eeca000 -     0x7fff5eeccff3  libquarantine.dylib (86) <6AC8773F-3817-3D82-99C2-01BABB9C3CBB> /usr/lib/system/libquarantine.dylib
    0x7fff5eecd000 -     0x7fff5eeceff3  libremovefile.dylib (45) <912FA211-DD8C-3C92-8424-21B89F8B10FD> /usr/lib/system/libremovefile.dylib
    0x7fff5eecf000 -     0x7fff5eee6fff  libsystem_asl.dylib (356.1.1) <94972913-9DF0-3C78-847C-43E58919E3DA> /usr/lib/system/libsystem_asl.dylib
    0x7fff5eee7000 -     0x7fff5eee7fff  libsystem_blocks.dylib (67) <F2493BB5-B1C6-3C4D-9F1F-1B402E0F1DB7> /usr/lib/system/libsystem_blocks.dylib
    0x7fff5eee8000 -     0x7fff5ef71ff7  libsystem_c.dylib (1244.30.3) <E0136C71-0648-36F0-9F84-82EA2748A8D7> /usr/lib/system/libsystem_c.dylib
    0x7fff5ef72000 -     0x7fff5ef75ffb  libsystem_configuration.dylib (963.30.1) <0F8D0B76-4F7D-34EC-AB6C-50F9465809DA> /usr/lib/system/libsystem_configuration.dylib
    0x7fff5ef76000 -     0x7fff5ef79ffb  libsystem_coreservices.dylib (51) <21A488D0-2D07-344E-8631-CC8B2A246F35> /usr/lib/system/libsystem_coreservices.dylib
    0x7fff5ef7a000 -     0x7fff5ef7bfff  libsystem_darwin.dylib (1244.30.3) <2F750CB1-BC26-3FA3-AE59-553EE30D451B> /usr/lib/system/libsystem_darwin.dylib
    0x7fff5ef7c000 -     0x7fff5ef82ff7  libsystem_dnssd.dylib (878.30.4) <EB9BB165-45A4-367C-B33A-688D4F383A95> /usr/lib/system/libsystem_dnssd.dylib
    0x7fff5ef83000 -     0x7fff5efccff7  libsystem_info.dylib (517.30.1) <7D79E167-4B5C-3833-81EE-3AF3FB53616D> /usr/lib/system/libsystem_info.dylib
    0x7fff5efcd000 -     0x7fff5eff2ff7  libsystem_kernel.dylib (4570.41.2) <5155A4C3-825B-3178-AC51-0D2D2F2A6618> /usr/lib/system/libsystem_kernel.dylib
    0x7fff5eff3000 -     0x7fff5f03efcb  libsystem_m.dylib (3146) <ABB1B85F-9FFE-31B8-AD4F-E39A30794A93> /usr/lib/system/libsystem_m.dylib
    0x7fff5f03f000 -     0x7fff5f05efff  libsystem_malloc.dylib (140.40.1) <36B22C99-D772-3039-9A4C-AA31389965E1> /usr/lib/system/libsystem_malloc.dylib
    0x7fff5f05f000 -     0x7fff5f103ff3  libsystem_network.dylib (1229.30.11) <40BAD301-8744-3AD8-A688-E7925C587B00> /usr/lib/system/libsystem_network.dylib
    0x7fff5f104000 -     0x7fff5f10effb  libsystem_networkextension.dylib (767.40.1) <CEDC330D-28F0-3902-BEB0-10B92ACEC69F> /usr/lib/system/libsystem_networkextension.dylib
    0x7fff5f10f000 -     0x7fff5f118ff3  libsystem_notify.dylib (172) <98EA3D62-7C86-30DE-8261-D020D2F1EFF3> /usr/lib/system/libsystem_notify.dylib
    0x7fff5f119000 -     0x7fff5f120ff7  libsystem_platform.dylib (161.20.1) <C049250F-8C35-314D-810F-4E28AEAED983> /usr/lib/system/libsystem_platform.dylib
    0x7fff5f121000 -     0x7fff5f12cfff  libsystem_pthread.dylib (301.30.1) <ABA848E1-6978-3B42-A3A7-608B2C36FA93> /usr/lib/system/libsystem_pthread.dylib
    0x7fff5f12d000 -     0x7fff5f130ff3  libsystem_sandbox.dylib (765.40.2) <922D3D15-AB4C-3F1A-A94F-39214AF1ADB3> /usr/lib/system/libsystem_sandbox.dylib
    0x7fff5f131000 -     0x7fff5f132ff3  libsystem_secinit.dylib (30) <F06ADB8F-9E94-34A7-B3C9-2C22FDD14BAD> /usr/lib/system/libsystem_secinit.dylib
    0x7fff5f133000 -     0x7fff5f13aff7  libsystem_symptoms.dylib (820.30.7) <DC3586C2-AA56-3419-88D3-FC0DBF08E3C0> /usr/lib/system/libsystem_symptoms.dylib
    0x7fff5f13b000 -     0x7fff5f14eff7  libsystem_trace.dylib (829.30.14) <69EBF017-D40F-30D7-9B0B-BFC862D761A5> /usr/lib/system/libsystem_trace.dylib
    0x7fff5f150000 -     0x7fff5f155ff7  libunwind.dylib (35.3) <6D4FCD49-D2A9-3233-95C7-A7635CE265F2> /usr/lib/system/libunwind.dylib
    0x7fff5f156000 -     0x7fff5f182ff7  libxpc.dylib (1205.30.29) <F7E5F1BC-614B-39CB-B6CE-92A9C7B7EC0B> /usr/lib/system/libxpc.dylib

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 209964
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=251.7M resident=0K(0%) swapped_out_or_unallocated=251.7M(100%)
Writable regions: Total=125.4M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=125.4M(100%)
 
                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Kernel Alloc Once                    8K        2 
MALLOC                           117.0M       26 
MALLOC guard page                   16K        4 
STACK GUARD                       56.0M        2 
Stack                             8192K        2 
VM_ALLOCATE                         20K        5 
__DATA                            6212K       54 
__LINKEDIT                       197.9M        9 
__TEXT                            53.8M       51 
__UNICODE                          560K        2 
mapped file                       3584K        9 
shared memory                       12K        4 
===========                     =======  ======= 
TOTAL                            442.9M      158 


Code reformating

For our students (and for us trying to understand their program!), it would be super helpful to have a simple code reformater. At least that would do reindentation.

This is probably more an issue for the cell editor (Code::Mirror) rather than xeus-cling. Alas the former does not seem to currently support code reformating anymore, nor in the foreseable future:
http://codemirror.977696.n3.nabble.com/codemirror-3-0-format-preloaded-textarea-code-td4026907.html

I created this issue to keep track of how many xeus-cling users would be interested by the feature, and if sufficiently many see if we could do something about it.

using std a posteriori does not fix endl lookup

If one forgets to "use std" before accessing "endl", then "using namespace std" a posteriori does not resolve the lookup:

In[1] cout << 1 << endl;

input_line_7:2:2: error: use of undeclared identifier 'cout'; did you mean 'std::cout'?
 cout << 1 << endl;
 ^~~~
...

All good for now.

In[2] using namespace std;

One would now expect the following to work, but it does not:

In[3] cout << 1 << endl;

input_line_9:2:15: error: reference to overloaded function could not be resolved; did you mean to call it?
 cout << 1 << endl;
              ^~~~
...

Full transcript in
test-namespace-endl.pdf

issue installing on Linux

Hi, after the creating a new environment, I get this error on the first Conda install for Linux (latest version of Ubuntu). I installed on Ubuntu several months ago and it installed fine, but this is a new issue. Let me know if there is a solution. Thanks!

openssl 1.0.2l: ############################################################################# | 100% 
Preparing transaction: failed

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/home/mohit/miniconda3/lib/python3.6/site-packages/conda/exceptions.py", line 743, in __call__
        return func(*args, **kwargs)
      File "/home/mohit/miniconda3/lib/python3.6/site-packages/conda/cli/main.py", line 78, in _main
        exit_code = do_call(args, p)
      File "/home/mohit/miniconda3/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 76, in do_call
        exit_code = getattr(module, func_name)(args, parser)
      File "/home/mohit/miniconda3/lib/python3.6/site-packages/conda/cli/main_install.py", line 11, in execute
        install(args, parser, 'install')
      File "/home/mohit/miniconda3/lib/python3.6/site-packages/conda/cli/install.py", line 255, in install
        handle_txn(progressive_fetch_extract, unlink_link_transaction, prefix, args, newenv)
      File "/home/mohit/miniconda3/lib/python3.6/site-packages/conda/cli/install.py", line 285, in handle_txn
        unlink_link_transaction.execute()
      File "/home/mohit/miniconda3/lib/python3.6/site-packages/conda/core/link.py", line 220, in execute
        self.verify()
      File "/home/mohit/miniconda3/lib/python3.6/site-packages/conda/common/io.py", line 415, in decorated
        return f(*args, **kwds)
      File "/home/mohit/miniconda3/lib/python3.6/site-packages/conda/core/link.py", line 197, in verify
        self.prepare()
      File "/home/mohit/miniconda3/lib/python3.6/site-packages/conda/core/link.py", line 189, in prepare
        stp.remove_specs, stp.update_specs)
      File "/home/mohit/miniconda3/lib/python3.6/site-packages/conda/core/link.py", line 253, in _prepare
        for prec, pcrec in zip(link_precs, pkg_cache_recs_to_link))
      File "/home/mohit/miniconda3/lib/python3.6/site-packages/conda/core/link.py", line 253, in <genexpr>
        for prec, pcrec in zip(link_precs, pkg_cache_recs_to_link))
      File "/home/mohit/miniconda3/lib/python3.6/site-packages/conda/gateways/disk/read.py", line 92, in read_package_info
        index_json_record = read_index_json(epd)
      File "/home/mohit/miniconda3/lib/python3.6/site-packages/conda/gateways/disk/read.py", line 112, in read_index_json
        record = IndexJsonRecord(**json.load(fi))
      File "/home/mohit/miniconda3/lib/python3.6/json/__init__.py", line 299, in load
        parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
      File "/home/mohit/miniconda3/lib/python3.6/json/__init__.py", line 354, in loads
        return _default_decoder.decode(s)
      File "/home/mohit/miniconda3/lib/python3.6/json/decoder.py", line 339, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "/home/mohit/miniconda3/lib/python3.6/json/decoder.py", line 357, in raw_decode
        raise JSONDecodeError("Expecting value", s, err.value) from None
    json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

`$ /home/mohit/miniconda3/bin/conda install cling -c QuantStack -c conda-forge`

  environment variables:
                 CIO_TEST=<not set>
        CONDA_DEFAULT_ENV=cling
             CONDA_PREFIX=/home/mohit/miniconda3/envs/cling
    CONDA_PROMPT_MODIFIER=(cling)
         CONDA_PYTHON_EXE=/home/mohit/miniconda3/bin/python
               CONDA_ROOT=/home/mohit/miniconda3
              CONDA_SHLVL=1
                     PATH=/home/mohit/miniconda3/envs/cling/bin:/home/mohit/miniconda3/bin:/usr/
                          local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/us
                          r/local/games:/snap/bin
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>

     active environment : cling
    active env location : /home/mohit/miniconda3/envs/cling
            shell level : 1
       user config file : /home/mohit/.condarc
 populated config files : 
          conda version : 4.4.7
    conda-build version : not installed
         python version : 3.6.3.final.0
       base environment : /home/mohit/miniconda3  (writable)
           channel URLs : https://conda.anaconda.org/QuantStack/linux-64
                          https://conda.anaconda.org/QuantStack/noarch
                          https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.continuum.io/pkgs/main/linux-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
          package cache : /home/mohit/miniconda3/pkgs
                          /home/mohit/.conda/pkgs
       envs directories : /home/mohit/miniconda3/envs
                          /home/mohit/.conda/envs
               platform : linux-64
             user-agent : conda/4.4.7 requests/2.18.4 CPython/3.6.3 Linux/4.13.0-25-generic ubuntu/17.10 glibc/2.26
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False

Linking to other libraries

Hi. First of thank you for this great tool! I find it extremely useful for quick C++ prototyping and concisely presenting the results - something that I always found lacking when it comes to C++.

Now, I would also like to be able to link to other libraries - in my case Eigen and Boost, or even some custom made libraries. Is that possible? If so, could you please outline the steps how to do this?

Thank you!

xbuffer size

The size of the buffer in xbuffer is limited to 1024. But when we use xsystem to execute a shell command, the output could be much bigger.

Then the output command is lost.

It is also true when you have a lot of std::cout in a c++ cell.

I think that xbuffer should be a stringstream.

Can't define more than 1 function per cell

I get the error: function definition is not allowed here when I try to declare more than one function per cell. I was running C++14 on mybinder.org. Is there a work around?

error

add godbolt.org nbextension

The idea is to be able to have godbolt.org available in a code cell using a magic function like

%%goldbolt
%%compiler_explorer

updating xeus-cling on anaconda?

It appears that xeus-cling 0.7.1 is still the latest version available via conda. Any plans to make 0.1 available soon?

This project rocks, by the way :)

unsigned int as return type yields parser error

Defining a function returning unsigned int (and probably other unsigned types):

unsigned int f() { return 1; }

fails with

error: function definition not allowed here
unsigned int f() { return 1; }
..........................^

install breaks Jupyter -- libzmq.so.5.1.2 not found

Using Ubuntu 14.04 LTS on Lenovo notebook. I followed the Conda install instructions as shown in the README. Subsequent "jupyter notebook" immediately fails. Here's the error msgs:

> cannot find -lpthread
> connot find -lc
> collect2: error: ld returned 1 exit status
> ... stack trace ...
> ImportError: libzmq.so.5.1.2: cannot open shared object file: No such file or directory

Can't compile against uninstalled cxxopts

If I try to compile against an uninstalled cxxopts, compilation fails because it can't find <cxxopts.hpp>.

This is how I configured the build:

cmake -DClang_DIR=$HOME/miniconda3/lib/cmake/clang -DCMAKE_INSTALL_PREFIX=$HOME/miniconda3 -Dcxxopts_DIR=$HOME/src/cxxopts/build

Something like this fixes it:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index dd5b703..2be23fc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -127,7 +127,7 @@ if(MSVC)
   set_target_properties(${XEUSCLING_TARGET} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS 1)  # Internal string
 endif(MSVC)
 
-target_link_libraries(${XEUSCLING_TARGET} ${LIBS})
+target_link_libraries(${XEUSCLING_TARGET} ${LIBS}, cxxopts::cxxopts)
 
 ################
 # Installation #

PackageNotFoundError in windows

I am trying to install xeus-cling following the installation instruction in a Windows machine. The first step went well. But the second command returns a PackageNotFoundError. The output looks like:

conda install xeus-cling -c QuantStack -c conda-forge
Fetching package metadata .................

PackageNotFoundError: Packages missing in current channels:

  - xeus-cling

We have searched for the packages in the following channels:

  - https://conda.anaconda.org/QuantStack/win-64
  - https://conda.anaconda.org/QuantStack/noarch
  - https://conda.anaconda.org/conda-forge/win-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://repo.continuum.io/pkgs/main/win-64
  - https://repo.continuum.io/pkgs/main/noarch
  - https://repo.continuum.io/pkgs/free/win-64
  - https://repo.continuum.io/pkgs/free/noarch
  - https://repo.continuum.io/pkgs/r/win-64
  - https://repo.continuum.io/pkgs/r/noarch
  - https://repo.continuum.io/pkgs/pro/win-64
  - https://repo.continuum.io/pkgs/pro/noarch
  - https://repo.continuum.io/pkgs/msys2/win-64
  - https://repo.continuum.io/pkgs/msys2/noarch

Is this package unavailable for Windows or it is not updated yet?

How to start jupyter at conda using non root at system boot up

i tried add following cmd at /etc/rc.local but not work.
su username -c 'conda activate cling && jupyter notebook'

'conda activate cling && jupyter notebook' cmd works as non root user in console mode.
I installed all conda and jupyter using nonroot.
could you help?
Thanks

Distinction between output and result messages

Hi,
I just noticed with @takluyver that the xeus-cling output's are not prefixed with [Out ??] prompts:

In [1] 1 + 1
(int) 2

instead of

In [1] 1 + 1
Out[1] (int) 2

This suggests that the output messages are not tagged as "execute_result" as one would expect.

Potentially related: we noticed with @gouarin that nbgrader does not pick error messages when grading xeux-cling notebooks. @takluyver just mentionned that there are two types of error messages which is a regular source of confusion between kernels and frontends. Maybe that's what's happening here, with nbgrader expecting one type, and xeus-cling sending the other.

using namespace std and templates

Error occurs when inserting using namespace std; in front of template definition.

#include <iostream>

using namespace std;

template<class T>
class Base
{
        
};
error: expected expression
template<class T>
^

when using namespace std; is removed there is no more error.

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.