OpenWrt Forum Archive

Topic: Cross-compile gnuplot for OpenWRT Chaos Calmer 15.05

The content of this topic has been archived on 4 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi!

Faced with the problem of compiling gnuplot package. I cant link libraries libpng and libjpeg for png or jpeg plotting (via "set terminal" command). Below is all implemented steps.

I have Ubuntu 14.04 LTS, 3.13.0-106-generic, x86_64.

Step 1) Download buildroot:

git clone .../openwrt/openwrt.git -b chaos_calmer

Step 2) Updating the repository:

cd openwrt
./scripts/feeds update -a

Step 3) Download additional packages required for gnuplot:

./scripts/feeds install zlib
./scripts/feeds install libjpeg
./scripts/feeds install libpng
./scripts/feeds install libgd

Step 4) Check the necessary software for compiling:

make prereq

OK, no errors

Step 5) Setting target system options:

make menuconfig

Set:
    Target System (Atheros AR7xxx/AR9xxx)
    Target Profile (TP-LINK TL-MR3020)
Saved

Step 6) Building cross-compiler:

make tools/install -j3 V=-1
make toolchain/install -j3 V=-1

OK, no errors

Step 7) Building additional packages required for gnuplot:

make package/zlib/install -j1 V=-1
make package/libpng/install -j1 V=-1
make package/libjpeg/install -j1 V=-1
make package/libgd/install -j1 V=-1

OK, no errors

Step 8) Setting environment variables:

export STAGING_DIR="/home/vento/src/openwrt/staging_dir"
export TOOLCHAIN_DIR="${STAGING_DIR}/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2"
export PATH="${TOOLCHAIN_DIR}/bin:${PATH}"

Step 9) Download gnuplot sources:

cd ../
wget .../gnuplot/5.0.4/gnuplot-5.0.4.tar.gz -O gnuplot-5.0.4.tar.gz
tar xvf gnuplot-5.0.4.tar.gz

Step 10) Building gnuplot:

cd gnuplot-5.0.4/
./configure --prefix=$TOOLCHAIN_DIR \
   --build=x86_64-unknown-linux-gnu \
   --host=mips-openwrt-linux-uclibc \
   --without-cairo \
   --with-qt=no \
   --with-gd=$STAGING_DIR/target-mips_34kc_uClibc-0.9.33.2/usr/lib

The conclusion is a phrase that says that the png and jpeg is not supported:

 libgd-based png, jpeg, and gif terminals: no (see config.log)

config.log:

$ cat config.log | grep gd
  $ ./configure --prefix=/home/vento/src/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2 --build=x86_64-unknown-linux-gnu --host=mips-openwrt-linux-uclibc --without-cairo --with-qt=no --with-gd=/home/vento/src/openwrt/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib
configure:10835: checking for gdlib-config
configure:10853: found /usr/bin/gdlib-config
configure:10865: result: /usr/bin/gdlib-config
configure:10890: checking for gdImageCreateTrueColor in -lgd
configure:10915: mips-openwrt-linux-uclibc-gcc -o conftest        conftest.c -lgd  -ldl -lm  -lgd   >&5
/home/vento/src/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib/gcc/mips-openwrt-linux-uclibc/4.8.3/../../../../mips-openwrt-linux-uclibc/bin/ld: cannot find -lgd
/home/vento/src/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib/gcc/mips-openwrt-linux-uclibc/4.8.3/../../../../mips-openwrt-linux-uclibc/bin/ld: cannot find -lgd
| char gdImageCreateTrueColor ();
| return gdImageCreateTrueColor ();
configure:11162: WARNING: libgd not found or too old, version >= 2.0 is required
configure:16513: result:   libgd-based png, jpeg, and gif terminals: no (see config.log) 
ac_cv_lib_gd_gdImageCreateTrueColor=no
ac_cv_path_GDLIB_CONFIG=/usr/bin/gdlib-config
GDLIB_CONFIG='/usr/bin/gdlib-config'

Please indicate me where the error. How to tell the compiler configure to library obtained in step 7.

Thank you.

(Last edited by wmo on 16 Jan 2017, 15:52)

Understood!

It is necessary to set the compilation environment variables at step 8:

export LDFLAGS="-L$STAGING_DIR/target-mips_34kc_uClibc-0.9.33.2/usr/lib  -Wl,-rpath $STAGING_DIR/target-mips_34kc_uClibc-0.9.33.2/usr/lib"
export CPPFLAGS="-I$STAGING_DIR/target-mips_34kc_uClibc-0.9.33.2/usr/include"

And configure at step 10:

./configure --build=x86_64-unknown-linux-gnu \
   --host=mips-openwrt-linux-uclibc \
   --without-cairo \
   --with-qt=no

(Last edited by wmo on 17 Jan 2017, 13:30)

The discussion might have continued from here.