【发布时间】:2020-07-27 00:35:12
【问题描述】:
我正在运行 Pop!_OS(ubuntu 衍生产品)并从默认存储库安装了 boost(libboost-all-dev)。我知道它已正确安装,因为我可以使用 GCC 编译和运行简单的 boost odeint 示例。
但是,当我尝试使用 zeus-cling 内核在 jupyter 笔记本中运行相同的示例时,在包含 odeint 标头时出现错误。我可以在执行此代码时重新创建错误:
#pragma cling add_include_path("/usr/include")
#include <boost/numeric/odeint.hpp>
我得到的错误信息是:
In file included from input_line_8:1:
In file included from /usr/include/boost/numeric/odeint.hpp:22:
In file included from /usr/include/boost/numeric/odeint/config.hpp:44:
In file included from /usr/include/boost/config.hpp:48:
In file included from /usr/include/boost/config/stdlib/libstdcpp3.hpp:78:
/usr/include/unistd.h:756:28: error: expected function body after function declarator
extern __pid_t fork (void) __THROWNL;
^
/usr/include/unistd.h:869:11: fatal error: 'bits/getopt_posix.h' file not found
# include <bits/getopt_posix.h>
^~~~~~~~~~~~~~~~~~~~~
Interpreter Error:
据我了解,bits/getopt_posix.h 是仅 GCC 的标头,因此我认为问题可能是因为 boost 标头正在配置自己,就好像它们在 GCC 下编译而不是紧贴/叮当声一样。
那么,如何在 xeus-cling jupyter notebook 中正确包含 boost?
【问题讨论】:
-
在这种情况下不需要添加已编译的共享库 (*.so),因为
odeint只是标题。尽管如此,我还是尝试了。
标签: c++ boost cling xeus-cling