Paul Hinker's Weblog
Thursday Aug 21, 2008
Building open source apps with Studio Express (July 08) on OpenSolaris
I recently installed the latest openSolaris distribution on my home machine so that I could chase an issue a user was having. The first thing I was struck by was the ease of installation and configuration when compared with traditional Solaris. I downloaded the openSolaris LiveCD, burned it to a DVD (although it fits on a CD) and fired it up. The mini-kernel that comes up recognized the external USB drive I had attached and I was able to install onto it. The first thing I tried was to install the OS on a USB thumb drive. While the mini-root recognized a pre-formatted USB thumb drive, the installation seemed to hang during the 'Initializing Drive for installation' step.The installation from the LiveCD is fairly bare bones so the first thing you'll want to do is install some of the development packages. Since I'm interested in the Sun Studio tools, I downloaded the Sun Studio Development cluster.
myhost% pkg install ss-dev
This will install the packages in the /opt/SUNWspro tree so you'll need to adjust your paths to find the compilers. Alternatively, you can use the pfexec command to install the software in alternate places.
This takes a bit of time since there's a little north of 500 Mb in the package but it's all good stuff.
There's been some recent internal interest in the GLPK (GNU Linear Programming Kit) package so I grabbed that to see if it would compile out-of-the-box. Like so many of these open source packages, GLPK depends on something else. In this case, GMP (GNU MP Library) is required so I pulled that over as well.
The GMP source distribution includes the usual configure script which can be modified with the usual list of environment variables. Here are the ones I set before running configure :
myhost% CC="cc -m64" ; export CC myhost% CXX="CC -m64" ; export CXX myhost% F77="f90 -m64" ; export F77 myhost% CFLAGS="-xO3" ; export CFLAGS myhost% CXXFLAGS="-fast" ; export CXXFLAGS myhost% FFLAGS="-fast" ; export FFLAGS myhost% LDFLAGS="-L/usr/lib -R/usr/lib" myhost% configure --prefix /usr myhost% make myhost% make check myhost% make installIf you follow the same steps you'll get warnings from gmp-impl.h about unknown attributes but the compile completes successfully and the tests run correctly. The above will build the GMP libraries for 64-bit addressing. I install the libraries in /usr/lib since other configure scripts usually look there for installed libraries.
Now on to the glpk directory. The same environment variables work fine for configuring GLPK so once the source is un-tarred :
myhost% configure --prefix /usr myhost% make myhost% make check myhost% make installDuring the configure you'll notice that the gmp library is discovered and paths are set up to link it in during the GLPK build.
I did find a C compiler issue during the building of GMP (which explains the -xO3 instead of more aggressive optimization like -fast) so this was a useful exercise. Later I'll go through the building of SuiteSparse (University of Florida's Tim Davis' sparse package), Xerces-C, Cryptopp, and Octave 3.0.1. Some of which need a little more hand holding during the configure and build.
Posted at 02:36PM Aug 21, 2008 by hinkthink in General | Comments[2]


Did you try compiling R?
http://www.r-project.org/
Posted by Scott on August 21, 2008 at 07:28 PM MDT #
Hi, Scott.
Yes, R is one of the projects I'll detail in later entries. It requires some additional package to be present (readline, iconv, etc.) and so it will be addressed when some of the others have been put in place. Thanks for the comment.
Posted by Paul Hinker on August 25, 2008 at 09:45 AM MDT #