Monday, November 5, 2012

C++ remote build host

This is one of the coolest features present in Oracle Solaris Studio 12.3 and NetBeans 6.9.
The term Remote Development seems usual, but I prefer the clearer Remote Build Host.
In a remote building scenario two separate hosts have the following activities (roles):

  • Coding   : A desktop or a laptop with a full-blown GUI IDE.
  • Building : A very powerful and efficient server with no GUI.
  
The remote building also supports running and debugging on mixed platforms.
Of course, this implies portable C/C++ coding.
For the sake of sanity I'll stick to, Solaris!

Depending on the setup, where the C/C++source files are kept, 3 modes are supported:

  • Simple   : At the local coding host.
  • Mixed    : On shared storage, such as NFS.
  • Full     : On the remote build host.
   

Thursday, November 1, 2012

C++ stability & evolution

I love the C++ language since the beginning.
For me it all begins with BASIC, then Pascal, then C, then Object Pascal and finally C++.
On this blog I intend to share my experience with Oracle Solaris Studio 12.3.
I do not intend to write about C++, at least not on this blog.
  
What all this had to do with Solaris after all?
Well, C has everything to do with UNIX™ and Solaris is UNIX™ for the best.
I've never looked at any Solaris source code but for the most part it must be purely C.
At the same time a lot of C++ code should out there, despite Java.
  
Solaris is recognized by its ABI stability, a practical and important aspect to business.
This ABI stability may represent a key foundation and that's why it may be a critical factor.
See Stephen Clamage's Stability of the C++ ABI: Evolution of a Programming Language.
   
Nevertheless, a new C++ standard has finally emerged, know as C++11.
The language's author, Bjarne Stroustrup, still like the former designation, C++0x.
The new standard,  ISO/IEC 14882:2011, is at ISO and a draft is available for free.
As projected there are modifications that may affect ABI implementations.
   
Bjarne's C++11 FAQ is a must reading for everyone using the old C++03 standard.
Current compilers, such as Oracle Solaris Studio 12.3, fully support only the old standard.
For me it seems inevitable that in the next couple of years things will have to change.
But I don't believe Solaris will break its 20 yeares ABI backwards compatibility.
I do hope that this major breakthrough is carefully handled.
     

Thursday, October 25, 2012

Solaris 11.1 availability

Today is a great day!
Solaris 11.1 is available for downloading!
 
The new update continues raising the bar.
Tremendous enhancements and new features.
Oracle is definitely sustaining Solaris as the best UNIX™ ever.
  
Once more, since the beginning of this blog I can say:
If it must run, it runs on Solaris!
    
For the record, coincidence or not, Windows 8 became available today as well.
Unfortunately I didn't feel inclined to its new interface for desktop computing.
But that's another story that fortunately has nothing to do with Solaris.
 

Solaris 10 parallel zone patching

By a zoned Solaris 10 system I mean the existence of many non-global zones (NGZ).
There's perhaps a less known tunning that allows for parallel updating of multiple zones.
     
The num_proc setting is at /etc/patch/pdo.conf and described at pdo.conf(4).
The recommendation is to have num_proc equal to the on-line CPUs.
  
Thus, on a system with 4 online CPUs:
  
# psrinfo
0       on-line   since 10/18/2012 06:28:18
1       on-line   since 10/18/2012 06:28:18
2       on-line   since 10/18/2012 06:28:18
3       on-line   since 10/18/2012 06:28:18
 
A setting of 4 is recommended:
 
# cp -p /etc/patch/pdo.conf{,.0}
# vim /etc/patch/pdo.conf
# grep num_proc= /etc/patch/pdo.conf

# num_proc=
# num_proc=1 # default entry
num_proc=4
    

Wednesday, October 3, 2012

Unattended SVr4 package install

SVr4 relocatable and non-relocatable packages add/removal can be fully automated.
This is accomplished by CLI options for response and administration files.
For simplicity, assume /pkg/out as the current directory on all that follows.
   
# cd /pkg/out
    
A response file is required if the package uses an interactive request script.
If so, the pkgask command is used to record all the answers in this file.
That's the case with my sample relocatable package PHXapp1.
    
# pkgask -r ./PHXapp1.response -d ./PHXapp1.pkg PHXapp1 all
Processing package instance <PHXapp1> from </pkg/out/PHXapp1.pkg>
Relocatable sample package(i386,sparc) 1.0
Copyright (c) 2012 ...
Enter path to package base directory (q to quit) [/opt/PHXapp1] <ENTER>
Response file </pkg/out/PHXapp1.response> was created.
Processing of request script was successful.
   
# cat PHXapp1.response
BASEDIR=/opt/PHXapp1
   
Otherwise the following error message appears explaining the situation.
That's the case for my sample non-relocatable SMF service package PHXsvc1:
   
# pkgask -r ./PHXsvc1.response -d ./PHXsvc1.pkg PHXsvc1
pkgask: ERROR: ... does not contain an interactive request script
      
In general an administration file, admin(4), is required.
This is specially required if the package contains or references other scripts.
Basically and at a minimum, the following entries seem enough:
   
# cat PHX.admin
setuid=nocheck
action=nocheck
  
The above files make unattended package operations possible.

Option -r is for specifying the response file to pkgadd.
Option -a is for specifying the administration file to both pkgadd and pkgrm.
Optionally, the listing of the package contents can be omitted with option -n.

For the sample non-relocatable SMF service package PHXsvc1 it looks like:

# pkgadd -n -a ./PHX.admin -d ./PHXsvc1.pkg all
Copyright (c) 2012 ...
Installation of <PHXsvc1> was successful.

# pkgrm -n -a ./PHX.admin PHXsvc1
Waiting up to 30 seconds for svc:/site/phx-svc:default to stop...
Removal of <PHXsvc1> was successful.

For the sample relocatable application package PHXapp1 it looks like:

# pkgadd
  -n
  -a ./PHX.admin
  -r ./PHXapp1.response
  -d ./PHXapp1.pkg
  all
Copyright (c) 2012 ... 
Installation of <PHXapp1> was successful.

# pkgrm -n -a ./PHX.admin PHXapp1
Removing package base directory.
Removal of <PHXapp1> was successful.