caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: [Caml-list] Initial port of ocaml for mingw (long)
@ 2001-09-26 13:06 CaptnJamesKirk
  2001-09-26 16:44 ` [Caml-list] Looking for Graph Operations-library Mattias Waldau
  2001-09-26 16:47 ` Mattias Waldau
  0 siblings, 2 replies; 13+ messages in thread
From: CaptnJamesKirk @ 2001-09-26 13:06 UTC (permalink / raw)
  To: ayerkes; +Cc: caml-list

In a message dated 9/25/2001 3:29:34 PM Central Daylight Time, 
ayerkes@gmvnetwork.com writes:

> Actually, my thought was to build with cygwin itself at least in the
>  short term.  The important thing (to me) is the ability to write nice
>  software and distribute it without the cygwin dll.  It's a bonus too
>  that ocaml.exe works properly without it too, but the main thing was
>  the ability to run ocamlopt and get an exe out that you can pass
>  around easily.  I built with cygwin's gcc (-mno-cygwin), tho.  I think
>  that it may not be realistic to build ocaml otherwise given that it
>  uses unix tools to create the prims list, however it can easily be
>  used without cygwin.
>  
>  I should've made it more clear that you need cygwin gcc as yet to build.
>  The important point was that it's possible to get it away from
>  dependence on cygwin1.dll...  

After I fired off my last message, I started to wonder if that's what you 
did, so I tried it myself under cygwin. Copying libncurses.a to libpdcurses.a 
still works (though this may need to be changed to use the regular ncurses 
which is part of the standard cygwin distro). I ran into some other problems, 
and here's what happened.

(first untarring the ocaml source, then patching, then untarring the boot 
stuff...)

1) make
First break is at utils/misc.mli, where it says cannot open pervasives.cmi. 
The only thing that worked for me here was to...
2) make world
which exits shortly with a cryptic (at least for me) error at [coldstart], 
but then
3) make
seems to be happy until it gets to bigarray. It needs bigarray.cmi but 
doesn't have it since it doesn't have big_int.cmi.  Making the 3 cmis you 
mention in otherlibs/num (int_misc.cmi, string_misc.cmi, and arith_flags.cmi) 
may be the first step, but it doesn't fix it. The only way I could build 
big_int.cmi was to cd to "otherlibs/num" and type "make big_int.cmi" there, 
after building nat.cmi as well.  Two more tries indicated that "ratio.cmi" 
and "num.cmi" also have to be built in the "otherlibs/num" directory. THEN, 
we have to cd to "otherlibs/bigarray" and do "make bigarray.cmi" there. Then,
4) make
goes all the way to ocamldebugger where it exits with "Uncaught exception: 
Not_found." I can't figure out how to fix it, so I do your next steps of "rm 
byterun/io.h", "make -C asmrun depend", and "make -C byterun depend". These 
last two have many warnings, most of which seem tied to redefinitions in 
fail.h.
5) make opt
then says I need arith_status.cmi in otherlibs/num, but once that's built it 
finishes without further error.

However, after doing "make install" and "make installopt" and trying to run 
ocaml.exe, I get "Cannot exec /usr/local/ocamlrun". In fact, all of the 
executables return that error.

And now I don't know how to fix that...

Oh, and as long as we're working on it, it would be VERY nice if we could get 
labltk to build as well.

/John



  
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Caml-list] Looking for Graph Operations-library
  2001-09-26 13:06 [Caml-list] Initial port of ocaml for mingw (long) CaptnJamesKirk
@ 2001-09-26 16:44 ` Mattias Waldau
  2001-09-26 16:47 ` Mattias Waldau
  1 sibling, 0 replies; 13+ messages in thread
From: Mattias Waldau @ 2001-09-26 16:44 UTC (permalink / raw)
  To: caml-list

I am converting some code from SICStus Prolog, and need a directed graph
library for Ocaml. Any pointers?

I found Markus Mottl's POMAP, and I can probably redesign in order to use
that instead.

/mattias



>From the SICStus manual:

Unweighted Graph Operations

