error occured on compling
Closed this issue · 2 comments
lgh@lgh-u20201:~/mydds$ colcon build --cmake-args -DSECURITY=ON -DEPROSIMA_BUILD=ON -DCMAKE_BUILD_TYPE=Debug --parallel-workers 32
Starting >>> fastcdr
Starting >>> foonathan_memory_vendor
Finished <<< foonathan_memory_vendor [0.37s]
Finished <<< fastcdr [0.57s]
Starting >>> fastrtps
Finished <<< fastrtps [6.14s]
Starting >>> ShapesDemo
--- stderr: ShapesDemo
CMake Error at cmake_install.cmake:41 (file):
file INSTALL cannot find
"/home/lgh/mydds/build/ShapesDemo/external/install/lib": No such file or
directory.
Failed <<< ShapesDemo [0.31s, exited with code 1]
Summary: 3 packages finished [7.57s]
1 package failed: ShapesDemo
1 package had stderr output: ShapesDemo
Hi @stilong,
You have uncovered the existence of some residual CMake code that should have been removed when the submodules where deleted from this repository here in #25. While we remove this code, you can try anD build ShapesDemo without the EPROSIMA_BUILD=ON
option. You have several ways of doing so:
- Run two different
colcon build
commands.colcon build --packages-up-to fastrtps --cmake-args -DSECURITY=ON -DEPROSIMA_BUILD=ON -DCMAKE_BUILD_TYPE=Debug --parallel-workers 32 source install/setup.bash colcon build --packages-select ShapesDemo --cmake-args -DCMAKE_BUILD_TYPE=Debug --parallel-workers 32
- Use a .meta file for defining compiling options with colon (see an example here).
- Build ShapesDemo in a different colcon workspace from the rest, and source the other one before running
colcon build
on the ShapesDemo one.
Hi @stilong,
I'm going to combine answers for this ticket and also for its duplicate in Fast DDS (eProsima/Fast-DDS#3322).
I have submitted to remove the residual CMake code that causing the compilation error.
Looking at the other issue, it seems that you are trying to compile not only ShapesDemo, but test for all the workspace (hinted by -DEPROSIMA_BUILD=ON
); if that is not the case, you may consider using a colcon .meta file to specify different build options for the different packages in the workspace.
In any case, to compile Fast DDS linking it against its submodule dependencies (TinyXML2 in this case), the appropriate flag is -DTHIRDPARTY=FORCE
(see here).
I have prepared a Dockerfile to showcase the entire installation on a clean Ubuntu 22.04. Mind that your issue points to Ubuntu 20.04; I choose 22.04 since installing Qt was actually not the point of the issue, and installing Qt it's easier in 22.04.
FROM ubuntu:22.04
# Needed for a dependency that forces to set timezone
ENV TZ=Europe/Madrid
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Download build tools
RUN apt update && \
apt install -y \
python3-pip \
cmake \
g++ \
wget \
git \
libssl-dev \
libp11-dev \
libengine-pkcs11-openssl \
softhsm2 \
qtbase5-dev
RUN pip install -U \
colcon-common-extensions \
vcstool
# Create workspace
WORKDIR /ShapesDemo
RUN mkdir src
# Download dependencies
RUN wget https://raw.githubusercontent.com/eProsima/ShapesDemo/master/shapes-demo.repos && \
vcs import src < shapes-demo.repos
# Add Gtest to be able to compile with -DEPROSIMA_BUILD=ON
RUN git clone \
--branch release-1.12.1 \
--single-branch \
--depth 1 \
https://github.com/google/googletest.git
# Checkout ShapesDemo fix branch
RUN cd src/shapes-demo && \
git checkout hotfix/cleanup_thirdparty
# Compile workspace
RUN colcon build \
--event-handlers=console_direct+ \
--cmake-args \
-DTHIRDPARTY=FORCE \
-DSECURITY=ON \
-DEPROSIMA_BUILD=ON \
-DGTEST_INDIVIDUAL=ON \
-DCMAKE_BUILD_TYPE=Debug \
--parallel-workers 32