USNavalResearchLaboratory / protolib

Protean Protocol Prototyping Library

Home Page:https://www.nrl.navy.mil/itd/ncs/products/protolib

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

waf build fails

j-joshua opened this issue · comments

Hi,

Running make -f Makefile.linux succeeds with warnings. Waf build has some errors.

$ ./waf --targets=*
Waf: Entering directory `/home/xxxx/protolib/build'
[45/91] Linking build/detourExample
[50/91] Compiling examples/graphRider.cpp
[57/91] Linking build/msgExample
[59/91] Compiling examples/pcapExample.cpp
[62/91] Linking build/pipe2SockExample
[63/91] Linking build/pipeExample
In file included from ../examples/graphRider.cpp:12:0:
../include/manetGraphML.h:7:10: fatal error: libxml/encoding.h: No such file or directory
 #include <libxml/encoding.h>
          ^~~~~~~~~~~~~~~~~~~
compilation terminated.

examples/detourExample.cpp.3.o: In function `DetourExample::OnStartup(int, char const* const*)':
detourExample.cpp:(.text+0xa1): undefined reference to `ProtoDetour::Create()'
collect2: error: ld returned 1 exit status

../examples/pcapExample.cpp:3:10: fatal error: protoPacketeer.h: No such file or directory
 #include "protoPacketeer.h"
          ^~~~~~~~~~~~~~~~~~
compilation terminated.

examples/msgExample.cpp.9.o: In function `main':
msgExample.cpp:(.text.startup+0x26): undefined reference to `ParseDump(char const*)'
msgExample.cpp:(.text.startup+0x56): undefined reference to `BuildPacket(unsigned int*, ManetPkt&)'
msgExample.cpp:(.text.startup+0x88): undefined reference to `MakeDump(char*, unsigned int)'
msgExample.cpp:(.text.startup+0x93): undefined reference to `ParseBuffer(unsigned int*, unsigned int)'
msgExample.cpp:(.text.startup+0xbd): undefined reference to `MakeDump(char*, unsigned int)'
collect2: error: ld returned 1 exit status

Waf: Leaving directory `/home/xxxx/protolib/build'
Build failed
 -> task in 'graphRider' failed with exit status 1 (run with -v to display more information)
 -> task in 'detourExample' failed with exit status 1 (run with -v to display more information)
 -> task in 'pcapExample' failed with exit status 1 (run with -v to display more information)
 -> task in 'msgExample' failed with exit status 1 (run with -v to display more information)

