Skip to content

Commit 2d8fe03

Browse files
committed
Bump everything to use CXX11 ABI by default
After this the only remaining pre-CXX11 ABI build we will have will be the default libtorch one Signed-off-by: Eli Uriegas <[email protected]>
1 parent f883406 commit 2d8fe03

File tree

4 files changed

+24
-28
lines changed

4 files changed

+24
-28
lines changed

check_binary.sh

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ fi
6262
echo "Checking that the gcc ABI is what we expect"
6363
if [[ "$(uname)" != 'Darwin' ]]; then
6464
function is_expected() {
65-
if [[ "$DESIRED_DEVTOOLSET" == *"cxx11-abi"* ]]; then
66-
if [[ "$1" -gt 0 || "$1" == "ON " ]]; then
65+
if [[ "$DESIRED_DEVTOOLSET" == *libtorch*devtoolset7* ]]; then
66+
if [[ -z "$1" || "$1" == 0 || "$1" == "OFF" ]]; then
6767
echo 1
6868
fi
6969
else
70-
if [[ -z "$1" || "$1" == 0 || "$1" == "OFF" ]]; then
70+
if [[ "$1" -gt 0 || "$1" == "ON " ]]; then
7171
echo 1
7272
fi
7373
fi
@@ -143,21 +143,7 @@ if [[ "$(uname)" != 'Darwin' ]]; then
143143
check_lib_symbols_for_abi_correctness () {
144144
lib=$1
145145
echo "lib: " $lib
146-
if [[ "$DESIRED_DEVTOOLSET" == *"cxx11-abi"* ]]; then
147-
num_pre_cxx11_symbols=$(grep_symbols "${PRE_CXX11_SYMBOLS[@]}" | wc -l) || true
148-
echo "num_pre_cxx11_symbols: " $num_pre_cxx11_symbols
149-
if [[ "$num_pre_cxx11_symbols" -gt 0 ]]; then
150-
echo "Found pre-cxx11 symbols but there shouldn't be. Dumping symbols"
151-
grep_symbols "${PRE_CXX11_SYMBOLS[@]}"
152-
exit 1
153-
fi
154-
num_cxx11_symbols=$(grep_symbols "${CXX11_SYMBOLS[@]}" | wc -l) || true
155-
echo "num_cxx11_symbols: " $num_cxx11_symbols
156-
if [[ "$num_cxx11_symbols" -lt 1000 ]]; then
157-
echo "Didn't find enough cxx11 symbols. Aborting."
158-
exit 1
159-
fi
160-
else
146+
if [[ "$DESIRED_DEVTOOLSET" == *"libtorch*devtoolset7"* ]]; then
161147
num_cxx11_symbols=$(grep_symbols "${CXX11_SYMBOLS[@]}" | wc -l) || true
162148
echo "num_cxx11_symbols: " $num_cxx11_symbols
163149
if [[ "$num_cxx11_symbols" -gt 0 ]]; then
@@ -171,6 +157,20 @@ if [[ "$(uname)" != 'Darwin' ]]; then
171157
echo "Didn't find enough pre-cxx11 symbols. Aborting."
172158
exit 1
173159
fi
160+
else
161+
num_pre_cxx11_symbols=$(grep_symbols "${PRE_CXX11_SYMBOLS[@]}" | wc -l) || true
162+
echo "num_pre_cxx11_symbols: " $num_pre_cxx11_symbols
163+
if [[ "$num_pre_cxx11_symbols" -gt 0 ]]; then
164+
echo "Found pre-cxx11 symbols but there shouldn't be. Dumping symbols"
165+
grep_symbols "${PRE_CXX11_SYMBOLS[@]}"
166+
exit 1
167+
fi
168+
num_cxx11_symbols=$(grep_symbols "${CXX11_SYMBOLS[@]}" | wc -l) || true
169+
echo "num_cxx11_symbols: " $num_cxx11_symbols
170+
if [[ "$num_cxx11_symbols" -lt 1000 ]]; then
171+
echo "Didn't find enough cxx11 symbols. Aborting."
172+
exit 1
173+
fi
174174
fi
175175
}
176176
# After https://github.com/pytorch/pytorch/pull/29731 most of the real

conda/pytorch-nightly/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export PYTORCH_BUILD_NUMBER=$PKG_BUILDNUM
1616
export USE_NINJA=OFF
1717
export INSTALL_TEST=0 # dont install test binaries into site-packages
1818

19+
export _GLIBCXX_USE_CXX11_ABI=1
20+
1921
# MacOS build is simple, and will not be for CUDA
2022
if [[ "$OSTYPE" == "darwin"* ]]; then
2123
MACOSX_DEPLOYMENT_TARGET=10.9 \

manywheel/build_common.sh

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,7 @@ else
116116
retry pip install -q numpy==1.11
117117
fi
118118

119-
if [[ "$DESIRED_DEVTOOLSET" == *"cxx11-abi"* ]]; then
120-
export _GLIBCXX_USE_CXX11_ABI=1
121-
else
122-
export _GLIBCXX_USE_CXX11_ABI=0
123-
fi
119+
export _GLIBCXX_USE_CXX11_ABI=1
124120

125121
if [[ "$DESIRED_CUDA" == *"rocm"* ]]; then
126122
echo "Calling build_amd.py at $(date)"
@@ -173,11 +169,7 @@ if [[ -n "$BUILD_PYTHONLESS" ]]; then
173169

174170
mkdir -p /tmp/$LIBTORCH_HOUSE_DIR
175171

176-
if [[ "$DESIRED_DEVTOOLSET" == *"cxx11-abi"* ]]; then
177-
LIBTORCH_ABI="cxx11-abi-"
178-
else
179-
LIBTORCH_ABI=
180-
fi
172+
LIBTORCH_ABI="cxx11-abi-"
181173

182174
zip -rq /tmp/$LIBTORCH_HOUSE_DIR/libtorch-$LIBTORCH_ABI$LIBTORCH_VARIANT-$PYTORCH_BUILD_VERSION.zip libtorch
183175
cp /tmp/$LIBTORCH_HOUSE_DIR/libtorch-$LIBTORCH_ABI$LIBTORCH_VARIANT-$PYTORCH_BUILD_VERSION.zip \

wheel/build_wheel.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ retry () {
2121
$* || (sleep 1 && $*) || (sleep 2 && $*) || (sleep 4 && $*) || (sleep 8 && $*)
2222
}
2323

24+
export _GLIBCXX_USE_CXX11_ABI=1
25+
2426
# Parameters
2527
if [[ -n "$DESIRED_PYTHON" && -n "$PYTORCH_BUILD_VERSION" && -n "$PYTORCH_BUILD_NUMBER" ]]; then
2628
desired_python="$DESIRED_PYTHON"

0 commit comments

Comments
 (0)