You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2023/01/12 21:02:54 UTC

[GitHub] [tvm] gigiblender commented on a diff in pull request #13714: [CI] Cross-compile libtvm_runtime to Aarch64 and run tests

gigiblender commented on code in PR #13714:
URL: https://github.com/apache/tvm/pull/13714#discussion_r1068650074


##########
tests/scripts/task_config_build_minimal_cross_isa.sh:
##########
@@ -0,0 +1,49 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -euxo pipefail
+
+BUILD_DIR=$1
+mkdir -p "$BUILD_DIR"
+cd "$BUILD_DIR"
+cp ../cmake/config.cmake .
+
+echo set\(USE_SORT ON\) >> config.cmake
+echo set\(USE_RELAY_DEBUG ON\) >> config.cmake
+echo set\(CMAKE_BUILD_TYPE=Debug\) >> config.cmake
+echo set\(CMAKE_CXX_FLAGS \"-Werror -Wp,-D_GLIBCXX_ASSERTIONS\"\) >> config.cmake
+echo set\(HIDE_PRIVATE_SYMBOLS ON\) >> config.cmake
+echo set\(USE_LIBBACKTRACE OFF\) >> config.cmake
+echo set\(USE_CCACHE OFF\) >> config.cmake
+echo set\(SUMMARIZE ON\) >> config.cmake
+
+architecture_type=$(uname -i)
+if [ "$architecture_type" != "aarch64" ]; then
+  echo set\(USE_LLVM \"/usr/llvm-aarch64/bin/llvm-config --link-static\"\) >> config.cmake
+
+  # Cross compile to aarch64
+  echo set\(CMAKE_C_COMPILER aarch64-linux-gnu-gcc\) >> config.cmake
+  echo set\(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++\) >> config.cmake
+
+  echo set\(CMAKE_FIND_ROOT_PATH /usr/aarch64-linux-gnu\) >> config.cmake
+  echo set\(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER\) >> config.cmake
+  echo set\(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY\) >> config.cmake
+else
+  # This usually runs in the ci_arm docker image.

Review Comment:
   I am building the cpp tests on aarch64 instead of cross-compiling, and in order to build (and run) the tests, I need the LLVM backend enabled.  I am running this config file on the aarch64 Jenkins node before building the tests.
   
   The reason I am not cross-compiling the cpp tests is that I would need to cross-compile gtest beforehand.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org