On 2008-03-08 16:34-0500 Hezekiah M. Carty wrote:

> PLplot core devs,
>
> If there is an interest, I would like to integrate the OCaml bindings
> I have written for PLplot in to the official source tree.  I have
> tried to structure building these bindings so that this will be
> relatively straightforward.
>
> I updated the OCaml PLplot bindings to be up to date with version
> 5.9.0 today in Subversion -
> http://code.google.com/p/ocaml-plplot/source/browse/trunk/
> In addition, I have moved from a completely make-based build to
> ocamlbuild for most of the process.  ocamlbuild is a
> make/cmake/etc-like build system for OCaml which, among other things,
> automatically determines dependencies between source files.  It is
> also part of the vanilla OCaml distribution since version 3.10.0.

Hi Hez:

The usual way bindings are implemented for any language is to hand-craft or
automatically generate C (or C++) code that interfaces between the language
and our core PLplot C library. That interface is then compiled and linked
into a shared object which is either linked at link time or dynamically
loaded at run time for the language environment in question.  Also note that
many of our bindings as a matter of convenience have an interface written in
the language in question which then calls the C interface which is then
linked to our core library, but that is just a detail.

Is that a good overview of how the OCaml PLplot bindings are implemented? If
so, then cmake is very good at taking care of the details of building the
shared object from the interface source code.  See
cmake/modules/$LANGUAGE.cmake (where needed system files are found and
variables are set up for a particular language) and
bindings/$LANGUAGE/CMakeLists.txt for a number of examples, where LANGUAGE
is c++, etc.  I suggest you look at several languages in
cmake/modules/$LANGUAGE.cmake to gain a full appreciation of the power of
CMake to find system files, but for the interface build step I would start
with bindings/c++/CMakeLists.txt since the C++ interface is completely
straightforward to understand from the build perspective.

CMake syntax is easy to understand so the above files should give you a good
start at finding the required system files for the OCaml bindings and then
building those bindings, but if you want to look deeper, than have a look at
the CMake documentation links we have collected at
http://www.miscdebris.net/plplot_wiki/index.php?title=General_CMake_documentation_links

Also, I would be happy to help with any further questions you might have
about CMake or building our present bindings.

> Thank you for your time and for the wonderful PLplot library.

On behalf of all the developers that have contributed to it over the years,
you are most welcome!

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to