$ ./waf -v --targets=*
Waf: Entering directory `/home/xxxx/protolib/build'
[45/91] Linking build/detourExample
09:18:48 runner ['/opt/rh/devtoolset-7/root/usr/bin/g++', 'examples/detourExample.cpp.3.o', '-o/home/xxxx/protolib/build/detourExample', '-Wl,-Bstatic', '-L.', '-lprotolib', '-lprotolib'
, '-Wl,-Bdynamic', '-lpthread']
[50/91] Compiling examples/graphRider.cpp
09:18:48 runner ['/opt/rh/devtoolset-7/root/usr/bin/g++', '-fPIC', '-O3', '-Iinclude', '-I../include', '-Iinclude/unix', '-I../include/unix', '-DUNIX', '-DHAVE_DIRFD', '-DHAVE_IPV6', '-DHAV$_ASSERT', '-DHAVE_GETLOGIN', '-DLINUX', '-DHAVE_LOCKF', '-D_FILE_OFFSET_BITS=64', '-DHAVE_OLD_SIGNALHANDLER', '-DNO_SCM_RIGHTS', '-DHAVE_SCHED', '-DUSE_TIMERFD', '-DUSE_EVENTFD', '-DHAVE_PS$
LECT', '-DUSE_SELECT', '-DNDEBUG', '-DPROTO_DEBUG', '../examples/graphRider.cpp', '-c', '-o/home/xxxx/protolib/build/examples/graphRider.cpp.6.o']
[58/91] Linking build/msgExample
09:18:48 runner ['/opt/rh/devtoolset-7/root/usr/bin/g++', 'examples/msgExample.cpp.9.o', '-o/home/xxxx/protolib/build/msgExample', '-Wl,-Bstatic', '-L.', '-lprotolib', '-lprotolib', '-W$,-Bdynamic', '-lpthread']
[59/91] Compiling examples/pcapExample.cpp
09:18:48 runner ['/opt/rh/devtoolset-7/root/usr/bin/g++', '-fPIC', '-O3', '-Iinclude', '-I../include', '-Iinclude/unix', '-I../include/unix', '-DUNIX', '-DHAVE_DIRFD', '-DHAVE_IPV6', '-DHAV$_ASSERT', '-DHAVE_GETLOGIN', '-DLINUX', '-DHAVE_LOCKF', '-D_FILE_OFFSET_BITS=64', '-DHAVE_OLD_SIGNALHANDLER', '-DNO_SCM_RIGHTS', '-DHAVE_SCHED', '-DUSE_TIMERFD', '-DUSE_EVENTFD', '-DHAVE_PS$LECT', '-DUSE_SELECT', '-DNDEBUG', '-DPROTO_DEBUG', '../examples/pcapExample.cpp', '-c', '-o/home/xxxx/protolib/build/examples/pcapExample.cpp.11.o']
[64/91] Compiling examples/protoCapExample.cpp
09:18:48 runner ['/opt/rh/devtoolset-7/root/usr/bin/g++', '-fPIC', '-O3', '-Iinclude', '-I../include', '-Iinclude/unix', '-I../include/unix', '-DUNIX', '-DHAVE_DIRFD', '-DHAVE_IPV6', '-DHAV$
_ASSERT', '-DHAVE_GETLOGIN', '-DLINUX', '-DHAVE_LOCKF', '-D_FILE_OFFSET_BITS=64', '-DHAVE_OLD_SIGNALHANDLER', '-DNO_SCM_RIGHTS', '-DHAVE_SCHED', '-DUSE_TIMERFD', '-DUSE_EVENTFD', '-DHAVE_PS$
LECT', '-DUSE_SELECT', '-DNDEBUG', '-DPROTO_DEBUG', '../examples/protoCapExample.cpp', '-c', '-o/home/xxxx/protolib/build/examples/protoCapExample.cpp.14.o']
[65/91] Compiling examples/protoExample.cpp
09:18:48 runner ['/opt/rh/devtoolset-7/root/usr/bin/g++', '-fPIC', '-O3', '-Iinclude', '-I../include', '-Iinclude/unix', '-I../include/unix', '-DUNIX', '-DHAVE_DIRFD', '-DHAVE_IPV6', '-DHAV$
_ASSERT', '-DHAVE_GETLOGIN', '-DLINUX', '-DHAVE_LOCKF', '-D_FILE_OFFSET_BITS=64', '-DHAVE_OLD_SIGNALHANDLER', '-DNO_SCM_RIGHTS', '-DHAVE_SCHED', '-DUSE_TIMERFD', '-DUSE_EVENTFD', '-DHAVE_PS$LECT', '-DUSE_SELECT', '-DNDEBUG', '-DPROTO_DEBUG', '../examples/protoExample.cpp', '-c', '-o/home/xxxx/protolib/build/examples/protoExample.cpp.15.o']
In file included from ../examples/graphRider.cpp:12:0:
../include/manetGraphML.h:7:10: fatal error: libxml/encoding.h: No such file or directory
 #include <libxml/encoding.h>
          ^~~~~~~~~~~~~~~~~~~
compilation terminated.

examples/detourExample.cpp.3.o: In function `DetourExample::OnStartup(int, char const* const*)':
detourExample.cpp:(.text+0xa1): undefined reference to `ProtoDetour::Create()'
collect2: error: ld returned 1 exit status

../examples/pcapExample.cpp:3:10: fatal error: protoPacketeer.h: No such file or directory
 #include "protoPacketeer.h"
          ^~~~~~~~~~~~~~~~~~
compilation terminated.

examples/msgExample.cpp.9.o: In function `main':
msgExample.cpp:(.text.startup+0x26): undefined reference to `ParseDump(char const*)'
msgExample.cpp:(.text.startup+0x56): undefined reference to `BuildPacket(unsigned int*, ManetPkt&)'
msgExample.cpp:(.text.startup+0x88): undefined reference to `MakeDump(char*, unsigned int)'
msgExample.cpp:(.text.startup+0x93): undefined reference to `ParseBuffer(unsigned int*, unsigned int)'
msgExample.cpp:(.text.startup+0xbd): undefined reference to `MakeDump(char*, unsigned int)'
collect2: error: ld returned 1 exit status

Waf: Leaving directory `/home/xxxx/protolib/build'
Build failed
 -> task in 'graphRider' failed with exit status 1:
        {task 140693367558624: cxx graphRider.cpp -> graphRider.cpp.6.o}
