Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Zendar SDK Compile failed? #36

Open
daydreamer2023 opened this issue Apr 20, 2021 · 4 comments
Open

Zendar SDK Compile failed? #36

daydreamer2023 opened this issue Apr 20, 2021 · 4 comments

Comments

@daydreamer2023
Copy link

Hi!
I couldn't compile the SDK correctly.
Probably because of the protobuf, but I can't find a solution.
image

By the way, I can't import data_bp2 while /usr/lib/zendar is add to PYTHONPATH.
That's what i got under the folder '/usr/lib/zendar' :
image

thanks a lot!

The history of terminal:
sudo apt install libgoogle-glog0v5 libgoogle-glog-dev libprotobuf-dev protobuf-compiler g++ git cmake

Reading package lists... Done
Building dependency tree
Reading state information... Done
libprotobuf-dev is already the newest version (3.0.0-9.1ubuntu1).
libgoogle-glog-dev is already the newest version (0.3.5-1).
libgoogle-glog0v5 is already the newest version (0.3.5-1).
protobuf-compiler is already the newest version (3.0.0-9.1ubuntu1).
cmake is already the newest version (3.10.2-1ubuntu2.18.04.1).
g++ is already the newest version (4:7.4.0-1ubuntu2.3).
git is already the newest version (1:2.17.1-1ubuntu0.7).
The following packages were automatically installed and are no longer required:
geoclue geoclue-ubuntu-geoip gnome-screensaver indicator-applet indicator-datetime
indicator-keyboard indicator-messages indicator-power indicator-session indicator-sound
libaccounts-glib0 libfcitx-config4 libfcitx-gclient1 libfcitx-utils0 libgeoclue0 libido3-0.1-0
liblightdm-gobject-1-0 libnm-glib4 libnm-util2 libpanel-applet3 libunity-settings-daemon1
liburl-dispatcher1 qml-module-qtquick-dialogs qml-module-qtquick-privatewidgets ubuntu-touch-sounds
unity-greeter unity-settings-daemon
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 267 not upgraded.

git clone https://github.com/nanomsg/nng.git cd nng git checkout b74e76c # i.e Revision 1.2.4 mkdir build cd build cmake .. -DCMAKE_INSTALL_PATH=/usr/local \ -DNNG_TESTS:BOOL=OFF \ -DNNG_TOOLS:BOOL=OFF \ -DNNG_ENABLE_TLS:BOOL=OFF \ -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON make -j sudo make install sudo ldconfig

-- The C compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found UnixCommands: /bin/bash
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Performing Test NNG_HIDDEN_VISIBILITY
-- Performing Test NNG_HIDDEN_VISIBILITY - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Looking for lockf
-- Looking for lockf - found
-- Looking for flock
-- Looking for flock - found
-- Looking for getentropy
-- Looking for getentropy - found
-- Looking for getrandom
-- Looking for getrandom - found
-- Looking for arc4random_buf
-- Looking for arc4random_buf - not found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for sem_wait in pthread
-- Looking for sem_wait in pthread - found
-- Looking for pthread_atfork in pthread
-- Looking for pthread_atfork in pthread - found
-- Looking for gethostbyname in nsl
-- Looking for gethostbyname in nsl - found
-- Looking for socket in socket
-- Looking for socket in socket - not found
-- Looking for AF_UNIX
-- Looking for AF_UNIX - found
-- Looking for backtrace_symbols_fd
-- Looking for backtrace_symbols_fd - found
-- Performing Test NNG_HAVE_MSG_CONTROL
-- Performing Test NNG_HAVE_MSG_CONTROL - Success
-- Looking for eventfd
-- Looking for eventfd - found
-- Looking for kqueue
-- Looking for kqueue - not found
-- Looking for port_create
-- Looking for port_create - not found
-- Looking for epoll_create
-- Looking for epoll_create - found
-- Looking for epoll_create1
-- Looking for epoll_create1 - found
-- Looking for getpeereid
-- Looking for getpeereid - not found
-- Looking for SO_PEERCRED
-- Looking for SO_PEERCRED - found
-- Performing Test NNG_HAVE_SOCKPEERCRED
-- Performing Test NNG_HAVE_SOCKPEERCRED - Failed
-- Looking for LOCAL_PEERCRED
-- Looking for LOCAL_PEERCRED - not found
-- Looking for getpeerucred
-- Looking for getpeerucred - not found
-- Looking for atomic_flag_test_and_set
-- Looking for atomic_flag_test_and_set - found
-- Looking for strlcat
-- Looking for strlcat - not found
-- Looking for strlcpy
-- Looking for strlcpy - not found
-- Looking for strnlen
-- Looking for strnlen - found
-- Looking for strcasecmp
-- Looking for strcasecmp - found
-- Looking for strncasecmp
-- Looking for strncasecmp - found
-- Building static libs
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:

