ZeroCM / zcm

Zero Communications and Marshalling
http://zerocm.github.io/zcm/
GNU Lesser General Public License v2.1
237 stars 69 forks source link

Build failed -> task in 'pyzcm' failed with exit status #398

Closed fty0724 closed 2 years ago

fty0724 commented 2 years ago

When I build zcm in the below environment: gcc&g++ 7.5.0, Python 3.6, linux 18.04

here is the process:

./waf configure --use-java --use-nodejs --use-python --use-zmq --use-elf --use-inproc --use-ipc --use-udpm Setting top to : /home/mm/Downloads/tongji_tools/zcm1.1.5 Setting out to : /home/mm/Downloads/tongji_tools/zcm1.1.5/build Checking for 'gcc' (C compiler) : /usr/bin/gcc Checking for 'g++' (C++ compiler) : /usr/bin/g++ Checking for program 'javac' : /usr/lib/jvm/java-8-openjdk-amd64/bin/javac Checking for program 'java' : /usr/lib/jvm/java-8-openjdk-amd64/bin/java Checking for program 'jar' : /usr/lib/jvm/java-8-openjdk-amd64/bin/jar Checking for program 'javadoc' : /usr/lib/jvm/java-8-openjdk-amd64/bin/javadoc Checking for header jni.h : yes Checking for program 'node' : /usr/bin/node Checking for program 'npm' : /usr/bin/npm Checking for program 'python' : /usr/bin/python Checking for python version : 3.6.9 python-config : /usr/bin/python-config Asking python-config for pyembed '--cflags --libs --ldflags --embed' flags : not found Asking python-config for pyembed '--cflags --libs --ldflags' flags : yes Testing pyembed configuration : yes Asking python-config for pyext '--cflags --libs --ldflags' flags : yes Testing pyext configuration : yes Checking for program 'cython' : /usr/bin/cython Checking for program 'pkg-config' : /usr/bin/pkg-config Checking for 'libzmq' : yes ZCM Version: 1.1.5

Dependency Configuration: C/C++ Enabled Java Enabled NodeJs Enabled Python Enabled Julia Disabled ZeroMQ Enabled Elf Enabled GTK Disabled Third Party Disabled

Transport Configuration: ipc Enabled inproc Enabled udpm Enabled serial Disabled can Disabled

Type Configuration: hash-typename Enabled hash-member-names Disabled

Dev Configuration: Build Cache Disabled Clang Disabled CxxTest Disabled Record Traffic Topology Disabled

'configure' finished successfully (0.965s)

Then I try to build,but the error happend:

