Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bytecode support #12

Closed
edwintorok opened this issue Dec 22, 2015 · 4 comments
Closed

bytecode support #12

edwintorok opened this issue Dec 22, 2015 · 4 comments

Comments

@edwintorok
Copy link

I'm using mtime with ocamlopt but it would be nice to have mtime working with the toplevel or bytecode too.
Apparently it tries to load rt as a bytecode library and not the system librt.so:

$ ocamlc -version
4.02.3
$ ocamlfind ocamlc -package mtime.os x.ml -linkpkg  -verbose
Effective set of compiler predicates: pkg_mtime.os,autolink,byte
+ ocamlc.opt -verbose -I /home/edwin/.opam/4.02.3/lib/mtime/os /home/edwin/.opam/4.02.3/lib/mtime/os/mtime.cma x.ml
File "x.ml", line 1:
Error: Error on dynamically loaded library: dllrt.so: dllrt.so: cannot open shared object file: No such file or directory
ocamlc.opt returned with exit code 2

$ utop
[...]
utop # #require "mtime.os.top";;
Cannot load required shared library dllrt.                                                                                                                                  Reason: dllrt.so: dllrt.so: cannot open shared object file: No such file or directory.                                                                                      File "/home/edwin/.opam/4.02.3/lib/mtime/os/mtime_top_init.ml", line 1:                                                                                                     
Error: Reference to undefined global `Mtime'
@dbuenzli
Copy link
Owner

Mmmmh sorry about that. This comes at the right time since I'm working on finishing ptime_clock and was copying that build system. I tried to provide a fix could you please try to:

opam pin -kgit mtime https://github.com/dbuenzli/mtime.git
cp $(opam config var mtime:doc)/min.ml /tmp/
cd /tmp
ocamlfind ocamlc -package mtime.os -linkpkg -o min.byte min.ml
./min.byte 
ocamlfind ocamlopt -package mtime.os -linkpkg -o min.native min.ml
./min.native 

and confirm me that this now works (I tried on Darwin and Ubuntu 14.04 64bits).

@edwintorok
Copy link
Author

On 12/22/2015 05:20 PM, Daniel Bünzli wrote:

Mmmmh sorry about that. This comes at the right time since I'm working on finishing ptime_clock and was copying that build system. I tried to provide a fix could you please try to:

|opam pin -kgit mtime https://github.com/dbuenzli/mtime.git cp $(opam config var mtime:doc)/min.ml /tmp/ cd /tmp ocamlfind ocamlc -package mtime.os -linkpkg -o min.byte min.ml ./min.byte ocamlfind ocamlopt -package mtime.os -linkpkg -o min.native min.ml ./min.native |

and confirm me that this now works (I tried on Darwin and Ubuntu 14.04 64bits).

Thanks, works on Debian Jessie.

Not sure if Linux is the only OS that needs -lrt though, but I don't have a Solaris machine to test now.

@dbuenzli
Copy link
Owner

I'll make a release soon. Just fixing other parts of the build system (#1).

@dbuenzli
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants