I need to deploy to Linux box a native OCaml application that depends on several dynamic libraries. The idea is to prepare self-contained package (no dependencies on OCaml, OPAM etc.) that contains all stuff, and can be installed on hypothetically any modern x84 Linux box. In ideal world, there would be just a single file to be deployed and run.
The best I can think of is to deploy all needed dynamic libraries (ldd app.native
) together with application executable and run application by means of bash script that exports LD_LIBRARY_PATH
before calling application.
Any ideas how to make it better are welcome.
UPDATE
Some tips:
- Use Linux Application Checker to verify compatibility with different Linux distributions.
- Build a binary package on stable, but a bit outdated distribution (e.g. CentOS 6 for now) to improve
libc
compatibility. - Examples of scripts to build a binary package, and run an executable.