Prophidys / RTG2

Realtime Traffic Grapher 2
GNU General Public License v2.0
11 stars 9 forks source link

Compiling RTG2 on Debian Stretch/Sid #52

Open boards188 opened 8 years ago

boards188 commented 8 years ago

Is it possible to compile only the rtgpoll executable? My intentions are to run the poller on a VM and have it write to an existing MySQL database which is on a different host. Eventually, I would like to run the poller in a Docker container.

Currently, I am having issues compiling RTG2 on a Debian (stretch/sid) Linux VM. The ./configure script is halting on:

checking libtool... checking for lt_dlinit in -lltdl... no configure: error: Cannot link with libtool libs! (libltdl)

It appears the the ./bootstrap.sh script built the following version of libtool:

ltmain.sh (GNU libtool) 1.4.3 (1.922.2.111 2002/10/23 02:54:36)

But my Debian distribution has the following installed:

libtool (GNU libtool) 2.4.6

Which, I am not sure if that matters.

Any help would be appreciated.

m1ari commented 8 years ago

I've just been trying to compile on Raspbian Jessie and came across the same error.

snippet from config.log is:

configure:9198: checking libtool
configure:9206: checking for lt_dlinit in -lltdl
configure:9231: gcc -o conftest -g -O2  -L  conftest.c -lltdl  -lz -lrt -lpthread -lm -lnsl  >&5
/usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/crt1.o: In function `_start':
/build/glibc-6f8a9a/glibc-2.19/csu/../ports/sysdeps/arm/start.S:119: undefined reference to `main'
collect2: error: ld returned 1 exit status
configure:9231: $? = 1
m1ari commented 8 years ago

On Raspbain I've had to add a line to configure.in for the libltdl.so path. Without it it was adding the -L option to gcc with no path which led to the errors. I don't know if that's the same issue for debian (stretch/sid). Hopefully it might point you in the right direction..

Whilst I'm not sure it's necessary, I was able to use the older autoconf and automake versions on rasbian jessie. This produces fewer issues with the bootstrap process:

sudo apt-get install automake1.9 autoconf2.59
sudo ln -s /usr/bin/autoconf2.59 /usr/local/bin/autoconf-2.59
sudo ln -s /usr/bin/autoheader2.59 /usr/local/bin/autoheader-2.59
amver=1.9 acver=2.59 ./bootstrap.sh

For reference the path on raspbian for libltdl was /usr/lib/arm-linux-gnueabihf/libltdl.so, I'll submit a pull request for that once I've got a build working on the Pi.

boards188 commented 8 years ago

Thanks for the "pointer", m1ari! I guess I should have looked a little harder in configure.in for what was causing it to fail. I created two symbolic links for libltdl.so and libltdl.a in the /usr/lib/ directory since that is one of the locations it was looking for.

Again, thanks for the help!