mm@lotus:~/Downloads/tongji_tools/zcm1.1.5$ ./waf build -v Waf: Entering directory `/home/mm/Downloads/tongji_tools/zcm1.1.5/build' [ 2/88] Linking build/zcm/json/libzcm_json.a 11:21:18 runner ['/usr/bin/ar', 'rcs', 'zcm/json/libzcm_json.a', 'zcm/json/jsoncpp.cpp.1.o'] [27/88] Creating build/zcm.gitid 11:21:18 runner ' cd /home/mm/Downloads/tongji_tools/zcm1.1.5 && ((git rev-parse HEAD && ((git tag --contains ; echo "") | head -n1) && git diff) || echo "Not built from git" > /home/mm/Downloads/tongji_tools/zcm1.1.5/build/zcm.gitid) > /home/mm/Downloads/tongji_tools/zcm1.1.5/build/zcm.gitid 2>/dev/null ' [31/88] Compiling build/zcm/python/zerocm.c 11:21:18 runner ['/usr/bin/gcc', '-fPIC', '-fno-strict-aliasing', '-g', '-fdebug-prefix-map=/build/python2.7-oYYDrU/python2.7-2.7.17=.', '-fstack-protector-strong', '-g', '-fwrapv', '-O2', '-std=gnu99', '-fPIC', '-pthread', '-Wall', '-Werror', '-Wno-unused-function', '-O3', '-Wno-unused-local-typedefs', '-I.', '-I..', '-I/usr/include/python2.7', '-I/usr/include/x86_64-linux-gnu/python2.7', '-I..', '-DHAVE_JNI_H=1', '-DPYTHONDIR="/usr/local/lib/python3/dist-packages"', '-DPYTHONARCHDIR="/usr/local/lib/python3/dist-packages"', '-DHAVE_PYEMBED=1', '-DHAVE_PYEXT=1', '-DHAVE_PYTHON_H=1', '-DHAVE_ZMQ=1', '-D_FORTIFY_SOURCE=2', '-DNDEBUG', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-DUSING_CPP', '-DUSING_ELF', '-DUSING_JAVA', '-DUSING_NODEJS', '-DUSING_OPT', '-DUSING_PYTHON', '-DUSING_TRANS_INPROC', '-DUSING_TRANS_IPC', '-DUSING_TRANS_UDPM', '-DUSING_ZMQ', '-DENABLE_TYPENAME_HASHING', 'zcm/python/zerocm.c', '-c', '-o/home/mm/Downloads/tongji_tools/zcm1.1.5/build/zcm/python/zerocm.c.2.o'] [43/88] Linking build/gen/zcm-gen 11:21:18 runner ['/usr/bin/g++', '-pthread', 'gen/GetOpt.cpp.1.o', 'gen/Main.cpp.1.o', 'gen/ZCMGen.cpp.1.o', 'gen/emit/EmitC.cpp.1.o', 'gen/emit/EmitCpp.cpp.1.o', 'gen/emit/EmitJava.cpp.1.o', 'gen/emit/EmitJulia.cpp.1.o', 'gen/emit/EmitNode.cpp.1.o', 'gen/emit/EmitPython.cpp.1.o', 'gen/emit/Emitter.cpp.1.o', 'gen/tokenize.c.1.o', '-o/home/mm/Downloads/tongji_tools/zcm1.1.5/build/gen/zcm-gen', '-Wl,-Bstatic', '-Lzcm/json', '-lzcm_json', '-Wl,-Bdynamic'] [72/88] Linking build/zcm/libzcm.so 11:21:18 runner ['/usr/bin/g++', '-shared', '-shared', '-pthread', 'zcm/blocking.cpp.1.o', 'zcm/eventlog.c.1.o', 'zcm/nonblocking.c.1.o', 'zcm/tools/IndexerPlugin.cpp.1.o', 'zcm/transport/generic_serial_circ_buff.c.1.o', 'zcm/transport/generic_serial_transport.c.1.o', 'zcm/transport/transport_file.cpp.1.o', 'zcm/transport/transport_inproc.cpp.1.o', 'zcm/transport/transport_zmq_local.cpp.1.o', 'zcm/transport/udpm/buffers.cpp.1.o', 'zcm/transport/udpm/mempool.cpp.1.o', 'zcm/transport/udpm/udpm.cpp.1.o', 'zcm/transport/udpm/udpmsocket.cpp.1.o', 'zcm/transport_registrar.c.1.o', 'zcm/url.cpp.1.o', 'zcm/util/debug.cpp.1.o', 'zcm/util/lockfile.cpp.1.o', 'zcm/util/topology.cpp.1.o', 'zcm/zcm.c.1.o', '-o/home/mm/Downloads/tongji_tools/zcm1.1.5/build/zcm/libzcm.so', '-Wl,-Bstatic', '-Lzcm/json', '-lzcm_json', '-Wl,-Bdynamic', '-lzmq'] [77/88] Linking build/zcm/java/libzcmjni.so 11:21:18 runner ['/usr/bin/gcc', '-shared', '-pthread', 'zcm/java/jni/zcm_zcm_ZCMJNI.c.1.o', '-o/home/mm/Downloads/tongji_tools/zcm1.1.5/build/zcm/java/libzcmjni.so', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Lzcm', '-L/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server', '-lzcm', '-lzmq', '-ljvm'] [78/88] Linking build/tools/cpp/logplayer/zcm-logplayer 11:21:18 runner ['/usr/bin/g++', '-pthread', 'tools/cpp/logplayer/main.cpp.1.o', '-o/home/mm/Downloads/tongji_tools/zcm1.1.5/build/tools/cpp/logplayer/zcm-logplayer', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Lzcm', '-lzcm', '-lzmq'] [79/88] Linking build/tools/cpp/log-repair/zcm-log-repair 11:21:18 runner ['/usr/bin/g++', '-pthread', 'tools/cpp/log-repair/main.cpp.1.o', '-o/home/mm/Downloads/tongji_tools/zcm1.1.5/build/tools/cpp/log-repair/zcm-log-repair', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Lzcm', '-lzcm', '-lzmq'] [80/88] Linking build/tools/cpp/repeater/zcm-repeater 11:21:18 runner ['/usr/bin/g++', '-pthread', 'tools/cpp/repeater/main.cpp.1.o', '-o/home/mm/Downloads/tongji_tools/zcm1.1.5/build/tools/cpp/repeater/zcm-repeater', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Lzcm', '-lzcm', '-lzmq'] [81/88] Linking build/tools/cpp/spy-peek/zcm-spy-peek 11:21:18 runner ['/usr/bin/g++', '-pthread', 'tools/cpp/spy-peek/main.cpp.1.o', '-o/home/mm/Downloads/tongji_tools/zcm1.1.5/build/tools/cpp/spy-peek/zcm-spy-peek', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Lzcm', '-lzcm', '-lzmq'] [82/88] Linking build/tools/cpp/spy-lite/zcm-spy-lite 11:21:18 runner ['/usr/bin/g++', '-pthread', 'tools/cpp/spy-lite/Debug.cpp.1.o', 'tools/cpp/spy-lite/MsgDisplay.cpp.1.o', 'tools/cpp/spy-lite/MsgInfo.cpp.1.o', 'tools/cpp/spy-lite/main.cpp.1.o', '-o/home/mm/Downloads/tongji_tools/zcm1.1.5/build/tools/cpp/spy-lite/zcm-spy-lite', '-Wl,-Bstatic', '-Ltools/cpp/util', '-lzcm_tools_util', '-Wl,-Bdynamic', '-Lzcm', '-lzcm', '-lzmq', '-lelf', '-ldl'] [83/88] Linking build/tools/cpp/indexer/zcm-log-indexer 11:21:18 runner ['/usr/bin/g++', '-pthread', 'tools/cpp/indexer/BandwidthIndexerPlugin.cpp.1.o', 'tools/cpp/indexer/IndexerPluginDb.cpp.1.o', 'tools/cpp/indexer/TimingIndexerPlugin.cpp.1.o', 'tools/cpp/indexer/main.cpp.1.o', '-o/home/mm/Downloads/tongji_tools/zcm1.1.5/build/tools/cpp/indexer/zcm-log-indexer', '-Wl,-Bstatic', '-Ltools/cpp/util', '-lzcm_tools_util', '-Wl,-Bdynamic', '-Lzcm', '-lzcm', '-lzmq', '-lelf', '-ldl'] [84/88] Linking build/tools/cpp/transcoder/zcm-log-transcoder 11:21:18 runner ['/usr/bin/g++', '-pthread', 'tools/cpp/transcoder/main.cpp.1.o', '-o/home/mm/Downloads/tongji_tools/zcm1.1.5/build/tools/cpp/transcoder/zcm-log-transcoder', '-Wl,-Bstatic', '-Ltools/cpp/util', '-lzcm_tools_util', '-Wl,-Bdynamic', '-Lzcm', '-lzcm', '-lzmq', '-lelf', '-ldl'] [85/88] Linking build/tools/cpp/logger/zcm-logger 11:21:18 runner ['/usr/bin/g++', '-pthread', 'tools/cpp/logger/main.cpp.1.o', '-o/home/mm/Downloads/tongji_tools/zcm1.1.5/build/tools/cpp/logger/zcm-logger', '-Wl,-Bstatic', '-Ltools/cpp/util', '-lzcm_tools_util', '-Wl,-Bdynamic', '-Lzcm', '-lzcm', '-lzmq', '-lelf', '-ldl'] [86/88] Linking build/tools/cpp/bridge/zcm-bridge 11:21:18 runner ['/usr/bin/g++', '-pthread', 'tools/cpp/bridge/main.cpp.1.o', '-o/home/mm/Downloads/tongji_tools/zcm1.1.5/build/tools/cpp/bridge/zcm-bridge', '-Wl,-Bstatic', '-Ltools/cpp/util', '-lzcm_tools_util', '-Wl,-Bdynamic', '-Lzcm', '-lzcm', '-lzmq', '-lelf', '-ldl'] [87/88] Linking build/tools/cpp/topology-visualizer/zcm-topology-visualizer 11:21:18 runner ['/usr/bin/g++', '-pthread', 'tools/cpp/topology-visualizer/main.cpp.1.o', '-o/home/mm/Downloads/tongji_tools/zcm1.1.5/build/tools/cpp/topology-visualizer/zcm-topology-visualizer', '-Wl,-Bstatic', '-Ltools/cpp/util', '-lzcm_tools_util', '-Wl,-Bdynamic', '-Lzcm', '-lzcm', '-lzmq', '-lelf', '-ldl'] zcm/python/zerocm.c: In function ‘__Pyx_CyFunction_CallAsMethod’: zcm/python/zerocm.c:12115:47: error: format ‘%S’ expects argument of type ‘wchar_t ’, but argument 3 has type ‘PyObject {aka struct _object *}’ [-Werror=format=] "unbound method %.200S() needs an argument",

                          cyfunc->func_qualname);

cc1: all warnings being treated as errors

Waf: Leaving directory `/home/mm/Downloads/tongji_tools/zcm1.1.5/build' Build failed -> task in 'pyzcm' failed with exit status 1: {task 140228307341096: c zerocm.c -> zerocm.c.2.o} ['/usr/bin/gcc', '-fPIC', '-fno-strict-aliasing', '-g', '-fdebug-prefix-map=/build/python2.7-oYYDrU/python2.7-2.7.17=.', '-fstack-protector-strong', '-g', '-fwrapv', '-O2', '-std=gnu99', '-fPIC', '-pthread', '-Wall', '-Werror', '-Wno-unused-function', '-O3', '-Wno-unused-local-typedefs', '-I.', '-I..', '-I/usr/include/python2.7', '-I/usr/include/x86_64-linux-gnu/python2.7', '-I..', '-DHAVE_JNI_H=1', '-DPYTHONDIR="/usr/local/lib/python3/dist-packages"', '-DPYTHONARCHDIR="/usr/local/lib/python3/dist-packages"', '-DHAVE_PYEMBED=1', '-DHAVE_PYEXT=1', '-DHAVE_PYTHON_H=1', '-DHAVE_ZMQ=1', '-D_FORTIFY_SOURCE=2', '-DNDEBUG', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-DUSING_CPP', '-DUSING_ELF', '-DUSING_JAVA', '-DUSING_NODEJS', '-DUSING_OPT', '-DUSING_PYTHON', '-DUSING_TRANS_INPROC', '-DUSING_TRANS_IPC', '-DUSING_TRANS_UDPM', '-DUSING_ZMQ', '-DENABLE_TYPENAME_HASHING', 'zcm/python/zerocm.c', '-c', '-o/home/mm/Downloads/tongji_tools/zcm1.1.5/build/zcm/python/zerocm.c.2.o']

