mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Should prevent weird issues when PyTorch is compiled with clang, but triton or torch_vision are build with gcc Pull Request resolved: https://github.com/pytorch/pytorch/pull/103350 Approved by: https://github.com/seemethere
21 lines
583 B
Bash
21 lines
583 B
Bash
#!/bin/bash
|
|
|
|
set -ex
|
|
|
|
if [ -n "$GCC_VERSION" ]; then
|
|
|
|
# Need the official toolchain repo to get alternate packages
|
|
add-apt-repository ppa:ubuntu-toolchain-r/test
|
|
apt-get update
|
|
apt-get install -y g++-$GCC_VERSION
|
|
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-"$GCC_VERSION" 50
|
|
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-"$GCC_VERSION" 50
|
|
update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-"$GCC_VERSION" 50
|
|
|
|
|
|
# Cleanup package manager
|
|
apt-get autoclean && apt-get clean
|
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
fi
|