OCaml Forge

Detail: [#740] Building ocaml toplevels with OASIS

Feature Requests: Browse | Download .csv | Monitor

[#740] Building ocaml toplevels with OASIS

Date:
2010-09-06 08:53
Priority:
3
State:
Open
Submitted by:
Jérémie Dimino (dim)
Assigned to:
Sylvain Le Gall (gildor-admin)
Resolution:
None
Due in version:
None
Product:
OASIS
Component:
OASIS
Operating System:
All
 
Summary:
Building ocaml toplevels with OASIS

Detailed description
I have not find how to build an ocaml toplevel using OASIS. The "Executable" section try to compile the target "foo.byte" or "foo.native" but not "foo.top".

Followup

Message
Date: 2010-09-09 16:10
Sender: Jérémie Dimino

> The difference between InternalModules and Modules is that with expunge, you don't list InternalModules?

Yes.

> How can you list public modules modules of libraries ?

I get the library path with ocamlfind and list .cmi files it contains.

Date: 2010-09-09 15:28
Sender: Sylvain Le Gall

The difference between InternalModules and Modules is that with expunge, you don't list InternalModules?

How can you list public modules modules of libraries ?

I will use ocamlfind anyway.
Date: 2010-09-09 14:43
Sender: Jérémie Dimino

I think the specific fields for toplevel sections should be "Modules", "InternalModules" and maybe "Expunge":

_oasis:
Toplevel lablgtktop
Path: top/
Modules: Gtk_toplevel
InternalModules: Foo, Bar
BuildDepends: lablgtk
Expunge: true

build (without expunge):
- create a file lablgtktop.mltop containing the list of modules (publics and internals)
- build the target lablgtktop.top with ocamlbuild
- copy lablgtktop.top to lablgtktop

note: toplevels must also be linked with the "-linkpkg" switch if using ocamlfind

build (with expunge):
- create a file lablgtktop.mltop containing the list of modules (publics and internals)
- build the target lablgtktop.top with ocamlbuild
- list all modules that should be accessible in the toplevel i.e:
- all modules of the "Modules" field
- all public modules of libraries (internals and externals) linked with the toplevel
- call "expunge lablgtktop.top lablgtktop <all listed modules>"

install:
- install lablgtktop

The expunge phase is not mandatory but it avoids name clashes with internal modules of the compiler (such as Types, Env, ...). The expunge executable is located in the standard library directory.
Date: 2010-09-09 13:41
Sender: Sylvain Le Gall

I don't often build toplevels, so I have no real idea how to it the right way.

Could you give me an example? E.g. a toplevel section as should be written in _oasis and the corresponding step to build it (using ocamlbuild maybe).


_oasis:
Toplevel lablgtktop
Path: top/
BuildDepends: lablgtk
XXXX

build:
create a file top/lablgtktop.mltop with content
...

Thank you for you time.
Date: 2010-09-06 09:09
Sender: Sylvain Le Gall

Indeed. I need to add a section "Toplevel" just like "Executable".

Sylvain Le Gall

Attached Files:

Changes:

Field Old Value Date By
Due in version0.3.02016-09-03 21:20gildor-admin
Due in versionNone2010-11-05 16:21gildor-admin
assigned_tonone2010-09-06 09:06gildor-admin