Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
15 replies Latest Post - ‏2010-04-19T18:16:47Z by klausk
SystemAdmin
SystemAdmin
706 Posts
ACCEPTED ANSWER

Pinned topic PHP 5.2 or 5.3 Compilation on RHEL5-64Bit-PPC

‏2010-04-15T12:46:43Z |
I am trying to install PHP5.2 on RHEL5.4 PPC Linux. Getting following error while doing make. Please let me know the steps if any one has done this already.

./configure
make
make intsall

lz -lm -lxml2 -lz -lm -lcrypt -o sapi/cgi/php-cgi
/usr/bin/ld: skipping incompatible /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.so when searching for -lm
/usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.a(w_sqrt.o): In function `sqrt':
(.text+0x6): undefined reference to `_dl_hwcap'
/usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.a(w_sqrt.o): In func
Updated on 2010-04-19T18:16:47Z at 2010-04-19T18:16:47Z by klausk
  • klausk
    klausk
    13 Posts
    ACCEPTED ANSWER

    Re: PHP 5.2 or 5.3 Compilation on RHEL5-64Bit-PPC

    ‏2010-04-16T02:22:33Z  in response to SystemAdmin
    do you have glibc-devel.ppc (32bit) installed?
    • klausk
      klausk
      13 Posts
      ACCEPTED ANSWER

      Re: PHP 5.2 or 5.3 Compilation on RHEL5-64Bit-PPC

      ‏2010-04-16T02:45:29Z  in response to klausk
      > klausk wrote:
      > do you have glibc-devel.ppc (32bit) installed?
      I mean, glibc-devel.ppc64 (64bit)?
      • SystemAdmin
        SystemAdmin
        706 Posts
        ACCEPTED ANSWER

        Re: PHP 5.2 or 5.3 Compilation on RHEL5-64Bit-PPC

        ‏2010-04-16T07:12:46Z  in response to klausk
        All required package has been installed.
        • klausk
          klausk
          13 Posts
          ACCEPTED ANSWER

          Re: PHP 5.2 or 5.3 Compilation on RHEL5-64Bit-PPC

          ‏2010-04-16T13:10:48Z  in response to SystemAdmin
          I could build php-5.2.13 on a RHEL5.4 PPC64 box:
          
          [root@jeep09 php-5.2.13]# make ... s.lo Zend/zend_dynamic_array.lo Zend/zend_execute_API.lo Zend/zend_highlight.lo Zend/zend_llist.lo Zend/zend_opcode.lo Zend/zend_operators.lo Zend/zend_ptr_stack.lo Zend/zend_stack.lo Zend/zend_variables.lo Zend/zend.lo Zend/zend_API.lo Zend/zend_extensions.lo Zend/zend_hash.lo Zend/zend_list.lo Zend/zend_indent.lo Zend/zend_builtin_functions.lo Zend/zend_sprintf.lo Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo Zend/zend_ts_hash.lo Zend/zend_stream.lo Zend/zend_iterators.lo Zend/zend_interfaces.lo Zend/zend_exceptions.lo Zend/zend_strtod.lo Zend/zend_objects.lo Zend/zend_object_handlers.lo Zend/zend_objects_API.lo Zend/zend_default_classes.lo Zend/zend_execute.lo sapi/cli/php_cli.lo sapi/cli/php_cli_readline.lo sapi/cli/getopt.lo main/internal_functions_cli.lo -lcrypt -lcrypt -lrt -lrt -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt  -o sapi/cli/php   Build complete. Don
          't forget to run 'make test
          '.   [root@jeep09 php-5.2.13]#
          


          I have both 32 and 64-bit glibc-devel, 32-bit libxml2-devel, 32 and 64-bit zlib-devel. gcc is 4.1.2 32-bit:
          
          [root@jeep09 ~]# rpm -qa --qf 
          '%{NAME}-%{VERSION}-%{RELEASE}@%{ARCH}\n' | grep gcc compat-libgcc-296-2.96-138@ppc gcc-gfortran-4.1.2-46.el5@ppc gcc-c++-4.1.2-46.el5@ppc libgcc-4.1.2-46.el5@ppc compat-gcc-34-c++-3.4.6-4@ppc gcc-4.1.2-46.el5@ppc compat-gcc-34-3.4.6-4@ppc libgcc-4.1.2-46.el5@ppc64 compat-gcc-34-g77-3.4.6-4@ppc [root@jeep09 ~]# rpm -qa --qf 
          '%{NAME}-%{VERSION}-%{RELEASE}@%{ARCH}\n' | grep zlib zlib-1.2.3-3@ppc zlib-devel-1.2.3-3@ppc64 zlib-devel-1.2.3-3@ppc zlib-1.2.3-3@ppc64 [root@jeep09 ~]# rpm -qa --qf 
          '%{NAME}-%{VERSION}-%{RELEASE}@%{ARCH}\n' | grep xml2 libxml2-python-2.6.26-2.1.2.8@ppc libxml2-2.6.26-2.1.2.8@ppc64 libxml2-2.6.26-2.1.2.8@ppc libxml2-devel-2.6.26-2.1.2.8@ppc [root@jeep09 ~]#
          

          Procedure to build was regular ./configure && make && make install

          -Klaus
  • SystemAdmin
    SystemAdmin
    706 Posts
    ACCEPTED ANSWER

    Re: PHP 5.2 or 5.3 Compilation on RHEL5-64Bit-PPC

    ‏2010-04-16T14:09:04Z  in response to SystemAdmin
    Hi

    Thanks for the reply.

    As you mention all packages are available in OS. But still I am getting same error while doing make. Can you please let me know from where you donwload PHP 5.2.13?

    end_indent.lo Zend/zend_builtin_functions.lo Zend/zend_sprintf.lo Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo Zend/zend_ts_hash.lo Zend/zend_stream.lo Zend/zend_iterators.lo Zend/zend_interfaces.lo Zend/zend_exceptions.lo Zend/zend_strtod.lo Zend/zend_objects.lo Zend/zend_object_handlers.lo Zend/zend_objects_API.lo Zend/zend_default_classes.lo Zend/zend_execute.lo sapi/cgi/cgi_main.lo sapi/cgi/getopt.lo main/internal_functions.lo -lcrypt -lcrypt -lrt -lrt -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -o sapi/cgi/php-cgi
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.so when searching for -lm
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.so when searching for -lm
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.so when searching for -lm
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.so when searching for -lm
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.so when searching for -lm
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.so when searching for -lm
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.so when searching for -lm
    /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.a(w_sqrt.o): In function `sqrt':
    (.text+0x6): undefined reference to `_dl_hwcap'
    /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.a(w_sqrt.o): In function `sqrt':
    (.text+0x1e): undefined reference to `_dl_hwcap'
    /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.a(e_sqrt.o): In function `__ieee754_sqrt':
    (.text+0x1a2): undefined reference to `_dl_hwcap'
    /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.a(e_sqrt.o): In function `__ieee754_sqrt':
    (.text+0x1aa): undefined reference to `_dl_hwcap'
    • klausk
      klausk
      13 Posts
      ACCEPTED ANSWER

      Re: PHP 5.2 or 5.3 Compilation on RHEL5-64Bit-PPC

      ‏2010-04-16T15:12:15Z  in response to SystemAdmin
      http://php.net/downloads.php

      Please double-check the packages (including versions, releases and architecture, check the rpm query syntax in my previous post). The error message clearly shows that you're trying to link 32bit libraries in a 64 bit build.

      -Klaus
  • SystemAdmin
    SystemAdmin
    706 Posts
    ACCEPTED ANSWER

    Re: PHP 5.2 or 5.3 Compilation on RHEL5-64Bit-PPC

    ‏2010-04-17T07:48:50Z  in response to SystemAdmin
    Please check following RPM status in RHEL5. I am downloading PHP from same site http://php.net/downloads.php.

    http://in.php.net/get/php-5.2.13.tar.gz/from/co.php.net/mirror

    Can you please send me mirror link for PHP which you used in your environment.
    root@auscp02 ~# rpm -qa --qf '%{NAME}-%{VERSION}-%{RELEASE}@%{ARCH}\n' | grep gcc
    gcc-gfortran-4.1.2-46.el5@ppc
    libgcc-4.1.2-46.el5@ppc64
    gcc-c++-4.1.2-46.el5@ppc
    compat-gcc-34-3.4.6-4@ppc
    compat-gcc-34-g77-3.4.6-4@ppc
    compat-gcc-34-c++-3.4.6-4@ppc
    libgcc-4.1.2-46.el5@ppc
    gcc-4.1.2-46.el5@ppc
    compat-libgcc-296-2.96-138@ppc
    root@auscp02 ~# rpm -qa --qf '%{NAME}-%{VERSION}-%{RELEASE}@%{ARCH}\n' | grep zlib
    zlib-1.2.3-3@ppc64
    zlib-devel-1.2.3-3@ppc64
    zlib-devel-1.2.3-3@ppc
    zlib-1.2.3-3@ppc
    root@auscp02 ~#
    root@auscp02 ~# rpm -qa --qf '%{NAME}-%{VERSION}-%{RELEASE}@%{ARCH}\n' | grep xml2
    libxml2-2.6.26-2.1.2.8@ppc64
    libxml2-devel-2.6.26-2.1.2.8@ppc
    libxml2-2.6.26-2.1.2.8@ppc
    libxml2-python-2.6.26-2.1.2.8@ppc
    libxml2-devel-2.6.26-2.1.2.8@ppc64
    • klausk
      klausk
      13 Posts
      ACCEPTED ANSWER

      Re: PHP 5.2 or 5.3 Compilation on RHEL5-64Bit-PPC

      ‏2010-04-19T13:34:47Z  in response to SystemAdmin
      I've downloaded from http://www.php.net/get/php-5.2.13.tar.bz2/from/a/mirror

      The md5sum of my copy matches that of the website:
      
      [root@perfsqh2 ~]# md5sum php-5.2.13.tar.bz2 eb4d0766dc4fb9667f05a68b6041e7d1  php-5.2.13.tar.bz2 [root@perfsqh2 ~]#
      

      I have installed the exact versions of the packages you have installed in your box, and I was able to do build php fine.

      Please do the following so we can debug this:

      set-up a new dir for building php
      
      [root@perfsqh2 ~]# tar xvjf php-5.2.13.tar.bz2 ... [root@perfsqh2 ~]# cd php-5.2.13 [root@perfsqh2 php-5.2.13]#
      


      export the LDFLAGS environment variable like the following
      
      [root@perfsqh2 php-5.2.13]# export LDFLAGS=
      "-t" [root@perfsqh2 php-5.2.13]#
      


      run the ./configure script, capturing it's output to configure.output
      root@perfsqh2 php-5.2.13# ./configure 2>&1 | tee configure.output
      ...
      Thank you for using PHP.

      root@perfsqh2 php-5.2.13#
      
      *make the build, capturing it
      's output to make.output*
      

      root@perfsqh2 php-5.2.13# make 2>&1 | tee make.output
      ...
      root@perfsqh2 php-5.2.13#
      {code}

      After you hit the error, copy the config.log, configure.output and make.outout files found in your build directory and attach them here so we can take a look.

      I'm attaching mine here if you'd like to take a look and compare.

      -Klaus

      Attachments

      • klausk
        klausk
        13 Posts
        ACCEPTED ANSWER

        Re: PHP 5.2 or 5.3 Compilation on RHEL5-64Bit-PPC

        ‏2010-04-19T13:35:56Z  in response to klausk
        configure.output
        • klausk
          klausk
          13 Posts
          ACCEPTED ANSWER

          Re: PHP 5.2 or 5.3 Compilation on RHEL5-64Bit-PPC

          ‏2010-04-19T13:36:28Z  in response to klausk
          config.log

          Attachments

          • klausk
            klausk
            13 Posts
            ACCEPTED ANSWER

            Re: PHP 5.2 or 5.3 Compilation on RHEL5-64Bit-PPC

            ‏2010-04-19T13:50:47Z  in response to klausk
            Other things to try (in order to check that the math library is in it's correct place):
            
            [root@perfsqh2 php-5.2.13]# rpm -q --qf 
            '%{NAME}-%{VERSION}-%{RELEASE}@%{ARCH}\n' -f /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.so glibc-devel-2.5-42@ppc [root@perfsqh2 php-5.2.13]# readlink -f /usr/lib/gcc/ppc64-redhat-linux/4.1.2/../../../../lib/libm.so/lib/libm-2.5.so [root@perfsqh2 php-5.2.13]# rpm -q --qf 
            '%{NAME}-%{VERSION}-%{RELEASE}@%{ARCH}\n' -f /lib/libm-2.5.so glibc-2.5-42@ppc [root@perfsqh2 php-5.2.13]# rpm -qV glibc-devel-2.5-42 [root@perfsqh2 php-5.2.13]# echo $? 0 [root@perfsqh2 php-5.2.13]# rpm -qV glibc-2.5-42 [root@perfsqh2 php-5.2.13]# echo $? 0 [root@perfsqh2 php-5.2.13]#
            
  • SystemAdmin
    SystemAdmin
    706 Posts
    ACCEPTED ANSWER

    Re: PHP 5.2 or 5.3 Compilation on RHEL5-64Bit-PPC

    ‏2010-04-19T13:56:50Z  in response to SystemAdmin
    Attached configure.output
  • SystemAdmin
    SystemAdmin
    706 Posts
    ACCEPTED ANSWER

    Re: PHP 5.2 or 5.3 Compilation on RHEL5-64Bit-PPC

    ‏2010-04-19T14:01:09Z  in response to SystemAdmin
    config.log

    Attachments

  • SystemAdmin
    SystemAdmin
    706 Posts
    ACCEPTED ANSWER

    Re: PHP 5.2 or 5.3 Compilation on RHEL5-64Bit-PPC

    ‏2010-04-19T14:02:42Z  in response to SystemAdmin
    make output

    Attachments

    • klausk
      klausk
      13 Posts
      ACCEPTED ANSWER

      Re: PHP 5.2 or 5.3 Compilation on RHEL5-64Bit-PPC

      ‏2010-04-19T18:16:47Z  in response to SystemAdmin
      Sai,

      I checked your output and seems like you're PHP build is trying to link with libm.a instead of libm.so, that is, statically linking to the math library instead of using the dynamic library.

      I'm no expert, but I suspect this might be happening either because the environment is configured to do so, or perhaps you're trying to link against a library that was previously been statically linked the standard math library.

      Either way, please check your environment. Try deploying a temporary LPAR with fresh install from RHEL5.4 and trying again.

      Check your environment variables (CFLAGS, LDFLAGS etc), or if any of the libraries you're using is custom-built (happens often if you got around building stuff by your own).

      If you're still having problems after all that, you should try getting some official support.

      -Klaus