Help with compiling Math::GMP on AIX 5.3

B

btna

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.
 
U

usenet

[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.
 
B

btna

[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.

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
 
B

Benoit Lefebvre

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
 
U

usenet

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?
 
B

Ben Morrow

Quoth btna said:
[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
 
B

btna

Quoth btna <[email protected]>:




[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
 
H

Heinrich Mislik

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
 
B

btna

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
 
H

Heinrich Mislik

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top