Help with compiling Math::GMP on AIX 5.3

Discussion in 'Perl Misc' started by btna, Sep 12, 2007.

  1. btna

    btna Guest

    Hello All,

    I am not sure what I am missing but I think it must be something
    simple. I am trying to install Net::SSH::perl and it requires
    Math::GMP which I have downloaded and when trying to install I get the
    following errors:

    (Note: I have successfully downloaded and installed GMP following the
    standard instruction as and I have added the -L/usr/local/lib to the
    LIBS in the Makefile.PL

    Any help will be appreciated it!!

    Thanks

    BTNA

    Math-GMP-2.04> perl Makefile.PL

    Writing Makefile for Math::GMP

    Math-GMP-2.04> make

    /usr/bin/perl -e 'use ExtUtils::Mksymlists; Mksymlists("NAME"
    => "Math::GMP", "DL_FUNCS" => { }, "FUNCLIST" => [], "DL_VARS" =>
    []);'
    cc_r -c -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -
    qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -
    q32 -D_LARGE_FILES -qlonglong -O -DVERSION=\"2.04\" -DXS_VERSION=
    \"2.04\" "-I/usr/opt/perl5/lib/5.8.2/aix-thread-multi/CORE" GMP.c
    Running Mkbootstrap for Math::GMP ()
    chmod 644 GMP.bs
    rm -f blib/arch/auto/Math/GMP/GMP.so
    LD_RUN_PATH="" ld -bhalt:4 -bM:SRE -bI:/usr/opt/perl5/lib/
    5.8.2/aix-thread-multi/CORE/perl.exp -bE:GMP.exp -bnoentry -lpthreads -
    lc_r GMP.o -o blib/arch/auto/Math/GMP/GMP.so -L/usr/local/lib -lgmp
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_init
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_sqrt
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_tstbit
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_init_set
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_fac_ui
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_ior
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_xor
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_and
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_fib_ui
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_gcd
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_pow_ui
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_jacobi
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_cmp
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_mod
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_tdiv_qr
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_fdiv_q
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_mul
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_sub
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_add
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_fdiv_r_2exp
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_fdiv_r
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_powm
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_fdiv_q_2exp
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_mul_2exp
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_get_si
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_add_ui
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_get_ui
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_sizeinbase
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_get_str
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_clear
    ld: 0711-317 ERROR: Undefined symbol: .__gmpz_init_set_str
    ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
    information.
    make: 1254-004 The error code from the last command is 8.


    Stop.
     
    btna, Sep 12, 2007
    #1
    1. Advertising

  2. btna

    Guest

    On Sep 12, 9:18 am, btna <> wrote:
    > [problems installing Math::GMP]


    I had this same problem (also AIX 5.3). I was able to build Math::GMP
    after I copied /usr/local/include/gmp.h to the directory (top level)
    where I was building Math::GMP.


    --
    The best way to get a good answer is to ask a good question.
    David Filmer (http://DavidFilmer.com)
     
    , Sep 12, 2007
    #2
    1. Advertising

  3. btna

    btna Guest

    On Sep 12, 2:06 pm, wrote:
    > On Sep 12, 9:18 am, btna <> wrote:
    >
    > > [problems installing Math::GMP]

    >
    > I had this same problem (also AIX 5.3). I was able to build Math::GMP
    > after I copied /usr/local/include/gmp.h to the directory (top level)
    > where I was building Math::GMP.
    >
    > --
    > The best way to get a good answer is to ask a good question.
    > David Filmer (http://DavidFilmer.com)


    David,

    Thank you . I copied the gmp.h to the directory where I was building
    it . It has the following:

    COPYING.LIB GMP.exp_old MANIFEST blib t
    Changes GMP.o Makefile gmp.h typemap
    GMP.bs GMP.xs Makefile.PL lib
    GMP.c INSTALL Makefile.old libgmp.la
    GMP.exp LICENSE README pm_to_blib

    I still have the same errors. Is this the directory you are talking
    about?

    Thanks for your response.

    BTNA
     
    btna, Sep 12, 2007
    #3
  4. I'm having some problems too compiling Math::GMP.. (Required by a
    requirement of Net::SSH::perl)

    I have no gmp.h in my system.

    Anyone have an idea in what package it is ?

    Thanks,
    --Ben
     
    Benoit Lefebvre, Sep 12, 2007
    #4
  5. btna

    Guest

    On Sep 12, 12:00 pm, btna <> wrote:
    > I still have the same errors. Is this the directory you are talking
    > about?


    Yes. OK, verify that you have this in your Makefile.PL (with the -
    lgmp flag):

    'LIBS' => ['-L/usr/local/lib -lgmp'],

    What is your $CFLAGS? I used this:

    export CFLAGS="-g -O2 -mcpu=powerpc"

    Also, /usr/vacpp/bin is in your $PATH, right?



    --
    The best way to get a good answer is to ask a good question.
    David Filmer (http://DavidFilmer.com)
     
    , Sep 12, 2007
    #5
  6. btna

    Guest

    On Sep 12, 12:02 pm, Benoit Lefebvre <>
    wrote:
    > I have no gmp.h in my system.


    You must build GMP before you can install Math::GMP.

    http://www.swox.com/gmp/


    --
    The best way to get a good answer is to ask a good question.
    David Filmer (http://DavidFilmer.com)
     
    , Sep 12, 2007
    #6
  7. btna

    Guest

    On Sep 12, 12:02 pm, Benoit Lefebvre <>
    wrote:
    > I have no gmp.h in my system.


    You must build GMP before you can install Math::GMP.

    http://www.swox.com/gmp/


    --
    The best way to get a good answer is to ask a good question.
    David Filmer (http://DavidFilmer.com)
     
    , Sep 12, 2007
    #7
  8. btna

    Ben Morrow Guest

    Quoth btna <>:
    > On Sep 12, 2:06 pm, wrote:
    > > On Sep 12, 9:18 am, btna <> wrote:
    > >
    > > > [problems installing Math::GMP]

    > >
    > > I had this same problem (also AIX 5.3). I was able to build Math::GMP
    > > after I copied /usr/local/include/gmp.h to the directory (top level)
    > > where I was building Math::GMP.

    >
    > Thank you . I copied the gmp.h to the directory where I was building
    > it . It has the following:
    >
    > COPYING.LIB GMP.exp_old MANIFEST blib t
    > Changes GMP.o Makefile gmp.h typemap
    > GMP.bs GMP.xs Makefile.PL lib
    > GMP.c INSTALL Makefile.old libgmp.la
    > GMP.exp LICENSE README pm_to_blib
    >
    > I still have the same errors. Is this the directory you are talking
    > about?


    Have you cleaned up the old GMP.c/GMP.o (uh, and probably GMP.exp/GMP.bs
    as well, since this is AIX) from when you built before (make clean, or
    simply re-extract from the tarball)? It sounds like the problem is that
    the C compiler was picking up a different gmp.h from somewhere else, but
    simply putting the correct header where the compiler will find it won't
    make the makefile rebuild things...

    Ben
     
    Ben Morrow, Sep 12, 2007
    #8
  9. btna

    btna Guest

    On Sep 12, 3:20 pm, Ben Morrow <> wrote:
    > Quoth btna <>:
    >
    >
    >
    >
    >
    > > On Sep 12, 2:06 pm, wrote:
    > > > On Sep 12, 9:18 am, btna <> wrote:

    >
    > > > > [problems installing Math::GMP]

    >
    > > > I had this same problem (also AIX 5.3). I was able to build Math::GMP
    > > > after I copied /usr/local/include/gmp.h to the directory (top level)
    > > > where I was building Math::GMP.

    >
    > > Thank you . I copied the gmp.h to the directory where I was building
    > > it . It has the following:

    >
    > > COPYING.LIB GMP.exp_old MANIFEST blib t
    > > Changes GMP.o Makefile gmp.h typemap
    > > GMP.bs GMP.xs Makefile.PL lib
    > > GMP.c INSTALL Makefile.old libgmp.la
    > > GMP.exp LICENSE README pm_to_blib

    >
    > > I still have the same errors. Is this the directory you are talking
    > > about?

    >
    > Have you cleaned up the old GMP.c/GMP.o (uh, and probably GMP.exp/GMP.bs
    > as well, since this is AIX) from when you built before (make clean, or
    > simply re-extract from the tarball)? It sounds like the problem is that
    > the C compiler was picking up a different gmp.h from somewhere else, but
    > simply putting the correct header where the compiler will find it won't
    > make the makefile rebuild things...
    >
    > Ben- Hide quoted text -
    >
    > - Show quoted text -


    Thanks for the responses but no luck yet. I have the -L/usr/local/lib
    and I have used the CFLAGS as David posted them. I still get the same
    errors. I do a "make clean" before I start again.

    I am not sure what I am missing.

    BTNA
     
    btna, Sep 12, 2007
    #9
  10. btna

    Guest

    On Sep 12, 1:43 pm, btna <> wrote:

    > Thanks for the responses but no luck yet.


    I Googled around and found an old usenet archive website with a very
    similar problem:
    http://www.issociate.de/board/goto/630875/GMP::Math_...PLEASE_HELP!!.html

    And you appear to be the OP for that old thread. Is this the same
    machine you were building on back in Feb 2005? Are some remnants of
    old stuff still lying around?


    --
    The best way to get a good answer is to ask a good question.
    David Filmer (http://DavidFilmer.com)
     
    , Sep 13, 2007
    #10
  11. In article <>, says...
    >
    >
    >Hello All,
    >
    >I am not sure what I am missing but I think it must be something
    >simple. I am trying to install Net::SSH::perl and it requires
    >Math::GMP which I have downloaded and when trying to install I get the
    >following errors:


    Check wether libgmp.a has objects for the correct object mode. Try:

    ar -X64 t /usr/local/lib/libgmp.a

    or

    ar -X32 t /usr/local/lib/libgmp.a

    You should get a list for -X32 since your perl is 32-bit (seen from -q32 in your CFLAGS). If nothing is there for -X32 then rebuild libgmp with OBJECT_MODE=32.

    Cheers

    Heinrich

    --
    Heinrich Mislik
    Zentraler Informatikdienst der Universitaet Wien
    A-1010 Wien, Universitaetsstrasse 7
    Tel.: (+43 1) 4277-14056, Fax: (+43 1) 4277-9140
     
    Heinrich Mislik, Sep 13, 2007
    #11
  12. btna

    btna Guest

    On Sep 13, 6:08 am, (Heinrich Mislik)
    wrote:
    > In article <>, says...
    >
    >
    >
    > >Hello All,

    >
    > >I am not sure what I am missing but I think it must be something
    > >simple. I am trying to install Net::SSH::perl and it requires
    > >Math::GMP which I have downloaded and when trying to install I get the
    > >following errors:

    >
    > Check wether libgmp.a has objects for the correct object mode. Try:
    >
    > ar -X64 t /usr/local/lib/libgmp.a
    >
    > or
    >
    > ar -X32 t /usr/local/lib/libgmp.a
    >
    > You should get a list for -X32 since your perl is 32-bit (seen from -q32 in your CFLAGS). If nothing is there for -X32 then rebuild libgmp with OBJECT_MODE=32.
    >
    > Cheers
    >
    > Heinrich
    >
    > --
    > Heinrich Mislik
    > Zentraler Informatikdienst der Universitaet Wien
    > A-1010 Wien, Universitaetsstrasse 7
    > Tel.: (+43 1) 4277-14056, Fax: (+43 1) 4277-9140



    Thanks for the reply.
    David, This is a new server. I managed to get the other server to work
    fine 2 years ago. This is a new server just installed with AIX 5.3

    Heinrich,

    I did what you suggested:

    the -X32 did not return anything. However, the -X64 returned a bunch
    of objects. So, I set the env variable:
    # export OBJECT_MODE=32
    and recompiled gmp. When I do he -X32, I still don't see anything but
    now when I do -X64, I see only:
    libgmp.so.3

    I tried recompiling Mat::GMP and get of course the same undefined
    errors.

    Do you know how I could specify -q32 when compiling Math::GMP? or do
    you have any other ideas for me? I am really not sure what else I can
    try.

    Thanks again for the replies.

    BTNA
     
    btna, Sep 13, 2007
    #12
  13. In article <>, says...

    >the -X32 did not return anything. However, the -X64 returned a bunch
    >of objects. So, I set the env variable:
    ># export OBJECT_MODE=32
    >and recompiled gmp. When I do he -X32, I still don't see anything but
    >now when I do -X64, I see only:
    >libgmp.so.3


    Now you built a shared library but still for 64 bit.
    I think gmp always builds 64 bit since this is in configure:

    xlc_aix64_cflags="-O2 -q64 -qtune=pwr3 -qmaxmem=20000"

    So I see two choices:

    Try hacking configure to build gmp in 32bit.

    Build your own perl with 64 bit. I prefer to build my own perl anyway.

    good luck

    Heinrich

    --
    Heinrich Mislik
    Zentraler Informatikdienst der Universitaet Wien
    A-1010 Wien, Universitaetsstrasse 7
    Tel.: (+43 1) 4277-14056, Fax: (+43 1) 4277-9140
     
    Heinrich Mislik, Sep 13, 2007
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    4
    Views:
    1,116
  2. Allen Harkleroad
    Replies:
    0
    Views:
    463
    Allen Harkleroad
    Sep 5, 2007
  3. Senthilkumar T
    Replies:
    4
    Views:
    372
    Sherm Pendley
    Jul 15, 2004
  4. Ishmael

    Math::GMP make test fails.

    Ishmael, Jan 5, 2007, in forum: Perl Misc
    Replies:
    1
    Views:
    188
    Ishmael
    Jan 5, 2007
  5. VK
    Replies:
    15
    Views:
    1,185
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page