2

I want to install the PBC library for my project. On my 64 bit system, the configure script installs 64 bit libraries readily. But the code that I have to use is built on 32-bit.

I tried this command (from an answer to this question):

./configure --build=i686-pc-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"

But I get this error when I run 'make' :

/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-field.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-z.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-naivefp.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-fastfp.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-fp.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-fasterfp.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-montfp.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-multiz.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-dlog.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-fieldquadratic.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-poly.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-random.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-init_random.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-darray.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-symtab.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-get_time.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-utils.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-memory.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-extend_printf.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-mpc.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-mnt.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-hilbert.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-curve.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-pairing.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-singular.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-param.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-a_param.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-d_param.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-e_param.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-f_param.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-g_param.o' is incompatible with i386 output

The '--help' lists out the following flags:

Some influential environment variables:
CC          C compiler command
CFLAGS      C compiler flags
LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir>
LIBS        libraries to pass to the linker, e.g. -l<library>
CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir>
CPP         C preprocessor
Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations.
Community
  • 1
  • 1
Ajoy
  • 1,838
  • 3
  • 30
  • 57

2 Answers2

2

First, check:

./configure --help

does it allow to override CFALGS/LDFLAGS?

If yes, then do it as per the help info. Second, usually, ./configure produces makefile and then you issue "make" command. You said, you got this error just after configure ?

If you are getting these errors after make then it looks like ld is linking with old-residue.

Did you try:

make clean;make
Icarus3
  • 2,310
  • 14
  • 22
  • Sorry, I forgot to mention it correctly. I get the above error when I run 'make'. I have added the output of '--help'. Do I need to add cppflags and cpp too? – Ajoy Dec 30 '12 at 04:42
  • Or do you think that --build=i686-pc-linux-gnu is wrong. Should it be something like i386-linux-gnu ?? – Ajoy Dec 30 '12 at 04:48
  • I replaced CXXFLAGS with CPPFLAGS and it worked. Thanks Icarus3 – Ajoy Dec 30 '12 at 05:29
0

Thanks @Icarus3. You pointed me in the right direction. The command I used was :

./configure --build=i686-pc-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"

When I ran

./configure --help

it did not have CXXFLAGS. So I changed it to CPPFLAGS=-m32. And it worked.

Ajoy
  • 1,838
  • 3
  • 30
  • 57