caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Dynlink ocamlfind problem
@ 2009-10-14  2:36 Dmitriy Kargapolov
  2009-10-14 19:09 ` Dmitriy Kargapolov
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitriy Kargapolov @ 2009-10-14  2:36 UTC (permalink / raw)
  To: caml-list

Hi All,
This already was discussed but in context of Win32/Cygwin.
I found similar behaviour in Unix environment.
Playing with ocamlfind command I found that option "-package dynlink"
didn't add anything to the generated build command, but other
packages, extlib for example, did that.
Looks like problem with ocamlfind.

test1:

$ ocamlfind ocamlopt -verbose -o test test.ml -linkpkg
Effective set of compiler predicates: autolink,native
+ ocamlopt.opt -verbose -o test test.ml
+ as -o 'test.o' '/tmp/camlasm635817.s'
+ as -o '/tmp/camlstartupdd953f.o' '/tmp/camlstartup783576.s'
+ gcc -o 'test'   '-L/usr/lib/ocaml' '/tmp/camlstartupdd953f.o'
'/usr/lib/ocaml/std_exit.o' 'test.o' '/usr/lib/ocaml/stdlib.a'
'/usr/lib/ocaml/libasmrun.a' -lm  -ldl


test2:

$ ocamlfind ocamlopt -verbose -o test test.ml -linkpkg -package dynlink
Effective set of compiler predicates: pkg_dynlink,autolink,native
+ ocamlopt.opt -verbose -o test test.ml
+ as -o 'test.o' '/tmp/camlasmc8032e.s'
+ as -o '/tmp/camlstartup436e2c.o' '/tmp/camlstartup632e4c.s'
+ gcc -o 'test'   '-L/usr/lib/ocaml' '/tmp/camlstartup436e2c.o'
'/usr/lib/ocaml/std_exit.o' 'test.o' '/usr/lib/ocaml/stdlib.a'
'/usr/lib/ocaml/libasmrun.a' -lm  -ldl


test3:

$ ocamlfind ocamlopt -verbose -o test test.ml -linkpkg -package extlib
Effective set of compiler predicates: pkg_extlib,autolink,native
+ ocamlopt.opt -verbose -o test -I /usr/lib/ocaml/extlib -ccopt
-I/usr/lib/ocaml/extlib -ccopt -L/usr/lib/ocaml/extlib
/usr/lib/ocaml/extlib/extLib.cmxa test.ml
+ as -o 'test.o' '/tmp/camlasmf474f8.s'
+ as -o '/tmp/camlstartup453a69.o' '/tmp/camlstartupe0a59a.s'
+ gcc -o 'test'   '-L/usr/lib/ocaml/extlib' '-L/usr/lib/ocaml'
'/tmp/camlstartup453a69.o' '/usr/lib/ocaml/std_exit.o' 'test.o'
'/usr/lib/ocaml/extlib/extLib.a' '/usr/lib/ocaml/stdlib.a'
'/usr/lib/ocaml/libasmrun.a' -lm  -ldl -I/usr/lib/ocaml/extlib
-L/usr/lib/ocaml/extlib

Note that I have this dynlink installed:

$ ocamlfind query dynlink -l
package:     dynlink
description: Dynamic loading and linking of object files
version:     [distributed with Ocaml]
archive(s):
linkopts:
location:    /usr/lib/ocaml

I have all latest packages from fedora11 distribution:

$ rpm -qa ocaml\* |sort
ocaml-3.11.0-3.fc11.i586
ocaml-camlp4-3.11.0-3.fc11.i586
ocaml-camlp4-devel-3.11.0-3.fc11.i586
ocaml-extlib-1.5.1-6.fc11.i586
ocaml-extlib-devel-1.5.1-6.fc11.i586
ocaml-findlib-1.2.3-6.fc11.i586
ocaml-findlib-devel-1.2.3-6.fc11.i586
ocaml-omake-0.9.8.5-7.fc11.i586
ocaml-runtime-3.11.0-3.fc11.i586
ocaml-sexplib-4.2.7-2.fc11.i586
ocaml-sexplib-devel-4.2.7-2.fc11.i586
ocaml-type-conv-1.6.7-1.fc11.i586

$ cat /usr/lib/ocaml/dynlink/META
# Specifications for the "dynlink" library:
requires = ""
version = "[distributed with Ocaml]"
description = "Dynamic loading and linking of object files"
directory = "^"
browse_interfaces = " Btype Bytesections Clflags Config Consistbl Dll
Dynlink Ident Meta Misc Opcodes Path Predef Runtimedef Symtable Tbl
Types "
archive(byte) = "dynlink.cma"


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

* Re: Dynlink ocamlfind problem
  2009-10-14  2:36 Dynlink ocamlfind problem Dmitriy Kargapolov
@ 2009-10-14 19:09 ` Dmitriy Kargapolov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitriy Kargapolov @ 2009-10-14 19:09 UTC (permalink / raw)
  To: caml-list

Never mind. Problem was with /usr/lib/ocaml/dynlink/META which was
missing native library spec.
(My actual project that didn't compile used native mode)

Fix:

--- /usr/lib/ocaml/dynlink/META.orig    2009-02-26 05:23:21.000000000 -0500
+++ /usr/lib/ocaml/dynlink/META 2009-10-14 15:02:56.253171783 -0400
@@ -5,4 +5,4 @@
 directory = "^"
 browse_interfaces = " Btype Bytesections Clflags Config Consistbl Dll
Dynlink Ident Meta Misc Opcodes Path Predef Runtimedef Symtable Tbl
Types "
 archive(byte) = "dynlink.cma"
-
+archive(native) = "dynlink.cmxa"


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

end of thread, other threads:[~2009-10-14 19:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-14  2:36 Dynlink ocamlfind problem Dmitriy Kargapolov
2009-10-14 19:09 ` Dmitriy Kargapolov

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