math::gmp install problem

J

jrpfinch

I'm trying to install the Math::GMP module on Sparc Solaris 8 and
receive the following error:

bash-2.03# make
/opt/SUNWspro/bin/cc -c -I/usr/local/include -D_LARGEFILE_SOURCE -
D_FILE_OFFSET_BITS=64 -O -DVERSION=\"2.04\" -DXS_VERSION=\"2.04\" -
KPIC "-I/usr/local/lib/perl5/5.8.8/sun4-solaris/CORE" GMP.c
Running Mkbootstrap for Math::GMP ()
chmod 644 GMP.bs
rm -f blib/arch/auto/Math/GMP/GMP.so
LD_RUN_PATH="/usr/local/lib" /opt/SUNWspro/bin/cc -G -L/usr/lib -L/
usr/ccs/lib -L/opt/SUNWspro/WS6U2/lib -L/usr/local/lib GMP.o -o blib/
arch/auto/Math/GMP/GMP.so \
-lgmp \

ld: fatal: file /usr/local/lib/libgmp.so: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to blib/arch/auto/
Math/GMP/GMP.so
*** Error code 1
make: Fatal error: Command failed for target `blib/arch/auto/Math/GMP/
GMP.so'

This is when I have installed GMP (successfully) using ./configure CC=/
opt/SUNWspro/bin/cc.

If I try to make GMP after using ./configure CC=/opt/SUNWspro/bin/cc
ABI=32 (doing a make clean first) I get:

bash-2.03# make
make all-recursive
Making all in tests
Making all in .
Making all in devel
Making all in mpn
Making all in mpz
Making all in mpq
Making all in mpf
Making all in rand
Making all in misc
Making all in cxx
Making all in mpbsd
Making all in mpn
/bin/bash ../libtool --mode=compile /opt/SUNWspro/bin/cc -
DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHIN_GMP -I.. -
DOPERATION_`echo fib_table | sed 's/_$//'` -xO4 -xarch=v8plus -
xchip=ultra3 -c -o fib_table.lo fib_table.c
mkdir .libs
/opt/SUNWspro/bin/cc -DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHIN_GMP -
I.. -DOPERATION_fib_table -xO4 -xarch=v8plus -xchip=ultra3 -c
fib_table.c -KPIC -DPIC -o .libs/fib_table.o
"../fib_table.h", line 4: warning: old-style declaration or incorrect
type for: Error
"../fib_table.h", line 4: warning: old-style declaration or incorrect
type for: error
"../fib_table.h", line 4: warning: old-style declaration or incorrect
type for: this
"../fib_table.h", line 4: syntax error before or at: data
"../fib_table.h", line 4: warning: old-style declaration or incorrect
type for: data
"../fib_table.h", line 4: warning: old-style declaration or incorrect
type for: is
"../mp_bases.h", line 4: warning: old-style declaration or incorrect
type for: bits
"../mp_bases.h", line 4: warning: old-style declaration or incorrect
type for: Error
"../mp_bases.h", line 4: warning: old-style declaration or incorrect
type for: error
"../mp_bases.h", line 4: warning: old-style declaration or incorrect
type for: this
"../mp_bases.h", line 4: syntax error before or at: data
"../mp_bases.h", line 4: warning: old-style declaration or incorrect
type for: data
"../mp_bases.h", line 4: warning: old-style declaration or incorrect
type for: is
"/usr/include/sys/int_types.h", line 62: warning: old-style
declaration or incorrect type for: bits
"fib_table.c", line 7: warning: old-style declaration or incorrect
type for: Error
"fib_table.c", line 7: warning: old-style declaration or incorrect
type for: error
"fib_table.c", line 7: warning: old-style declaration or incorrect
type for: this
"fib_table.c", line 7: syntax error before or at: data
"fib_table.c", line 7: warning: old-style declaration or incorrect
type for: data
"fib_table.c", line 7: warning: old-style declaration or incorrect
type for: is
"fib_table.c", line 10: warning: old-style declaration or incorrect
type for: bits
cc: acomp failed for fib_table.c
*** Error code 1
make: Fatal error: Command failed for target `fib_table.lo'
Current working directory /tmp/gmp-4.2.1/mpn
*** Error code 1
make: Fatal error: Command failed for target `all-recursive'
Current working directory /tmp/gmp-4.2.1
*** Error code 1
make: Fatal error: Command failed for target `all'

I would be very grateful for any advice - I have spent all day trying
to get this to work and am tearing my hair out.

Many thanks

Jon
 
S

Sisyphus

..
..
This is when I have installed GMP (successfully) using ./configure CC=/
opt/SUNWspro/bin/cc.

I really don't know if it will help (or even if you want to go down this
path) but, if you're having trouble building Math::GMP against a dynamic
build of gmp, you could try building Math::GMP against a *static* build of
gmp:

../configure CC=/opt/SUNWspro/bin/cc --disable-shared --enable-static

I guess the other consideration is that you *should* be able to build
against a shared lib if you want to ... but a static lib could be worth a
try if you have no particular reason to persist with a shared lib.

Cheers,
Rob
 
J

jrpfinch

By a bit of trial and error and reading exhaustively through the docs
the problem was solved by setting the environment variable
LD_LIBRARY_PATH to equal the empty string and then executing the
following:

../configure CC='/opt/SUNWspro/bin/cc -xarch=v8plus' ABI=32

I had to get it to compile in 32 bit mode as this was how perl was
compiled. ABI=32 was not enough - for some reason had to force it
into 32-bit by adding the xarch flag.

Cheers

Jon
 

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,965
Messages
2,570,148
Members
46,710
Latest member
FredricRen

Latest Threads

Top