Small changes in comments and docs

release/4.3a0
dellaert 2017-05-20 12:23:41 -07:00
parent 673806553b
commit c8dec5d8dc
3 changed files with 11 additions and 6 deletions

View File

@ -2,15 +2,14 @@ This is the Cython/Python wrapper around the GTSAM C++ library.
INSTALL
=======
- This wrapper needs Cython(>=0.25.2), backports_abc>=0.5, numpy, which can be installed
as follows:
- This wrapper needs Cython(>=0.25.2), backports_abc>=0.5, and numpy. These can be installed as follows:
```bash
pip install -r <gtsam_folder>/cython/requirements.txt
```
- 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
git clone https://github.com/wouterboomsma/eigency.git
@ -19,10 +18,14 @@ python setup.py -v build
python setup.py install
```
- Build and install gtsam using cmake with GTSAM_INSTALL_CYTHON_TOOLBOX enabled
Note: The wrapped module will be installed to GTSAM_CYTHON_INSTALL_PATH, which is
- 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
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
==========

View File

@ -166,7 +166,7 @@ if (GTSAM_INSTALL_MATLAB_TOOLBOX)
wrap_and_install_library(../gtsam.h "${GTSAM_ADDITIONAL_LIBRARIES}" "" "${mexFlags}")
endif ()
# Create the matlab toolbox for the gtsam library
# Create the cython toolbox for the gtsam library
if (GTSAM_INSTALL_CYTHON_TOOLBOX)
# Set up codegen
include(GtsamCythonWrap)

View File

@ -411,6 +411,7 @@ void Module::emit_cython_pyx(FileWriter& pyxFile) const {
"from "<< pxdHeader << " cimport shared_ptr\n"
"from "<< pxdHeader << " cimport dynamic_pointer_cast\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
for(const Qualified& q: Qualified::BasicTypedefs) {
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)
cls.emit_cython_pyx(pyxFile, allClasses);
pyxFile.oss << "\n";
//... wrap global functions
for(const GlobalFunctions::value_type& p: global_functions)
p.second.emit_cython_pyx(pyxFile);