XL C/C++ Compiler

Hello, I am trying to use the IBM XL C/C++ Compiler on my AIX server. I have uised smit to install it and it appears to have been successful. When I however type XlC it tells me that I am still using my old compiler which is VisualAge C++ Professional / C for AIX Compiler, Version 5. How can I switch to the new XL C/C++ Enterprise Edition V8.0 that I have installed? If I run lslpp -l | grep xlC I get the following output:

xlC.adt.include 5.0.2.0 COMMITTED C Set ++ Application
xlC.aix43.rte 5.0.0.0 COMMITTED C Set ++ Runtime for AIX 4.3
xlC.aix50.rte 8.0.0.8 COMMITTED C Set ++ Runtime for AIX 5.0
xlC.cpp 6.0.0.0 COMMITTED C for AIX Preprocessor
xlC.msg.JA_JP.cpp 6.0.0.0 COMMITTED C for AIX Preprocessor
xlC.msg.JA_JP.rte 6.0.0.0 COMMITTED C Set ++ Runtime
xlC.msg.Ja_JP.cpp 6.0.0.0 COMMITTED C for AIX Preprocessor
xlC.msg.Ja_JP.rte 8.0.0.8 COMMITTED C Set ++ Runtime
xlC.msg.ZH_CN.cpp 6.0.0.0 COMMITTED C for AIX Preprocessor
xlC.msg.ZH_CN.rte 6.0.0.0 COMMITTED C Set ++ Runtime
xlC.msg.en_US.cpp 6.0.0.0 COMMITTED C for AIX Preprocessor
xlC.msg.en_US.rte 8.0.0.8 COMMITTED C Set ++ Runtime
xlC.msg.ja_JP.cpp 6.0.0.0 COMMITTED C for AIX Preprocessor
xlC.msg.ja_JP.rte 8.0.0.8 COMMITTED C Set ++ Runtime
xlC.rte 8.0.0.8 COMMITTED C Set ++ Runtime

~David

There are several ways to alter this behavior. Try using

which Xlc

to see which one you are using. If it is a link in /bin or /usr/bin, you can delete the link and create a new link to the location where your new executable is located. If it is located somewhere else, you can alter your PATH variable so that your new version is found before the old.

/usr/bin/xlc.

How can I change the link? How do I know where the desired executable is?

~David

Use

find / -name xlc

to show all instances of xlc on the host.

You can use

lslpp -w <filename>

to show which fileset they are a part of, if any.

Use

ls -l /usr/bin/xlc

to see if it is a link or an actual file. If it is a link, will have an arrow like ->. You can use ln -s <actual path> <link> to create a new symbolic link, but you'll need to delete the old link first. For example, if you wanted a link to /usr/trash/bin/trashit in /usr/bin, you would use

ln -s /usr/trash/bin/trashit /usr/bin/trashit