Skip to content

Commit 672edbe

Browse files
authored
remove submodule requirement for dependency fetching (#786)
1 parent 79e1f32 commit 672edbe

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

get_deps.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,17 @@ else
4747
fi
4848
fi
4949

50-
git submodule update --init --recursive || true
50+
#git submodule update --init --recursive || true
51+
52+
if [ -f ${HERE}/opt/readies/bin/platform ]; then
53+
OS=$(python3 $HERE/opt/readies/bin/platform --os)
54+
ARCH=$(python3 $HERE/opt/readies/bin/platform --arch)
55+
else
56+
OS=`uname -s | tr '[:upper:]' '[:lower:]'`
57+
uname -m|grep aarch64 || ARCH=x64
58+
uname -m|grep x86 || ARCH=arm64v8
59+
fi
5160

52-
OS=$(python3 $HERE/opt/readies/bin/platform --os)
53-
ARCH=$(python3 $HERE/opt/readies/bin/platform --arch)
5461

5562
# avoid wget warnings on macOS
5663
[[ $OS == macos ]] && export LC_ALL=en_US.UTF-8
@@ -235,7 +242,7 @@ if [[ $WITH_PT != 0 ]]; then
235242
LIBTORCH_ARCHIVE=libtorch-${PT_BUILD}-${PT_OS}-${PT_ARCH}-${PT_VERSION}.tar.gz
236243

237244
if [[ $PT_REPACK == 1 ]]; then
238-
PT_VERSION=$PT_VERSION GPU=$GPU $HERE/opt/build/libtorch/repack.sh
245+
PT_VERSION=$PT_VERSION GPU=$GPU OS=${OS} ARCH=${ARCH} $HERE/opt/build/libtorch/repack.sh
239246
else
240247
LIBTORCH_URL=https://s3.amazonaws.com/redismodules/pytorch/$LIBTORCH_ARCHIVE
241248

opt/build/libtorch/repack.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -e
66
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
77

88
ROOT=$HERE/../../..
9-
. $ROOT/opt/readies/shibumi/functions
9+
#. $ROOT/opt/readies/shibumi/functions
1010
ROOT=$(realpath $ROOT)
1111

1212
if [[ "$1" == "cpu" || $CPU == 1 ]]; then
@@ -24,8 +24,13 @@ else
2424
fi
2525
fi
2626

27-
OS=$(python3 $ROOT/opt/readies/bin/platform --os)
28-
ARCH=$(python3 $ROOT/opt/readies/bin/platform --arch)
27+
# set them internally or externally
28+
if [ -z ${OS} ]; then
29+
OS=$(python3 $ROOT/opt/readies/bin/platform --os)
30+
fi
31+
if [ -z ${ARCH} ]; then
32+
ARCH=$(python3 $ROOT/opt/readies/bin/platform --arch)
33+
fi
2934

3035
TARGET_DIR=$ROOT/deps/$OS-$ARCH-$DEVICE
3136

0 commit comments

Comments
 (0)