Skip to content

Commit

Permalink
Update tensorflow-xla-runtime.spec (#9072)
Browse files Browse the repository at this point in the history
* Update tensorflow-xla-runtime.spec

* Add arch_build_flags

* Update tensorflow-xla-runtime.spec

* Update tensorflow-xla-runtime.spec

* Update tensorflow-xla-runtime.spec

* Update env.file

* Update tensorflow-xla-runtime.spec
  • Loading branch information
iarspider authored Mar 15, 2024
1 parent 7f81f82 commit eab900d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions scram-tools.file/tools/eigen/env.file
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
export CMS_EIGEN_CXX_FLAGS="-DEIGEN_DONT_PARALLELIZE -DEIGEN_MAX_ALIGN_BYTES=64"
if [ `uname -m` = "aarch64" ]; then
export CMS_EIGEN_CXX_FLAGS="-DEIGEN_NEON_GEBP_NR=4 ${CMS_EIGEN_CXX_FLAGS}"
fi
12 changes: 10 additions & 2 deletions tensorflow-xla-runtime.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
### RPM external tensorflow-xla-runtime 2.12.0
## INCLUDE cpp-standard
## INCLUDE compilation_flags

Source99: scram-tools.file/tools/eigen/env

Requires: eigen py3-tensorflow
BuildRequires: cmake
Expand All @@ -9,11 +12,16 @@ BuildRequires: cmake
cp -r ${PY3_TENSORFLOW_ROOT}/lib/python%{cms_python3_major_minor_version}/site-packages/tensorflow .

%build

source %{_sourcedir}/env
export CPATH="${CPATH}:${EIGEN_ROOT}/include/eigen3"

CXXFLAGS="-fPIC %{arch_build_flags} ${CMS_EIGEN_CXX_FLAGS}"
%ifarch x86_64
CXXFLAGS="${CXXFLAGS} -msse3"
%endif

pushd tensorflow/xla_aot_runtime_src
cmake . -DCMAKE_CXX_FLAGS="-fPIC -msse3" -DCMAKE_CXX_STANDARD=%{cms_cxx_standard} -DBUILD_SHARED_LIBS=OFF
cmake . -DCMAKE_CXX_FLAGS="${CXXFLAGS}" -DCMAKE_CXX_STANDARD=%{cms_cxx_standard} -DBUILD_SHARED_LIBS=OFF
make %{makeprocesses}
popd

Expand Down

0 comments on commit eab900d

Please sign in to comment.