Skip to content

Commit

Permalink
Merge pull request #7087 from cms-sw/py2-cleanup2
Browse files Browse the repository at this point in the history
py2 cleanup: fastjet and mxnet-predict build with py3
  • Loading branch information
smuzaffar authored Jul 2, 2021
2 parents 4885659 + 0a4f968 commit 3f7455f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions fastjet-toolfile.spec
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ done
cat << \EOF_TOOLFILE >>%i/etc/scram.d/%{base_package}.xml
</client>
<runtime name="ROOT_INCLUDE_PATH" value="$INCLUDE" type="path"/>
<runtime name="PYTHON27PATH" value="$FASTJET_BASE/lib/python@PYTHONV@/site-packages" type="path"/>
<runtime name="PYTHON3PATH" value="$FASTJET_BASE/lib/python%{cms_python3_major_minor_version}/site-packages" type="path"/>
<use name="root_cxxdefaults"/>
</tool>
EOF_TOOLFILE
export PYTHONV=$(echo $PYTHON_VERSION | cut -f1,2 -d.)

## IMPORT scram-tools-post
5 changes: 3 additions & 2 deletions fastjet.spec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## INCLUDE compilation_flags

BuildRequires: autotools
Requires: python
Requires: python3
%define tag 65f948f075860df1fddf7b819f60c3346710ebf1
%define branch cms/v%{realversion}
%define github_user cms-externals
Expand All @@ -28,7 +28,8 @@ case %{cmsplatf} in
*_ppc64le_*) CXXFLAGS="${CXXFLAGS} %{ppc64le_build_flags}" ;;
esac

./configure \
PYTHON=$(which python3) \
./configure \
--enable-shared \
--enable-atlascone \
--enable-cmsiterativecone \
Expand Down
8 changes: 3 additions & 5 deletions mxnet-predict.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
### RPM external mxnet-predict 1.6.0
## INITENV +PATH PYTHON27PATH %{i}/$PYTHON_LIB_SITE_PACKAGES
## INITENV +PATH PYTHON3PATH %{i}/$PYTHON3_LIB_SITE_PACKAGES
## INITENV +PATH LD_LIBRARY_PATH %{i}/lib

Expand All @@ -10,7 +9,7 @@ Source: git+https://github.com/%{github_user}/incubator-mxnet.git?obj=%{branch}/

BuildRequires: cmake ninja

Requires: OpenBLAS python python3 py2-numpy py3-numpy
Requires: OpenBLAS python3 py2-numpy py3-numpy

%prep
%setup -q -n %{n}-%{realversion}
Expand All @@ -21,8 +20,6 @@ rm -rf ../build; mkdir ../build; cd ../build
# use LAPACK functions in OpenBLAS:
# manually set MXNET_USE_LAPACK=1 and turn off USE_LAPACK in cmake
export CFLAGS="-DMXNET_USE_LAPACK=1 -DMXNET_THREAD_LOCAL_ENGINE=1"
export PYTHONV=$(echo $PYTHON_VERSION | cut -f1,2 -d.)
export PYTHON3V=$(echo $PYTHON3_VERSION | cut -f1,2 -d.)

cmake ../%{n}-%{realversion} -GNinja \
-DCMAKE_INSTALL_PREFIX="%{i}" \
Expand All @@ -39,7 +36,8 @@ cmake ../%{n}-%{realversion} -GNinja \
-DUSE_CPP_PACKAGE=ON \
-DBUILD_CPP_EXAMPLES=OFF \
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY="%{i}" \
-DINSTALL_PYTHON_VERSIONS="${PYTHONV};${PYTHON3V}" \
-DPYTHON_EXECUTABLE=$(which python3) \
-DINSTALL_PYTHON_VERSIONS="%{cms_python3_major_minor_version}" \
-DCMAKE_PREFIX_PATH="${OPENBLAS_ROOT}"

ninja -v %{makeprocesses}
Expand Down

0 comments on commit 3f7455f

Please sign in to comment.