From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 30AD37F860 for ; Fri, 21 Feb 2014 11:47:04 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.97,518,1389740400"; d="scan'208";a="59576855" Received: from sympa.inria.fr ([193.51.193.213]) by mail2-relais-roc.national.inria.fr with ESMTP; 21 Feb 2014 11:47:03 +0100 Received: by sympa.inria.fr (Postfix, from userid 20132) id 148437F861; Fri, 21 Feb 2014 11:47:04 +0100 (CET) Date: Fri, 21 Feb 2014 11:46:58 +0100 To: caml-list@inria.fr Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7BIT From: X-Mailer: Sympa 6.1.17 Subject: [Caml-list] Creating an OPAM package that wraps c functions that can be used in a non-custom utop I have a small OCaml library that wraps a couple of C functions that I wrote. I'm able to compile the project to a .cmx?a file just fine using ocamlbuild. I have the following files src geolocalisation_c.c geolocalisation.ml geolocalisation.mllib I want to be able to play around with my code in a top-level, and I'm able to do this just fine with the following series of commands. ocamlbuild src/geolocalisation_c.o ocamlbuild -pkgs ounit src/geolocalisation.cma ocamlmktop -custom -cclib -lGeoIp _build/src/geolocalisation_c.o _build/ src/geolocalisation.cma -o myutop To verify that it works I run ./myutop -I _build/src/ #load "geolocalisation.cmo";; Geolocalisation.create_context;; and I get the correct type-signature printed in the top-level. The next thing I want to do is create an OPAM package for it that my co- workers and I can use. My question is, will I be able to create the package in such a way that the library can be loaded into utop using topfind so we don't have to build a custom top-level in the projects that use this library? Basically I would like the users of the library to be unaware that it invokes external c functions. If it is possible, do you have any pointers to where I might find some information about how to do it? Cheers, Mads