| author | wenzelm | 
| Sun, 02 Mar 2014 20:20:20 +0100 | |
| changeset 55839 | ee71b2687c4b | 
| parent 55438 | 3b95e70c5cb3 | 
| child 58780 | 1f8c0da85664 | 
| permissions | -rw-r--r-- | 
| 36204 | 1 | Some notes on multi-platform support of Isabelle | 
| 2 | ================================================ | |
| 35610 | 3 | |
| 4 | Preamble | |
| 5 | -------- | |
| 6 | ||
| 7 | The general programming model is that of a stylized ML + Scala + POSIX | |
| 48833 | 8 | environment, with as little system-specific code in user-space tools | 
| 9 | as possible. | |
| 35610 | 10 | |
| 11 | The basic Isabelle system infrastructure provides some facilities to | |
| 48833 | 12 | make this work, e.g. see the ML and Scala modules File and Path, or | 
| 13 | functions like Isabelle_System.bash. The settings environment also | |
| 48836 | 14 | provides some means for portability, e.g. the bash function "jvmpath" | 
| 15 | to keep the impression that Java on Windows/Cygwin adheres to | |
| 16 | Isabelle/POSIX standards, although inside the JVM itself there are | |
| 17 | many Windows-specific things. | |
| 35610 | 18 | |
| 19 | When producing add-on tools, it is important to stay within this clean | |
| 20 | room of Isabelle, and refrain from overly ambitious system hacking. | |
| 48833 | 21 | The existing Isabelle scripts follow a peculiar style that reflects | 
| 22 | long years of experience in getting system plumbing right. | |
| 35610 | 23 | |
| 24 | ||
| 25 | Supported platforms | |
| 26 | ------------------- | |
| 27 | ||
| 28 | The following hardware and operating system platforms are officially | |
| 36204 | 29 | supported by the Isabelle distribution (and bundled tools), with the | 
| 30 | following reference versions (which have been selected to be neither | |
| 31 | too old nor too new): | |
| 35610 | 32 | |
| 44876 | 33 | x86-linux Ubuntu 10.04 LTS | 
| 48833 | 34 | x86_64-linux Ubuntu 10.04 LTS | 
| 35610 | 35 | |
| 55391 
eae296b5ef33
Mac OS X Lion (macbroy6) is baseline for portable executables;
 wenzelm parents: 
49144diff
changeset | 36 | x86_64-darwin Mac OS X Lion (macbroy6) | 
| 
eae296b5ef33
Mac OS X Lion (macbroy6) is baseline for portable executables;
 wenzelm parents: 
49144diff
changeset | 37 | Mac OS X Mountain Lion (macbroy30) | 
| 
eae296b5ef33
Mac OS X Lion (macbroy6) is baseline for portable executables;
 wenzelm parents: 
49144diff
changeset | 38 | Mac OS X Mavericks (macbroy2) | 
| 48833 | 39 | |
| 40 | x86-cygwin Cygwin 1.7 (vmbroy9) | |
| 36204 | 41 | |
| 42 | All of the above platforms are 100% supported by Isabelle -- end-users | |
| 44876 | 43 | should not have to care about the differences (at least in theory). | 
| 35610 | 44 | |
| 55391 
eae296b5ef33
Mac OS X Lion (macbroy6) is baseline for portable executables;
 wenzelm parents: 
49144diff
changeset | 45 | Fringe platforms like BSD or Solaris are unsupported. | 
| 36204 | 46 | |
| 47 | ||
| 48 | 32 bit vs. 64 bit platforms | |
| 49 | --------------------------- | |
| 50 | ||
| 48833 | 51 | Most users have 64 bit hardware and are running a 64 bit operating | 
| 55391 
eae296b5ef33
Mac OS X Lion (macbroy6) is baseline for portable executables;
 wenzelm parents: 
