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

Re: /usr/local/lib/ocaml/pervasives.cmi is not a compiled interface

Expand Messages
  • Marco
    ... Certainly I can : urzhiataer-ewan:/usr/local/lib/ocaml ewan$ file pervasives.cmi pervasives.cmi: Objective caml interface file (.cmi) (Version 012). So the
    Message 1 of 22 , Feb 14, 2011
    • 0 Attachment
      --- In ocaml_beginners@yahoogroups.com, Sylvain Le Gall <sylvain@...> wrote:

      > Can you check the existence of pervasives.cmi in the mentioned
      > directory? Can you also check that it is the version coming with ocaml
      > 3.12.0?


      Certainly I can :

      urzhiataer-ewan:/usr/local/lib/ocaml ewan$ file pervasives.cmi
      pervasives.cmi: Objective caml interface file (.cmi) (Version 012).

      So the problem with pervasives.cmi is not that it doesn't
      exit (else a "not found" message would have been produed), but that
      it's not a "compiled interface" (what the heck does that mean?)

      Cheers,

      Ewan
    • Sylvain Le Gall
      ... You are probably mixing 2 versions of OCaml. You need to find what comes from your 3.09 installation. Can you check the version of the ocamlopt.opt
      Message 2 of 22 , Feb 14, 2011
      • 0 Attachment
        On 14-02-2011, Marco <roparzhhemon@...> wrote:
        > --- In ocaml_beginners@yahoogroups.com, Sylvain Le Gall <sylvain@...> wrote=
        >:
        >
        >> Can you check the existence of pervasives.cmi in the mentioned
        >> directory? Can you also check that it is the version coming with ocaml
        >> 3.12.0?
        >
        >
        > Certainly I can :
        >
        > urzhiataer-ewan:/usr/local/lib/ocaml ewan$ file pervasives.cmi
        > pervasives.cmi: Objective caml interface file (.cmi) (Version 012).
        >
        > So the problem with pervasives.cmi is not that it doesn't
        > exit (else a "not found" message would have been produed), but that
        > it's not a "compiled interface" (what the heck does that mean?)
        >

        You are probably mixing 2 versions of OCaml. You need to find what comes
        from your 3.09 installation.

        Can you check the version of the ocamlopt.opt compiler?

        (ocamlopt.opt -v)

        Cheers,
        Sylvain Le Gall
        --
        My company: http://www.ocamlcore.com
        Linkedin: http://fr.linkedin.com/in/sylvainlegall
        Start an OCaml project here: http://forge.ocamlcore.org
        OCaml blogs: http://planet.ocamlcore.org
      • Marco
        You re absolutely right : urzhiataer-ewan:~ ewan$ ocamlopt.opt -v The Objective Caml native-code compiler, version 3.09.3 Standard library directory:
        Message 3 of 22 , Feb 14, 2011
        • 0 Attachment
          You're absolutely right :

          urzhiataer-ewan:~ ewan$ ocamlopt.opt -v
          The Objective Caml native-code compiler, version 3.09.3
          Standard library directory: /usr/local/lib/ocaml

          Should I have deleted all the contents of /usr/local/lib/ocaml
          to avoid this ? If I try to remake ocamlopt.opt I run into problems :

          urzhiataer-ewan:~/Documents/Caml/ocaml-3.12.0 ewan$ make ocamlopt.opt
          cd tools; \
          make CAMLC="../byterun/ocamlrun ../boot/ocamlc -I ../stdlib" cvt_emit
          ../byterun/ocamlrun ../boot/ocamlc -I ../stdlib -c -warn-error A -I ../utils -I ../parsing -I ../typing -I ../bytecomp -I ../asmcomp -I ../driver cvt_emit.ml
          make[1]: ../byterun/ocamlrun: Command not found
          make[1]: *** [cvt_emit.cmo] Error 127
          make: *** [tools/cvt_emit] Error 2

          Must I go through all the installation process from scratch?

          Ewan




          --- In ocaml_beginners@yahoogroups.com, Sylvain Le Gall <sylvain@...> wrote:
          >

          >
          > You are probably mixing 2 versions of OCaml. You need to find what comes
          > from your 3.09 installation.
          >
          > Can you check the version of the ocamlopt.opt compiler?
          >
          > (ocamlopt.opt -v)
          >
          > Cheers,
          > Sylvain Le Gall
          > --
          > My company: http://www.ocamlcore.com
          > Linkedin: http://fr.linkedin.com/in/sylvainlegall
          > Start an OCaml project here: http://forge.ocamlcore.org
          > OCaml blogs: http://planet.ocamlcore.org
          >
        • Sylvain Le Gall
          ... It is indeed better to get rid of all the previous content (/usr/local/lib/ocaml + /usr/local/bin/ocaml* + /usr/local/bin/camlp4* and everything
          Message 4 of 22 , Feb 14, 2011
          • 0 Attachment
            On 14-02-2011, Marco <roparzhhemon@...> wrote:
            > You're absolutely right :
            >
            > urzhiataer-ewan:~ ewan$ ocamlopt.opt -v
            > The Objective Caml native-code compiler, version 3.09.3
            > Standard library directory: /usr/local/lib/ocaml
            >
            > Should I have deleted all the contents of /usr/local/lib/ocaml
            > to avoid this ? If I try to remake ocamlopt.opt I run into problems :
            >
            > urzhiataer-ewan:~/Documents/Caml/ocaml-3.12.0 ewan$ make ocamlopt.opt
            > cd tools; \
            > make CAMLC=3D"../byterun/ocamlrun ../boot/ocamlc -I ../stdlib" cvt_emit
            > ../byterun/ocamlrun ../boot/ocamlc -I ../stdlib -c -warn-error A -I ../util=
            > s -I ../parsing -I ../typing -I ../bytecomp -I ../asmcomp -I ../driver cvt_=
            > emit.ml
            > make[1]: ../byterun/ocamlrun: Command not found
            > make[1]: *** [cvt_emit.cmo] Error 127
            > make: *** [tools/cvt_emit] Error 2
            >
            > Must I go through all the installation process from scratch?

            It is indeed better to get rid of all the previous content
            (/usr/local/lib/ocaml + /usr/local/bin/ocaml* + /usr/local/bin/camlp4*
            and everything appropriate).

            AFAIR, the sequence is:
            make world
            make opt
            make opt.opt
            make install

            Then you'll have to rebuild findlib and oUnit.

            Cheers,
            Sylvain Le Gall
            --
            My company: http://www.ocamlcore.com
            Linkedin: http://fr.linkedin.com/in/sylvainlegall
            Start an OCaml project here: http://forge.ocamlcore.org
            OCaml blogs: http://planet.ocamlcore.org
          • Marco
            ... This time, the make opt.opt command fails : /usr/bin/ld: table of contents for archive: stdlib/libasmrun.a is out of date; rerun ranlib(1) (can t load
            Message 5 of 22 , Feb 14, 2011
            • 0 Attachment
              --- In ocaml_beginners@yahoogroups.com, Sylvain Le Gall <sylvain@...> wrote:
              >

              > AFAIR, the sequence is:
              > make world
              > make opt
              > make opt.opt
              > make install
              >

              This time, the "make opt.opt" command fails :

              /usr/bin/ld: table of contents for archive: stdlib/libasmrun.a is out of date; rerun ranlib(1) (can't load from it)
              collect2: ld returned 1 exit status
              File "caml_startup", line 1, characters 0-1:
              Error: Error during linking
              make: *** [ocamlc.opt] Error 2


              Ewan
            • Sylvain Le Gall
              ... Have you cleaned your environment before ? (make clean) What Linux distribution are you using ? What version of gcc ? Cheers, Sylvain Le Gall -- My
              Message 6 of 22 , Feb 14, 2011
              • 0 Attachment
                On 14-02-2011, Marco <roparzhhemon@...> wrote:
                > --JySAFIhnBCylSryj4YAq2srH-UxfUQCBP0WgOq2
                > Content-Type: text/plain; charset=ISO-8859-1
                > Content-Transfer-Encoding: quoted-printable
                >
                >
                >
                > --- In ocaml_beginners@yahoogroups.com, Sylvain Le Gall <sylvain@...> wrote=
                >:
                >>
                >
                >> AFAIR, the sequence is:
                >> make world
                >> make opt
                >> make opt.opt=20
                >> make install=20
                >>=20
                >
                > This time, the "make opt.opt" command fails :
                >
                > /usr/bin/ld: table of contents for archive: stdlib/libasmrun.a is out of da=
                > te; rerun ranlib(1) (can't load from it)
                > collect2: ld returned 1 exit status
                > File "caml_startup", line 1, characters 0-1:
                > Error: Error during linking
                > make: *** [ocamlc.opt] Error 2
                >

                Have you cleaned your environment before ? (make clean)

                What Linux distribution are you using ? What version of gcc ?

                Cheers,
                Sylvain Le Gall
                --
                My company: http://www.ocamlcore.com
                Linkedin: http://fr.linkedin.com/in/sylvainlegall
                Start an OCaml project here: http://forge.ocamlcore.org
                OCaml blogs: http://planet.ocamlcore.org
              • Marco
                ... I have. ... My laptop is an iBook, so there s no Linux distribution. The gcc is version is urzhiataer-ewan:~/Documents/Caml/ocaml-3.12.0 ewan$ gcc -v Using
                Message 7 of 22 , Feb 14, 2011
                • 0 Attachment
                  --- In ocaml_beginners@yahoogroups.com, Sylvain Le Gall <sylvain@...> wrote:

                  >
                  > Have you cleaned your environment before ? (make clean)

                  I have.

                  >
                  > What Linux distribution are you using ? What version of gcc ?
                  >


                  My laptop is an iBook, so there's no Linux distribution. The gcc
                  is version is

                  urzhiataer-ewan:~/Documents/Caml/ocaml-3.12.0 ewan$ gcc -v
                  Using built-in specs.
                  Target: powerpc-apple-darwin8
                  Configured with: /private/var/tmp/gcc/gcc-5247.obj~4/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --build=powerpc-apple-darwin8 --host=powerpc-apple-darwin8 --target=powerpc-apple-darwin8
                  Thread model: posix
                  gcc version 4.0.1 (Apple Computer, Inc. build 5247)


                  Ewan
                • Jean Saint-Remy
                  I always wonder about that. Can I compile my own interface file? # open Set ;; -: Error: set.cmi is not a compiled interface # open MoreLabels ;; # open Set ;;
                  Message 8 of 22 , Feb 16, 2011
                  • 0 Attachment
                    I always wonder about that. Can I compile my own interface file?

                    # open Set ;;
                    -: Error: set.cmi is not a compiled interface

                    # open MoreLabels ;;
                    # open Set ;;
                    (* works here *)

                    Why don't we get a more useful error, such as x requires y to be loaded as well?

                    Jean

                    --- On Mon, 2/14/11, Marco <roparzhhemon@...> wrote:

                    From: Marco <roparzhhemon@...>
                    Subject: "ocaml_beginners"::[] Re: /usr/local/lib/ocaml/pervasives.cmi is not a compiled interface
                    To: ocaml_beginners@yahoogroups.com
                    Date: Monday, February 14, 2011, 10:48 AM







                     













                    --- In ocaml_beginners@yahoogroups.com, Sylvain Le Gall <sylvain@...> wrote:



                    > Can you check the existence of pervasives.cmi in the mentioned

                    > directory? Can you also check that it is the version coming with ocaml

                    > 3.12.0?



                    Certainly I can :



                    urzhiataer-ewan:/usr/local/lib/ocaml ewan$ file pervasives.cmi

                    pervasives.cmi: Objective caml interface file (.cmi) (Version 012).



                    So the problem with pervasives.cmi is not that it doesn't

                    exit (else a "not found" message would have been produed), but that

                    it's not a "compiled interface" (what the heck does that mean?)



                    Cheers,



                    Ewan

























                    [Non-text portions of this message have been removed]
                  • Sylvain Le Gall
                    ... You have a problem with set.cmi, check that ocaml and the .cmi are from the same installation (i.e. at least same ocaml version). ... In fact, it has
                    Message 9 of 22 , Feb 16, 2011
                    • 0 Attachment
                      On 16-02-2011, Jean Saint-Remy <jeansaintremy@...> wrote:
                      >
                      > I always wonder about that. Can I compile my own interface file?
                      >
                      > # open Set ;;
                      > -: Error: set.cmi is not a compiled interface
                      >

                      You have a problem with set.cmi, check that ocaml and the .cmi are from
                      the same installation (i.e. at least same ocaml version).

                      > # open MoreLabels ;;
                      > # open Set ;;
                      > (* works here *)
                      >
                      > Why don't we get a more useful error, such as x requires y to be loaded as =
                      > well?
                      >

                      In fact, it has nothing to do with module loading (which is handled by
                      open).

                      In this case, MoreLabels contains a module Set. So basically, you are
                      not opening the same thing.

                      # open Set;;
                      -> should open the module Set
                      http://caml.inria.fr/pub/docs/manual-ocaml/libref/Set.html

                      # open MoreLabels;;
                      # open Set;;
                      -> open MoreLabels.Set
                      http://caml.inria.fr/pub/docs/manual-ocaml/libref/MoreLabels.Set.html

                      You can encounter module loading problems when you use more complex
                      library that require extra external libraries. In this case, you should
                      use "findlib" that will handle library loading for you.

                      Cheers,
                      Sylvain Le Gall
                      --
                      My company: http://www.ocamlcore.com
                      Linkedin: http://fr.linkedin.com/in/sylvainlegall
                      Start an OCaml project here: http://forge.ocamlcore.org
                      OCaml blogs: http://planet.ocamlcore.org
                    • Jean Saint-Remy
                      Hi Sylvain, # ocamlc -v The blessed Objective Caml compiler, version 3.12.0 Standard library directory: /usr/lib/ocaml # locate set.cmi /home/jean/set.cmi
                      Message 10 of 22 , Feb 16, 2011
                      • 0 Attachment
                        Hi Sylvain,

                        # ocamlc -v
                        The blessed Objective Caml compiler, version 3.12.0
                        Standard library directory: /usr/lib/ocaml

                        # locate set.cmi
                        /home/jean/set.cmi
                        /usr/lib/ocaml/set.cmi
                        ls -l set.cmi
                        -rw-r--r-- 1 jean jean 495 2010-07-18 10:21 set.cmi
                        -rw-r--r-- 1 root root 4545 2010-10-30 10:53 /usr/lib/ocaml/set.cmi
                        echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/jean

                        After removing the *mysterious* set.cmi from /home, I can now successfully open the Set library. This is uncanny, strange behaviour if you ask me. I inadvertently created a set.ml when working with unique.ml

                        Does this mean I have to be very gingerly when creating _programs_ that might appear in the standard ocaml library?

                        With kind regards,

                        Jean

                        (* unique.ml *)
                        (* echo input text only if did not appear already *)
                        (** compile with ocamlc -c set.ml unique.ml then ocamlc -o unique set.cmo
                            unique.cmo; note there is an already existing unique Unix prog so run with
                            ./unique *)
                        open Set
                        let rec unique already_read =
                          output_string stdout "> ";
                          flush stdout;
                          let line = input_line stdin in
                        (* revised *)
                        (*  if not ( List.mem line already_read )  *)
                            if not ( mem line already_read )
                            then
                              begin
                                output_string stdout line;
                                output_char stdout '\n';
                        (* revised *)
                        (*      unique ( line :: already_read )  *)
                                unique ( add line already_read )
                              end
                            else
                              unique already_read ;;

                        (* main program *)
                        try unique empty  (* changed from 'try unique []' *)
                        with End_of_file -> () ;;


                        --- On Wed, 2/16/11, Sylvain Le Gall <sylvain@...> wrote:

                        From: Sylvain Le Gall <sylvain@...>
                        Subject: "ocaml_beginners"::[] Re: /usr/local/lib/ocaml/pervasives.cmi is not a compiled interface
                        To: ocaml_beginners@yahoogroups.com
                        Date: Wednesday, February 16, 2011, 12:49 PM







                         









                        On 16-02-2011, Jean Saint-Remy <jeansaintremy@...> wrote:

                        >

                        > I always wonder about that. Can I compile my own interface file?

                        >

                        > # open Set ;;

                        > -: Error: set.cmi is not a compiled interface

                        >



                        You have a problem with set.cmi, check that ocaml and the .cmi are from

                        the same installation (i.e. at least same ocaml version).



                        > # open MoreLabels ;;

                        > # open Set ;;

                        > (* works here *)

                        >

                        > Why don't we get a more useful error, such as x requires y to be loaded as =

                        > well?

                        >



                        In fact, it has nothing to do with module loading (which is handled by

                        open).



                        In this case, MoreLabels contains a module Set. So basically, you are

                        not opening the same thing.



                        # open Set;;

                        -> should open the module Set

                        http://caml.inria.fr/pub/docs/manual-ocaml/libref/Set.html



                        # open MoreLabels;;

                        # open Set;;

                        -> open MoreLabels.Set

                        http://caml.inria.fr/pub/docs/manual-ocaml/libref/MoreLabels.Set.html



                        You can encounter module loading problems when you use more complex

                        library that require extra external libraries. In this case, you should

                        use "findlib" that will handle library loading for you.



                        Cheers,

                        Sylvain Le Gall

                        --

                        My company: http://www.ocamlcore.com

                        Linkedin: http://fr.linkedin.com/in/sylvainlegall

                        Start an OCaml project here: http://forge.ocamlcore.org

                        OCaml blogs: http://planet.ocamlcore.org

























                        [Non-text portions of this message have been removed]
                      • Sylvain Le Gall
                        ... This is what is called a name clash. It happens with OCaml, but you can have the same more or less uncanny behavior with other langage. The namespace in
                        Message 11 of 22 , Feb 16, 2011
                        • 0 Attachment
                          On 16-02-2011, Jean Saint-Remy <jeansaintremy@...> wrote:
                          > # ocamlc -v
                          > The blessed Objective Caml compiler, version 3.12.0
                          > Standard library directory: /usr/lib/ocaml
                          >
                          > # locate set.cmi
                          > /home/jean/set.cmi
                          > /usr/lib/ocaml/set.cmi
                          > ls -l set.cmi
                          > -rw-r--r-- 1 jean jean 495 2010-07-18 10:21 set.cmi
                          > -rw-r--r-- 1 root root 4545 2010-10-30 10:53 /usr/lib/ocaml/set.cmi
                          > echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/us=
                          > r/games:/home/jean
                          >
                          > After removing the *mysterious* set.cmi from /home, I can now successfully =
                          > open the Set library. This is uncanny, strange behaviour if you ask me. I i=
                          > nadvertently created a set.ml when working with unique.ml
                          >
                          > Does this mean I have to be very gingerly when creating _programs_ that mig=
                          > ht appear in the standard ocaml library?
                          >

                          This is what is called a name clash. It happens with OCaml, but you can
                          have the same more or less "uncanny" behavior with other langage. The
                          namespace in OCaml is not its strongest point.

                          Cheers,
                          Sylvain Le Gall
                          --
                          My company: http://www.ocamlcore.com
                          Linkedin: http://fr.linkedin.com/in/sylvainlegall
                          Start an OCaml project here: http://forge.ocamlcore.org
                          OCaml blogs: http://planet.ocamlcore.org
                        Your message has been successfully submitted and would be delivered to recipients shortly.