Meet Mr. DTrace - Part 2
Web April 24th, 2007
Since OpenSolaris Express Developer Edition asks for more than 768M memory, 8G disk, what a demanding monster! I could not fit it into VMWare on my laptop 700m. Therefore, before I order a new powerful desktop, I might stick to the NexentaOS right now.
SunStudio 11 is the native compiler in Solaris so it is supposed to work with DTrace static provider. Unfortunately there is no success story to install SunStudio 11 on NexentaOS so far according to the IRC discussion, I need to find my own way to work around this problem.
SunStudio is packaged in pkgcmd format, to make things even worse, NexentaOS drops the native pkgcmd, and replace it with a wrapper for Debian package. To automation the tedious unzip, copy, chown, chmod, ln and last but not the least, dependency resolving, I develop this python script
To use this script, you need to change your work directory to the packages, then you can list the available packages:
emerge.py -l .
We only care about the SunStudio C compiler, before we emerge it, we might take a look at the dependencies:
calculating the dependency recursively ….
SUNWkvm Core Architecture, (Kvm)
SUNWhea Header files
SUNWcsu Core Solaris, (Usr)
SUNWcsr Core Solaris, (Root)
SUNWtoo Programming Tools
SPROlang Components for Sun compilers and tools
SUNWesu Extended System Utilities
SPROdwrfb Dwarf Support Library binaries
SPROcc
SUNWcar Core Architecture, (Root)
There are some packages missing, for example SUNWesu, since we are using APT package system, just ignore them, and install the package, emerge will recursively install all packages available in the current path:
This procedure includes the following steps:
- Calculate the dependencies
- Unpack ${PKG}/archieves/none to the ${BASEDIR}
- chmod, chown if necessary according to ${PKG}/pkgmap
After that, you need to add /opt/SUNWspro/bin to your ${PATH}, and compile the very first application, hello world. Oops, cc could not find stdio.h. It compiles simple C source code without library. It seems that the C Compiler is not well configured, I would figure it out later.
Have you installed the sunwhea package from Nexenta? That should provide the standard library headers.
One more thing: Most of the packages listed as a dependency can be installed by apt. The only difference is where Sun uses capitalized SUNW package names, Nexenta uses lower case sunw.