p4lang / switch

Consolidated switch repo (API, SAI and Nettlink)
151 stars 72 forks source link

Compile error in switchapi #99

Closed youf3 closed 1 year ago

youf3 commented 6 years ago

I've been trying to compile the switch on the recent Ubuntu 17.10 with kernel 4.13, however, I cannot get switchapi to compile.

Steps I took are:

$ git clone https://github.com/p4lang/switch.git Cloning into 'switch'... remote: Counting objects: 3764, done. remote: Total 3764 (delta 0), reused 0 (delta 0), pack-reused 3764 Receiving objects: 100% (3764/3764), 3.24 MiB | 10.50 MiB/s, done. Resolving deltas: 100% (2598/2598), done.

$ cd switch/

$ git submodule update --init --recursive Submodule 'p4-build' (https://github.com/p4lang/p4-build.git) registered for path 'p4-build' Submodule 'switchsai/submodules/SAI' (https://github.com/p4lang/SAI) registered for path 'switchsai/submodules/SAI' Cloning into '/home/youf3/p4/switch/p4-build'... Cloning into '/home/youf3/p4/switch/switchsai/submodules/SAI'... Submodule path 'p4-build': checked out '32c897b3b03f438e36191d7002b31319eca864b4' Submodule path 'switchsai/submodules/SAI': checked out '62fb5b951ccd4d16599f4c0ff31341c48f44cdfd' Submodule 'test/ptf' (https://github.com/p4lang/ptf) registered for path 'switchsai/submodules/SAI/test/ptf' Submodule 'test/saithrift/ctypesgen' (https://github.com/davidjamesca/ctypesgen) registered for path 'switchsai/submodules/SAI/test/saithrift/ctypesgen' Cloning into '/home/youf3/p4/switch/switchsai/submodules/SAI/test/ptf'... Cloning into '/home/youf3/p4/switch/switchsai/submodules/SAI/test/saithrift/ctypesgen'... Submodule path 'switchsai/submodules/SAI/test/ptf': checked out 'fe3cd89e332d9b0e673230e06a1a7ff29d688df5' Submodule path 'switchsai/submodules/SAI/test/saithrift/ctypesgen': checked out '3d2d9803339503d2988382aa861b47a6a4872c32'

$ ./autogen.sh libtoolize: putting auxiliary files in '.'. libtoolize: copying file './ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'. libtoolize: copying file 'm4/libtool.m4' libtoolize: copying file 'm4/ltoptions.m4' libtoolize: copying file 'm4/ltsugar.m4' libtoolize: copying file 'm4/ltversion.m4' libtoolize: copying file 'm4/lt~obsolete.m4' configure.ac:65: installing './compile' configure.ac:66: installing './config.guess' configure.ac:66: installing './config.sub' configure.ac:8: installing './install-sh' configure.ac:8: installing './missing' bmv2/Makefile.am: installing './depcomp' bmv2/Makefile.am:105: installing './py-compile' parallel-tests: installing './test-driver' libtoolize: putting auxiliary files in '.'. libtoolize: copying file './ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'. libtoolize: copying file 'm4/libtool.m4' libtoolize: copying file 'm4/ltoptions.m4' libtoolize: copying file 'm4/ltsugar.m4' libtoolize: copying file 'm4/ltversion.m4' libtoolize: copying file 'm4/lt~obsolete.m4' libtoolize: 'AC_PROG_RANLIB' is rendered obsolete by 'LT_INIT' configure.ac:94: installing './compile' configure.ac:96: installing './config.guess' configure.ac:96: installing './config.sub' configure.ac:12: installing './install-sh' configure.ac:12: installing './missing' bmv2/Makefile.am: installing './depcomp'

$ ./configure --with-bmv2 --with-switchlink --enable-thrift --with-p4factory checking for a Python interpreter with version >= 2.7... python checking for python... /usr/bin/python checking for python version... 2.7 checking for python platform... linux2 checking for python script directory... ${prefix}/lib/python2.7/dist-packages checking for python extension module directory... ${exec_prefix}/lib/python2.7/dist-packages 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 whether make supports nested variables... (cached) yes Package libnl-route-3.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `libnl-route-3.0.pc' to the PKG_CONFIG_PATH environment variable No package 'libnl-route-3.0' found checking for ctypesgen.py... /usr/local/bin/ctypesgen.py 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 gcc option to accept ISO C99... none needed checking for gcc option to accept ISO Standard C... (cached) none needed checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 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 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 how to run the C++ preprocessor... g++ -E checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC -DPIC checking if g++ PIC flag -fPIC -DPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether /usr/bin/python version is >= 2.7... yes checking for /usr/bin/python version... (cached) 2.7 checking for /usr/bin/python platform... (cached) linux2 checking for /usr/bin/python script directory... (cached) ${prefix}/lib/python2.7/dist-packages checking for /usr/bin/python extension module directory... (cached) ${exec_prefix}/lib/python2.7/dist-packages checking for gawk... (cached) mawk checking for a sed that does not truncate output... (cached) /bin/sed checking for grep that handles long lines and -e... (cached) /bin/grep checking for simple_switch... /usr/local/bin/simple_switch checking assert.h usability... yes checking assert.h presence... yes checking for assert.h... yes checking stdio.h usability... yes checking stdio.h presence... yes checking for stdio.h... yes checking for string.h... (cached) yes checking for sys/stat.h... (cached) yes checking for sys/types.h... (cached) yes checking for unistd.h... (cached) yes checking for thrift... /usr/local/bin/thrift checking thrift/Thrift.h usability... yes checking thrift/Thrift.h presence... yes checking for thrift/Thrift.h... yes checking for pcap_create in -lpcap... yes checking for Judy1Next in -lJudy... yes checking for ptf... /usr/local/bin/ptf checking for memset... yes checking for select... yes checking for socket... yes checking for stdbool.h that conforms to C99... no checking for _Bool... no checking arpa/inet.h usability... yes checking arpa/inet.h presence... yes checking for arpa/inet.h... yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking stddef.h usability... yes checking stddef.h presence... yes checking for stddef.h... yes checking sys/ioctl.h usability... yes checking sys/ioctl.h presence... yes checking for sys/ioctl.h... yes checking sys/socket.h usability... yes checking sys/socket.h presence... yes checking for sys/socket.h... yes checking for ptrdiff_t... yes checking for inline... inline checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for ranlib... (cached) ranlib checking for int16_t... yes checking for int32_t... yes checking for int64_t... yes checking for int8_t... yes checking for size_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for doxygen... /usr/bin/doxygen checking for perl... /usr/bin/perl checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating switchapi/third-party/tommyds/Makefile config.status: creating switchapi/Makefile config.status: creating switchsai/Makefile config.status: creating switchlink/third-party/xxhash/Makefile config.status: creating switchlink/Makefile config.status: creating bmv2/Makefile config.status: creating Makefile config.status: creating bmv2/run_bm.sh config.status: creating bmv2/run_drivers.sh config.status: creating bmv2/run_tests.sh config.status: creating tests/run_tests.py config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands === configuring in p4-build (/home/youf3/p4/switch/p4-build) configure: running /bin/bash ./configure --disable-option-checking '--prefix=/usr/local' '--with-bmv2' '--with-switchlink' '--enable-thrift' '--with-p4factory' --cache-file=/dev/null --srcdir=. 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 for a Python interpreter with version >= 2.7... python checking for python... /usr/bin/python checking for python version... 2.7 checking for python platform... linux2 checking for python script directory... ${prefix}/lib/python2.7/dist-packages checking for python extension module directory... ${exec_prefix}/lib/python2.7/dist-packages checking for g++... g++ 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 g++ accepts -g... yes checking for style of include used by make... GNU checking dependency style of g++... gcc3 checking for gcc... gcc 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 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 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 how to run the C++ preprocessor... g++ -E checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC -DPIC checking if g++ PIC flag -fPIC -DPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether g++ supports C++11 features by default... yes checking algorithm usability... yes checking algorithm presence... yes checking for algorithm... yes checking array usability... yes checking array presence... yes checking for array... yes checking cassert usability... yes checking cassert presence... yes checking for cassert... yes checking cmath usability... yes checking cmath presence... yes checking for cmath... yes checking queue usability... yes checking queue presence... yes checking for queue... yes checking cstdio usability... yes checking cstdio presence... yes checking for cstdio... yes checking string usability... yes checking string presence... yes checking for string... yes checking for sys/stat.h... (cached) yes checking for sys/types.h... (cached) yes checking ctime usability... yes checking ctime presence... yes checking for ctime... yes checking tuple usability... yes checking tuple presence... yes checking for tuple... yes checking for unistd.h... (cached) yes checking unordered_map usability... yes checking unordered_map presence... yes checking for unordered_map... yes checking utility usability... yes checking utility presence... yes checking for utility... yes checking vector usability... yes checking vector presence... yes checking for vector... yes checking for p4c-bmv2... /usr/local/bin/p4c-bmv2 checking bm/pdfixed/pd_common.h usability... yes checking bm/pdfixed/pd_common.h presence... yes checking for bm/pdfixed/pd_common.h... yes checking bm/Standard.h usability... yes checking bm/Standard.h presence... yes checking for bm/Standard.h... yes checking for thrift... /usr/local/bin/thrift checking thrift/Thrift.h usability... yes checking thrift/Thrift.h presence... yes checking for thrift/Thrift.h... yes checking for Judy1Next in -lJudy... yes checking for nn_errno in -lnanomsg... yes checking for pthread_create in -lpthread... yes checking for size_t... yes checking for uint64_t... yes checking for a sed that does not truncate output... (cached) /bin/sed checking whether ln -s works... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating bmv2/Makefile config.status: creating bmv2/tests/Makefile config.status: creating bmv2/tests/pdtest/Makefile config.status: creating bmv2/tests/openflow/Makefile config.status: creating tools/produce_deps.py config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands

p4-build features recap ...................... P4_PATH ....................... : /home/youf3/p4/switch/p4src/switch.p4 P4_NAME ....................... : switch P4_PREFIX ..................... : dc Compile for bmv2 .............. : yes

switch features recap ...................... Coverage enabled .............. : no With switchlink ............... : yes With switchsai ................ : yes With switchapi ................ : yes With openflow ................. : no Compile for p4factory ......... : yes Compile for bmv2 .............. : yes PTF found ..................... : yes

$ make make all-recursive make[1]: Entering directory '/home/youf3/p4/switch' Making all in p4-build make[2]: Entering directory '/home/youf3/p4/switch/p4-build' make all-recursive make[3]: Entering directory '/home/youf3/p4/switch/p4-build' Making all in bmv2 make[4]: Entering directory '/home/youf3/p4/switch/p4-build/bmv2' PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/dist-packages /usr/local/bin/p4c-bmv2 --pd ./switch/ --p4-prefix dc --json ./switch.json /home/youf3/p4/switch/p4src/switch.p4 parsing successful Semantic warning: Parameter session_id of action negative_mirror defined in file /home/youf3/p4/switch/p4src/acl.p4 at line 563 is not being used and will be removed Semantic warning: Parameter fabric_mgid of action set_fabric_multicast defined in file /home/youf3/p4/switch/p4src/fabric.p4 at line 211 is not being used and will be removed Semantic warning: header type 'ieee802_1ah_t' is not reachable and will be removed Semantic warning: header type 'ipsec_esp_t' is not reachable and will be removed Semantic warning: header type 'ipsec_ah_t' is not reachable and will be removed Semantic warning: header type 'arp_rarp_t' is not reachable and will be removed Semantic warning: header type 'arp_rarp_ipv4_t' is not reachable and will be removed Semantic warning: header type 'genv_opt_A_t' is not reachable and will be removed Semantic warning: header type 'genv_opt_B_t' is not reachable and will be removed Semantic warning: header type 'genv_opt_C_t' is not reachable and will be removed Semantic warning: header type 'sflow_sample_cpu_t' is not reachable and will be removed Semantic warning: parser function 'parse_roce' is not reachable and will be removed Semantic warning: parser function 'parse_fcoe' is not reachable and will be removed Semantic warning: parser function 'parse_vpls' is not reachable and will be removed Semantic warning: parser function 'parse_pw' is not reachable and will be removed Semantic warning: parser function 'parse_udp_v6' is not reachable and will be removed Semantic warning: parser function 'parse_gre_v6' is not reachable and will be removed Semantic warning: parser function 'parse_roce_v2' is not reachable and will be removed Semantic warning: parser function 'parse_sctp' is not reachable and will be removed Semantic warning: header instance 'outer_udp' is not reachable and will be removed Semantic warning: header instance 'eompls' is not reachable and will be removed Semantic warning: parser function 'parse_nsh' is not reachable and will be removed Semantic warning: parser function 'parse_lisp' is not reachable and will be removed Semantic warning: parser function 'parse_inner_sctp' is not reachable and will be removed Semantic warning: parser function 'parse_trill' is not reachable and will be removed Semantic warning: parser function 'parse_vntag' is not reachable and will be removed Semantic warning: parser function 'parse_bfd' is not reachable and will be removed Semantic warning: header instance 'sflow_sample' is not reachable and will be removed Semantic warning: header instance 'sflow_raw_hdr_record' is not reachable and will be removed Semantic warning: header instance 'global_config_metadata' is not reachable and will be removed Semantic warning: field list 'mirror_info' is not reachable and will be removed Semantic warning: table 'outer_multicast_rpf' is not reachable and will be removed Semantic warning: table 'multicast_rpf' is not reachable and will be removed Semantic warning: header type 'eompls_t' is not reachable and will be removed Semantic warning: header type 'sflow_sample_t' is not reachable and will be removed Semantic warning: header type 'sflow_raw_hdr_record_t' is not reachable and will be removed Semantic warning: header instance 'roce' is not reachable and will be removed Semantic warning: header instance 'fcoe' is not reachable and will be removed Semantic warning: header instance 'roce_v2' is not reachable and will be removed Semantic warning: header instance 'sctp' is not reachable and will be removed Semantic warning: header instance 'nsh' is not reachable and will be removed Semantic warning: header instance 'nsh_context' is not reachable and will be removed Semantic warning: header instance 'lisp' is not reachable and will be removed Semantic warning: header instance 'inner_sctp' is not reachable and will be removed Semantic warning: header instance 'trill' is not reachable and will be removed Semantic warning: header instance 'vntag' is not reachable and will be removed Semantic warning: header instance 'bfd' is not reachable and will be removed Semantic warning: parser function 'parse_set_prio_max' is not reachable and will be removed Semantic warning: header type 'global_config_metadata_t' is not reachable and will be removed Semantic warning: action 'outer_multicast_rpf_check_pass' is not reachable and will be removed Semantic warning: action 'multicast_rpf_check_pass' is not reachable and will be removed Semantic warning: action 'multicast_rpf_check_fail' is not reachable and will be removed Semantic warning: header type 'roce_header_t' is not reachable and will be removed Semantic warning: header type 'roce_v2_header_t' is not reachable and will be removed Semantic warning: header type 'fcoe_header_t' is not reachable and will be removed Semantic warning: header type 'sctp_t' is not reachable and will be removed Semantic warning: header type 'nsh_t' is not reachable and will be removed Semantic warning: header type 'nsh_context_t' is not reachable and will be removed Semantic warning: header type 'trill_t' is not reachable and will be removed Semantic warning: header type 'lisp_t' is not reachable and will be removed Semantic warning: header type 'vntag_t' is not reachable and will be removed Semantic warning: header type 'bfd_t' is not reachable and will be removed semantic checking successful Header type standard_metadata_t not byte-aligned, adding padding Header type ingress_intrinsic_metadata_t not byte-aligned, adding padding Header type ingress_metadata_t not byte-aligned, adding padding Header type egress_metadata_t not byte-aligned, adding padding Header type l2_metadata_t not byte-aligned, adding padding Header type l3_metadata_t not byte-aligned, adding padding Header type ipv4_metadata_t not byte-aligned, adding padding Header type ipv6_metadata_t not byte-aligned, adding padding Header type tunnel_metadata_t not byte-aligned, adding padding Header type acl_metadata_t not byte-aligned, adding padding Header type nat_metadata_t not byte-aligned, adding padding Header type multicast_metadata_t not byte-aligned, adding padding Header type nexthop_metadata_t not byte-aligned, adding padding Header type security_metadata_t not byte-aligned, adding padding Header type fabric_metadata_t not byte-aligned, adding padding Header type int_metadata_i2e_t not byte-aligned, adding padding Header type meter_metadata_t not byte-aligned, adding padding Header type qos_metadata_t not byte-aligned, adding padding WARNING:p4c_bm.gen_json:Your P4 program uses the modify_field() action primitive with 3 arguments (aka masked modify), bmv2 does not support it anymore and this compiler will replace your modify_field(a, b, c) with modify_field(a, (a & ~c) | (b & c)) WARNING:p4c_bm.gen_json:Your P4 program uses the modify_field() action primitive with 3 arguments (aka masked modify), bmv2 does not support it anymore and this compiler will replace your modify_field(a, b, c) with modify_field(a, (a & ~c) | (b & c)) WARNING:p4c_bm.gen_json:Your P4 program uses the modify_field() action primitive with 3 arguments (aka masked modify), bmv2 does not support it anymore and this compiler will replace your modify_field(a, b, c) with modify_field(a, (a & ~c) | (b & c)) INFO:p4c_bm.gen_json:you are using a mask in a match table, this is still an experimental feature INFO:p4c_bm.gen_json:you are using a mask in a match table, this is still an experimental feature INFO:p4c_bm.gen_json:you are using a mask in a match table, this is still an experimental feature INFO:p4c_bm.gen_json:you are using a mask in a match table, this is still an experimental feature INFO:p4c_bm.gen_json:you are using a mask in a match table, this is still an experimental feature INFO:p4c_bm.gen_json:you are using a mask in a match table, this is still an experimental feature INFO:p4c_bm.gen_json:you are using a mask in a match table, this is still an experimental feature INFO:p4c_bm.gen_json:you are using a mask in a match table, this is still an experimental feature WARNING:p4c_bm.gen_json:The P4 program defines a checksum verification on field 'ipv4.hdrChecksum'; as of now bmv2 ignores all checksum verifications; checksum updates are processed correctly. WARNING:p4c_bm.gen_json:The P4 program defines a checksum verification on field 'inner_ipv4.hdrChecksum'; as of now bmv2 ignores all checksum verifications; checksum updates are processed correctly. Generating json output to /home/youf3/p4/switch/p4-build/bmv2/switch.json Generating PD source files in /home/youf3/p4/switch/p4-build/bmv2/switch /usr/local/bin/thrift -o ./pd_thrift_gen/ -I /usr/local/include/bm/pdfixed/thrift --gen cpp -r switch/thrift/p4_pd_rpc.thrift [WARNING:/home/youf3/p4/switch/p4-build/bmv2/switch/thrift/p4_pd_rpc.thrift:2139] Consider using the more efficient "binary" type instead of "list". /usr/local/bin/thrift -o ./pd_thrift_gen/ -I /usr/local/include/bm/pdfixed/thrift --gen py -r switch/thrift/p4_pd_rpc.thrift [WARNING:/home/youf3/p4/switch/p4-build/bmv2/switch/thrift/p4_pd_rpc.thrift:2139] Consider using the more efficient "binary" type instead of "list". mv -f pd_thrift_gen/gen-cpp/dc.h pd_thrift_gen/gen-cpp/p4_prefix.h sed --in-place 's/include "dc.h"/include "p4_prefix.h"/' pd_thrift_gen/gen-cpp/dc.cpp /usr/bin/python ../tools/split_pd_thrift.py pd_thrift_gen/gen-cpp/dc.cpp pd_thrift_gen/gen-cpp/ 3 make all-recursive make[5]: Entering directory '/home/youf3/p4/switch/p4-build/bmv2' Making all in . make[6]: Entering directory '/home/youf3/p4/switch/p4-build/bmv2' depbase=echo switch/src/pd.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||';\ /bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd.lo -MD -MP -MF $depbase.Tpo -c -o switch/src/pd.lo switch/src/pd.cpp &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd.lo -MD -MP -MF switch/src/.deps/pd.Tpo -c switch/src/pd.cpp -fPIC -DPIC -o switch/src/.libs/pd.o libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd.lo -MD -MP -MF switch/src/.deps/pd.Tpo -c switch/src/pd.cpp -o switch/src/pd.o >/dev/null 2>&1 depbase=echo switch/src/pd_learning.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||';\ /bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd_learning.lo -MD -MP -MF $depbase.Tpo -c -o switch/src/pd_learning.lo switch/src/pd_learning.cpp &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd_learning.lo -MD -MP -MF switch/src/.deps/pd_learning.Tpo -c switch/src/pd_learning.cpp -fPIC -DPIC -o switch/src/.libs/pd_learning.o libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd_learning.lo -MD -MP -MF switch/src/.deps/pd_learning.Tpo -c switch/src/pd_learning.cpp -o switch/src/pd_learning.o >/dev/null 2>&1 depbase=echo switch/src/pd_meters.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||';\ /bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd_meters.lo -MD -MP -MF $depbase.Tpo -c -o switch/src/pd_meters.lo switch/src/pd_meters.cpp &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd_meters.lo -MD -MP -MF switch/src/.deps/pd_meters.Tpo -c switch/src/pd_meters.cpp -fPIC -DPIC -o switch/src/.libs/pd_meters.o libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd_meters.lo -MD -MP -MF switch/src/.deps/pd_meters.Tpo -c switch/src/pd_meters.cpp -o switch/src/pd_meters.o >/dev/null 2>&1 depbase=echo switch/src/pd_counters.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||';\ /bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd_counters.lo -MD -MP -MF $depbase.Tpo -c -o switch/src/pd_counters.lo switch/src/pd_counters.cpp &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd_counters.lo -MD -MP -MF switch/src/.deps/pd_counters.Tpo -c switch/src/pd_counters.cpp -fPIC -DPIC -o switch/src/.libs/pd_counters.o libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd_counters.lo -MD -MP -MF switch/src/.deps/pd_counters.Tpo -c switch/src/pd_counters.cpp -o switch/src/pd_counters.o >/dev/null 2>&1 depbase=echo switch/src/pd_registers.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||';\ /bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd_registers.lo -MD -MP -MF $depbase.Tpo -c -o switch/src/pd_registers.lo switch/src/pd_registers.cpp &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd_registers.lo -MD -MP -MF switch/src/.deps/pd_registers.Tpo -c switch/src/pd_registers.cpp -fPIC -DPIC -o switch/src/.libs/pd_registers.o libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd_registers.lo -MD -MP -MF switch/src/.deps/pd_registers.Tpo -c switch/src/pd_registers.cpp -o switch/src/pd_registers.o >/dev/null 2>&1 depbase=echo switch/src/pd_tables.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||';\ /bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd_tables.lo -MD -MP -MF $depbase.Tpo -c -o switch/src/pd_tables.lo switch/src/pd_tables.cpp &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd_tables.lo -MD -MP -MF switch/src/.deps/pd_tables.Tpo -c switch/src/pd_tables.cpp -fPIC -DPIC -o switch/src/.libs/pd_tables.o libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd_tables.lo -MD -MP -MF switch/src/.deps/pd_tables.Tpo -c switch/src/pd_tables.cpp -o switch/src/pd_tables.o >/dev/null 2>&1 depbase=echo switch/src/pd_ageing.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||';\ /bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd_ageing.lo -MD -MP -MF $depbase.Tpo -c -o switch/src/pd_ageing.lo switch/src/pd_ageing.cpp &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd_ageing.lo -MD -MP -MF switch/src/.deps/pd_ageing.Tpo -c switch/src/pd_ageing.cpp -fPIC -DPIC -o switch/src/.libs/pd_ageing.o libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/src/pd_ageing.lo -MD -MP -MF switch/src/.deps/pd_ageing.Tpo -c switch/src/pd_ageing.cpp -o switch/src/pd_ageing.o >/dev/null 2>&1 /bin/bash ../libtool --tag=CXX --mode=link g++ -o libpd.la -rpath /usr/local/lib/bmpd/switch switch/src/pd.lo switch/src/pd_learning.lo switch/src/pd_meters.lo switch/src/pd_counters.lo switch/src/pd_registers.lo switch/src/pd_tables.lo switch/src/pd_ageing.lo -lpthread -lnanomsg -lJudy libtool: link: g++ -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o switch/src/.libs/pd.o switch/src/.libs/pd_learning.o switch/src/.libs/pd_meters.o switch/src/.libs/pd_counters.o switch/src/.libs/pd_registers.o switch/src/.libs/pd_tables.o switch/src/.libs/pd_ageing.o -lpthread -lnanomsg -lJudy -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o -Wl,-soname -Wl,libpd.so.0 -o .libs/libpd.so.0.0.0 libtool: link: (cd ".libs" && rm -f "libpd.so.0" && ln -s "libpd.so.0.0.0" "libpd.so.0") libtool: link: (cd ".libs" && rm -f "libpd.so" && ln -s "libpd.so.0.0.0" "libpd.so") libtool: link: ar cru .libs/libpd.a switch/src/pd.o switch/src/pd_learning.o switch/src/pd_meters.o switch/src/pd_counters.o switch/src/pd_registers.o switch/src/pd_tables.o switch/src/pd_ageing.o ar: u' modifier ignored sinceD' is the default (see U') libtool: link: ranlib .libs/libpd.a libtool: link: ( cd ".libs" && rm -f "libpd.la" && ln -s "../libpd.la" "libpd.la" ) depbase=echo pd_thrift_gen/gen-cpp/p4_prefix0.lo | sed 's|[^/]$|.deps/&|;s|.lo$||';\ /bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT pd_thrift_gen/gen-cpp/p4_prefix0.lo -MD -MP -MF $depbase.Tpo -c -o pd_thrift_gen/gen-cpp/p4_prefix0.lo pd_thrift_gen/gen-cpp/p4_prefix0.cpp &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT pd_thrift_gen/gen-cpp/p4_prefix0.lo -MD -MP -MF pd_thrift_gen/gen-cpp/.deps/p4_prefix0.Tpo -c pd_thrift_gen/gen-cpp/p4_prefix0.cpp -fPIC -DPIC -o pd_thrift_gen/gen-cpp/.libs/p4_prefix0.o libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT pd_thrift_gen/gen-cpp/p4_prefix0.lo -MD -MP -MF pd_thrift_gen/gen-cpp/.deps/p4_prefix0.Tpo -c pd_thrift_gen/gen-cpp/p4_prefix0.cpp -o pd_thrift_gen/gen-cpp/p4_prefix0.o >/dev/null 2>&1 depbase=echo pd_thrift_gen/gen-cpp/p4_prefix1.lo | sed 's|[^/]$|.deps/&|;s|.lo$||';\ /bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT pd_thrift_gen/gen-cpp/p4_prefix1.lo -MD -MP -MF $depbase.Tpo -c -o pd_thrift_gen/gen-cpp/p4_prefix1.lo pd_thrift_gen/gen-cpp/p4_prefix1.cpp &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT pd_thrift_gen/gen-cpp/p4_prefix1.lo -MD -MP -MF pd_thrift_gen/gen-cpp/.deps/p4_prefix1.Tpo -c pd_thrift_gen/gen-cpp/p4_prefix1.cpp -fPIC -DPIC -o pd_thrift_gen/gen-cpp/.libs/p4_prefix1.o libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT pd_thrift_gen/gen-cpp/p4_prefix1.lo -MD -MP -MF pd_thrift_gen/gen-cpp/.deps/p4_prefix1.Tpo -c pd_thrift_gen/gen-cpp/p4_prefix1.cpp -o pd_thrift_gen/gen-cpp/p4_prefix1.o >/dev/null 2>&1 depbase=echo pd_thrift_gen/gen-cpp/p4_prefix2.lo | sed 's|[^/]$|.deps/&|;s|.lo$||';\ /bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT pd_thrift_gen/gen-cpp/p4_prefix2.lo -MD -MP -MF $depbase.Tpo -c -o pd_thrift_gen/gen-cpp/p4_prefix2.lo pd_thrift_gen/gen-cpp/p4_prefix2.cpp &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT pd_thrift_gen/gen-cpp/p4_prefix2.lo -MD -MP -MF pd_thrift_gen/gen-cpp/.deps/p4_prefix2.Tpo -c pd_thrift_gen/gen-cpp/p4_prefix2.cpp -fPIC -DPIC -o pd_thrift_gen/gen-cpp/.libs/p4_prefix2.o libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT pd_thrift_gen/gen-cpp/p4_prefix2.lo -MD -MP -MF pd_thrift_gen/gen-cpp/.deps/p4_prefix2.Tpo -c pd_thrift_gen/gen-cpp/p4_prefix2.cpp -o pd_thrift_gen/gen-cpp/p4_prefix2.o >/dev/null 2>&1 depbase=echo pd_thrift_gen/gen-cpp/p4_pd_rpc_constants.lo | sed 's|[^/]$|.deps/&|;s|.lo$||';\ /bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT pd_thrift_gen/gen-cpp/p4_pd_rpc_constants.lo -MD -MP -MF $depbase.Tpo -c -o pd_thrift_gen/gen-cpp/p4_pd_rpc_constants.lo pd_thrift_gen/gen-cpp/p4_pd_rpc_constants.cpp &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT pd_thrift_gen/gen-cpp/p4_pd_rpc_constants.lo -MD -MP -MF pd_thrift_gen/gen-cpp/.deps/p4_pd_rpc_constants.Tpo -c pd_thrift_gen/gen-cpp/p4_pd_rpc_constants.cpp -fPIC -DPIC -o pd_thrift_gen/gen-cpp/.libs/p4_pd_rpc_constants.o libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT pd_thrift_gen/gen-cpp/p4_pd_rpc_constants.lo -MD -MP -MF pd_thrift_gen/gen-cpp/.deps/p4_pd_rpc_constants.Tpo -c pd_thrift_gen/gen-cpp/p4_pd_rpc_constants.cpp -o pd_thrift_gen/gen-cpp/p4_pd_rpc_constants.o >/dev/null 2>&1 depbase=echo pd_thrift_gen/gen-cpp/p4_pd_rpc_types.lo | sed 's|[^/]$|.deps/&|;s|.lo$||';\ /bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT pd_thrift_gen/gen-cpp/p4_pd_rpc_types.lo -MD -MP -MF $depbase.Tpo -c -o pd_thrift_gen/gen-cpp/p4_pd_rpc_types.lo pd_thrift_gen/gen-cpp/p4_pd_rpc_types.cpp &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT pd_thrift_gen/gen-cpp/p4_pd_rpc_types.lo -MD -MP -MF pd_thrift_gen/gen-cpp/.deps/p4_pd_rpc_types.Tpo -c pd_thrift_gen/gen-cpp/p4_pd_rpc_types.cpp -fPIC -DPIC -o pd_thrift_gen/gen-cpp/.libs/p4_pd_rpc_types.o libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT pd_thrift_gen/gen-cpp/p4_pd_rpc_types.lo -MD -MP -MF pd_thrift_gen/gen-cpp/.deps/p4_pd_rpc_types.Tpo -c pd_thrift_gen/gen-cpp/p4_pd_rpc_types.cpp -o pd_thrift_gen/gen-cpp/p4_pd_rpc_types.o >/dev/null 2>&1 depbase=echo switch/thrift-src/pd_rpc_server.lo | sed 's|[^/]$|.deps/&|;s|.lo$||';\ /bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/thrift-src/pd_rpc_server.lo -MD -MP -MF $depbase.Tpo -c -o switch/thrift-src/pd_rpc_server.lo switch/thrift-src/pd_rpc_server.cpp &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/thrift-src/pd_rpc_server.lo -MD -MP -MF switch/thrift-src/.deps/pd_rpc_server.Tpo -c switch/thrift-src/pd_rpc_server.cpp -fPIC -DPIC -o switch/thrift-src/.libs/pd_rpc_server.o libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -I./switch/ -I./pd_thrift_gen/gen-cpp/ -DHOST_BYTE_ORDER_CALLER -MT switch/thrift-src/pd_rpc_server.lo -MD -MP -MF switch/thrift-src/.deps/pd_rpc_server.Tpo -c switch/thrift-src/pd_rpc_server.cpp -o switch/thrift-src/pd_rpc_server.o >/dev/null 2>&1 /bin/bash ../libtool --tag=CXX --mode=link g++ -o libpdthrift.la -rpath /usr/local/lib/bmpd/switch pd_thrift_gen/gen-cpp/p4_prefix0.lo pd_thrift_gen/gen-cpp/p4_prefix1.lo pd_thrift_gen/gen-cpp/p4_prefix2.lo pd_thrift_gen/gen-cpp/p4_pd_rpc_constants.lo pd_thrift_gen/gen-cpp/p4_pd_rpc_types.lo switch/thrift-src/pd_rpc_server.lo -lpthread -lnanomsg -lJudy libtool: link: g++ -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o pd_thrift_gen/gen-cpp/.libs/p4_prefix0.o pd_thrift_gen/gen-cpp/.libs/p4_prefix1.o pd_thrift_gen/gen-cpp/.libs/p4_prefix2.o pd_thrift_gen/gen-cpp/.libs/p4_pd_rpc_constants.o pd_thrift_gen/gen-cpp/.libs/p4_pd_rpc_types.o switch/thrift-src/.libs/pd_rpc_server.o -lpthread -lnanomsg -lJudy -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o -Wl,-soname -Wl,libpdthrift.so.0 -o .libs/libpdthrift.so.0.0.0 libtool: link: (cd ".libs" && rm -f "libpdthrift.so.0" && ln -s "libpdthrift.so.0.0.0" "libpdthrift.so.0") libtool: link: (cd ".libs" && rm -f "libpdthrift.so" && ln -s "libpdthrift.so.0.0.0" "libpdthrift.so") libtool: link: ar cru .libs/libpdthrift.a pd_thrift_gen/gen-cpp/p4_prefix0.o pd_thrift_gen/gen-cpp/p4_prefix1.o pd_thrift_gen/gen-cpp/p4_prefix2.o pd_thrift_gen/gen-cpp/p4_pd_rpc_constants.o pd_thrift_gen/gen-cpp/p4_pd_rpc_types.o switch/thrift-src/pd_rpc_server.o ar:u' modifier ignored since D' is the default (seeU') libtool: link: ranlib .libs/libpdthrift.a libtool: link: ( cd ".libs" && rm -f "libpdthrift.la" && ln -s "../libpdthrift.la" "libpdthrift.la" ) make[6]: Leaving directory '/home/youf3/p4/switch/p4-build/bmv2' Making all in tests make[6]: Entering directory '/home/youf3/p4/switch/p4-build/bmv2/tests' make[7]: Entering directory '/home/youf3/p4/switch/p4-build/bmv2/tests' make[7]: Nothing to be done for 'all-am'. make[7]: Leaving directory '/home/youf3/p4/switch/p4-build/bmv2/tests' make[6]: Leaving directory '/home/youf3/p4/switch/p4-build/bmv2/tests' make[5]: Leaving directory '/home/youf3/p4/switch/p4-build/bmv2' make[4]: Leaving directory '/home/youf3/p4/switch/p4-build/bmv2' make[4]: Entering directory '/home/youf3/p4/switch/p4-build' make[4]: Leaving directory '/home/youf3/p4/switch/p4-build' make[3]: Leaving directory '/home/youf3/p4/switch/p4-build' make[2]: Leaving directory '/home/youf3/p4/switch/p4-build' Making all in switchapi make[2]: Entering directory '/home/youf3/p4/switch/switchapi' /usr/local/bin/thrift -o ./src/ --gen cpp -r ./src/switch_api.thrift [WARNING:/home/youf3/p4/switch/switchapi/src/switch_api.thrift:573] Consider using the more efficient "binary" type instead of "list". /usr/local/bin/thrift -o ./ --gen py -r ./src/switch_api.thrift [WARNING:/home/youf3/p4/switch/switchapi/src/switch_api.thrift:573] Consider using the more efficient "binary" type instead of "list". cp -r ./gen-py/switch_api/ ./switch_api_thrift Running ctypesgen on switchapi include files Makefile:2468: recipe for target 'gen-py/switch_api/switch_api_headers.py' failed make[2]: [gen-py/switch_api/switch_api_headers.py] Error 1 make[2]: Leaving directory '/home/youf3/p4/switch/switchapi' Makefile:469: recipe for target 'all-recursive' failed make[1]: [all-recursive] Error 1 make[1]: Leaving directory '/home/youf3/p4/switch' Makefile:393: recipe for target 'all' failed make: *** [all] Error 2

After the error, I forced the stderr and stdout to be printed by editing the Makefile in switchapi to find out the detail.

$ make Running ctypesgen on switchapi include files WARNING: No libraries specified INFO: Status: Preprocessing /tmp/tmpyXieu.h INFO: Status: gcc -E -U GNUC -dD -I/usr/include -I../p4src/includes -I./third-party/tommyds/include -I/usr/local/include "-Dinline=" "-Dinline=" "-Dextension=" "-Dconst=const" "-Dasm(x)=" "-Dasm(x)=" "-DCTYPESGEN=1" "/tmp/tmpyXieu.h" ERROR: gcc -E: In file included from /tmp/tmpyXieu_.h:23:0: ERROR: gcc -E: /home/youf3/p4/switch/switchapi/include/switchapi/switch_porting.h:44:2: error: #error The macro SWITCH_MALLOC is required but cannot be defined. ERROR: gcc -E: #error The macro SWITCH_MALLOC is required but cannot be defined. ERROR: gcc -E: ^~~~~ ERROR: gcc -E: /home/youf3/p4/switch/switchapi/include/switchapi/switch_porting.h:54:2: error: #error The macro SWITCH_FREE is required but cannot be defined. ERROR: gcc -E: #error The macro SWITCH_FREE is required but cannot be defined. ERROR: gcc -E: ^~~~~ ERROR: gcc -E: /home/youf3/p4/switch/switchapi/include/switchapi/switch_porting.h:64:2: error: #error The macro SWITCH_MEMSET is required but cannot be defined. ERROR: gcc -E: #error The macro SWITCH_MEMSET is required but cannot be defined. ERROR: gcc -E: ^~~~~ ERROR: gcc -E: /home/youf3/p4/switch/switchapi/include/switchapi/switch_porting.h:74:2: error: #error The macro SWITCH_MEMCPY is required but cannot be defined. ERROR: gcc -E: #error The macro SWITCH_MEMCPY is required but cannot be defined. ERROR: gcc -E: ^~~~~ ERROR: gcc -E: /home/youf3/p4/switch/switchapi/include/switchapi/switch_porting.h:84:2: error: #error The macro SWITCH_STRNCPY is required but cannot be defined. ERROR: gcc -E: #error The macro SWITCH_STRNCPY is required but cannot be defined. ERROR: gcc -E: ^~~~~ ERROR: gcc -E: /home/youf3/p4/switch/switchapi/include/switchapi/switch_porting.h:94:2: error: #error The macro SWITCH_VSNPRINTF is required but cannot be defined. ERROR: gcc -E: #error The macro SWITCH_VSNPRINTF is required but cannot be defined. ERROR: gcc -E: ^~~~~ ERROR: gcc -E: /home/youf3/p4/switch/switchapi/include/switchapi/switch_porting.h:104:2: error: #error The macro SWITCH_SNPRINTF is required but cannot be defined. ERROR: gcc -E: #error The macro SWITCH_SNPRINTF is required but cannot be defined. ERROR: gcc -E: ^~~~~ ERROR: gcc -E: /home/youf3/p4/switch/switchapi/include/switchapi/switch_porting.h:114:2: error: #error The macro SWITCH_STRLEN is required but cannot be defined. ERROR: gcc -E: #error The macro SWITCH_STRLEN is required but cannot be defined. ERROR: gcc -E: ^~~~~ Traceback (most recent call last): File "../third-party/ctypesgen/ctypesgen.py", line 154, in descriptions=ctypesgencore.parser.parse(options.headers,options) File "/home/youf3/p4/switch/third-party/ctypesgen/ctypesgencore/parser/init.py", line 21, in parse parser.parse() File "/home/youf3/p4/switch/third-party/ctypesgen/ctypesgencore/parser/datacollectingparser.py", line 69, in parse ctypesparser.CtypesParser.parse(self, fname, None) File "/home/youf3/p4/switch/third-party/ctypesgen/ctypesgencore/parser/cparser.py", line 113, in parse self.preprocessor_parser.parse(filename) File "/home/youf3/p4/switch/third-party/ctypesgen/ctypesgencore/parser/preprocessor.py", line 200, in parse token = self.lexer.token() File "/home/youf3/p4/switch/third-party/ctypesgen/ctypesgencore/parser/preprocessor.py", line 51, in token result = lex.Lexer.token(self) File "/home/youf3/p4/switch/third-party/ctypesgen/ctypesgencore/parser/lex.py", line 297, in token newtok = func(tok) File "/home/youf3/p4/switch/third-party/ctypesgen/ctypesgencore/parser/pplexer.py", line 218, in t_ANY_int g1 = str(long(g1,8)) ValueError: invalid literal for long() with base 8: '08420217248550443400745280086994171' Makefile:2468: recipe for target 'gen-py/switch_api/switch_api_headers.py' failed make: *** [gen-py/switch_api/switch_api_headers.py] Error 1

I'm not sure how to address the errors defining macros in switch_porting.h. Would you provide some help to make this work please?

fruffy commented 6 years ago

I have a similar problem compiling the switch. Same version of Ubuntu and same kernel. Same error. I am not exactly sure what might be causing it.

$make
Running ctypesgen on switchapi include files
WARNING: No libraries specified
INFO: Status: Preprocessing /tmp/tmpojhy3t.h
INFO: Status: gcc -E -U __GNUC__ -dD -I/usr/include -I../p4src/includes -I./third-party/tommyds/include -I/usr/local/include "-Dinline=" "-D__inline__=" "-D__extension__=" "-D__const=const" "-D__asm__(x)=" "-D__asm(x)=" "-DCTYPESGEN=1" "/tmp/tmpojhy3t.h"
ERROR: gcc -E: In file included from /tmp/tmpojhy3t.h:23:0:
ERROR: gcc -E: ./switchapi/include/switchapi/switch_porting.h:44:2: error: #error The macro SWITCH_MALLOC is required but cannot be defined.
ERROR: gcc -E:  #error The macro SWITCH_MALLOC is required but cannot be defined.
ERROR: gcc -E:   ^~~~~
ERROR: gcc -E: ./switchapi/include/switchapi/switch_porting.h:54:2: error: #error The macro SWITCH_FREE is required but cannot be defined.
ERROR: gcc -E:  #error The macro SWITCH_FREE is required but cannot be defined.
ERROR: gcc -E:   ^~~~~
ERROR: gcc -E: ./switchapi/include/switchapi/switch_porting.h:64:2: error: #error The macro SWITCH_MEMSET is required but cannot be defined.
ERROR: gcc -E:  #error The macro SWITCH_MEMSET is required but cannot be defined.
ERROR: gcc -E:   ^~~~~
ERROR: gcc -E: ./switchapi/include/switchapi/switch_porting.h:74:2: error: #error The macro SWITCH_MEMCPY is required but cannot be defined.
ERROR: gcc -E:  #error The macro SWITCH_MEMCPY is required but cannot be defined.
ERROR: gcc -E:   ^~~~~
ERROR: gcc -E: ./switchapi/include/switchapi/switch_porting.h:84:2: error: #error The macro SWITCH_STRNCPY is required but cannot be defined.
ERROR: gcc -E:  #error The macro SWITCH_STRNCPY is required but cannot be defined.
ERROR: gcc -E:   ^~~~~
ERROR: gcc -E: ./switchapi/include/switchapi/switch_porting.h:94:2: error: #error The macro SWITCH_VSNPRINTF is required but cannot be defined.
ERROR: gcc -E:  #error The macro SWITCH_VSNPRINTF is required but cannot be defined.
ERROR: gcc -E:   ^~~~~
ERROR: gcc -E: ./switchapi/include/switchapi/switch_porting.h:104:2: error: #error The macro SWITCH_SNPRINTF is required but cannot be defined.
ERROR: gcc -E:  #error The macro SWITCH_SNPRINTF is required but cannot be defined.
ERROR: gcc -E:   ^~~~~
ERROR: gcc -E: ./switchapi/include/switchapi/switch_porting.h:114:2: error: #error The macro SWITCH_STRLEN is required but cannot be defined.
ERROR: gcc -E:  #error The macro SWITCH_STRLEN is required but cannot be defined.
ERROR: gcc -E:   ^~~~~
Traceback (most recent call last):
  File "../third-party/ctypesgen/ctypesgen.py", line 154, in <module>
    descriptions=ctypesgencore.parser.parse(options.headers,options)
  File "./third-party/ctypesgen/ctypesgencore/parser/__init__.py", line 21, in parse
    parser.parse()
  File "./third-party/ctypesgen/ctypesgencore/parser/datacollectingparser.py", line 69, in parse
    ctypesparser.CtypesParser.parse(self, fname, None)
  File "./third-party/ctypesgen/ctypesgencore/parser/cparser.py", line 113, in parse
    self.preprocessor_parser.parse(filename)
  File "./third-party/ctypesgen/ctypesgencore/parser/preprocessor.py", line 200, in parse
    token = self.lexer.token()
  File "./third-party/ctypesgen/ctypesgencore/parser/preprocessor.py", line 51, in token
    result = lex.Lexer.token(self)
  File "./third-party/ctypesgen/ctypesgencore/parser/lex.py", line 297, in token
    newtok = func(tok)
  File "./third-party/ctypesgen/ctypesgencore/parser/pplexer.py", line 218, in t_ANY_int
    g1 = str(long(g1,8))
ValueError: invalid literal for long() with base 8: '08420217248550443400745280086994171'
Makefile:2468: recipe for target 'gen-py/switch_api/switch_api_headers.py' failed
make: *** [gen-py/switch_api/switch_api_headers.py] Error 1
fruffy commented 6 years ago

I had to perform two operations to compile the switch on Ubuntu 17.10. First, I had to change from gcc-7 to gcc-6. Second, I had to fix line 91 in switchapi/src: the assertion was missing =: assert(buf[0] == 'A'); After, I was able to compile the program. This is just a workaround for now.

frederic-loui commented 5 years ago

Hi ! I started to be desperate. Thanks to you @fruffy I managed to use this:

sudo apt update
sudo apt install gcc-6 g++-6
sudo update-alternatives --install "/usr/bin/gcc" "gcc" "/usr/bin/gcc-6" 60 --slave "/usr/bin/g++" "g++" "/usr/bin/g++-6"
sudo update-alternatives --config gcc
gcc --version
g++ --version

I found the solution here: https://forum.libreelec.tv/thread/12368-fixed-compilation-under-ubuntu-18-04-lts/ (not sure if this is safe though ... But after having corrected switchapi/src => I compiled it !) So => Thank you so much for your help.

All the best/ Frederic

youf3 commented 1 year ago

Thank you both.

I think the issue is resolved