Portability
Supported platforms
The bytecoded system currently runs on any POSIX-compliant operating system with an ANSI-compliant C compiler (and tries hard to accommodate deviations from POSIX and ANSI-C). It should run straight out of the box on all Unix and Unix-compatible systems, including Linux and MacOS X. (See below for MS Windows.) While not mandatory, it is recommended to use the GNU gcc compiler to compile the distribution.
The native-code compiler currently supports the following processor/operating system combinations:
Processors | Operating systems |
---|---|
Tier 1 platforms (actively used and maintained by the core Caml team): |
|
AMD64 (Intel and AMD x86 processors in 64-bit mode) | Linux, MacOS X |
IA32 (Intel and AMD x86 processors in 32-bit mode) | Linux, FreeBSD, MacOS X, Microsoft Windows |
Power PC | Linux, Mac OS X |
ARM | Linux |
Tier 2 platforms (maintained but less actively, with help from users): |
|
AMD64 | Microsoft Windows, FreeBSD, OpenBSD |
IA32 | NetBSD, OpenBSD, Solaris 9 |
PowerPC | NetBSD |
SPARC (discontinued since 2017) | Solaris 9, Linux, NetBSD |
Other operating systems for the processors above have not been tested, but the compiler may work under other operating systems with little work.
Ports for Microsoft Windows
There are no less than four ports of Objective Caml for Microsoft Windows available:
- a native Windows port, using the Microsoft development tools (Microsoft Windows SDK), called "Native MSVC";
- a Cygwin port consisting of the Unix sources compiled under the Cygwin Unix-like environment for Windows, called "Cygwin".
- a Cygwin cross-compiler to native Windows, using MinGW, development tools, called "MinGW Cygwin";
- a native Windows port, using a self-contained MinGW distributed by OCamlPro, called "OCPWin".
Each of these ports exists for either Win32 or Win64 platforms.
Here is a summary of the main differences between these ports:
Native MSVC | MinGW Cygwin | Cygwin | OCPWin | |
---|---|---|---|---|
Third-party software required - for base bytecode system - for ocamlc -custom - for native-code generation |
none Windows SDK Windows SDK |
none Cygwin Cygwin |
Cygwin Cygwin Cygwin |
none none none |
Speed of bytecode interpreter | 70 % | 100 % | 100 % | 100 % |
Debugger | partial | partial | full | |
Libraries - Unix - Threads - Graphics |
partial yes yes |
partial yes yes |
full yes no |
partial yes yes |
Restrictions on generated executables | none | none | yes* | yes* |
Note (*): Cygwin-generated .exe
files refer to a DLL that is distributed
under the GPL. Thus, these .exe
files can only be distributed under a
license that is compatible with the GPL. Executables generated by MSVC
or by MinGW have no such restrictions, while OCPWin allows commercial
use except for OCaml compiler parts of itself.