Anyone who can give a hint why make of project fails? - cmake

when I make the following project: https://github.com/ovrheat/raspberry_rtl_wh1080#readme on my raspberry pi, I end up with errors:
sudo make
[ 6%] Building C object src/CMakeFiles/data.dir/data.c.o
/home/pi/raspberry_rtl_wh1080/src/data.c:88:35: warning: cast between incompatible function types from ‘void (*)(data_t *)’ {aka ‘void (*)(struct data *)’} to ‘void * (*)(void *)’ [-Wcast-function-type]
88 | .array_element_release = (array_element_release_fn) data_free,
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:89:35: warning: cast between incompatible function types from ‘void (*)(data_t *)’ {aka ‘void (*)(struct data *)’} to ‘void * (*)(void *)’ [-Wcast-function-type]
89 | .value_release = (value_release_fn) data_free },
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:96:35: warning: cast between incompatible function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-function-type]
96 | .value_release = (value_release_fn) free },
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:103:35: warning: cast between incompatible function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-function-type]
103 | .value_release = (value_release_fn) free },
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:109:35: warning: cast between incompatible function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-function-type]
109 | .array_element_release = (array_element_release_fn) free,
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:110:35: warning: cast between incompatible function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-function-type]
110 | .value_release = (value_release_fn) free },
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:116:35: warning: cast between incompatible function types from ‘void (*)(data_array_t *)’ {aka ‘void (*)(struct data_array *)’} to ‘void * (*)(void *)’ [-Wcast-function-type]
116 | .array_element_release = (array_element_release_fn) data_array_free ,
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:117:35: warning: cast between incompatible function types from ‘void (*)(data_array_t *)’ {aka ‘void (*)(struct data_array *)’} to ‘void * (*)(void *)’ [-Wcast-function-type]
117 | .value_release = (value_release_fn) data_array_free },
| ^
[ 13%] Linking C static library libdata.a
[ 13%] Built target data
[ 20%] Building C object src/CMakeFiles/rtl_433.dir/baseband.c.o
[ 26%] Building C object src/CMakeFiles/rtl_433.dir/bitbuffer.c.o
[ 33%] Building C object src/CMakeFiles/rtl_433.dir/data.c.o
/home/pi/raspberry_rtl_wh1080/src/data.c:88:35: warning: cast between incompatible function types from ‘void (*)(data_t *)’ {aka ‘void (*)(struct data *)’} to ‘void * (*)(void *)’ [-Wcast-function-type]
88 | .array_element_release = (array_element_release_fn) data_free,
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:89:35: warning: cast between incompatible function types from ‘void (*)(data_t *)’ {aka ‘void (*)(struct data *)’} to ‘void * (*)(void *)’ [-Wcast-function-type]
89 | .value_release = (value_release_fn) data_free },
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:96:35: warning: cast between incompatible function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-function-type]
96 | .value_release = (value_release_fn) free },
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:103:35: warning: cast between incompatible function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-function-type]
103 | .value_release = (value_release_fn) free },
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:109:35: warning: cast between incompatible function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-function-type]
109 | .array_element_release = (array_element_release_fn) free,
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:110:35: warning: cast between incompatible function types from ‘void (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-function-type]
110 | .value_release = (value_release_fn) free },
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:116:35: warning: cast between incompatible function types from ‘void (*)(data_array_t *)’ {aka ‘void (*)(struct data_array *)’} to ‘void * (*)(void *)’ [-Wcast-function-type]
116 | .array_element_release = (array_element_release_fn) data_array_free ,
| ^
/home/pi/raspberry_rtl_wh1080/src/data.c:117:35: warning: cast between incompatible function types from ‘void (*)(data_array_t *)’ {aka ‘void (*)(struct data_array *)’} to ‘void * (*)(void *)’ [-Wcast-function-type]
117 | .value_release = (value_release_fn) data_array_free },
| ^
[ 40%] Building C object src/CMakeFiles/rtl_433.dir/pulse_demod.c.o
[ 46%] Building C object src/CMakeFiles/rtl_433.dir/pulse_detect.c.o
[ 53%] Building C object src/CMakeFiles/rtl_433.dir/rtl_433.c.o
[ 60%] Building C object src/CMakeFiles/rtl_433.dir/optparse.c.o
[ 66%] Building C object src/CMakeFiles/rtl_433.dir/util.c.o
[ 73%] Building C object src/CMakeFiles/rtl_433.dir/devices/flex.c.o
[ 80%] Building C object src/CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o
In file included from /usr/include/aarch64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from /home/pi/raspberry_rtl_wh1080/include/data.h:24,
from /home/pi/raspberry_rtl_wh1080/src/devices/fineoffset_wh1080.c:102:
/usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
| ^~~~~~~
[ 86%] Linking C executable rtl_433
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `bmp085_i2c_Read_Int':
fineoffset_wh1080.c:(.text+0x80): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `bmp085_i2c_Write_Byte':
fineoffset_wh1080.c:(.text+0xc0): undefined reference to `i2c_smbus_write_byte_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `bmp085_i2c_Read_Block':
fineoffset_wh1080.c:(.text+0xf0): undefined reference to `i2c_smbus_read_i2c_block_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `bmp085_Calibration':
fineoffset_wh1080.c:(.text+0x150): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x178): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x198): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x1b8): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x1d8): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o:fineoffset_wh1080.c:(.text+0x1f8): more undefined references to `i2c_smbus_read_word_data' follow
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `bmp085_ReadUT':
fineoffset_wh1080.c:(.text+0x320): undefined reference to `i2c_smbus_write_byte_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x338): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `bmp085_ReadUP':
fineoffset_wh1080.c:(.text+0x3c0): undefined reference to `i2c_smbus_write_byte_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x3e0): undefined reference to `i2c_smbus_read_i2c_block_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `read_int_temp':
fineoffset_wh1080.c:(.text+0x588): undefined reference to `i2c_smbus_write_byte_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x5a0): undefined reference to `i2c_smbus_read_word_data'
/usr/bin/ld: CMakeFiles/rtl_433.dir/devices/fineoffset_wh1080.c.o: in function `read_press':
fineoffset_wh1080.c:(.text+0x694): undefined reference to `i2c_smbus_write_byte_data'
/usr/bin/ld: fineoffset_wh1080.c:(.text+0x6ac): undefined reference to `i2c_smbus_read_word_data'
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/rtl_433.dir/build.make:239: src/rtl_433] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:212: src/CMakeFiles/rtl_433.dir/all] Fehler 2
make: *** [Makefile:149: all] Fehler 2
How to solve this? I've followed the instructions, but unfortunately no success. The project owner has not replied to a similar question, therefore I try to find an answer here
Is there any lib missing? Any possibility for better debugging?

Solved now. And a big thanks to #fabian. There are two steps:
The includes have been changed (Please follow: Can't compile i2c_smbus_write_byte on Raspberry Pi 4)
The CMakelists.txt in the /src folder needs to be extended on line 38 to the following:
target_link_libraries(rtl_433
${SDR_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} i2c
)

Related

YAML_CPP issue using XCode: Undefined symbols for architecture x86_64:

When I build 'SuperCollider' on MacOS 12.5.1 using using XCode and -'std=gnu++17' using it's internal 'yaml-cpp' I get:
Undefined symbols for architecture x86_64:
"YAML::BadConversion::~BadConversion()", referenced from:
YAML::TypedBadConversion<bool>::~TypedBadConversion() in libsclang.a(SC_LanguageConfig.o)
YAML::TypedBadConversion<bool>::~TypedBadConversion() in libsclang.a(SC_LanguageConfig.o)
YAML::TypedBadConversion<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::~TypedBadConversion() in libsclang.a(PyrStringPrim.o)
YAML::TypedBadConversion<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::~TypedBadConversion() in libsclang.a(PyrStringPrim.o)
"YAML::detail::node_data::convert_to_map(std::__1::shared_ptr<YAML::detail::memory_holder> const&)", referenced from:
YAML::detail::node& YAML::detail::node_data::get<char const*>(char const* const&, std::__1::shared_ptr<YAML::detail::memory_holder>) in libsclang.a(SC_LanguageConfig.o)
"typeinfo for YAML::BadConversion", referenced from:
typeinfo for YAML::TypedBadConversion<bool> in libsclang.a(SC_LanguageConfig.o)
typeinfo for YAML::TypedBadConversion<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > in libsclang.a(PyrStringPrim.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
% nm ../lang/SuperCollider.build/RelWithDebInfo/libsclang.build/Objects-normal/x86_64/SC_LanguageConfig.o | grep Conversion
U __ZN4YAML13BadConversionD2Ev
0000000000004620 T __ZN4YAML18TypedBadConversionIbED0Ev
0000000000004610 T __ZN4YAML18TypedBadConversionIbED1Ev
U __ZTIN4YAML13BadConversionE
0000000000006658 S __ZTIN4YAML18TypedBadConversionIbEE
0000000000006e0e S __ZTSN4YAML18TypedBadConversionIbEE
0000000000006670 S __ZTVN4YAML18TypedBadConversionIbEE
When I build 'SuperCollider' using the system's yaml-cpp (from Macports) it builds properly.
When I build the 'yaml_cpp' project which is using '-std=gnu++11', it works:
https://github.com/jbeder/yaml-cpp
% nm ./RelWithDebInfo/libyaml-cpp.0.7.0.dylib | grep Conversion
00000000000117e0 T __ZN4YAML13BadConversionD0Ev
00000000000117b0 T __ZN4YAML13BadConversionD1Ev
0000000000011780 T __ZN4YAML13BadConversionD2Ev
00000000000308f8 S __ZTIN4YAML13BadConversionE
000000000002ea19 S __ZTSN4YAML13BadConversionE
00000000000308d0 S __ZTVN4YAML13BadConversionE
There's are differences in exceptions.h, and no 'exceptions.cpp' in SuperCollider/external_libraries, instead, it has 'exceptions.hpp':
% diff include/yaml-cpp ~/SuperCollider/external_libraries/yaml-cpp/include/yaml-cpp/ | grep Conversion
< class YAML_CPP_API BadConversion : public RepresentationException {
> class BadConversion : public RepresentationException {
< BadConversion(const BadConversion&) = default;
< ~BadConversion() YAML_CPP_NOEXCEPT override;
Is there an issue building projects with 'yaml-cpp' with '-std=gnu++17'?
Some other issue? (E.g. - 'SuperCollider' included the wrong version of 'yaml-cpp'?

OVS with dpdk : error: ‘const struct vhost_device_ops’ has no member named ‘new_device’

I see the following error while compiling openvswitch-2.13.6 library with dpdk. I have tried to look for answers and am not able to find. I did try to see what header is included. it is from
. /usr/local/include/rte_vhost.h and I see the variable definitions are available in struct vhost_device_ops
Any pointers and suggestions are welcome.
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I ./include -I ./include -I ./lib -I ./lib -I/root/dpdk/dpdk-21.11/build -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wswitch-bool -Wlogical-not-parentheses -Wsizeof-array-argument -Wbool-compare -Wshift-negative-value -Wduplicated-cond -Wshadow -mssse3 -include rte_config.h -I/usr/local/include -D_FILE_OFFSET_BITS=64 -I/root/dpdk/dpdk-21.11/build -Ofast -msse4.2 -mpopcnt -I/root/dpdk/dpdk-21.11/build -MT lib/netdev-dpdk.lo -MD -MP -MF lib/.deps/netdev-dpdk.Tpo -c lib/netdev-dpdk.c -o lib/netdev-dpdk.o
In file included from lib/netdev-dpdk.c:52:0:
lib/dp-packet.h: In function ‘dp_packet_hwol_is_tso’:
lib/dp-packet.h:541:13: warning: "PKT_TX_TCP_SEG" is deprecated
return !!(b->mbuf.ol_flags & PKT_TX_TCP_SEG);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h: In function ‘dp_packet_hwol_is_ipv4’:
lib/dp-packet.h:548:13: warning: "PKT_TX_IPV4" is deprecated
return !!(b->mbuf.ol_flags & PKT_TX_IPV4);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h: In function ‘dp_packet_hwol_l4_mask’:
lib/dp-packet.h:555:13: warning: "PKT_TX_L4_MASK" is deprecated
return b->mbuf.ol_flags & PKT_TX_L4_MASK;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h: In function ‘dp_packet_hwol_l4_is_tcp’:
lib/dp-packet.h:562:13: warning: "PKT_TX_L4_MASK" is deprecated
return (b->mbuf.ol_flags & PKT_TX_L4_MASK) == PKT_TX_TCP_CKSUM;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h:562:13: warning: "PKT_TX_TCP_CKSUM" is deprecated
return (b->mbuf.ol_flags & PKT_TX_L4_MASK) == PKT_TX_TCP_CKSUM;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h: In function ‘dp_packet_hwol_l4_is_udp’:
lib/dp-packet.h:569:13: warning: "PKT_TX_L4_MASK" is deprecated
return (b->mbuf.ol_flags & PKT_TX_L4_MASK) == PKT_TX_UDP_CKSUM;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h:569:13: warning: "PKT_TX_UDP_CKSUM" is deprecated
return (b->mbuf.ol_flags & PKT_TX_L4_MASK) == PKT_TX_UDP_CKSUM;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h: In function ‘dp_packet_hwol_l4_is_sctp’:
lib/dp-packet.h:576:13: warning: "PKT_TX_L4_MASK" is deprecated
return (b->mbuf.ol_flags & PKT_TX_L4_MASK) == PKT_TX_SCTP_CKSUM;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h:576:13: warning: "PKT_TX_SCTP_CKSUM" is deprecated
return (b->mbuf.ol_flags & PKT_TX_L4_MASK) == PKT_TX_SCTP_CKSUM;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h: In function ‘dp_packet_hwol_set_tx_ipv4’:
lib/dp-packet.h:583:13: warning: "PKT_TX_IPV4" is deprecated
b->mbuf.ol_flags |= PKT_TX_IPV4;
^~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h: In function ‘dp_packet_hwol_set_tx_ipv6’:
lib/dp-packet.h:590:13: warning: "PKT_TX_IPV6" is deprecated
b->mbuf.ol_flags |= PKT_TX_IPV6;
^~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h: In function ‘dp_packet_hwol_set_csum_tcp’:
lib/dp-packet.h:598:13: warning: "PKT_TX_TCP_CKSUM" is deprecated
b->mbuf.ol_flags |= PKT_TX_TCP_CKSUM;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h: In function ‘dp_packet_hwol_set_csum_udp’:
lib/dp-packet.h:606:13: warning: "PKT_TX_UDP_CKSUM" is deprecated
b->mbuf.ol_flags |= PKT_TX_UDP_CKSUM;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h: In function ‘dp_packet_hwol_set_csum_sctp’:
lib/dp-packet.h:614:13: warning: "PKT_TX_SCTP_CKSUM" is deprecated
b->mbuf.ol_flags |= PKT_TX_SCTP_CKSUM;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h: In function ‘dp_packet_hwol_set_tcp_seg’:
lib/dp-packet.h:623:13: warning: "PKT_TX_TCP_SEG" is deprecated
b->mbuf.ol_flags |= PKT_TX_TCP_SEG;
^~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h: In function ‘dp_packet_set_rss_hash’:
lib/dp-packet.h:638:13: warning: "PKT_RX_RSS_HASH" is deprecated
p->mbuf.ol_flags |= PKT_RX_RSS_HASH;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h: In function ‘dp_packet_rss_valid’:
lib/dp-packet.h:644:13: warning: "PKT_RX_RSS_HASH" is deprecated
return p->mbuf.ol_flags & PKT_RX_RSS_HASH;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h: In function ‘dp_packet_reset_offload’:
lib/dp-packet.h:650:13: warning: "EXT_ATTACHED_MBUF" is deprecated
p->mbuf.ol_flags &= DPDK_MBUF_NON_OFFLOADING_FLAGS;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h:650:13: warning: "IND_ATTACHED_MBUF" is deprecated
lib/dp-packet.h: In function ‘dp_packet_ip_checksum_valid’:
lib/dp-packet.h:656:13: warning: "PKT_RX_IP_CKSUM_MASK" is deprecated
return (p->mbuf.ol_flags & PKT_RX_IP_CKSUM_MASK) ==
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h:657:13: warning: "PKT_RX_IP_CKSUM_GOOD" is deprecated
PKT_RX_IP_CKSUM_GOOD;
^~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h: In function ‘dp_packet_ip_checksum_bad’:
lib/dp-packet.h:663:13: warning: "PKT_RX_IP_CKSUM_MASK" is deprecated
return (p->mbuf.ol_flags & PKT_RX_IP_CKSUM_MASK) ==
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h:664:13: warning: "PKT_RX_IP_CKSUM_BAD" is deprecated
PKT_RX_IP_CKSUM_BAD;
^~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h: In function ‘dp_packet_l4_checksum_valid’:
lib/dp-packet.h:670:13: warning: "PKT_RX_L4_CKSUM_MASK" is deprecated
return (p->mbuf.ol_flags & PKT_RX_L4_CKSUM_MASK) ==
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h:671:13: warning: "PKT_RX_L4_CKSUM_GOOD" is deprecated
PKT_RX_L4_CKSUM_GOOD;
^~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h: In function ‘dp_packet_l4_checksum_bad’:
lib/dp-packet.h:677:13: warning: "PKT_RX_L4_CKSUM_MASK" is deprecated
return (p->mbuf.ol_flags & PKT_RX_L4_CKSUM_MASK) ==
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h:678:13: warning: "PKT_RX_L4_CKSUM_BAD" is deprecated
PKT_RX_L4_CKSUM_BAD;
^~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h: In function ‘dp_packet_has_flow_mark’:
lib/dp-packet.h:684:13: warning: "PKT_RX_FDIR_ID" is deprecated
if (p->mbuf.ol_flags & PKT_RX_FDIR_ID) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dp-packet.h: In function ‘dp_packet_set_flow_mark’:
lib/dp-packet.h:696:13: warning: "PKT_RX_FDIR_ID" is deprecated
p->mbuf.ol_flags |= PKT_RX_FDIR_ID;
^~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/netdev-dpdk.c: At top level:
lib/netdev-dpdk.c:191:21: error: variable ‘virtio_net_device_ops’ has initializer but incomplete type
static const struct vhost_device_ops virtio_net_device_ops =
^~~~~~~~~~~~~~~~
lib/netdev-dpdk.c:193:6: error: ‘const struct vhost_device_ops’ has no member named ‘new_device’
.new_device = new_device,
^~~~~~~~~~
lib/netdev-dpdk.c:193:20: warning: excess elements in struct initializer
.new_device = new_device,
^~~~~~~~~~
lib/netdev-dpdk.c:193:20: note: (near initialization for ‘virtio_net_device_ops’)
lib/netdev-dpdk.c:194:6: error: ‘const struct vhost_device_ops’ has no member named ‘destroy_device’
.destroy_device = destroy_device,
^~~~~~~~~~~~~~
lib/netdev-dpdk.c:194:23: warning: excess elements in struct initializer
.destroy_device = destroy_device,
^~~~~~~~~~~~~~
lib/netdev-dpdk.c:194:23: note: (near initialization for ‘virtio_net_device_ops’)
lib/netdev-dpdk.c:195:6: error: ‘const struct vhost_device_ops’ has no member named ‘vring_state_changed’
.vring_state_changed = vring_state_changed,
^~~~~~~~~~~~~~~~~~~
lib/netdev-dpdk.c:195:28: warning: excess elements in struct initializer
.vring_state_changed = vring_state_changed,
^~~~~~~~~~~~~~~~~~~
lib/netdev-dpdk.c:195:28: note: (near initialization for ‘virtio_net_device_ops’)
lib/netdev-dpdk.c:196:6: error: ‘const struct vhost_device_ops’ has no member named ‘features_changed’
.features_changed = NULL,
^~~~~~~~~~~~~~~~
lib/netdev-dpdk.c:196:25: warning: excess elements in struct initializer
.features_changed = NULL,
^~~~
lib/netdev-dpdk.c:196:25: note: (near initialization for ‘virtio_net_device_ops’)
lib/netdev-dpdk.c:197:6: error: ‘const struct vhost_device_ops’ has no member named ‘new_connection’
.new_connection = NULL,
^~~~~~~~~~~~~~
lib/netdev-dpdk.c:197:23: warning: excess elements in struct initializer
.new_connection = NULL,
^~~~
lib/netdev-dpdk.c:197:23: note: (near initialization for ‘virtio_net_device_ops’)
lib/netdev-dpdk.c:198:6: error: ‘const struct vhost_device_ops’ has no member named ‘destroy_connection’
.destroy_connection = destroy_connection,
^~~~~~~~~~~~~~~~~~
lib/netdev-dpdk.c:198:27: warning: excess elements in struct initializer
.destroy_connection = destroy_connection,
^~~~~~~~~~~~~~~~~~
lib/netdev-dpdk.c:198:27: note: (near initialization for ‘virtio_net_device_ops’)
lib/netdev-dpdk.c:199:6: error: ‘const struct vhost_device_ops’ has no member named ‘guest_notified’
.guest_notified = vhost_guest_notified,
^~~~~~~~~~~~~~
lib/netdev-dpdk.c:199:23: warning: excess elements in struct initializer
.guest_notified = vhost_guest_notified,
^~~~~~~~~~~~~~~~~~~~
lib/netdev-dpdk.c:199:23: note: (near initialization for ‘virtio_net_device_ops’)
lib/netdev-dpdk.c: In function ‘netdev_dpdk_get_num_ports’:
lib/netdev-dpdk.c:1342:13: error: ‘rte_eth_devices’ undeclared (first use in this function); did you mean ‘rte_eth_dev’?
if (rte_eth_devices[dev->port_id].device == device
^~~~~~~~~~~~~~~
rte_eth_dev
lib/netdev-dpdk.c:1342:13: note: each undeclared identifier is reported only once for each function it appears in
lib/netdev-dpdk.c: In function ‘vhost_common_construct’:
lib/netdev-dpdk.c:1354:44: warning: implicit declaration of function ‘rte_get_master_lcore’; did you mean ‘rte_get_main_lcore’? [-Wimplicit-function-declaration]
int socket_id = rte_lcore_to_socket_id(rte_get_master_lcore());
^~~~~~~~~~~~~~~~~~~~
rte_get_main_lcore
lib/netdev-dpdk.c: In function ‘netdev_dpdk_vhost_construct’:
lib/netdev-dpdk.c:1413:49: warning: passing argument 2 of ‘rte_vhost_driver_callback_register’ from incompatible pointer type [-Wincompatible-pointer-types]
&virtio_net_device_ops);
^
In file included from lib/netdev-dpdk.c:47:0:
/usr/local/include/rte_vhost.h:608:5: note: expected ‘const struct rte_vhost_device_ops * const’ but argument is of type ‘const struct vhost_device_ops *’
int rte_vhost_driver_callback_register(const char *path,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/netdev-dpdk.c: In function ‘netdev_dpdk_destruct’:
lib/netdev-dpdk.c:1516:20: error: ‘rte_eth_devices’ undeclared (first use in this function); did you mean ‘rte_eth_dev’?
eth_dev = &rte_eth_devices[dev->port_id];
^~~~~~~~~~~~~~~
rte_eth_dev
lib/netdev-dpdk.c:1518:20: error: dereferencing pointer to incomplete type ‘struct rte_eth_dev’
eth_dev->data &&
^~
lib/netdev-dpdk.c:1519:45: error: ‘RTE_ETH_DEV_CLOSE_REMOVE’ undeclared (first use in this function); did you mean ‘RTE_ETH_DEV_REMOVED’?
(eth_dev->data->dev_flags & RTE_ETH_DEV_CLOSE_REMOVE);
^~~~~~~~~~~~~~~~~~~~~~~~
RTE_ETH_DEV_REMOVED
lib/netdev-dpdk.c: In function ‘netdev_dpdk_vhost_client_set_config’:
lib/netdev-dpdk.c:2099:44: error: ‘RTE_VHOST_USER_DEQUEUE_ZERO_COPY’ undeclared (first use in this function); did you mean ‘RTE_VHOST_USER_ASYNC_COPY’?
dev->vhost_driver_flags |= RTE_VHOST_USER_DEQUEUE_ZERO_COPY;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RTE_VHOST_USER_ASYNC_COPY
lib/netdev-dpdk.c: In function ‘netdev_dpdk_prep_hwol_packet’:
lib/netdev-dpdk.c:2203:13: warning: "PKT_TX_L4_MASK" is deprecated
if (mbuf->ol_flags & PKT_TX_L4_MASK) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/netdev-dpdk.c:2210:13: warning: "PKT_TX_TCP_SEG" is deprecated
if (mbuf->ol_flags & PKT_TX_TCP_SEG) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/netdev-dpdk.c:2220:13: warning: "PKT_TX_TCP_CKSUM" is deprecated
mbuf->ol_flags |= PKT_TX_TCP_CKSUM;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/netdev-dpdk.c:2223:13: warning: "PKT_TX_IPV4" is deprecated
if (mbuf->ol_flags & PKT_TX_IPV4) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/netdev-dpdk.c:2224:13: warning: "PKT_TX_IP_CKSUM" is deprecated
mbuf->ol_flags |= PKT_TX_IP_CKSUM;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/netdev-dpdk.c: In function ‘netdev_dpdk_filter_packet_len’:
lib/netdev-dpdk.c:2571:13: warning: "PKT_TX_TCP_SEG" is deprecated
&& !(pkt->ol_flags & PKT_TX_TCP_SEG))) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/netdev-dpdk.c: In function ‘dpdk_copy_dp_packet_to_mbuf’:
lib/netdev-dpdk.c:2793:13: warning: "EXT_ATTACHED_MBUF" is deprecated
~(EXT_ATTACHED_MBUF | IND_ATTACHED_MBUF));
^ ~~~~~~~~~~~~~~~~~~~~~
lib/netdev-dpdk.c:2793:13: warning: "IND_ATTACHED_MBUF" is deprecated
lib/netdev-dpdk.c:2798:13: warning: "PKT_TX_L4_MASK" is deprecated
if (mbuf_dest->ol_flags & PKT_TX_L4_MASK) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/netdev-dpdk.c: In function ‘dpdk_do_tx_copy’:
lib/netdev-dpdk.c:2843:13: warning: "PKT_TX_TCP_SEG" is deprecated
&& !(packet->mbuf.ol_flags & PKT_TX_TCP_SEG)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/netdev-dpdk.c: In function ‘netdev_dpdk_get_status’:
lib/netdev-dpdk.c:3687:13: warning: "PCI_ANY_ID" is deprecated
uint16_t vendor_id = PCI_ANY_ID;
^~~~~~~~~~~~~~~~~~~~~~~~
lib/netdev-dpdk.c:3688:13: warning: "PCI_ANY_ID" is deprecated
uint16_t device_id = PCI_ANY_ID;
^~~~~~~~~~~~~~~~~~~~~~~~
lib/netdev-dpdk.c: In function ‘netdev_dpdk_detach’:
lib/netdev-dpdk.c:3811:15: error: ‘rte_eth_devices’ undeclared (first use in this function); did you mean ‘rte_eth_dev’?
rte_dev = rte_eth_devices[port_id].device;
^~~~~~~~~~~~~~~
rte_eth_dev
lib/netdev-dpdk.c: In function ‘netdev_dpdk_vhost_client_reconfigure’:
lib/netdev-dpdk.c:5235:24: error: ‘RTE_VHOST_USER_DEQUEUE_ZERO_COPY’ undeclared (first use in this function); did you mean ‘RTE_VHOST_USER_ASYNC_COPY’?
& RTE_VHOST_USER_DEQUEUE_ZERO_COPY;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RTE_VHOST_USER_ASYNC_COPY
lib/netdev-dpdk.c:5263:50: warning: passing argument 2 of ‘rte_vhost_driver_callback_register’ from incompatible pointer type [-Wincompatible-pointer-types]
&virtio_net_device_ops);
^
In file included from lib/netdev-dpdk.c:47:0:
/usr/local/include/rte_vhost.h:608:5: note: expected ‘const struct rte_vhost_device_ops * const’ but argument is of type ‘const struct vhost_device_ops *’
int rte_vhost_driver_callback_register(const char *path,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/netdev-dpdk.c: In function ‘netdev_dpdk_rte_flow_query_count’:
lib/netdev-dpdk.c:5384:45: error: ‘struct rte_flow_action_count’ has no member named ‘shared’
struct rte_flow_action_count count = { .shared = 0, .id = 0 };
^~~~~~
lib/netdev-dpdk.c:5384:63: warning: initialized field overwritten [-Woverride-init]
struct rte_flow_action_count count = { .shared = 0, .id = 0 };
^
lib/netdev-dpdk.c:5384:63: note: (near initialization for ‘count.id’)
lib/netdev-dpdk.c: At top level:
lib/netdev-dpdk.c:191:38: error: storage size of ‘virtio_net_device_ops’ isn’t known
static const struct vhost_device_ops virtio_net_device_ops =
^~~~~~~~~~~~~~~~~~~~~
Makefile:4470: recipe for target 'lib/netdev-dpdk.lo' failed
make[2]: *** [lib/netdev-dpdk.lo] Error 1
make[2]: Leaving directory '/root/dpdk/openvswitch-2.13.6'
Makefile:5199: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/dpdk/openvswitch-2.13.6'
Makefile:2953: recipe for target 'all' failed
make: *** [all] Error 2
Found the issue, OVS release notes actually has the compatible version of DPDK listed and I got compilation going.
According to the OVS release notes, DPDK version 20.11.1 needs to be used instead of the latest.
So if you are doing installation according to this manual: https://docs.openvswitch.org/en/latest/intro/install/dpdk/
you need to use
wget https://fast.dpdk.org/rel/dpdk-20.11.1.tar.xz
instead of
wget https://fast.dpdk.org/rel/dpdk-21.11.tar.xz

adding gRPC dependency to Rocksdb's CMakeLists

I'm trying to use gRPC directly in rocksdb's source code
LogAndApplyClient log_and_apply_client(grpc::CreateChannel(
secondary, grpc::InsecureChannelCredentials()));
log_and_apply_client is a basically class I wrote used for making rpcs calls, and it depends on the Stub Code generated by Protobuf. And I'm adding it directly into rocksdb's source code.
To resolve the grpc dependency, I'm adding dependency into rocksdb's CMakeLists.txt file using the CMakeLists example provided by the gRPC.
I installed gRPC and protobuf in Ubuntu18.04 and this is what I added to rocksdb's CMakeLists.
This basically finds grpc and protobuf's installation
# This branch assumes that gRPC and all its dependencies are already installed
# on this system, so they can be located by find_package().
# Find Protobuf installation
# Looks for protobuf-config.cmake file installed by Protobuf's cmake installation.
set(protobuf_MODULE_COMPATIBLE TRUE)
find_package(Protobuf CONFIG REQUIRED)
message(STATUS "Using protobuf ${Protobuf_VERSION}")
set(_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf)
set(_REFLECTION gRPC::grpc++_reflection)
if(CMAKE_CROSSCOMPILING)
find_program(_PROTOBUF_PROTOC protoc)
else()
set(_PROTOBUF_PROTOC $<TARGET_FILE:protobuf::protoc>)
endif()
# Find gRPC installation
# Looks for gRPCConfig.cmake file installed by gRPC's cmake installation.
find_package(gRPC CONFIG REQUIRED)
message(STATUS "Using gRPC ${gRPC_VERSION}")
set(_GRPC_GRPCPP gRPC::grpc++)
if(CMAKE_CROSSCOMPILING)
find_program(_GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin)
else()
set(_GRPC_CPP_PLUGIN_EXECUTABLE $<TARGET_FILE:gRPC::grpc_cpp_plugin>)
endif()
Linking the rocksdb with grpc, protobuf
add_library(${ROCKSDB_STATIC_LIB} STATIC ${SOURCES})
target_link_libraries(${ROCKSDB_STATIC_LIB} PRIVATE
${THIRDPARTY_LIBS} ${SYSTEM_LIBS}
${_REFLECTION}
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF}
)
The Rocksdb compiles fine without error, but When I'm trying to use the compiled rocksdb library, It gives me a bunch of undefined reference.
mnt/sdb/my_rocksdb/librocksdb.a(version_set.cc.o): In function `__static_initialization_and_destruction_0(int, int)':
/mnt/sdb/my_rocksdb/db/version_set.cc:4325: undefined reference to `grpc::InsecureChannelCredentials()'
/mnt/sdb/my_rocksdb/db/version_set.cc:4324: undefined reference to `grpc::CreateChannel(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<grpc::ChannelCredentials> const&)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::Response::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:468: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::Response::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:497: undefined reference to `google::protobuf::UnknownFieldSet::default_instance()'
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:497: undefined reference to `google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet const&, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::Response::ByteSizeLong() const':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:519: undefined reference to `google::protobuf::internal::ComputeUnknownFieldsSize(google::protobuf::internal::InternalMetadata const&, unsigned long, google::protobuf::internal::CachedSize*)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::Response::MergeFrom(google::protobuf::Message const&)':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:534: undefined reference to `google::protobuf::internal::ReflectionOps::Merge(google::protobuf::Message const&, google::protobuf::Message*)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::EditLists_EditList_VersionEdit::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:705: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::EditLists_EditList_VersionEdit::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:744: undefined reference to `google::protobuf::UnknownFieldSet::default_instance()'
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:744: undefined reference to `google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet const&, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::EditLists::MergeFrom(google::protobuf::Message const&)':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:1206: undefined reference to `google::protobuf::internal::ReflectionOps::Merge(google::protobuf::Message const&, google::protobuf::Message*)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::NewFile_FileMetaData_FileDescriptor::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:1378: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)'
/root/local/include/google/protobuf/unknown_field_set.h:312: undefined reference to `google::protobuf::UnknownFieldSet::ClearFallback()'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `google::protobuf::Message::Message()':
/root/local/include/google/protobuf/message.h:230: undefined reference to `vtable for google::protobuf::Message'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `google::protobuf::Message::Message(google::protobuf::Arena*)':
/root/local/include/google/protobuf/message.h:362: undefined reference to `vtable for google::protobuf::Message'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::Response::GetMetadataStatic()':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.h:207: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const*, bool)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::EditLists_EditList_VersionEdit::GetMetadataStatic()':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.h:344: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const*, bool)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::EditLists_EditList::GetMetadataStatic()':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.h:510: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const*, bool)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::EditLists::GetMetadataStatic()':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.h:658: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const*, bool)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o):(.data.rel.ro._ZTVN8logapply20NewFile_FileMetaDataE[_ZTVN8logapply20NewFile_FileMetaDataE]+0x98): undefined reference to `google::protobuf::Message::SpaceUsedLong() const'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o):(.data.rel.ro._ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE[_ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE]+0x20): undefined reference to `google::protobuf::Message::GetTypeName[abi:cxx11]() const'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o):(.data.rel.ro._ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE[_ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE]+0x48): undefined reference to `google::protobuf::Message::InitializationErrorString[abi:cxx11]() const'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o):(.data.rel.ro._ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE[_ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE]+0x50): undefined reference to `google::protobuf::Message::CheckTypeAndMergeFrom(google::protobuf::MessageLite const&)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o):(.data.rel.ro._ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE[_ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE]+0x90): undefined reference to `google::protobuf::Message::DiscardUnknownFields()'
(.data.rel.ro._ZTIN8logapply20NewFile_FileMetaDataE[_ZTIN8logapply20NewFile_FileMetaDataE]+0x10): undefined reference to `typeinfo for google::protobuf::Message'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o):(.data.rel.ro._ZTIN8logapply35NewFile_FileMetaData_FileDescriptorE[_ZTIN8logapply35NewFile_FileMetaData_FileDescriptorE]+0x10): more undefined references to `typeinfo for google::protobuf::Message' follow
collect2: error: ld returned 1 exit status
CMakeFiles/primary_server.dir/build.make:143: recipe for target 'primary_server' failed
make[2]: *** [primary_server] Error 1
CMakeFiles/Makefile2:98: recipe for target 'CMakeFiles/primary_server.dir/all' failed
make[1]: *** [CMakeFiles/primary_server.dir/all] Error 2
Makefile:102: recipe for target 'all' failed
make: *** [all] Error 2
This is the CMakeLists file I wrote for my client program which uses the rocksdb library object
# Proto file
get_filename_component(kv_proto "../protos/keyvaluestore.proto" ABSOLUTE)
get_filename_component(kv_proto_path "${kv_proto}" PATH)
# Generated sources
set(kv_proto_srcs "${CMAKE_CURRENT_BINARY_DIR}/keyvaluestore.pb.cc")
set(kv_proto_hdrs "${CMAKE_CURRENT_BINARY_DIR}/keyvaluestore.pb.h")
set(kv_grpc_srcs "${CMAKE_CURRENT_BINARY_DIR}/keyvaluestore.grpc.pb.cc")
set(kv_grpc_hdrs "${CMAKE_CURRENT_BINARY_DIR}/keyvaluestore.grpc.pb.h")
add_custom_command(
OUTPUT "${kv_proto_srcs}" "${kv_proto_hdrs}" "${kv_grpc_srcs}" "${kv_grpc_hdrs}"
COMMAND ${_PROTOBUF_PROTOC}
ARGS --grpc_out "${CMAKE_CURRENT_BINARY_DIR}"
--cpp_out "${CMAKE_CURRENT_BINARY_DIR}"
-I "${kv_proto_path}"
--plugin=protoc-gen-grpc="${_GRPC_CPP_PLUGIN_EXECUTABLE}"
"${kv_proto}"
DEPENDS "${kv_proto}")
# Include generated *.pb.h files
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
include_directories(/mnt/sdb/my_rocksdb/include)
link_directories(/mnt/sdb/my_rocksdb)
# kv_grpc_proto
add_library(kv_grpc_proto
${kv_grpc_srcs}
${kv_grpc_hdrs}
${kv_proto_srcs}
${kv_proto_hdrs})
target_link_libraries(kv_grpc_proto
${_REFLECTION}
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF}
)
# Targets greeter_[async_](client|server)
foreach(_target
kv_store_client
primary_server
)
add_executable(${_target} "${_target}.cc")
target_link_libraries(${_target}
kv_grpc_proto
${_REFLECTION}
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF}
liblog_and_apply_grpc_proto.a
librocksdb.a
)
endforeach()
I'm not quite familiar with cmake, I think I didn't get it right when I'm trying to add the dependency into rocksdb's source code and I'm really kind of stuck on this, so any suggestions will be appreciated !
The linker output seems is not linking libprotobuf.a and libgrpcpp.a
[100%] Linking CXX static library librocksdb.a
/usr/local/bin/cmake -P CMakeFiles/rocksdb.dir/cmake_clean_target.cmake
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/rocksdb.dir/link.txt --verbose=1
/usr/bin/ar qc librocksdb.a CMakeFiles/rocksdb.dir/cache/cache.cc.o CMakeFiles/rocksdb.dir/cache/clock_cache.cc.o CMakeFiles/rocksdb.dir/cache/lru_cache.cc.o CMakeFiles/rocksdb.dir/cache/sharded_cache.cc.o CMakeFiles/rocksdb.dir/db/arena_wrapped_db_iter.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_file_addition.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_file_builder.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_file_cache.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_file_garbage.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_file_meta.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_file_reader.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_log_format.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_log_sequential_reader.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_log_writer.cc.o CMakeFiles/rocksdb.dir/db/builder.cc.o CMakeFiles/rocksdb.dir/db/c.cc.o CMakeFiles/rocksdb.dir/db/column_family.cc.o CMakeFiles/rocksdb.dir/db/compacted_db_impl.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction_iterator.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction_picker.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction_job.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction_picker_fifo.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction_picker_level.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction_picker_universal.cc.o CMakeFiles/rocksdb.dir/db/compaction/sst_partitioner.cc.o CMakeFiles/rocksdb.dir/db/convenience.cc.o CMakeFiles/rocksdb.dir/db/db_filesnapshot.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_write.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_compaction_flush.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_files.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_open.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_debug.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_experimental.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_readonly.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_secondary.cc.o CMakeFiles/rocksdb.dir/db/db_info_dumper.cc.o CMakeFiles/rocksdb.dir/db/db_iter.cc.o CMakeFiles/rocksdb.dir/db/dbformat.cc.o CMakeFiles/rocksdb.dir/db/error_handler.cc.o CMakeFiles/rocksdb.dir/db/event_helpers.cc.o CMakeFiles/rocksdb.dir/db/experimental.cc.o CMakeFiles/rocksdb.dir/db/external_sst_file_ingestion_job.cc.o CMakeFiles/rocksdb.dir/db/file_indexer.cc.o CMakeFiles/rocksdb.dir/db/flush_job.cc.o CMakeFiles/rocksdb.dir/db/flush_scheduler.cc.o CMakeFiles/rocksdb.dir/db/forward_iterator.cc.o CMakeFiles/rocksdb.dir/db/import_column_family_job.cc.o CMakeFiles/rocksdb.dir/db/internal_stats.cc.o CMakeFiles/rocksdb.dir/db/logs_with_prep_tracker.cc.o CMakeFiles/rocksdb.dir/db/log_reader.cc.o CMakeFiles/rocksdb.dir/db/log_writer.cc.o CMakeFiles/rocksdb.dir/db/malloc_stats.cc.o CMakeFiles/rocksdb.dir/db/memtable.cc.o CMakeFiles/rocksdb.dir/db/memtable_list.cc.o CMakeFiles/rocksdb.dir/db/merge_helper.cc.o CMakeFiles/rocksdb.dir/db/merge_operator.cc.o CMakeFiles/rocksdb.dir/db/output_validator.cc.o CMakeFiles/rocksdb.dir/db/periodic_work_scheduler.cc.o CMakeFiles/rocksdb.dir/db/range_del_aggregator.cc.o CMakeFiles/rocksdb.dir/db/range_tombstone_fragmenter.cc.o CMakeFiles/rocksdb.dir/db/repair.cc.o CMakeFiles/rocksdb.dir/db/snapshot_impl.cc.o CMakeFiles/rocksdb.dir/db/table_cache.cc.o CMakeFiles/rocksdb.dir/db/table_properties_collector.cc.o CMakeFiles/rocksdb.dir/db/transaction_log_impl.cc.o CMakeFiles/rocksdb.dir/db/trim_history_scheduler.cc.o CMakeFiles/rocksdb.dir/db/version_builder.cc.o CMakeFiles/rocksdb.dir/db/version_edit.cc.o CMakeFiles/rocksdb.dir/db/version_edit_handler.cc.o CMakeFiles/rocksdb.dir/db/version_set.cc.o CMakeFiles/rocksdb.dir/db/wal_edit.cc.o CMakeFiles/rocksdb.dir/db/wal_manager.cc.o CMakeFiles/rocksdb.dir/db/write_batch.cc.o CMakeFiles/rocksdb.dir/db/write_batch_base.cc.o CMakeFiles/rocksdb.dir/db/write_controller.cc.o CMakeFiles/rocksdb.dir/db/write_thread.cc.o CMakeFiles/rocksdb.dir/env/env.cc.o CMakeFiles/rocksdb.dir/env/env_chroot.cc.o CMakeFiles/rocksdb.dir/env/env_encryption.cc.o CMakeFiles/rocksdb.dir/env/env_hdfs.cc.o CMakeFiles/rocksdb.dir/env/file_system.cc.o CMakeFiles/rocksdb.dir/env/file_system_tracer.cc.o CMakeFiles/rocksdb.dir/env/mock_env.cc.o CMakeFiles/rocksdb.dir/file/delete_scheduler.cc.o CMakeFiles/rocksdb.dir/file/file_prefetch_buffer.cc.o CMakeFiles/rocksdb.dir/file/file_util.cc.o CMakeFiles/rocksdb.dir/file/filename.cc.o CMakeFiles/rocksdb.dir/file/random_access_file_reader.cc.o CMakeFiles/rocksdb.dir/file/read_write_util.cc.o CMakeFiles/rocksdb.dir/file/readahead_raf.cc.o CMakeFiles/rocksdb.dir/file/sequence_file_reader.cc.o CMakeFiles/rocksdb.dir/file/sst_file_manager_impl.cc.o CMakeFiles/rocksdb.dir/file/writable_file_writer.cc.o CMakeFiles/rocksdb.dir/logging/auto_roll_logger.cc.o CMakeFiles/rocksdb.dir/logging/event_logger.cc.o CMakeFiles/rocksdb.dir/logging/log_buffer.cc.o CMakeFiles/rocksdb.dir/memory/arena.cc.o CMakeFiles/rocksdb.dir/memory/concurrent_arena.cc.o CMakeFiles/rocksdb.dir/memory/jemalloc_nodump_allocator.cc.o CMakeFiles/rocksdb.dir/memory/memkind_kmem_allocator.cc.o CMakeFiles/rocksdb.dir/memtable/alloc_tracker.cc.o CMakeFiles/rocksdb.dir/memtable/hash_linklist_rep.cc.o CMakeFiles/rocksdb.dir/memtable/hash_skiplist_rep.cc.o CMakeFiles/rocksdb.dir/memtable/skiplistrep.cc.o CMakeFiles/rocksdb.dir/memtable/vectorrep.cc.o CMakeFiles/rocksdb.dir/memtable/write_buffer_manager.cc.o CMakeFiles/rocksdb.dir/monitoring/histogram.cc.o CMakeFiles/rocksdb.dir/monitoring/histogram_windowing.cc.o CMakeFiles/rocksdb.dir/monitoring/in_memory_stats_history.cc.o CMakeFiles/rocksdb.dir/monitoring/instrumented_mutex.cc.o CMakeFiles/rocksdb.dir/monitoring/iostats_context.cc.o CMakeFiles/rocksdb.dir/monitoring/perf_context.cc.o CMakeFiles/rocksdb.dir/monitoring/perf_level.cc.o CMakeFiles/rocksdb.dir/monitoring/persistent_stats_history.cc.o CMakeFiles/rocksdb.dir/monitoring/statistics.cc.o CMakeFiles/rocksdb.dir/monitoring/thread_status_impl.cc.o CMakeFiles/rocksdb.dir/monitoring/thread_status_updater.cc.o CMakeFiles/rocksdb.dir/monitoring/thread_status_util.cc.o CMakeFiles/rocksdb.dir/monitoring/thread_status_util_debug.cc.o CMakeFiles/rocksdb.dir/options/cf_options.cc.o CMakeFiles/rocksdb.dir/options/configurable.cc.o CMakeFiles/rocksdb.dir/options/db_options.cc.o CMakeFiles/rocksdb.dir/options/options.cc.o CMakeFiles/rocksdb.dir/options/options_helper.cc.o CMakeFiles/rocksdb.dir/options/options_parser.cc.o CMakeFiles/rocksdb.dir/port/stack_trace.cc.o CMakeFiles/rocksdb.dir/table/adaptive/adaptive_table_factory.cc.o CMakeFiles/rocksdb.dir/table/block_based/binary_search_index_reader.cc.o CMakeFiles/rocksdb.dir/table/block_based/block.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_based_filter_block.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_based_table_builder.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_based_table_factory.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_based_table_iterator.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_based_table_reader.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_builder.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_prefetcher.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_prefix_index.cc.o CMakeFiles/rocksdb.dir/table/block_based/data_block_hash_index.cc.o CMakeFiles/rocksdb.dir/table/block_based/data_block_footer.cc.o CMakeFiles/rocksdb.dir/table/block_based/filter_block_reader_common.cc.o CMakeFiles/rocksdb.dir/table/block_based/filter_policy.cc.o CMakeFiles/rocksdb.dir/table/block_based/flush_block_policy.cc.o CMakeFiles/rocksdb.dir/table/block_based/full_filter_block.cc.o CMakeFiles/rocksdb.dir/table/block_based/hash_index_reader.cc.o CMakeFiles/rocksdb.dir/table/block_based/index_builder.cc.o CMakeFiles/rocksdb.dir/table/block_based/index_reader_common.cc.o CMakeFiles/rocksdb.dir/table/block_based/parsed_full_filter_block.cc.o CMakeFiles/rocksdb.dir/table/block_based/partitioned_filter_block.cc.o CMakeFiles/rocksdb.dir/table/block_based/partitioned_index_iterator.cc.o CMakeFiles/rocksdb.dir/table/block_based/partitioned_index_reader.cc.o CMakeFiles/rocksdb.dir/table/block_based/reader_common.cc.o CMakeFiles/rocksdb.dir/table/block_based/uncompression_dict_reader.cc.o CMakeFiles/rocksdb.dir/table/block_fetcher.cc.o CMakeFiles/rocksdb.dir/table/cuckoo/cuckoo_table_builder.cc.o CMakeFiles/rocksdb.dir/table/cuckoo/cuckoo_table_factory.cc.o CMakeFiles/rocksdb.dir/table/cuckoo/cuckoo_table_reader.cc.o CMakeFiles/rocksdb.dir/table/format.cc.o CMakeFiles/rocksdb.dir/table/get_context.cc.o CMakeFiles/rocksdb.dir/table/iterator.cc.o CMakeFiles/rocksdb.dir/table/merging_iterator.cc.o CMakeFiles/rocksdb.dir/table/meta_blocks.cc.o CMakeFiles/rocksdb.dir/table/persistent_cache_helper.cc.o CMakeFiles/rocksdb.dir/table/plain/plain_table_bloom.cc.o CMakeFiles/rocksdb.dir/table/plain/plain_table_builder.cc.o CMakeFiles/rocksdb.dir/table/plain/plain_table_factory.cc.o CMakeFiles/rocksdb.dir/table/plain/plain_table_index.cc.o CMakeFiles/rocksdb.dir/table/plain/plain_table_key_coding.cc.o CMakeFiles/rocksdb.dir/table/plain/plain_table_reader.cc.o CMakeFiles/rocksdb.dir/table/sst_file_dumper.cc.o CMakeFiles/rocksdb.dir/table/sst_file_reader.cc.o CMakeFiles/rocksdb.dir/table/sst_file_writer.cc.o CMakeFiles/rocksdb.dir/table/table_factory.cc.o CMakeFiles/rocksdb.dir/table/table_properties.cc.o CMakeFiles/rocksdb.dir/table/two_level_iterator.cc.o CMakeFiles/rocksdb.dir/test_util/sync_point.cc.o CMakeFiles/rocksdb.dir/test_util/sync_point_impl.cc.o CMakeFiles/rocksdb.dir/test_util/testutil.cc.o CMakeFiles/rocksdb.dir/test_util/transaction_test_util.cc.o CMakeFiles/rocksdb.dir/tools/block_cache_analyzer/block_cache_trace_analyzer.cc.o CMakeFiles/rocksdb.dir/tools/dump/db_dump_tool.cc.o CMakeFiles/rocksdb.dir/tools/io_tracer_parser_tool.cc.o CMakeFiles/rocksdb.dir/tools/ldb_cmd.cc.o CMakeFiles/rocksdb.dir/tools/ldb_tool.cc.o CMakeFiles/rocksdb.dir/tools/sst_dump_tool.cc.o CMakeFiles/rocksdb.dir/tools/trace_analyzer_tool.cc.o CMakeFiles/rocksdb.dir/trace_replay/trace_replay.cc.o CMakeFiles/rocksdb.dir/trace_replay/block_cache_tracer.cc.o CMakeFiles/rocksdb.dir/trace_replay/io_tracer.cc.o CMakeFiles/rocksdb.dir/util/coding.cc.o CMakeFiles/rocksdb.dir/util/compaction_job_stats_impl.cc.o CMakeFiles/rocksdb.dir/util/comparator.cc.o CMakeFiles/rocksdb.dir/util/compression_context_cache.cc.o CMakeFiles/rocksdb.dir/util/concurrent_task_limiter_impl.cc.o CMakeFiles/rocksdb.dir/util/crc32c.cc.o CMakeFiles/rocksdb.dir/util/dynamic_bloom.cc.o CMakeFiles/rocksdb.dir/util/hash.cc.o CMakeFiles/rocksdb.dir/util/murmurhash.cc.o CMakeFiles/rocksdb.dir/util/random.cc.o CMakeFiles/rocksdb.dir/util/rate_limiter.cc.o CMakeFiles/rocksdb.dir/util/slice.cc.o CMakeFiles/rocksdb.dir/util/file_checksum_helper.cc.o CMakeFiles/rocksdb.dir/util/status.cc.o CMakeFiles/rocksdb.dir/util/string_util.cc.o CMakeFiles/rocksdb.dir/util/thread_local.cc.o CMakeFiles/rocksdb.dir/util/threadpool_imp.cc.o CMakeFiles/rocksdb.dir/util/xxhash.cc.o CMakeFiles/rocksdb.dir/utilities/backupable/backupable_db.cc.o CMakeFiles/rocksdb.dir/utilities/blob_db/blob_compaction_filter.cc.o CMakeFiles/rocksdb.dir/utilities/blob_db/blob_db.cc.o CMakeFiles/rocksdb.dir/utilities/blob_db/blob_db_impl.cc.o CMakeFiles/rocksdb.dir/utilities/blob_db/blob_db_impl_filesnapshot.cc.o CMakeFiles/rocksdb.dir/utilities/blob_db/blob_dump_tool.cc.o CMakeFiles/rocksdb.dir/utilities/blob_db/blob_file.cc.o CMakeFiles/rocksdb.dir/utilities/cassandra/cassandra_compaction_filter.cc.o CMakeFiles/rocksdb.dir/utilities/cassandra/format.cc.o CMakeFiles/rocksdb.dir/utilities/cassandra/merge_operator.cc.o CMakeFiles/rocksdb.dir/utilities/checkpoint/checkpoint_impl.cc.o CMakeFiles/rocksdb.dir/utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc.o CMakeFiles/rocksdb.dir/utilities/debug.cc.o CMakeFiles/rocksdb.dir/utilities/env_mirror.cc.o CMakeFiles/rocksdb.dir/utilities/env_timed.cc.o CMakeFiles/rocksdb.dir/utilities/fault_injection_env.cc.o CMakeFiles/rocksdb.dir/utilities/fault_injection_fs.cc.o CMakeFiles/rocksdb.dir/utilities/leveldb_options/leveldb_options.cc.o CMakeFiles/rocksdb.dir/utilities/memory/memory_util.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/bytesxor.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/max.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/put.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/sortlist.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/string_append/stringappend.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/string_append/stringappend2.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/uint64add.cc.o CMakeFiles/rocksdb.dir/utilities/object_registry.cc.o CMakeFiles/rocksdb.dir/utilities/option_change_migration/option_change_migration.cc.o CMakeFiles/rocksdb.dir/utilities/options/options_util.cc.o CMakeFiles/rocksdb.dir/utilities/persistent_cache/block_cache_tier.cc.o CMakeFiles/rocksdb.dir/utilities/persistent_cache/block_cache_tier_file.cc.o CMakeFiles/rocksdb.dir/utilities/persistent_cache/block_cache_tier_metadata.cc.o CMakeFiles/rocksdb.dir/utilities/persistent_cache/persistent_cache_tier.cc.o CMakeFiles/rocksdb.dir/utilities/persistent_cache/volatile_tier_impl.cc.o CMakeFiles/rocksdb.dir/utilities/simulator_cache/cache_simulator.cc.o CMakeFiles/rocksdb.dir/utilities/simulator_cache/sim_cache.cc.o CMakeFiles/rocksdb.dir/utilities/table_properties_collectors/compact_on_deletion_collector.cc.o CMakeFiles/rocksdb.dir/utilities/trace/file_trace_reader_writer.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/lock/lock_manager.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/lock/point/point_lock_tracker.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/lock/point/point_lock_manager.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/optimistic_transaction_db_impl.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/optimistic_transaction.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/pessimistic_transaction.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/pessimistic_transaction_db.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/snapshot_checker.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/transaction_base.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/transaction_db_mutex_impl.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/transaction_util.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/write_prepared_txn.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/write_prepared_txn_db.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/write_unprepared_txn.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/write_unprepared_txn_db.cc.o CMakeFiles/rocksdb.dir/utilities/ttl/db_ttl_impl.cc.o CMakeFiles/rocksdb.dir/utilities/write_batch_with_index/write_batch_with_index.cc.o CMakeFiles/rocksdb.dir/utilities/write_batch_with_index/write_batch_with_index_internal.cc.o CMakeFiles/rocksdb.dir/rubble/logAndApply/logAndApply.grpc.pb.cc.o CMakeFiles/rocksdb.dir/rubble/logAndApply/logAndApply.pb.cc.o CMakeFiles/rocksdb.dir/port/port_posix.cc.o CMakeFiles/rocksdb.dir/env/env_posix.cc.o CMakeFiles/rocksdb.dir/env/fs_posix.cc.o CMakeFiles/rocksdb.dir/env/io_posix.cc.o CMakeFiles/rocksdb.dir/third-party/folly/folly/detail/Futex.cpp.o CMakeFiles/rocksdb.dir/third-party/folly/folly/synchronization/AtomicNotification.cpp.o CMakeFiles/rocksdb.dir/third-party/folly/folly/synchronization/DistributedMutex.cpp.o CMakeFiles/rocksdb.dir/third-party/folly/folly/synchronization/ParkingLot.cpp.o CMakeFiles/rocksdb.dir/third-party/folly/folly/synchronization/WaitOptions.cpp.o CMakeFiles/rocksdb.dir/logAndApply.grpc.pb.cc.o CMakeFiles/rocksdb.dir/logAndApply.pb.cc.o CMakeFiles/build_version.dir/build_version.cc.o
/usr/bin/ranlib librocksdb.a
doing a grep on the output on grpc and protobuf didn't give me the library... So linker somehow fails to find the lib, which is confusing to me cause I did a
target_link_libraries(${ROCKSDB_STATIC_LIB} PRIVATE
${THIRDPARTY_LIBS} ${SYSTEM_LIBS}
${_REFLECTION}
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF}
)
in rocksdb's CMakeLists.

