Skip to content

color compilation #4

Open
Open

Description

@tomsib2001

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.

Activity

  1. backtracking commented on Apr 15, 2016

    @backtracking
    Owner

    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
    #4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions