Hi everyone,

As my first post in this mailing list I would like to ask, has anyone tried using boost in a xeus-cling jupyter kernel? Or just cling?

My plan is to use odeint in the jupyter notebook for some simulations. However I had issues when I tried to run one of the odeint examples. I originally posted my issue on stackoverlfow but didn;t get any feedback. So I'm going to mostly copy my original question in this email.

https://stackoverflow.com/questions/61205040/how-do-i-use-boost-with-the-xeus-cling-jupyter-kernel

I'm running Pop!_OS (ubuntu derivative) and apt installed boost (libboost-all-dev) from the default repositories. I know it has been installed properly since I can compile and run the simple boost odeint example with GCC.

However when I tried to run the same example inside a jupyter notebook using the zeus-cling kernel I got an error while including the odeint header. I can recreate the error while executing this code:

#pragma cling add_include_path("/usr/include")
#include <boost/numeric/odeint.hpp>

The error message I get is:

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: 

From what I understand bits/getopt_posix.h is a GCC only header, thus I think the problem might be because the boost headers are configuring themselves as if they are compiling under GCC instead of cling/clang.

My solution so far has been to submodule the boost super project into my repository and add all the include paths necessary to get odeint and it's dependencies to compile. This is fine since odeint is a header only library anyways. But I'm pretty sure there is a better solution to this problem.

Thanks in advance and hope to hear from someone back soon.


Cheers,
Aaron M. de Windt