Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Problems building perl on AIX

by Anonymous Monk
on Mar 07, 2019 at 10:15 UTC ( [id://1230998]=perlquestion: print w/replies, xml ) Need Help??

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

I have to confess that I got a bit stuck while building a new Perl package (version 5.24.4) on AIX 7.1. I have done this several times before on AIX, Solaris and various Linux distros, but now I have the situation that Configure hangs and I don't know why.

I've been using both, the excellent perl-build module and Configure, executed on the command prompt (ksh and bash). At the end perl-build runs in the same issue in Configure.

I have tried different combinations but this is the most trivial command I've tried

export OBJECT_MODE=64 export CC='/usr/bin/gcc -maix64' sh ./Configure -des -Dcc="$CC" -Dprefix=/usr/db/perl/5.24.4.0 (I see you are using the Korn shell. Some ksh's blow up on Configure, mainly on older exotic systems. If yours does, try the Bourne shell i +nstead.) awk: 0602-533 Cannot find or open file ../patchlevel.h. The source line number is 1. Would you like to see the instructions? [n] Locating common programs... Checking compatibility between /usr/bin/echo and builtin echo (if any) +... Symbolic links are supported. Checking how to test for symbolic links... You can test for symbolic links with 'test -h'. Checking for cross-compile No targethost for running compiler tests against defined, running loca +lly Good, your tr supports [:lower:] and [:upper:] to convert case. Using [:upper:] and [:lower:] to convert case. aix esix4 linux sco_2_3_1 aix_3 fps lynxos sco_2_3_2 aix_4 freebsd midnightbsd sco_2_3_3 altos486 freemint mips sco_2_3_4 amigaos genix mirbsd solaris_2 atheos gnu mpc stellar aux_3 gnukfreebsd ncr_tower sunos_4_0 bitrig gnuknetbsd netbsd sunos_4_1 bsdos greenhills newsos4 super-ux catamount haiku nonstopux svr4 convexos hpux openbsd svr5 cxux i386 opus ti1500 cygwin interix os2 ultrix_4 darwin irix_4 os390 umips dcosx irix_5 os400 unicos dec_osf irix_6 posix-bc unicosmk dos_djgpp irix_6_0 powerux unisysdynix dragonfly irix_6_1 qnx utekv dynix isc riscos uwin dynixptx isc_2 sco vos epix linux-android sco_2_3_0 Which of these apply, if any? [none] Operating system name? [AIX]

here it hangs, apparently waiting for me hitting the 'return' button. But nothing happens.

Replies are listed 'Best First'.
Re: Problems building perl on AIX
by Tux (Canon) on Mar 07, 2019 at 11:13 UTC

    As Configure is a (huge) shell script, you can see what is going on exactly using -x:

    $ sh -x ./Configure -des -Dcc="$CC" -Dprefix=/usr/db/perl/5.24.4.0 : :

    I think it might be executing hints/aix.sh.


    Enjoy, Have FUN! H.Merijn

      Thank you very much for your reply. I've tried that already. I've even modified the Configure script with some defaults which work in my case to jump over the critical steps. But I thought, this looks like a systematic issue and there should be a general solution. I'm also wondering why this happens on my side and has apparently never been reported by someone else.

        I'd prefer you to not modify Configure, as that won't help us to pinpoint possible problems.

        What was the last command executed before the "hang"? Can you show what command "hang"s with the -x option?

        You can make the full log available as (git)paste if you think that would help.

        If there is a real problem, I want a real (generic) solution to it!


        Enjoy, Have FUN! H.Merijn
Re: Problems building perl on AIX
by bliako (Monsignor) on Mar 07, 2019 at 10:59 UTC

    There is a script created on the fly when you are running Perl's Configure, in current dir, whose purpose is to read your answer. The script is called myread and its source is inside Configure file. First make sure that this script terminates. You can either run it in another shell while Configure hangs or add debugging messages to Configure. Script "myread" attempts to start a shell using the contents of a variable in Configure named $startsh. Check that it is a valid shebang for your system (that would be the first line in file myread).

      Thank you very much for your reply. I've noticed this script in a UU sub dir and was already assuming that it could be the problem. I've seen some other script there which seem to be created in a later phase, like gettext or so, which were kind of hanging, too.

      I've tried to execute the myread script manually now but that seems to look good

      # rp='Do you really want to continue?' # dflt='n' # . UU/myread 4>&1 Do you really want to continue? [n] (hit return) # (script has terminated)
Re: Problems building perl on AIX
by bliako (Monsignor) on Mar 08, 2019 at 15:15 UTC

    Two things ring alarm in the log you posted:

    first, the output of sh -x Configure ...

    + + echo AIX + /usr/bin/sed -e s/[ ][ ]*/_/g + ./tr [A-Z] [a-z]

    I am not acquainted much with the output of sh -x But I assume that what follows a plus sign is a command executed in current shell and whatever commands are preceded by two-or-more plus signs were executed in sub-shells therein. For example:

    sh -x -e "echo abc | sed s'/a/b/'" + echo abc + sed s/a/b/ bbc

    whereas,

    sh -x -c 'z=`echo abc | sed "s/a/b/"`' ++ echo abc ++ sed s/a/b/ + z=bbc

    So, the output you posted has echo AIX in a sub-shell and following sed and tr commands are executed on current shell. But *if* that output is at corresponds to this Configure part:

    rp="Operating system name?" . ./myread case "$ans" in none) osname='' ;; *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' + '[a-z]'`;; esac

    Then echo, sed, tr should have all been preceded by 2 plus signs as they are all part of one single `...`.

    The second alarm is that $sed is a variable which refers to some sed executable I guess. But it is worth investigating what it actually contains. Also, ./tr is not the same as tr. It probably is another script created on the fly and it is used instead of /usr/bin/tr. So, it is also worth finding out what that ./tr file contains...

    So, I suggest to add some debugging lines in Configure (sorry if that contradicts the other advice you got about not modifying that file, which is correct but this is special and once you sort things out you will go back to original Configure and discard any perl executable may have been produced). Something like this perhaps (untested):

    rp="Operating system name?" . ./myread case "$ans" in none) osname='' ;; *) echo "AAAA: ans='${ans}', sed='${sed}', Here is tr:" cat ./tr echo "BBBB: done cat tr" osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[ +a-z]'` echo "CCCC: osname='${osname}'" ;; esac echo " " echo "XXXXXX out of case with this osname='${osname}'"

    bw, bliako

    p.s. Although the log was posted in another node of this post, I chose to create a new comment/answer to avoid clutter.

Re: Problems building perl on AIX
by Anonymous Monk on Mar 11, 2019 at 09:03 UTC

    SOLVED !!!

    Thank you all very much for your replies.

    The hint to build perl as non-root user was the key to the solution. Apparently my build machine was somehow screwed up which caused the Configure script to fail when started as root. As soon as I ran it as my personal user it worked like a charm, at least with the most basic parameters. As I'm going to use this perl to connect to an oracle database I maybe have to find out what the best options might be to be used together with gcc.

    Again, thank you very much for your support.

    Regards, Andreas

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1230998]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-26 05:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found