<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2009/10/6d8097dd50dc4197e62e77c76987d947"
  from="Dmitriy Kargapolov &lt;dmitriy.kargapolov@g...&gt;"
  author="Dmitriy Kargapolov"
  date="2009-10-14T02:36:43"
  subject="Dynlink ocamlfind problem"
  prev="2009/10/4ad3ab7d4dbfb154c1200f9e52f982fe"
  next="2009/10/67acf39883f97441f08e61ecd49a77e2"
  next-in-thread="2009/10/e6a0f61ca2697ada7ca7010f2e8abae2"
  prev-thread="2009/10/7b2a0313dff20ef412e178f7bf6cfa49"
  next-thread="2009/10/67acf39883f97441f08e61ecd49a77e2"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Dynlink ocamlfind problem">
<msg 
  url="2009/10/6d8097dd50dc4197e62e77c76987d947"
  from="Dmitriy Kargapolov &lt;dmitriy.kargapolov@g...&gt;"
  author="Dmitriy Kargapolov"
  date="2009-10-14T02:36:43"
  subject="Dynlink ocamlfind problem">
<msg 
  url="2009/10/e6a0f61ca2697ada7ca7010f2e8abae2"
  from="Dmitriy Kargapolov &lt;dmitriy.kargapolov@g...&gt;"
  author="Dmitriy Kargapolov"
  date="2009-10-14T19:09:26"
  subject="Re: Dynlink ocamlfind problem">
</msg>
</msg>
</thread>

<contents>
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"

</contents>

</message>

