Operating System - HP-UX
1833793 Members
2387 Online
110063 Solutions
New Discussion

Need to find out version of "C" compiler on our system

 
SOLVED
Go to solution
Joe Profaizer
Super Advisor

Need to find out version of "C" compiler on our system

Running HP-UX 11.11 on PA-RISC. A user specified the need version HP-UX ANSI C B.11.01.25171 of "C" running on our system. I can't figure out the command(s) to find out what version we're running.

Please assist.

Thanks,
9 REPLIES 9
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Need to find out version of "C" compiler on our system

Most versions need at least a dummy source file to operate on before using the "-V" option.

Do this:

echo > /var/tmp/x.c
cc -V /var/tmp/x.c

swlist can tell you as well be you also have to look at the cumulative patches so cc -V is the definitive method.
If it ain't broke, I can fix that.
Mic V.
Esteemed Contributor

Re: Need to find out version of "C" compiler on our system

This should help:

swlist | grep ANSI

"swlist" lists the software installed on the host, similar to Sun's pkginfo. If you run the above command and receive no output, either it's not installed or I've told you the wrong string (ANSI) to search for. I'm fairly sure I'm remembering correctly.

To see more info on the swlist command (there are interesting options and it will show you other software manipulation commands):

man swlist

HTH.
What kind of a name is 'Wolverine'?
Joe Profaizer
Super Advisor

Re: Need to find out version of "C" compiler on our system

cc -V didn't work nor did swlist |grep ANSI find anything. I did however:
strings /usr/bin/cc

and it listed:
HP92453-01 A.11.01.21 HP C (Bundled) Compiler

So, I presume the above is our version.
H.Merijn Brand (procura
Honored Contributor

Re: Need to find out version of "C" compiler on our system

Yes it is, and it is an almost useless compiler, only capable of rebuilding the kernel and (very) simple C programs.

Don't expect it to be able to build more advanced stuff, like GNU utilities or Perl. It just won't.

You need an ANSI compiler for that. Either the (very good, but expensive) HP C-ANSI-C, or the (free and always improving) GNU gcc

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
A. Clay Stephenson
Acclaimed Contributor

Re: Need to find out version of "C" compiler on our system

Looks like all you have is the Bundled C compiler. It is really only intended for kernel compiles and does not speak ANSI C only K&R C.

In either case, cc -V x.c (as long as you have a dummy source file) should have revealed the compiler version. You might have the C++ compiler (aCC) which also speaks ANSI C but swlist should have found it.

Do a "type aCC" to see if it is found.
If it ain't broke, I can fix that.
Joe Profaizer
Super Advisor

Re: Need to find out version of "C" compiler on our system

Procura,
So, how much $$ am I looking at here to purchase a license?
A. Clay Stephenson
Acclaimed Contributor

Re: Need to find out version of "C" compiler on our system

Go to this webpage:

http://software.hp.com/portal/swdepot/displayProductsList.do?category=DTDC

I would strongly consider using aCC rather than ANSI/C because aCC gives you C++ as well as ANSI/C -- but not K&R C. If you need to develop in ANSI and K&R C then you need ANSI/C. Most software vendors' products will work with either as long as your compiler version is >= to the version they specify.
If it ain't broke, I can fix that.
H.Merijn Brand (procura
Honored Contributor

Re: Need to find out version of "C" compiler on our system

$ 1100 for the ANSI-C, ans $1500 for aCC. In *my* opinion the aCC is not worth that much more.

I myself use C-ANCI-C and if I have to do C++, I use GNU g++, which is free (See my webpage where all my GNU gcc ports include g++)

My HP ITRC site pages can be found at (please use LA as primary choice):

USA Los Angeles http://mirrors.develooper.com/hpux/
SGP Singapore https://www.beepz.com/personal/merijn/
USA Chicago http://ww.hpux.ws/
NL Hoofddorp http://www.cmve.net/~merijn/

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Mic V.
Esteemed Contributor

Re: Need to find out version of "C" compiler on our system

Whatever the ultimate choice, I recommend something from a vendor, from whom you can buy support, rather than gcc -- particularly if you're going to support mission-critical stuff. I seem to recall paying about $2500 for ANSI C several years ago. Although gcc is lovely on other platforms, it's always given me burrs under the saddle on HP-UX (YMMV).
What kind of a name is 'Wolverine'?