Directed and undirected graphs are fundamental data structures representing
arbitrary relationships between data objects. This package provides a Prolog
implementation of directed graphs, undirected graphs being a special case of
directed graphs.

An unweighted directed graph (ugraph) is represented as a list of
(vertex-neighbors) pairs, where the pairs are in standard order (as produced
by keysort with unique keys) and the neighbors of each vertex are also in
standard order (as produced by sort), every neighbor appears as a vertex
even if it has no neighbors itself, and no vertex is a neighbor to itself.

An undirected graph is represented as a directed graph where for each edge
(U,V) there is a symmetric edge (V,U).


Some operations:
================

transitive_closure(+Graph, -Closure)
Computes Closure as the transitive closure of Graph in O(N^3) time.

symmetric_closure(+Graph, -Closure)
Computes Closure as the symmetric closure of Graph, i.e. for each edge (u,v)
in Graph, add its symmetric edge (v,u). Takes O(N^2) time. This is useful
for making a directed graph undirected.

top_sort(+Graph, -Sorted)
Finds a topological ordering of a Graph and returns the ordering as a list
of Sorted vertices. Fails iff no ordering exists, i.e. iff the graph
contains cycles. Takes O(N^2) time.
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Caml-list] Looking for Graph Operations-library
  2001-09-26 13:06 [Caml-list] Initial port of ocaml for mingw (long) CaptnJamesKirk
  2001-09-26 16:44 ` [Caml-list] Looking for Graph Operations-library Mattias Waldau
@ 2001-09-26 16:47 ` Mattias Waldau
  2001-09-26 17:08   ` Markus Mottl
                     ` (3 more replies)
  1 sibling, 4 replies; 13+ messages in thread
From: Mattias Waldau @ 2001-09-26 16:47 UTC (permalink / raw)
  To: caml-list

I am converting some code from SICStus Prolog, and need a directed graph
library for Ocaml. Any pointers?

I found Markus Mottl's POMAP, and I can probably redesign in order to use
that instead.

/mattias



>From the SICStus manual:

Unweighted Graph Operations

Directed and undirected graphs are fundamental data structures representing
arbitrary relationships between data objects. This package provides a Prolog
implementation of directed graphs, undirected graphs being a special case of
directed graphs.

An unweighted directed graph (ugraph) is represented as a list of
(vertex-neighbors) pairs, where the pairs are in standard order (as produced
by keysort with unique keys) and the neighbors of each vertex are also in
standard order (as produced by sort), every neighbor appears as a vertex
even if it has no neighbors itself, and no vertex is a neighbor to itself.

An undirected graph is represented as a directed graph where for each edge
(U,V) there is a symmetric edge (V,U).


Some operations:
================

transitive_closure(+Graph, -Closure)
Computes Closure as the transitive closure of Graph in O(N^3) time.

symmetric_closure(+Graph, -Closure)
Computes Closure as the symmetric closure of Graph, i.e. for each edge (u,v)
in Graph, add its symmetric edge (v,u). Takes O(N^2) time. This is useful
for making a directed graph undirected.

