Installation of Studio Compiler in Solaris 11 Express

Guest Author

I am testing with Solaris 11 Express and many times, I've run into situation that I need a compiler on it. I thought testing the latest Oracle Solaris studio compiler on s11ex would be a good idea.

One of the important features of Solaris 11 is IPS (Image Packaging System) which will streamline installation of packages. When everything is ready, installation of compiler will use IPS, but as of now IPS package for the whole compiler is not ready yet. What is described here is based on Kuldip's blog here but uses pkgadd command along with some additional system package installation using IPS.

  1. Download Studio compiler from OTN (Oracle Technology Network) page.
    Choose Solaris 10 (SPARC or x86) package installer (not tar file). It
    requires root access to the system, but most of the case compiler
    installer should have root access. The latest release now is 12.2; if
    you need earlier version of Studio compiler, go to the bottom of the
    page and find 'Previous Releases' link.
  2. Become root; untar the file; cd into the untarred directory.
  3. Make a temporary directory and extract package files (SUNW*) into the temp directory:

    # mkdir temp

    # ./SolarisStudio12.2-solaris-x86-pkg-ML.sh --non-interactive --extract-installation-data temp
  4. Install the packages with pkgadd command:

    # cd temp

    # for i in SPRO*;

    > do pkgadd -d $i

    > done
    [Accept default and y to all input]

This will install all necessary compiler packages. But these compiler packages depend on system packages, and there are some important packages missing from base Solaris 11 Express distribution, such as one installed from S11Ex CD. User need to add those packages using IPS pkg command. One important example of missing OS component is system header files, such as /usr/include/stdio.h. So, even after finish of compiler installation, you would not be able to compile the most basic hello program if it includes the header file, stdio.h.

Here is the list of all Solaris packages (in IPS terminology) on which Studio 12.2 compiler is dependent:

  • system/header (*)
  • system/library/math
  • system/library/c++/sunpro
  • system/library/math/header-math (*)
  • developer/macro/cpp
  • developer/linker
  • developer/build/make
  • developer/java/jdk (*)
  • developer/library/lint (*)

Of these, ones with (*) should be installed additionally, and here's how:

# pkg info system/header

   will tell you are missing the package and advise to look for remote repository with -r option

# pkg info -r system/header

    will show the remote repository info

# pkg install system/header

    will install from remote repository of above.

# pkg info system/header

    verify installation, and repeat for all necessary packages.

After installation, symbolic link will have been created under /usr/bin for some compiler binaries such as : cc, CC, dem, cscope, link, soltudio, sunstudio

yet still others will not have link : f90, dbx, analyzer, collect.

So you can compile a C program without even setting the path, but if you try to compiler a Fortran program without path setting, you will get complaint. So it'll be a good idea to include /opt/solstudio12.2/bin into your PATH.

Happy compiling in new Solaris 11!

Join the discussion

Comments ( 5 )
  • Matt Fahrner Friday, June 3, 2011
    Definitely works better than the automated installer which reports that Solaris 11 Express (at least the latest version) is not supported.
  • Tom Haynes Tuesday, June 28, 2011

    Should be "–-non-interactive –-extract-installation-data".

    My system complained with the single leading '-'.

    BTW - thanks for this information!

  • Tom Haynes Tuesday, June 28, 2011

    Just saw this on my WordPress blog, you probably want to enclose those in a code tag.

  • fred Jewell Thursday, October 13, 2011

    2 things.

    First this is brilliant and a huge Thank YOU! I have been trying to install this package now for 8 hours.

    Second the invocation of the script requires 2 -- I believe the typesetting program that printed this page made them an "M" dash so if you're lazy like me and cut and paste the line it fails. I went into the script and figured out it needed two "--". Here is what it should be:

    # ./SolarisStudio12.2-solaris-x86-pkg-ML.sh --non-interactive --extract-installation-data temp

  • guest Thursday, October 20, 2011

    Hello, Younseo,

    Thank you for your help and effort on this. I was completely stumped until I found your blog. Just a few suggestions:

    On my fresh install of Solaris 11 Express I had to use the following double dashes (instead of single):

    ./SolarisStudio12.2-solaris-x86-pkg-ML.sh ––non-interactive ––extract-installation-data temp

    instead of:

    ... –non-interactive –extract-installation-data ..

    And the shell interpreter gives me an ">" when I run:

    # cd temp

    # for i in SPRO*;

    > do pkgadd -d $i

    > done

    Which I assume is correct.

    I haven't used Sun Studio is quite some time, but I remember it being very impressive. I'm hoping to "decompile" a few install scripts (the usual, ".install.sh", etc.) and see where things are going wrong.

    Keep up the good work!

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.