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