Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make dependency on re2 explicit for grpc, py3-grpcio, onnxruntime #8088

Merged
merged 6 commits into from Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions grpc.spec
Expand Up @@ -4,7 +4,7 @@ Source: git+https://github.com/grpc/grpc.git?obj=master/v%{realversion}&export=%
Patch0: grpc-ssl-fix
Patch1: grpc-gcc11
BuildRequires: cmake ninja go
Requires: protobuf zlib pcre c-ares abseil-cpp
Requires: protobuf zlib pcre c-ares abseil-cpp re2
%define keep_archives true

%prep
Expand Down Expand Up @@ -34,9 +34,10 @@ cmake ../%{n}-%{realversion} \
-DgRPC_PROTOBUF_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package \
-DgRPC_ZLIB_PROVIDER=package \
-DgRPC_RE2_PROVIDER=package \
-DZLIB_ROOT=${ZLIB_ROOT} \
-DCMAKE_INSTALL_PREFIX=%{i} \
-DCMAKE_PREFIX_PATH="${PCRE_ROOT};${PROTOBUF_ROOT};${ZLIB_ROOT}${OPENSSLROOT};${C_ARES_ROOT};${ABSEIL_CPP_ROOT}"
-DCMAKE_PREFIX_PATH="${PCRE_ROOT};${PROTOBUF_ROOT};${ZLIB_ROOT}${OPENSSLROOT};${C_ARES_ROOT};${ABSEIL_CPP_ROOT};${RE2_ROOT}"

ninja -v %{makeprocesses}

Expand Down
12 changes: 3 additions & 9 deletions onnxruntime.spec
Expand Up @@ -6,7 +6,7 @@
Source: git+https://github.com/%{github_user}/%{n}.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&submodules=1&output=/%{n}-%{realversion}.tgz

BuildRequires: cmake ninja
Requires: protobuf py3-numpy py3-wheel py3-onnx zlib libpng py3-pybind11 cuda
Requires: protobuf py3-numpy py3-wheel py3-onnx zlib libpng py3-pybind11 cuda re2
%if "%{cmsos}" != "slc7_aarch64"
Requires: cudnn
%endif
Expand All @@ -32,30 +32,24 @@ cmake ../%{n}-%{realversion}/cmake -GNinja \
-Donnxruntime_ENABLE_PYTHON=ON \
-Donnxruntime_BUILD_SHARED_LIB=ON \
-Donnxruntime_USE_CUDA=${USE_CUDA} \
-Donnxruntime_CUDA_VERSION="${CUDA_VERSION}" \
-Donnxruntime_CUDA_HOME="${CUDA_ROOT}" \
-Donnxruntime_CUDNN_HOME="${CUDNN_ROOT}" \
-Donnxruntime_BUILD_CSHARP=OFF \
-Donnxruntime_USE_EIGEN_FOR_BLAS=ON \
-Donnxruntime_USE_OPENBLAS=OFF \
-Donnxruntime_USE_MKLML=OFF \
-Donnxruntime_USE_NGRAPH=OFF \
-Donnxruntime_USE_OPENMP=OFF \
-Donnxruntime_USE_TVM=OFF \
-Donnxruntime_USE_LLVM=OFF \
-Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF \
-Donnxruntime_USE_BRAINSLICE=OFF \
-Donnxruntime_USE_NUPHAR=OFF \
-Donnxruntime_USE_TENSORRT=OFF \
-Donnxruntime_CROSS_COMPILING=OFF \
-Donnxruntime_USE_FULL_PROTOBUF=ON \
-Donnxruntime_DISABLE_CONTRIB_OPS=OFF \
-Donnxruntime_USE_PREINSTALLED_PROTOBUF=ON \
-Donnxruntime_PREFER_SYSTEM_LIB=ON \
-DCMAKE_CUDA_FLAGS="-cudart shared" \
-DCMAKE_CUDA_RUNTIME_LIBRARY=Shared \
-DCMAKE_TRY_COMPILE_PLATFORM_VARIABLES="CMAKE_CUDA_RUNTIME_LIBRARY" \
-DCMAKE_PREFIX_PATH="${ZLIB_ROOT};${LIBPNG_ROOT};${PROTOBUF_ROOT};${PY3_PYBIND11_ROOT}"
-DCMAKE_PREFIX_PATH="${ZLIB_ROOT};${LIBPNG_ROOT};${PROTOBUF_ROOT};${PY3_PYBIND11_ROOT};${RE2_ROOT}" \
-DRE2_INCLUDE_DIR="${RE2_ROOT}/include"