CMAKE_INSTALL_PATH

-- Build files have been written to: /home/fire/Project/ZendarSDK/cpp/nng/build
XX@XX:/Project/ZendarSDK/cpp/nng/build$ make -j
Scanning dependencies of target nng
[ 1%] Building C object src/CMakeFiles/nng.dir/protocol/pair0/pair.c.o
[ 2%] Building C object src/CMakeFiles/nng.dir/protocol/pipeline0/pull.c.o
[ 3%] Building C object src/CMakeFiles/nng.dir/protocol/pair1/pair.c.o
[ 4%] Building C object src/CMakeFiles/nng.dir/protocol/survey0/respond.c.o
[ 6%] Building C object src/CMakeFiles/nng.dir/protocol/pubsub0/pub.c.o
[ 9%] Building C object src/CMakeFiles/nng.dir/nng.c.o
[ 9%] Building C object src/CMakeFiles/nng.dir/protocol/reqrep0/req.c.o
[ 12%] Building C object src/CMakeFiles/nng.dir/protocol/pubsub0/sub.c.o
[ 12%] Building C object src/CMakeFiles/nng.dir/protocol/reqrep0/rep.c.o
[ 13%] Building C object src/CMakeFiles/nng.dir/protocol/pubsub0/xsub.c.o
[ 13%] Building C object src/CMakeFiles/nng.dir/protocol/bus0/bus.c.o
[ 14%] Building C object src/CMakeFiles/nng.dir/protocol/reqrep0/xrep.c.o
[ 15%] Building C object src/CMakeFiles/nng.dir/protocol/pipeline0/push.c.o
[ 17%] Building C object src/CMakeFiles/nng.dir/protocol/survey0/xrespond.c.o
[ 19%] Building C object src/CMakeFiles/nng.dir/core/pipe.c.o
[ 19%] Building C object src/CMakeFiles/nng.dir/protocol/reqrep0/xreq.c.o
[ 20%] Building C object src/CMakeFiles/nng.dir/protocol/survey0/survey.c.o
[ 21%] Building C object src/CMakeFiles/nng.dir/protocol/survey0/xsurvey.c.o
[ 23%] Building C object src/CMakeFiles/nng.dir/core/init.c.o
[ 24%] Building C object src/CMakeFiles/nng.dir/transport/ipc/ipc.c.o
[ 25%] Building C object src/CMakeFiles/nng.dir/supplemental/websocket/websocket.c.o
[ 28%] Building C object src/CMakeFiles/nng.dir/core/lmq.c.o
[ 29%] Building C object src/CMakeFiles/nng.dir/core/reap.c.o
[ 29%] Building C object src/CMakeFiles/nng.dir/supplemental/sha1/sha1.c.o
[ 31%] Building C object src/CMakeFiles/nng.dir/supplemental/tcp/tcp.c.o
[ 31%] Building C object src/CMakeFiles/nng.dir/core/stream.c.o
[ 34%] Building C object src/CMakeFiles/nng.dir/platform/posix/posix_ipcdial.c.o
[ 34%] Building C object src/CMakeFiles/nng.dir/core/dialer.c.o
[ 35%] Building C object src/CMakeFiles/nng.dir/core/file.c.o
[ 37%] Building C object src/CMakeFiles/nng.dir/core/aio.c.o
[ 37%] Building C object src/CMakeFiles/nng.dir/core/socket.c.o
[ 39%] Building C object src/CMakeFiles/nng.dir/core/idhash.c.o
[ 40%] Building C object src/CMakeFiles/nng.dir/core/random.c.o
[ 41%] Building C object src/CMakeFiles/nng.dir/core/url.c.o
[ 42%] Building C object src/CMakeFiles/nng.dir/core/message.c.o
[ 43%] Building C object src/CMakeFiles/nng.dir/transport/tcp/tcp.c.o
[ 45%] Building C object src/CMakeFiles/nng.dir/transport/inproc/inproc.c.o
[ 46%] Building C object src/CMakeFiles/nng.dir/supplemental/http/http_msg.c.o
[ 48%] Building C object src/CMakeFiles/nng.dir/platform/posix/posix_sockaddr.c.o
[ 51%] Building C object src/CMakeFiles/nng.dir/supplemental/util/options.c.o
[ 51%] Building C object src/CMakeFiles/nng.dir/platform/posix/posix_pipe.c.o
[ 48%] Building C object src/CMakeFiles/nng.dir/platform/posix/posix_alloc.c.o
[ 53%] Building C object src/CMakeFiles/nng.dir/supplemental/http/http_server.c.o
[ 53%] Building C object src/CMakeFiles/nng.dir/core/msgqueue.c.o
[ 54%] Building C object src/CMakeFiles/nng.dir/core/taskq.c.o
[ 56%] Building C object src/CMakeFiles/nng.dir/core/panic.c.o
[ 57%] Building C object src/CMakeFiles/nng.dir/core/list.c.o
[ 58%] Building C object src/CMakeFiles/nng.dir/core/clock.c.o
[ 59%] Building C object src/CMakeFiles/nng.dir/core/thread.c.o
[ 60%] Building C object src/CMakeFiles/nng.dir/platform/posix/posix_resolv_gai.c.o
[ 62%] Building C object src/CMakeFiles/nng.dir/platform/posix/posix_file.c.o
[ 63%] Building C object src/CMakeFiles/nng.dir/core/transport.c.o
[ 64%] Building C object src/CMakeFiles/nng.dir/platform/posix/posix_ipcconn.c.o
[ 67%] Building C object src/CMakeFiles/nng.dir/platform/posix/posix_tcpconn.c.o
[ 68%] Building C object src/CMakeFiles/nng.dir/core/protocol.c.o
[ 69%] Building C object src/CMakeFiles/nng.dir/compat/nanomsg/nn.c.o
[ 70%] Building C object src/CMakeFiles/nng.dir/platform/posix/posix_ipclisten.c.o
[ 71%] Building C object src/CMakeFiles/nng.dir/supplemental/http/http_client.c.o
[ 73%] Building C object src/CMakeFiles/nng.dir/core/options.c.o
[ 73%] Building C object src/CMakeFiles/nng.dir/supplemental/base64/base64.c.o
[ 74%] Building C object src/CMakeFiles/nng.dir/supplemental/http/http_public.c.o
[ 75%] Building C object src/CMakeFiles/nng.dir/platform/posix/posix_tcpdial.c.o
[ 76%] Building C object src/CMakeFiles/nng.dir/core/stats.c.o
[ 79%] Building C object src/CMakeFiles/nng.dir/core/timer.c.o
[ 79%] Building C object src/CMakeFiles/nng.dir/core/device.c.o
[ 80%] Building C object src/CMakeFiles/nng.dir/transport/ws/websocket.c.o
[ 81%] Building C object src/CMakeFiles/nng.dir/platform/posix/posix_tcplisten.c.o
[ 82%] Building C object src/CMakeFiles/nng.dir/core/strs.c.o
[ 87%] Building C object src/CMakeFiles/nng.dir/core/pollable.c.o
[ 87%] Building C object src/CMakeFiles/nng.dir/platform/posix/posix_thread.c.o
[ 87%] Building C object src/CMakeFiles/nng.dir/platform/posix/posix_udp.c.o
[ 87%] Building C object src/CMakeFiles/nng.dir/supplemental/util/platform.c.o
[ 89%] Building C object src/CMakeFiles/nng.dir/platform/posix/posix_clock.c.o
[ 90%] Building C object src/CMakeFiles/nng.dir/platform/posix/posix_pollq_epoll.c.o
[ 92%] Building C object src/CMakeFiles/nng.dir/supplemental/http/http_chunk.c.o
[ 92%] Building C object src/CMakeFiles/nng.dir/platform/posix/posix_rand.c.o
[ 93%] Building C object src/CMakeFiles/nng.dir/supplemental/tls/none/tls.c.o
[ 96%] Building C object src/CMakeFiles/nng.dir/platform/posix/posix_debug.c.o
[ 97%] Building C object src/CMakeFiles/nng.dir/core/listener.c.o
[ 95%] Building C object src/CMakeFiles/nng.dir/platform/posix/posix_atomic.c.o
[ 98%] Building C object src/CMakeFiles/nng.dir/supplemental/http/http_conn.c.o
[100%] Linking C static library ../libnng.a
[100%] Built target nng
fire@Jarvis:
/Project/ZendarSDK/cpp/nng/build$ sudo make install
[100%] Built target nng
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/lib/libnng.a
-- Installing: /usr/local/lib/cmake/nng/nng-targets.cmake
-- Installing: /usr/local/lib/cmake/nng/nng-targets-noconfig.cmake
-- Up-to-date: /usr/local/include/nng
-- Up-to-date: /usr/local/include/nng/transport
-- Up-to-date: /usr/local/include/nng/transport/tls
-- Installing: /usr/local/include/nng/transport/tls/tls.h
-- Up-to-date: /usr/local/include/nng/transport/ws
-- Installing: /usr/local/include/nng/transport/ws/websocket.h
-- Up-to-date: /usr/local/include/nng/transport/zerotier
-- Installing: /usr/local/include/nng/transport/zerotier/zerotier.h
-- Up-to-date: /usr/local/include/nng/transport/tcp
-- Installing: /usr/local/include/nng/transport/tcp/tcp.h
-- Up-to-date: /usr/local/include/nng/transport/inproc
-- Installing: /usr/local/include/nng/transport/inproc/inproc.h
-- Up-to-date: /usr/local/include/nng/transport/ipc
-- Installing: /usr/local/include/nng/transport/ipc/ipc.h
-- Up-to-date: /usr/local/include/nng/compat
-- Up-to-date: /usr/local/include/nng/compat/nanomsg
-- Installing: /usr/local/include/nng/compat/nanomsg/pubsub.h
-- Installing: /usr/local/include/nng/compat/nanomsg/bus.h
-- Installing: /usr/local/include/nng/compat/nanomsg/pipeline.h
-- Installing: /usr/local/include/nng/compat/nanomsg/tcp.h
-- Installing: /usr/local/include/nng/compat/nanomsg/reqrep.h
-- Installing: /usr/local/include/nng/compat/nanomsg/survey.h
-- Installing: /usr/local/include/nng/compat/nanomsg/ipc.h
-- Installing: /usr/local/include/nng/compat/nanomsg/nn.h
-- Installing: /usr/local/include/nng/compat/nanomsg/ws.h
-- Installing: /usr/local/include/nng/compat/nanomsg/pair.h
-- Installing: /usr/local/include/nng/compat/nanomsg/inproc.h
-- Up-to-date: /usr/local/include/nng/supplemental
-- Up-to-date: /usr/local/include/nng/supplemental/tls
-- Installing: /usr/local/include/nng/supplemental/tls/tls.h
-- Up-to-date: /usr/local/include/nng/supplemental/util
-- Installing: /usr/local/include/nng/supplemental/util/platform.h
-- Installing: /usr/local/include/nng/supplemental/util/options.h
-- Up-to-date: /usr/local/include/nng/supplemental/http
-- Installing: /usr/local/include/nng/supplemental/http/http.h
-- Installing: /usr/local/include/nng/nng.h
-- Up-to-date: /usr/local/include/nng/protocol
-- Up-to-date: /usr/local/include/nng/protocol/reqrep0
-- Installing: /usr/local/include/nng/protocol/reqrep0/rep.h
-- Installing: /usr/local/include/nng/protocol/reqrep0/req.h
-- Up-to-date: /usr/local/include/nng/protocol/pair0
-- Installing: /usr/local/include/nng/protocol/pair0/pair.h
-- Up-to-date: /usr/local/include/nng/protocol/pubsub0
-- Installing: /usr/local/include/nng/protocol/pubsub0/sub.h
-- Installing: /usr/local/include/nng/protocol/pubsub0/pub.h
-- Up-to-date: /usr/local/include/nng/protocol/survey0
-- Installing: /usr/local/include/nng/protocol/survey0/respond.h
-- Installing: /usr/local/include/nng/protocol/survey0/survey.h
-- Up-to-date: /usr/local/include/nng/protocol/pipeline0
-- Installing: /usr/local/include/nng/protocol/pipeline0/pull.h
-- Installing: /usr/local/include/nng/protocol/pipeline0/push.h
-- Up-to-date: /usr/local/include/nng/protocol/bus0
-- Installing: /usr/local/include/nng/protocol/bus0/bus.h
-- Up-to-date: /usr/local/include/nng/protocol/pair1
-- Installing: /usr/local/include/nng/protocol/pair1/pair.h
-- Installing: /usr/local/lib/cmake/nng/nng-config.cmake
-- Installing: /usr/local/lib/cmake/nng/nng-config-version.cmake

