caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Zhu Ping" <zhuping@comp.nus.edu.sg>
To: <matthieu.dubuget@laposte.net>
Cc: "Anil Madhavapeddy" <anil@recoil.org>, <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Using Frontc
Date: Mon, 21 Nov 2005 16:41:35 +0800	[thread overview]
Message-ID: <000e01c5ee77$724858b0$1db312ac@comp.nus.edu.sg> (raw)
In-Reply-To: <43806DF3.1000806@laposte.net>

I have successfully compiled my main program by executing the following two 
commands sequentially:
$ ocamlc -c -I /home/sand/cil/obj/x86_LINUX  main.ml
$ ocamlc -o main -custom /home/sand/cil/obj/x86_LINUX/perfcount.o 
/usr/lib/ocaml/unix.cma /usr/lib/ocaml/str.cma -I 
/home/sand/cil/obj/x86_LINUX/ pretty.cmo trace.cmo errormsg.cmo cabs.cmo 
cabsvisit.cmo escape.cmo cprint.cmo patch.cmo stats.cmo lexerhack.cmo 
machdep.cmo clexer.cmo cparser.cmo inthash.cmo util.cmo clist.cmo 
cilversion.cmo alpha.cmo cil.cmo cilutil.cmo cabs2cil.cmo frontc.cmo 
main.cmo

But you can't see anything by just typing "./main"



To print the value of "parse_result" defined in my main.ml, I first build my 
toplevel interpretator by executing:
$ ocamlmktop -o mytoplevel -custom /home/sand/cil/obj/x86_LINUX/perfcount.o 
/usr/lib/ocaml/unix.cma /usr/lib/ocaml/str.cma -I 
/home/sand/cil/obj/x86_LINUX/ pretty.cmo trace.cmo errormsg.cmo cabs.cmo 
cabsvisit.cmo escape.cmo cprint.cmo patch.cmo stats.cmo lexerhack.cmo 
machdep.cmo clexer.cmo cparser.cmo inthash.cmo util.cmo clist.cmo 
cilversion.cmo alpha.cmo cil.cmo cilutil.cmo cabs2cil.cmo frontc.cmo 
main.cmo

Then in this new toplevel the value of "parse_result" is propoerly displayed

You can refer to the book "Developing Applications With Objective Caml" 
(page 322) to know more details about building a new toplevel interpretator 
which can use an external C function in the toplevel interactive loop.


The pity now is the CIL format seems too complicated for me. I like the data 
structure defined in an earlier version of FrontC 
(http://casse.hugues.free.fr/projects/frontc.html) better:). However I still 
have problems in compiling FrontC sources downloaded from the site 
http://casse.hugues.free.fr/projects/frontc.html. Did anyone successfully 
install FrontC in Linux/Unix?



Anyway, thank you all for your help:)


----- Original Message ----- 
From: "Matthieu Dubuget" <matthieu.dubuget@laposte.net>
To: "Zhu Ping" <zhuping@comp.nus.edu.sg>
Cc: "Anil Madhavapeddy" <anil@recoil.org>; <caml-list@yquem.inria.fr>
Sent: Sunday, November 20, 2005 8:37 PM
Subject: Re: [Caml-list] Using Frontc


>
>> ocamlc -o main -I /home/sand/cil/obj/x86_LINUX/ pretty.cmo trace.cmo
>> errormsg.cmo cabs.cmo cabsvisit.cmo escape.cmo cprint.cmo patch.cmo
>> frontc.cmo main.cmo
>> "Error while linking /home/sand/cil/obj/x86_LINUX/patch.cmo: Reference
>> to undefined global 'Unix' "
>
> Try this :
> ocamlc -o main -I /home/sand/cil/obj/x86_LINUX/ unix .cma pretty.cmo
> trace.cmo errormsg.cmo cabs.cmo cabsvisit.cmo escape.cmo cprint.cmo
> patch.cmo frontc.cmo main.cmo
>
> Salutations
>
> Matthieu
> 


  reply	other threads:[~2005-11-21  8:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-20  8:44 Zhu Ping
2005-11-20 12:37 ` Matthieu Dubuget
2005-11-21  8:41   ` Zhu Ping [this message]
2005-11-21  9:54     ` Gerd Stolpmann
2005-11-24  6:12       ` Zhu Ping
2005-11-24 10:25         ` skaller
  -- strict thread matches above, loose matches on Subject: below --
2005-11-18  9:22 Zhu Ping
2005-11-18  9:52 ` [Caml-list] " Anil Madhavapeddy

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='000e01c5ee77$724858b0$1db312ac@comp.nus.edu.sg' \
    --to=zhuping@comp.nus.edu.sg \
    --cc=anil@recoil.org \
    --cc=caml-list@yquem.inria.fr \
    --cc=matthieu.dubuget@laposte.net \
    /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).