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 207E57EE49 for ; Wed, 20 Feb 2013 13:20:12 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of oleg@okmij.org) identity=pra; client-ip=66.39.3.115; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="oleg@okmij.org"; x-sender="oleg@okmij.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of oleg@okmij.org designates 66.39.3.115 as permitted sender) identity=mailfrom; client-ip=66.39.3.115; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="oleg@okmij.org"; x-sender="oleg@okmij.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@www1.g3.pair.com) identity=helo; client-ip=66.39.3.115; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="oleg@okmij.org"; x-sender="postmaster@www1.g3.pair.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Am0CAOa+JFFCJwNzd2dsb2JhbAA/BcBXgRQOAQwHDwc7gh8BAQQBJ1IFFhgcaRQfh3IGwAONW4EzBxaDKgOSbYM+AYEdkkU X-IPAS-Result: Am0CAOa+JFFCJwNzd2dsb2JhbAA/BcBXgRQOAQwHDwc7gh8BAQQBJ1IFFhgcaRQfh3IGwAONW4EzBxaDKgOSbYM+AYEdkkU X-IronPort-AV: E=Sophos;i="4.84,701,1355094000"; d="scan'208";a="3706324" Received: from www1.g3.pair.com ([66.39.3.115]) by mail2-smtp-roc.national.inria.fr with SMTP; 20 Feb 2013 13:20:11 +0100 Received: (qmail 18645 invoked by uid 9370); 20 Feb 2013 12:20:10 -0000 Date: 20 Feb 2013 12:20:10 -0000 Message-ID: <20130220122010.18644.qmail@www1.g3.pair.com> From: oleg@okmij.org To: bobzhang1988@gmail.com CC: caml-list@inria.fr In-reply-to: X-Validation-by: oleg@okmij.org Subject: [Caml-list] Re: ANN: Brand-new BER MetaOCaml for OCaml 4.00.1 Bob Zhang wrote: > After reading the patch of BER MetaOCaml today, I found that it is not > too hard to port camlp4/Fan to support metaocaml. That's a good news! Old camlp4 was once ported to MetaOCaml, but it took really a lot of effort. > I get an install error > ./build/partial-install.sh: line 25: config/config.sh: No such file or directory > make: *** [install] Error 1 > After I ignore the error message, the metaocaml toplevel works > perfectly well. The error comes about because the Makefile doesn't build ocamlbuild. To save time during the development metaocaml, I skip building ocamlbuild (I don't use it myself). I guess I didn't reactivated it. I will fix this shortly in the metaocaml.bundle. In the meanwhile, you can do make ocamlbuild.byte in the main ocaml-4.00.1 tree, followed by make install. This time there should be no build/partial-install.sh error. ocamlbuild will be installed. > But if I customized my own toplevel (I used my toplevel as 'ocamlmktop > -custom -o mocaml') > mocaml is bundled with compiler-libs, the toplevel does not work, I get > the following > error message: > > # let spower7 = .! spower7_code;; > Error: Reference to undefined global `Runcode' As Jacques said, you do need to use metaocamlmktop. This is just a shell script; you can look inside and see what libraries and object files it uses and link your own toplevel accordingly (the order libraries and object files matters!) > Currently metaocaml does not support native code, but it seems that the > patch only installs ocamlc, is it possible to get ocamlc.opt installed as > well? (not the ocamlopt.opt) ocamlbuild is not installed either. It would > be even nicer that ocamlopt.opt could be installed without supporting > metaocaml, otherwise I have to switch between different compilers from time > to time. Yes, it is possible. It is possible almost immediately but I just had an idea how to do it much better. If works out it will bring essentially native metaocaml. I will need time to check it though... Well, better is the enemy of the good. If you want ocamlopt urgently (without using brackets and escapes) I can make a patch easily -- or tell you one line to add to one file. Namely, to the file asmcomp/cmmgen.ml add at the line 1713 (at the end of the function emit_constant_field) the following single line: | Const_csp_value _ -> assert false After that, do make ocamlopt followed by make install. You get ocamlopt that, as a side benefit, understands the let! monadic notation (which never made it to the official version, but seems quite handy).