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

Architecture specific checks break ability to cross-compile #6239

Open
vchuravy opened this issue Jan 31, 2021 · 5 comments
Open

Architecture specific checks break ability to cross-compile #6239

vchuravy opened this issue Jan 31, 2021 · 5 comments
Assignees
Labels

Comments

@vchuravy
Copy link

ucx/src/ucs/configure.m4

Lines 211 to 228 in c664678

#
# Architecture specific checks
#
case ${host} in
aarch64*)
AC_MSG_CHECKING([support for CNTVCT_EL0 on aarch64])
AC_RUN_IFELSE([AC_LANG_PROGRAM(
[[#include <stdint.h>]],
[[uint64_t tmp; asm volatile("mrs %0, cntvct_el0" : "=r" (tmp));]])],
[AC_MSG_RESULT([yes])]
[AC_DEFINE([HAVE_HW_TIMER], [1], [high-resolution hardware timer enabled])],
[AC_MSG_RESULT([no])]
[AC_DEFINE([HAVE_HW_TIMER], [0], [high-resolution hardware timer disabled])]
);;
*)
# HW timer is supported for all other architectures
AC_DEFINE([HAVE_HW_TIMER], [1], [high-resolution hardware timer enabled])
esac

Similar to FFTW/fftw3#73 and leads to the build failing when cross-compiling.

[03:23:26] configure: error: in `/workspace/srcdir/ucx-1.7.0':
[03:23:26] configure: error: cannot run test program while cross compiling
[03:23:26] See `config.log' for more details
[03:23:26]  ---> ./configure --prefix=${prefix} --build=${MACHTYPE} --host=${target} --disable-debug --disable-assertions --disable-params-check --disable-static --enable-mt --enable-frame-pointer --enable-cma --with-rdmacm=${prefix}
[03:23:26] Previous command exited with 1
[03:23:26] Child Process exited, exit code 1
[03:23:26] checking support for CNTVCT_EL0 on aarch64... ERROR: LoadError: Build for UCX on aarch64-linux-gnu did not complete successfully
@shamisp shamisp self-assigned this Jan 31, 2021
@shamisp
Copy link
Contributor

shamisp commented Jan 31, 2021

Is this with Linaro cross compile toolchain ? Can you please post your command line.

@shamisp
Copy link
Contributor

shamisp commented Feb 2, 2021

Can you give it a try:

diff --git a/src/ucs/configure.m4 b/src/ucs/configure.m4
index 153eb0d78..8ed448b14 100644
--- a/src/ucs/configure.m4
+++ b/src/ucs/configure.m4
@@ -214,10 +214,12 @@ case ${host} in
                   [[#include <stdint.h>]],
                   [[uint64_t tmp; asm volatile("mrs %0, cntvct_el0" : "=r" (tmp));]])],
                   [AC_MSG_RESULT([yes])]
-                 [AC_DEFINE([HAVE_HW_TIMER], [1], [high-resolution hardware timer enabled])],
-                 [AC_MSG_RESULT([no])]
-                 [AC_DEFINE([HAVE_HW_TIMER], [0], [high-resolution hardware timer disabled])]
-                 );;
+                  [AC_DEFINE([HAVE_HW_TIMER], [1], [high-resolution hardware timer enabled])],
+                  [AC_MSG_RESULT([no])]
+                  [AC_DEFINE([HAVE_HW_TIMER], [0], [high-resolution hardware timer disabled])],
+                  [AC_MSG_RESULT([no - cross-compiling detected])]
+                  [AC_DEFINE([HAVE_HW_TIMER], [0], [high-resolution hardware timer disabled])]
+                  );;
     *)
     # HW timer is supported for all other architectures
     AC_DEFINE([HAVE_HW_TIMER], [1], [high-resolution hardware timer enabled])

@vchuravy
Copy link
Author

vchuravy commented Feb 2, 2021

This is with the Julia cross-compilation toolchain https://github.com/JuliaPackaging/Yggdrasil/blob/master/U/UCX/build_tarballs.jl

I will try out your patch.

@vchuravy
Copy link
Author

vchuravy commented Feb 2, 2021

I had to backport the patch since I am building 1.9.0 (https://github.com/JuliaPackaging/Yggdrasil/pull/2487/files#diff-902a1a0ff5ee2963250308a500b3e95a316b2f9dd016619e624618e9461b5734)

but it looks like the build is going through successfully in JuliaPackaging/Yggdrasil#2487

@shamisp
Copy link
Contributor

shamisp commented Feb 2, 2021

I will push this to master and will create port for v1.10.0 which will be released very soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants