main.cpp 749 Bytes
Newer Older
Rohan Budhiraja's avatar
Rohan Budhiraja committed
1
2
3
4
/*
 * Copyright 2021 INRIA
 */

5
6
#include <Eigen/Core>
#include <eigenpy/eigenpy.hpp>
Rohan Budhiraja's avatar
Rohan Budhiraja committed
7

8
#include "pycppad/cppad.hpp"
Rohan Budhiraja's avatar
Rohan Budhiraja committed
9
#include "pycppad/ad.hpp"
10
#include "pycppad/independent.hpp"
Rohan Budhiraja's avatar
Rohan Budhiraja committed
11

12
13
14
15
16
17
18
19
20
21
22
23
24
#include <sstream>

inline std::string printVersion(const std::string & delimiter = ".")
{
  std::ostringstream oss;
  oss
  << PYCPPAD_MAJOR_VERSION << delimiter
  << PYCPPAD_MINOR_VERSION << delimiter
  << PYCPPAD_PATCH_VERSION;
  return oss.str();
}

namespace bp = boost::python;
Rohan Budhiraja's avatar
Rohan Budhiraja committed
25

26
BOOST_PYTHON_MODULE(pycppad_pywrap)
Rohan Budhiraja's avatar
Rohan Budhiraja committed
27
{
28
29
30
31
  bp::docstring_options module_docstring_options(true,true,false);
  
  bp::scope().attr("__version__") = printVersion();
  bp::scope().attr("__raw_version__") = bp::str(PYCPPAD_VERSION);
32
33
  
  eigenpy::enableEigenPy();
34
  pycppad::enablePyCppAD();
Rohan Budhiraja's avatar
Rohan Budhiraja committed
35
}