Posted by: Anil | December 22, 2007

How to compile with Sun Studio

Sun Studio is Sun’s compiler and when used in building Solaris binaries, can increase performance of these applications. You can use some of the tips here to compile your own software on your Entic.net’s v.DS server.

Here is our environment before we start the build.

INSTALLDIR=/usr/local
LDFLAGS="-L$INSTALLDIR/lib -L/usr/sfw/lib -lsendfile -R/usr/sfw/lib"
PATH=/opt/SUNWspro/bin:/usr/ccs/bin:/usr/sbin:/usr/bin:
DMAKE_MODE=parallel
DMAKE_MAX_JOBS=8
CFLAGS="-fast -xipo -xtarget=opteron"
CC="/opt/SUNWspro/bin/cc"
CXX="/opt/SUNWspro/bin/CC"
export PATH CFLAGS DMAKE_MAX_JOBS DMAKE_MODE CC CXX INSTALLDIR LDFLAGS

Ignore some of those variables that seem out of place. Here’s how we’ve done a recent compile of Dovecot IMAP software after we’ve brought in those environment variables.

# make distclean; make clean
# ./configure --prefix=/usr/local/dovecot --with-ldap --without-pop3d --with-sqlite --without-gssapi --disable-ipv6 --without-docs
# dmake
# dmake install

dmake is the make that comes with Sun Studio. Using dmake is significantly faster at building than using GNU make, it runs the compile in parallel.
Thats it! The whole compile took less than two minutes to finish on our Quad core server. Let us know if you have problems compiling using Sun Studio, we can help!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: