OCaml Forge
SCM

Caml Foreign Home

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

(Difference between revisions)
Jump to: navigation, search
 
(3 intermediate revisions not shown)
Line 1: Line 1:
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.
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.
+
At the moment it is Linux-only, gcc-only, and experimental. It is mostly undocumented.
Get the code using darcs :
Get the code using darcs :
-
   darcs get https://forge.ocamlcore.org/anonscm/darcs/caml-foreign/caml-foreign
+
   darcs get http://forge.ocamlcore.org/anonscm/darcs/caml-foreign/caml-foreign
You can send patches using
You can send patches using
Line 11: Line 11:
Build dependences:
Build dependences:
-
* g++-4.4 (g++-4.5 does not work)
+
* g++
* libffi-dev
* libffi-dev
* ocamlfind (for installation)
* ocamlfind (for installation)
-
Building and installing using GNU Make:
+
Configure, build, test and install using the Oasis-generated build system:
-
  # compile the library
+
  ocaml setup.ml -configure
-
  make -f Makefile.lib
+
  ocaml setup.ml -build
-
  # compile and run the tests
+
  ocaml setup.ml -test
-
make -f Makefile.lib test
+
  ocaml setup.ml -install
-
  # 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.

Latest revision as of 15:16, 4 March 2012

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 mostly undocumented.

Get the code using darcs :

 darcs get http://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++
  • libffi-dev
  • ocamlfind (for installation)

Configure, build, test and install using the Oasis-generated build system:

ocaml setup.ml -configure
ocaml setup.ml -build
ocaml setup.ml -test
ocaml setup.ml -install

Caml-foreign is based on libffi.

Development

Personal tools
Navigation