ChuckP has asked for the wisdom of the Perl Monks concerning the following question:

I'm having issues compiling Perl 5.20.1 on AIX 7.1 using XL C 11. I've tried the compile directions on perlaix.perldoc.org. It keeps saying it's in 32-bit mode, even thought I've exported the

OBJECT_MODE=64

and set the '-q64' in the CFLAGS variable. Here's the error message:

<stdarg.h> found. <varargs.h> found. *** WHOA THERE!!! *** Your C compiler "/usr/vac/bin/c99_r -q32" doesn't seem to support +stdarg or varargs! I'm giving up; maybe you can try again with a different compiler? 1 $ echo $OBJECT_MODE 64 $ history -5 92 ./Configure -Dcc=/usr/vac/bin/c(c|89|99)_r -Duseshrplib -Duset +hreads \ -Duselargefiles -Duse64bitint -Dprefix=/db/sched1/common/perl5 +/perl-5.20.1 \ -Dlocincpth='/usr/vac/include /usr/vacpp/include /usr/include +/usr/include/sys' \ -Dloclibpth='/usr/vac/lib /usr/lib64 /usr/local/lib64 /usr/lib +' ; echo $? => 1

If I append the the '-q64' in quotes after the cc_r, I get the same error meesage with the '-q64 before the '-q32'. I have tried compiling without the locincpth and loclibpath. PLus changing the order of the path entries. I should also mention that I'm trying to install perl in an administrative account and not as root. Any thoughts? Much Thanks!

Replies are listed 'Best First'.
Re: Problem Compiling Perl 5.20.1 on AIX
by Tux (Canon) on Dec 05, 2014 at 06:56 UTC

    Your -Dcc cannot have a regex.

    You do not have - by accident - $CC also set or (through a symlink) pointing to a different cc.

    Use -Duse64bitall instead of -Duse64bitint.

    $ env OBJECT_MODE=64 ./Configure -Dusethreads -Duse64bitall \ -Dprefix=/db/sched1/common/perl5/perl-5.20.1 -des

    should do the trick. If you really want to specify your compiler, do it without regex or in the env:

    $ export OBJECT_MODE=64 $ export CC=/usr/vac/bin/cc99_r $ ./Configure -Dusethreads -Duse64bitall \ -Dprefix=/db/sched1/common/perl5/perl-5.20.1 -des

    Enjoy, Have FUN! H.Merijn

      Thanks for the help!! Sory about the confusion on the regex, but it was to show that I've used several xlc aliases (c89_r, c99_r,cc_r, etc) and that I got the same results each time. I copied and pasted your example and got the following error:

      List of earlier versions to include in @INC? [none] <malloc/malloc.h> NOT found. <malloc.h> NOT found. Checking to see how big your pointers are... cc: 1501-228 (W) input file undefined not found (I can't seem to compile the test program. Guessing...) What is the size of a pointer (in bytes)? [4] *** You have chosen a maximally 64-bit build, *** but your pointers are only 4 bytes wide. *** Please rerun Configure without -Duse64bitall. *** Since you have quads, you could possibly try with -Duse64bitint. *** Cannot continue, aborting.

      Where do I set the size of the pointers? Also, do I need to set a env var like SHLIB_PATH? So Configure can find the malloc.h? I set the env vars as follows:

      $ export OBJECT_MODE=64 $ export CC=/usr/vac/bin/c99_r

      This is why I switched to using the '-Duse64bitint' flag. This is my first time I've ever used the xlc compiler and the docs from ibm seem to be incomplete. At a previous job, I compiled perl 5.12 and 5.14 with gcc on linux and only had to try it 2 to 3 times tops on the perl 5.12. I saved the env in make_opts.inc config file. Unfortunately, this an IBM shop and they won't let me have gcc, gawk, gtar, etc. I appreciate your help! Thanks!

        Unfortunately indeed. Try to read the INSTALL document and do not use make_opts.inc, but Policy.sh


        Enjoy, Have FUN! H.Merijn
Re: Problem Compiling Perl 5.20.1 on AIX
by flexvault (Monsignor) on Dec 06, 2014 at 16:42 UTC

    ChuckP,

    I luv AIX, but I have found compiling Perl with the XLC compiler very, very difficult. I use 'gcc' and have compiled on every version of AIX since 3.1 (original RS/6000 AIX). That said, I know it can be done.

    So I suggest you call the IBM native Perl with

    perl -V | grep config
    Look at the 'config_args' parameter and see if you use the same fields to compile a new Perl. Then you would have a starting point. ( Note: If you don't need threads, don't include it in your new Perl. A threads enabled Perl will be slower than a non threads Perl on AIX. But if you need it, then include it. )

    Regards...Ed

    "Well done is better than well said." - Benjamin Franklin

      Hi Ed,

      I took a break for the holidays, but try that and let you know how it goes.

      Thanks for the suggestion!