octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Algorithmic Differentiation in Octave


From: Brad Bell
Subject: Re: Algorithmic Differentiation in Octave
Date: Sat, 4 Feb 2017 06:32:09 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0


Did your run the following command ?
    make check_lib_octave
(see same question below)

On 02/04/2017 05:48 AM, Olaf Till wrote:
On Sat, Jan 28, 2017 at 09:42:43AM +0100, Olaf Till wrote:
For finding an overall way to fit this into Octave, I still have to
find out about some issues in your interface which are not clear to
me. But before asking, I'd like to give it a try, making it compile
and experimenting with it a bit. Since I have currently some other
things on my schedule, I guess it'll take a week.
I havn't come very far. The cppad library, compiled according to the
instructions at

https://www.coin-or.org/CppAD/Doc/cmake.htm

with

cd build
cmake -G "Unix Makefiles" -D cppad_prefix=/usr/local ..

with 'make install' only installs headers, no library. And I find no
library even under the build/directory.
Cppad is a header only package. There is are a few library's that will install if you choose certain options, but the headers are all that is needed by cppad_swig. You can run a check of CppAD for your particular machine with the following command
    make check
see
    https://www.coin-or.org/CppAD/Doc/cmake_check.xml

Note that the cppad_swig package does provide a C++ AD object library; e.g., see
http://www.seanet.com/~bradbell/cppad_swig/a_fun_jacobian_xam.cpp.htm


swig-cppad compiled an oct-file, after fiddling with Octaves include
files. (BTW: Instead of `octave-config -p INCLUDEDIR`, use `mkoctfile
-p INCFLAGS`, yielding 2 include dirs, with '-I' already prepended.
Thanks, I will give this a try.

swig-cppad compiled this although no cppad library was present
anywhere, and not even the cppad headers were present at this time
(and I don't find them in swig-cppad either)! The resulting oct-file,
according to 'ldd', referenced nothing which looked like a cppad
library, of course. And it segfaulted at the time of loading into
Octave.
See the heading Testing on
    http://www.seanet.com/~bradbell/cppad_swig/cppad_swig.htm
When you run
    bin/run_cmake.sh
there will a list of available make commands (for your configuration).

Did your run the following command ?
    make check_lib_octave
This should build all the example *.m files, the octave swig interface, and run the tests.
Setting verbose to true in bin/run_cmake.sh (before running it) may help.

No install is yet available because I figure that should be wrapped with the special code (like matrix multiply in Octaves case) for each language.

So I can only give 'theoretical' notes now.

Let's assume swig-cppad worked as expected. Then, if we took it
unchanged, we'd have to define a wrapper class around it. Doing this
in iterpreted Octave code would yield matrix operations which are too
slow.
I thought that Octave would automatically generate matrix operations in C++ that used the overloaded classes (as numpy does for python) ?

I think the best bet would be to generate an Octave type at the c++
level (similar to what swig-cppad currently does) which interfaces to
cppad and already contains overloading of matrix operations.

If the latter is done, I would not like to do it with swig, but rather
try it directly with Octaves API. And the build system of swig-cppad
would have to be changed anyway, IMHO, to make it distributable as an
Octave package.ld
I defined a very lightweight (and I think efficient) interface from the Cppad Swig library to any language. I figured that this would greatly reduce the work involved in make taped AD available in not only available in python, but other languages as well.

This would be rather a long term project for me (but maybe others
would be faster). I have difficulties in deducing from swig-cppad the
interaction with the cppad interface. I'd have to learn how to
interface with cppad from the cppad documentation.

Problems are that cppad currently installs no library for me (see
above), and that cppad doesn't seem to be available in current Debian
(i.e. only the headers are available there).
See
   https://tracker.debian.org/pkg/cppad

Olaf





reply via email to

[Prev in Thread] Current Thread [Next in Thread]