caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: oleg@okmij.org
To: bobzhang1988@gmail.com
Cc: caml-list@inria.fr
Subject: [Caml-list] Re: ANN: Brand-new BER MetaOCaml for OCaml 4.00.1
Date: 20 Feb 2013 12:20:10 -0000	[thread overview]
Message-ID: <20130220122010.18644.qmail@www1.g3.pair.com> (raw)
In-Reply-To: <CANcqPu7UTgE=z3YdMHKQsVjZm7XsDGiS7=apd2KzAy25eS=76A@mail.gmail.com>


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).



  parent reply	other threads:[~2013-02-20 12:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-19  3:37 [Caml-list] " bob zhang
2013-02-20  1:51 ` Jacques Carette
2013-02-20 14:03   ` bob zhang
2013-02-20 12:20 ` oleg [this message]
2013-02-20 14:11   ` [Caml-list] " bob zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130220122010.18644.qmail@www1.g3.pair.com \
    --to=oleg@okmij.org \
    --cc=bobzhang1988@gmail.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).