From 8f875f1e892abe5fde51a4d028c95352dbe57895 Mon Sep 17 00:00:00 2001 From: "Chayim I. Kirshen" Date: Wed, 16 Jun 2021 12:07:03 +0300 Subject: [PATCH] remove submodule requirement for dependency fetching --- get_deps.sh | 15 +++++++++++---- opt/build/libtorch/repack.sh | 11 ++++++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/get_deps.sh b/get_deps.sh index 3b65f11a4..11e18f8ae 100755 --- a/get_deps.sh +++ b/get_deps.sh @@ -47,10 +47,17 @@ else fi fi -git submodule update --init --recursive || true +#git submodule update --init --recursive || true + +if [ -f ${HERE}/opt/readies/bin/platform ]; then + OS=$(python3 $HERE/opt/readies/bin/platform --os) + ARCH=$(python3 $HERE/opt/readies/bin/platform --arch) +else + OS=`uname -s | tr '[:upper:]' '[:lower:]'` + uname -m|grep aarch64 || ARCH=x64 + uname -m|grep x86 || ARCH=arm64v8 +fi -OS=$(python3 $HERE/opt/readies/bin/platform --os) -ARCH=$(python3 $HERE/opt/readies/bin/platform --arch) # avoid wget warnings on macOS [[ $OS == macos ]] && export LC_ALL=en_US.UTF-8 @@ -235,7 +242,7 @@ if [[ $WITH_PT != 0 ]]; then LIBTORCH_ARCHIVE=libtorch-${PT_BUILD}-${PT_OS}-${PT_ARCH}-${PT_VERSION}.tar.gz if [[ $PT_REPACK == 1 ]]; then - PT_VERSION=$PT_VERSION GPU=$GPU $HERE/opt/build/libtorch/repack.sh + PT_VERSION=$PT_VERSION GPU=$GPU OS=${OS} ARCH=${ARCH} $HERE/opt/build/libtorch/repack.sh else LIBTORCH_URL=https://s3.amazonaws.com/redismodules/pytorch/$LIBTORCH_ARCHIVE diff --git a/opt/build/libtorch/repack.sh b/opt/build/libtorch/repack.sh index 50124786c..c7103ec0a 100755 --- a/opt/build/libtorch/repack.sh +++ b/opt/build/libtorch/repack.sh @@ -6,7 +6,7 @@ set -e HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" ROOT=$HERE/../../.. -. $ROOT/opt/readies/shibumi/functions +#. $ROOT/opt/readies/shibumi/functions ROOT=$(realpath $ROOT) if [[ "$1" == "cpu" || $CPU == 1 ]]; then @@ -24,8 +24,13 @@ else fi fi -OS=$(python3 $ROOT/opt/readies/bin/platform --os) -ARCH=$(python3 $ROOT/opt/readies/bin/platform --arch) +# set them internally or externally +if [ -z ${OS} ]; then + OS=$(python3 $ROOT/opt/readies/bin/platform --os) +fi +if [ -z ${ARCH} ]; then + ARCH=$(python3 $ROOT/opt/readies/bin/platform --arch) +fi TARGET_DIR=$ROOT/deps/$OS-$ARCH-$DEVICE