Fix Issues with libstdcxx and conda sysroot (#2482)

This commit is contained in:
XXXXRT666 2025-06-25 14:52:27 +08:00 committed by GitHub
parent 4987df5a71
commit 37f5abfcb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -170,7 +170,13 @@ if ! $USE_HF && ! $USE_HF_MIRROR && ! $USE_MODELSCOPE; then
exit 1
fi
# 安装构建工具
case "$(uname -m)" in
x86_64|amd64) SYSROOT_PKG="sysroot_linux-64>=2.28" ;;
aarch64|arm64) SYSROOT_PKG="sysroot_linux-aarch64>=2.28" ;;
ppc64le) SYSROOT_PKG="sysroot_linux-ppc64le>=2.28" ;;
*) echo "Unsupported architecture: $(uname -m)"; exit 1 ;;
esac
# Install build tools
echo -e "${INFO}Detected system: $(uname -s) $(uname -r) $(uname -m)"
if [ "$(uname)" != "Darwin" ]; then
@ -178,10 +184,14 @@ if [ "$(uname)" != "Darwin" ]; then
if [ "$gcc_major_version" -lt 11 ]; then
echo -e "${INFO}Installing GCC & G++..."
run_conda_quiet gcc=11 gxx=11
run_conda_quiet "$SYSROOT_PKG"
echo -e "${SUCCESS}GCC & G++ Installed..."
else
echo -e "${INFO}Detected GCC Version: $gcc_major_version"
echo -e "${INFO}Skip Installing GCC & G++ From Conda-Forge"
echo -e "${INFO}Installing libstdcxx-ng From Conda-Forge"
run_conda_quiet "libstdcxx-ng>=$gcc_major_version"
echo -e "${SUCCESS}libstdcxx-ng=$gcc_major_version Installed..."
fi
else
if ! xcode-select -p &>/dev/null; then