-
Notifications
You must be signed in to change notification settings - Fork 65
[ML] Add cross compilation support, Docker images and CI for aarch64 #1135
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
Conversation
Following on from elastic#1132, this change adds: 1. The ability to cross compile a Linux build for aarch64 on Linux on another hardware architecture 2. A Docker container for x86_64 that is set up for cross compiling for aarch64 3. A Docker container for aarch64 that can both build and run unit tests 4. Changes to CI scripts to utilise these Docker containers where appropriate
@@ -192,13 +209,7 @@ case `uname` in | |||
if [ $? -eq 0 ] ; then | |||
echo "Set RPATH in $FILE" | |||
else | |||
# Set RPATH for 3rd party libraries that reference other libraries we ship | |||
ldd $FILE | grep /usr/local/lib >/dev/null 2>&1 && patchelf --set-rpath '$ORIGIN/.' $FILE |
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 removed this bit because it hasn't been doing anything since we switched from storing the 3rd party libraries we build from /usr/local/lib
to /usr/local/gcc75/lib
. This came up in this PR because ldd
only works on the native architecture. But the line is completely unnecessary now as Boost must have changed the way they link related libraries since we first added this line.
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.
Looks good Dave. A couple of minor comments. I haven't spotted any issues, but I guess the proof is in the eating! Happy for you to go ahead and submit without another review.
SYSROOT=/usr/local/sysroot-$CPP_CROSS_COMPILE-linux-gnu | ||
BOOST_LOCATION=$SYSROOT/usr/local/gcc75/lib | ||
BOOST_COMPILER=gcc | ||
if [ "$CPP_CROSS_COMPILE" = aarch64 ] ; then |
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.
Is there any reason to set SYSROOT, etc if this if condition fails. It seems more natural to just add this as a new
elif [ "$CPP_CROSS_COMPILE" = aarch64 ] ; then
and keep the failure case at the end? Then if we added another target we could just add a new elif
.
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.
The reason I did it like this is that during the porting exercise I realised that a port to Linux on any other architecture could reuse a lot of the same code. Everything between lines 78 and 96 would be the same except the Boost abbreviation for the hardware architecture.
(This is also why I named the new make rules file linux_cross_compile_linux.mk
. I started out with linux_cross_compile_aarch64.mk
but realised before I opened the PR that almost the entire file would be the same for a cross compile to Linux on any other hardware architecture. Maybe in 5 years time we'll be cross compiling x86_64 from aarch64.)
Co-Authored-By: Tom Veasey <[email protected]>
retest |
…ch64 Following on from elastic#1134, this change adds: 1. The ability to cross compile a Linux build for aarch64 on Linux on another hardware architecture 2. A Docker container for x86_64 that is set up for cross compiling for aarch64 3. A Docker container for aarch64 that can both build and run unit tests 4. Changes to CI scripts to utilise these Docker containers where appropriate Backport of elastic#1135
Following elastic/ml-cpp#1135 there are now Linux binaries for both x86_64 and aarch64. The code that finds the correct binaries to ship with each distribution was including both on every Linux distribution. This change alters that logic to consider the architecture as well as the operating system. Also, there is no need to disable ML on aarch64 now that we have the native binaries available. ML is still not supported on aarch64, but the processes at least run up and work at a superficial level.
Following elastic/ml-cpp#1135 there are now Linux binaries for both x86_64 and aarch64. The code that finds the correct binaries to ship with each distribution was including both on every Linux distribution. This change alters that logic to consider the architecture as well as the operating system. Also, there is no need to disable ML on aarch64 now that we have the native binaries available. ML is still not supported on aarch64, but the processes at least run up and work at a superficial level.
Following elastic/ml-cpp#1135 there are now Linux binaries for both x86_64 and aarch64. The code that finds the correct binaries to ship with each distribution was including both on every Linux distribution. This change alters that logic to consider the architecture as well as the operating system. Also, there is no need to disable ML on aarch64 now that we have the native binaries available. ML is still not supported on aarch64, but the processes at least run up and work at a superficial level. Backport of elastic#55256
Following elastic/ml-cpp#1135 there are now Linux binaries for both x86_64 and aarch64. The code that finds the correct binaries to ship with each distribution was including both on every Linux distribution. This change alters that logic to consider the architecture as well as the operating system. Also, there is no need to disable ML on aarch64 now that we have the native binaries available. ML is still not supported on aarch64, but the processes at least run up and work at a superficial level. Backport of #55256
…ch64 (#1138) Following on from #1134, this change adds: 1. The ability to cross compile a Linux build for aarch64 on Linux on another hardware architecture 2. A Docker container for x86_64 that is set up for cross compiling for aarch64 3. A Docker container for aarch64 that can both build and run unit tests 4. Changes to CI scripts to utilise these Docker containers where appropriate Backport of #1135
Following on from #1132, this change adds:
Linux on another hardware architecture
compiling for aarch64
unit tests
where appropriate