Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions p/pytorch/pytorch_2.0.1_ubi_9.3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,21 @@ CURRENT_DIR="${PWD}"

# Install dependencies and tools
echo "Installing dependencies..."
yum install -y git wget gcc gcc-c++ python python3-devel python3 python3-pip openblas-devel cmake gcc-gfortran

yum install -y git wget python3 python3-devel python3-pip openblas-devel cmake gcc-toolset-12-gcc gcc-toolset-12-gcc-c++ gcc-toolset-12-gcc-gfortran
source /opt/rh/gcc-toolset-12/enable

# Set compiler paths to make use of right compiler
export CC=/opt/rh/gcc-toolset-12/root/usr/bin/gcc
export CXX=/opt/rh/gcc-toolset-12/root/usr/bin/g++
export LD=/opt/rh/gcc-toolset-12/root/usr/bin/ld
export CXXFLAGS="$CXXFLAGS -Wno-error=nonnull"
export CXXFLAGS="$CXXFLAGS -O2 -fPIC -Wno-error"
export CFLAGS="$CFLAGS -O2 -fPIC -Wno-error"
export NO_WERROR=1
export BUILD_TEST=0

echo "Installing required Python packages..."
pip install wheel scipy ninja build pytest
pip install wheel "numpy<2.0" scipy==1.13.1 ninja build pytest
echo "Installing required numpy"
pip install "numpy<2.0"

Expand Down Expand Up @@ -78,7 +89,7 @@ if ! (MAX_JOBS=$(nproc) python3 setup.py install); then
fi

echo "Building wheel file..."
python setup.py bdist_wheel --dist-dir="$CURRENT_DIR/"
python3 setup.py bdist_wheel --dist-dir="$CURRENT_DIR/"

cd ..

Expand Down