svlad-90 / DLT-Message-Analyzer

"Extended search" plugin for the DLT-viewer
GNU General Public License v3.0
77 stars 13 forks source link

Compilation of the plugin fails with "No rule to make target [...] libantlr4-runtime.a" #203

Closed vifactor closed 4 months ago

vifactor commented 4 months ago

Describe the bug I follow the instructions on how to build and install the plugin and get the following error at compilation step: make[2]: *** No rule to make target 'plugin/DLT-Message-Analyzer/dltmessageanalyzerplugin/src/antlr4_runtime/src/antlr4_runtime/runtime/Cpp/dist/libantlr4-runtime.a', needed by 'plugin/DLT-Message-Analyzer/dltmessageanalyzerplugin/src/CMakeFiles/antlr4_PCRE_static_autogen_timestamp_deps'. Stop. make[1]: *** [CMakeFiles/Makefile2:1716: plugin/DLT-Message-Analyzer/dltmessageanalyzerplugin/src/CMakeFiles/antlr4_PCRE_static_autogen_timestamp_deps.dir/all] Error 2 make: *** [Makefile:156: all] Error 2

To Reproduce Steps to reproduce the behavior:

Expected behavior Build should not fail

Desktop (please complete the following information):

svlad-90 commented 4 months ago

Hi @vifactor, first of all, thanks for reporting this issue.

I was able to reproduce it in the specified environment. Luckily, I'm also using Ubuntu 22.04.

I did the following things:

I thought the root cause was the old-style CMake scripting used by the Antlr4 C++ runtime. The core root cause is probably located somewhere there. However, I decided to go the easier way and update the newer CMake to exclude the possibility of the bug within CMake 3.28.1.

=> I switched to CMake 3.29.6 and discovered this issue was not reproducible after the update. => Also, it wasn't reproducible with the initial version of the CMake that I was using - 3.22.1.

This issue looks like a CMake bug. I suggest changing the CMake version to a newer ( or older ) one.

If you follow my advice, please remember to clean up your build folder and run the CMake configuration on the dlt-viewer once again to get an update of all the files generated by the CMake.

=> Please let me know whether my proposal is functional for you once you try it out.

vifactor commented 4 months ago

Thanks for your very quick reply! Indeed with other version of cmake (I tried cmake v3.22.0) it worked out. Should I make a PR to installation instructions with this hint?

Btw, I suspect because my system has both Qt6 and Qt5, and I do not explicitly provide Qt version via CMAKE_PREFIX_PATH, I had also issues at configure step. These can be overcome by providing explicit QT_PREFIX: cmake -DQT_PREFIX=Qt5 ...

Unfortunately, this trick does not work with the "original" dlt viewer, even if I checkout to the recommended 2.25-version tag.

svlad-90 commented 4 months ago

Hi @vifactor,

Thanks for your very quick reply! Indeed with other version of cmake (I tried cmake v3.22.0) it worked out. Should I make a PR to installation instructions with this hint?

I've prepared the following PR that extends the documentation: https://github.com/svlad-90/DLT-Message-Analyzer/pull/204

Please review it and reply whether it meets your expectations. If it does, I'll merge it and close this issue. ))

Btw, I suspect because my system has both Qt6 and Qt5, and I do not explicitly provide Qt version via CMAKE_PREFIX_PATH, I had also issues at configure step. These can be overcome by providing explicit QT_PREFIX: cmake -DQT_PREFIX=Qt5 ...

Unfortunately, this trick does not work with the "original" dlt viewer, even if I checkout to the recommended 2.25-version tag.

Please get in touch with the dlt-viewer dev team to resolve this issue. I'm reusing their QT_PREFIX concept in my implementation and can't do anything in this respect on my side.

vifactor commented 4 months ago

Your PR looks good, thanks again for fast support!