Version française
Home     About     Download     Resources     Contact us    
Browse thread
Dynlink ocamlfind problem
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Dmitriy Kargapolov <dmitriy.kargapolov@g...>
Subject: Dynlink ocamlfind problem
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"