49144diff
changeset | 52 | system by default. For Linux this usually means missing 32 bit shared | 
| 48833 | 53 | libraries, so native x86_64-linux needs to be used by default, despite | 
| 54 | its doubled space requirements for Poly/ML heaps. For Mac OS X, the | |
| 55 | x86-darwin personality usually works seamlessly for C/C++ programs, | |
| 56 | but the Java 7 platform is only available for x86_64-darwin. | |
| 57 | ||
| 49144 | 58 | Add-on executables are expected to work without manual user | 
| 59 | configuration. Each component settings script needs to determine the | |
| 60 | platform details appropriately. | |
| 48833 | 61 | |
| 62 | The Isabelle settings environment provides the following variables to | |
| 63 | help configuring platform-dependent tools: | |
| 64 | ||
| 65 | ISABELLE_PLATFORM64 (potentially empty) | |
| 66 | ISABELLE_PLATFORM32 | |
| 67 | ISABELLE_PLATFORM | |
| 36204 | 68 | |
| 69 | The ISABELLE_PLATFORM setting variable refers to the 32 bit version of | |
| 48833 | 70 | the platform, even on 64 bit hardware. Using regular bash notation, | 
| 71 | tools may express their preference for 64 bit with a fall-back for 32 | |
| 72 | bit as follows: | |
| 73 | ||
| 74 |   "${ISABELLE_PLATFORM64:-$ISABELLE_PLATFORM32}"
 | |
| 36204 | 75 | |
| 48833 | 76 | Moreover note that ML and JVM usually have a different idea of the | 
| 77 | platform, depending on the respective binaries that are actually run. | |
| 49144 | 78 | Poly/ML 5.5.x performs best in 32 bit mode, even for large | 
| 79 | applications, thanks to its sophisticated heap management. The JVM | |
| 80 | usually works better in 64 bit mode, which allows its heap to grow | |
| 81 | beyond 2 GB. | |
| 36204 | 82 | |
| 48833 | 83 | The traditional "uname" Unix tool usually only tells about its own | 
| 84 | executable format, not the underlying platform! | |
| 35610 | 85 | |
| 86 | ||
| 87 | Dependable system tools | |
| 88 | ----------------------- | |
| 89 | ||
| 90 | The following portable system tools can be taken for granted: | |
| 91 | ||
| 36204 | 92 | * GNU bash as uniform shell on all platforms. The POSIX "standard" | 
| 93 | shell /bin/sh is *not* appropriate, because there are too many | |
| 44876 | 94 | non-standard implementations of it. | 
| 35610 | 95 | |
| 36204 | 96 | * Perl as largely portable system programming language. In some | 
| 97 | situations Python may serve as an alternative, but it usually | |
| 98 | performs not as well in addressing various delicate details of | |
| 99 | operating system concepts (processes, signals, sockets etc.). | |
| 35610 | 100 | |
| 49144 | 101 | * Scala with Java 1.7. Isabelle/Scala irons out many oddities and | 
| 102 | portability issues of the Java platform. | |
| 35610 | 103 | |
| 104 | ||
| 105 | Known problems | |
| 106 | -------------- | |
| 107 | ||
| 55391 
eae296b5ef33
Mac OS X Lion (macbroy6) is baseline for portable executables;
 wenzelm parents: 
49144diff
changeset | 108 | * Mac OS X: If MacPorts is installed there is some danger that | 
| 41668 | 109 | accidental references to its shared libraries are created | 
| 110 | (e.g. libgmp). Use otool -L to check if compiled binaries also work | |
| 111 | without MacPorts. | |
| 112 | ||
| 55391 
eae296b5ef33
Mac OS X Lion (macbroy6) is baseline for portable executables;
 wenzelm parents: 
49144diff
changeset | 113 | * Mac OS X: If MacPorts is installed and its version of Perl takes | 
| 35610 | 114 | precedence over /usr/bin/perl in the PATH, then the end-user needs | 
| 36204 | 115 | to take care of installing extra modules, e.g. for HTTP support. | 
| 116 | Such add-ons are usually included in Apple's /usr/bin/perl by | |
| 117 | default. | |
| 35610 | 118 | |
| 119 | * The Java runtime has its own idea about the underlying platform, | |
| 48833 | 120 | which affects Java native libraries in particular. In | 
| 49144 | 121 | Isabelle/Scala the function isabelle.Platform.jvm_platform | 
| 122 | identifies the JVM platform. Since a particular Java version is | |
| 123 | always bundled with Isabelle, the resulting settings also provide | |
| 124 | some clues about its platform, without running it. | |
| 55438 | 125 | |
| 126 | * Common Unix tools like /bin/sh, /bin/kill, sed, ulimit are | |
| 127 | notoriously non-portable an should be avoided. |