Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1028
  • Last Modified:

switch to XL C instead of GCC

I am doing compilations on oracle applications.

I run
make –f mts.mk depend 2>&1 | tee srcdpnd.log

And i get errors. One solution i was give as below,

It looks like from the “cc –v” command ran and shown in the SR, it is pointing to GCC distribution instead of XL C. With this setup, compiling...

How do I make my compilation use XL C instead of GCC?

Thanks in advance
0
dplinnane
Asked:
dplinnane
  • 6
  • 5
1 Solution
 
sjm_eeCommented:
Take a look at the file "mts.mk" which is known in such an invocation as the "makefile" which is the default name that "make" looks for. It is common practice to set the compiler by changing a variable such as "CC" in the makefile - such a setting is usually at the top the makefile. The actual name of the variable controlling the compiler depends on the rules that make is using - in the default rules, it is "CC".

Alternatively, if you cannot change the makefile but the makefile does set the value of "CC", then you can override the value from the environment by setting the variable CC or from the command line

CC="/usr/vac/bin/xlc -v" make npp

It may be more complex if the makefile contains non-default rules for builiding the executable. Try looking at the makefile and if that does not work, please post the makefile
0
 
woolmilkporcCommented:
First of all, do you have xlC installed? It's not part of the AIX distribution, but has to be purchased separately.

There is a 60-day evaluation version available here:

http://www.ibm.com/developerworks/downloads/r/xlcplusaix/?S_CMP=rnav&S_CMP=rnav

The installation will replace all the cc* links in /usr/bin, so there is n further customization required.

Switching back to gcc will require (sort of) a reinstallation then.

wmp
0
 
dplinnaneAuthor Commented:
the mts.mk file looks like this. I don't see any CC in there. What should I add here? Has it got anything to do with adding the path to xLC  in the PATH or LD_LIBRARY_PATH variable?


.SUFFIXES:
.SUFFIXES:  .random-suffix-to-suppress-HP-warning

include ${MMHOME}/oracle/proc/src/rms_include.mk
include ${MMHOME}/oracle/proc/src/rtm_include.mk
include ${MMHOME}/oracle/proc/src/recs_include.mk
include ${MMHOME}/oracle/proc/src/resa_include.mk
include ${MMHOME}/oracle/proc/src/fif11i_include.mk

$(RMS_TARGETS): FORCE
        @$(MAKE) -f ${MMHOME}/oracle/proc/src/rms.mk $@

$(RTM_TARGETS): FORCE
        @$(MAKE) -f ${MMHOME}/oracle/proc/src/rtm.mk $@

$(ReCS_TARGETS): FORCE
        @$(MAKE) -f ${MMHOME}/oracle/proc/src/recs.mk $@

$(ReSA_TARGETS): FORCE
        @$(MAKE) -f ${MMHOME}/oracle/proc/src/resa.mk $@

$(FIF_TARGETS): FORCE
        @$(MAKE) -f ${MMHOME}/oracle/proc/src/fif11i.mk $@

clobber libchange clean install lint depend: FORCE
        @$(MAKE) -f ${MMHOME}/oracle/proc/src/rms.mk $@
        @$(MAKE) -f ${MMHOME}/oracle/proc/src/rtm.mk $@
        @$(MAKE) -f ${MMHOME}/oracle/proc/src/recs.mk $@
        @$(MAKE) -f ${MMHOME}/oracle/proc/src/resa.mk $@
        @$(MAKE) -f ${MMHOME}/oracle/proc/src/fif11i.mk $@
FORCE:
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
dplinnaneAuthor Commented:
Here is what is installed.


xxxxxx:{rmssnd}:/home/oracle > lslpp -l | grep vac
  vac.Bnd                   11.1.0.0  COMMITTED  XL C for AIX Media Defined
  vac.C                     11.1.0.6  COMMITTED  IBM XL C Compiler
  vac.aix50.lib      99.99.9999.9999  COMMITTED  Supersede entry, not installed
  vac.aix52.lib      99.99.9999.9999  COMMITTED  Supersede entry, not installed
  vac.aix53.lib             11.1.0.6  COMMITTED  XL C for AIX Libraries for AIX
  vac.html.common.search    11.1.0.6  COMMITTED  Supersede entry, not installed
  vac.html.en_US.C          11.1.0.6  COMMITTED  Supersede entry, not installed
  vac.html.ja_JP.C          11.1.0.6  COMMITTED  Supersede entry, not installed
  vac.html.zh_CN.C          11.1.0.6  COMMITTED  Supersede entry, not installed
  vac.include               11.1.0.6  COMMITTED  IBM XL C Compiler Include
  vac.lib                   11.1.0.6  COMMITTED  XL C for AIX Libraries
  vac.lic                   11.1.0.0  COMMITTED  XL C for AIX Licence Files
  vac.licAgreement          11.1.0.0  COMMITTED  IBM XL C Electronic License
  vac.man.en_US             11.1.0.6  COMMITTED  IBM XL C Compiler Man
  vac.msg.en_US.C           11.1.0.6  COMMITTED  XL C for AIX Compiler
  vac.ndi                   11.1.0.6  COMMITTED  XL C for AIX Non-Default
  vac.pdf.en_US.C           11.1.0.6  COMMITTED  XL C for AIX Compiler
  vacpp.cmp.aix50.lib
  vacpp.cmp.aix52.lib
  vacpp.cmp.aix53.lib       11.1.0.6  COMMITTED  IBM XL C/C++ Libraries for AIX
  vacpp.cmp.core            11.1.0.6  COMMITTED  IBM XL C/C++ Compiler
  vacpp.cmp.include         11.1.0.6  COMMITTED  IBM XL C/C++ Compiler Include
  vacpp.cmp.lib             11.1.0.6  COMMITTED  IBM XL C/C++ Libraries
  vacpp.cmp.rte             11.1.0.6  COMMITTED  IBM XL C/C++ Compiler
  vacpp.cmp.tools           11.1.0.6  COMMITTED  IBM XL C/C++ Tools
  vacpp.lic                 11.1.0.0  COMMITTED  IBM XL C/C++ Licence Files
  vacpp.licAgreement        11.1.0.0  COMMITTED  IBM XL C++ Electronic License
  vacpp.man.en_US           11.1.0.6  COMMITTED  IBM XL C/C++ Compiler Man
  vacpp.memdbg.aix50.lib
  vacpp.memdbg.aix50.rte
  vacpp.memdbg.aix52.lib
  vacpp.memdbg.aix52.rte
  vacpp.memdbg.aix53.lib    11.1.0.6  COMMITTED  IBM XL C/C++ User Heap/Memory
  vacpp.memdbg.aix53.rte    11.1.0.6  COMMITTED  IBM XL C/C++ User Heap/Memory
  vacpp.memdbg.lib          11.1.0.6  COMMITTED  IBM XL C/C++ User Heap and
  vacpp.memdbg.rte          11.1.0.6  COMMITTED  IBM XL C/C++ User Heap and
  vacpp.msg.en_US.cmp.core  11.1.0.6  COMMITTED  IBM XL C/C++ Compiler
  vacpp.msg.en_US.cmp.tools
  vacpp.ndi                 11.1.0.6  COMMITTED  IBM XL C/C++ Non-Default
  vac.C                     11.1.0.6  COMMITTED  IBM XL C Compiler
  vacpp.cmp.core            11.1.0.0  COMMITTED  IBM XL C/C++ Compiler
0
 
woolmilkporcCommented:
make CC=xlc -f ....

Or change your PATH to contain /usr/vac/bin before /usr/bin and /opt/freeware/bin

wmp
0
 
dplinnaneAuthor Commented:
Just to confirm does this look correct?
Is there a single command to get the version of xlc I tried xlc -v and which xlc to see was it in the path.


{rmssnd}:/data > ls -lrt  /usr/vac/bin
total 0
-r-xr-xr-x    1 bin      bin           77027 Feb 08 2011  fixpkg_vacndi
-r-xr-xr-x    1 bin      bin            3120 Mar 24 2011  CreateExportList
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  xlc_r7
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  xlc_r4
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  xlc_r
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  xlc128_r7
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  xlc128_r4
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  xlc128_r
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  xlc128
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  xlc
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  cc_r7
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  cc_r4
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  cc_r
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  cc128_r7
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  cc128_r4
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  cc128_r
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  cc128
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  cc
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  c99_r7
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  c99_r4
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  c99_r
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  c99_128_r7
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  c99_128_r4
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  c99_128_r
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  c99_128
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  c99
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  c89_r7
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  c89_r4
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  c89_r
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  c89_128_r7
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  c89_128_r4
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  c89_128_r
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  c89_128
-r-xr-xr-x   32 bin      bin         2567557 Mar 24 2011  c89
-r-xr-xr-x    1 bin      bin         2192644 Mar 24 2011  gxlc
-r-xr-xr-x    1 bin      bin           46505 Mar 28 2011  mergepdf
-r-xr-xr-x    1 bin      bin           65736 Mar 28 2011  showpdf
-r-xr-xr-x    1 bin      bin           65736 Mar 28 2011  resetpdf
-r-xr-xr-x    1 bin      bin           65736 Mar 28 2011  cleanpdf
-r-xr-xr-x    1 bin      bin          103981 May 05 11:29 vacndi


0
 
woolmilkporcCommented:
Yes, that looks like a complete xlC installation.

