Loading ...
Sorry, an error occurred while loading the content.

Re: "ocaml_beginners"::[] Re: Does ocamlbuild have a bytecode mode?

Expand Messages
  • Jianzhou Zhao
    ... Thanks. -byte-plugin solves the problem. ... I did both. But I am using OpenSUSE 11.2, whose distribution does not contain ocamlbuild.cmx under
    Message 1 of 11 , Aug 14, 2010
    • 0 Attachment
      On Sat, Aug 14, 2010 at 10:43 AM, Sylvain Le Gall <sylvain@...> wrote:
      >
      >
      >
      > Hello,
      >
      > On 14-08-2010, Jianzhou Zhao <jianzhou@...> wrote:
      > > I have a myocamlbuild.ml that fails by ocamlbuild.
      > >
      > >========myocamlbuild.ml======
      > > open Ocamlbuild_plugin;;
      > > ocaml_lib ~extern:true "A";;
      > > flag ["link"; "ocaml"; "g++"] (S[A"-cc"; A"g++"]);;
      > > dep ["link"; "ocaml"; "use_bindings"] ;;
      > >===========================
      > >
      > > The command and errors are:
      > >
      > > ocamlbuild -j 2 -cflags -I,/home/jianzhou/Tools/llvm-2.6/lib//ocaml/
      > > test.byte
      > > + /usr/bin/ocamlopt.opt -I /usr/lib/ocaml/ocamlbuild unix.cmxa
      > > /usr/lib/ocaml/ocamlbuild/ocamlbuildlib.cmxa
      > > myocamlbuild.ml/usr/lib/ocaml/ocamlbuild/ocamlbuild.cmx -o
      > > myocamlbuild
      > > File "myocamlbuild.ml", line 1, characters 0-1:
      > > Error: Cannot find file /usr/lib/ocaml/ocamlbuild/ocamlbuild.cmx
      > > Command exited with code 2.
      > > make: *** [Test] Error 10
      > >
      > > I guess it is the first line "open Ocamlbuild_plugin" forces ocamlbuild to
      > > find ocamlbuild.cmx?
      >
      > No, if present myocamlbuild.ml triggers a compilation anyway.
      >
      > You can use
      > ocamlbuild -byte-plugin -j 2 -cflags -I,/home/jianzhou/Tools/llvm-2.6/lib//ocaml/
      > to begin

      Thanks. -byte-plugin solves the problem.

      >
      > Did you compile ocaml by yourself? Did you get it from a distribution
      > like Debian?

      I did both. But I am using OpenSUSE 11.2, whose distribution does not
      contain ocamlbuild.cmx under /usr/lib/ocaml/ocamlbuild. I also
      compiled an OCaml 3.12 by myself, and found out that only 'make
      opt.opt' generates native ocamlbuild. The files under
      /usr/lib/ocaml/ocamlbuild in OpenSUSE distribution are exactly
      objects til 'make opt'. It does not include native compilation. Does
      Debian's distribution have ocamlbuild.cmx?

      >
      > Regards,
      > Sylvain Le Gall
      >
      >


      --
      Jianzhou
    • Hugo Ferreira
      Hi Jianzhou, ... snip ... Apologies for butting in like this but... consider using GODI [1]. It will make your like easier. Works on many distributions. Allows
      Message 2 of 11 , Aug 14, 2010
      • 0 Attachment
        Hi Jianzhou,

        Jianzhou Zhao wrote:
        > On Sat, Aug 14, 2010 at 10:43 AM, Sylvain Le Gall <sylvain@...> wrote:
        snip
        >> Did you compile ocaml by yourself? Did you get it from a distribution
        >> like Debian?
        >
        > I did both. But I am using OpenSUSE 11.2, whose distribution does not
        > contain ocamlbuild.cmx under /usr/lib/ocaml/ocamlbuild. I also
        > compiled an OCaml 3.12 by myself, and found out that only 'make
        > opt.opt' generates native ocamlbuild. The files under
        > /usr/lib/ocaml/ocamlbuild in OpenSUSE distribution are exactly
        > objects til 'make opt'. It does not include native compilation. Does
        > Debian's distribution have ocamlbuild.cmx?
        >

        Apologies for butting in like this but... consider using GODI [1].
        It will make your like easier. Works on many distributions. Allows
        quick updates. Doesn't stop you from compiling anything manually.

        regards,
        Hugo.

        [1] http://godi.camlcity.org/godi/index.html

        >> Regards,
        >> Sylvain Le Gall
        >>
        >>
        >
        >
        > --
        > Jianzhou
        >
        >
        > ------------------------------------
        >
        > Archives up to December 31, 2009 are also downloadable at http://www.connettivo.net/cntprojects/ocaml_beginners/
        > The archives of the very official ocaml list (the seniors' one) can be found at http://caml.inria.fr
        > Attachments are banned and you're asked to be polite, avoid flames etc.Yahoo! Groups Links
        >
        >
        >
      • Sylvain Le Gall
        ... If you are sure of what you say, this is a bug and you should submit it to the bug tracking system of OCaml: http://caml.inria.fr/mantis/ For OCaml 3.11.2,
        Message 3 of 11 , Aug 14, 2010
        • 0 Attachment
          On 14-08-2010, Jianzhou Zhao <jianzhou@...> wrote:
          > On Sat, Aug 14, 2010 at 10:43 AM, Sylvain Le Gall <sylvain@...> wrote:
          >>
          >> Did you compile ocaml by yourself? Did you get it from a distribution
          >> like Debian?
          >
          > I did both. But I am using OpenSUSE 11.2, whose distribution does not
          > contain ocamlbuild.cmx under /usr/lib/ocaml/ocamlbuild. I also
          > compiled an OCaml 3.12 by myself, and found out that only 'make
          > opt.opt' generates native ocamlbuild. The files under
          > /usr/lib/ocaml/ocamlbuild in OpenSUSE distribution are exactly
          > objects til 'make opt'. It does not include native compilation. Does
          > Debian's distribution have ocamlbuild.cmx?

          If you are sure of what you say, this is a bug and you should submit it
          to the bug tracking system of OCaml:
          http://caml.inria.fr/mantis/

          For OCaml 3.11.2, Debian includes an ocamlbuild.cmx.

          Regards,
          Sylvain Le Gall
        • Jianzhou Zhao
          ... Maybe I am confused. Why do we think this is a bug of Ocaml? If we dont compiler ocamlbuild with make opt.opt , then it should not work as a native mode.
          Message 4 of 11 , Aug 14, 2010
          • 0 Attachment
            On Sat, Aug 14, 2010 at 11:28 AM, Sylvain Le Gall <sylvain@...> wrote:
            >
            >
            >
            > On 14-08-2010, Jianzhou Zhao <jianzhou@...> wrote:
            > > On Sat, Aug 14, 2010 at 10:43 AM, Sylvain Le Gall <sylvain@...> wrote:
            > >>
            > >> Did you compile ocaml by yourself? Did you get it from a distribution
            > >> like Debian?
            > >
            > > I did both. But I am using OpenSUSE 11.2, whose distribution does not
            > > contain ocamlbuild.cmx under /usr/lib/ocaml/ocamlbuild. I also
            > > compiled an OCaml 3.12 by myself, and found out that only 'make
            > > opt.opt' generates native ocamlbuild. The files under
            > > /usr/lib/ocaml/ocamlbuild in OpenSUSE distribution are exactly
            > > objects til 'make opt'. It does not include native compilation. Does
            > > Debian's distribution have ocamlbuild.cmx?
            >
            > If you are sure of what you say, this is a bug and you should submit it
            > to the bug tracking system of OCaml:
            > http://caml.inria.fr/mantis/

            Maybe I am confused. Why do we think this is a bug of Ocaml? If we
            dont compiler ocamlbuild with 'make opt.opt', then it should not work
            as a native mode. Is that ocamlbuild chooses byte mode automatically
            at this case expected?

            >
            > For OCaml 3.11.2, Debian includes an ocamlbuild.cmx.
            >
            > Regards,
            > Sylvain Le Gall
            >
            >


            --
            Jianzhou
          • Sylvain Le Gall
            ... make world opt should build ocamlbuild.cmx. Did you do a make opt ? Regards, Sylvain Le Gall
            Message 5 of 11 , Aug 14, 2010
            • 0 Attachment
              On 14-08-2010, Jianzhou Zhao <jianzhou@...> wrote:
              > On Sat, Aug 14, 2010 at 11:28 AM, Sylvain Le Gall <sylvain@...> wrote:
              >>
              >>
              >>
              >> On 14-08-2010, Jianzhou Zhao <jianzhou@...> wrote:
              >> > On Sat, Aug 14, 2010 at 10:43 AM, Sylvain Le Gall <sylvain@...> wrote:
              >> >>
              >> >> Did you compile ocaml by yourself? Did you get it from a distribution
              >> >> like Debian?
              >> >
              >> > I did both. But I am using OpenSUSE 11.2, whose distribution does not
              >> > contain ocamlbuild.cmx under /usr/lib/ocaml/ocamlbuild. I also
              >> > compiled an OCaml 3.12 by myself, and found out that only 'make
              >> > opt.opt' generates native ocamlbuild. The files under
              >> > /usr/lib/ocaml/ocamlbuild in OpenSUSE distribution are exactly
              >> > objects til 'make opt'. It does not include native compilation. Does
              >> > Debian's distribution have ocamlbuild.cmx?
              >>
              >> If you are sure of what you say, this is a bug and you should submit it
              >> to the bug tracking system of OCaml:
              >> http://caml.inria.fr/mantis/
              >
              > Maybe I am confused. Why do we think this is a bug of Ocaml? If we
              > dont compiler ocamlbuild with 'make opt.opt', then it should not work
              > as a native mode. Is that ocamlbuild chooses byte mode automatically
              > at this case expected?
              >

              "make world opt" should build ocamlbuild.cmx. Did you do a "make opt"?

              Regards,
              Sylvain Le Gall
            • Jianzhou Zhao
              ... Yes. I actually first did make world , and then make opt after make world . ... -- Jianzhou
              Message 6 of 11 , Aug 14, 2010
              • 0 Attachment
                On Sat, Aug 14, 2010 at 12:53 PM, Sylvain Le Gall <sylvain@...> wrote:
                >
                >
                >
                > On 14-08-2010, Jianzhou Zhao <jianzhou@...> wrote:
                > > On Sat, Aug 14, 2010 at 11:28 AM, Sylvain Le Gall <sylvain@...> wrote:
                > >>
                > >>
                > >>
                > >> On 14-08-2010, Jianzhou Zhao <jianzhou@...> wrote:
                > >> > On Sat, Aug 14, 2010 at 10:43 AM, Sylvain Le Gall <sylvain@...> wrote:
                > >> >>
                > >> >> Did you compile ocaml by yourself? Did you get it from a distribution
                > >> >> like Debian?
                > >> >
                > >> > I did both. But I am using OpenSUSE 11.2, whose distribution does not
                > >> > contain ocamlbuild.cmx under /usr/lib/ocaml/ocamlbuild. I also
                > >> > compiled an OCaml 3.12 by myself, and found out that only 'make
                > >> > opt.opt' generates native ocamlbuild. The files under
                > >> > /usr/lib/ocaml/ocamlbuild in OpenSUSE distribution are exactly
                > >> > objects til 'make opt'. It does not include native compilation. Does
                > >> > Debian's distribution have ocamlbuild.cmx?
                > >>
                > >> If you are sure of what you say, this is a bug and you should submit it
                > >> to the bug tracking system of OCaml:
                > >> http://caml.inria.fr/mantis/
                > >
                > > Maybe I am confused. Why do we think this is a bug of Ocaml? If we
                > > dont compiler ocamlbuild with 'make opt.opt', then it should not work
                > > as a native mode. Is that ocamlbuild chooses byte mode automatically
                > > at this case expected?
                > >
                >
                > "make world opt" should build ocamlbuild.cmx. Did you do a "make opt"?

                Yes. I actually first did "make world", and then "make opt" after "make world".

                >
                > Regards,
                > Sylvain Le Gall
                >
                >


                --
                Jianzhou
              • Sylvain Le Gall
                ... If make opt doesn t produce the required file, this is a problem. make opt.opt is not mandatory. $ ocamlbuild -just-plugin -verbose 5 # Target:
                Message 7 of 11 , Aug 14, 2010
                • 0 Attachment
                  On 14-08-2010, Jianzhou Zhao <jianzhou@...> wrote:
                  > On Sat, Aug 14, 2010 at 12:53 PM, Sylvain Le Gall <sylvain@...> wrote:
                  >>
                  >>
                  >>
                  >> On 14-08-2010, Jianzhou Zhao <jianzhou@...> wrote:
                  >> > On Sat, Aug 14, 2010 at 11:28 AM, Sylvain Le Gall <sylvain@...> wrote:
                  >> >>
                  >> >>
                  >> >>
                  >> >> On 14-08-2010, Jianzhou Zhao <jianzhou@...> wrote:
                  >> >> > On Sat, Aug 14, 2010 at 10:43 AM, Sylvain Le Gall <sylvain@...> wrote:
                  >> >> >>
                  >> >> >> Did you compile ocaml by yourself? Did you get it from a distribution
                  >> >> >> like Debian?
                  >> >> >
                  >> >> > I did both. But I am using OpenSUSE 11.2, whose distribution does not
                  >> >> > contain ocamlbuild.cmx under /usr/lib/ocaml/ocamlbuild. I also
                  >> >> > compiled an OCaml 3.12 by myself, and found out that only 'make
                  >> >> > opt.opt' generates native ocamlbuild. The files under
                  >> >> > /usr/lib/ocaml/ocamlbuild in OpenSUSE distribution are exactly
                  >> >> > objects til 'make opt'. It does not include native compilation. Does
                  >> >> > Debian's distribution have ocamlbuild.cmx?
                  >> >>
                  >> >> If you are sure of what you say, this is a bug and you should submit it
                  >> >> to the bug tracking system of OCaml:
                  >> >> http://caml.inria.fr/mantis/
                  >> >
                  >> > Maybe I am confused. Why do we think this is a bug of Ocaml? If we
                  >> > dont compiler ocamlbuild with 'make opt.opt', then it should not work
                  >> > as a native mode. Is that ocamlbuild chooses byte mode automatically
                  >> > at this case expected?
                  >> >
                  >>
                  >> "make world opt" should build ocamlbuild.cmx. Did you do a "make opt"?
                  >
                  > Yes. I actually first did "make world", and then "make opt" after "make world".
                  >

                  If "make opt" doesn't produce the required file, this is a problem.
                  "make opt.opt" is not mandatory.

                  $ ocamlbuild -just-plugin -verbose 5
                  # Target: myocamlbuild, tags: { }
                  /usr/bin/ocamlopt.opt -I /usr/lib/ocaml/ocamlbuild unix.cmxa /usr/lib/ocaml/ocamlbuild/ocamlbuildlib.cmxa myocamlbuild.ml /usr/lib/ocaml/ocamlbuild/ocamlbuild.cmx -o myocamlbuild

                  So to build myocamlbuild we need ocamlbuild.cmx, if it is only installed
                  in an optional step, it is a bug (not very grave).

                  Regards
                  Sylvain Le Gall
                Your message has been successfully submitted and would be delivered to recipients shortly.