From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA17100; Thu, 6 Sep 2001 23:24:18 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id XAA17341 for ; Thu, 6 Sep 2001 23:24:16 +0200 (MET DST) Received: from chopin.ai.univie.ac.at (chopin.ai.univie.ac.at [131.130.174.170]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f86LOFL10600 for ; Thu, 6 Sep 2001 23:24:15 +0200 (MET DST) Received: (from markus@localhost) by chopin.ai.univie.ac.at (8.9.3/8.9.3/Debian 8.9.3-21) id XAA31427; Thu, 6 Sep 2001 23:23:56 +0200 Date: Thu, 6 Sep 2001 23:23:56 +0200 From: Markus Mottl To: Johann Spies Cc: ocaml Subject: Re: [Caml-list] How to use pcre (3) Message-ID: <20010906232356.A31302@chopin.ai.univie.ac.at> References: <87pu94lbdt.fsf@bywoner.sun.ac.za> <20010906152958.B24260@chopin.ai.univie.ac.at> <87sne0jt71.fsf_-_@bywoner.sun.ac.za> <20010906164530.F24260@chopin.ai.univie.ac.at> <87heug5c81.fsf_-_@adept.co.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <87heug5c81.fsf_-_@adept.co.za>; from jhspies@adept.co.za on Thu, Sep 06, 2001 at 21:51:58 +0200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 06 Sep 2001, Johann Spies wrote: > After about another hour and a half I did not succeed in compiling the > following program: [snip] > My latest effort was: > > $ocamlfind ocamlopt -o rex -I /usr/lib/ocaml/contrib -ccopt > -L/usr/lib/ocaml/contrib -cclib -llibpcre.a -linkall /tmp/rex.ml The problem is that you have to add pcre.cmxa (or pcre.cma for byte code) before your /tmp/rex.ml. It's not enough to link against the C-library, or better: you don't even have to do this. This should suffice: ocamlopt -o rex -I /usr/lib/ocaml/contrib -ccopt \ -L/usr/lib/ocaml/contrib pcre.cmxa /tmp/rex.ml I don't know ocamlfind, because I usually use OcamlMakefile for just about anything. If you want to try the latter, you'd write a Makefile that might look like this: --------------------------------------------------------------------------- SOURCES = rex.ml RESULT = rex LIBS = pcre -include OcamlMakefile --------------------------------------------------------------------------- You'd only have to set an environment variable (e.g. either in the Makefile itself or globally in you .bashrc or similar) named OCAML_DEFAULT_DIRS, which can be any number of paths that contain your favourite OCaml-libraries. I usually define a shell alias that just copies a suitable template of such a Makefile into the current directory so that I can experiment fast. OcamlMakefile is somewhere in my home directory and is automatically loaded if you start make as "make -I {path to generic Makefiles}". The latter can, again, be aliased. Once I find a bit more time, I'll explain such small (but useful!) development speedups on my upcoming OCaml hint page... Regards, Markus Mottl -- Markus Mottl markus@oefai.at Austrian Research Institute for Artificial Intelligence http://www.oefai.at/~markus ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr