OpenSolaris: HowTo Install Sun Studio + Common Build Environment (CBE)

Few steps to install Sun Studio and Common Build Environment on OpenSolaris box.

Those little steps will explain how to install Sun Studio and Common Build Environment on top of OpenSolaris 2008.05. Please note that some of those instructions normally should be different, but little bugs, which currently exists caused need for those changes in this tutorial.

Why you will need this?
The Sun Studio together with CBE will allow to build lot's and lot's of new packages/software to your lovely OpenSolaris and if you have a little knowledge you might want to create your own packages and share them with other people!

What you will need?
1. Internet Access.
2. Few cups of coffe/tee, since this will take a while, depending on your connection speed.
3. Good mood, as this was tested Today and may be different in couple of weeks, so if something will break don't panic! You have ZFS snapshots, so you will not break your system :-)

I) UPDATING YOUR SYSTEM
First you need to fully update your OpenSolaris 2008.05. Without this, probably things will not work, so to fully update your system please follow those steps as standard user:

$ pfexec pkg refresh

After this step you should follow those commands (as shown on below picture):

$ export PKG_CLIENT_TIMEOUT=300

Updated:
$ pfexec pkg install SUNWipkg

$ pfexec pkg image-update

The below steps are related to the bug described HERE and MUST be done, otherwise you will NOT be able to boot to the updated OpenSolaris.

$ pfexec mount -F zfs rpool/ROOT/opensolaris-1 /mnt

$ pfexec /mnt/boot/solaris/bin/update_grub -R /mnt

$ pfexec reboot

The below screenshot, shows the actual steps. The black-marked commands are the ones which you should type (before this please remember to type pkg refresh) :)

II) INSTALLING REQUIRED PACKAGES

Those steps will install all required packages

$ export PKG_CLIENT_TIMEOUT=300

$ pfexec pkg install SUNWcvs SUNWsvn SUNWarc SUNWj6dmo \\
SUNWj6dev SUNWj6dmx SUNWj6dvx SUNWj6cfg SUNWj6rtx \\
SUNWj6man SUNWgnu-automake-19 SUNWgnu-automake-110 \\
SUNWaconf SUNWmercurial SUNWlibtool ss-dev SUNWsfwhea \\
SUNWhea SUNWxwinc SUNWxorg-headers SUNWi2cs SUNWgpch \\
SUNWgnome-common-devel SUNWgmake SUNWbison SUNWflexlex

The below picture is actual screenshot from the above operation:

III) INSTALLING COMMON BUILD ENVIRONMENT (CBE)
The first thing you need to do is to add the "Software Installation" profile for your user, to do so, please follow the commands, replacing USERNAME with your actual username:

$ su

$ usermod -P "Software Installation,Primary Administrator" \\
USERNAME

Secondly you need to get CBE sources from HERE.
Then unpack:

$ bunzip jds-cbe-1.6.0-i386.tar.bz2

$ tar -xvf jds-cbe-1.6.0-i386.tar

Now you need to apply one small, so please download it and place in the directory one level up from jds-cbe-1.6.0 directory, so simply stay in the directory where you have been unpacking jds-cbe-1.6.0-i386.tar.bz2.
To apply this patch, please type the following command:

$ patch -p0 < cbe-install.diff

If this will not work, you can download patched cbe-install script and replace the one from the jds-cbe-1.6.0 directory.

Now just go to the jds-cbe-1.6.0 directory:

$ cd jds-cbe-1.6.0

and install stuff:

$ ./cbe-install

You will get few questions, so for all yes/no, please answer yes. For the question about patch to the C compiler, please type the following path:

/opt/SunStudioExpress/bin/cc

All those steps are visible on the screenshot:

That is it! If you would like to make a use of CBE, you can watch simple tutorials describing howto build some packages (especially part 2 is made for this purpose):
Create your own OpenSolaris IPS repository in a Weekend!

KNOWN PROBLEM:
If something will go wrong during installation, and you will hit similar stacktrace to the one shown below, simply add the package name to the pkg install command by hand and it should go further. This is related to bug 2229

Comments:

This is very useful. Thanks.

Posted by James on June 17, 2008 at 04:31 PM UTC #

Thank you

Posted by luca on June 19, 2008 at 12:16 PM UTC #

This is exactly what I needed. However, I got as far as the pfexec reboot. The system rebooted but hung just after the first three SunOS boot lines.

2008.05 loaded and booted off disk just fine.

This is on a HP laptop with Intel Core 2 Duo, 2GB of memory, with a 60GB+ partition for Solaris 10.

Any ideas or suggestion of another place to look?

thanks

Posted by John Pleines on June 23, 2008 at 05:29 PM UTC #

FYI, the hang appears to be related to acpi, if I either switch it off or to legacy mode the system boots successfully. Same problem/solution also exists for me for first spin of 2008.11.

Posted by John Pleines on August 01, 2008 at 02:29 PM UTC #

Hi Mic,

actually iam from the Testing Team. i have seen you blogs . its to interesting to me . i have some questions. which as of now i have not worked on the systems like IPS, IDS, security systems. i think you might be Help full for me. how the IPS testing will done if you have doc's on the please can you share me...

Thanks
Prabhu

Posted by prabhakar on August 04, 2008 at 11:24 PM UTC #

Are all the SUNW\* packages created by pkgtool ?

Posted by TJ Yang on September 04, 2008 at 12:00 AM UTC #

It seems that the Sun Performance Analyzer Actions and SS Stat components are missing but with B99 I had no issues running the commands. The respective desktop entries are also not propagated either.

Posted by James Cornell on October 16, 2008 at 07:00 AM UTC #

i have solaris 10 os installed, but i want to installed SunStudio12ml.tar.bz2 this software in that os ,
how i can ?

Posted by Amol on April 06, 2009 at 11:21 AM UTC #

"pfexec pkg refresh"

first of all im naive to opensolaris ..

now right at the very first step(command) above mentioned ..i have been stuck and no update has done.

the problem i'm facing after running the command--- "pfexec pkg refresh" ---
is :

-bash-3.2# pfexec pkg refresh
pkg: 0/4 catalogs successfully updated:
pkg.lifewithsolaris.jp: node name or service name not known
pkg.opensolaris.org: node name or service name not known
pkg.lifewithsolaris.jp: node name or service name not known
pkg.opensolaris.org: node name or service name not known

kindly help me ASAP ..
thanks ..

Posted by sourabh sharma on May 25, 2009 at 11:58 AM UTC #

Hi,
It looks like you have some network problems. Are you using proxy server?

If yes please before command type:

HTTP_PROXY=http://url.of.your.proxy pfexec pkg refresh

secondly you are using lifewithsolaris which is not working anymore. Please remove this repository from your list of repositories.

Posted by Michal Pryc on May 25, 2009 at 12:14 PM UTC #

I get below errors.
Could you help on it?

bagside@bagvapp:~/ex$ pfexec pkg image-update
Creating Plan -Traceback (most recent call last):
File "/usr/bin/pkg", line 1440, in ?
ret = main_func()
File "/usr/bin/pkg", line 1404, in main_func
return image_update(img, pargs)
File "/usr/bin/pkg", line 366, in image_update
noexecute = noexecute)
File "/usr/lib/python2.4/vendor-packages/pkg/client/image.py", line 1282, in make_install_plan
ip.evaluate()
File "/usr/lib/python2.4/vendor-packages/pkg/client/imageplan.py", line 344, in evaluate
self.evaluate_fmri(f)
File "/usr/lib/python2.4/vendor-packages/pkg/client/imageplan.py", line 187, in evaluate_fmri
m = self.image.get_manifest(pfmri)
File "/usr/lib/python2.4/vendor-packages/pkg/client/image.py", line 516, in get_manifest
m = self._fetch_manifest(fmri)
File "/usr/lib/python2.4/vendor-packages/pkg/client/image.py", line 469, in _fetch_manifest
m.set_content(mcontent)
File "/usr/lib/python2.4/vendor-packages/pkg/manifest.py", line 251, in set_content
action = actions.fromstr(l)
File "/usr/lib/python2.4/vendor-packages/pkg/actions/__init__.py", line 118, in fromstr
return fromlist(type, nlist, hash)
File "/usr/lib/python2.4/vendor-packages/pkg/actions/__init__.py", line 158, in fromlist
action = types[type](\*\*attrs)
File "/usr/lib/python2.4/vendor-packages/pkg/actions/attribute.py", line 53, in __init__
assert len(attrs) == 2
AssertionError

bagside@bagvapp:~/ex$

Posted by Ray on July 22, 2009 at 08:25 AM UTC #

It was a very nice idea! Just wanna say thank you for the information you have shared. Just continue writing this kind of post. I will be your loyal reader. Thanks again.
~

Posted by links of london jewellery on November 21, 2009 at 08:30 PM UTC #

please update this tutorial for newer version of jds-cbe-1.6.2 and opensolaris(snv_130+).

Posted by T.J. Yang on February 02, 2010 at 07:30 AM UTC #

Post a Comment:
Comments are closed for this entry.
About

migi

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today