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

Re: "ocaml_beginners"::[] OASIS help: can't build project that depends on core

Expand Messages
  • Chingfan Tsou
    Ah~It acutally worked. Thanks a lot! 2013/9/4 Philippe Veber
    Message 1 of 11 , Sep 4, 2013
    • 0 Attachment
      Ah~It acutally worked. Thanks a lot!


      2013/9/4 Philippe Veber <philippe.veber@...>
       

      Hi,

      just add threads in your BuildDepends field, and it should be ok.

      cheers,
        Philippe.



      2013/9/4 Chingfan Tsou <caojingfan@...>


      I've been working around a little project recently for a better understanding of OCaml. Everything went pretty well until I ran into this problem with oasis. Apparently I had difficulties working it out alone, so any kind of help would be appreciated!

      I generated this _oasis file with 'oasis quickstart' and manually modified it since I have to use camlp4o for syntax extension:

      OASISFormat: 0.3
      Name:        rep
      Version:     0.1
      Synopsis:    ocaml regular expression
      Authors:     Chingfan Tsao
      License:     GPL-3

      Library rep
        Path:       .
        BuildTools: ocamlbuild, camlp4o
        Modules:    Expr, Autmt, Rep
        BuildDepends: sexplib.syntax, core

      and I manually modified the _tags file after looking up the internet so that oasis can deal with camlp4o:

      # OASIS_START
      # DO NOT EDIT (digest: d4c9e3a85ffc914e367dff846b370eb3)
      # Ignore VCS directories, you can use the same kind of rule outside 
      # OASIS_START/STOP if you want to exclude directories that contains 
      # useless stuff for the build process
      <**/.svn>: -traverse
      <**/.svn>: not_hygienic
      ".bzr": -traverse
      ".bzr": not_hygienic
      ".hg": -traverse
      ".hg": not_hygienic
      ".git": -traverse
      ".git": not_hygienic
      "_darcs": -traverse
      "_darcs": not_hygienic
      # Library rep
      "rep.cmxs": use_rep
      <*.ml{,i}>: pkg_sexplib.syntax
      <*.ml{,i}>: pkg_core
      # OASIS_STOP
      "expr.ml": syntax_camlp4o   #manually added

      However, I still got this error while running 'ocaml setup.ml -build':

      + ocamlfind ocamlc -c -g -package sexplib.syntax -package core -syntax camlp4o -o expr.cmo expr.ml
      ocamlfind: Error from package `threads': Missing -thread or -vmthread switch
      Command exited with code 2.

      It seems that ocamlfind needs a '-thread' argument for core, I tried this command manually with the present of '-thread' and it worked. So how am I supposed to do to make oasis generate the proper build commands for this?

      Thanks!




    • Chingfan Tsou
      Hi~again I ran into troubles with this little project and I was hoping anyone could help me out. Thanks in advance. Currently there are 3 files (described in
      Message 2 of 11 , Sep 5, 2013
      • 0 Attachment
        Hi~again I ran into troubles with this little project and I was hoping anyone could help me out. Thanks in advance.

        Currently there are 3 files (described in the first mail) in this little project and one depends on the other like this: 

        rep.cmo : expr.cmo autmt.cmo
        rep.cmx : expr.cmx autmt.cmx

        autmt.cmo : expr.cmo
        autmt.cmx : expr.cmx

        expr.ml doesn't have the kind of inside-project dependencies.

        The problem is expr.ml has internal modules like Expr.Table and is referenced in autmt.ml.I tried this command 'ocamlfind ocamlc -c -package core -thread expr.cmo -o autmt.cmo autmt.ml' but failed with 

        File "autmt.ml", line 8, characters 17-34:
        Error: Unbound module Expr.Table

        So could anyone tell me what exactly should the build command be and what am I supposed to do with the _oasis file so that oasis can work properly? Thanks a lot!

      • Philippe Veber
        Hi again ! The _oasis file can be used to generate build scripts (it is one of its primary functions). Just run the following commands: oasis setup # will
        Message 3 of 11 , Sep 5, 2013
        • 0 Attachment
          Hi again !

          The _oasis file can be used to generate build scripts (it is one of its primary functions). Just run the following commands:

          oasis setup # will generate the build files
          ocaml setup.ml -configure
          ocaml setup.ml -build

          Of course for the next compilation, only the last command is necessary.

          cheers,
            Philippe.




          2013/9/5 Chingfan Tsou <caojingfan@...>


          Hi~again I ran into troubles with this little project and I was hoping anyone could help me out. Thanks in advance.

          Currently there are 3 files (described in the first mail) in this little project and one depends on the other like this: 

          rep.cmo : expr.cmo autmt.cmo
          rep.cmx : expr.cmx autmt.cmx

          autmt.cmo : expr.cmo
          autmt.cmx : expr.cmx

          expr.ml doesn't have the kind of inside-project dependencies.

          The problem is expr.ml has internal modules like Expr.Table and is referenced in autmt.ml.I tried this command 'ocamlfind ocamlc -c -package core -thread expr.cmo -o autmt.cmo autmt.ml' but failed with 

          File "autmt.ml", line 8, characters 17-34:
          Error: Unbound module Expr.Table

          So could anyone tell me what exactly should the build command be and what am I supposed to do with the _oasis file so that oasis can work properly? Thanks a lot!




        • Hongbo Zhang
          Hi, For toy projects, there s no need to use oasis. OCamlbuild would suffice ... -- -- Regards, Hongbo
          Message 4 of 11 , Sep 5, 2013
          • 0 Attachment
            Hi,
               For toy projects, there's no need to use oasis.
               OCamlbuild would suffice


            On Thu, Sep 5, 2013 at 9:50 AM, Chingfan Tsou <caojingfan@...> wrote:
             

            Hi~again I ran into troubles with this little project and I was hoping anyone could help me out. Thanks in advance.

            Currently there are 3 files (described in the first mail) in this little project and one depends on the other like this: 

            rep.cmo : expr.cmo autmt.cmo
            rep.cmx : expr.cmx autmt.cmx

            autmt.cmo : expr.cmo
            autmt.cmx : expr.cmx

            expr.ml doesn't have the kind of inside-project dependencies.

            The problem is expr.ml has internal modules like Expr.Table and is referenced in autmt.ml.I tried this command 'ocamlfind ocamlc -c -package core -thread expr.cmo -o autmt.cmo autmt.ml' but failed with 

            File "autmt.ml", line 8, characters 17-34:
            Error: Unbound module Expr.Table

            So could anyone tell me what exactly should the build command be and what am I supposed to do with the _oasis file so that oasis can work properly? Thanks a lot!




            --
            -- Regards, Hongbo
          • Chingfan Tsou
            I just figured it may be useful if I learned how to use oasis. Sadly it turns out that it can be pretty challenge :( I tried with the command *ocamlbuild -lib
            Message 5 of 11 , Sep 5, 2013
            • 0 Attachment
              I just figured it may be useful if I learned how to use oasis. Sadly it turns out that it can be pretty challenge :(

              I tried with the command "ocamlbuild -lib expr.cmo autmt.native" just now but still got the same error. Was I doing this right?


              2013/9/5 Hongbo Zhang <hongboz@...>
               

              Hi,
                 For toy projects, there's no need to use oasis.
                 OCamlbuild would suffice


              On Thu, Sep 5, 2013 at 9:50 AM, Chingfan Tsou <caojingfan@...> wrote:
               

              Hi~again I ran into troubles with this little project and I was hoping anyone could help me out. Thanks in advance.

              Currently there are 3 files (described in the first mail) in this little project and one depends on the other like this: 

              rep.cmo : expr.cmo autmt.cmo
              rep.cmx : expr.cmx autmt.cmx

              autmt.cmo : expr.cmo
              autmt.cmx : expr.cmx

              expr.ml doesn't have the kind of inside-project dependencies.

              The problem is expr.ml has internal modules like Expr.Table and is referenced in autmt.ml.I tried this command 'ocamlfind ocamlc -c -package core -thread expr.cmo -o autmt.cmo autmt.ml' but failed with 

              File "autmt.ml", line 8, characters 17-34:
              Error: Unbound module Expr.Table

              So could anyone tell me what exactly should the build command be and what am I supposed to do with the _oasis file so that oasis can work properly? Thanks a lot!




              --
              -- Regards, Hongbo


            • Gabriel Scherer
              It s hard to help you without a reproducible setting to test. Could you send somewhere a zip of your project (or a reduced version thereof that reproduces the
              Message 6 of 11 , Sep 6, 2013
              • 0 Attachment
                It's hard to help you without a reproducible setting to test. Could you send somewhere a zip of your project (or a reduced version thereof that reproduces the issue)?


                On Thu, Sep 5, 2013 at 4:30 PM, Chingfan Tsou <caojingfan@...> wrote:


                I just figured it may be useful if I learned how to use oasis. Sadly it turns out that it can be pretty challenge :(

                I tried with the command "ocamlbuild -lib expr.cmo autmt.native" just now but still got the same error. Was I doing this right?


                2013/9/5 Hongbo Zhang <hongboz@...>
                 

                Hi,
                   For toy projects, there's no need to use oasis.
                   OCamlbuild would suffice


                On Thu, Sep 5, 2013 at 9:50 AM, Chingfan Tsou <caojingfan@...> wrote:
                 

                Hi~again I ran into troubles with this little project and I was hoping anyone could help me out. Thanks in advance.

                Currently there are 3 files (described in the first mail) in this little project and one depends on the other like this: 

                rep.cmo : expr.cmo autmt.cmo
                rep.cmx : expr.cmx autmt.cmx

                autmt.cmo : expr.cmo
                autmt.cmx : expr.cmx

                expr.ml doesn't have the kind of inside-project dependencies.

                The problem is expr.ml has internal modules like Expr.Table and is referenced in autmt.ml.I tried this command 'ocamlfind ocamlc -c -package core -thread expr.cmo -o autmt.cmo autmt.ml' but failed with 

                File "autmt.ml", line 8, characters 17-34:
                Error: Unbound module Expr.Table

                So could anyone tell me what exactly should the build command be and what am I supposed to do with the _oasis file so that oasis can work properly? Thanks a lot!




                --
                -- Regards, Hongbo





              • Chingfan Tsou
                Yes, of course. Sorry that I thought it would be enough to solve this just with my description. https://github.com/ChingfanTsou/oc-regexp here it is, and thank
                Message 7 of 11 , Sep 6, 2013
                • 0 Attachment
                  Yes, of course. Sorry that I thought it would be enough to solve this just with my description.


                  here it is, and thank you very much!


                  2013/9/6 Gabriel Scherer <gabriel.scherer@...>
                   

                  It's hard to help you without a reproducible setting to test. Could you send somewhere a zip of your project (or a reduced version thereof that reproduces the issue)?


                  On Thu, Sep 5, 2013 at 4:30 PM, Chingfan Tsou <caojingfan@...> wrote:


                  I just figured it may be useful if I learned how to use oasis. Sadly it turns out that it can be pretty challenge :(

                  I tried with the command "ocamlbuild -lib expr.cmo autmt.native" just now but still got the same error. Was I doing this right?


                  2013/9/5 Hongbo Zhang <hongboz@...>
                   

                  Hi,
                     For toy projects, there's no need to use oasis.
                     OCamlbuild would suffice


                  On Thu, Sep 5, 2013 at 9:50 AM, Chingfan Tsou <caojingfan@...> wrote:
                   

                  Hi~again I ran into troubles with this little project and I was hoping anyone could help me out. Thanks in advance.

                  Currently there are 3 files (described in the first mail) in this little project and one depends on the other like this: 

                  rep.cmo : expr.cmo autmt.cmo
                  rep.cmx : expr.cmx autmt.cmx

                  autmt.cmo : expr.cmo
                  autmt.cmx : expr.cmx

                  expr.ml doesn't have the kind of inside-project dependencies.

                  The problem is expr.ml has internal modules like Expr.Table and is referenced in autmt.ml.I tried this command 'ocamlfind ocamlc -c -package core -thread expr.cmo -o autmt.cmo autmt.ml' but failed with 

                  File "autmt.ml", line 8, characters 17-34:
                  Error: Unbound module Expr.Table

                  So could anyone tell me what exactly should the build command be and what am I supposed to do with the _oasis file so that oasis can work properly? Thanks a lot!




                  --
                  -- Regards, Hongbo






                • Philippe Veber
                  Hi, There is indeed no Expr.Table module in your project. However there is an Expr.Expr.Table one :o) When you compile a file name foo.ml, this automatically
                  Message 8 of 11 , Sep 7, 2013
                  • 0 Attachment
                    Hi,

                    There is indeed no Expr.Table module in your project. However there is an Expr.Expr.Table one :o)

                    When you compile a file name foo.ml, this automatically defines a module named Foo. If you start the file foo.ml with module Foo = struct ... end, you're defining a submodule Foo of the module Foo. Let's see that on an example:

                    foo.ml:
                    let a = 1
                    module Foo = struct
                      let b = 41
                    end


                    bar.ml:
                    let c = Foo.a + Foo.Foo.b

                    Please refer to the manual [1] for a more thorough explanation, and do not hesitate to ask again if things are not clear yet.

                    Cheers,
                      Philippe.

                    [1] http://caml.inria.fr/pub/docs/manual-ocaml/manual004.html#toc17


                    2013/9/6 Chingfan Tsou <caojingfan@...>


                    Yes, of course. Sorry that I thought it would be enough to solve this just with my description.


                    here it is, and thank you very much!


                    2013/9/6 Gabriel Scherer <gabriel.scherer@...>
                     

                    It's hard to help you without a reproducible setting to test. Could you send somewhere a zip of your project (or a reduced version thereof that reproduces the issue)?


                    On Thu, Sep 5, 2013 at 4:30 PM, Chingfan Tsou <caojingfan@...> wrote:


                    I just figured it may be useful if I learned how to use oasis. Sadly it turns out that it can be pretty challenge :(

                    I tried with the command "ocamlbuild -lib expr.cmo autmt.native" just now but still got the same error. Was I doing this right?


                    2013/9/5 Hongbo Zhang <hongboz@...>
                     

                    Hi,
                       For toy projects, there's no need to use oasis.
                       OCamlbuild would suffice


                    On Thu, Sep 5, 2013 at 9:50 AM, Chingfan Tsou <caojingfan@...> wrote:
                     

                    Hi~again I ran into troubles with this little project and I was hoping anyone could help me out. Thanks in advance.

                    Currently there are 3 files (described in the first mail) in this little project and one depends on the other like this: 

                    rep.cmo : expr.cmo autmt.cmo
                    rep.cmx : expr.cmx autmt.cmx

                    autmt.cmo : expr.cmo
                    autmt.cmx : expr.cmx

                    expr.ml doesn't have the kind of inside-project dependencies.

                    The problem is expr.ml has internal modules like Expr.Table and is referenced in autmt.ml.I tried this command 'ocamlfind ocamlc -c -package core -thread expr.cmo -o autmt.cmo autmt.ml' but failed with 

                    File "autmt.ml", line 8, characters 17-34:
                    Error: Unbound module Expr.Table

                    So could anyone tell me what exactly should the build command be and what am I supposed to do with the _oasis file so that oasis can work properly? Thanks a lot!




                    --
                    -- Regards, Hongbo









                  • Chingfan Tsou
                    No wonder why I keep getting the same error! I totally misunderstood the differences between toplevel and file compilation. Thanks for pointing it out~Now the
                    Message 9 of 11 , Sep 7, 2013
                    • 0 Attachment
                      No wonder why I keep getting the same error! I totally misunderstood the differences between toplevel and file compilation. Thanks for pointing it out~Now the building process is working just fine!


                      2013/9/8 Philippe Veber <philippe.veber@...>
                       

                      Hi,

                      There is indeed no Expr.Table module in your project. However there is an Expr.Expr.Table one :o)

                      When you compile a file name foo.ml, this automatically defines a module named Foo. If you start the file foo.ml with module Foo = struct ... end, you're defining a submodule Foo of the module Foo. Let's see that on an example:

                      foo.ml:
                      let a = 1
                      module Foo = struct
                        let b = 41
                      end


                      bar.ml:
                      let c = Foo.a + Foo.Foo.b

                      Please refer to the manual [1] for a more thorough explanation, and do not hesitate to ask again if things are not clear yet.

                      Cheers,
                        Philippe.

                      [1] http://caml.inria.fr/pub/docs/manual-ocaml/manual004.html#toc17


                      2013/9/6 Chingfan Tsou <caojingfan@...>


                      Yes, of course. Sorry that I thought it would be enough to solve this just with my description.


                      here it is, and thank you very much!


                      2013/9/6 Gabriel Scherer <gabriel.scherer@...>
                       

                      It's hard to help you without a reproducible setting to test. Could you send somewhere a zip of your project (or a reduced version thereof that reproduces the issue)?


                      On Thu, Sep 5, 2013 at 4:30 PM, Chingfan Tsou <caojingfan@...> wrote:


                      I just figured it may be useful if I learned how to use oasis. Sadly it turns out that it can be pretty challenge :(

                      I tried with the command "ocamlbuild -lib expr.cmo autmt.native" just now but still got the same error. Was I doing this right?


                      2013/9/5 Hongbo Zhang <hongboz@...>
                       

                      Hi,
                         For toy projects, there's no need to use oasis.
                         OCamlbuild would suffice


                      On Thu, Sep 5, 2013 at 9:50 AM, Chingfan Tsou <caojingfan@...> wrote:
                       

                      Hi~again I ran into troubles with this little project and I was hoping anyone could help me out. Thanks in advance.

                      Currently there are 3 files (described in the first mail) in this little project and one depends on the other like this: 

                      rep.cmo : expr.cmo autmt.cmo
                      rep.cmx : expr.cmx autmt.cmx

                      autmt.cmo : expr.cmo
                      autmt.cmx : expr.cmx

                      expr.ml doesn't have the kind of inside-project dependencies.

                      The problem is expr.ml has internal modules like Expr.Table and is referenced in autmt.ml.I tried this command 'ocamlfind ocamlc -c -package core -thread expr.cmo -o autmt.cmo autmt.ml' but failed with 

                      File "autmt.ml", line 8, characters 17-34:
                      Error: Unbound module Expr.Table

                      So could anyone tell me what exactly should the build command be and what am I supposed to do with the _oasis file so that oasis can work properly? Thanks a lot!




                      --
                      -- Regards, Hongbo










                    Your message has been successfully submitted and would be delivered to recipients shortly.