Any way to compile to dynamically link to system in /usr/lib?

25 views
Skip to first unread message

temporala...@gmail.com

unread,
Dec 18, 2015, 4:50:49 PM12/18/15
to ocaml-core
I have installed Core via Opam but I also have Core on my system (Gentoo Linux, via the dev-ml/core package). Using `ocamlbuild -use-ocamlfind foo.native` with the appropriate `_tags` file seems to statically link the Core implementation in my home directory in. I'd like to dynamically link against the system library if that's possible.

Malcolm Matalka

unread,
Dec 18, 2015, 5:00:25 PM12/18/15
to ocaml...@googlegroups.com

Libraries are statically linked.

Den 18 dec 2015 10:50 em skrev <temporala...@gmail.com>:
I have installed Core via Opam but I also have Core on my system (Gentoo Linux, via the dev-ml/core package). Using `ocamlbuild -use-ocamlfind foo.native` with the appropriate `_tags` file seems to statically link the Core implementation in my home directory in. I'd like to dynamically link against the system library if that's possible.

--
You received this message because you are subscribed to the Google Groups "ocaml-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ocaml-core+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christopher Zimmermann

unread,
Dec 19, 2015, 9:09:24 AM12/19/15
to temporala...@gmail.com, ocaml-core
On Fri, 18 Dec 2015 09:50:00 -0800 (PST) temporala...@gmail.com
wrote:
Are you looking for the -dllpath option of ocamlc ?

--
http://gmerlin.de
OpenPGP: http://gmerlin.de/christopher.pub
F190 D013 8F01 AA53 E080 3F3C F17F B0A1 D44E 4FEE

Sinäkin

unread,
Dec 19, 2015, 12:32:35 PM12/19/15
to ocaml-core
Well, another thing then. If I use Core and make a trivial program, like a simple infinite loop. It uses ~5 MiB of memory immediately while using the normal stdlib uses only 100KiB of memory. I was hoping to alleviate this memory loss by sharing a dynamic link. But is there some setting that can be used to disable whatever it is doing to immediately allocate ~5MiB because I'm going to need a lot of separate small executables.

Yaron Minsky

unread,
Dec 19, 2015, 8:32:36 PM12/19/15
to ocaml...@googlegroups.com
Some of this comes from the fact that Core is currently a packed
library. We no longer link like this internally, so you only pay for
the modules you use and their direct dependencies. That makes things
somewhat better. We plan to get the external releases building this
way too, but there's still some work to be done to get that to happen.

Another thing that would be helpful would be dead code elimination for
native code OCaml (it already exists for bytecode.) There's been some
talk of doing this, but I haven't seen any patches yet.

Once we've dropped packed modules, there's probably some fairly modest
refactors we can do to cut down the dependency tree to make simple
uses of Core more lightweight.

y
Reply all
Reply to author
Forward
0 new messages