top_sort(+Graph, -Sorted)
Finds a topological ordering of a Graph and returns the ordering as a list
of Sorted vertices. Fails iff no ordering exists, i.e. iff the graph
contains cycles. Takes O(N^2) time.

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Caml-list] Looking for Graph Operations-library
  2001-09-26 16:47 ` Mattias Waldau
@ 2001-09-26 17:08   ` Markus Mottl
  2001-09-26 17:13   ` Brian Rogoff
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Markus Mottl @ 2001-09-26 17:08 UTC (permalink / raw)
  To: Mattias Waldau; +Cc: caml-list

On Wed, 26 Sep 2001, Mattias Waldau wrote:
> I am converting some code from SICStus Prolog, and need a directed graph
> library for Ocaml. Any pointers?
> 
> I found Markus Mottl's POMAP, and I can probably redesign in order to use
> that instead.

Yes, this should be possible. The internal datastructure used to
represent partially ordered maps is actually a (purely functional)
directed graph. Maybe not optimal for all purposes, but fast enough
for many and additionally allows persistent sharing of datastructures,
which is also a nice feature.

> transitive_closure(+Graph, -Closure)
> Computes Closure as the transitive closure of Graph in O(N^3) time.
>
> symmetric_closure(+Graph, -Closure)
> Computes Closure as the symmetric closure of Graph, i.e. for each edge (u,v)
> in Graph, add its symmetric edge (v,u). Takes O(N^2) time. This is useful
> for making a directed graph undirected.

Should be straightforward.

> top_sort(+Graph, -Sorted)
> Finds a topological ordering of a Graph and returns the ordering as a list
> of Sorted vertices. Fails iff no ordering exists, i.e. iff the graph
> contains cycles. Takes O(N^2) time.

A similar function is already implemented (topo_fold). Because the
partially ordered map represents a Hasse-diagram, this function is
really fast. Of course, you are likely to spend the O(N^2) computation
time elsewhere, namely during the creation of the Hasse-diagram.

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Caml-list] Looking for Graph Operations-library
  2001-09-26 16:47 ` Mattias Waldau
  2001-09-26 17:08   ` Markus Mottl
@ 2001-09-26 17:13   ` Brian Rogoff
  2001-09-26 18:04     ` Mattias Waldau
  2001-09-27  6:16   ` Jean-Christophe Filliatre
  2001-10-01 10:00   ` Francois Pottier
  3 siblings, 1 reply; 13+ messages in thread
From: Brian Rogoff @ 2001-09-26 17:13 UTC (permalink / raw)
  To: Mattias Waldau; +Cc: caml-list

On Wed, 26 Sep 2001, Mattias Waldau wrote:
> I am converting some code from SICStus Prolog, and need a directed graph
> library for Ocaml. Any pointers?

I ported part of Martin Erwig's Functional Graph Library to OCaml, the
part that uses functional maps as arrays. I used a hacked version of
Jean-Christophe Filliatre's Patricia tree implementation for that. I
haven't yet written the version tree code. If you don't mind its
incomplete state and would like to help complete the port I can wrap it
up and e-mail it to you.

See http://www.cs.orst.edu/~erwig/fgl/ for the original.

You might also consider porting a more imperative library, like the one in
SML for MLRISC, if you are comfortable with SML too. FGL is cool but I'm
not confident that the performance will match a tuned imperative
implementation :-).

-- Brian

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [Caml-list] Looking for Graph Operations-library
  2001-09-26 17:13   ` Brian Rogoff
@ 2001-09-26 18:04     ` Mattias Waldau
  2001-09-26 18:29       ` Brian Rogoff
  2001-09-26 19:23       ` Markus Mottl
  0 siblings, 2 replies; 13+ messages in thread
From: Mattias Waldau @ 2001-09-26 18:04 UTC (permalink / raw)
  To: Brian Rogoff, Mattias Waldau; +Cc: caml-list

I looked thru the documentation, but FGL doesn't seem to be any operations
like closures and topological sorting in fgl, it mostly seems to be about
traversing the structure. Have I missed something?

When I look at one of the papers, you get the impression that an imperative
implementation is one to two magnitudes faster, is that right?
(Speed is irrelevant right now for me.)

/mattias


-----Original Message-----
From: owner-caml-list@pauillac.inria.fr
[mailto:owner-caml-list@pauillac.inria.fr]On Behalf Of Brian Rogoff
Sent: Wednesday, September 26, 2001 7:14 PM
To: Mattias Waldau
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Looking for Graph Operations-library


On Wed, 26 Sep 2001, Mattias Waldau wrote:
> I am converting some code from SICStus Prolog, and need a directed graph
> library for Ocaml. Any pointers?

I ported part of Martin Erwig's Functional Graph Library to OCaml, the
part that uses functional maps as arrays. I used a hacked version of
Jean-Christophe Filliatre's Patricia tree implementation for that. I
haven't yet written the version tree code. If you don't mind its
incomplete state and would like to help complete the port I can wrap it
up and e-mail it to you.

See http://www.cs.orst.edu/~erwig/fgl/ for the original.

You might also consider porting a more imperative library, like the one in
SML for MLRISC, if you are comfortable with SML too. FGL is cool but I'm
not confident that the performance will match a tuned imperative
implementation :-).

-- Brian

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ:
http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives:
http://caml.inria.fr

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [Caml-list] Looking for Graph Operations-library
  2001-09-26 18:04     ` Mattias Waldau
