GabrielGanne / vpp-flowtable-plugin

Proposal to add a flowtable plugin to vpp
Apache License 2.0
11 stars 7 forks source link

build issue #3

Open billvaughan opened 4 years ago

billvaughan commented 4 years ago

Hi Gabriel,

[Posting here because your qosmos.com email bounced]

I am very new to VPP but plan to use it on an upcoming project. I have created and run a test plugin using the VPP script (../../extras/emacs/make-plugin.sh). It runs without issue. I am building VPP stable/2001 from source (make build; make run). So my environment seems to be working ok. I don't have any of the VPP system libs installed. Everything is in the VPP source tree.

I would like to try your plugin but can't seem to get it built. I have not built a stand-alone plugin before but it seems like it should be simple. My test plugin is part of the VPP tree.

I would appreciate if you could spend a couple of minutes looking at the below output and let me know what you think. I am setting VPP_ROOT correctly as far as I can tell.

vppdev:~/git$
vppdev:~/git$ git clone https://github.com/GabrielGanne/vpp-flowtable-plugin.git
Cloning into 'vpp-flowtable-plugin'...
remote: Enumerating objects: 52, done.
remote: Total 52 (delta 0), reused 0 (delta 0), pack-reused 52
Unpacking objects: 100% (52/52), done.
vppdev:~/git$ cd vpp-flowtable-plugin/flowtable-plugin/
vppdev:~/git/vpp-flowtable-plugin/flowtable-plugin$ export VPP_ROOT=~/git/vpp/build-root/install-vpp_debug-native
vppdev:~/git/vpp-flowtable-plugin/flowtable-plugin$ ls -l $VPP_ROOT
total 8
drwxrwxr-x 7 vppuser vppuser 4096 Feb 16 17:10 external
drwxrwxr-x 7 vppuser vppuser 4096 Feb 16 17:12 vpp
vppdev:~/git/vpp-flowtable-plugin/flowtable-plugin$ autoreconf -i -f
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac,
libtoolize: and rerunning libtoolize and aclocal.
libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
configure.ac:5: installing './compile'
configure.ac:5: installing './config.guess'
configure.ac:5: installing './config.sub'
configure.ac:3: installing './install-sh'
configure.ac:3: installing './missing'
Makefile.am: installing './depcomp'
vppdev:~/git/vpp-flowtable-plugin/flowtable-plugin$ mkdir build
vppdev:~/git/vpp-flowtable-plugin/flowtable-plugin$ pushd build
~/git/vpp-flowtable-plugin/flowtable-plugin/build ~/git/vpp-flowtable-plugin/flowtable-plugin
vppdev:~/git/vpp-flowtable-plugin/flowtable-plugin/build$ ../configure --prefix=$VPP_ROOT/vpp
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking dependency style of gcc... gcc3
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
config.status: executing libtool commands
vppdev:~/git/vpp-flowtable-plugin/flowtable-plugin/build$
vppdev:~/git/vpp-flowtable-plugin/flowtable-plugin/build$
vppdev:~/git/vpp-flowtable-plugin/flowtable-plugin/build$
vppdev:~/git/vpp-flowtable-plugin/flowtable-plugin/build$ make
make  all-am
make[1]: Entering directory '/home/vppuser/git/vpp-flowtable-plugin/flowtable-plugin/build'
/bin/bash ./libtool  --tag=CC   --mode=compile gcc -DPACKAGE_NAME=\"flowtable_plugin\" -DPACKAGE_TARNAME=\"flowtable_plugin\" -DPACKAGE_VERSION=\"0.9\" -DPACKAGE_STRING=\"flowtable_plugin\ 0.9\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"flowtable_plugin\" -DVERSION=\"0.9\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -I..    -DDEBUG -g -g -O2 -DDEBUG -g -I/home/vppuser/git/vpp/build-root/install-vpp_debug-native/vpp/include -MT flowtable/flowtable_plugin_la-api.lo -MD -MP -MF flowtable/.deps/flowtable_plugin_la-api.Tpo -c -o flowtable/flowtable_plugin_la-api.lo `test -f 'flowtable/api.c' || echo '../'`flowtable/api.c
libtool: compile:  gcc -DPACKAGE_NAME=\"flowtable_plugin\" -DPACKAGE_TARNAME=\"flowtable_plugin\" -DPACKAGE_VERSION=\"0.9\" "-DPACKAGE_STRING=\"flowtable_plugin 0.9\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"flowtable_plugin\" -DVERSION=\"0.9\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -I.. -DDEBUG -g -g -O2 -DDEBUG -g -I/home/vppuser/git/vpp/build-root/install-vpp_debug-native/vpp/include -MT flowtable/flowtable_plugin_la-api.lo -MD -MP -MF flowtable/.deps/flowtable_plugin_la-api.Tpo -c ../flowtable/api.c  -fPIC -DPIC -o flowtable/.libs/flowtable_plugin_la-api.o
../flowtable/api.c:25:10: fatal error: flowtable/flowtable.api.h: No such file or directory
 #include <flowtable/flowtable.api.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:529: recipe for target 'flowtable/flowtable_plugin_la-api.lo' failed