ninja -v %{makeprocesses}
python3 ../%{n}-%{realversion}/setup.py build
Expand Down
2 changes: 1 addition & 1 deletion pip/grpcio.file
@@ -1 +1 @@
Requires: py3-six
Requires: py3-six re2
27 changes: 27 additions & 0 deletions re2.spec
@@ -0,0 +1,27 @@
### RPM external re2 2021-06-01
Source: https://github.com/google/re2/archive/%{realversion}.tar.gz

BuildRequires: cmake gmake

%define strip_files %{i}/lib

%prep
%setup -n %{n}-%{realversion}

%build
rm -rf ../build
mkdir ../build
cd ../build

cmake ../%{n}-%{realversion} \
-DCMAKE_INSTALL_PREFIX:PATH="%i" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=True \
-DCMAKE_POSITION_INDEPENDENT_CODE=True \
-DCMAKE_INSTALL_LIBDIR=lib

make %{makeprocesses} VERBOSE=1

%install
cd ../build
make %{makeprocesses} install
1 change: 1 addition & 0 deletions scram-tools.file/tools/grpc/grpc.xml
Expand Up @@ -14,4 +14,5 @@
<use name="pcre"/>
<use name="abseil-cpp"/>
<use name="c-ares"/>
<use name="re2"/>
</tool>
1 change: 1 addition & 0 deletions scram-tools.file/tools/onnxruntime/onnxruntime.xml
Expand Up @@ -10,5 +10,6 @@
<use name="cuda"/>
<use name="cudnn"/>
</ifarchitecture>
<use name="re2"/>
<runtime name="MLAS_DYNAMIC_CPU_ARCH" value="2"/>
</tool>
10 changes: 10 additions & 0 deletions scram-tools.file/tools/re2/re2.xml
@@ -0,0 +1,10 @@
<tool name="re2" version="@TOOL_VERSION@">
<info url="https://github.com/google/re2"/>
<lib name="re2"/>
<client>
<environment name="RE2_BASE" default="@TOOL_ROOT@"/>
<environment name="LIBDIR" default="$RE2_BASE/lib"/>
<environment name="INCLUDE" default="$RE2_BASE/include"/>
</client>
</tool>

Expand Up @@ -9,4 +9,5 @@
<use name="protobuf"/>
<use name="grpc"/>
<use name="cuda"/>
<use name="re2"/>
</tool>
4 changes: 2 additions & 2 deletions triton-inference-client.spec
Expand Up @@ -7,7 +7,7 @@ Source: git+https://github.com/%{github_user}/client.git?obj=%{branch}/%{tag_2_1
Source1: triton-inference-client/model_config.h
Source2: triton-inference-client/model_config.cc
BuildRequires: cmake git
Requires: protobuf grpc cuda abseil-cpp
Requires: protobuf grpc cuda abseil-cpp re2

%prep

Expand Down Expand Up @@ -90,7 +90,7 @@ cmake ${PROJ_DIR} \
-DTRITON_VERSION=%{realversion} \
-DCMAKE_CXX_FLAGS="-Wno-error -fPIC" \
-DFETCHCONTENT_SOURCE_DIR_REPO-COMMON=${COMMON_DIR} \
-DCMAKE_PREFIX_PATH="${GRPC_ROOT};${ABSEIL_CPP_ROOT}"
-DCMAKE_PREFIX_PATH="${GRPC_ROOT};${ABSEIL_CPP_ROOT};${RE2_ROOT}"
iarspider marked this conversation as resolved.
Show resolved Hide resolved

make %{makeprocesses}

Expand Down