how can I fix it? Thanks!

jbendes commented 2 years ago

Can you post only the error? What happens if you run ./waf build -v again? I'm going to try and replicate your issue in the Dockerfile using 18.04.

fty0724 commented 2 years ago

i have locate the error happend here:

zcm/python/zerocm.c:12115:47: error: format ‘%S’ expects argument of type ‘wchar_t *’, but argument 3 has type ‘PyObject * {aka struct _object *}’ [-Werror=format=]
"unbound method %.200S() needs an argument",
~~~~~^
cyfunc->func_qualname);
~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

so, I unregistered this code, and it works!

jbendes commented 2 years ago

What does unregistered mean?

fty0724 commented 2 years ago

sorry, my english is bad, I mean code cancellation (add # before these lines).

jbendes commented 2 years ago

What lines exactly? I can't replicate your issue when building the entire repo from the Dockerfile.

fty0724 commented 2 years ago

in zcm/python/zerocm.c: line 12115

PyError_Fromat(PyExc_TypeError,"unbound method %.200S() needs an argument", cyfunc->funcqualname);

jbendes commented 2 years ago

Is that a file in your build directory?

fty0724 commented 2 years ago

yes, it's in the build directory

jbendes commented 2 years ago

Yeah you shouldn't need to ever edit anything in the build directory. I was unable to reproduce your issue in the Dockerfile. If you are able to reproduce your issue in the dockerfile, I would love to take a look. But otherwise, it will be something with the way you set up your environment or are building. I'm going to close out this issue. If you'd like to continue to debug, I would suggest modifying the Dockerfile to generate your issue. What you'll probably find is that there is some difference between how you are trying to build and how the dockerfile is building. This is the command I was running to try and reproduce your issue: docker build -f Dockerfile -t zcm --build-arg IMAGE_VERSION=18.04 . Feel free to reopen the issue if you find additional details or are able to instruct how to replicate the issue