From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 883ACBB84 for ; Tue, 10 Feb 2009 15:06:38 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlYCABkZkUmTIMAki2dsb2JhbACBbpJWAQEBCgsKGL1/hBoG X-IronPort-AV: E=Sophos;i="4.38,186,1233529200"; d="scan'208";a="23855182" Received: from max.feld.cvut.cz ([147.32.192.36]) by mail1-smtp-roc.national.inria.fr with ESMTP; 10 Feb 2009 15:06:38 +0100 Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id E3B0919F343A for ; Tue, 10 Feb 2009 15:06:37 +0100 (CET) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id bembuJ9kQ9pQ for ; Tue, 10 Feb 2009 15:06:36 +0100 (CET) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id 1D64119F3435 for ; Tue, 10 Feb 2009 15:06:36 +0100 (CET) Received: from localhost.fel.cvut.cz (meyer.felk.cvut.cz [147.32.84.20]) by imap.feld.cvut.cz (Postfix) with ESMTPSA id DCA1DFA003 for ; Tue, 10 Feb 2009 15:06:35 +0100 (CET) To: caml-list@yquem.inria.fr Subject: Re: ocamlbuild documentation Reply-To: Jan Kybic From: Jan Kybic In-Reply-To: <49909F14.6010601@doomeer.com> (DooMeeR's message of "Mon, 09 Feb 2009 22:24:36 +0100") References: <1233936696.6216.65.camel@Blefuscu> <0520EBEC-B30C-4D83-9153-A72BC3C986BF@erratique.ch> <499036C6.5070504@lri.fr> <200902091828.30057.jon@ffconsultancy.com> <49909F14.6010601@doomeer.com> Date: Tue, 10 Feb 2009 15:06:34 +0100 Message-ID: <87vdriwfmd.fsf@fel.cvut.cz> User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam: no; 0.00; ocamlopt:01 foo:01 lablgl:01 lablgl:01 cmxa:01 lablglut:01 cmxa:01 foo:01 ocaml:01 ocaml:01 lacaml:01 gsl:01 ocamlfind:01 wiki:01 ocamlfind:01 >> Instead, I found that ocamlbuild replaces my current build option of choice: >> ocamlopt foo.ml -I +lablGL lablgl.cmxa lablglut.cmxa foo.ml -o foo >> with lots of incidental complexity: I agree with the previous posters that ocamlbuild is a great project but the documentation is not yet sufficient for a beginner. Let me recall my recent experience: Yesterday, out of curiosity, I have tried to use Ocaml for my current project. It is not complicated, just a few Ocaml source files with a few libraries. In Ocamlmake, I only had to list the SOURCES and set PACKS = lacaml unix extlib str gsl In ocamlbuild, I spent a long time finding out how to tell Ocaml to use the required libraries. I took the ocamlfind plugin from the Ocamlbuild wiki (http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild) and created the following _tags file: <*.ml> or <*.mli>: pkg_extlib, pkg_gsl, pkg_str, pkg_unix : ocaml, pp(ocaml+twt), debug : ocaml, pp(camlp4o), debug Now, all files compiled correctly. However, the linking failed with message "No implementations provided for the following modules". I could eliminate some of the messages by invoking ocamlbuild as ocamlbuild -libs str,unix,bigarray,gsl matvflss.native but this did not help with gsl and extlib libraries. Finally, after many frustrating attempts I could link everything using: ocamlbuild -lflags -I,/usr/lib/ocaml/site-packages/gsl -lflags -I,/usr/lib/ocaml/site-packages/extlib -libs str,unix,bigarray,gsl,extLib matvflss.native So finally yes, ocamlbuild works. But for a beginner, it is currently more complicated to use than Ocamlmake. Instead of a few lines in a Makefile, you need to write myocamlbuild.ml, _tags, and a script automating the command line. I found the command line more or less by trial and error and by looking at the examples. It is admittedly my fault since there is one relevant sentence in the manual ("You may need to add options such as...") but it is easy to miss. Why do I have to manually set all the paths and library names if I have already said "pkg_..." in _tags? Why does not ocamlbuild uses ocamlfind to find out automatically? I thought the plugin was supposed to do exactly this. By the way, how am I supposed to use the caml-types-show-type feature in Emacs Tuareg mode, if ocamlbuild forces all the annot files into the _build subdirectory? I am sure Ocamlbuild will mature with time and become a very useful tool. Keep up the good work. Jan -- ------------------------------------------------------------------------- Jan Kybic tel. +420 2 2435 5721 http://cmp.felk.cvut.cz/~kybic ICQ 200569450