Pre-requisite Software

The tools you need to compile software for Haiku, or to compile Haiku itself, depend on the platform that you are using for building Haiku.

The Haiku operating system can be a very convenient development environment for working on Haiku, but using Haiku is not strictly necessary. It may also not be practical to use Haiku in some very special cases, such as when writing some drivers - using a virtual machine to test your changes may be much more practical. It may also be a bit slower as far as compilation times are concerned, but performance has massively improved over the years. Occasionally, building Haiku within Haiku can be problematic if the host is significantly out of date compared to the version being built. In this case, cross-compiling Haiku from another operating system, or updating Haiku to a newer version should fix that.

On the other hand, while Haiku may not necessarily the fastest, there’s a huge advantage to being able to immediately test the freshly compiled programs. Working from a Haiku environment is paramount in many cases, such as when you’re porting applications to Haiku or when you’re working on desktop applications. Using the operating system that you’re working on is also very useful, because some of the difficulties that you may come across while using the system, or just using the system without coming across any real problems, will lead to even more improvements that everyone will benefit from. Haiku’s a pretty good development platform on its own: There are IDEs (Integrated Development Environments) that are exclusive to and deeply integrated with Haiku, such as Pe, Koder, microbe and Paladin, as well as IDEs that were ported to Haiku and work perfectly fine with it, such as Qt Creator and the Arduino IDE, all the way up to the world famous text-based editors, such as vim, nano and emacs.

If you’d like to have the best of both worlds, you could also use Haiku in a virtual machine and use that as a development environment. If you are using text-based IDEs, you could also connect to your virtual machine running Haiku with Secure Shell and integrate that in your workflow. This may be a particularly viable option when working with HaikuPorts.

Nightly images (or the latest stable release) of Haiku should contain most of the software needed to build Haiku in Haiku. Please see below for the requirements not included. Note that building the entire operating system on an x86_64 Haiku host will require that the buildtools for that architecture are also prepared and compiled. Use the same instructions as a cross-compile in this case. The reason for this is because some 32-bit objects need to be built as well and the compiler supplied by default on an x86_64 environment is insufficient for building these objects.

In short, you are basically free to use whichever operating system suits you the most in order to develop with Haiku. We understand that you may not be able to switch operating systems on a whim, or that Haiku may not fulfill your needs as well as it does for other people. You’re free to use whichever operating system you feel like.

For your convenience, we have also compiled a table with a list of operating systems that have been tested and confirmed to work, as far as building Haiku is concerned. If your operating system exhibits weird building-related problems, we would appreciate that you report these issues - or better yet, deal with them yourself and send them in, since that would massively help us and other people interested in developing on that operating system. The latter also applies if your operating system cannot be currently used to build Haiku.

Installing Jam

Haiku uses a custom version of Jam which needs to be built from sources. It is not possible to use the Jam version that may be packaged with Linux distributions, which is missing several features added by Haiku developers.

Haiku’s version of jam lives inside the buildtools repository. If you need to, see this page on Getting Haiku Source Code.

cd  /path/haiku/buildtools/jam/
make
<jam-install-command>

Note, you may need to use gmake instead of make on BSD systems.

<jam-install-command>

To install jam you can use one of two commands: The first requires administrative privilege, as jam will be installed to ‘/usr/local/bin/’

  • sudo ./jam0 install
  • ./jam0 -sBINDIR=$HOME/bin install

Is my platform supported for building Haiku?

Below are common build platforms and their statuses. This is not meant as a complete list, and the build specifics might change with new versions of those platforms. Further below you’ll find more specific help on how to set up the build.

Note that in addition to all the platform-specific packages, you will also need to install Haiku’s custom version of Jam.

Platform Package Manager Supported Notes
Haiku pkgman YES Easiest
ArchLinux pacman YES
CentOS rpm/yum YES
Debian deb/apt YES
Fedora rpm/dnf YES
FreeBSD packages YES Not frequently tested
Gentoo Portage YES
Linux Mint deb/apt YES
NetBSD packages MAYBE? Untested.
openSUSE rpm/zypper YES
RedHat Linux rpm/yum YES
Rocky Linux rpm/yum YES
Ubuntu deb/apt YES
BeOS pkg NO Once upon a time…
macOS Homebrew MAYBE Need a working case sensitive filesystem
Solaris solaris NO Once upon a time…
Windows see notes USING WSL Using Windows Subsystem for Linux
Zeta pkg NO Once upon a time…

pkgman pkgman (Haiku package system)

Basic requirements:

pkgman install cmd:python3 cmd:xorriso devel:libzstd

Additional requirements for building ARM versions of Haiku:

pkgman install dtc

APT APT (Linux distributions such as Debian, Ubuntu, Mint…)

Basic requirements:

sudo apt install git nasm bc autoconf automake texinfo flex bison gawk build-essential unzip wget zip less zlib1g-dev libzstd-dev xorriso libtool gcc-multilib python3

