-
Notifications
You must be signed in to change notification settings - Fork 1
OpenCAL Py
Python bindings are create using the swig tools. To produce python bidings do the followings:
-
(from the root source tree) cd OpenCAL++-Py
-
swig -c -python -I./include/swig_interfaces -I../OpenCAL/include -outdir ./lib ./opencal.i
-
g -shared -fPIC -fopenmp opencal_wrap.cxx ../OpenCAL/source/* -I./ -I../OpenCAL++/include/ -I/usr/include/python2.7/ -o lib/_opencal.so
step (1) prepare the c++ side of the wrapper producing opencal_wrap.h and opencal_wrap.cxx files that are then compiled in a shared library in orer to be imported in python scripts. Step (3) performs the compilation of all the necessary files.
Note that the library should be included in the LD_LIBRARY_PATH in order to be imported in python scripts. (for example export LD_LIBRARY_PATH:$LD_LIBRARY_PATH:<path to _opencal.so>)