Small changes in comments and docs
parent
673806553b
commit
c8dec5d8dc
|
@ -2,15 +2,14 @@ This is the Cython/Python wrapper around the GTSAM C++ library.
|
||||||
|
|
||||||
INSTALL
|
INSTALL
|
||||||
=======
|
=======
|
||||||
- This wrapper needs Cython(>=0.25.2), backports_abc>=0.5, numpy, which can be installed
|
- This wrapper needs Cython(>=0.25.2), backports_abc>=0.5, and numpy. These can be installed as follows:
|
||||||
as follows:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install -r <gtsam_folder>/cython/requirements.txt
|
pip install -r <gtsam_folder>/cython/requirements.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
- It also needs Eigency, a package that interfaces between C++'s Eigen and Python's numpy.
|
- It also needs Eigency, a package that interfaces between C++'s Eigen and Python's numpy.
|
||||||
You can try to install via pip: "pip install eigency". If that fails, install it from source as follows:
|
You can try to install via pip: "pip install eigency". If that fails, please install it from source as follows:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/wouterboomsma/eigency.git
|
git clone https://github.com/wouterboomsma/eigency.git
|
||||||
|
@ -19,10 +18,14 @@ python setup.py -v build
|
||||||
python setup.py install
|
python setup.py install
|
||||||
```
|
```
|
||||||
|
|
||||||
- Build and install gtsam using cmake with GTSAM_INSTALL_CYTHON_TOOLBOX enabled
|
- Build and install gtsam using cmake with GTSAM_INSTALL_CYTHON_TOOLBOX enabled. The wrapped module will be installed to GTSAM_CYTHON_INSTALL_PATH, which is
|
||||||
Note: The wrapped module will be installed to GTSAM_CYTHON_INSTALL_PATH, which is
|
|
||||||
by default: <your CMAKE_INSTALL_PREFIX>/cython
|
by default: <your CMAKE_INSTALL_PREFIX>/cython
|
||||||
|
|
||||||
|
- Modify your PYTHONPATH to include the GTSAM_CYTHON_INSTALL_PATH:
|
||||||
|
```bash
|
||||||
|
export PYTHONPATH = $PYTHONPATH:<GTSAM_CYTHON_INSTALL_PATH>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
UNIT TESTS
|
UNIT TESTS
|
||||||
==========
|
==========
|
||||||
|
|
|
@ -166,7 +166,7 @@ if (GTSAM_INSTALL_MATLAB_TOOLBOX)
|
||||||
wrap_and_install_library(../gtsam.h "${GTSAM_ADDITIONAL_LIBRARIES}" "" "${mexFlags}")
|
wrap_and_install_library(../gtsam.h "${GTSAM_ADDITIONAL_LIBRARIES}" "" "${mexFlags}")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# Create the matlab toolbox for the gtsam library
|
# Create the cython toolbox for the gtsam library
|
||||||
if (GTSAM_INSTALL_CYTHON_TOOLBOX)
|
if (GTSAM_INSTALL_CYTHON_TOOLBOX)
|
||||||
# Set up codegen
|
# Set up codegen
|
||||||
include(GtsamCythonWrap)
|
include(GtsamCythonWrap)
|
||||||
|
|
|
@ -411,6 +411,7 @@ void Module::emit_cython_pyx(FileWriter& pyxFile) const {
|
||||||
"from "<< pxdHeader << " cimport shared_ptr\n"
|
"from "<< pxdHeader << " cimport shared_ptr\n"
|
||||||
"from "<< pxdHeader << " cimport dynamic_pointer_cast\n"
|
"from "<< pxdHeader << " cimport dynamic_pointer_cast\n"
|
||||||
"from "<< pxdHeader << " cimport make_shared\n";
|
"from "<< pxdHeader << " cimport make_shared\n";
|
||||||
|
|
||||||
// import all typedefs, e.g. from gtsam_wrapper cimport Key, so we don't need to say gtsam.Key
|
// import all typedefs, e.g. from gtsam_wrapper cimport Key, so we don't need to say gtsam.Key
|
||||||
for(const Qualified& q: Qualified::BasicTypedefs) {
|
for(const Qualified& q: Qualified::BasicTypedefs) {
|
||||||
pyxFile.oss << "from " << pxdHeader << " cimport " << q.pxdClassName() << "\n";
|
pyxFile.oss << "from " << pxdHeader << " cimport " << q.pxdClassName() << "\n";
|
||||||
|
@ -429,6 +430,7 @@ void Module::emit_cython_pyx(FileWriter& pyxFile) const {
|
||||||
for(const Class& cls: expandedClasses)
|
for(const Class& cls: expandedClasses)
|
||||||
cls.emit_cython_pyx(pyxFile, allClasses);
|
cls.emit_cython_pyx(pyxFile, allClasses);
|
||||||
pyxFile.oss << "\n";
|
pyxFile.oss << "\n";
|
||||||
|
|
||||||
//... wrap global functions
|
//... wrap global functions
|
||||||
for(const GlobalFunctions::value_type& p: global_functions)
|
for(const GlobalFunctions::value_type& p: global_functions)
|
||||||
p.second.emit_cython_pyx(pyxFile);
|
p.second.emit_cython_pyx(pyxFile);
|
||||||
|
|
Loading…
Reference in New Issue