cd ZendarSDK/cpp sudo make all

dpkg -i zendar-core_0.1.21031704594970a0d136681ed4b87f58b71eb36c00cb8e8a02_amd64.deb
(Reading database ... 399014 files and directories currently installed.)
Preparing to unpack zendar-core_0.1.2103170459
4970a0d136681ed4b87f58b71eb36c00cb8e8a02_amd64.deb ...
Unpacking zendar-core (0.1.21031704594970a0d136681ed4b87f58b71eb36c00cb8e8a02) over (0.1.21031704594970a0d136681ed4b87f58b71eb36c00cb8e8a02) ...
Setting up zendar-core (0.1.21031704594970a0d136681ed4b87f58b71eb36c00cb8e8a02) ...
dpkg -i zendar-zenapi_0.1.2103170459
4970a0d136681ed4b87f58b71eb36c00cb8e8a02_amd64.deb
(Reading database ... 399014 files and directories currently installed.)
Preparing to unpack zendar-zenapi_0.1.21031704594970a0d136681ed4b87f58b71eb36c00cb8e8a02_amd64.deb ...
Unpacking zendar-zenapi (0.1.2103170459
4970a0d136681ed4b87f58b71eb36c00cb8e8a02) over (0.1.21031704594970a0d136681ed4b87f58b71eb36c00cb8e8a02) ...
Setting up zendar-zenapi (0.1.2103170459
4970a0d136681ed4b87f58b71eb36c00cb8e8a02) ...
protoc -I=/usr/lib/zendar --cpp_out=/usr/lib/zendar /usr/lib/zendar/.proto
protoc -I=/usr/lib/zendar --python_out=/usr/lib/zendar /usr/lib/zendar/
.proto
g++ -fPIC /usr/lib/zendar/.pb.cc -shared -lprotobuf -o /usr/lib/libzenproto.so
cp /usr/lib/zendar/
.pb.h /usr/lib
g++ example-simple.cc -I/usr/lib -L/usr/lib -lzendar_api -lglog -lzenproto -lprotobuf -lshannon_core -lnng -lpthread -o example-simple
In file included from example-simple.cc:1:0:
/usr/lib/zendar-api.h:8:10: fatal error: data.pb.h: No such file or directory
#include "data.pb.h"
^~~~~~~~~~~
compilation terminated.
Makefile:33: recipe for target 'example-simple' failed
make: *** [example-simple] Error 1

@ghsyu
Copy link
Contributor

ghsyu commented Apr 21, 2021

Can you post the contents of /usr/lib/zendar?

@daydreamer2023
Copy link
Author

The second picture is the contents of /use/lib/zendar in my conputer.
image

I found there also need a module named lidar_pb2.

import data_pb2, tracker_pb2, lidar_pb2

Maybe you could upload a file xxx.pro, and I can use protoc to generate the appropriate python files.

thanks!

@ghsyu
Copy link
Contributor

ghsyu commented Apr 22, 2021

They should be included in the zenapi dpkg, they were accidentally removed at one point, can you try pulling the newest main and trying again?

@daydreamer2023
Copy link
Author

I have got the data.proto in the path : multimodal_variational_autoencoders_for_semi_supervised_learning_in_defense_of_product_of_experts-Supplementary Material.
image
But i haven't found the cues about lidar_pb2. Is it also contained in this repo?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants