Question

I'm trying to build python 2.6.8 from source code on an AIX 6.5 machine, but several modules can't build successful. In the build process, there is a XLC man page jumps out and stucks. I have to press q to end the man page and the process will continue. So I'm thinking whether is because the build invokes the default XLC compiler, and I'm trying to change the default compiler to g++:

make clean
CC=/bin/gcc CXX=/bin/g++ ./configure
make

But it seems doesn't work, the XLC man page still pops up, and the moduls fail to build.

How can I make sure it will use g++ instead of XLC? Thanks.

Update

This is the log after CC=/bin/gcc CXX=/bin/g++ ./configure

-bash-3.2$ CC=/bin/gcc CXX=/bin/g++ ./configure
checking for --enable-universalsdk... no
checking for --with-universal-archs... 32-bit
checking MACHDEP... aix6
checking EXTRAPLATDIR... 
checking machine type as reported by uname -m... 00F63F144C00
checking for --without-gcc... 
checking for gcc... cc_r
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... no
checking whether cc_r accepts -g... yes
checking for cc_r option to accept ISO C89... -qlanglvl=extc89
checking for --with-cxx-main=<compiler>... no
checking how to run the C preprocessor... cc_r -qlanglvl=extc89 -E
checking for grep that handles long lines and -e... /opt/freeware/bin/grep
checking for egrep... /opt/freeware/bin/grep -E

In that I see the line checking whether we are using the GNU C compiler... no, does that mean it is not using the gcc?

And also in the log of make

checking for __attribute__((visibility("hidden")))... no
cc_r: 1501-210 (W) command option t contains an incorrect subargument

right after the above log, the man page of xlc pops up.

Was it helpful?

Solution

The cc_r compiler is the IBM compiler. The IBM C compiler (and the C++ one) have several ways of being invoked. xlc is one, the _r variants (which mean they link to reentrant/threadsafe libraries) is another. There are also the cc and c99 ones. Why so many you ask? Well, each is provided as a shorthand for common options, in this case each is for different language standards. c99, for instance, supports the C99 standard. So just because the compiler doesn't have an 'xl' prefix doesn't mean it is not an IBM compiler.

Note that the reason you are getting the man page shown is that somewhere you are invoking the compiler without any arguments or an incorrect argument. This is the cause of the message

cc_r: 1501-210 (W) command option t contains an incorrect subargument

The -t flag allows you to swap out parts of your compiler and it's rare that you'd actually want to do that. It takes a subargument e.g.

cc_r -tI ...

Says you're going to swap out the compile-time phase of the IPA optimizer (usually specifying the new component's location with -B).

Somewhere in your makefile you are specifying -t and confusing the poor compiler mightily.

Btw, if you want to override the compiler in make, you can specify it directly in the makefile by the CC, CXX and CCC variables. You can experiment by specifying it on the command line before editing your makefile. Note that these changes would be lost if you run ./configure again.

make CC=/bin/gcc CCC=/bin/g++ CXX=/bin/g++
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top