@ 2001-09-26 18:29       ` Brian Rogoff
  2001-09-26 19:23       ` Markus Mottl
  1 sibling, 0 replies; 13+ messages in thread
From: Brian Rogoff @ 2001-09-26 18:29 UTC (permalink / raw)
  To: Mattias Waldau; +Cc: caml-list

On Wed, 26 Sep 2001, Mattias Waldau wrote:
> I looked thru the documentation, but FGL doesn't seem to be any operations
> like closures and topological sorting in fgl, it mostly seems to be about
> traversing the structure. Have I missed something?

The interfaces don't have, say, topsort as a builtin function, but the
papers describe how to implement it using the provided functions.

> When I look at one of the papers, you get the impression that an imperative
> implementation is one to two magnitudes faster, is that right?
> (Speed is irrelevant right now for me.)

I don't think the papers measured against an imperative implementation,
but rather a functional array based on binary trees versus a functional
array based on version arrays. But I could be wrong and I don't have them
handy at the moment. Anyways, I'd like to do a version array version :-)
too in the future. It would be nice if there was a version array library
around; I've written some quick ones but I don't know how they compare
against some of the better ones. Lots of SML implementations around.

Beware of surmising too much based on some quick benchmarks.

-- Brian


-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Caml-list] Looking for Graph Operations-library
  2001-09-26 18:04     ` Mattias Waldau
  2001-09-26 18:29       ` Brian Rogoff
@ 2001-09-26 19:23       ` Markus Mottl
  1 sibling, 0 replies; 13+ messages in thread
From: Markus Mottl @ 2001-09-26 19:23 UTC (permalink / raw)
  To: Mattias Waldau; +Cc: Brian Rogoff, caml-list

On Wed, 26 Sep 2001, Mattias Waldau wrote:
> When I look at one of the papers, you get the impression that an
> imperative implementation is one to two magnitudes faster, is that
> right?  (Speed is irrelevant right now for me.)

This depends on the operation and the size of your graph. Some operations
should be nearly as fast (e.g. in the POMAP-case, insertion of elements),
others might run slower by this considerable amount (e.g. traversing
nodes - requires traversal and lookups in both edge sets and the node
set). I don't have any direct comparison to an imperative version so
this is just an estimate. It would be really interesting to have an
efficient imperative graph library in OCaml, too.

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Caml-list] Looking for Graph Operations-library
  2001-09-26 16:47 ` Mattias Waldau
  2001-09-26 17:08   ` Markus Mottl
  2001-09-26 17:13   ` Brian Rogoff
@ 2001-09-27  6:16   ` Jean-Christophe Filliatre
  2001-10-01 10:00   ` Francois Pottier
  3 siblings, 0 replies; 13+ messages in thread
From: Jean-Christophe Filliatre @ 2001-09-27  6:16 UTC (permalink / raw)
  To: Mattias Waldau; +Cc: caml-list


Mattias Waldau writes:
 > I am converting some code from SICStus Prolog, and need a directed graph
 > library for Ocaml. Any pointers?

If you  ever consider  writing such a  library from scratch,  there at
least two  books describing graphs  data structures and  algorithms in
very details:

The Stanford GraphBase
    http://www-cs-staff.Stanford.EDU/~knuth/sgb.html

The LEDA Platform
    http://www.mpi-sb.mpg.de/~mehlhorn/LEDAbook.html

Hope this helps,
-- 
Jean-Christophe Filliatre (http://www.lri.fr/~filliatr)

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Caml-list] Looking for Graph Operations-library
  2001-09-26 16:47 ` Mattias Waldau
                     ` (2 preceding siblings ...)
  2001-09-27  6:16   ` Jean-Christophe Filliatre
@ 2001-10-01 10:00   ` Francois Pottier
  3 siblings, 0 replies; 13+ messages in thread