make[1]: *** [flowtable/flowtable_plugin_la-api.lo] Error 1
make[1]: Leaving directory '/home/vppuser/git/vpp-flowtable-plugin/flowtable-plugin/build'
Makefile:401: recipe for target 'all' failed
make: *** [all] Error 2
vppdev:~/git/vpp-flowtable-plugin/flowtable-plugin/build$

It looks like it is not creating the flowtable include directory.

vppdev:~/git/vpp-flowtable-plugin/flowtable-plugin/build$
vppdev:~/git/vpp-flowtable-plugin/flowtable-plugin/build$
vppdev:~/git/vpp-flowtable-plugin/flowtable-plugin/build$
vppdev:~/git/vpp-flowtable-plugin/flowtable-plugin/build$ cd $VPP_ROOT
vppdev:~/git/vpp/build-root/install-vpp_debug-native$ ls
external  vpp
vppdev:~/git/vpp/build-root/install-vpp_debug-native$ cd vpp
vppdev:~/git/vpp/build-root/install-vpp_debug-native/vpp$ ls
bin  etc  include  lib  share  vpp_papi-1.6.2-py2.7.egg
vppdev:~/git/vpp/build-root/install-vpp_debug-native/vpp$ cd include/
vppdev:~/git/vpp/build-root/install-vpp_debug-native/vpp/include$ ls
nat  svm  vapi  vat  vcl  vlib  vlibapi  vlibmemory  vnet  vpp  vpp-api  vppinfra  vpp_plugins
vppdev:~/git/vpp/build-root/install-vpp_debug-native/vpp/include$ cd vpp_plugins/
vppdev:~/git/vpp/build-root/install-vpp_debug-native/vpp/include/vpp_plugins$ ls
abf  builtinurl  dhcp  dslite     gbp          igmp   ioam  lacp     map    nat   oddbuf  sctp    srv6as      svs         vrrp
acl  cdp         dns   etm        gtpu         ikev2  l2e   lb       mdata  nsh   pppoe   srv6ad  srv6mobile  tlsopenssl
avf  ct6         dpdk  flowprobe  http_static  ila    l3xc  mactime  memif  nsim  rdma    srv6am  stn         vmxnet3
vppdev:~/git/vpp/build-root/install-vpp_debug-native/vpp/include/vpp_plugins$

Really appreciate any insights you can give. I have also tried all sorts of variations including trying to build as a plugin within the VPP tree and also changing build-root to use the non-debug version. The VPP dev environment is really basic (clean checkout with only my test plugin).

Thanks, -Bill

GabrielGanne commented 4 years ago

Hi Bill,

All the commands you're running are the ones that I expect to work. It's indeed an issue with the code: vpp commit 39d69112fcec114fde34955ceb41555221d3ba11 (api: multiple connections per process) from last December breaks the build compatibility between vpp and its plugins. If you wish to simply try this plugin out, then I advise you to pick a vpp commit or a release before 39d69112fcec114fde34955ceb41555221d3ba11 (it does not matter which, vpp is usually pretty stable).

If you wish to fix this instead, you should probably do something along the line of what's been done in all the <plugin-name>: remove api boilerplate commits in vpp. Eg. ae07240340b6fb44b1a8faa38e60da43bfd1307c (the load balancing plugin).

I'll do it myself when I have the time, but I stopped maintaining this a few years ago so I'm afraid it will take me some time to get into it again. (FYI that's why the email was broken, Qosmos does not even exists anymore).

Best regards,

billvaughan commented 4 years ago

Thanks for the info Gabriel. This is helpful.