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 issue in Docker container #479

Closed
DylanCavers opened this issue Jan 27, 2024 · 2 comments
Closed

cmake issue in Docker container #479

DylanCavers opened this issue Jan 27, 2024 · 2 comments

Comments

@DylanCavers
Copy link

DylanCavers commented Jan 27, 2024

Hi, I'm trying to get Paho C++ up and running in a container, but having issues with the install. This is working fine outside of the container but fails when I try to build inside. Any help would be much appreciated.

Seem to also be getting a similar issue to #469.

Here's the install in the Dockerfile. (edit: parent image is ubuntu:latest)

# Install Paho C
WORKDIR /home
RUN git clone https://github.com/eclipse/paho.mqtt.c.git
WORKDIR /home/paho.mqtt.c
RUN git checkout v1.3.13
RUN cmake -Bbuild -H. -DPAHO_ENABLE_TESTING=OFF -DPAHO_BUILD_STATIC=ON -DPAHO_WITH_SSL=ON -DPAHO_HIGH_PERFORMANCE=ON
RUN sudo cmake --build build/ --target install
RUN sudo ldconfig

# Install Paho C++
WORKDIR /home
RUN git clone https://github.com/eclipse/paho.mqtt.cpp.git
WORKDIR /home/paho.mqtt.cpp
RUN cmake -Bbuild -H. -DPAHO_WITH_MQTT_C=ON -DPAHO_BUILD_STATIC=ON -DPAHO_BUILD_DOCUMENTATION=OFF -DPAHO_BUILD_SAMPLES=OFF
RUN sudo cmake --build build/ --target install
RUN sudo ldconfig

And getting the following error

CMake Error at CMakeLists.txt:60 (add_subdirectory):
  add_subdirectory given source "/home/paho.mqtt.cpp/externals/paho-mqtt-c"
  which is not an existing directory.


CMake Error at CMakeLists.txt:64 (add_library):
  add_library cannot create ALIAS target "eclipse-paho-mqtt-c::paho-mqtt3a"
  because target "paho-mqtt3a" does not already exist.


CMake Error at CMakeLists.txt:66 (add_library):
  add_library cannot create ALIAS target "eclipse-paho-mqtt-c::paho-mqtt3as"
  because target "paho-mqtt3as" does not already exist.

update: for anyone unable to install at the moment here's my temp fix until the main issue is resolved.
not ideal as it uses a version from last summer but still has basic support, also drops the clone of the paho c repo in favour of git submodules, which is much nicer.

WORKDIR /home
RUN git clone --recurse-submodules https://github.com/eclipse/paho.mqtt.cpp.git
WORKDIR /home/paho.mqtt.cpp
RUN git checkout ef021805c7aca42d72194d85bb2bdccdfe963e28
RUN cmake -Bbuild -H. -DPAHO_WITH_MQTT_C=ON -DPAHO_BUILD_STATIC=ON -DPAHO_BUILD_DOCUMENTATION=OFF -DPAHO_BUILD_SAMPLES=ON
RUN sudo cmake --build build/ --target install
RUN sudo ldconfig
@AngelChik11
Copy link

Same issue on Ubuntu 16.10 under CMake 3.5.2... (((

@fpagliughi
Copy link
Contributor

fpagliughi commented Jan 28, 2024

Normally we try to keep the master branch relatively stable, but at the moment there is some churn leading up to the next release. Don’t rely on it for your production code.

Check out the tag for the latest release, “v1.3.2” (like you’re doing for the C lib) or wget the release tarball and build that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants