How to fix a `xeus-cling` kernel runtime error on Mac OS (C++ Jupyter kernel stdlib errors)

1.3k Views Asked by At

I installed xeus-cling with the usual conda install xeus-cling and get the following runtime errors when I go to start a C++ kernel (11, 14 and 17 versions) in the Jupyter notebook:

/opt/anaconda3/envs/cling/include/c++/v1/stdlib.h:143:12: error: no member named 'ldiv' in the global namespace
  return ::ldiv(__x, __y);

< many such errors, eventually >

/opt/anaconda3/envs/cling/include/c++/v1/cstdlib:122:9: error: no member named 'rand' in the global namespace
using ::rand;
      ~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]

I tried re-installing XCode command line tools - no go. Same setup works fine on my Linux machine.

How can I fix these errors and get the kernel to start?

I filed an issue here with the recent XCode version 12.5.1 (12E507) - it looks like either xeus-cling conda package is using an incompatible toolchain, or XCode is misconfigured - either way, the C++ kernel won't start. Conda 4.10.1 with Python 3.9.6 (in case this matters). Thanks in advance!

1

There are 1 best solutions below

0
Arkivaren On

See here (GitHub)

SylvainCorlay suggests trying:

conda remove libcxx --force

And it worked for me (MacOS Monterey, Mambaforge)