mirror of
https://github.com/pytorch/pytorch.git
synced 2025-11-11 22:34:53 +08:00
Follow up after https://github.com/pytorch/pytorch/pull/92569 Pull Request resolved: https://github.com/pytorch/pytorch/pull/93104 Approved by: https://github.com/huydhn, https://github.com/seemethere, https://github.com/ZainRizvi
35 lines
919 B
Bash
Executable File
35 lines
919 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -ex
|
|
|
|
[ -n "$GLIBC_VERSION" ]
|
|
if [[ -n "$CENTOS_VERSION" ]]; then
|
|
[ -n "$DEVTOOLSET_VERSION" ]
|
|
fi
|
|
|
|
yum install -y wget sed
|
|
|
|
mkdir -p /packages && cd /packages
|
|
wget -q http://ftp.gnu.org/gnu/glibc/glibc-$GLIBC_VERSION.tar.gz
|
|
tar xzf glibc-$GLIBC_VERSION.tar.gz
|
|
if [[ "$GLIBC_VERSION" == "2.26" ]]; then
|
|
cd glibc-$GLIBC_VERSION
|
|
sed -i 's/$name ne "nss_test1"/$name ne "nss_test1" \&\& $name ne "nss_test2"/' scripts/test-installation.pl
|
|
cd ..
|
|
fi
|
|
mkdir -p glibc-$GLIBC_VERSION-build && cd glibc-$GLIBC_VERSION-build
|
|
|
|
if [[ -n "$CENTOS_VERSION" ]]; then
|
|
export PATH=/opt/rh/devtoolset-$DEVTOOLSET_VERSION/root/usr/bin:$PATH
|
|
fi
|
|
|
|
../glibc-$GLIBC_VERSION/configure --prefix=/usr CFLAGS='-Wno-stringop-truncation -Wno-format-overflow -Wno-restrict -Wno-format-truncation -g -O2'
|
|
make -j$(nproc)
|
|
make install
|
|
|
|
# Cleanup
|
|
rm -rf /packages
|
|
rm -rf /var/cache/yum/*
|
|
rm -rf /var/lib/rpm/__db.*
|
|
yum clean all
|