xeus-cling icon indicating copy to clipboard operation
xeus-cling copied to clipboard

run time error on MacOS installed via conda

Open PrometheusPi opened this issue 4 years ago • 10 comments

I installed a minimal setup of xeus-cling and jupyter on macOS 10.15.7 via conda 4.10.3 via

conda env create -f setup_cling.yml

using the following yml file

name: cling_test

channels:
  - conda-forge

dependencies:
    - jupyter
    - xeus-cling

Resulting in having jupyter 1.0.0 and xeus-cling 0.12.1 .

If I start a jupyter server and select a C++17 kernel (C++14 and C++11 work) I get the following error in the jupyter server:

In file included from input_line_1:1:
/Users/myName/anaconda/install/envs/cling_test/include/c++/v1/new:235:33: error: too many arguments to function call, expected 1, have 2
  return __builtin_operator_new(__args...);
         ~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~
/Users/myName/anaconda/install/envs/cling_test/include/c++/v1/new:256:12: note: in instantiation of function template specialization 'std::__1::__libcpp_operator_new<unsigned long, std::align_val_t>' requested here
    return __libcpp_operator_new(__size, __align_val);
           ^
/Users/myName/anaconda/install/envs/cling_test/include/c++/v1/new:245:29: error: too many arguments to function call, expected 1, have 2
  __builtin_operator_delete(__args...);
  ~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~
/Users/myName/anaconda/install/envs/cling_test/include/c++/v1/new:297:14: note: in instantiation of function template specialization 'std::__1::__libcpp_operator_delete<void *, std::align_val_t>' requested here
      return __libcpp_operator_delete(__ptr, __align_val);
             ^
