combine icon indicating copy to clipboard operation
combine copied to clipboard

color compilation

Open tomsib2001 opened this issue 8 years ago • 1 comments

When trying to compile color.ml using the proposed command with Ocaml 4.02.1 or Ocaml 4.02.3

make color.opt

I get the error

ocamlopt.opt -o color.opt -g -annot  -I +ocamlgraph unix.cmxa graphics.cmxa graph.cmxa combine.cmxa color.ml
File "color.ml", line 25, characters 5-10:
Error: Unbound module Graph
make: *** [color.opt] Erreur 2

But the issue here is not my installation of ocamlgraph, as if I create a file toto.ml with just

open Graph

and compile it using

ocamlbuid -package ocamlgraph toto.native

the log says

### Starting build.
# Target: toto.ml.depends, tags: { extension:ml, file:toto.ml, ocaml, ocamldep, quiet }
/home/thomas/.opam/4.02.3/bin/ocamldep.opt -modules toto.ml > toto.ml.depends
# Target: toto.cmo, tags: { byte, compile, extension:cmo, extension:ml, file:toto.cmo, file:toto.ml, implem, ocaml, quiet }
/home/thomas/.opam/4.02.3/bin/ocamlc.opt -c -I /home/thomas/.opam/4.02.3/lib/ocamlgraph -o toto.cmo toto.ml
# Target: toto.cmx, tags: { compile, extension:cmx, extension:ml, file:toto.cmx, file:toto.ml, implem, native, ocaml, quiet }
/home/thomas/.opam/4.02.3/bin/ocamlopt.opt -c -I /home/thomas/.opam/4.02.3/lib/ocamlgraph -o toto.cmx toto.ml
# Target: toto.native, tags: { dont_link_with, extension:native, file:toto.native, link, native, ocaml, program, quiet }
/home/thomas/.opam/4.02.3/bin/ocamlopt.opt -I /home/thomas/.opam/4.02.3/lib/ocamlgraph /home/thomas/.opam/4.02.3/lib/ocamlgraph/graph.cmxa toto.cmx -o toto.native
# Compilation successful.

tomsib2001 avatar Apr 15 '16 12:04 tomsib2001

This is indeed a compilation issue: our Makefile entry for color.opt is assuming OCamlGraph has been installed in subdirectory ocamlgraph/ of OCaml's standard library and not via ocamlfind (which must be your case).

The correct compilation command for color.opt should then rather be

ocamlfind ocamlopt -package ocamlgraph -package graphics -package unix -linkpkg combine.cmxa color.ml -o color.opt

Thanks for reporting this issue.

Jean-Christophe

On 15/04/2016 14:55, tomsib2001 wrote:

When trying to compile color.ml using the proposed command with Ocaml 4.02.1 or Ocaml 4.02.3

|make color.opt |

I get the error

|ocamlopt.opt -o color.opt -g -annot -I +ocamlgraph unix.cmxa graphics.cmxa graph.cmxa combine.cmxa color.ml File "color.ml", line 25, characters 5-10: Error: Unbound module Graph make: *** [color.opt] Erreur 2 |

But the issue here is not my installation of ocamlgraph, as if I create a file toto.ml with just

|open Graph |

and compile it using

|ocamlbuid -package ocamlgraph toto.native |

the log says

|### Starting build. # Target: toto.ml.depends, tags: { extension:ml, file:toto.ml, ocaml, ocamldep, quiet } /home/thomas/.opam/4.02.3/bin/ocamldep.opt -modules toto.ml > toto.ml.depends # Target: toto.cmo, tags: { byte, compile, extension:cmo, extension:ml, file:toto.cmo, file:toto.ml, implem, ocaml, quiet } /home/thomas/.opam/4.02.3/bin/ocamlc.opt -c -I /home/thomas/.opam/4.02.3/lib/ocamlgraph -o toto.cmo toto.ml # Target: toto.cmx, tags: { compile, extension:cmx, extension:ml, file:toto.cmx, file:toto.ml, implem, native, ocaml, quiet } /home/thomas/.opam/4.02.3/bin/ocamlopt.opt -c -I /home/thomas/.opam/4.02.3/lib/ocamlgraph -o toto.cmx toto.ml # Target: toto.native, tags: { dont_link_with, extension:native, file:toto.native, link, native, ocaml, program, quiet } /home/thomas/.opam/4.02.3/bin/ocamlopt.opt -I /home/thomas/.opam/4.02.3/lib/ocamlgraph /home/thomas/.opam/4.02.3/lib/ocamlgraph/graph.cmxa toto.cmx -o toto.native # Compilation successful. |

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/backtracking/combine/issues/4

backtracking avatar Apr 15 '16 19:04 backtracking