18#include <gsl/gsl_errno.h>
20#include <boost/python.hpp>
26#define PYOPAL_GLOBALS_C
30 void errorHandlerGSL(
const char *reason,
35 if (line || gsl_errno) {;}
43 while (argv[i] !=
nullptr) {
44 std::cerr << i <<
" " << std::string(argv[i]) <<
std::endl;
51 if (
ippl ==
nullptr) {
52 PyObject* pyargv = PySys_GetObject(
"argv");
53 boost::python::handle<> wrapper(boost::python::borrowed(pyargv));
54 boost::python::list myList(wrapper);
56 int argc = int(boost::python::len(myList));
61 argvr[0] =
new char[7];
62 strcpy(argvr[0],
"pyopal");
63 for (
int i = 1; i < argc; ++i) {
64 int stringLength(boost::python::len(myList[i]));
65 const char* value = boost::python::extract<const char*>(
66 boost::python::str(myList[i]));
67 argvr[i] =
new char[stringLength+1];
68 strcpy(argvr[i], value);
70 argvr[argc] =
nullptr;
77 if (
gmsg ==
nullptr) {
82 gsl_set_error_handler(&errorHandlerGSL);
Inform & endl(Inform &inf)
void printArgv(char **argv)
void Initialise()
Globals namespace provides routines to initialise global objects:
The base class for all OPAL exceptions.
static void instantiateGlobals()