Skip to content

Commit

Permalink
Bump everything to use CXX11 ABI by default
Browse files Browse the repository at this point in the history
After this the only remaining pre-CXX11 ABI build we will have will be
the default libtorch one

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
  • Loading branch information
seemethere committed Sep 15, 2020
1 parent f883406 commit 2d8fe03
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 28 deletions.
36 changes: 18 additions & 18 deletions check_binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ fi
echo "Checking that the gcc ABI is what we expect"
if [[ "$(uname)" != 'Darwin' ]]; then
function is_expected() {
if [[ "$DESIRED_DEVTOOLSET" == *"cxx11-abi"* ]]; then
if [[ "$1" -gt 0 || "$1" == "ON " ]]; then
if [[ "$DESIRED_DEVTOOLSET" == *libtorch*devtoolset7* ]]; then
if [[ -z "$1" || "$1" == 0 || "$1" == "OFF" ]]; then
echo 1
fi
else
if [[ -z "$1" || "$1" == 0 || "$1" == "OFF" ]]; then
if [[ "$1" -gt 0 || "$1" == "ON " ]]; then
echo 1
fi
fi
Expand Down Expand Up @@ -143,21 +143,7 @@ if [[ "$(uname)" != 'Darwin' ]]; then
check_lib_symbols_for_abi_correctness () {
lib=$1
echo "lib: " $lib
if [[ "$DESIRED_DEVTOOLSET" == *"cxx11-abi"* ]]; then
num_pre_cxx11_symbols=$(grep_symbols "${PRE_CXX11_SYMBOLS[@]}" | wc -l) || true
echo "num_pre_cxx11_symbols: " $num_pre_cxx11_symbols
if [[ "$num_pre_cxx11_symbols" -gt 0 ]]; then
echo "Found pre-cxx11 symbols but there shouldn't be. Dumping symbols"
grep_symbols "${PRE_CXX11_SYMBOLS[@]}"
exit 1
fi
num_cxx11_symbols=$(grep_symbols "${CXX11_SYMBOLS[@]}" | wc -l) || true
echo "num_cxx11_symbols: " $num_cxx11_symbols
if [[ "$num_cxx11_symbols" -lt 1000 ]]; then
echo "Didn't find enough cxx11 symbols. Aborting."
exit 1
fi
else
if [[ "$DESIRED_DEVTOOLSET" == *"libtorch*devtoolset7"* ]]; then
num_cxx11_symbols=$(grep_symbols "${CXX11_SYMBOLS[@]}" | wc -l) || true
echo "num_cxx11_symbols: " $num_cxx11_symbols
if [[ "$num_cxx11_symbols" -gt 0 ]]; then
Expand All @@ -171,6 +157,20 @@ if [[ "$(uname)" != 'Darwin' ]]; then
echo "Didn't find enough pre-cxx11 symbols. Aborting."
exit 1
fi
else
num_pre_cxx11_symbols=$(grep_symbols "${PRE_CXX11_SYMBOLS[@]}" | wc -l) || true
echo "num_pre_cxx11_symbols: " $num_pre_cxx11_symbols
if [[ "$num_pre_cxx11_symbols" -gt 0 ]]; then
echo "Found pre-cxx11 symbols but there shouldn't be. Dumping symbols"
grep_symbols "${PRE_CXX11_SYMBOLS[@]}"
exit 1
fi
num_cxx11_symbols=$(grep_symbols "${CXX11_SYMBOLS[@]}" | wc -l) || true
echo "num_cxx11_symbols: " $num_cxx11_symbols
if [[ "$num_cxx11_symbols" -lt 1000 ]]; then
echo "Didn't find enough cxx11 symbols. Aborting."
exit 1
fi
fi
}
# After https://github.com/pytorch/pytorch/pull/29731 most of the real
Expand Down
2 changes: 2 additions & 0 deletions conda/pytorch-nightly/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export PYTORCH_BUILD_NUMBER=$PKG_BUILDNUM
export USE_NINJA=OFF
export INSTALL_TEST=0 # dont install test binaries into site-packages

export _GLIBCXX_USE_CXX11_ABI=1

# MacOS build is simple, and will not be for CUDA
if [[ "$OSTYPE" == "darwin"* ]]; then
MACOSX_DEPLOYMENT_TARGET=10.9 \
Expand Down
12 changes: 2 additions & 10 deletions manywheel/build_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,7 @@ else
retry pip install -q numpy==1.11
fi

if [[ "$DESIRED_DEVTOOLSET" == *"cxx11-abi"* ]]; then
export _GLIBCXX_USE_CXX11_ABI=1
else
export _GLIBCXX_USE_CXX11_ABI=0
fi
export _GLIBCXX_USE_CXX11_ABI=1

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

mkdir -p /tmp/$LIBTORCH_HOUSE_DIR

if [[ "$DESIRED_DEVTOOLSET" == *"cxx11-abi"* ]]; then
LIBTORCH_ABI="cxx11-abi-"
else
LIBTORCH_ABI=
fi
LIBTORCH_ABI="cxx11-abi-"

zip -rq /tmp/$LIBTORCH_HOUSE_DIR/libtorch-$LIBTORCH_ABI$LIBTORCH_VARIANT-$PYTORCH_BUILD_VERSION.zip libtorch
cp /tmp/$LIBTORCH_HOUSE_DIR/libtorch-$LIBTORCH_ABI$LIBTORCH_VARIANT-$PYTORCH_BUILD_VERSION.zip \
Expand Down
2 changes: 2 additions & 0 deletions wheel/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ retry () {
$* || (sleep 1 && $*) || (sleep 2 && $*) || (sleep 4 && $*) || (sleep 8 && $*)
}

export _GLIBCXX_USE_CXX11_ABI=1

# Parameters
if [[ -n "$DESIRED_PYTHON" && -n "$PYTORCH_BUILD_VERSION" && -n "$PYTORCH_BUILD_NUMBER" ]]; then
desired_python="$DESIRED_PYTHON"
Expand Down

0 comments on commit 2d8fe03

Please sign in to comment.