fix(install): support libstdcxx-ng on GCC 16+ hosts

When system GCC major version exceeds the highest libstdcxx-ng pin
available on conda-forge, install the latest libstdcxx-ng instead of
libstdcxx-ng>=N, which may not exist yet.
This commit is contained in:
jiang 2026-06-01 08:21:26 -04:00
parent 08d627c333
commit 4de3a6236e

View File

@ -196,9 +196,15 @@ if [ "$(uname)" != "Darwin" ]; then
echo -e "${INFO}Detected GCC Version: $gcc_major_version" echo -e "${INFO}Detected GCC Version: $gcc_major_version"
echo -e "${INFO}Skip Installing GCC & G++ From Conda-Forge" echo -e "${INFO}Skip Installing GCC & G++ From Conda-Forge"
echo -e "${INFO}Installing libstdcxx-ng From Conda-Forge" echo -e "${INFO}Installing libstdcxx-ng From Conda-Forge"
# Arch GCC 16+: conda 尚无 libstdcxx-ng>=16装最新版即可
if [ "$gcc_major_version" -gt 15 ]; then
run_conda_quiet libstdcxx-ng
echo -e "${SUCCESS}libstdcxx-ng (latest) Installed..."
else
run_conda_quiet "libstdcxx-ng>=$gcc_major_version" run_conda_quiet "libstdcxx-ng>=$gcc_major_version"
echo -e "${SUCCESS}libstdcxx-ng=$gcc_major_version Installed..." echo -e "${SUCCESS}libstdcxx-ng=$gcc_major_version Installed..."
fi fi
fi
else else
if ! xcode-select -p &>/dev/null; then if ! xcode-select -p &>/dev/null; then
echo -e "${INFO}Installing Xcode Command Line Tools..." echo -e "${INFO}Installing Xcode Command Line Tools..."