-
Notifications
You must be signed in to change notification settings - Fork 217
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
Add Arm LLVM cross-compilation CI pipeline #2736
Add Arm LLVM cross-compilation CI pipeline #2736
Conversation
For Clang cross-compilation we need to do a few extra things when compared to GNU. First of all, we need to have a sysroot with all the libraries installed that we want. As such, we debootstrap a sysroot, which is to be cached in the Azure CI pipelines. We also install a more recent version of the LLVM compiler. Whilst not necessary for the Arm build, this is necessary to get some more recent support for RISC-V, in particular the vector extensions, which will be coming in a future commit. Changes made: * Install clang from llvm.org, rather than default apt * Build a sysroot with necessary packages, and cache this in the CI * Add a CMake toolchain file for Clang on aarch64 * Update OpenBLAS build to pass appropriate options for clang cross-compilation * Add a variable to the oneDAL makefile to detect Clang cross-compilation, and set appropriate flags for building * Update list of failing tests under emulation
@rakshithgb-fujitsu You might want to have a look at this as well @napetrov @Alexandr-Solovev I've added an LLVM cross-compiled Arm pipeline. This is because the LLVM toolchain for RISC-V is more mature, and I am going to put up another pull request for the RISC-V build on top of this one. I want to show that the RISC-V cross-build is very similar to the aarch64 one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general LGTM, just have one question and request minor fixes. Lets wait private CI
sudo debootstrap --arch="$2" --verbose --include=fakeroot,symlinks,libatomic1 --resolve-deps --variant=minbase --components=main,universe "$3" "$4" | ||
sudo chroot "$4" symlinks -cr . | ||
sudo chown "${USER}" -R "$4" | ||
rm -rf "${4:?}"/{dev,proc,run,sys,var} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please explain how and for what these rm functions will work? Can it affect user?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just to save on a few bytes when caching the sysroot. We only need the sysroot for includes and libraries, and not for running a chroot, so we rm some of the executables. The use of "${4:?}" will ensure that we don't remove /dev /proc, etc. The list might not be exhaustive here, but it is at least a start for what can be trimmed away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks! I relaunched a private ci job, previous one was pretty green, but it's just for doublechecking. When it will be finished, I'll approve this pr.
/intelci: run |
/intelci: run |
Description
For Clang cross-compilation we need to do a few extra things when compared to GNU. First of all, we need to have a sysroot with all the libraries installed that we want. As such, we debootstrap a sysroot, which is to be cached in the Azure CI pipelines. We also install a more recent version of the LLVM compiler. Whilst not necessary for the Arm build, this is necessary to get some more recent support for RISC-V, in particular the vector extensions, which will be coming in a future commit.
Changes proposed: