Skip to content
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

CMake problem with MQTT examples #103

Closed
edwardalee opened this issue Mar 10, 2024 · 4 comments · Fixed by #104
Closed

CMake problem with MQTT examples #103

edwardalee opened this issue Mar 10, 2024 · 4 comments · Fixed by #104
Assignees
Labels
bug Something isn't working

Comments

@edwardalee
Copy link
Contributor

In the playground, compiling examples/C/src/mqtt/MQTTDistributed.lf now gives the following compile error, which did not occur before. How to fix this? Help please. The error message means nothing to me.

CMake Error at paho-extension.cmake:49 (target_link_libraries):
  The keyword signature for target_link_libraries has already been used with
  the target "federate__source".  All uses of target_link_libraries with a
  target must be either all-keyword or all-plain.

  The uses of the keyword signature are here:

   * CMakeLists.txt:85 (target_link_libraries)
   * CMakeLists.txt:87 (target_link_libraries)
   * CMakeLists.txt:97 (target_link_libraries)

The offending line in pho-extension.cmake is this:

target_link_libraries(${LF_MAIN_TARGET} ${PAHO_MQTT_C_LIBRARIES})
@edwardalee edwardalee added the bug Something isn't working label Mar 10, 2024
@cmnrd
Copy link
Contributor

cmnrd commented Mar 11, 2024

The fix is to change the line to:

target_link_libraries(${LF_MAIN_TARGET} PRIVATE ${PAHO_MQTT_C_LIBRARIES})

This fix works only with versions greater than 0.6.0., so we should wait for the 0.7.0 release before we update the example.

@edwardalee
Copy link
Contributor Author

I thought that CI in the playground was running with the latest release, but the MQTT examples fail to build in CI. See https://github.com/lf-lang/playground-lingua-franca/actions/runs/8222781948/job/22484683032
Are we now running the playground CI with the nightly build?

@cmnrd
Copy link
Contributor

cmnrd commented Mar 11, 2024

This appears to be the case, yes. Actually, #101 switched from the release version to LF master (I think because the updated/new examples did not work with the 0.6.0 release).

I don't know how to resolve this. Generally, we should either only merge examples that work with the latest release, or if we want to use master, make sure that all examples are compiled in the LF CI. I just merged lf-lang/lingua-franca#2235, which likely will introduce more errors.

It seems like our best bet is releasing 0.7.0 ASAP and then updating the examples quickly.

@cmnrd
Copy link
Contributor

cmnrd commented Mar 11, 2024

I started working on fixes here: #104

I will also push fixes for the syntax updates in lf-lang/lingua-franca#2235 there tomorrow. Feel free to add other fixes as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants