Cross Compiling, Library Gmp Not Found

I'm trying to cross compile StrongSwan package on Ubuntu for Synology NAS using official Synology toolchain.

Host:
hostname = ubuntu
uname -m = i686
uname -r = 3.8.0-32-generic
uname -s = Linux

Target:
Synology:
- model DS213+
- CPU: Freescale QorIQ P1022
- Arch: PowerPC
- Endianness: Big Endian
- Linux 2.6.32
- uname -a:
Linux LupoDiskStation 2.6.32.12 #3776 SMP Sat Aug 17 02:11:24 CST 2013 ppc
GNU/Linux synology_qoriq_213+

When I run ./configure, I get error:

configure: error: GNU Multi Precision library gmp not found

Configure command:

env CC=/usr/local/powerpc-none-linux-gnuspe/bin/powerpc-none-linux-gnuspe-gcc \
LD=/usr/local/powerpc-none-linux-gnuspe/bin/powerpc-none-linux-gnuspe-ld \ 
RANLIB=/usr/local/powerpc-none-linux-gnuspe/bin/powerpc-none-linux-gnuspe-ranlib \ 
CFLAGS="-I/usr/local/powerpc-none-linux-gnuspe/include -mcpu=8548 -mhard-float -mfloat-gprs=double" \ 
LDFLAGS="-L/usr/local/powerpc-none-linux-gnuspe/lib" \ 
./configure \ 
--host=powerpc-unknown-linux \ 
--target=powerpc-unknown-linux \ 
--build=i686-pc-linux \ 
--prefix=/usr/local

If I run ./configure without extra parameters (with ubuntu gcc), I get no errors. I can also successfully compile helloworld.c with synology toolchain.

I've following GMP packages installed:

dpkg --get-selections | grep gmp
gmpc                        install
gmpc-data                   install
gmpc-dev                    install
libgmp-dev                  install
libgmp10                    install
libgmp3-dev                 install
libgmp3c2                   install
libgmpada2                  install
libgmpxx4ldbl                   install

Header file is under /usr/include/gmp.h.

Any idea how to include that gmp.h ?

3 Answers

Maybe this will help in Ubuntu 18.04?

sudo apt install libgmp-dev

1

It's working now. I had to download gmp, cross compile it and copy files to /usr/local/powerpc-none-linux-gnuspe/include dir.

2

Ok so I read into the configure file try.

./configure \ 
--host=powerpc-unknown-linux \ 
--target=powerpc-unknown-linux \ 
--build=i686-pc-linux \ 
--prefix=/usr/local \
--libdir="/usr/include"
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest