Admin/PLATFORMS
author wenzelm
Mon Nov 27 11:45:20 2017 +0100 (19 months ago)
changeset 67096 e77f13a6a501
parent 67088 89e82aed7813
child 67235 759d4fb30bfc
permissions -rw-r--r--
proper context (as in 'term' command);
     1 Multi-platform support of Isabelle
     2 ==================================
     3 
     4 Preamble
     5 --------
     6 
     7 The general programming model is that of a stylized ML + Scala + POSIX
     8 environment, with as little system-specific code in user-space tools
     9 as possible.
    10 
    11 The basic Isabelle system infrastructure provides some facilities to
    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
    14 provides some means for portability, e.g. the bash function
    15 "platform_path" to keep the impression that Windows/Cygwin adheres to
    16 Isabelle/POSIX standards, although Poly/ML and the JVM are native on
    17 Windows.
    18 
    19 When producing add-on tools, it is important to stay within this clean
    20 room of Isabelle, and refrain from low-level access to the operating
    21 system. The Isabelle environment uses peculiar scripts for GNU bash and
    22 perl to get the plumbing right. This style should be imitated as far as
    23 possible.
    24 
    25 
    26 Supported platforms
    27 -------------------
    28 
    29 The following hardware and operating system platforms are officially
    30 supported by the Isabelle distribution (and bundled tools), with the
    31 following base-line versions (which have been selected to be neither
    32 too old nor too new):
    33 
    34   x86_64-linux      Ubuntu 12.04 LTS
    35 
    36   x86_64-darwin     Mac OS X 10.10 Yosemite (macbroy31 MacBookPro6,2)
    37                     Mac OS X 10.11 El Capitan (macbroy2 MacPro4,1)
    38                     macOS 10.12 Sierra (macbroy30 MacBookPro6,2)
    39 
    40   x86_64-windows    Windows 7
    41   x86_64-cygwin     Cygwin 2.8 http://isabelle.in.tum.de/cygwin_2017 (x86_64/release)
    42 
    43 All of the above platforms are 100% supported by Isabelle -- end-users
    44 should not have to care about the differences (at least in theory).
    45 
    46 Fringe platforms like BSD or Solaris are not supported.
    47 
    48 
    49 64 bit vs. 32 bit platform personality
    50 --------------------------------------
    51 
    52 Isabelle requires 64 bit hardware running a 64 bit operating. Windows
    53 and Mac OS X allow x86 executables as well, but for Linux this requires
    54 separate installation of 32 bit shared libraries. The POSIX emulation on
    55 Windows via Cygwin64 is exclusively for x86_64.
    56 
    57 ML works both for x86_64 and x86, and the latter is preferred for space
    58 and performance reasons. Java is always for x86_64 on all platforms.
    59 
    60 Add-on executables are expected to work without manual user
    61 configuration. Each component settings script needs to determine the
    62 platform details appropriately.
    63 
    64 
    65 The Isabelle settings environment provides the following variables to
    66 help configuring platform-dependent tools:
    67 
    68   ISABELLE_PLATFORM64  (potentially empty)
    69   ISABELLE_PLATFORM32  (potentially empty)
    70   ISABELLE_PLATFORM
    71 
    72 The ISABELLE_PLATFORM setting variable prefers the 32 bit personality of
    73 the platform, if possible. Using regular bash notation, tools may
    74 express their preference for 64 bit with a fall-back for 32 bit as
    75 follows:
    76 
    77   "${ISABELLE_PLATFORM64:-$ISABELLE_PLATFORM32}"
    78 
    79 
    80 There is a second set of settings for native Windows (instead of the
    81 POSIX emulation of Cygwin used before):
    82 
    83   ISABELLE_WINDOWS_PLATFORM64
    84   ISABELLE_WINDOWS_PLATFORM32
    85   ISABELLE_WINDOWS_PLATFORM
    86 
    87 It can be used like this:
    88 
    89   "${ISABELLE_WINDOWS_PLATFORM:-$ISABELLE_PLATFORM}"
    90 
    91   "${ISABELLE_WINDOWS_PLATFORM64:-${ISABELLE_WINDOWS_PLATFORM32:-${ISABELLE_PLATFORM64:-$ISABELLE_PLATFORM32}}}"
    92 
    93 
    94 Dependable system tools
    95 -----------------------
    96 
    97 The following portable system tools can be taken for granted:
    98 
    99 * Scala on top of Java 8.  Isabelle/Scala irons out many oddities and
   100   portability issues of the Java platform.
   101 
   102 * GNU bash as uniform shell on all platforms. The POSIX "standard" shell
   103   /bin/sh does *not* work -- there are too many non-standard
   104   implementations of it. On Debian and Ubuntu /bin/sh is actually
   105   /bin/dash and thus introduces many oddities.
   106 
   107 * Perl as largely portable system programming language, with its
   108   fairly robust support for processes, signals, sockets etc.
   109 
   110 
   111 Known problems
   112 --------------
   113 
   114 * Mac OS X: If MacPorts is installed there is some danger that
   115   accidental references to its shared libraries are created
   116   (e.g. libgmp).  Use otool -L to check if compiled binaries also work
   117   without MacPorts.
   118 
   119 * Mac OS X: If MacPorts is installed and its version of Perl takes
   120   precedence over /usr/bin/perl in the PATH, then the end-user needs
   121   to take care of installing extra modules, e.g. for HTTP support.
   122   Such add-ons are usually included in Apple's /usr/bin/perl by
   123   default.
   124 
   125 * The Java runtime has its own idea about the underlying platform, which
   126   affects Java native libraries in particular. In Isabelle/Scala the
   127   function isabelle.Platform.jvm_platform identifies the JVM platform.
   128   In the settings environment, ISABELLE_JAVA_PLATFORM provides the same
   129   information without running the JVM.
   130 
   131 * Common Unix tools like /bin/sh, /bin/kill, sed, ulimit are
   132   notoriously non-portable an should be avoided.
   133 
   134 * The traditional "uname" Unix tool only tells about its own executable
   135   format, not the underlying platform!