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