ppl is incorrectly configured in build-prerequisites.sh

Asked by Dale Lukas Peterson

Line 145 of build-prerequisites.sh has:

    --with-libgmp-prefix=$BUILDDIR_LINUX/host-libs/usr

But the configure option for ppl should be:

  --with-gmp-prefix[=DIR] search for libgmp, libgmpxx in DIR/include and DIR/lib

This causes the source build (4_6-2012q2) to fail on my machine unless I change the offending line.

Question information

Language:
English Edit question
Status:
Answered
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Zhenqiang Chen (zhenqiang-chen) said :
#1

Thank you for the bug report. I have confirmed it. We will fix it in next release.

But in our build environment, we can build it since the configure can find the related libraries from "--prefix"
    --prefix=$BUILDDIR_LINUX/host-libs/usr

Revision history for this message
Dale Lukas Peterson (hazelnusse) said :
#2

Thanks for fixing that.

Here is the configure command that gets executed on my machine:
configure --build=i686-linux-gnu --host=i686-linux-gnu --target=arm-none-eabi --prefix=/tmp/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr --disable-shared --disable-nls --with-libgmp-prefix=/tmp/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr

and here is the location of libgmp/libgmpxx:
$ ls /tmp/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/
libgmp.a libgmp.la libgmpxx.a libgmpxx.la libmpc.a libmpc.la libmpfr.a libmpfr.la

and yet configure fails:
...
checking how to link with libgmp.../tmp/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a
checking how to link with libgmpxx... /tmp/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmpxx.a /tmp/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a
checking for the GMP library version 4.1.3 or above... no
configure: error: Cannot find GMP version 4.1.3 or higher.
GMP is the GNU Multi-Precision library:
see http://www.swox.com/gmp/ for more information.
When compiling the GMP library, do not forget to enable the C++ interface:
add --enable-cxx to the configuration options.

So even though it is in the prefix, it still doesn't find it. So I'm not sure why it would work in your build environment but not on mine, because those files are in the prefix path in my build environment as well.

Revision history for this message
Zhenqiang Chen (zhenqiang-chen) said :
#3

It fails at GMP version check.

Can you show us the cmd line just after string "checking for the GMP library version 4.1.3 or above" in config.log?

In our build, it is like:
g++ -o conftest -g -O2 -frounding-math -I/home/.../build-native/host-libs/usr/include conftest.cpp /home/.../build-native/host-libs/usr/lib/libgmpxx.a /home/.../build-native/host-libs/usr/lib/libgmp.a

It can find the correct header files and libraries.

Revision history for this message
Dale Lukas Peterson (hazelnusse) said :
#4

> Can you show us the cmd line just after string "checking for the GMP
> library version 4.1.3 or above" in config.log?
>
> In our build, it is like:
> g++ -o conftest -g -O2 -frounding-math -I/home/.../build-native/host-libs/usr/include conftest.cpp /home/.../build-native/host-libs/usr/lib/libgmpxx.a /home/.../build-native/host-libs/usr/lib/libgmp.a

