Software icon indicating copy to clipboard operation
Software copied to clipboard

Make cross-compilation more consistent across devices

Open itsarune opened this issue 9 months ago • 2 comments

Please fill out the following before requesting review on this PR

Description

Our cross-compilation is inconsistent across Ubuntu 20, 22 and 24 platforms and there are certain bugs that come from it. For example, Ubuntu 24 on ARM machines aren't able to compile code for the Jetson Nanos as a result of the different in GLIBC versions.

I standardized the cross-compilers to target GLIBC 2.27 and upgraded it to use gcc 8.

More details to come here: https://www.notion.so/ubcthunderbots/Toolchains-1b01e25196bd802c82c5f570f7584fb2?pvs=4

Testing Done

Compiles on my Ubuntu 24 machine, Ubuntu 22 desktop and Ubuntu 24 ARM emulator. Also runs on robots.

Resolved Issues

Length Justification and Key Files to Review

  • Most of these changes are linting changes due to the clang-format upgrade
  • Relevant toolchain files:
  • environment_setup/setup_software.sh
  • environment_setup/util.sh
  • src/WORKSPACE
  • src/cc_toolchain/BUILD
  • src/cc_toolchain/wrapper

Review Checklist

It is the reviewers responsibility to also make sure every item here has been covered

  • [ ] Function & Class comments: All function definitions (usually in the .h file) should have a javadoc style comment at the start of them. For examples, see the functions defined in thunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.
  • [ ] Remove all commented out code
  • [ ] Remove extra print statements: for example, those just used for testing
  • [ ] Resolve all TODO's: All TODO (or similar) statements should either be completed or associated with a github issue

itsarune avatar Mar 15 '25 18:03 itsarune

@itsarune Could you link the relevant changed files? Most of these are changes from the new clang-format right?

Andrewyx avatar Mar 30 '25 21:03 Andrewyx

@itsarune Could you link the relevant changed files? Most of these are changes from the new clang-format right?

Yup most of these are linting changes. These are the toolchain specific ones:

  • environment_setup/setup_software.sh
  • environment_setup/util.sh
  • src/WORKSPACE
  • src/cc_toolchain/BUILD
  • src/cc_toolchain/wrapper

but the meat of the work here in the PR is the configurations for building the toolchains (which is in the notion link about how these compilers are generated: https://www.notion.so/ubcthunderbots/Toolchains-1b01e25196bd802c82c5f570f7584fb2?pvs=4)

itsarune avatar Apr 04 '25 02:04 itsarune

Thanks @itsarune for the detailed toolchain docs -- very helpful documentation to have!

williamckha avatar May 07 '25 23:05 williamckha