Porting State

Introduction

My intention is to port the screen library to as many platforms as I can reasonably support.

SourceForge, which hosts STLplus, used to provide a Compile Farm so that I could test STLplus on different platforms. This enabled me, for example, to fix problems with data persistence on 64-bit CPUs. Unfortunately, the Compile Farm has now been withdrawn, so I can only test the library on my Windows machine. However, I can still test against Cygwin Unix emulation on Windows, and Windows native builds using Visual Studio, the MinGW version of the Gcc compiler and the Cygwin gcc compiler running in native mode (up to v3.x only).

Porting Status

There are a number of porting issues to be overcome:

Different Operating Systems

One of the objectives of this library is to provide platform-independent access to operating system services that differ between platforms. The idea is to hide the implementation behind a common interface. By writing software to that interface, you automatically get portable software. At least, that is the theory.

STLplus has been built on the following Operating Systems:

  • Windows
    • NT
    • 2000
    • XP
  • Linux
    • Debian
    • RedHat
    • Suse
    • Ubuntu
    • Cygwin (linux emulation on Windows)
  • other Unix
    • Open BSD
    • Net BSD
    • Free BSD
    • Solaris
  • MacOS
    • X (Darwin)
Different CPU Architectures

Different CPUs have different word lengths, different byte ordering and different integer type definitions. The intention is that STLplus will work with all variations of these characteristics that I come across.

STLplus has been built on the following CPUs:

  • Intel Pentium 686 (32-bit)
  • AMD Opteron (64-bit)
  • IBM OpenPower (32-bit)
  • DEC Alpha (64-bit)
  • Sun Sparc (32-bit)
  • Power PC (32-bit)
  • Power PC (64-bit)
Different Compilers

The concept of portability means portability between operating systems, not necessarily portability between compilers. However, to cater for different tastes in compilers, I have supported as many as I have access to.

It is also important that software will build with different versions of each compiler, because I have no control over which compiler you are using and there's a good chance that you don't either. The STLplus library should ideally work in whatever development environment you have chosen (within reason). So, STLplus works with different releases of these compilers, not just the latest one.

STLplus has been built on the following compilers:

  • Visual Studio
    • v6 - if patched to SP5
    • v7 (.NET)
    • v8 (2005)
    • v9 (2008)
  • Gnu gcc
    • v2, v2.95 onwards - tried on v2.95
    • v3 - tried on v3.3, v3.4
    • v4 - tried on v4.3, v4.4
  • Borland
    • v5.5 (Free Command-line Tools)
    • v5.8 (Turbo C++ 2006 Explorer)

On each operating system there are a number of different development environments available:

  • Windows
    • Visual Studio
    • Borland
    • native Windows using gnu gcc on MinGW
    • Unix-emulation on Windows using gnu gcc on Cygwin
  • all Linux / Unix
    • gnu gcc
  • MacOS X
    • gnu gcc

I refer to a "platform" as a particular combination of CPU, Operating System and Compiler.

These requirements create some limitations on the extent of the library - the primary objective is for it to be portable such that it presents exactly the same interface on all platforms. This means that I do not have anything that cannot be implemented on all platforms with all supported compilers.

For example there's no Unicode support because some compilers have little or no support for Unicode and there are major differences in how Unicode is implemented on different operating systems. There are other libraries that deal with this issue better than I can and so I consider it beyond the scope of the STLplus library to resolve it.

Porting Testing

If you can confirm the library works on any other platform or compiler combination, please let me know the details - Compiler, Compiler version, OS, CPU etc.

The following table shows the platforms that STLplus3 has been tested on recently.

Porting State
Platform Build State
CPU Bits OS Compiler Version Name -D1 Tested Passed Notes
Intel 686 32 Ubuntu Linux gcc 4.3.3 LINUX-i686 2008-10-02 21/21 Uses pre-installed gcc to build a native Linux program
Intel 686 32 Windows XP gcc 3.4.5 (MinGW) MINGW-i686 _WIN32 2008-12-16 Uses MinGW to build a native Windows program
4.4.0 (MinGW) MINGW-i686 _WIN32 2009-10-02 21/21 Uses MinGW with gcc v4.4 to build a native Windows program
3.4.4 (Cygwin) CYGWIN-i686 CYGWIN 2009-10-02 21/21 Uses Cygwin to build a Unix-emulation program that runs on Windows
4.3.2 (alpha) (Cygwin) CYGWIN-i686 CYGWIN 2009-05-26 Uses Cygwin with the alpha-test version of gcc v4 to build a Unix-emulation program that runs on Windows
3.4.4 (Cygwin) CYGMING-i686 CYGMING 2009-05-26 Uses Cygwin with the -mno-cygwin option to build a native Windows program. This option only works on some v3 gcc compilers and has been removed from v4.
Visual Studio 6 (SP5) N/A _WIN32 2009-10-02 21/21 Visual Studio v6 (compiler v12) - must be patched to Service Pack 5
8 N/A _WIN32 2009-01-15 Visual Studio v8 (compiler v14) (2005 Express Edition) - needs Platform SDK
9 N/A _WIN32 2009-10-02 21/21 Visual Studio v9 (compiler v15) (2008 Express Edition)
Borland 5.5.1 N/A _WIN32 2009-05-26 Free C++ Builder version 5.5
5.8.2 N/A _WIN32 2009-10-02 21/21 Turbo C++ 2006 Explorer

Note 1: The -D directive is a C macro that selects between different implementations of code for different platforms. For example, a Windows application will use different system calls to a Unix application. The correct directive for the platform must be defined for the STLplus library to build on the target platform. Typically this is set as an option to the compiler - for example with the gcc compiler you would specify "gcc -DSOLARIS" when building on Solaris. The _WIN32 value that selects the Windows native build is set automatically by the compilers so you don't have to do this. If no -D directive is shown, then the default build is a generic Unix build and needs no special rules. See the documentation on building the library for more on this.