From f48972ca5bb2a320de9bbf361fbe0412159e1413 Mon Sep 17 00:00:00 2001 From: max Date: Thu, 26 Oct 2023 16:16:35 -0500 Subject: [PATCH] fix symbol hiding --- .github/workflows/distro.yml | 12 ++++++------ .github/workflows/wheels.yml | 12 ++++++------ python_bindings/setup.py | 4 ++++ requirements.txt | 8 ++++---- scripts/build_local.sh | 6 +++--- setup.py | 4 ++++ 6 files changed, 27 insertions(+), 19 deletions(-) diff --git a/.github/workflows/distro.yml b/.github/workflows/distro.yml index 1efb8e914..24bdfdd45 100644 --- a/.github/workflows/distro.yml +++ b/.github/workflows/distro.yml @@ -115,15 +115,15 @@ jobs: pip install cibuildwheel - export PIP_FIND_LINKS="https://makslevental.github.io/wheels https://github.com/Xilinx/mlir-aie/releases/expanded_assets/latest-wheels https://github.com/Xilinx/mlir-air/releases/expanded_assets/latest-wheels" + export PIP_FIND_LINKS="https://github.com/makslevental/mlir-wheels/releases/expanded_assets/latest https://github.com/Xilinx/mlir-aie/releases/expanded_assets/latest-wheels https://github.com/Xilinx/mlir-air/releases/expanded_assets/latest-wheels" BOOST_ROOT="${{ steps.install-boost.outputs.BOOST_ROOT }}" \ CIBW_ARCHS=${{ matrix.ARCH }} \ CMAKE_GENERATOR="Ninja" \ HOST_CCACHE_DIR=${{ steps.configure_ccache_dir_on_host.outputs.HOST_CCACHE_DIR }} \ MATRIX_OS=${{ matrix.OS }} \ - MLIR_WHEEL_VERSION="17.0.0.2023092813+35ca6498" \ - MLIR_AIE_WHEEL_VERSION="0.0.1.2023102602+bdd3c4be" \ + MLIR_WHEEL_VERSION="17.0.0.2023102703+35ca6498" \ + MLIR_AIE_WHEEL_VERSION="0.0.1.2023102707+7d51a5c8" \ PARALLEL_LEVEL=${{ matrix.OS == 'windows-2019' && '2' || '4' }} \ cibuildwheel --output-dir wheelhouse @@ -135,11 +135,11 @@ jobs: sudo apt-get install -y python3-dev - export PIP_FIND_LINKS="https://makslevental.github.io/wheels https://github.com/Xilinx/mlir-aie/releases/expanded_assets/latest-wheels https://github.com/Xilinx/mlir-air/releases/expanded_assets/latest-wheels" + export PIP_FIND_LINKS="https://github.com/makslevental/mlir-wheels/releases/expanded_assets/latest https://github.com/Xilinx/mlir-aie/releases/expanded_assets/latest-wheels https://github.com/Xilinx/mlir-air/releases/expanded_assets/latest-wheels" export PIP_NO_BUILD_ISOLATION="false" export CIBW_ARCHS=${{ matrix.ARCH }} - export MLIR_WHEEL_VERSION="17.0.0.2023092813+35ca6498" - export MLIR_AIE_WHEEL_VERSION="0.0.1.2023102602+bdd3c4be" + export MLIR_WHEEL_VERSION="17.0.0.2023102703+35ca6498" + export MLIR_AIE_WHEEL_VERSION="0.0.1.2023102707+7d51a5c8" export BOOST_ROOT="${{ steps.install-boost.outputs.BOOST_ROOT }}" export MATRIX_OS=${{ matrix.OS }} diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index ef6cfe926..03e1857c3 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -63,15 +63,15 @@ jobs: cp requirements.txt python_bindings pushd python_bindings - PIP_FIND_LINKS="https://makslevental.github.io/wheels https://github.com/Xilinx/mlir-aie/releases/expanded_assets/latest-wheels https://github.com/Xilinx/mlir-air/releases/expanded_assets/latest-wheels" \ + PIP_FIND_LINKS="https://github.com/makslevental/mlir-wheels/releases/expanded_assets/latest https://github.com/Xilinx/mlir-aie/releases/expanded_assets/latest-wheels https://github.com/Xilinx/mlir-air/releases/expanded_assets/latest-wheels" \ BOOST_ROOT=${{ steps.install-boost.outputs.BOOST_ROOT }} \ CIBW_ARCHS=${{ matrix.ARCH }} \ CIBW_BUILD="${{ matrix.PY_VERSION }}-*" \ CMAKE_GENERATOR="Ninja" \ HOST_CCACHE_DIR=${{ steps.configure_ccache_dir_on_host.outputs.HOST_CCACHE_DIR }} \ MATRIX_OS=${{ matrix.OS }} \ - MLIR_WHEEL_VERSION="17.0.0.2023092813+35ca6498" \ - MLIR_AIE_WHEEL_VERSION="0.0.1.2023102602+bdd3c4be" \ + MLIR_WHEEL_VERSION="17.0.0.2023102703+35ca6498" \ + MLIR_AIE_WHEEL_VERSION="0.0.1.2023102707+7d51a5c8" \ MLIR_AIR_WHEEL_VERSION=${{ inputs.MLIR_WHEEL_VERSION }} \ PARALLEL_LEVEL=2 \ cibuildwheel --output-dir ../wheelhouse @@ -154,15 +154,15 @@ jobs: cp requirements.txt python_bindings pushd python_bindings - PIP_FIND_LINKS="https://makslevental.github.io/wheels https://github.com/Xilinx/mlir-aie/releases/expanded_assets/latest-wheels https://github.com/Xilinx/mlir-air/releases/expanded_assets/latest-wheels" \ + PIP_FIND_LINKS="https://github.com/makslevental/mlir-wheels/releases/expanded_assets/latest https://github.com/Xilinx/mlir-aie/releases/expanded_assets/latest-wheels https://github.com/Xilinx/mlir-air/releases/expanded_assets/latest-wheels" \ BOOST_ROOT=${{ steps.install-boost.outputs.BOOST_ROOT }} \ CIBW_ARCHS=${{ matrix.ARCH }} \ CIBW_BUILD="${{ matrix.PY_VERSION }}-*" \ CMAKE_GENERATOR="Ninja" \ HOST_CCACHE_DIR=${{ steps.configure_ccache_dir_on_host.outputs.HOST_CCACHE_DIR }} \ MATRIX_OS=${{ matrix.OS }} \ - MLIR_WHEEL_VERSION="17.0.0.2023092813+35ca6498" \ - MLIR_AIE_WHEEL_VERSION="0.0.1.2023102602+bdd3c4be" \ + MLIR_WHEEL_VERSION="17.0.0.2023102703+35ca6498" \ + MLIR_AIE_WHEEL_VERSION="0.0.1.2023102707+7d51a5c8" \ MLIR_AIR_WHEEL_VERSION=${{ inputs.MLIR_WHEEL_VERSION }} \ PARALLEL_LEVEL=2 \ cibuildwheel --output-dir ../wheelhouse diff --git a/python_bindings/setup.py b/python_bindings/setup.py index d6fefb7fa..9d617d74d 100644 --- a/python_bindings/setup.py +++ b/python_bindings/setup.py @@ -89,6 +89,10 @@ def build_extension(self, ext: CMakeExtension) -> None: f"-DPython3_EXECUTABLE={sys.executable}", # not used on MSVC, but no harm f"-DCMAKE_BUILD_TYPE={cfg}", + # prevent symbol collision that leads to multiple pass registration and such + "-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON", + "-DCMAKE_C_VISIBILITY_PRESET=hidden", + "-DCMAKE_CXX_VISIBILITY_PRESET=hidden", ] if platform.system() == "Windows": cmake_args += [ diff --git a/requirements.txt b/requirements.txt index 2b9bf5cab..0b095bcbb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,9 +8,9 @@ pybind11[global]>=2.10.4 setuptools>=42 wheel --f https://makslevental.github.io/wheels +-f https://github.com/makslevental/mlir-wheels/releases/expanded_assets/latest -f https://github.com/Xilinx/mlir-aie/releases/expanded_assets/latest-wheels -mlir-native-tools==17.0.0.2023092813+35ca6498 -mlir==17.0.0.2023092813+35ca6498 -mlir-aie==0.0.1.2023102602+bdd3c4be +mlir-native-tools==17.0.0.2023102703+35ca6498 +mlir==17.0.0.2023102703+35ca6498 +mlir-aie==0.0.1.2023102707+7d51a5c8 diff --git a/scripts/build_local.sh b/scripts/build_local.sh index 598fa4b18..5fe163858 100755 --- a/scripts/build_local.sh +++ b/scripts/build_local.sh @@ -17,8 +17,8 @@ if [ ! -d mlir-air ]; then git clone --recursive https://github.com/Xilinx/mlir-air.git fi -export MLIR_WHEEL_VERSION="17.0.0.2023092813+35ca6498" -export MLIR_AIE_WHEEL_VERSION="0.0.1.2023102602+bdd3c4be" +export MLIR_WHEEL_VERSION="17.0.0.2023102703+35ca6498" +export MLIR_AIE_WHEEL_VERSION="0.0.1.2023102707+7d51a5c8" if [ "$machine" == "linux" ]; then export CIBW_ARCHS=${CIBW_ARCHS:-x86_64} @@ -40,7 +40,7 @@ ccache --print-stats ccache --show-config export HOST_CCACHE_DIR="$(ccache --get-config cache_dir)" -export PIP_FIND_LINKS="https://makslevental.github.io/wheels https://github.com/Xilinx/mlir-aie/releases/expanded_assets/latest-wheels https://github.com/Xilinx/mlir-air/releases/expanded_assets/latest-wheels" +export PIP_FIND_LINKS="https://github.com/makslevental/mlir-wheels/releases/expanded_assets/latest https://github.com/Xilinx/mlir-aie/releases/expanded_assets/latest-wheels https://github.com/Xilinx/mlir-air/releases/expanded_assets/latest-wheels" if [ x"$CIBW_ARCHS" == x"aarch64" ] || [ x"$CIBW_ARCHS" == x"arm64" ]; then pip install -r $HERE/../requirements.txt diff --git a/setup.py b/setup.py index cf434c57e..ed764a60c 100644 --- a/setup.py +++ b/setup.py @@ -126,6 +126,10 @@ def build_extension(self, ext: CMakeExtension) -> None: "-DMLIR_DETECT_PYTHON_ENV_PRIME_SEARCH=ON", # not used on MSVC, but no harm f"-DCMAKE_BUILD_TYPE={cfg}", + # prevent symbol collision that leads to multiple pass registration and such + "-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON", + "-DCMAKE_C_VISIBILITY_PRESET=hidden", + "-DCMAKE_CXX_VISIBILITY_PRESET=hidden", ] if platform.system() == "Windows": cmake_args += [