Skip to content
Alexander Saprykin edited this page Apr 10, 2016 · 62 revisions

Windows

Configuration 1

  • Version: Windows 7 SP1 (x64).
  • Compilers: MinGW GCC 5.3.0 (x86, x64), Intel XE 2013 (x86, x64), Visual Studio (VS) 2012 (x86, x64), Visual Studio 2015 (x86, x64).
  • Status: Compiled (MinGW, Intel, VS2012, VS2015).
  • Tests: Passed (MinGW, Intel, VS2012, VS2015).

Configuration 2

  • Version: Windows XP SP3 (x86).
  • Compilers: Open Watcom 1.9 (x86), Borland 5.82 (x86), VS2010 (x86).
  • Status: Compiled (Open Watcom, Borland, VS2010).
  • Tests: Not run (Open Watcom), Passed (Borland, VS2010).

Regular test builds are run on AppVeyor.

If you need IPv6 support on Windows XP you must enable it manually using the following command: netsh int ipv6 install. Without enabled IPv6 all calls related to IPv6 addresses and sockets will fail.

MinGW-W64 is an advance of the original MinGW project to provide GCC support on Windows including 64-bit API. It has easy-to-use online installer where you can select all required packages. You should have no problems with compilation using MinGW-W64.

MSYS2 provides POSIX environment to build native Windows binaries. After installing core MSYS2 distribution you need to install required MinGW-W64 toolchains and utilities: look for mingw-w64-i686-* and mingw-w64-x86_64-* package prefixes. You need at least GCC and make utility which provides mingw32-make binary. CMake and Boost are also available for the each of toolchains. You may need to explicitly pass to CMake name of the make utility and project generator: -DCMAKE_MAKE_PROGRAM=mingw32-make -G"Unix Makefiles". You can read more about MSYS2 in the below section.

MinGW-W64 (GCC) builds from the MSYS2 distribution may have some problems with optimizations which can lead compiled programs to unpredictable crashes. In that case you can try to compile code with -fno-aggressive-loop-optimizations flag (introduced in GCC 4.8.0).

Note. You must use MinGW-W64 shell to build native binaries, do not use MSYS2 shell directly.

Using Visual Studio is really easy: run CMake, choose required solution generator, run it and open generated solution in Visual Studio. If you are building on old Windows versions (i.e. Windows XP) you may need to pass _WIN32_WINNT and NTDDI_VERSION constants to compiler flags to disable unsupported APIs. This is especially important if you are using newer SDKs (i.e. 7.0a). Also take attention that you must define NTDDI_VERSION properly or it fails to work: in most cases it should be the same as _WIN32_WINNT plus four zeros. I have also encountered situations when SDK's headers were broken, i.e. unsupported APIs were not wrapped with conditional checking for target Windows versions. You can read more about using Windows headers on MSDN.

Open Watcom is an open source compiler with cross-compiling support. It is not officially supported by Boost so I'm not able to run tests though the library itself compiles fine.

Borland C++ is a compiler developed by Borland and CodeGear. Now it is developed by Embarcadero. I do not recommend you to use versions prior 5.7 (Borland C++ Builder 2006) because they have brain-damaged socket subsystem implementation which is not fully compatible with WinSock2 behavior. Those old versions are not fully supported by Boost.

Using Intel C/C++ compiler is straightforward: setup development environment using supplied scripts with appropriate Visual Studio version and target architecture (Intel doesn't supply linker). Run _CMake from the prepared environment and point out path to Intel C/C++ compiler for selected target architecture.

Cygwin

Configuration

  • Version: Windows 7 SP1 (x64).
  • Compilers: GCC 5.3.0 (x86, x64).
  • Status: Compiled.
  • Tests: Passed.

Cygwin is some sort of UNIX API emulation under the Windows so you do not need to modify existing UNIX-driven code. It has easy-to-use online installer with all required packages (including CMake and Boost). If you need to add more packages after installation re-run the installer again and check required packages.

You need to install cygrunsrv package in order to emulate IPC related API. After package installation run cygserver-config to initialize configuration file and then net start cygserver or cygrunsrv -S cygserver.

MSYS

Configuration

  • Version: MSYS2 on Windows 7 SP1 (x64).
  • Compilers: GCC 5.3.0 (x86, x64).
  • Status: Compiled.
  • Tests: Passed.

MSYS had been started as a MinGW add-on and was forked from the Cygwin. Its main goal was to provide POSIX environment to build native Windows binaries, not to run them. MSYS2 is a modern version which aims to be as closest to Cygwin current state as possible, plus it offers great package management through the ported pacman utility from the Arch Linux. More over, MSYS2 provides package build infrastructure to maintain them in an updated state. That is MSYS2 is a preferable choice.

Please, do not confuse MSYS with Cygwin because they have different goals. You can read more about their differences here.

To read about MSYS2 installation and package management refer to installation manual.

Note. As MSYS is a build environment and it lacks cygserver support from the Cygwin there is no mean to use IPC related calls (semaphores, shared memory and buffer). This functionality is not runnable under the MSYS.

GNU/Linux

Configuration 1

  • Version: Debian 8 (x64).
  • Compilers: GCC 4.9.2 (x86, x64), Clang 3.4.2 (x86, x64), Intel XE 2016 Update 1 (x64).
  • Status: Compiled (GCC, Clang, Intel).
  • Tests: Passed (GCC, Clang, Intel).

Configuration 2

  • Version: Debian 8.4 (Mac mini (Late 2005) - PPC32be).
  • Compilers: GCC 4.9.2.
  • Status: Compiled (GCC).
  • Tests: Passed (GCC).

Configuration 3

  • Version: Raspbian 7 (armv6l).
  • Compilers: GCC 4.6.3.
  • Status: Compiled (GCC).
  • Tests: Passed (GCC).

Regular test builds are run on Travis CI.

There a lot of GNU/Linux distributions all around the world, you can choose whatever you want. Debian is used for test builds thanks to its huge packages database and easy-to-use concept. Please refer to documentation of your distribution to obtain information on how to install or build required software.

Raspbian is a Debian-based GNU/Linux distribution optimized for the Raspberry Pi hardware.

Intel C/C++ compiler is a part of the Intel Parallel Studio (XE) which is a commercial software. But you may have a possibillity to get it for free, at least for GNU/Linux. On some old distributions you may encounter problems with Parallel Studio (XE) installation due to wget security certificates check for Intel's site. To fix it you can edit an installtaion script and pass --no-check-certificate option to wget everywhere in the script. You should also setup LD_LIBRARY_PATH variable to make Intel libraries avaialble for dynamic linker to run compiled binaries.

To build x86 binaries on a x64 host (GCC and Clang only, for Intel compiler you need x86 Parallel Studio (XE) version separately) you may need to install additional multilib packages. For example on Debian it is called g++-multilib. After that you should pass -m32 option to the compilers.

Note. It seems that default Clang 3.5.0 package in Debian repository has a bug with int-char type cast. Use Clang 3.4.2 instead.

OS X

Configuration 1

  • Version: El Capitan 10.11.3 (x64).
  • Compilers: GCC 5.2.0 (x64), Apple Clang 7.0.2 (x64), Intel XE 2016 Update 1 (x64).
  • Status: Compiled (GCC, Apple Clang, Intel).
  • Tests: Passed (GCC, Apple Clang, Intel).

Configuration 2

  • Version: Leopard 10.5.8 (PPC32be).
  • Compilers: Apple GCC 4.2.1 (PPC32)
  • Status: Compiled.
  • Tests: Passed.

Regular test builds are run on Travis CI.

Apple Clang compiler comes with Xcode, all other required packages can be downloaded (or built) using MacPorts or Homebrew. But probably you need to build Boost by yourself depending on which compiler was used for compiling packages (usually Apple Clang is used by default). Building Boost on OS X using GCC may be a bit tricky due to Apple's linker differences with GNU's one, perhaps this tip or this one will help you to save a time.

On older OS X systems you may have Apple GCC instead of Apple Clang, but rules are remain the same.

For Intel C/C++ compiler you need to prepare development environment first. Run command like source /opt/intel/bin/iccvars.sh intel64 with appropriate target architecture (or you will risk to get license errors and broken compiler). After that you should pass compiler parameters to CMake: -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc.

Use DYLD_LIBRARY_PATH variable instead of LD_LIBRARY_PATH.

FreeBSD

Configuration

  • Version: 10.1 (x86).
  • Compilers: GCC 4.8.5 (x86), Clang 3.4.1 (x86).
  • Status: Compiled (GCC, Clang).
  • Tests: Passed (GCC, Clang).

Configuration

  • Version: 10.2 (x64).
  • Compilers: GCC 4.8.5 (x64), Clang 3.4.1 (x86, x64).
  • Status: Compiled (GCC, Clang).
  • Tests: Passed (GCC, Clang).

FreeBSD can be downloaded from the official page. After installation you can use available binary packages or build ports from source to get required software. Read more about package management on FreeBSD. GCC, Clang and Boost are all distributed through the packages.

To compile and run x86 software on x64 host you need to install lib32 package first. You can download archive from the ftp and install it manually using tar -xfp lib32.txz command. Pass -m32 flag to compilers for x86 target. Latest versions of FreeBSD use Clang as default compiler, so you may need to build your own GCC with x86 target support.

NetBSD

Configuration

  • Version: 7.0 (x64).
  • Compilers: GCC 4.8.4 (x86, x64), Clang 3.6.2 (x86, x64).
  • Status: Compiled (GCC, Clang).
  • Tests: Passed (GCC, Clang).

NetBSD can be downloaded from the official page. After installation you can configure repository for pkksrc with binary and source based packages to get required software. Read more about package management on NetBSD. GCC, Clang and Boost are all distributed through the packages.

OpenBSD

Configuration

  • Version: 5.6 (x64).
  • Compilers: GCC 4.2.1 (x64), Clang 3.5-trunk (x64).
  • Status: Compiled (GCC, Clang).
  • Tests: Passed (GCC, Clang).

OpenBSD can be downloaded from the official page. After installation you should manually configure package repository. Read more about package management on OpenBSD. GCC, Clang and Boost are all distributed through the packages.

OpenBSD doesn't support multilib configuration so you coudn't build and run x86 binaries on x64 machine.

DragonFlyBSD

Configuration

  • Version: 4.4.1 (x64).
  • Compilers: GCC 5.2.1 (x64), Clang 3.7.1 (x64).
  • Status: Compiled (GCC, Clang).
  • Tests: Passed (GCC, Clang).

DragonFlyBSD can be downloaded from the official page. After installation it should be configured for package repository. More information about package management is available here. Repository contains all required packages (GCC, Clang, CMake and Boost). But for Clang you need to build Boost by yourself.

AIX

Configuration

  • Version: 7.1 (PPC64be).
  • Compilers: GCC 4.6.3 (PPC32, PPC64).
  • Status: Compiled (GCC).
  • Tests: Passed (GCC).

AIX is a UNIX-like proprietary IBM's operating system. Usually you can get it only with the hardware from IBM.

By default GCC compiles PPC32 binaries so you should explicitly pass -maix64 flag to compiler to produce PPC64 binaries. If you are building a static library you should also pass -X64 option to the AIX native linker, but for the some reasons CMake puts CMAKE_STATIC_LINKER_FLAGS (introduced in 2.8.10) variable in wrong order (it should be passed before cr parameters). See this answer to make it work properly.

More information about compiling programs with GCC on AIX can be found in this article. Also lot of useful information regarding AIX development is presented in the free book "Developing and Porting C and C++ Application on AIX".

Use LIBPATH variable if LD_LIBRARY_PATH is not working (could happen on AIX prior 5.3).

HP-UX

Configuration 1

  • Version: B.11.31 (IA-64).
  • Compilers: GCC 4.2.3 (IA-64/32, IA-64).
  • Status: Compiled.
  • Tests: Passed.

Configuration 2

  • Version: B.11.11 (PA-RISC 2.0).
  • Compilers: GCC 4.2.3 (HPPA2.0-32).
  • Status: Compiled.
  • Tests: Passed.

HP-UX is a Hewlett-Packard's (HP) enterprise proprietary operating system (UNIX-based). Recent versions run on Intel's Itanium and HP's PA-RISC 2.0 architectures. It is not available for download and is only shipped with new hardware or by contracts.

GCC for IA64 by default compiles IA-64/32 binaries so you should explicitly pass -mlp64 flag to compiler to produce IA-64 binaries.

GCC for PA-RISC couldn't switch between ABI's so you should have two distinct installed targets for HPPA2.0-32 and HPPA2.0-64 architectures.

HP-UX has Adaptive Address Space (AAS) technology which affects shared memory exchange between 32-bit and 64-bit processes. Also it seems that due to AAS every single process couldn't attach to the same shared memory segment twice. You can read more about the AAS in an "Adaptive Address Space" white papper (PDF).

Use SHLIB_PATH variable if LD_LIBRARY_PATH is not working.

Solaris

Configuration 1

  • Version: 11.3 (x64).
  • Compilers: GCC 4.8.2 (x86, x64), Oracle Solaris Studio (OSS) 12.4, 12.5 Beta (x86, x64).
  • Status: Compiled (GCC, OSS).
  • Tests: Passed (GCC, OSS).

Configuration 2

  • Version: 10 1/13 (Sun Fire V210 - SPARCv9).
  • Compilers: GCC 4.9.2 (m32, m64), Oracle Solaris Studio 12.3 (m32, m64).
  • Status: Compiled (GCC, OSS).
  • Tests: Passed (GCC, OSS).

Solaris 10 is available for free download from Oracle.

Solaris 11 is available for free download from Oracle.

Distribution comes with GCC in base installation, more packages are available from official repository. Use pkg add <package_name> to install any package automatically (repository is autoconfigured during the system installation). Follow download instructions to get the latest version of OSS.

There are no CMake and Boost packages in the repository, but they can be built from sources using GCC. It seems that OSS 12.4 still couldn't be used to build all the Boost libraries in easy way (see blog post if you want to fight it). Take a note that you should pass to OSS the same flags you have used to compile Boost.

By default GCC and OSS compile x86 binaries so you should explicitly pass -m64 flag to compilers to produce x64 binaries. On the SPARC-based workstation there is the same principle.

Update. A new version of OSS 12.5 Beta with improved Boost support has beed released. Just follow the configuration instructions from the above given blog post.

If you are building static tests with OSS compiler pass -std=c++03 to C++ compiler flags.

IRIX

Configuration

  • Version: 6.5.30 (MIPS R14000).
  • Compilers: GCC 3.3.0 (MIPS n32), MIPSpro 7.4.0 (n32).
  • Status: Compiled (GCC, MIPSpro).
  • Tests: Passed (GCC, MIPSpro).

IRIX is an operating system developed by Silicon Graphics for their MIPS powered workstations and servers. Its development is discontinued for the now.

IRIX comes with own commercially available C/C++ compilers named MIPSpro. Also lot of the open source software including GCC toolchains is available through the Nekoware repository.

IRIX has three ABI types (from the ABI man page):

  • o32: the old 32-bit ABI which was standard on IRIX 5 systems;
  • n32: the new high performance 32-bit ABI which was introduced on IRIX 6.2;
  • n64: the 64-bit ABI which was introduced on IRIX 6.0 systems.

You should compile all you code using the single ABI type.

CMake is available in the Nekoware repository as well as on the official site in the archive. Bundled version of the Boost compiles without any problems.

You can (almost) safely mix C code compiled with both GCC and MIPSpro as well as link that code with the C++ compiled one. But you couldn't mix C++ compiled with the both compilers. Read more about MIPSpro compiler and its relation with GCC.

The best resource for information about the IRIX is a Nekochan with lot of articles and forums.

Additional references:

QNX Neutrino

Configuration

  • Version: 6.5.0 (x86).
  • Compilers: GCC 4.4.2 (x86).
  • Status: Compiled.
  • Tests: Passed.

QNX Neutrino is a BlackBerry's real-time proprietary operating system. Version 6 (Neutrino) is claimed to be POSIX-compatible. You can download bootable ISO from the official download center. It has evaluation period or you can get free non-commercial license (requires registration at the QNX portal).

QNX Neutrino has GCC and a frontend called qcc. They can be installed from bootable ISO (not all bootable ISOs may contain compilers, check before downloading).

You can install binary packages from the NetBSD repository, read more about how to do it. Note that you should use bootstrap pkgsrc archive from the repository root directory directly, because posted on the wiki above differs in version from the repository itself, so it will refuse to install packages.

If you experience problems with certificates while using SSL-encrypted web protocols (i.e. https), you should install mozilla-rootcerts package and follow instructions on the screen after installation.

UnixWare

Configuration

  • Version: 7.1.4 (x86).
  • Compilers: GCC 2.95.3 (x86).
  • Status: Compiled.
  • Tests: Passed.

Currently UnixWare is distributed by Xinuos, developed by Novell and SCO. UnixWare is a closed-source shareware so you must buy a license after a trial period. You can download evaluation version (x86) from the SCO server. This ISO is capable to run on VMware (or similar virtualization platform which supports x86). Lot of additional software packages are available from the Skunkware repository. I would recommend you to install at least bash, tar, gzip and openssh packages to make life a bit easier. Boost library and CMake are not available.

Quick tips for the package management:

  • To install a package (a .pkg file) use the following command: pkgadd -d /full/path/to/package all.
  • To remove a package use the following command: pkgrm <package_name>.

Generally speaking there are two ways to develop software under the UnixWare:

  • UnixWare and OpenServer Development Kit (UDK, or UODK): universal C/C++ development system for both UnixWare and OpenServer. On older 2.x versions of UnixWare it was also named as C/C++ Compilation System (CCS).
  • GNU development tools: well-known GCC compiler and related tools.

UnixWare is shipped with its own optimizing CCS, but it lacks C++ compiler we are also need. The UDK requires license from SCO which can be quite expensive. You should contact SCO (or Xinuos now) or one its reseller to obtain a copy of UDK. Thus we have only one free option which is to use the GCC. Version 2.95.2 is available in the Skunkware and should be installed.

Please note that it is recommended to use bash for building, especially for GCC.

First of all, we need GNU assembler and linker because native friends have some bugs and not working as expected.

  • Install latest make utility package from Skunkware (it should be version 3.79.1).
  • Download and unpack GNU binutils, I have used version 2.14. Build and install it using installed make version, the process is fast and straight forward.
  • You need to replace native as and ld utilities: rename them in /usr/bin and /usr/ccs/bin, then prepend binutils installation binary directory to the PATH environment variable.

Now we can prepare working CMake. I have picked up version 2.8.12.2 (maybe 3.x branch can be also compiled, I haven't checked). The building process is a bit tricky, so you should carefully follow the steps.

  • In system header /usr/include/unistd.h comment out exit() declaration which has C++ linkage): it would be messed up with C-styled one.
  • You need to place proper /usr/include/elf.h header file instead of the system one which lacks several structures and definitions. You can take proper file from the glibc.
  • Setup GCC environment variables explicitly: set CC to /usr/local/bin/gcc, CXX to /usr/local/bin/g++, CPP to /usr/local/bin/cpp.
  • We also need to tell that GCC is C99 compliant. Set CFLAGS and CXXFLAGS environment variables to -D__STDC__ -D__STDC_VERSION__=199901L.
  • Go to CMake root directory and edit Modules/Platforms/UnixWare.cmake file: you need to replace -K PIC arguments to -fPIC because we will be using CMake with GCC, not with bundled C compiler. Also remove -Wl,-Bexport linker flag since now we are using GNU linker.
  • Run CMake bootstrap process with ./bootstrap command.
  • Now you can compile CMake with make command and after that build installation packages with make package command.

From now you can use CMake to build working library without Boost tests. To build Boost along with the tests you need at least GCC 2.95.3. Building GCC 2.95.3 is quite easy.

  • Install bison from Skunkware.
  • Download and unpack GCC 2.95.3.
  • Set CFLAGS and CXXFLAGS environment variables to /usr/local/include/g++-3 because system itself lacks some required headers.
  • Configure GCC: ./configure --enable-threads=posix --with-gnu-as --with-gnu-ld. You can also pass required --prefix.
  • Run building with make bootstrap command. Here and below use make utility installed from Skunkware.
  • During the building process you can get errors about some functions redefinitions (like abs) in new GCC's headers. Just comment them out (in the building tree) and re-run building.
  • Install new GCC with make install command.
  • Fix <prefix>/lib/gcc-lib/i686-UnixWare*-sysv5/2.95.3/include/syslimits.h header: append LL suffix to LLONG_MAX constant value and ULL to ULLONG_MAX.

You can use Boost 1.34.1 (use static tests option, I haven't tried to build the whole Boost) for the tests. Also pass -ftemplate-depth-30 to C++ compiler flags.

Additional references:

SCO OpenServer 5

Configuration

  • Version: 5.0.7 (x86).
  • Compilers: GCC 2.95.3.
  • Status: Compiled.
  • Tests: Passed.

Currently OpenServer is distributed by Xinuos, developed by SCO. OpenServer is a closed-source shareware so you must buy a license after a trial period. You can download evaluation version (x86) from the SCO server. This ISO is capable to run on VMware (or similar virtualization platform which supports x86). Lot of additional software packages are available from the Skunkware repository. Boost library and CMake are not available.

For package management you can use the same pkgadd and pkgrm commands as for UnixWare, but some software comes in form of media images (files named like VOL.000.000 after extracting from a VOLS archive). To install those files:

  • Put them into an empty directory (i.e. /tmp/foobar).
  • Run the scoadmin software command and select the menu items Software->Install New.
  • Select your host and, when prompted for the Media Device, select Media Images (you may need to scroll down the list) and Continue.
  • When prompted for the Image Directory, type in /tmp/foobar or whatever is the name of the directory containing the extracted media images.
  • Select OK and proceed.

If you need to skip media image prerequisities checking just create an empty file with the same name as the images directory plus .nocheck: touch /tmp/foobar.nocheck.

To get working GCC 2.95.3:

  • Make sure that you have installed the latest Maintenance Pack (MP) for your system (MP5 for OpenServer 5.0.7).
  • You may also need to install gwxlibs package on older systems (MP5 already contains it).
  • Install GNU Development Tools package. You may need to disable system requirements checking for that package if it fails.
  • Install SCO OpenServer Linker and Application Development Libraries package from the boot CD (there is no GNU linker for OpenServer 5 due to lack of the COFF weak symbols implementation).
  • Add /usr/gnu/bin to your binary search path. Also place /usr/bin/ar and /usr/bin/ranlib links to /usr/gnu/bin/gar and /usr/gnu/bin/granlib, respectively.

From now it is better to use GNU make utility instead of the native one (if you have it at all).

I have picked up CMake 2.8.12.2 (maybe 3.x branch can be also compiled, I haven't checked). The building process is easy.

  • You need to place proper /usr/include/elf.h header file instead of the system one which lacks several structures and definitions. You can take proper file from the glibc.
  • Setup GCC environment variables explicitly: set CC to /usr/local/bin/gcc, CXX to /usr/local/bin/g++, CPP to /usr/local/bin/cpp.
  • We also need to tell that GCC is C99 compliant. Set CFLAGS and CXXFLAGS environment variables to -D__STDC__ -D__STDC_VERSION__=199901L (you may only need this for CMake versions lower than 2.8.12.2).
  • Run CMake bootstrap process with ./bootstrap command.
  • Now you can compile CMake with make command and after that build installation packages with make package command.

Before moving next compile and install FSU Pthreads 3.14. You must compile it with GCC as you cannot mix object files from different compilers.

  • Make sure that -DMALLOC is appended to CFLAGS variable in Makefile of src sub-directory. If not add it manually.
  • Run building with make command. Comment out any redefined structures in library's headers.
  • Install library with make install command.
  • Note. Do not run configure script because Makefile is tuned for OpenServer 5 and you will lose all required changes.

Now you are ready to build the library. Make sure that libmalloc.a in /usr/lib will be found first by the linker.

You can use Boost 1.34.1 (use static tests option, I haven't tried to build the whole Boost) for the tests. Also pass -ftemplate-depth-30 to C++ compiler flags.

Additional references:

OpenVMS/VAX

Configuration

  • Version: 7.3 (VAXserver 3900).
  • Compilers: Compaq C 6.4.
  • Status: Not compiled.
  • Tests: Not run.

OpenVMS/VAX is a proprietary operating system distributed by HP. According to numerous discussions regarding CMake on OpenVMS for now there was no success in bootstrapping CMake on this system. VAXserver 3900 is a 32-bit machine.

Here is a good FAQ to start working with OpenVMS system.

OpenVMS/Alpha

Configuration

  • Version: 7.3 (AlphaServer ES40).
  • Compilers: Compaq C 6.5.
  • Status: Not compiled.
  • Tests: Not run.

The same thing as with OpenVMS/VAX. AlphaServer ES40 is a 64-bit machine.

Clone this wiki locally