Porting State

Introduction

My intention is to port the STLplus 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. So in the past, the library collection has been extensively tested on a wide range of platforms. This enabled me, for example, to fix problems with data persistence on 64-bit CPUs and to provide a MacOS port. Unfortunately, the Compile Farm has now been withdrawn, so I can only test the library on my own Windows PC and on virtual machines that I have available. However, this setup means that I can still test against a range of compiler/platform combinations, including gcc on Gnu/Linux, gcc on Windows using the Cygwin Unix emulator, Windows native builds using Visual Studio and Windows native builds using the MSYS2 version of the gcc compiler.

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 for the main desktop operating systems: all Unix-like flavours, Windows and MacOS. 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:

  • Any modern version of Windows (from XP to 11)
  • Any distribution of Gnu/Linux (Ubuntu, Cygwin (Gnu/Linux emulation on Windows), Debian, RedHat, Suse
  • Any BSD derivative (Open BSD, Net BSD, Free BSD
  • other Unix-like OSs (Solaris)
  • MacOS - which is also really a BSD derivative (MacOS X)
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)
  • Intel Pentium x86_64 (64-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 usually 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. On the other hand, STLplus requires a good implementation of templates and so this limits the range of compilers supported.

STLplus has been built on the following compilers:

  • Visual Studio - 2010 to 2022
  • Gnu gcc - v3 to v12
  • Clang - v4 to v13
  • Borland - v5.8 (Turbo C++ 2006 Explorer)

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

  • Windows 32-bit build
    • Visual Studio (WIN32 target)
    • Native Windows (WIN32 target) using gnu gcc on Msys2
    • Gnu/Linux emulation on Windows (WIN32 target) using gnu gcc on Cygwin
    • Borland Turbo C++ (WIN32 target)
  • Windows 64-bit build
    • Visual Studio (x64 target)
    • Native Windows (WIN64 target) using gnu gcc on Msys2
    • Gnu/Linux emulation on Windows using gnu gcc on Cygwin64
  • all Gnu/Linux - 32-bit and 64-bit
    • Gnu gcc
  • all BSD derivatives
    • Gnu gcc
    • Clang
  • MacOS X
    • gnu gcc
    • Clang
  • all other Posix Unixen
    • Gnu gcc

I refer to a "platform" as a particular combination of CPU, Operating System, Word Length (32 or 64 bit) 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 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.

Porting State
Platform Build State
CPU Bits OS Compiler Version Name -D1 Tested Passed Notes
Intel 686 64 Ubuntu Gnu/Linux gcc 11.3.0 GNULINUX-x86_64 2023-11-08 27/27
Intel 686 32 Windows 10 gcc 11.3.0 MINGW-i686 _WIN32 2022-05-20 27/27 Mingw 32-bit native Windows build
Intel 686 64 Windows 11 gcc 13.2.0 MINGW-x86_64 _WIN64 2023-10-03 27/27 msys2 64-bit native Windows build (using ucrt64 environment)
Intel 686 64 Windows 11 gcc 11.3.0 CYGWIN-x86_64 CYGWIN 2023-03-31 27/27 Cygwin64 linux-emulation build on Windows
Intel 686 64 Windows 11 Microsoft Visual Studio 2022 - MSVC 19.30 x64 _WIN64 2023-03-31 27/27
Intel 686 32 Windows 11 Microsoft Visual Studio 2022 - MSVC 19.30 Win32 _WIN32 2023-03-31 27/27
Intel 686 64 FreeBSD clang 14.0 FREEBSD-amd64 2023-11-09 27/27 Built using Clang (the default) and not gcc.

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.