-
Notifications
You must be signed in to change notification settings - Fork 772
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
Compiling FastRTPS for QNX neutrino #272
Comments
Hi @suneeshs, I found someone with an issue compiling with asio that seems similar to your issue. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224130#c3 They seem to have fixed the issue by upgrading to boost 1.67 (which includes asio 1.12.1) Fast-RTPS is using asio 1.12.0. When the next asio version is released as requested on chriskohlhoff/asio#309, we will update our submodule. I hope you can go on with Fast-RTPS with this information. |
Add flag -stdlib=libstdc++, you may solve this problem. |
Unfortunately not. I have not yet tried using boost 1.67 with Fast-RTPS 1.6.0 yet. Instead I tried updating the ASIO library in thirdparty to the source code from "asio version 1.12.1 Released Sunday, 15 April 2018." https://github.com/chriskohlhoff/asio/tree/master/asio and see the same issue. |
hi @suneeshs have you solved the problem? Now I also want to cross compile FastRTPS for QNX. But I download the FastRTPS at http://www.eprosima.com/index.php?option=com_ars&view=browses&layout=normal. There is not a CMakeList.txt, instead a configure. |
Hi suneeshs @suneeshs and hi all you should add -DTHIRDPARTY=ON to you cross compile. it solved fastcdr problem. But it report a error: |
This helped with the compile issue. Thanks! |
I was able to proceed compiling using @seancx 's suggestion of adding "-stdlib=libstdc++". However, now I am seeing an error while linking libfastrtps.so: [ 97%] Building C object src/cpp/CMakeFiles/fastrtps.dir/rtps/persistence/sqlite3.c.o |
@suneeshs : FYI: for QNX SDP 7, by default it is linked to libc++. If you specify -stdlib=libstdc++, it will link to libstdc++. If your project needs a lot of third party libs, make sure they are all linked to the same c++ libs. Otherwise, you will see unexpected crashes in runtime. A simple way to list all linked libraries is to run "ntoxxxxx-objdump -p yourlib.so" . Hope it helps. |
Here is the diff which might help the asio issue aforementioned.
|
Thanks for your help and collaboration. Currently we don't support officially QNX. We are working to make it officially in future versions. All contributions are appreciated. |
@richiware : Welcome. Found some old notes and re-run the compilation. Luckily It still works. Here they are:
You should see the following at the end:
fast_rtps_aarch64le_Toolchain.cmake.txt Here is its linked libraries:
|
HI jilinzhou @jilinzhou I apologize for disturbing you again..
Just as you say, my project depend protobuf indeed. I need it is linked to the libstdc++. But It failed. It seem that protobuf do not support flag libstdc++. protocolbuffers/protobuf#2945 |
I was able to get the HelloWorld program to run between my QNX machine and a Windows machine while using unicast (just have not had the time to try multicast discovery yet). So I consider this issue closed. To summarize, the changes I needed to make were:
|
Hi, @jilinzhou, I have compile the fast rtps for qnx. And start it with a very simple example found at: The ifconfig output is |
append: The multicast seems does not work. the nicinfo output is
|
@darbee : Cannot remember I ever run those examples. I suggest you enable logging and debug from there. Take a closer look of its CMakelist.txt and figure out all possible configurable parameters. Here are some related to logging:
|
@jilinzhou very thanks for your reply jilinzhou. I think it's not the reason of log level. Because I use the tcpdump -i lo0 to monitor the network. When I run the listener and talker, tcpdump output nothing. More detail message can find at #343. Thank for you jilinzhou again! |
@darbee : Of course, it is not the log level problem. However looking at internal log messages help you find the root cause. |
I did have to add initial peers. Probably something you could try:
|
1st console:
2nd console:
|
@suneeshs thanks you , I will try your suggestion. Soon I will tell you the result |
@jilinzhou I want to cry. Why I can not get the output like you? Is there are some thing wrong with my QNX? I will listen to you to modify the log level to see the reason. |
the debug log is :
|
And again @jilinzhou ilinzhou. Can you offer me your libs such as libfastcdr.so libfastcdr.so.1.0.7 libfastrtps.so libfastrtps.so.1 libfastrtps.so.1.6.0 and your executable file HelloWorldExample? Using these files , I can find out
When I first run and then it will output When I first run and then It will output But subscriber output nothing. It is very strange for me. Please accept my deepest thanks jilinzhou. And it 's too late for me. It is about 01:18 in my time zone. so I may not be able to wait for your reply. sorry. You can send these files to my email lantuling@gmail.com or Upload as an attachment. |
@darbee : attached with the binaries. Here is the linking info for the example:
|
Too sad, @jilinzhou using your libs and HelloWorldExample, It can run correctly. But using my code, I can only run staticworlExample. Do you use the example at |
boost/asio/detail/impl/socket_ops.ipp--- boost/asio/detail/impl/socket_ops.ipp (revision 843663)
+#else //QNX
#endif except this file , any other file have you changed for qnx @jilinzhou ? By the way , I don't find the boost/asio/detail/impl/socket_ops.ipp I only find a file named socket_ops.ipp at |
That is the only file I changed. |
Hmmm. Interesting, still does't work.. @jilinzhou . Would you mind giving me a copy of the code of your version (fast rtps).Although I follow your steps and instructions to build the project |
@darbee Sorry, I cannot pass you the code but it should be exactly the same as yours. Are you using the toolchain file I uploaded? Are you linking it with libstdc++ or libc++? Use ntoaarch64-objdump -p to show that. |
@jilinzhou yes,I use your toolchain file, and it link with libc++ . here is my objdump result:
By the way why In you project, there is a boost path,boost/asio/detail/impl/socket_ops.ipp |
Hi @jilinzhou thanks again, I have work it out. On the basis of your help, I change the socket_ops.ipp file. But instead using
I change the code |
glad that you figured it out. My diff for socket_ops.ipp was generated in somewhere else. The way you are doing it is supposed to be. |
Aha, That is how it is. Anyway, thank you very much for your selfless help. |
Came across the following issue while compiling Fast-RTPS(v1.6.0) on QNX 7.0 with libc++
Since QNX libc++ is at 3.7 it does not yet support TEMPLATE_ALIASES. Created the patch file fast_rtps_asio.patch.gz to fix the issue |
@anup-pem : I think your configuration has some issues. The libc++ shipped with QNX SDP 7.0.0 for sure has alias_template feature. I have attached the feature_tests.cxx used by CMake here. You can try it manually as the following:
|
@jilinzhou Thank you for your response. Sorry for not being specific about the version of Fast-RTPS. I am using v1.6.0. I updated my previous comment. Would be great if you can compile v1.6.0 version without any asio changes. If so, please let me know. Thanks |
@jilinzhou For simplicity, I created a test case to reproduce the problem I see in asio package(asio/include/asio/detail/memory.hpp) when compiling Fast-RTPS with v1.6.0. Just copy this code into a file called test_bind.cpp and the command used to compile is at the beginning of the source code. If you uncomment the #ifndef and #else part of the code, it compiles fine. Please let me know if there is a better solution so that I don't have to use my asio patch (#272 (comment)) . Just curious. Thanks
|
You can build it against GNU c++ library as the following: Have you been able to built it against LLVM c++ library on linux? |
@anup-pem : qnx sdp7 qcc toolchain only supports gcc compiler (version 5.4.0) which has no built-in macro
The gcc compiler has |
Yes, it works for libstdc++ with Vgcc_ntox86_64_gpp or -stdlib=libstdc++. The issue is with the LLVM C++.
Have not tested on Linux. But we do OS X build with LLVM C++ lib and it works fine
Not sure how it will help in fixing the |
@anup-pem : With this combination of gcc 5.4.0 compiler and libc++ 3.7.0, we are pretty much out of luck but use your patch. Here is a link which talks about the similar issue: |
FYI, I created chriskohlhoff/asio#353 adding the SO_REUSEPORT option for QNX |
@MiguelCompany : Thanks! |
For problems with QNX SDP 7.0 and LLVM backend ( |
I am having some trouble compiling FastRTPS for QNX. ‘fastcdr’ builds but compiling ‘fastrtps’ errors out complaining about asio related issues. I noticed that you have listed QNX as one of the platforms for which FastRTPS has been built so wanted to check if I am missing something.
I am cross compiling through CMAKE using a QNX toolchain file. The workflow is described in the PDF file that is in the attached ZIP file. It also contains the toolchain file that I am using. Any help is appreciated, please let me know if you need any more information.
FastRTPS_QNX_build_issue.zip
The text was updated successfully, but these errors were encountered: