Skip to content

Commit

Permalink
handle chip architectures in shell script
Browse files Browse the repository at this point in the history
  • Loading branch information
vtnate committed Nov 12, 2024
1 parent d6119d1 commit a6bf187
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions example_files/python_deps/install_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,29 @@ if [ ! -d $INSTALL_BASE ]; then
exit 1
fi

if [[ "$OSTYPE" == "linux-gnu" ]]; then
PLATFORM=Linux-x86_64
elif [[ "$OSTYPE" == "darwin"* ]]; then
PLATFORM=MacOSX-x86_64
else
error "unknown OS type $OSTYPE"
exit 1
architecture=$(uname -m)

echo "$architecture"

# Handle multiple chip architectures (ARM & x86) as well as OS types (Linux & MacOS)
if [[ $architecture == "x86"* || $architecture == "i686" || $architecture == "i386" ]]; then
if [[ "$OSTYPE" == "linux-gnu" ]]; then
PLATFORM=Linux-x86_64
elif [[ "$OSTYPE" == "darwin"* ]]; then
PLATFORM=MacOSX-x86_64
else
error "unknown OS type $OSTYPE"
exit 1
fi
elif [[ $architecture == "arm"* || $architecture == "aarch"* ]]; then
if [[ "$OSTYPE" == "linux-gnu" ]]; then
PLATFORM=Linux-aarch64
elif [[ "$OSTYPE" == "darwin"* ]]; then
PLATFORM=MacOSX-arm64
else
error "unknown OS type $OSTYPE"
exit 1
fi
fi

CONDA_PACKAGE_NAME=Miniconda3-py${PYTHON_MAJOR_MINOR}_${CONDA_VERSION}-${PLATFORM}.sh
Expand Down

0 comments on commit a6bf187

Please sign in to comment.