['/opt/rh/devtoolset-7/root/usr/bin/g++', '-fPIC', '-O3', '-Iinclude', '-I../include', '-Iinclude/unix', '-I../include/unix', '-DUNIX', '-DHAVE_DIRFD', '-DHAVE_IPV6', '-DHAVE_ASSERT', '-DHA$
E_GETLOGIN', '-DLINUX', '-DHAVE_LOCKF', '-D_FILE_OFFSET_BITS=64', '-DHAVE_OLD_SIGNALHANDLER', '-DNO_SCM_RIGHTS', '-DHAVE_SCHED', '-DUSE_TIMERFD', '-DUSE_EVENTFD', '-DHAVE_PSELECT', '-DUSE_S$
LECT', '-DNDEBUG', '-DPROTO_DEBUG', '../examples/graphRider.cpp', '-c', '-o/home/xxxx/protolib/build/examples/graphRider.cpp.6.o']
 -> task in 'detourExample' failed with exit status 1:
        {task 140693367504640: cxxprogram detourExample.cpp.3.o -> detourExample}
['/opt/rh/devtoolset-7/root/usr/bin/g++', 'examples/detourExample.cpp.3.o', '-o/home/xxxx/protolib/build/detourExample', '-Wl,-Bstatic', '-L.', '-lprotolib', '-lprotolib', '-Wl,-Bdynamic
', '-lpthread']
 -> task in 'pcapExample' failed with exit status 1:
        {task 140693367559744: cxx pcapExample.cpp -> pcapExample.cpp.11.o}
['/opt/rh/devtoolset-7/root/usr/bin/g++', '-fPIC', '-O3', '-Iinclude', '-I../include', '-Iinclude/unix', '-I../include/unix', '-DUNIX', '-DHAVE_DIRFD', '-DHAVE_IPV6', '-DHAVE_ASSERT', '-DHAV
E_GETLOGIN', '-DLINUX', '-DHAVE_LOCKF', '-D_FILE_OFFSET_BITS=64', '-DHAVE_OLD_SIGNALHANDLER', '-DNO_SCM_RIGHTS', '-DHAVE_SCHED', '-DUSE_TIMERFD', '-DUSE_EVENTFD', '-DHAVE_PSELECT', '-DUSE_SE
LECT', '-DNDEBUG', '-DPROTO_DEBUG', '../examples/pcapExample.cpp', '-c', '-o/home/xxxx/protolib/build/examples/pcapExample.cpp.11.o']
 -> task in 'msgExample' failed with exit status 1:
        {task 140693367559344: cxxprogram msgExample.cpp.9.o -> msgExample}
['/opt/rh/devtoolset-7/root/usr/bin/g++', 'examples/msgExample.cpp.9.o', '-o/home/xxxx/protolib/build/msgExample', '-Wl,-Bstatic', '-L.', '-lprotolib', '-lprotolib', '-Wl,-Bdynamic', '-l
pthread']

#include <libxml/encoding.h>

This include comes from the libxml2 package. If on Debian/Ubuntu, install libxml2-dev or libxml2-devel on Red Hat/CentOS/Fedora.

The point is that the waf build seems to be missing the include directory path for libxml.

Hi j-joshua,

I pushed some code that should address your issues identified (Thanks!). I added code to the way script to determine the libxml2 include path using 'xml2-config' that is part of the libxml2-dev installation. I tested this on Linux (Ubuntu 16) and Mac OSX. I will check it on Windows shortly.

Protolib builds on Windows with waf but a number of the examples don't because of dependencies on additional components, etc. Specific examples can set as waf build targets as needed.

Hi j-joshua,

Let me know if this has addressed your concern and I will close this issue. I am still getting spun up on Github etiquette and am not sure of the normative issue closure process ...