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

Conversation

paulbourelly999
Copy link
Contributor

@paulbourelly999 paulbourelly999 commented Oct 30, 2024

PR Details

Description

Dependent repositories that use carma-builds docker images as CI build environments for compiling and cross-compiling C++ libraries into Debian packages using CPack have had some build issues.
image
https://github.com/usdot-fhwa-stol/carma-j2735/actions/runs/11601962110/job/32305932330#step:6:788
One difference in build environment between cross-compiled and natively compiled libraries is CMake version. This PR ensures that both cross-compiling and natively compiling build environments install the same build tools

Related GitHub Issue

Related Jira Key

ARC-225

Motivation and Context

Fix cross compilation issues

How Has This Been Tested?

CI

Types of changes

  • Defect fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)

Checklist:

  • I have added any new packages to the sonar-scanner.properties file
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@paulbourelly999 paulbourelly999 self-assigned this Oct 30, 2024
@paulbourelly999 paulbourelly999 marked this pull request as ready for review October 30, 2024 22:31
Dockerfile Show resolved Hide resolved
@@ -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 link
Contributor

@MishkaMN MishkaMN left a comment

Choose a reason for hiding this comment

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

I just have a clirfying question about it, but looks good so far.
Please update if any README needs to be changed

@paulbourelly999 paulbourelly999 merged commit 60b294a into develop Nov 4, 2024
14 checks passed
@paulbourelly999 paulbourelly999 deleted the arc-225-fix-arm-focal-cross-compilation-issues branch November 4, 2024 15:58
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

Successfully merging this pull request may close these issues.

2 participants