Checking xlc compiler version

Hi,

Below is output of lslpp command.

bash-3.00# lslpp -L | grep xlC
  xlC.aix50.rte             11.1.0.1    C     F    XL C/C++ Runtime for AIX 5.3
  xlC.cpp                    9.0.0.0    C     F    C for AIX Preprocessor
  xlC.msg.en_US.cpp          9.0.0.0    C     F    C for AIX Preprocessor
  xlC.msg.en_US.rte         11.1.0.1    C     F    XL C/C++ Runtime
  xlC.rte                   11.1.0.1    C     F    XL C/C++ Runtime

how to check xlc compiler version using command line? example gcc --version

though it is showing in installed state, how to verify it using command line?

Honestly, i don't quite get it. lslpp is the common method to get version information in AIX an it works already from the command line.

I might be slow, but i don't get this either. Of course you can only obtain a version information if the compiler is installed (the packages shown in your example aren't the compiler at all, just the runtimes).

I hope this helps.

bakunin

As Bakunin stated, your lslpp output does not include the IBM C compiler. Those are the levels of the rte (run-time-environment) aka libC et al. That would probably be vaccp.*

To specifically answer you question: once installed -

cc -qversion

Displays the version and release of the compiler being invoked.
cc can also be xlc, xlc_r, etc.

Quick/short man page

cc

In other words, just cc with no arguments.

=== update === from the compiler reference (PDF)
Syntax

cc -qversion

For more details, see Example 1.
or

cc -qversion=verbose

For more details, see Example 2.

Defaults
-qnoversion
Parameters
verbose
Additionally displays information about the version, release, and level of each
compiler component installed.
Usage
When you specify -qversion, the compiler displays the version information and
exits; compilation is stopped. If you want to save this information to the output
object file, you can do so with the -qsaveopt -c options.
-qversion specified without the verbose suboption shows compiler information in
the format:
product_nameVersion: VV.RR.MMMM.LLLL
where:
V Represents the version.
R Represents the release.
M Represents the modification.
L Represents the level.
For more details, see Example 1.
-qversion=verbose shows component information in the following format:
component_name Version: VV.RR(product_name) Level: component_level
where:
component_name
Specifies an installed component, such as the low-level optimizer.
component_level
Represents the level of the installed component.
For more details, see Example 2.
Predefined macros
None.

Examples

Example 1:
IBM XL C for AIX, V12.1
Version: 12.01.0000.0001
Example 2:
IBM XL C for AIX, V12.1
Version: 12.01.0000.0001
Driver Version: 12.01(C) Level: 060414
C Front End Version: 12.01(C) Level: 060419
High Level Optimizer Version: 12.01(C) and 14.01(Fortran) Level: 060411
Low Level Optimizer Version: 12.01(C) and 14.01(Fortran) Level: 060418