Here is the information you requested:
configure:11105: checking for the GMP library version 4.1.3 or above
configure:11194: g++ -o conftest -g -O2 -frounding-math
conftest.cpp /home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmpxx.a
/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a
>&5
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(mp_bpl.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(version.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(lt4-clear.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(lt27-iset_str.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(lt40-set_str.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(mp_bases.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(lt81-set_str.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(assert.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(memory.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(mp_dv_tab.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(tal-reent.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(realloc.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(add_n.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(mul_1.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(dive_1.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(lt75-mul.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(mul_fft.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(mul_n.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(mul_basecase.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(sqr_basecase.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(toom22_mul.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(toom44_mul.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(toom32_mul.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(toom42_mul.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(toom4_sqr.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(toom_interpolate_5pts.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(toom_interpolate_7pts.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(bdiv_dbm1c.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(copyi.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(mp_minv_tab.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(sub_n.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(addmul_1.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(submul_1.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(lshift.o)'
is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file
`/home/luke/Eclipse-ARM/gcc-arm-none-eabi-4_6-2012q2-20120614/build-linux/host-libs/usr/lib/libgmp.a(rshift.o)'
is incompatible with i386:x86-64 output
collect2: error: ld returned 1 exit status

I guess this is all because I'm not running 32-bit or multilib or
something like that.

Revision history for this message
chengbin (can-finner) said :
#5

Hi,
The cause is g++ in your system has x86_64 default version multilib and it generates x86_64 binaries by default, while libgmp built by our script is i386 binary.

You can build a native gcc following the step 4 in our build document and use that to build the cross-toolchain.

Thanks.

Revision history for this message
Freddie Chopin (freddie-chopin) said :
#6

There's also another solution - you just need to upgrade PPL to higher version - I used 0.12.1 and it worked. I found that it's a longg standing bug in configure of PPL and for Linaro it works as they use old build system (Ubuntu 8 with older versions of GCC) - on new machines it fails with exactly same message as you had.

If you'r native compiler is 64-bit I suggest removing all --host and --build flags from the scripts (both of them).

Revision history for this message
Nemanja Savic (vlasinac) said :
#7

OK, I have just started doing everything from the scratch.
I want to install toolchain using my gcc, which is 64 bit, so I have changed variable inside of the build-common.h.
Next, I have commented parts of the script build-prereq.sh concerning installing gmp, mpfr, mpc and ppl also.
Process quits on error while installing cloog.
These are the lines from terminal:

Package gmp : /usr/lib64
checking whether gmp works... (GMP path has been set by user)
checking gmp.h usability... yes
checking gmp.h presence... yes
checking for gmp.h... yes
checking for __gmpz_init in -lgmp... yes
yes
checking for location of PolyLib... installed in standard location
checking for PolyhedronTSort in -lpolylib64... no
Can't find PolyLib.
checking for Parma Polyhedral Library (PPL)... installed in /usr/lib64
checking ppl_c.h usability... no
checking ppl_c.h presence... no
checking for ppl_c.h... no
configure: error: Can't find PPL headers.

How is possible that gmp has been found and ppl not.

Also ehwn i run
[savi_ne@ts-070046nl ~]$ sudo yum install ppl
Loaded plugins: refresh-packagekit, rhnplugin
Setting up Install Process
Package ppl-0.10.2-11.el6.x86_64 already installed and latest version
Nothing to do

Part of the script concerning cloog is the following:

$SRCDIR/$CLOOG_PPL/configure --build=$BUILD \
    --host=$HOST_LINUX \
    --target=$TARGET \
    --prefix=$BUILDDIR_LINUX/host-libs/usr \
    --disable-shared \
    --disable-nls \
    --with-host-libstdcxx='-lstdc++' \
    --with-gmp=/usr/lib64 \
    --with-ppl=/usr/lib64

As you can see, I have changed paths to the gmp and ppl.
So, what is wrong here?
Thanks

Revision history for this message
Freddie Chopin (freddie-chopin) said :
#8

Shouldn't you install something like a "dev" package of PPL? I don't know Linux that much - sorry... I've only compiled the toolchain using the whole scripts with minor modifications - never tried using libs from the system. On the other hand, this PPL is to old for GCC, which requires 0.11, you have 0.10

4\/3!!

Revision history for this message
Nemanja Savic (vlasinac) said :
#9

Yes, I have just started writting that I have installed dev package. After I installed that, build-prerequisites.sh finished without errors, but the script build-toolchain.sh terminated as soon as it realized that I have 0.10.2 PPL (which is exactly what you (freddie) told.
Since I cannot install PPL 0.11 using YUM, may I screw my system if I install 0.11 from the source?

Revision history for this message
Freddie Chopin (freddie-chopin) said :
#10

I would first try compiling that "natively" like in the scripts - setting good BUILD and HOST_LINUX variables to the EXACT same version of compiler you have (both these vars should be equal). If that fails you can try using PPL 0.12.1 (you just need to extract it to "src" and change version number in build-common.sh).

Revision history for this message
Nemanja Savic (vlasinac) said :
#11

OK, things are going forward I hope. And thank you once more.

Is enough for BUIL and HOST_LINUX to put original values: i686-linux-gnu ?

What do you mean by "EXACT same versio of compiler ... "?

How to check if native-gcc was installed properly?

Revision history for this message
Nemanja Savic (vlasinac) said :
#12

I don't know if this means something to you:

checking for recent GMP... yes
checking for gmp internal files... no
checking for working alloca.h... yes
checking for alloca... yes
checking for __gmpz_init in -lgmp... yes
checking if gmp.h version and libgmp version are the same... (4.3.2/4.3.2) yes
checking if gmp_printf supports "%jd"... yes
checking if gmp_printf supports "%hhd"... yes
checking if gmp_printf supports "%lld"... yes
checking if gmp_printf supports "%Lf"... yes
checking if gmp_printf supports "%td"... yes
configure: creating ./config.status

These couple of lines are written duringinstallation of the mpfr.
Installations of the mpfr, mpc and ppl requires gmp, and in every configuration is stated:

--with-gmp=$BUILDDIR_LINUX/host-libs/usr

There is no sense that build crashes when at ppl, while successfully passing mpfr and mpc.
Somebody has somewhere mentioned about setting LD_LIBRARY_PATH, to a proper value, or adding attributes like ABi or CC?

Revision history for this message
Nemanja Savic (vlasinac) said :
#13

LOL, I moved to another theme by mistake, can you move last two messages to my original post?

Can you help with this problem?

Provide an answer of your own, or ask Dale Lukas Peterson for more information if necessary.

To post a message you must log in.