I want to write a wrapper for C++ code. My ultimate goal is to access classes and their functions written in C++ using python but right now, I am just trying to write a simple wrapper for hello world program.
So, I looked online and saw boost.python is able to perform such feat. Their tutorial though is not so clear. I am trying to follow it but I am getting lost. Also the tutorial is based on windows systems and i am using mac, so it is creating more confusion for me.
I installed boost and bjam through homebrew.
brew install boost --with-python
brew install bjam
the code i am trying to wrap.
#include <iostream>
char const* greet(){
return "hello world!"
}
Can you help me how to proceed with this?
For now, I downloaded Jammroot
script as directed in tutorial and edited the use-project boost
to the current location of boost
(/usr/local/Cellar/boost
)
then, when i try to run bjam from terminal, i get following error
Jamroot:17: in modules.load
*** argument error
* rule use-project ( id : where )
* called with: ( boost : /usr/local/Cellar/boost; project boost-python- quickstart : requirements <library>/boost/python//boost_python <implicit-dependency>/boost//headers : usage- requirements <implicit-dependency>/boost//headers )
* extra argument project
/usr/local/share/boost-build/src/build/project.jam:1138:see definition of rule 'use-project' being called
/usr/local/share/boost-build/src/build/project.jam:311: in load-jamfile
/usr/local/share/boost-build/src/build/project.jam:64: in load
/usr/local/share/boost-build/src/build/project.jam:145: in project.find
/usr/local/share/boost-build/src/build-system.jam:535: in load
/usr/local/share/boost-build/src/kernel/modules.jam:289: in import
/usr/local/share/boost-build/src/kernel/bootstrap.jam:139: in boost-build
/usr/local/share/boost-build/boost-build.jam:8: in module scope