From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by c5ff346549e7 (Postfix) with ESMTP id 003C85D6 for ; Wed, 31 Jul 2019 21:18:48 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.64,331,1559512800"; d="scan'208";a="394046202" Received: from sympa.inria.fr ([193.51.193.213]) by mail2-relais-roc.national.inria.fr with ESMTP; 31 Jul 2019 23:18:38 +0200 Received: by sympa.inria.fr (Postfix, from userid 20132) id 704DE82718; Wed, 31 Jul 2019 23:18:38 +0200 (CEST) Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 7E4C682708 for ; Wed, 31 Jul 2019 23:18:27 +0200 (CEST) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=itz@very.loosely.org; spf=Pass smtp.mailfrom=itz@very.loosely.org; spf=Pass smtp.helo=postmaster@very.loosely.org IronPort-PHdr: =?us-ascii?q?9a23=3AgXOkKxVSFAxYNIoizk4hYIQoRdrV8LGtZVwlr6E/?= =?us-ascii?q?grcLSJyIuqrYbBaEt8tkgFKBZ4jH8fUM07OQ7/m6Hz1dqs/c7TgrS99lb1c9k8?= =?us-ascii?q?IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUhrwOhBo?= =?us-ascii?q?KevrB4Xck9q41/yo+53Ufg5EmCexbal9IRmrswndrM0bjIttJqosyhbEomZDdv?= =?us-ascii?q?hLy29vOV+dhQv36N2q/J5k/SRQuvYh+NBFXK7nYak2TqFWASo/PWwt68LlqRfM?= =?us-ascii?q?TQ2U5nsBSWoWiQZHAxLE7B7hQJj8tDbxu/dn1ymbOc32Sq00WSin4qx2RhLklD?= =?us-ascii?q?sLOjgk+27Ql8JwkblboAq/qBNj347aboaVNP9kcaPce9MRWG5NU8lVWiBEBI63?= =?us-asc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igGF2DClUeYY?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0AhMADtBEJd/0XX/61mHQEBHwUBBgGBT?= =?us-ascii?q?gKCFi1AUjIqjRqGPzcCAQkLAQEBAQEFAVNfAReBDohAjyGBewkBAwEMHw0BAgE?= =?us-ascii?q?BhxAcBgEEMgcOAQMBAQQBAQIBAwMBbIUeDII6DINFNEcTIU6DNoF2FAWuB4hug?= =?us-ascii?q?UiBNAGLXxd4gQeBEYIUUIsTBJVGlUkJghwDhlmNMQwbgi5thjqOQaVMgVcHKoF?= =?us-ascii?q?YTTAIO4JsCYYqhCCCMYQiHzOBBgEBjkABAQ?= X-IPAS-Result: =?us-ascii?q?A0AhMADtBEJd/0XX/61mHQEBHwUBBgGBTgKCFi1AUjIqjRq?= =?us-ascii?q?GPzcCAQkLAQEBAQEFAVNfAReBDohAjyGBewkBAwEMHw0BAgEBhxAcBgEEMgcOA?= =?us-ascii?q?QMBAQQBAQIBAwMBbIUeDII6DINFNEcTIU6DNoF2FAWuB4hugUiBNAGLXxd4gQe?= =?us-ascii?q?BEYIUUIsTBJVGlUkJghwDhlmNMQwbgi5thjqOQaVMgVcHKoFYTTAIO4JsCYYqh?= =?us-ascii?q?CCCMYQiHzOBBgEBjkABAQ?= X-IronPort-AV: E=Sophos;i="5.64,331,1559512800"; d="scan'208";a="315293771" X-MGA-submission: =?us-ascii?q?MDFbJ2cSC+rPGjsI4HubVBFSiNFQU9I1YZiAGL?= =?us-ascii?q?cEVvD0vgz1qI/BBVypoWJx2u1cXKalS0xAUz4YDiZ/KhduTrGCWsI5ml?= =?us-ascii?q?eFv7gwi0V6uCVBsZPRxlftT62qLcAlOeZwS/6rSp5RzvUZHsNGo+lTty?= =?us-ascii?q?y9WlzUCj8PlMXv2vGEb6WZ3g=3D=3D?= Received: from very.loosely.org ([173.255.215.69]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jul 2019 23:18:26 +0200 Received: from c-67-174-233-217.hsd1.ca.comcast.net ([67.174.233.217]:36416 helo=foolinux.mooo.com) by ahiker.mooo.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92-114-9dcbe0535) (envelope-from ) id 1hsvzL-0005Sa-MT; Wed, 31 Jul 2019 14:18:23 -0700 Date: Wed, 31 Jul 2019 14:18:16 -0700 From: Ian Zimmerman To: Caml Mailinglist Message-ID: <20190731211816.x5vj472m34cshifj@matica.foolinux.mooo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20180716 X-Loosely-ASN: 7922 Subject: [Caml-list] How to use -map , -no-alias-deps and friends? Reply-To: Ian Zimmerman X-Loop: caml-list@inria.fr X-Sequence: 17725 Errors-to: caml-list-owner@inria.fr Precedence: list Precedence: bulk Sender: caml-list-request@inria.fr X-no-archive: yes List-Id: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: I'm having hellish time with them. I'm trying to build a simple library Aaa; let's assume bytecode only at this point. It should make available submodules like Aaa.Strutils, Aaa.Listutils et cetera from other packages, yet when building the library I want cross-module references look like Strutils , Listutils et cetera. This seems to be precisely the situation these knobs were meant for; and yet I just cannot make it work. It doesn't help that the two pieces of the manual explaining this, namely sections 14.2 and 8.9, are in less than perfect alignment: 8.9 seems to suggest that the "map" file should be Aaa.ml (ie. an implementation file), and that there should be no corresponding interface file, but 14.2 shows -map mylib.mli passed to ocamldep. Here's my latest attempt. First, the Makefile: #! /usr/bin/make -f SHELL = /bin/sh PATH != eval "`opam env`" ; echo "$${PATH}" export PATH OCAMLFLAGS = -no-alias-deps -w -49 # add other options for ocamlc here # The list of object files for AAA AAA_SUBMODULES != echo Aaa__*.ml AAA_INTERFACES = $(AAA_SUBMODULES:.ml=.mli) AAA_NATIVEOBJS != ./linkorder.sh native Aaa $(AAA_SUBMODULES) $(AAA_INTERFACES) AAA_BYTEOBJS != ./linkorder.sh byte Aaa $(AAA_SUBMODULES) $(AAA_INTERFACES) .PHONY: byte native byte: Aaa.cma native: Aaa.cmxa Aaa.cma: $(AAA_BYTEOBJS) Aaa.cmo ocamlc -a -o Aaa.cma $(OCAMLFLAGS) $(AAA_BYTEOBJS) Aaa.cmo Aaa.cmxa: $(AAA_NATIVEOBJS) Aaa.cmx ocamlopt -a -o Aaa.cmxa $(OCAMLFLAGS) $(AAA_NATIVEOBJS) Aaa.cmx # Common rules .SUFFIXES: .ml .mli .cmo .cmi .cmx .ml.cmo: ocamlc $(OCAMLFLAGS) -open Aaa -c $< .ml.cmx: ocamlopt $(OCAMLFLAGS) -open Aaa -c $< Aaa.cmo: Aaa.ml ocamlc $(OCAMLFLAGS) -c Aaa.ml Aaa.cmx: Aaa.ml ocamlopt $(OCAMLFLAGS) -c Aaa.ml .mli.cmi: ocamlc $(OCAMLFLAGS) -open Aaa -c $< # Dependencies .depend: Makefile $(AAA_INTERFACES) $(AAA_SUBMODULES) Aaa.ml ocamldep -map Aaa.ml $(AAA_INTERFACES) $(AAA_SUBMODULES) -as-map Aaa.ml > .depend include .depend # Test suite RunTests: Aaa.cma RunTests.ml ocamlfind ocamlc -package qcheck-core -package qcheck-core.runner -o RunTests -linkpkg Aaa.cma RunTests.ml .PHONY: clean test test: RunTests ./RunTests clean: rm -f *.cma *.cmxa *.cmo *.o *.cmx *.cmi .depend RunTests # makefile ends here Here's Aaa.ml: module Colorspec = Aaa__Colorspec module Exnutils = Aaa__Exnutils module HashedString = Aaa__HashedString module Ioutils = Aaa__Ioutils module Listutils = Aaa__Listutils module Resultx = Aaa__Resultx module Sm = Aaa__Sm module Strutils = Aaa__Strutils ... and in this iteration, there is no Aaa.mli. This produces the following output: matica!91 aaa$ make Fatal error: exception Failure("Aaa.mli : empty map file or parse error") Fatal error: exception Failure("Aaa.mli : empty map file or parse error") ocamldep -map Aaa.ml Aaa__Colorspec.mli Aaa__Exnutils.mli Aaa__HashedString.mli Aaa__Ioutils.mli Aaa__Listutils.mli Aaa__Resultx.mli Aaa__Sm.mli Aaa__Strutils.mli Aaa__Colorspec.ml Aaa__Exnutils.ml Aaa__HashedString.ml Aaa__Ioutils.ml Aaa__Listutils.ml Aaa__Resultx.ml Aaa__Sm.ml Aaa__Strutils.ml -as-map Aaa.ml > .depend Fatal error: exception Failure("Aaa.mli : empty map file or parse error") Fatal error: exception Failure("Aaa.mli : empty map file or parse error") ocamlc -no-alias-deps -w -49 -c Aaa.ml ocamlc -a -o Aaa.cma -no-alias-deps -w -49 Aaa.cmo matica!92 aaa$ ls Aaa.cma Aaa__Colorspec.mli Aaa__Ioutils.ml Aaa__Resultx.mli LICENSE install.sh Aaa.cmi Aaa__Exnutils.ml Aaa__Ioutils.mli Aaa__Sm.ml META linkorder.sh Aaa.cmo Aaa__Exnutils.mli Aaa__Listutils.ml Aaa__Sm.mli Makefile Aaa.ml Aaa__HashedString.ml Aaa__Listutils.mli Aaa__Strutils.ml ORIGINAL_VERSION Aaa__Colorspec.ml Aaa__HashedString.mli Aaa__Resultx.ml Aaa__Strutils.mli RunTests.ml So, an archive file gets created, but obviously doesn't contain any real code. Virtual hugs for setting me on the right path. -- Please don't Cc: me privately on mailing lists and Usenet, if you also post the followup to the list or newsgroup. To reply privately _only_ on Usenet and on broken lists which rewrite From, fetch the TXT record for no-use.mooo.com.