-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
posix: redefinition of symbols while porting zeromq to zephyr #22722
Comments
I had also a similar problem when i tried out to port asio (asio is already ported for esp32 in esp-idf). |
As someone who ported more than project to Zephyr POSIX subsystem, and made numerous changes to that subsys to accommodate such porting efforts, I certainly can understand there're many more changes to make before Zephyr will be an equal member among POSIX systems (if that ever happens). ZMQ is definitely a hard case, because it's C++ and a large project overall. Something which caught my attention in the original description is:
There's no "west" in POSIX, so you're already not really using POSIX. I'd suggest to stick to POSIX tools when trying to work with POSIX subsystems, like Zephyr's one. At least, that would be my suggestion - please try to reproduce the issue without involving adhoc tools like west. |
Do you have a link to the PR? Maybe that could give me some additional ideas on what I need to do. |
Finally found the solution to this bug. Due to my own doing the CMakeLists.txt in libzmq defined -D_GNU_SOURCE which caused the redefines. |
Hi, is there any official support for ZeroMQ on Zephyr or this @jensschroer is the only one solution? |
@pablogs9 As far as I am aware there isn't any official support for ZeroMQ on Zephyr. I discontinued my efforts on the direct port, as the library turned out to be too big for the MCU I was targeting. I am still interested in ZeroMQ on Zephyr, so I might start another try if time permits. |
Thanks for the answer @jensschroer, I'm looking a broker-less pub-sub (ideally also req-rep) library that can be embedded in MCU like STM32F4 or so (~150 KB RAM, ~1 MB Flash). I'm targeting systems with RTOS and some POSIX compliance (by now: Zephyr RTOS, Nuttx and FreeRTOS + POSIX labs extensions). And ideally, it should be C++ free... I'm checking right now this nanomsg ng. Are you aware of any other solution? |
@pablogs9 I have also looked at nanomsg-ng and tried to port it, after I got stuck with ZeroMQ. At the time I could not port nanomsg-ng as some systemcalls were missing. From what I remember eventfd was the main one - which has been added recently to Zephyr. I was considering to implement a subset of ZeroMQ in C in Zephyr, but have not found the time for it. |
I think that I'm going to try nanomsg-ng. I'll keep you updated if success. |
Any update on your progress @pablogs9? |
@lakshjaisinghani we developed a DDS embedded solution, that is FreeRTOS compatible, so I guess that is easy to port to Zephyr: https://safe-dds.docs.eprosima.com/ |
Describe the bug
I am trying to port zeromq (libzmq) to Zephyr, using the posix subsystem.
I have patched libzmq to compile it as a module in Zephyr and created a small 'Hello World' app.
The compilation fails with several redefined symbols in the posix system.
To Reproduce
The easiest way to reproduce the issue is to clone my sample project.
I am using west for building the project.
Assuming a newly initialized zephyr installation (
west init
followed bywest update
etc)Steps to reproduce the behavior:
zephyr
)git clone https://github.com/jensschroer/zmqapp.git
git clone https://github.com/jensschroer/libzmq.git
Expected behavior
The build should continue without redefined symbols.
Screenshots or console output
As example, the following is the error output from one file that files, but also including
-H
outputEnvironment (please complete the following information):
Additional context
I include the library libzmq in the app by using
ZEPHYR_EXTRA_MODULES
.In order for west / cmake to add the zephyr posix include directories to the libzmq include paths,I had to explicitly add a
target_link_libraries
dependency on theposix_subsys
inlibzmq/CMakefile.txt
(see libzmq/CMakefile.txt, search forposix_subsys
).I just wanted to point this out, as I am not sure if this is the correct way or if it even might contribute to this problem.
The text was updated successfully, but these errors were encountered: