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

Fix ARM Focal Cross Compilation issues #36

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ ENV DEBIAN_FRONTEND="noninteractive"
# have the package manager scan the current repo list
RUN apt-get update

FROM base AS x64-version

# add build tools including Google test and mock
RUN ./opt/carma/scripts/install_build_tools.sh

FROM base AS x64-version
# Native build/dev environment
MishkaMN marked this conversation as resolved.
Show resolved Hide resolved

FROM base AS cross-compile-version
# Cross Compile environment

# set an envionrment variable anything can use to tell this is a cross compile environment
ARG BUILD_ARCHITECTURE
Expand All @@ -32,7 +33,7 @@ COPY cross/add_cross_architecture_ports.sh /
RUN /add_cross_architecture_ports.sh

# install the cross compiler
RUN apt-get update && apt-get install -y cmake crossbuild-essential-${BUILD_ARCHITECTURE} file
RUN apt-get update && apt-get install -y crossbuild-essential-${BUILD_ARCHITECTURE} file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are just removing the cmake here, which component or where in the pipeline do we install it?
Is there any README.md need to be updated because of this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are all installed by https://github.com/usdot-fhwa-stol/carma-builds/blob/develop/scripts/install_build_tools.sh. Do you think it would be helpful to mention this explicitly in the README or is the script naming sufficient

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I think that is okay. It maybe beginner question, but looking at the install_build_tools.sh script, I wonder how does installing x86-64 specific cmake work in other architectures?

wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.sh
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz
chmod u+x cmake-${CMAKE_VERSION}-linux-x86_64.sh
./cmake-${CMAKE_VERSION}-linux-x86_64.sh --skip-license --exclude-subdir --prefix=/usr/local
rm cmake-${CMAKE_VERSION}-linux-x86_64.sh
rm cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz

Do the scripts from cross go and fix/adjust after the x86-64 installation is done to make it cross compilable?
Has it been tested to work for the original issue you were encountering?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talked offline about it, looks good to me


# copy in our CMake toolchain file which indicates which compile tools to use
COPY cross/cmake_${BUILD_ARCHITECTURE}.toolchain.ubuntu /opt/carma/cmake/
Expand Down
Loading