Building sysdig on x86 based Solaris 11.1 - draios/sysdig GitHub Wiki

The following instructions are to build the userspace side of sysdig on SunOS solaris 5.11 (11.1) i86pc. We use the GNU build chain (ie., gmake, g++ and friends).

Notes: sysdig does not have any kernel modules available for SunOS at the time of this writing. The product that will be compiled below is limited to analyzing scap files created on other systems.

  • Goal: Userspace sysdig application.
  • Operating System: Intel-based Solaris 5.11.
  • Duration: 20 minutes ~ 2 hours depending on network and system speed.

Building

Install g++ 4.8 or greater

g++ 4.5 which is offered at the time of this authorship through the official solaris repositories (April 7, 2014) does not support some of the C++11 styles in sysdig's userspace code. Thus, you'll need a newer version of g++ (4.8 is known to work).

Add and configure the OpenCSW repository

g++ 4.8 can be installed through the OpenCSW repository with the pkgutil program. You can use the getting started guide on the OpenCSW site to find out how to install and configure the OpenCSW repository.

As of this writing, g++ 4.8 can be found in the "unstable" branch (how to specify this branch is discussed in the instructions linked to above). Check the current list of packages to see the latest g++ offerings.

Install g++ 4.8

After following the instructions above, execute

# pkgutil -i gcc4g++

And answer the prompts to your liking (I answered 'y' to all of them).

Tell Cmake to use OpenCSW's g++

Note: If you had already tried to build sysdig prior to reading this and failed, make sure to clean out your build directory with an rm -fr * inside the build directory prior to continuing (or create a new build directory if you aren't comfortable issuing that command).

Go to the base sysdig source directory (the directories and files should look similar to the file listings here) and make a build directory:

~/sysdig:$ mkdir build 
~/sysdig/build:$ cd build

In order to use the newer OpenCSW g++, modify your path on the command line, prior to the cmake command, like so:

~/sysdig/build:$ PATH=/opt/csw/bin:$PATH cmake ..
...
-- Check for working CXX compiler: /opt/csw/bin/c++
-- Check for working CXX compiler: /opt/csw/bin/c++ -- works
...

Notice how our output tells us that that Cmake is going to correctly be using the c++ compiler in the /opt/csw/bin/ path as opposed to the incorrect one in /usr/bin.

Build the userspace sysdig

Now, we cross all of our fingers, put on our lucky pink feather boa, and run make:

~/sysdig/build:$ make

You may get a few embarrassing warnings, but it's all going to be ok. I assure you.

Smoketest it

After all is done you should be able to run

~/sysdig/build:$ ./userspace/sysdig/sysdig -l

And have it run. Yes! we win again! Feel free to run a sudo make install if desired.