Additional requirements for building ARM versions of Haiku:

sudo apt-get install u-boot-tools util-linux device-tree-compiler

pacman pacman (ArchLinux)

Basic requirements:

sudo pacman -S base-devel multilib-devel bison git texinfo nasm openssh unzip zstd curl wget flex xorriso python lib32-glibc bc

Additional requirements for building ARM versions of Haiku:

sudo pacman -S paru uboot-tools

yum RPM-based GNU/Linux Distributions using yum (Fedora, CentOS…)

Basic requirements:

sudo yum install git nasm autoconf automake texinfo flex bison gcc gcc-c++ make glibc-devel zlib-devel zstd-devel xorriso curl-devel byacc libstdc++-static glibc-devel.i686 libstdc++-devel.i686 libstdc++-devel python36

Additional requirements for building ARM versions of Haiku:

sudo yum install libfdt

zypper RPM-based GNU/Linux Distribution using zypper (openSUSE, SLES)

Basic requirements:

sudo zypper install git nasm autoconf automake texinfo flex bison gcc-c++ make glibc-devel zlib-devel zstd-devel curl-devel xorriso python3

gentoo Portage based GNU/Linux Distribution (Gentoo)

Basic requirements:

sudo emerge -av dev-vcs/git autoconf automake texinfo flex bison gawk tar sys-libs/zlib app-arch/zstd libisoburn wget nasm net-misc/curl

Additional requirements for building ARM versions of Haiku:

sudo emerge -av u-boot-tools util-linux dtc

freebsd FreeBSD

Basic requirements:

pkg install devel/bison devel/git devel/nasm lang/gawk print/texinfo sysutils/xorriso ftp/curl ftp/wget sysutils/u-boot-tools sysutils/linuxfdisk lang/python lang/gcc devel/gmake

The configure script has to be run with extra enviroment variables to tell it the location of gcc-ranlib and gcc-ar, for example:

$ NM=gcc-nm9 RANLIB=gcc-ranlib9 AR=gcc-ar9 ./configure --cross-tools-source ../buildtools/ --build-cross-tools x86_64

macos macOS

A case-sensitive file system is required to build Haiku. You can use Disk Utility to create a case-sensitive disk image and store the Haiku source tree on that. Case-sensitive HFS+ works fine.

First install Xcode via xcode-select --install and accept the license. xcodebuild -license

Once you have installed XCode and the command line tools as well as agreed to the end user license you can install the prerequisite software either by using MacPorts or by using Homebrew.

To install the prerequisite software using Homebrew:

  1. Install Homebrew using the ruby command line installer provided on the linked page.
  2. Next install the prerequisite software to build Haiku using the following command via brew install autoconf zstd xorriso gawk wget nasm less mpfr gmp libmpc bison
  3. Force using the newer bison version. brew link bison --force
    • Note that Homebrew may refuse to shadow the built-in version of bison. If so, follow the instructions so that a new version of bison is in your $PATH

Note: You’ll need to install gnu less from the dupes repository as macOS comes with BSD less while Haiku requires GNU less.

To install the prerequisite software using Macports do the following:

  1. Install MacPorts (A standard Installer package is provided).
  2. Close your Terminal, open a new one and type sudo port install autoconf zstd xorriso gawk wget nasm less mpfr gmp libmpc bison

If you get an error “port: command not found”, the MacPorts shell configuration, stored in ~/.profile, is probably not taken into account. If you’re using Bash, you probably have a ~/.bash_profile or ~/.bash_login file, preventing bash to read ~/.profile. Check the file used by Bash (in the mentioned order) and add these lines to the used file:

export PATH=/opt/local/bin:$PATH
export MANPATH=$MANPATH:/opt/local/share/man
export INFOPATH=$INFOPATH:/opt/local/share/info

If you are using another shell, take a look a the shell documentation to see which file is parsed at login, and add the required commands. You can now retry the port install… command in a new Terminal.

Note: the ARM port is not yet supported for macOS, MacPorts is missing sfdisk at least.

windows Windows

Warning
Windows is not maintained as a development environment.

It is possible to install Windows Subsystem for Linux and follow the instructions for the appropriate Linux distribution (for example, Ubuntu is available this way in the Windows store).

beos BeOS & Zeta

Warning
BeOS and Zeta are no longer maintained or supported.

solaris Solaris

Warning
Solaris is not maintained as a development environment. These instructions are dependent on community contributions.

Linux remarks - xattr

Building Haiku correctly currently requires proper xattr support on the file system you compile it with. Unfortunately, the ext4 filesystem often used with Linux does not provide sufficient support. It is recommended to use either XFS or btrfs for the partition where your generated directory is stored. There is a fallback mechanism that is used otherwise, but the build will be slower.

In order to use xattr support, some distributions may need “attr” and “attr-dev” installed. See Configure Option : --use-xattr