Which version of protocol buffers does TensorFlow 1.1 depend on?

It is unclear which version of protocol buffers TensorFlow 1.1 depends on.
The pip package built by TensorFlow 1.1 depends on protobuf >= 3.2.
The TensorFlow installation instructions for Ubuntu reference protobuf 3.1.
Furthermore, attempting to build TensorFlow 1.1 from source whilst using protobuf 3.1, 3.2, or 3.3 built from source fails.
I can build TensorFlow 1.1 from source as long as I allow it to build its own copy of protobuf but I would rather it used a common version if possible.
If I build protobuf 3.1 from source and then attempt to build TensorFlow 1.1 from source I get the following error:
ERROR: <snip>/.cache/bazel/_bazel_daniel/041a78b467f26d47aee0fcd68c1f3624/external/protobuf/BUILD:73:1: C++ compilation of rule '#protobuf//:protobuf_lite' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG ... (remaining 45 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
external/protobuf/src/google/protobuf/wire_format_lite.cc:393:67: error: no 'void google::protobuf::internal::WireFormatLite::WriteFloatArray(const float*, int, google::protobuf::io::CodedOutputStream*)' member function declared in class 'google::protobuf::internal::WireFormatLite'
io::CodedOutputStream* output) {
^
external/protobuf/src/google/protobuf/wire_format_lite.cc:398:67: error: no 'void google::protobuf::internal::WireFormatLite::WriteDoubleArray(const double*, int, google::protobuf::io::CodedOutputStream*)' member function declared in class 'google::protobuf::internal::WireFormatLite'
io::CodedOutputStream* output) {
^
external/protobuf/src/google/protobuf/wire_format_lite.cc:403:67: error: no 'void google::protobuf::internal::WireFormatLite::WriteFixed32Array(const uint32*, int, google::protobuf::io::CodedOutputStream*)' member function declared in class 'google::protobuf::internal::WireFormatLite'
io::CodedOutputStream* output) {
^
external/protobuf/src/google/protobuf/wire_format_lite.cc:408:69: error: no 'void google::protobuf::internal::WireFormatLite::WriteFixed64Array(const uint64*, int, google::protobuf::io::CodedOutputStream*)' member function declared in class 'google::protobuf::internal::WireFormatLite'
io::CodedOutputStream* output) {
^
external/protobuf/src/google/protobuf/wire_format_lite.cc:413:69: error: no 'void google::protobuf::internal::WireFormatLite::WriteSFixed32Array(const int32*, int, google::protobuf::io::CodedOutputStream*)' member function declared in class 'google::protobuf::internal::WireFormatLite'
io::CodedOutputStream* output) {
^
external/protobuf/src/google/protobuf/wire_format_lite.cc:418:69: error: no 'void google::protobuf::internal::WireFormatLite::WriteSFixed64Array(const int64*, int, google::protobuf::io::CodedOutputStream*)' member function declared in class 'google::protobuf::internal::WireFormatLite'
io::CodedOutputStream* output) {
^
external/protobuf/src/google/protobuf/wire_format_lite.cc:423:66: error: no 'void google::protobuf::internal::WireFormatLite::WriteBoolArray(const bool*, int, google::protobuf::io::CodedOutputStream*)' member function declared in class 'google::protobuf::internal::WireFormatLite'
io::CodedOutputStream* output) {
^
external/protobuf/src/google/protobuf/wire_format_lite.cc: In static member function 'static void google::protobuf::internal::WireFormatLite::WriteGroupMaybeToArray(int, const google::protobuf::MessageLite&, google::protobuf::io::CodedOutputStream*)':
external/protobuf/src/google/protobuf/wire_format_lite.cc:557:17: error: 'class google::protobuf::io::CodedOutputStream' has no member named 'IsSerializationDeterministic'
output->IsSerializationDeterministic(), target);
^
external/protobuf/src/google/protobuf/wire_format_lite.cc: In static member function 'static void google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(int, const google::protobuf::MessageLite&, google::protobuf::io::CodedOutputStream*)':
external/protobuf/src/google/protobuf/wire_format_lite.cc:574:17: error: 'class google::protobuf::io::CodedOutputStream' has no member named 'IsSerializationDeterministic'
output->IsSerializationDeterministic(), target);
^
external/protobuf/src/google/protobuf/wire_format_lite.cc: At global scope:
external/protobuf/src/google/protobuf/wire_format_lite.cc:739:8: error: prototype for 'size_t google::protobuf::internal::WireFormatLite::Int32Size(const google::protobuf::RepeatedField<int>&)' does not match any in class 'google::protobuf::internal::WireFormatLite'
size_t WireFormatLite::Int32Size(const RepeatedField<int32>& value) {
^
In file included from external/protobuf/src/google/protobuf/wire_format_lite.cc:35:0:
<snip>/source/protobuf/protobuf-3.1.0/inst/include/google/protobuf/wire_format_lite_inl.h:813:15: error: candidate is: static size_t google::protobuf::internal::WireFormatLite::Int32Size(google::protobuf::int32)
inline size_t WireFormatLite::Int32Size(int32 value) {
^
external/protobuf/src/google/protobuf/wire_format_lite.cc:748:8: error: prototype for 'size_t google::protobuf::internal::WireFormatLite::UInt32Size(const google::protobuf::RepeatedField<unsigned int>&)' does not match any in class 'google::protobuf::internal::WireFormatLite'
size_t WireFormatLite::UInt32Size(const RepeatedField<uint32>& value) {
^
In file included from external/protobuf/src/google/protobuf/wire_format_lite.cc:35:0:
<snip>/source/protobuf/protobuf-3.1.0/inst/include/google/protobuf/wire_format_lite_inl.h:819:15: error: candidate is: static size_t google::protobuf::internal::WireFormatLite::UInt32Size(google::protobuf::uint32)
inline size_t WireFormatLite::UInt32Size(uint32 value) {
^
external/protobuf/src/google/protobuf/wire_format_lite.cc:757:8: error: prototype for 'size_t google::protobuf::internal::WireFormatLite::SInt32Size(const google::protobuf::RepeatedField<int>&)' does not match any in class 'google::protobuf::internal::WireFormatLite'
size_t WireFormatLite::SInt32Size(const RepeatedField<int32>& value) {
^
In file included from external/protobuf/src/google/protobuf/wire_format_lite.cc:35:0:
<snip>/source/protobuf/protobuf-3.1.0/inst/include/google/protobuf/wire_format_lite_inl.h:825:15: error: candidate is: static size_t google::protobuf::internal::WireFormatLite::SInt32Size(google::protobuf::int32)
inline size_t WireFormatLite::SInt32Size(int32 value) {
^
external/protobuf/src/google/protobuf/wire_format_lite.cc:766:8: error: prototype for 'size_t google::protobuf::internal::WireFormatLite::EnumSize(const google::protobuf::RepeatedField<int>&)' does not match any in class 'google::protobuf::internal::WireFormatLite'
size_t WireFormatLite::EnumSize(const RepeatedField<int>& value) {
^
In file included from external/protobuf/src/google/protobuf/wire_format_lite.cc:35:0:
<snip>/source/protobuf/protobuf-3.1.0/inst/include/google/protobuf/wire_format_lite_inl.h:831:15: error: candidate is: static size_t google::protobuf::internal::WireFormatLite::EnumSize(int)
inline size_t WireFormatLite::EnumSize(int value) {
^
Target //tensorflow/tools/pip_package:build_pip_package failed to build
If I build protobuf 3.2 from source and then attempt to build TensorFlow 1.1 from source I get the following error:
ERROR: <snip>/.cache/bazel/_bazel_daniel/041a78b467f26d47aee0fcd68c1f3624/external/protobuf/BUILD:113:1: C++ compilation of rule '#protobuf//:protobuf' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG ... (remaining 43 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
external/protobuf/src/google/protobuf/util/json_util.cc:52:49: error: definition of implicitly-declared 'virtual google::protobuf::util::internal::ZeroCopyStreamByteSink::~ZeroCopyStreamByteSink()'
ZeroCopyStreamByteSink::~ZeroCopyStreamByteSink() {
^
external/protobuf/src/google/protobuf/util/json_util.cc: In member function 'virtual void google::protobuf::util::internal::ZeroCopyStreamByteSink::Append(const char*, size_t)':
external/protobuf/src/google/protobuf/util/json_util.cc:58:16: error: 'buffer_size_' was not declared in this scope
if (len <= buffer_size_) {
^
external/protobuf/src/google/protobuf/util/json_util.cc:59:14: error: 'buffer_' was not declared in this scope
memcpy(buffer_, bytes, len);
^
external/protobuf/src/google/protobuf/util/json_util.cc:64:12: error: 'buffer_' was not declared in this scope
memcpy(buffer_, bytes, buffer_size_);
^
external/protobuf/src/google/protobuf/util/json_util.cc:64:28: error: 'buffer_size_' was not declared in this scope
memcpy(buffer_, bytes, buffer_size_);
^
external/protobuf/src/google/protobuf/util/json_util.cc: In function 'google::protobuf::util::Status google::protobuf::util::BinaryToJsonStream(google::protobuf::util::TypeResolver*, const string&, google::protobuf::io::ZeroCopyInputStream*, google::protobuf::io::ZeroCopyOutputStream*, const google::protobuf::util::JsonPrintOptions&)':
external/protobuf/src/google/protobuf/util/json_util.cc:85:47: error: 'const struct google::protobuf::util::JsonPrintOptions' has no member named 'always_print_enums_as_ints'
proto_source.set_use_ints_for_enums(options.always_print_enums_as_ints);
^
Target //tensorflow/tools/pip_package:build_pip_package failed to build
If I build protobuf 3.3 from source and then attempt to build TensorFlow 1.1 from source I get the following error:
ERROR: <snip>/.cache/bazel/_bazel_daniel/041a78b467f26d47aee0fcd68c1f3624/external/protobuf/BUILD:73:1: C++ compilation of rule '#protobuf//:protobuf_lite' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG ... (remaining 45 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
external/protobuf/src/google/protobuf/arenastring.cc:41:6: error: redefinition of 'void google::protobuf::internal::ArenaStringPtr::AssignWithDefault(const string*, google::protobuf::internal::ArenaStringPtr)'
void ArenaStringPtr::AssignWithDefault(const ::std::string* default_value,
^
In file included from external/protobuf/src/google/protobuf/arenastring.cc:34:0:
<snip>/source/protobuf/protobuf-3.3.0/inst/include/google/protobuf/arenastring.h:316:13: note: 'void google::protobuf::internal::ArenaStringPtr::AssignWithDefault(const string*, google::protobuf::internal::ArenaStringPtr)' previously defined here
inline void ArenaStringPtr::AssignWithDefault(const ::std::string* default_value,
^
Target //tensorflow/tools/pip_package:build_pip_package failed to build

Use generic implementation of wxDataViewCtrl on OSX

By default wxDataViewCtrl has native implementation under OSX. How can I use generic implementation of wxDataViewCtrl under OSX.
I do not want to make any changes in wxWidgets Code. I would prefer a macro or some specific header.
Also I am thinking how I can use native and generic implementations both at the same time.
Tried the way suggested:
Following errors while building wxWidgets dynamic library:
./src/osx/dataview_osx.cpp:101:38: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
noFailureFlag = m_DataViewCtrlPtr->GetDataViewPeer()->Add(parent,item);
~~~~~~~~~~~~~~~~~ ^
./src/osx/dataview_osx.cpp:112:38: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
noFailureFlag = m_DataViewCtrlPtr->GetDataViewPeer()->Add(parent,items);
~~~~~~~~~~~~~~~~~ ^
./src/osx/dataview_osx.cpp:123:26: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
if (m_DataViewCtrlPtr->GetDataViewPeer()->Update(GetOwner()->GetParent(item),item))
~~~~~~~~~~~~~~~~~ ^
./src/osx/dataview_osx.cpp:153:28: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
if (m_DataViewCtrlPtr->GetDataViewPeer()->Update(GetOwner()->GetParent(items[indexItem]),items[indexItem]))
~~~~~~~~~~~~~~~~~ ^
./src/osx/dataview_osx.cpp:178:22: error: no member named 'SetDeleting' in 'wxDataViewCtrl'
m_DataViewCtrlPtr->SetDeleting(true);
~~~~~~~~~~~~~~~~~ ^
./src/osx/dataview_osx.cpp:179:38: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
noFailureFlag = m_DataViewCtrlPtr->GetDataViewPeer()->Remove(parent,item);
~~~~~~~~~~~~~~~~~ ^
./src/osx/dataview_osx.cpp:181:22: error: no member named 'SetDeleting' in 'wxDataViewCtrl'
m_DataViewCtrlPtr->SetDeleting(false);
~~~~~~~~~~~~~~~~~ ^
./src/osx/dataview_osx.cpp:197:22: error: no member named 'SetDeleting' in 'wxDataViewCtrl'
m_DataViewCtrlPtr->SetDeleting(true);
~~~~~~~~~~~~~~~~~ ^
./src/osx/dataview_osx.cpp:199:38: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
noFailureFlag = m_DataViewCtrlPtr->GetDataViewPeer()->Remove(parent,items);
~~~~~~~~~~~~~~~~~ ^
./src/osx/dataview_osx.cpp:201:22: error: no member named 'SetDeleting' in 'wxDataViewCtrl'
m_DataViewCtrlPtr->SetDeleting(false);
~~~~~~~~~~~~~~~~~ ^
./src/osx/dataview_osx.cpp:212:26: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
if (m_DataViewCtrlPtr->GetDataViewPeer()->Update(GetOwner()->GetParent(item),item))
~~~~~~~~~~~~~~~~~ ^
./src/osx/dataview_osx.cpp:233:29: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
return m_DataViewCtrlPtr->GetDataViewPeer()->Reload();
~~~~~~~~~~~~~~~~~ ^
./src/osx/dataview_osx.cpp:238:22: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
m_DataViewCtrlPtr->GetDataViewPeer()->Resort();
~~~~~~~~~~~~~~~~~ ^
./src/osx/dataview_osx.cpp:252:55: error: no member named 'GetColumnPtr' in 'wxDataViewCtrl'; did you mean 'GetColumnAt'?
wxDataViewColumn* column(m_DataViewCtrlPtr->GetColumnPtr(col));
^~~~~~~~~~~~
GetColumnAt
./include/wx/generic/dataview.h:248:23: note: 'GetColumnAt' declared here
wxDataViewColumn *GetColumnAt(unsigned int pos) const;
^
./src/osx/dataview_osx.cpp:267:28: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
m_DataViewCtrlPtr->GetDataViewPeer()->SetRowHeight(item,height);
~~~~~~~~~~~~~~~~~ ^
./src/osx/dataview_osx.cpp:287:57: error: no member named 'GetColumnPtr' in 'wxDataViewCtrl'; did you mean 'GetColumnAt'?
wxDataViewColumn* column(m_DataViewCtrlPtr->GetColumnPtr(col));
^~~~~~~~~~~~
GetColumnAt
./include/wx/generic/dataview.h:248:23: note: 'GetColumnAt' declared here
wxDataViewColumn *GetColumnAt(unsigned int pos) const;
^
./src/osx/dataview_osx.cpp:302:30: error: no member named 'GetDataViewPeer' in 'wxDataViewCtrl'
m_DataViewCtrlPtr->GetDataViewPeer()->SetRowHeight(items[itemIndex],height);
~~~~~~~~~~~~~~~~~ ^
./src/osx/dataview_osx.cpp:312:53: error: no member named 'GetColumnPtr' in 'wxDataViewCtrl'; did you mean 'GetColumnAt'?
wxDataViewColumn *column = m_DataViewCtrlPtr->GetColumnPtr(col);
^~~~~~~~~~~~
GetColumnAt
./include/wx/generic/dataview.h:248:23: note: 'GetColumnAt' declared here
wxDataViewColumn *GetColumnAt(unsigned int pos) const;
^
./src/osx/dataview_osx.cpp:314:20: error: no member named 'GetWidthVariable' in 'wxDataViewColumn'
if ( column->GetWidthVariable() == wxCOL_WIDTH_AUTOSIZE )
~~~~~~ ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [advdll_dataview_osx.o] Error 1
#include <wx/generic/dataview.h> ?
You need to globally predefine wxHAS_GENERIC_DATAVIEWCTRL and rebuild both wxWidgets and your application using it.
There is currently no way to use both the native and generic implementations of this control in the same build.
We need to build wxWidgets with both:
wxHAS_GENERIC_DATAVIEWCTRL
wxUSE_GENERICDATAVIEWCTRL
Only wxHAS_GENERIC_DATAVIEWCTRL will not work. Note, now I am able to use the generic implementation of wxWidgets on OSX.