[I 12:56:24.465 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
In file included from input_line_1:1:
/Users/myName/anaconda/install/envs/cling_test/include/c++/v1/new:235:33: error: too many arguments to function call, expected 1, have 2
  return __builtin_operator_new(__args...);
         ~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~
/Users/myName/anaconda/install/envs/cling_test/include/c++/v1/new:256:12: note: in instantiation of function template specialization 'std::__1::__libcpp_operator_new<unsigned long, std::align_val_t>' requested here
    return __libcpp_operator_new(__size, __align_val);
           ^
/Users/myName/anaconda/install/envs/cling_test/include/c++/v1/new:245:29: error: too many arguments to function call, expected 1, have 2
  __builtin_operator_delete(__args...);
  ~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~
/Users/myName/anaconda/install/envs/cling_test/include/c++/v1/new:297:14: note: in instantiation of function template specialization 'std::__1::__libcpp_operator_delete<void *, std::align_val_t>' requested here
      return __libcpp_operator_delete(__ptr, __align_val);
             ^
[I 12:56:27.475 NotebookApp] KernelRestarter: restarting kernel (2/5), keep random ports
In file included from input_line_1:1:
/Users/myName/anaconda/install/envs/cling_test/include/c++/v1/new:235:33: error: too many arguments to function call, expected 1, have 2
  return __builtin_operator_new(__args...);
         ~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~
/Users/myName/anaconda/install/envs/cling_test/include/c++/v1/new:256:12: note: in instantiation of function template specialization 'std::__1::__libcpp_operator_new<unsigned long, std::align_val_t>' requested here
    return __libcpp_operator_new(__size, __align_val);
           ^
/Users/myName/anaconda/install/envs/cling_test/include/c++/v1/new:245:29: error: too many arguments to function call, expected 1, have 2
  __builtin_operator_delete(__args...);
  ~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~
/Users/myName/anaconda/install/envs/cling_test/include/c++/v1/new:297:14: note: in instantiation of function template specialization 'std::__1::__libcpp_operator_delete<void *, std::align_val_t>' requested here
      return __libcpp_operator_delete(__ptr, __align_val);
             ^
[I 12:56:30.488 NotebookApp] KernelRestarter: restarting kernel (3/5), keep random ports
In file included from input_line_1:1:
/Users/myName/anaconda/install/envs/cling_test/include/c++/v1/new:235:33: error: too many arguments to function call, expected 1, have 2
  return __builtin_operator_new(__args...);
         ~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~
/Users/myName/anaconda/install/envs/cling_test/include/c++/v1/new:256:12: note: in instantiation of function template specialization 'std::__1::__libcpp_operator_new<unsigned long, std::align_val_t>' requested here
    return __libcpp_operator_new(__size, __align_val);
           ^
/Users/myName/anaconda/install/envs/cling_test/include/c++/v1/new:245:29: error: too many arguments to function call, expected 1, have 2
  __builtin_operator_delete(__args...);
  ~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~
/Users/myName/anaconda/install/envs/cling_test/include/c++/v1/new:297:14: note: in instantiation of function template specialization 'std::__1::__libcpp_operator_delete<void *, std::align_val_t>' requested here
      return __libcpp_operator_delete(__ptr, __align_val);
             ^
[I 12:56:33.504 NotebookApp] KernelRestarter: restarting kernel (4/5), keep random ports
In file included from input_line_1:1:
/Users/myName/anaconda/install/envs/cling_test/include/c++/v1/new:235:33: error: too many arguments to function call, expected 1, have 2
  return __builtin_operator_new(__args...);
         ~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~
/Users/myName/anaconda/install/envs/cling_test/include/c++/v1/new:256:12: note: in instantiation of function template specialization 'std::__1::__libcpp_operator_new<unsigned long, std::align_val_t>' requested here
    return __libcpp_operator_new(__size, __align_val);
           ^
/Users/myName/anaconda/install/envs/cling_test/include/c++/v1/new:245:29: error: too many arguments to function call, expected 1, have 2
  __builtin_operator_delete(__args...);
  ~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~
/Users/myName/anaconda/install/envs/cling_test/include/c++/v1/new:297:14: note: in instantiation of function template specialization 'std::__1::__libcpp_operator_delete<void *, std::align_val_t>' requested here
      return __libcpp_operator_delete(__ptr, __align_val);

How can I solve this issue?

PrometheusPi avatar Jul 14 '21 11:07 PrometheusPi

I have a similar error with the same steps

[I 21:26:06.790 NotebookApp] Creating new notebook in 
[I 21:26:07.562 NotebookApp] Kernel started: 5158e60d-c203-4e37-b5fe-418b63000f2f, name: xcpp17
[W 21:26:07.571 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20210722212602 (::1) 62.170000ms referer=http://localhost:8889/notebooks/Untitled2.ipynb?kernel_name=xcpp17
In file included from input_line_1:1:
In file included from /Users/maxkaz/opt/anaconda3/envs/cling/include/c++/v1/new:92:
In file included from /Users/maxkaz/opt/anaconda3/envs/cling/include/c++/v1/cstdlib:85:
/Users/maxkaz/opt/anaconda3/envs/cling/include/c++/v1/stdlib.h:142:34: error: unknown type name 'ldiv_t'
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT {
                                 ^
/Users/maxkaz/opt/anaconda3/envs/cling/include/c++/v1/stdlib.h:143:12: error: no member named 'ldiv' in the global namespace
  return ::ldiv(__x, __y);

fatal error: too many errors emitted, stopping now [-ferror-limit=]
[I 21:26:16.565 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
In file included from input_line_1:1:
In file included from /Users/maxkaz/opt/anaconda3/envs/cling/include/c++/v1/new:92:
In file included from /Users/maxkaz/opt/anaconda3/envs/cling/include/c++/v1/cstdlib:85:
/Users/maxkaz/opt/anaconda3/envs/cling/include/c++/v1/stdlib.h:142:34: error: unknown type name 'ldiv_t'
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT {
                                 ^
/Users/maxkaz/opt/anaconda3/envs/cling/include/c++/v1/stdlib.h:143:12: error: no member named 'ldiv' in the global namespace
  return ::ldiv(__x, __y);

fatal error: too many errors emitted, stopping now [-ferror-limit=]
[W 21:26:28.644 NotebookApp] KernelRestarter: restart failed
[W 21:26:28.646 NotebookApp] Kernel 5158e60d-c203-4e37-b5fe-418b63000f2f died, removing from map.

Any help is much appreciated!

maxkazmsft avatar Jul 23 '21 01:07 maxkazmsft

Have the same error

fatal error: too many errors emitted, stopping now [-ferror-limit=]
[I 00:26:16.737 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
In file included from input_line_1:1:
In file included from /Users/molayodecker/miniconda3/envs/cling/include/c++/v1/new:92:
In file included from /Users/molayodecker/miniconda3/envs/cling/include/c++/v1/cstdlib:85:
/Users/molayodecker/miniconda3/envs/cling/include/c++/v1/stdlib.h:142:34: error: unknown type name 'ldiv_t'
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT {
                                 ^
/Users/molayodecker/miniconda3/envs/cling/include/c++/v1/stdlib.h:143:12: error: no member named 'ldiv' in the global namespace
  return ::ldiv(__x, __y);
         ~~^
/Users/molayodecker/miniconda3/envs/cling/include/c++/v1/stdlib.h:146:34: error: unknown type name 'lldiv_t'
inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x,
                                 ^
/Users/molayodecker/miniconda3/envs/cling/include/c++/v1/stdlib.h:148:12: error: no member named 'lldiv' in the global namespace
  return ::lldiv(__x, __y);
         ~~^
In file included from input_line_1:1:
In file included from /Users/molayodecker/miniconda3/envs/cling/include/c++/v1/new:92:
/Users/molayodecker/miniconda3/envs/cling/include/c++/v1/cstdlib:100:9: error: no member named 'div_t' in the global namespace
using ::div_t;
      ~~^
/Users/molayodecker/miniconda3/envs/cling/include/c++/v1/cstdlib:101:9: error: no member named 'ldiv_t' in the global namespace
using ::ldiv_t;
      ~~^

molayodecker avatar Jul 26 '21 04:07 molayodecker

Posted a question on SO about this https://stackoverflow.com/questions/68534960/how-to-fix-a-xeus-cling-kernel-runtime-error-on-mac-os-c-jupyter-kernel-std

maxkazmsft avatar Jul 26 '21 18:07 maxkazmsft

Same here.

Tried miniconda as also, no luck.

At the end, i used docker to run it. Here is the docker i used, https://hub.docker.com/r/sehrig/cling

younthu avatar Aug 22 '21 01:08 younthu

I get the error trying to just run cling:

❯ PATH="$HOME/anaconda/envs/cling/bin/:$PATH" /Users/evar/anaconda/envs/cling/bin/cling
In file included from input_line_1:1:
In file included from /Users/evar/anaconda/envs/cling/include/c++/v1/new:92:
In file included from /Users/evar/anaconda/envs/cling/include/c++/v1/cstdlib:85:
/Users/evar/anaconda/envs/cling/include/c++/v1/stdlib.h:142:34: error: unknown type name 'ldiv_t'
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT {
                                 ^
/Users/evar/anaconda/envs/cling/include/c++/v1/stdlib.h:143:12: error: no member named 'ldiv' in the global namespace
  return ::ldiv(__x, __y);
         ~~^
/Users/evar/anaconda/envs/cling/include/c++/v1/stdlib.h:146:34: error: unknown type name 'lldiv_t'
inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x,
                                 ^
/Users/evar/anaconda/envs/cling/include/c++/v1/stdlib.h:148:12: error: no member named 'lldiv' in the global namespace
  return ::lldiv(__x, __y);
         ~~^
In file included from input_line_1:1:
In file included from /Users/evar/anaconda/envs/cling/include/c++/v1/new:92:
/Users/evar/anaconda/envs/cling/include/c++/v1/cstdlib:100:9: error: no member named 'div_t' in the global namespace
using ::div_t;
      ~~^
/Users/evar/anaconda/envs/cling/include/c++/v1/cstdlib:101:9: error: no member named 'ldiv_t' in the global namespace
using ::ldiv_t;
      ~~^
/Users/evar/anaconda/envs/cling/include/c++/v1/cstdlib:103:9: error: no member named 'lldiv_t' in the global namespace
using ::lldiv_t;
      ~~^
/Users/evar/anaconda/envs/cling/include/c++/v1/cstdlib:105:9: error: no member named 'atof' in the global namespace
using ::atof;
      ~~^
/Users/evar/anaconda/envs/cling/include/c++/v1/cstdlib:106:9: error: no member named 'atoi' in the global namespace
using ::atoi;
      ~~^
/Users/evar/anaconda/envs/cling/include/c++/v1/cstdlib:107:9: error: no member named 'atol' in the global namespace
using ::atol;
      ~~^
/Users/evar/anaconda/envs/cling/include/c++/v1/cstdlib:109:9: error: no member named 'atoll' in the global namespace
using ::atoll;
      ~~^
/Users/evar/anaconda/envs/cling/include/c++/v1/cstdlib:111:9: error: no member named 'strtod' in the global namespace
using ::strtod;
      ~~^
/Users/evar/anaconda/envs/cling/include/c++/v1/cstdlib:112:9: error: no member named 'strtof' in the global namespace
using ::strtof;
      ~~^
/Users/evar/anaconda/envs/cling/include/c++/v1/cstdlib:113:9: error: no member named 'strtold' in the global namespace
using ::strtold;
      ~~^
/Users/evar/anaconda/envs/cling/include/c++/v1/cstdlib:114:9: error: no member named 'strtol' in the global namespace
using ::strtol;
      ~~^
/Users/evar/anaconda/envs/cling/include/c++/v1/cstdlib:116:9: error: no member named 'strtoll' in the global namespace
using ::strtoll;
      ~~^
/Users/evar/anaconda/envs/cling/include/c++/v1/cstdlib:118:9: error: no member named 'strtoul' in the global namespace
using ::strtoul;
      ~~^
/Users/evar/anaconda/envs/cling/include/c++/v1/cstdlib:120:9: error: no member named 'strtoull' in the global namespace
using ::strtoull;
      ~~^
/Users/evar/anaconda/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=]

****************** CLING ******************
* Type C++ code and press enter to run it *
*             Type .q to exit             *
*******************************************
[cling]$ 

The brew-installed version of cling works fine for me.

NightMachinery avatar Oct 19 '21 20:10 NightMachinery

same error for me here

QW-Is-Here avatar Jan 28 '22 08:01 QW-Is-Here

Same here.

Tried miniconda as also, no luck.

At the end, i used docker to run it. Here is the docker i used, https://hub.docker.com/r/sehrig/cling

The Docker mentioned the CUDA environment. Does the docker image work for MacOS? I didn't know Macos can support CUDA now. Excuse me if I am wrong. @younthu

yongming-qin avatar Feb 02 '22 14:02 yongming-qin

Same here...

FWIW: There has been a recent upgrade to Catalina. The version is now 10.15.7 (19H1715).

I installed xeus-cling and Jupyter from conda-forge in a new environment. C++17 fails with the same errors as @PrometheusPi. Ultimately the kernel dies and is de-listed. My versions are:

cling: 0.8

And for Jupyter:

ipykernel        : 6.9.1
ipywidgets       : not installed
jupyter_client   : 7.1.2
jupyter_core     : 4.9.2
jupyter_server   : 1.13.5
jupyterlab       : 3.2.9
nbclient         : 0.5.11
nbconvert        : 6.4.2
nbformat         : 5.1.3
notebook         : 6.4.8
qtconsole        : not installed
traitlets        : 5.1.1

Interestingly: cling -std=c++17 typed directly into the terminal results in:

In file included from input_line_1:1:
/Users/mark/opt/miniconda3/envs/XEUS/include/c++/v1/new:235:33: error: too many arguments to function call, expected 1, have 2
  return __builtin_operator_new(__args...);
         ~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~
/Users/mark/opt/miniconda3/envs/XEUS/include/c++/v1/new:256:12: note: in instantiation of function template specialization 'std::__1::__libcpp_operator_new<unsigned long, std::align_val_t>' requested here
    return __libcpp_operator_new(__size, __align_val);
           ^
/Users/mark/opt/miniconda3/envs/XEUS/include/c++/v1/new:245:29: error: too many arguments to function call, expected 1, have 2
  __builtin_operator_delete(__args...);
  ~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~
/Users/mark/opt/miniconda3/envs/XEUS/include/c++/v1/new:297:14: note: in instantiation of function template specialization 'std::__1::__libcpp_operator_delete<void *, std::align_val_t>' requested here
      return __libcpp_operator_delete(__ptr, __align_val);

cling -std=c++14 is fine, as is -std=c++11.

Hope this gives some clues...

marvin-littlewood avatar Feb 22 '22 12:02 marvin-littlewood

same error on Mac OS Big Sur 11.1 in Intel Core i5:

In file included from input_line_1:1:
In file included from /usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/new:92:
In file included from /usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/cstdlib:85:
/usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/stdlib.h:148:34: error: unknown type name 'ldiv_t'
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT {
                                 ^
/usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/stdlib.h:149:12: error: no member named 'ldiv' in the global namespace
  return ::ldiv(__x, __y);
         ~~^
/usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/stdlib.h:152:34: error: unknown type name 'lldiv_t'
inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x,
                                 ^
/usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/stdlib.h:154:12: error: no member named 'lldiv' in the global namespace
  return ::lldiv(__x, __y);
         ~~^
In file included from input_line_1:1:
In file included from /usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/new:92:
/usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/cstdlib:100:9: error: no member named 'div_t' in the global namespace
using ::div_t _LIBCPP_USING_IF_EXISTS;
      ~~^
/usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/cstdlib:101:9: error: no member named 'ldiv_t' in the global namespace
using ::ldiv_t _LIBCPP_USING_IF_EXISTS;
      ~~^
/usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/cstdlib:102:9: error: no member named 'lldiv_t' in the global namespace
using ::lldiv_t _LIBCPP_USING_IF_EXISTS;
      ~~^
/usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/cstdlib:103:9: error: no member named 'atof' in the global namespace
using ::atof _LIBCPP_USING_IF_EXISTS;
      ~~^
/usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/cstdlib:104:9: error: no member named 'atoi' in the global namespace
using ::atoi _LIBCPP_USING_IF_EXISTS;
      ~~^
/usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/cstdlib:105:9: error: no member named 'atol' in the global namespace
using ::atol _LIBCPP_USING_IF_EXISTS;
      ~~^
/usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/cstdlib:106:9: error: no member named 'atoll' in the global namespace
using ::atoll _LIBCPP_USING_IF_EXISTS;
      ~~^
/usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/cstdlib:107:9: error: no member named 'strtod' in the global namespace
using ::strtod _LIBCPP_USING_IF_EXISTS;
      ~~^
/usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/cstdlib:108:9: error: no member named 'strtof' in the global namespace
using ::strtof _LIBCPP_USING_IF_EXISTS;
      ~~^
/usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/cstdlib:109:9: error: no member named 'strtold' in the global namespace
using ::strtold _LIBCPP_USING_IF_EXISTS;
      ~~^
/usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/cstdlib:110:9: error: no member named 'strtol' in the global namespace
using ::strtol _LIBCPP_USING_IF_EXISTS;
      ~~^
/usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/cstdlib:111:9: error: no member named 'strtoll' in the global namespace
using ::strtoll _LIBCPP_USING_IF_EXISTS;
      ~~^
/usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/cstdlib:112:9: error: no member named 'strtoul' in the global namespace
using ::strtoul _LIBCPP_USING_IF_EXISTS;
      ~~^
/usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/cstdlib:113:9: error: no member named 'strtoull' in the global namespace
using ::strtoull _LIBCPP_USING_IF_EXISTS;
      ~~^
/usr/local/Caskroom/miniforge/base/envs/cling/include/c++/v1/cstdlib:114:9: error: no member named 'rand' in the global namespace
using ::rand _LIBCPP_USING_IF_EXISTS;
      ~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]

thisjiang avatar Jun 09 '22 09:06 thisjiang

Same error on macOS Monterey 12.3! Will try using brew instead but does anyone know a fix?

ashnaahmad avatar Oct 03 '22 14:10 ashnaahmad