CumulusNetworks / ptm

Prescriptive Topology Daemon
Eclipse Public License 1.0
82 stars 12 forks source link

Make fails on Ubuntu 16.04 #7

Open subsecond opened 7 years ago

subsecond commented 7 years ago

I am trying to run BFD on FRR under Ubuntu 16.04 and apparently need PTM in order to get it to work. However, make fails with the following error:

root@lab-r1:mgmt:~/ptm# make
make  all-recursive
make[1]: Entering directory '/root/ptm'
Making all in lib
make[2]: Entering directory '/root/ptm/lib'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/root/ptm/lib'
Making all in src
make[2]: Entering directory '/root/ptm/src'
gcc -DHAVE_CONFIG_H -I. -I..  -I../lib -Igraph -Ihash  -Wno-enum-compare -std=gnu99 -Wall -Werror -g -O0 -DPTMD_VERSION=\"TMD_VERSION\" -g -O2 -MT ptm_event.o -MD -MP -MF .deps/ptm_event.Tpo -c -o ptm_event.o ptm_event.c
ptm_event.c: In function ‘main’:
ptm_event.c:562:13: error: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Werror=unused-result]
             fscanf(pid_fp, "%d", &my_pid);
             ^
ptm_event.c:581:9: error: ignoring return value of ‘daemon’, declared with attribute warn_unused_result [-Werror=unused-result]
         daemon(0, 0);
         ^
ptm_event.c:584:5: error: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Werror=unused-result]
     ftruncate(fileno(pid_fp), 0);
     ^
cc1: all warnings being treated as errors
Makefile:363: recipe for target 'ptm_event.o' failed
make[2]: *** [ptm_event.o] Error 1
make[2]: Leaving directory '/root/ptm/src'
Makefile:292: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/ptm'
Makefile:232: recipe for target 'all' failed
make: *** [all] Error 2

Is that something that can be fixed easily or should we look for a different implementation of BFD?

screech commented 7 years ago

This patch/change will get you past this problem .. while a cleaner fix is put in

diff --git a/src/Makefile.in b/src/Makefile.in index b2e69a4..e3d4d9b 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -221,7 +221,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ PTMD_VERSION = "2.0" AM_CPPFLAGS = -I../lib -Igraph -Ihash -AM_CFLAGS = -Wno-enum-compare -std=gnu99 -Wall -Werror -g -O0 -DPTMD_VERSION=\"$PTMD_VERSION\" +AM_CFLAGS = -Wno-enum-compare -std=gnu99 -Wall -g -O0 -DPTMD_VERSION=\"$PTMD_VERSION\" AM_LDFLAGS = -L../lib -llldpctl -lcgraph -lrt -lcdt sbin_SCRIPTS = ptmctl ptmd_LDADD = ../lib/libptmdep.a

subsecond commented 7 years ago

Thanks, that actually worked while still producing the same warnings.

However, PTM does not seem to run on Ubuntu 16.04 without making further code changes. I found the following instructions for 14.04 that show how much customization needs to be done in order to get PTM working: https://getsatisfaction.cumulusnetworks.com/cumulus/topics/has-anyone-used-bfd-with-an-ubuntu-machine#reply_16261077

Are there any plans to officially support Ubuntu as well? Currently, the only way to get BFD running in combination with FRR (frrouting.org) seems to be by using PTM.

screech commented 7 years ago

What errors did you see ? There is no official support for the github project at this point, but if you do get this working and it needs patches we will be happy to take them.

The 14.04 issues are due to older lldp and ptm library dependencies. Should not happen on 16.04, can you paste the actual issue you saw ? also a dpkg -l would be useful