From: Francois Pottier @ 2001-10-01 10:00 UTC (permalink / raw)
  To: Mattias Waldau; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 1286 bytes --]


> I am converting some code from SICStus Prolog, and need a directed graph
> library for Ocaml. Any pointers?

It is difficult to design a `universal' graph library, i.e. one that will suit
most users' needs, because different applications often require different
concrete representations of graphs.

Perhaps (as suggested by Chris Tilt in an earlier message) the best route is
to write a functorized library of graph algorithms, where each algorithm is
written independently of the actual data structure used to represent the
graph.

Yet, even then, it is not easy to determine which set of basic operations
should be supported by the structure. For instance, some algorithms are easily
expressed if graph nodes are numbered sequentially, but this is a rather
undesirable requirement if nodes are to be dynamically added and deleted.  As
another example, some algorithms can be written more efficiently if they are
allowed to store data directly within every graph node, but this causes them
to be non-reentrant and can also be a problem in some applications.

As an example of this functorized style of programming, attached is an
abstract implementation of a topological-order iterator for graphs.

-- 
François Pottier
Francois.Pottier@inria.fr
http://pauillac.inria.fr/~fpottier/

[-- Attachment #2: topological.mli --]
[-- Type: text/plain, Size: 1017 bytes --]

(* $Header: /home/pauillac/formel1/fpottier/cvs/typo/topological.mli,v 1.1 2001/08/17 17:04:35 fpottier Exp $ *)

module type Graph = sig

  type node

  (* The client must allow associating an integer degree with every graph node. *)

  val get: node -> int
  val set: int -> node -> unit

  (* The client must allow enumerating all nodes. *)

  val iter: (node -> unit) -> unit

  (* The client must allow enumerating all successors of a given node. *)

  val successors: (node -> unit) -> node -> unit

end

(* Given an acyclic graph $G$, this functor provides functions which allow iterating over the graph in topological
   order. Each graph traversal has complexity $O(V+E)$, where $V$ is the number of vertices in the graph, and $E$ is
   the number of its edges. The graph must be acyclic; otherwise, [Cycle] will be raised at some point during every
   traversal. *)

module Sort (G : Graph) : sig

  exception Cycle
  
  val iter: (G.node -> unit) -> unit
  val fold: (G.node -> 'a -> 'a) -> 'a -> 'a

end


[-- Attachment #3: topological.ml --]
[-- Type: text/plain, Size: 1958 bytes --]

(* $Header: /home/pauillac/formel1/fpottier/cvs/typo/topological.ml,v 1.1 2001/08/17 17:04:35 fpottier Exp $ *)

module type Graph = sig

  type node

  (* The client must allow associating an integer degree with every graph node. *)

  val get: node -> int
  val set: int -> node -> unit

  (* The client must allow enumerating all nodes. *)

  val iter: (node -> unit) -> unit

  (* The client must allow enumerating all successors of a given node. *)

  val successors: (node -> unit) -> node -> unit

end

(* Given an acyclic graph $G$, this functor provides functions which allow iterating over the graph in topological
   order. Each graph traversal has complexity $O(V+E)$, where $V$ is the number of vertices in the graph, and $E$ is
   the number of its edges. The graph must be acyclic; otherwise, [Cycle] will be raised at some point during every
   traversal. *)

module Sort (G : Graph) = struct

  (* Auxiliary function. *)

  let increment node =
    G.set (G.get node + 1) node

  (* The main iterator. *)

  exception Cycle

  let fold action accu =

    (* Compute each node's in degree. *)

    G.iter (G.set 0);
    G.iter (G.successors increment);

    (* Create a queue and fill it with all nodes of in-degree 0. At the same time, count all nodes in the graph. *)

    let count = ref 0 in
    let queue = Queue.create() in
    G.iter (fun node ->
      incr count;
      if G.get node = 0 then
	Queue.add node queue
    );

    (* Walk the graph, in topological order. *)

    let rec walk accu =
      if Queue.length queue = 0 then
	if !count > 0 then
	  raise Cycle
	else
	  accu
      else
	let node = Queue.take queue in
	let accu = action node accu in
	decr count;
	G.successors (fun successor ->
	  let degree = G.get successor - 1 in
	  G.set degree successor;
	  if degree = 0 then
	    Queue.add successor queue
        ) node;
	walk accu in

    walk accu

  let iter action =
    fold (fun node () -> action node) ()

end


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Caml-list] Initial port of ocaml for mingw (long)
@ 2001-09-25 20:24 art
  0 siblings, 0 replies; 13+ messages in thread
From: art @ 2001-09-25 20:24 UTC (permalink / raw)
  To: caml-list

CaptnJamesKirk@aol.com said:

> I could not get it to build completely, see the notes below. Due to the 
> number of cygwin tools needed, this will probably have to be a binary 
> distribution to use with mingw, not a source distribution to build with 

mingw.
>

Actually, my thought was to build with cygwin itself at least in the
short term.  The important thing (to me) is the ability to write nice
software and distribute it without the cygwin dll.  It's a bonus too
that ocaml.exe works properly without it too, but the main thing was
the ability to run ocamlopt and get an exe out that you can pass
around easily.  I built with cygwin's gcc (-mno-cygwin), tho.  I think
that it may not be realistic to build ocaml otherwise given that it
uses unix tools to create the prims list, however it can easily be
used without cygwin.

I should've made it more clear that you need cygwin gcc as yet to build.
The important point was that it's possible to get it away from
dependence
on cygwin1.dll...  

> In a message dated 9/24/2001 6:47:33 PM Central Daylight Time, 
> ayerkes@gmvnetwork.com writes:
> >  Assumptions:
> >   (You *must* have the CAMLLIB env variable set to a dos path
> >    containing your caml libraries.  You have to have libcamlrun.a
> >    in this directory in order for things to work.  You may wish
> >    to premake this directory and copy files as necessary)
> 
> Ok, I did this. I was able to build through libcamlrun.a (see below), and I 
> copied it to the appropriate directory, but not much else worked.
> 

Good to know it got that far with the mingw compiler by itself.

> >  
> >  Building: 
> >  
> >  With the files ocaml-3.02.tar.gz, ocaml-mingw-diffs and
> >  ocaml-boot-mingw.tgz in a directory, do the following:
> >  (sorry for breaking the build process)
> >  
> >  gzip -d < ocaml-3.02.tar.gz | tar xvf -
> 
> Or just "tar zxvf ocaml-3.02.tar.gz".
> 
> gzip and tar are part of the cygwin distro. I created a separate bin 
> directory, put it in my path, and copied several things from cygwin to it. 
> These included cygwin1.dll (of course), make (for some reason the make that 
> comes with mingw has problems), tar, gzip & gunzip, ar, awk & gawk, bash 
> (renamed to sh), patch, and lots of text-utils and file-utils. The main 
> cygwin bin directory was not in my path, so that only the mingw gcc, as 
> (assembler), and libraries were used. I can make a complete list of the 

tools 
> needed from cygwin, if I can get it all to work.
> 

Hmm...  

>
> >  cd ocaml-3.02
> >  patch -p 0 < ../ocaml-mingw-diffs
> >  gzip -d < ../ocaml-boot-mingw.tgz | tar xvf -
> >  make
> >  : The build breaks here (access.c) ... builds ok next time
> 
> Umm, not for me. Actually the first break involved building libcamlrun.a, 
> when the linker couldn't find libpdcurses.a (which isn't part of mingw). In 
> fact, pdcurses isn't part of my cygwin distro either, but I copied the 
> regular ncurses library file to the mingw lib directory and renamed it 
> libpdcurses.a and that seemed to work. The next break was nowhere near 
> access.c, and had to do with finding pervasives.cmi. I tried "make world" 
> instead of just "make" and it built through pervasives.cmi but stopped at 
> bytecode/emitcode.ml with the error "Unbound value opEQ".
> 

Sorry, I should've mentioned that I used a small public domain curses
that
was different from the mingw one.  I meant to change that back but
didn't.
(sorry)

> I tried several different things, but could never get it beyond this point. 
> ocamlrun.exe, libocamlrun.a and ocamlyacc.exe were built, but nothing else.
> 
> >  
> >  Hopefully, this is a step in the right direction for a MinGW port.
> >  In any case, it relives the user of ocaml toplevel environments
> >  from having to have cygwin, in addition to allowing one to create
> >  executables that are free from cygwin.
> >  
> >  To complete the cycle, someone who is a bit better with mingw than
> >  I will have to change the compile line in bytelink.ml and asmlink.ml
> >  to reflect mingw,
> 
> I don't think this part will be necessary, since the mingw compiler and 
> assembler are gcc and as, just like cygwin, but I'm not completely sure.
> 

It at least needs a little I'm sure...  Even if just to get rid of the
-mno-cygwin part.  

> /John
> -------------------
> Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: 

http://caml.inria.fr/FAQ/
> To unsubscribe, mail caml-list-request@inria.fr  Archives: 

http://caml.inria.fr
>
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Caml-list] Initial port of ocaml for mingw (long)
@ 2001-09-25 19:34 CaptnJamesKirk
  0 siblings, 0 replies; 13+ messages in thread
From: CaptnJamesKirk @ 2001-09-25 19:34 UTC (permalink / raw)
  To: ayerkes; +Cc: caml-list

I could not get it to build completely, see the notes below. Due to the 
number of cygwin tools needed, this will probably have to be a binary 
distribution to use with mingw, not a source distribution to build with mingw.

In a message dated 9/24/2001 6:47:33 PM Central Daylight Time, 
ayerkes@gmvnetwork.com writes:
>  Assumptions:
>   (You *must* have the CAMLLIB env variable set to a dos path
>    containing your caml libraries.  You have to have libcamlrun.a
>    in this directory in order for things to work.  You may wish
>    to premake this directory and copy files as necessary)

Ok, I did this. I was able to build through libcamlrun.a (see below), and I 
copied it to the appropriate directory, but not much else worked.

>  
>  Building: 
>  
>  With the files ocaml-3.02.tar.gz, ocaml-mingw-diffs and
>  ocaml-boot-mingw.tgz in a directory, do the following:
>  (sorry for breaking the build process)
>  
>  gzip -d < ocaml-3.02.tar.gz | tar xvf -

Or just "tar zxvf ocaml-3.02.tar.gz".

gzip and tar are part of the cygwin distro. I created a separate bin 
directory, put it in my path, and copied several things from cygwin to it. 
These included cygwin1.dll (of course), make (for some reason the make that 
comes with mingw has problems), tar, gzip & gunzip, ar, awk & gawk, bash 
(renamed to sh), patch, and lots of text-utils and file-utils. The main 
cygwin bin directory was not in my path, so that only the mingw gcc, as 
(assembler), and libraries were used. I can make a complete list of the tools 
needed from cygwin, if I can get it all to work.

>  cd ocaml-3.02
>  patch -p 0 < ../ocaml-mingw-diffs
>  gzip -d < ../ocaml-boot-mingw.tgz | tar xvf -
>  make
>  : The build breaks here (access.c) ... builds ok next time

Umm, not for me. Actually the first break involved building libcamlrun.a, 
when the linker couldn't find libpdcurses.a (which isn't part of mingw). In 
fact, pdcurses isn't part of my cygwin distro either, but I copied the 
regular ncurses library file to the mingw lib directory and renamed it 
libpdcurses.a and that seemed to work. The next break was nowhere near 
access.c, and had to do with finding pervasives.cmi. I tried "make world" 
instead of just "make" and it built through pervasives.cmi but stopped at 
bytecode/emitcode.ml with the error "Unbound value opEQ".

I tried several different things, but could never get it beyond this point. 
ocamlrun.exe, libocamlrun.a and ocamlyacc.exe were built, but nothing else.

>  
>  Hopefully, this is a step in the right direction for a MinGW port.
>  In any case, it relives the user of ocaml toplevel environments
>  from having to have cygwin, in addition to allowing one to create
>  executables that are free from cygwin.
>  
>  To complete the cycle, someone who is a bit better with mingw than
>  I will have to change the compile line in bytelink.ml and asmlink.ml
>  to reflect mingw,

I don't think this part will be necessary, since the mingw compiler and 
assembler are gcc and as, just like cygwin, but I'm not completely sure.

/John
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Caml-list] Initial port of ocaml for mingw (long)
@ 2001-09-24 23:40 art
  0 siblings, 0 replies; 13+ messages in thread
From: art @ 2001-09-24 23:40 UTC (permalink / raw)
  To: caml-list

Using code from the cvsnt project (just one function really), I was
able to make an ocaml that does not depend on cygwin1.dll for windows.
The bad news is that currently, it still depends on gcc -mno-cygwin,
sh and make to build programs, etc.  The good news is that it can
produce programs that don't depend on cygwin1.dll as well (from ocamlc
or ocamlopt).  I have tested programs made with both ocamlc and
ocamlopt, and used objdump to verify that they only depend on the
microsoft C runtime.

File needed here:
http://lcc-java.sourceforge.net/ocaml-boot-mingw.tgz
 (New boot directory)
http://lcc-java.sourceforge.net/ocaml-mingw-diffs
 (patch file for ocaml-3.02 distribution for MinGW.

Assumptions:
 (You *must* have the CAMLLIB env variable set to a dos path
  containing your caml libraries.  You have to have libcamlrun.a
  in this directory in order for things to work.  You may wish
  to premake this directory and copy files as necessary)

Building: 

With the files ocaml-3.02.tar.gz, ocaml-mingw-diffs and
ocaml-boot-mingw.tgz in a directory, do the following:
(sorry for breaking the build process)

gzip -d < ocaml-3.02.tar.gz | tar xvf -
cd ocaml-3.02
patch -p 0 < ../ocaml-mingw-diffs
gzip -d < ../ocaml-boot-mingw.tgz | tar xvf -
make
: The build breaks here (access.c) ... builds ok next time
make
: Need some pre-built cmis... not sure why
make	otherlibs/num/int_misc.cmi \
	otherlibs/num/string_misc.cmi \
	otherlibs/num/arith_flags.cmi
make
: Everything except ocamlopt.exe and family made so far
rm byterun/io.h
make -C asmrun depend
make -C byterun depend
: byterun/io.h is replaced by byterun/_io.h due to a name conflict.
make opt
: Everything made
make install 
make installopt
: Installed

Hopefully, this is a step in the right direction for a MinGW port.
In any case, it relives the user of ocaml toplevel environments
from having to have cygwin, in addition to allowing one to create
executables that are free from cygwin.

To complete the cycle, someone who is a bit better with mingw than
I will have to change the compile line in bytelink.ml and asmlink.ml
to reflect mingw, and do new makefiles (perhaps Dmitry will help with
this?)

Art
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2001-10-01 10:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-26 13:06 [Caml-list] Initial port of ocaml for mingw (long) CaptnJamesKirk
2001-09-26 16:44 ` [Caml-list] Looking for Graph Operations-library Mattias Waldau
2001-09-26 16:47 ` Mattias Waldau
2001-09-26 17:08   ` Markus Mottl
2001-09-26 17:13   ` Brian Rogoff
2001-09-26 18:04     ` Mattias Waldau
2001-09-26 18:29       ` Brian Rogoff
2001-09-26 19:23       ` Markus Mottl
2001-09-27  6:16   ` Jean-Christophe Filliatre
2001-10-01 10:00   ` Francois Pottier
  -- strict thread matches above, loose matches on Subject: below --
2001-09-25 20:24 [Caml-list] Initial port of ocaml for mingw (long) art
2001-09-25 19:34 CaptnJamesKirk
2001-09-24 23:40 art

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).