Yesterday I tried to compile pgocaml, but I couldn't link the test suite:
================================ 8< CUT HERE >8 ================================
$ make
ocamlfind ocamlc -g -package unix,extlib,pcre,calendar,csv -c pGOCaml_config.ml
ocamlfind ocamlc -g -package unix,extlib,pcre,calendar,csv -c pGOCaml.mli
ocamlfind ocamlc -g -package unix,extlib,pcre,calendar,csv -c pGOCaml.ml
ocamlfind ocamlc -g -package unix,extlib,pcre,calendar,csv -a -o
pgocaml.cma pGOCaml_config.cmo pGOCaml.cmo
ocamlfind ocamlopt -package unix,extlib,pcre,calendar,csv -c pGOCaml_config.ml
ocamlfind ocamlopt -package unix,extlib,pcre,calendar,csv -c pGOCaml.ml
ocamlfind ocamlopt -package unix,extlib,pcre,calendar,csv -a -o
pgocaml.cmxa pGOCaml_config.cmx pGOCaml.cmx
ocamlfind ocamlc -g -package unix,extlib,pcre,calendar,csv \
-pp "camlp4o pa_extend.cmo q_MLast.cmo -loc loc -impl" \
-I +camlp4 -c -impl pa_pgsql.ml4
ocamlfind ocamlc -g -package unix,extlib,pcre,calendar,csv -c
test_pgocaml_lowlevel.ml
ocamlfind ocamlc -g -package unix,extlib,pcre,calendar,csv -linkpkg \
pgocaml.cma -o test_pgocaml_lowlevel test_pgocaml_lowlevel.cmo
Error while linking pgocaml.cma(PGOCaml):
Reference to undefined global `Calendar'
make: *** [test_pgocaml_lowlevel] Error 2
================================ 8< END HERE >8 ================================
As you can see the package "calendar" is present and actually the
library successfully compiles, both native and bytecode.
My system is a Debian (unstable), OCaml 3.10.2, extlib 1.5.1, calendar
2.0.2 and csv 1.1.6. I think I'm probably missing something *very*
obvious that I should see at a glance. Can anyone of you help me?
Thanks a lot,
-- Paolo ~ ~ :wq
Richard Jones wrote:
> Hmmm -- shouldn't ocamlfind ... -package calendar pick this up?
It does. Actually, I think the problem is in PGOcaml itself (I've faced
a similar situation with nurpawiki): the compilation of each module
succeeds because .cmi files for each submodule are there (maybe they
shouldn't, BTW). Adding "open CalendarLib" at the beginning of each
module using calendar's ones solved all my problems in nurpawiki.
Cheers,
-- Stéphane
Richard Jones wrote:
> Paolo: If you add 'open CalendarLib' somewhere at the top of the
> test_pgocaml_lowlevel.ml file, does it link?
Adding "open CalendarLib" on top of pGOCaml.ml *and* pGOCaml.mli, and
replacing line 41 of PGOcaml Makefile (from 1.1 source tarball):
-I +calendar $(shell ocamlfind query calendar)/calendar.cma \
with:
-I +calendar $(shell ocamlfind query calendar)/calendarLib.cmo \
everything compiles and links.
In any case, this is the first time a see an OCaml library distributed
as cmo/cmx and not as a cma/cmxa package. Unfortunately a standard for
package distribution (blessed by INRIA) is far from coming, but Calendar
distribution package is certainly weird a lot :-)
-- Paolo ~ ~ :wq