-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move install_ci_deps to seperate script
- Loading branch information
Showing
3 changed files
with
47 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env bash | ||
|
||
command_exists() { | ||
command -v "${1}" >/dev/null 2>&1; | ||
} | ||
|
||
is_root() { | ||
[ "${EUID:-$(id -u)}" -eq 0 ]; | ||
} | ||
|
||
install_ci_dependencies() { | ||
if [ "${determined_os}" = "windows" ]; then | ||
if command_exists choco; then | ||
choco install curl --no-progress | ||
fi | ||
elif [ "${determined_os}" = "linux" ]; then | ||
if command_exists apt; then | ||
if ! is_root; then | ||
maybe_sudo="sudo" | ||
fi | ||
${maybe_sudo} apt update | ||
${maybe_sudo} apt install -y --no-install-recommends curl | ||
elif command_exists yum; then | ||
if ! is_root; then | ||
maybe_sudo="sudo" | ||
fi | ||
${maybe_sudo} yum install curl | ||
fi | ||
elif [ "${determined_os}" = "macos" ]; then | ||
prettyprint "Downloading libomp for: " "${OCL_MACOS_ARCHITECTURE}" | ||
if [ "${OCL_MACOS_ARCHITECTURE}" = "arm64" ]; then | ||
libomp_tar_loc=$(brew fetch --bottle-tag=arm64_big_sur libomp | grep -i downloaded | grep tar.gz | cut -f2 -d ":" | xargs echo) | ||
else | ||
libomp_tar_loc=$(brew fetch --bottle-tag=big_sur libomp | grep -i downloaded | grep tar.gz | cut -f2 -d ":" | xargs echo) | ||
fi | ||
temp_dir="/tmp" | ||
cp "${libomp_tar_loc}" "${temp_dir}/libomp.tar.gz" | ||
mkdir "${temp_dir}/libomp" || true | ||
tar -xzf "${temp_dir}/libomp.tar.gz" -C "${temp_dir}/libomp" | ||
libomp_prefix=$(find "${temp_dir}/libomp/libomp" -depth 1 | head -1) | ||
export OPENMP_PREFIX_MACOS="${temp_dir}/libomp/libomp/fixed" | ||
mv "${libomp_prefix}" "${OPENMP_PREFIX_MACOS}" | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters