speedup osx build with ccache and other stuff#1
speedup osx build with ccache and other stuff#1sergregory wants to merge 8 commits intosergregory:masterfrom
Conversation
tools/osx-build-cmake.sh
Outdated
| ) | ||
| for m in ${CV_MODULES[@]}; do | ||
| if make help | grep $m; then | ||
| time make -j $m |
There was a problem hiding this comment.
I think it should be something like time make -j$(sysctl -n hw.ncpu) $m. With just -j option make will launch as many threads as possible, which, in many situations, slower than launching 1 thread per core.
tools/osx-build-cmake.sh
Outdated
| time make -j $m | ||
| fi | ||
| done | ||
| time make -j |
There was a problem hiding this comment.
And the same comment as above here.
tools/osx-build-cmake.sh
Outdated
| ENABLE_HEADLESS=0 | ||
| ENABLE_JAVA=0 | ||
| CWD=`pwd` | ||
| REPO=${REPO:-/Users/grigoryserebryakov/Documents/project/python-opencv/repos} |
There was a problem hiding this comment.
Looks strange to me - ~ means home directory, so probably it should be either
~/Documents/project/python-opencv/repos or $HOME/Documents/project/python-opencv/repos
tools/osx-build-cmake.sh
Outdated
| ENABLE_CONTRIB=1 | ||
| ENABLE_HEADLESS=0 | ||
| ENABLE_JAVA=0 | ||
| CWD=`pwd` |
There was a problem hiding this comment.
Please use the shellcheck tool and fix the things it warns you about
tools/osx-prepare.sh
Outdated
| # Install python 3.7-3.9 | ||
| # brew install [email protected] | ||
| brew install [email protected] | ||
| brew install [email protected] |
There was a problem hiding this comment.
Looks strange to me - why should we install several pythons just to unlink one of them and use another one?
tools/osx-build-pip.sh
Outdated
| ENABLE_CONTRIB=1 | ||
| ENABLE_HEADLESS=0 | ||
| ENABLE_JAVA=0 | ||
| REPO=${REPO:-/Users/grigoryserebryakov/Documents/project/python-opencv/repos} |
There was a problem hiding this comment.
Comment about the home directory
tools/osx-build-pip.sh
Outdated
| export ENABLE_CONTRIB | ||
| export ENABLE_HEADLESS | ||
| export ENABLE_JAVA | ||
| pip3 wheel . |
There was a problem hiding this comment.
this is a bit confusing - surely you can do pip3 wheel, but I'd expect python3 setup.py bdist_wheel here - at least because you already use setup.py the same way for sdist several lines above
| @@ -0,0 +1,23 @@ | |||
| import sys | |||
There was a problem hiding this comment.
Probably, it should be executable, so needs sha-bang and the '+x' flag
|
@GArik please take a look |
| if (sys.argv[1] == "bin"): | ||
| print(sys.executable) | ||
| elif (sys.argv[1] == "lib"): | ||
| python_lib_path = cmaker.CMaker.get_python_library(python_version).replace("\\", "/") |
There was a problem hiding this comment.
You can try something like this SO answer:
https://stackoverflow.com/questions/35071192/how-to-find-out-where-the-python-include-directory-is
3309e3a to
c5ba285
Compare
a85b34c to
457c377
Compare
To fix warnings like this: Warning: You are using macOS 10.13. 5We (and Apple) do not provide support for this old version. You will encounter build failures with some formulae. Also use Qt-5.15.2 which is installed in MacOS 10.15.5
Use cmake && make to prebuild opencv libraries and use pip to pack them
No description provided.