[ocaml-ctypes] libffi compatibility

Ashish Agarwal agarwal1975 at gmail.com
Fri Oct 4 14:48:57 BST 2013


> I'm preparing to distribute my ctypes-using project

Can you please provide a link to your project.



On Thu, Oct 3, 2013 at 1:22 PM, Phil Hagelberg <phil at hagelb.org> wrote:

>
> I'm preparing to distribute my ctypes-using project to folks who don't
> have OCaml installed, so I'm compiling a .native executable.
>
> Most of what I read about distributing OCaml is that for native binaries
> you can compile it on any 64-bit Linux system, and it should work on any
> other 64-bit Linux. But I get the feeling libffi complicates things a
> bit; my Debian-compiled binary refuses to run on newer Ubuntus ("error
> while loading shared libraries: libffi.so.5: cannot open shared object
> file") and straight up segfaults on Fedora 19.
>
> So I'm guessing I'll need to compile separately for each
> distribution/version I want to support? Are there any tools to make this
> process more streamlined? I briefly looked at the OpenSuSE Build
> Service[1], but it looks pretty complicated. What about different
> versions of Mac OS X?
>
> Also on a somewhat-related note, I have this to find the readline library:
>
>   let libreadline = Dl.(dlopen ~filename:"libreadline.so"
> ~flags:[RTLD_NOW])
>
> However, the ".so" needs to be replaced with ".dylib" for Mac OS X
> compatibility. Is there a recommended way to specify dlopen filenames
> portably, or should I just catch the exception and try to fall back to
> .dylib if it can't find the .so?
>
> thanks,
> Phil
>
> [1] - http://build.opensuse.org
>
> _______________________________________________
> Ctypes mailing list
> Ctypes at lists.ocaml.org
> http://lists.ocaml.org/listinfo/ctypes
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ocaml.org/pipermail/ctypes/attachments/20131004/7e796d8d/attachment.html>


More information about the Ctypes mailing list