[Omake] Re: Getting similar errors to previous posts
Jason Hickey
jyh at cs.caltech.edu
Tue Aug 14 17:37:35 PDT 2007
On Aug 14, 2007, at 10:56 AM, Todd Gardner wrote:
> Jason Hickey wrote:
>> Add the following line to your OMakefile.
>> OCAML_OTHER_LIBS[] += graphics
>
> I have this specified for my local build, but I thought by
> specifying the use ocamldep, the build system would automatically
> pick up on the dependencies within the standard library. My attempt
> here is more to get a working prototype for a larger, more scalable
> build system, so I was trying to get away from having to enter each
> of included libraries names into the OMakefiles for each project.
> Is this possible?
ocamldep is really only used for the .cmi and .cmx dependencies.
Your program has "open Graphics", so ocamldep+omake figure out that
this means some specific <pathname>/graphics.cmi file. If <pathname>/
graphics.cmi changes, your program will be recompiled.
Unfortunately, there isn't a uniform convention about how libraries,
like graphics.cma, are named. It could have been named graphicx.cma,
or something else, so ocamldep+omake ignores this part. In general,
this means you have to specify libraries by hand. [However, I really
like the idea of some kind of semi-automated approach. Mybe in a
future release...]
In any case, libraries are inherited down the build tree. So if you
add "OCAML_OTHER_LIBS[] += graphics" in your toplevel OMakefile, all
programs will be linked with graphics.cma.
> I agree it is most likely running two versions, however:
>
> C:\ocamlmgw\bin>ocamlfind ocamldep -version
> ocamldep, version 3.10.1+dev0 (2007-05-21)
>
> C:\ocamlmgw\bin>ocamldep -version
> ocamldep, version 3.10.1+dev0 (2007-05-21)
This is -very- strange.
Here are some things you could do just from omake.
2. OCAMLDEP_MODULES_ENABLED = false
But I don't like this much, because -modules is much better.
3. OCAMLDEP_MODULES_USE_OCAMLFIND = false
Just turn off using ocamlfind, but this is probably a hassle.
4. Use a custom scanner, by redefining the OCamlScanner function.
You can define the command to be whatever you want. But I
don't know what that would be...
But if you can get findlib to work properly that is probably a lot
better.
1. Try to track down the real problem.
# (Your config will be different)
% ocamlfind printconf
Effective configuration:
Configuration file:
/usr/local/godi/etc/findlib.conf
[snipped]
% cat /usr/local/godi/etc/findlib.conf
destdir="/usr/local/godi/lib/ocaml/site-lib"
path="/usr/local/godi/lib/ocaml/pkg-lib:/usr/local/godi/lib/
ocaml/site-lib"
ocamlc="ocamlc.opt"
ocamlopt="ocamlopt.opt"
ocamldep="ocamldep.opt"
Maybe the path in your findlib.conf is incorrect. You should
probably check the path by hand and make sure ocamlfind is really
using the ocamldep you want.
Jason
--
Jason Hickey http://www.cs.caltech.edu/~jyh
Caltech Computer Science Tel: 626-395-6568 FAX: 626-792-4257
More information about the Omake
mailing list