OCaml Forge
SCM

Caml Foreign Home

From Caml Foreign dynamic interface to C/C++ Wiki

(Difference between revisions)
Jump to: navigation, search
Line 10: Line 10:
  # (sends to caml-foreign-devel@lists.forge.ocamlcore.org by default)
  # (sends to caml-foreign-devel@lists.forge.ocamlcore.org by default)
-
The build system uses Oasis. In order to build and test the library, you need libffi-dev and oasis installed. In order to build from a darcs checkout, do:
+
Build dependences:
-
  oasis setup-dev
+
* g++-4.4 (g++-4.5 does not work)
-
  ocaml setup.ml -configure
+
* libffi-dev
-
  ocaml setup.ml -build
+
* ocamlfind (for installation)
-
  ocaml setup.ml -test
+
 
 +
Building and installing using GNU Make:
 +
# compile the library
 +
make -f Makefile.lib
 +
# compile and run the tests
 +
make -f Makefile.lib test
 +
# install the library (uses ocamlfind)
 +
make -f Makefile.lib install
 +
# install the library to directory DIR
 +
make -f Makefile.lib rawinstall OCAML_LIB_INSTALL=$DIR
Caml-foreign is based on libffi.
Caml-foreign is based on libffi.

Revision as of 00:41, 8 September 2011

Caml Foreign is a Caml library to access C and C++ functions without writing C wrapping code. Instead, you write OCaml wrapping code. There is some functionality to cope with C++ classes : dynamic casting, constructors, destructors, methods.

At the moment it is Linux-only, gcc-only, and experimental. It is lightly tested. Also, it is mostly undocumented.

Get the code using darcs :

 darcs get https://forge.ocamlcore.org/anonscm/darcs/caml-foreign/caml-foreign

You can send patches using

darcs send
# (sends to caml-foreign-devel@lists.forge.ocamlcore.org by default)

Build dependences:

  • g++-4.4 (g++-4.5 does not work)
  • libffi-dev
  • ocamlfind (for installation)

Building and installing using GNU Make:

# compile the library
make -f Makefile.lib
# compile and run the tests
make -f Makefile.lib test
# install the library (uses ocamlfind)
make -f Makefile.lib install
# install the library to directory DIR
make -f Makefile.lib rawinstall OCAML_LIB_INSTALL=$DIR

Caml-foreign is based on libffi.

Development

Personal tools
Navigation