view INSTALL.md @ 362:b0677c492655

Overhaul Python object storage and wrapping in pyobject * oct-py-util.cc, oct-py-util.h (pytave::py_objstore_del, pytave::py_objstore_get, pytave::py_objstore_put, pytave::pyobject_wrap_object, pytave::pyobject_unwrap_object): New functions. (pytave::get_object_from_python): Use pyobject_unwrap_object. * octave_to_python.cc (pytave::octvalue_to_pyobj): Use pyobject_unwrap_object. * python_to_octave.cc (pytave::pyobj_to_octvalue): Use pyobject_wrap_object. (pytave::pyobj_to_oct_pyobject): Delete. * __py_struct_from_dict__.cc (F__py_objstore_del__, F__py_objstore_get__, F__py_objstore_put__): New functions. * @pyobject/pyobject.m (pyobject.m_id): Rename from id. (pyobject.pyobject): Use __py_objstore_put__, simplify conditional logic. (pyobject.delete): Use __py_objstore_del__. (pyobject.id): Rename from getid. * @pyobject/display.m: Use pyobject.id method name, format as hex.
author Mike Miller <mtmiller@octave.org>
date Thu, 25 Aug 2016 09:51:58 -0700
parents a323f9fae46b
children
line wrap: on
line source

Pytave Building Instructions
============================

Pytave is built using GNU autotools.

Use the configure script to detect Octave and Boost::Python paths.

Run `./configure --help` for more info.

Dependencies
------------

Configuring:

  * a shell capable of running `configure`

Building:

  * GNU make

Linked and tested with:

  * Python 2.7
  * Boost::Python 1.58
  * Octave 4.1 (development version)

Bootstrapping from Mercurial
----------------------------

  1. `hg clone https://bitbucket.org/mtmiller/pytave`

  2. `autoreconf --install`

Building
--------

  1. `./configure`

     or

     `./configure --prefix=/directory/where/you/want/the/module/file`

  2. Run `make` to build the extension module

  3. To copy the pytave dynamic library to the prefix, run
     `make install`

Running from build directory
----------------------------

Pytave is made up of three parts. The `pytave` package, the
`pytave/pytave` module and the `pytave/_pytave` extension. When the user
uses `import pytave`, the pytave package `__init__` script loads both
the module and the extension. It is important that they both can be
found.

  1. Follow the build instructions to compile the extension.

  2. Start the Python interpreter with a Python path set to a path
     containing `_pytave.so` and the `package` directory. A common way
     to do this with the bash shell is to execute this command:

        PYTHONPATH=.libs:package python

  3. In the interpreter you can now access Octave through Python:

        import numpy
        import pytave
        pytave.feval(1, "cos", 0)
        b = pytave.addpath(".")
        pytave.feval(1, "testfile", 42)

Note that there is no `testfile.m` file in the distribution. This is
simply a demonstration of how to execute an arbitrary Octave m-file.

Running test suite in build directory
-------------------------------------

  1. Run `make check`

There are known errors in the test suite.

Creating a source dist
----------------------

  1. Run `make distcheck`

Hint about foreign systems
--------------------------

If you are running on a system incapable of executing the configure
scripts (e.g. a Microsoft Windows system), you may want to try
installing the MinGW and MSYS packages, and build everything inside that
environment. This isn't for the faint of heart though, since you
need/want to build Octave too. It is probably easier than trying to
build without configure scripts, that's all. There are no guarantees
that it will build at all, it has not been tested.