To install SUN Studio on OpenIndiana, follow these steps:
sudo pkg set-publisher -g http://pkg.openindiana.org/legacy opensolaris.org
sudo pkg install pkg:/developer/sunstudio12u1
sudo mkdir -p /opt/SUNWspro
sudo ln -s /opt/sunstudio12.1 /opt/SUNWspro/sunstudio12.1

 
Source: How To Build illumos