ZMQ files not linked with TensorRT sample

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) NVIDIA Jetson Xavier AGX
• DeepStream Version 5.1
• JetPack Version (valid for Jetson only) 4.5.1
• TensorRT Version 7.1.3
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs) questions

• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)

I installed zmq on my Xavier as follows:

sudo apt-get install libzmq3-dev

I created a simple ZMQ server that uses PUSH/PULL architecture in a C++ program. I am able to compile it using CLI as follows:

$ gcc -Wall -g server.cpp -lstdc++ -lzmq -o out

Then I integrate this code in my sampleUffMaskRCNN. As this is compiled using the makefile (makefile.config). To compile the updated application, I need to add the -lzmq flag to the original makefile. This is what I do:

-COMMON_FLAGS += -Wall -Wno-deprecated-declarations -std=c++11 $(INCPATHS)
+COMMON_FLAGS += -Wall -g -lstdc++ -lzmq -Wno-deprecated-declarations -std=c++11 $(INCPATHS)

On running sudo make clean && sudo make, I get

Linking: ../../bin/sample_uff_mask_rcnn_debug
../../bin/dchobj/sampleUffMaskRCNN.o: In function `main':
/home/virus/Desktop/optimisation/custom-inference-mrcnn/maskRCNN/sampleUffMaskRCNN.cpp:717: undefined reference to `zmq_ctx_new'
/home/virus/Desktop/optimisation/custom-inference-mrcnn/maskRCNN/sampleUffMaskRCNN.cpp:718: undefined reference to `zmq_socket'
/home/virus/Desktop/optimisation/custom-inference-mrcnn/maskRCNN/sampleUffMaskRCNN.cpp:724: undefined reference to `zmq_ctx_new'
/home/virus/Desktop/optimisation/custom-inference-mrcnn/maskRCNN/sampleUffMaskRCNN.cpp:725: undefined reference to `zmq_socket'
/home/virus/Desktop/optimisation/custom-inference-mrcnn/maskRCNN/sampleUffMaskRCNN.cpp:726: undefined reference to `zmq_connect'
/home/virus/Desktop/optimisation/custom-inference-mrcnn/maskRCNN/sampleUffMaskRCNN.cpp:737: undefined reference to `zmq_recv'
collect2: error: ld returned 1 exit status
../Makefile.config:301: recipe for target '../../bin/sample_uff_mask_rcnn_debug' failed
make: *** [../../bin/sample_uff_mask_rcnn_debug] Error 1

I feel that I am messing up with the makefile because zmq works when compiling using gcc.

• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

I have cloned the sampleUffMaskRCNN sample provided in the pre-installed TensorRT and then added the ZMQ part. On compiling this modified sample using modified makefile.config,


Do you want to add the zmq library into sampleUffMaskRCNN but it is not working?
If yes, could you share the error you met with us first?


Sorry for leaving that part. Just added it to the question. Please look

Ok so I was wrongly adding the linker flag -lzmq to the compiler line, which was meant to only contain compilation flags and not linker flags.

This is the change I made:

+COMMON_LIBS += -lzmq

and undid the change to

-COMMON_FLAGS += -Wall -Wno-deprecated-declarations -std=c++11 $(INCPATHS)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.