The binaries are all the same (in fact they're all hardlinks), it's just their name which makes them work differently (e.g. by using different defaults).

So you should go fine by modifying your PATH to contain /usr/vac/bin in the very first place.

There is no command line option to show the version.

Try "what /usr/vac/bin/xlc" or see the output of "lslpp" which you posted.

wmp

0
 
dplinnaneAuthor Commented:
the what works. Now when I run my command I get errors. It's a long shot that you may know what causes these but worth a try.

what /usr/vac/bin/xlc
/usr/vac/bin/xlc:
        version %s
        61      1.15  src/bos/usr/ccs/lib/libc/__threads_init.c, libcthrd, bos53H, h2006_10B1 3/5/06 16:44:58

         Licensed Materials - Property of IBM.
         IBM XL C/C++ for AIX, V11.1 (5724-X13)

         IBM XL C for AIX, V11.1 (5724-X12)

         Copyright IBM Corp. 1991, 2010 and by others.
         All Rights Reserved.
         US Government Users Restricted Rights -
         Use, duplication or disclosure restricted by
         GSA ADP Schedule Contract with IBM Corp.
         -----------------------------------------
         Version: 11.01.0000.0006
         Version: 11.01.0000.0006
         110324
         Driver 110324
         110303
         Compiler Services 110324
         Date: Thu Mar 24 18:42:39 EDT 2011
         -----------------------------------------


:{rmssnd}:/data/u04/oretail/rmsbatch/oracle/lib/src > make -f retek.mk retek rms resa 2>&1 | tee libretek.log
        cc -DNDEBUG  -I.  -I/data/u04/oretail/rmsbatch/oracle/lib/src  -I/data/u01/app/oracle/product/11.2.0/precomp/public  -I/data/u01/app/oracle/product/11.2.0/rdbms/public  -I/data/u01/app/oracle/product/11.2.0/plsql/public  -I/data/u01/app/oracle/product/11.2.0/sqllib/public  -I/data/u01/app/oracle/product/11.2.0/network/public  -I/data/u01/app/oracle/product/11.2.0/rdbms/demo      -O3  -q64 -DSS_64BIT_SERVER -qwarn64 -qinfo=uni -DAIXRIOS -qflag=s:s  -I/data/u01/app/oracle/product/11.2.0/precomp/hdrs  -I/data/u01/app/oracle/product/11.2.0/precomp/public -I/data/u01/app/oracle/product/11.2.0/precomp/include   -I/data/u01/app/oracle/product/11.2.0/oracore/include -I/data/u01/app/oracle/product/11.2.0/oracore/public -I/data/u01/app/oracle/product/11.2.0/oracore/port/include -I/data/u01/app/oracle/product/11.2.0/xdk/include -I/data/u01/app/oracle/product/11.2.0/xdk/public -I/data/u01/app/oracle/product/11.2.0/nlsrtl/include  -I/data/u01/app/oracle/product/11.2.0/ldap/public/sslinc -I/data/u01/app/oracle/product/11.2.0/ldap/include/sslinc  -I/data/u01/app/oracle/product/11.2.0/slax/include   -I.      -c saoranumadd.c -o `basename saoranumadd.o`
cc: unrecognized option '-q64'
cc: unrecognized option '-qwarn64'
cc: unrecognized option '-qinfo=uni'
cc: unrecognized option '-qflag=s:s'
Assembler:
/tmp//cc7DFqrv.s: line 17: 1252-191 Only .llong should be used for relocatable expressions.
make: 1254-004 The error code from the last command is 1.


Stop.:{rmssnd}:/data/u04/oretail/rmsbatch/oracle/lib/src >
0
 
woolmilkporcCommented:
You're still using GCC!
0
 
dplinnaneAuthor Commented:
Any reason why as I have modified the PATH
:{rmssnd}:/data/u04/oretail/rmsbatch > echo $PATH
/usr/vac/bin/xlc:/data/u01/app/oracle/product/11.2.0/bin:/data/u01/app/oracle/product/11.2.0/opmn/bin:/data/u04/oretail/rmsbatch/oracle/lib/src:/data/u01/app/oracle/product/11.2.0/bin:/u01/app/oracle/jdk/bin:/u01/app/oracle/jdk/lib:/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/local/bin:/home/oracle/bin:/home/oracle/scripts:/data/u01/app/oracle/scripts:.:/usr/java6_64/bin
0
 
woolmilkporcCommented:
A PATH points to a directory, not to a single executable.

(See my post #36986079 above).

Your PATH should be

/usr/vac/bin:/data/u01/app/oracle/product/11.2.0/bin:/data/u01/app/oracle/product/11.2.0/opmn/bin:... ... ...
0
 
dplinnaneAuthor Commented:
Thanks, all is good, it worked.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now