Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


You need an illumos-based operating system to build illumos (cross-compilation is not supported). If you don't have one installed, the quickest way to get started is to download and install either OpenIndiana from or OmniOS from . You may use a virtual machine – compilation performance may suffer, but it is functional. Some other distributions support self-hosting, including compilation of illumos-gate, as well. If you have an existing system with OpenSolaris installed, see Updating OpenSolaris to OpenIndiana.

Note: All commands in this guide assume you run them as an unprivileged user. sudo will be prepended to commands which need additional privileges; on some systems pfexec can be used instead, if your user has the correct RBAC profiles. The generic commands below use a $USER variable to define the current (unprivileged) user account's name which will ultimately be used to compile the project. If you are not using a stock shell or have manipulated the $USER variable in your environment at a site, system, or user level, you are responsible for diagnosing and addressing any consequences.


You need to install several packages in order to build illumos.

  • On OpenIndiana (the dev variant), these are:
Code Block
titleShell: Installation of packaged dependencies for build
sudo pkg install -v \
 pkg:/data/docbook \
 pkg:/developer/astdev \
 pkg:/developer/build/make \
 pkg:/developer/build/onbld \
 pkg:/developer/illumos-gcc \
 pkg:/developer/gnu-binutils \
 pkg:/developer/opensolaris/osnet \
 pkg:/developer/java/jdk \
 pkg:/developer/lexer/flex \
 pkg:/developer/object-file \
 pkg:/developer/parser/bison \
 pkg:/developer/versioning/git \
 pkg:/developer/library/lint \
 pkg:/library/glib2 \
 pkg:/library/libxml2 \
 pkg:/library/libxslt \
 pkg:/library/nspr/header-nspr \
 pkg:/library/perl-5/xml-parser \
 pkg:/library/security/trousers \
 pkg:/print/cups \
 pkg:/print/filter/ghostscript \
 pkg:/runtime/perl-510 \
 pkg:/runtime/perl-510/extra \
 pkg:/runtime/perl-510/module/sun-solaris \
 pkg:/system/library/math/header-math \
 pkg:/system/library/install \
 pkg:/system/library/dbus \
 pkg:/system/library/libdbus \
 pkg:/system/library/libdbus-glib \
 pkg:/system/library/mozilla-nss/header-nss \
 pkg:/system/header \
 pkg:/system/management/product-registry \
 pkg:/system/management/snmp/net-snmp \
 pkg:/text/gnu-gettext \
 pkg:/library/python-2/python-extra-26 \
 pkg:/web/server/apache-22 \
  • On OpenIndiana Hipster, it is encapsulated in a single (meta)package:it's enough to install build-essential meta-package
Code Block
sudo pkg install build-essential


Note that the compiler for building illumos-gate installs into /opt/gcc/4.4.4 on OpenIndiana, and /opt/gcc-4.4.4 on OmniOS and is not available in the default PATH for building application programs. You can add (OI example) PATH="/opt/gcc/4.4.4/bin:$PATH"; export PATH to your profile to reference this compiler, or install one of the other GCC builds, destined as the current default compiler for application programs (versions ranging from 3.4.3 to 4.6.x, see pkg info -r '*gcc*' for details du-jour).

Unfortunately, Sun Studio dmake (Distributed Make) and lint are Studio lint is currently required even for GCC-only builds. OmniOS includes this in its sunstudio12.1 package.  We currently deliver Lint libraries built using the closed Sun Studio version of lint.  The lint from the unpatched (but redistributable) version of Sun Studio 12.1 in the repository can be used, regardless of its utility for actually checking the software.

For OpenIndiana, you should run:




OmniOS includes this in its sunstudio12.1 package.  On OpenIndiana it's delivered as part of developer/sunstudio12u1/cc, which you shouldn't install explicitly if you've already installed build-essential.

Sun Studio compilers

If you wish to build with Sun Studio, you need specifically patched versions of both Studio 12 (used to compile) and 12.1 (used for lint) to get consistent results. These are no longer distributed by Oracle and can not be legally found in the open Internet. If you do not have access to these versions, skip this section and use GCC. NOTE that OmniOS will not support builds with Sun Studio.


Code Block
sudo pkg uninstall \
    pkg:/developer/sunstudio12u1* \
    pkg:/developer/sunstudioexpress \
    pkg:/sunstudioexpress \

sudo mkdir -p /opt/SUNWspro
cd /opt/SUNWspro
sudo tar xjf /tmp/sunstudio12-patched-ii-2009Sep-sol-x86.tar.bz2
sudo tar xzf /tmp/sunstudio12u1-patched-ii-2010Feb-sol-x86.tar.gz


NOTE: OmniOS r151016 or later and OpenIndiana users have these tarballs installed in /opt/onbld/closed, and ON_CLOSED_BINS can be set to point to this directory directly.


ImportantONNV_BUILDNUM specifies the build number which is used in packaging. If you intend to upgrade a system whose build number is greater than the one in illumos-gate (currently 148), such as OpenIndiana, OmniOS you need to specify this to allow upgrades until issue #1118 is addressed. Run:


Code Block
export ONNV_BUILDNUM=152

to the script.

On OpenIndiana you'll likely see something like 'Branch: 2017.0.0.16790'. You have to use PKGVERS_BRANCH to overwrite this value, you can't use ONNV_BUILDNUM for this purpose. You should set PKGVERS_BRANCH in a form of YEAR.MAJOR.0.0 , where YEAR is the current ear and MAJOR is more that the one used by OpenIndiana. For example:  

Code Block
export PKGVERS_BRANCH=2017.3.0.0

Building with only GCC-4.4.4-il (i.e. without using Sun Studio at all)


If you need to also compile IPP and SMB printing, you must provide the Apache, Apr/Apr-util for IPP or CUPS headers for SMB printing.




To build illumos-gate on OpenIndiana Hipster , you'll have to customize in the following way:

Code Block
titleOpenIndiana Hipster mods
# Set version which is greater than current OpenIndiana Hipster build numbers, ONNV_BUILDNUM is ignored if PKGVERS_BRANCH is set:
export PKGVERS_BRANCH=20162017.3.0.0 

# Set to current perl version
export PERL_VERSION="5.22"
export PERL_PKGVERS="-522"

# If you are building on the latest OpenIndiana Hipster (2017-03-07 and later)
export BLD_JAVA_8=


Code Block
./ -i

Fixing the closed binaries for GCC-4.4.4-il

According to 2012-06-15 Illumos will now build with GCC 4.4.4 + patches the closed binaries should be fixed for compilation of illumos-gate with the newer gcc-4.4.4-il compiler. However, several developers stated that they've never needed to do this for current versions of illumos-gate (as of March 2014).

Just in case, the command to run is:

Code Block
cd /code/illumos-gate && \
   cd closed && find . -type f | grep '/kernel/' | grep -v '\.conf' | \
   while read F; do echo "=== $F" && mcs -d -n .SUNW_ctf "$F"; done


Ensuring a build with only GCC-4.4.4-il for older branches of illumos


Cure: Builders must either set JAVA_ROOT to an installation location of JDK7, or must have /usr/java populated with JDK7 (or pointing to an installation location of JDK7). You can use whatever distribution of JDK7+ works for you best (packages or tarballs, OpenJDK or Sun/Oracle JDK).

If you are on the latest OI HipsterOpenIndiana, you want to install runtime/java/openjdk8 and developer/java/openjdk8 packages. Then in your env file, set: