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
[Sonic] Add OpenCV external #5747
Merged
smuzaffar
merged 8 commits into
cms-sw:IB/CMSSW_11_1_X/master
from
mrodozov:add_opencv_external
May 22, 2020
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3511c39
[Sonic] Add OpenCV external
mrodozov d03cdf3
Build everything possible opencv is trying to build and we have the d…
mrodozov 02d4bd3
add quotes
mrodozov 2231cdc
update opencv toolfile
mrodozov a7e344b
Merge branch 'IB/CMSSW_11_1_X/master' into add_opencv_external
mrodozov dc45951
Update opencv.spec
smuzaffar de06ac4
add opencv to python_tools
mrodozov 6191986
Merge branch 'IB/CMSSW_11_1_X/master' into add_opencv_external
smuzaffar File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
### RPM external opencv-toolfile 1.0 | ||
Requires: opencv | ||
%prep | ||
|
||
%build | ||
|
||
%install | ||
|
||
mkdir -p %i/etc/scram.d | ||
cat << \EOF_TOOLFILE >%i/etc/scram.d/opencv.xml | ||
<tool name="opencv" version="@TOOL_VERSION@"> | ||
<lib name="opencv_core"/> | ||
<client> | ||
<environment name="OPENCV_BASE" default="@TOOL_ROOT@"/> | ||
<environment name="INCLUDE" default="$OPENCV_BASE/include"/> | ||
<environment name="LIBDIR" default="$OPENCV_BASE/lib"/> | ||
<environment name="BINDIR" default="$OPENCV_BASE/bin"/> | ||
</client> | ||
<use name="libpng"/> | ||
<use name="libjpeg-turbo"/> | ||
<use name="zlib"/> | ||
<use name="eigen"/> | ||
<use name="OpenBLAS"/> | ||
</tool> | ||
EOF_TOOLFILE | ||
|
||
## IMPORT scram-tools-post |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
### RPM external opencv 4.3.0 | ||
## INITENV +PATH PYTHON27PATH %{i}/${PYTHON_LIB_SITE_PACKAGES} | ||
## INITENV +PATH PYTHON3PATH %{i}/${PYTHON3_LIB_SITE_PACKAGES} | ||
%define tag 01b2c5a77ca6dbef3baef24ebc0a5984579231d9 | ||
%define branch master | ||
%define github_user opencv | ||
|
||
Source: git+https://github.com/%{github_user}/opencv.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}-%{tag}.tgz | ||
BuildRequires: cmake ninja | ||
Requires: python python3 py2-numpy py3-numpy libpng libjpeg-turbo libtiff zlib eigen OpenBLAS | ||
|
||
%prep | ||
%setup -n %{n}-%{realversion} | ||
|
||
%build | ||
rm -rf ../build | ||
mkdir ../build | ||
cd ../build | ||
|
||
cmake ../%{n}-%{realversion} \ | ||
-GNinja \ | ||
-DCMAKE_INSTALL_PREFIX="%{i}" \ | ||
-DCMAKE_INSTALL_LIBDIR=lib \ | ||
-DPYTHON2_EXECUTABLE:FILEPATH="${PYTHON_ROOT}/bin/python" \ | ||
-DPYTHON2_INCLUDE_DIR:PATH="${PYTHON_ROOT}/include/python2.7" \ | ||
-DPYTHON2_LIBRARY:FILEPATH="${PYTHON_ROOT}/lib/libpython2.7.so" \ | ||
-DPYTHON3_EXECUTABLE:FILEPATH="${PYTHON3_ROOT}/bin/python3" \ | ||
-DPYTHON3_INCLUDE_DIR:PATH="${PYTHON3_ROOT}/include/python3.8" \ | ||
-DPYTHON3_LIBRARY:FILEPATH="${PYTHON3_ROOT}/lib/libpython3.8.so" \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_PREFIX_PATH="${LIBPNG_ROOT};${LIBTIFF_ROOT};${LIBJPEG_TURBO_ROOT};${ZLIB_ROOT};${PYTHON_ROOT};${PYTHON3_ROOT};${PY2_NUMPY_ROOT};${PY3_NUMPY_ROOT};${EIGEN_ROOT};${OPENBLAS_ROOT}" | ||
|
||
ninja -v %{makeprocesses} -l $(getconf _NPROCESSORS_ONLN) | ||
|
||
%install | ||
cd ../build | ||
ninja -v %{makeprocesses} -l $(getconf _NPROCESSORS_ONLN) install |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we not use a traditionally tagged release version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
01b2c5a77ca6dbef3baef24ebc0a5984579231d9 anyway points to tag 4.3.0. So we can just use
%{realversion}
instead of tag here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done