-
Notifications
You must be signed in to change notification settings - Fork 82
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
Simplify build commands, update readme #583
Conversation
headupinclouds
commented
Oct 16, 2017
- Make these options true for mobile platforms, else false
- DRISHTI_BUILD_REGRESSION_SIMD
- DRISHTI_BUILD_REGRESSION_FIXED_POINT
- Update README with hunter notes and simple polly.py build commands * DRISHTI_COPY_3RDPARTY_LICENSES=ON # default
- remove legacy/unused DRISHTI_BUILD_CV_ML
- fix spelling
* Make these options true for mobile platforms, else false + DRISHTI_BUILD_REGRESSION_SIMD + DRISHTI_BUILD_REGRESSION_FIXED_POINT * Update README with hunter notes and simple polly.py build commands * DRISHTI_COPY_3RDPARTY_LICENSES=ON # default * remove legacy/unused DRISHTI_BUILD_CV_ML * fix spelling
@@ -35,13 +35,13 @@ Goal: SDK size <= 1 MB and combined resources (object detection + regression mod | |||
|
|||
## Quick Start (i.e., How do I make this library work?) | |||
|
|||
Drishti is a [CMake](https://github.com/kitware/CMake) based project that uses the [Hunter](https://github.com/ruslo/hunter) package manager to download and build project dependencies from source as needed. Hunter contains [detailed documentation](https://docs.hunter.sh/en/latest), but a few high level notes are provided here to help orient first time users. In practice, some working knowledge of CMake may also be required. Hunter itself is written in CMake, and is installed as part of the build process from a single `HunterGate()` macro at the top of the root `CMakeLists.txt` file (typically `cmake/Hunter/HunterGate.cmake`) (you don't have to build or install it). Each CMake dependency's `find_package(FOO)` call that is paired with a `hunter_add_package(FOO CONFIG REQUIRED)` will be managed by Hunter. Additional configuration (i.e., custom version and/or CMake arguments) can be performed for each package with an optional `hunter_config(FOO VERSION 1.0.0 CMAKE_ARGS ${FOO_CMAKE_ARGS}))` call in an optional local config file that is specified in the `HunterGate()` call. In most cases, the only system requirement for building a Hunter project is a recent CMake with CURL support and a working compiler correpsonding to the operative toolchain. | |||
Drishti is a [CMake](https://github.com/kitware/CMake) based project that uses the [Hunter](https://github.com/ruslo/hunter) package manager to download and build project dependencies from source as needed. Hunter contains [detailed documentation](https://docs.hunter.sh/en/latest), but a few high level notes are provided here to help orient first time users. In practice, some working knowledge of CMake may also be required. Hunter itself is written in CMake, and is installed as part of the build process from a single `HunterGate()` macro at the top of the root `CMakeLists.txt` file (typically `cmake/Hunter/HunterGate.cmake`) (you don't have to build or install it). Each CMake dependency's `find_package(FOO)` call that is paired with a `hunter_add_package(FOO CONFIG REQUIRED)` will be managed by Hunter. Additional configuration (i.e., custom version and/or CMake arguments) can be performed for each package with an optional `hunter_config(FOO VERSION 1.0.0 CMAKE_ARGS ${FOO_CMAKE_ARGS}))` call in an optional local config file that is specified in the `HunterGate()` call. In most cases, the only system requirement for building a Hunter project is a recent CMake with CURL support and a working compiler correpsonding to the operative toolchain. Hunter will maintain all dependencies in a [versioned](https://docs.hunter.sh/en/latest/overview/customization.html) local [cache](https://docs.hunter.sh/en/latest/overview/shareable.html) by default (typically `${HOME}/.hunter`) where they can be reused in subsequent builds and shared between different projects. They can also be stored in a server side [binary cache](https://docs.hunter.sh/en/latest/overview/binaries.html). |
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.
Additional configuration (i.e., custom version and/or CMake arguments) can be performed for each package with an optional
hunter_config(FOO VERSION 1.0.0 CMAKE_ARGS ${FOO_CMAKE_ARGS}))
call in an optional local config file that is specified in theHunterGate()
call
Not sure why user may need to know this.
In most cases, the only system requirement for building a Hunter project is a recent CMake with CURL support and a working compiler correpsonding to the operative toolchain
Info is here:
Probably should be moved to "Quick start: Tools".
They can also be stored in a server side binary cache.
Not very informative. How it can be helpful for the first time user?
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.
Not sure why user may need to know this.
I think that makes sense. That is probably more critical for creating a new project. I'll cut this (in line w/ preference for bare bones description that doesn't duplicate Hunter docs too much).
Info is here: https://docs.hunter.sh/en/latest/contributing.html#reporting-bugs
I'll link this. I think it is important to keep it in the "setup" notes. I believe the default Ubuntu 16.04 doesn't have CURL support, for example. (I'll incorporate feedback and update via direct README.md commit after the merge.)
Not very informative. How it can be helpful for the first time user?
In the toolchain discussion, the CI builds + cache are mentioned. I think it is important to introduce the idea of a binary cache so the user understands the pre-built packages are downloaded from a server. Maybe a little more information could help.
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.
I believe the default Ubuntu 16.04 doesn't have CURL support, for example
I'm pretty sure it has. The CURL support issue (OpenSSL support to be precise) usually about manually compiled CMake.
In the toolchain discussion, the CI builds + cache are mentioned
Okay, I see. However not all of them are "stable", e.g. xcode-hid-sections
.
CONFIG=Release | ||
INSTALL=--install | ||
bin/drishti_build.sh "${TOOLCHAIN}" "${CONFIG}" "${INSTALL}" | ||
polly.py --toolchain ${TOOLCHAIN} --config ${CONFIG} --fwd HUNTER_CONFIGURATION_TYPES=${CONFIG} --install --verbose |
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.
I guess first time user is not interested in --install
.
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.
I think --install
is important. My sense is that the majority of users are looking for a working lib they can stick into their project. An "Integration" section discussing Hunter vs Non-Hunter (shared lib) solutions is also needed in a follow up.
|
||
The [Travis](https://github.com/elucideye/drishti/blob/master/.travis.yml) (Linux/OSX/iOS/Android) and [Appveyor](https://github.com/elucideye/drishti/blob/master/appveyor.yml) (Windows) CI scripts in the project's root directory can serve as a reference for basic setup when building from source. To support cross platform builds and testing, the CI scripts make use of [Polly](https://github.com/ruslo/polly): a set of common CMake toolchains paired with a simple `polly.py` CMake build script. Polly is used here for convenience to generate `CMake` command line invocations -- it is not required for building Hunter projects. | ||
|
||
To reproduce the CI builds on a local host, you must install `CMake` and `Polly` and add the paths for the `cmake` and `polly.py` executables to your system's `PATH` variable. The `bin/hunter_env.{sh,cmd}` scripts (used in the CI builds) can be used to install these tools for you in your local terminal. You may want to add the `PATH` variables permanently to your `.bashrc` file (or equivalent) for future sessions. | ||
|
||
Linux/OS X: | ||
Linux/OSX: | ||
``` | ||
source bin/hunter_env.sh |
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.
Now it can be:
- Install CMake
- Install Python (for Polly)
- Clone Polly and add
<polly>/bin
to PATH
?
By the way "Install CMake" includes not only CMake but the real build tools and compiler. So probably this page can be helpful: http://cgold.readthedocs.io/en/latest/first-step.html
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.
I like the bullet list as a high level description.
So probably this page can be helpful: http://cgold.readthedocs.io/en/latest/first-step.html
Perfect. I'll add a link appropriately in the text.
|
||
The configurations listed below have all been tested. In general, most C++11 toolchains should work with minimal effort. A CI comment indicates that the configuration is part of the Travis or Appveyor CI tests, so all Hunter packages will be available in the server side binary cache. | ||
|
||
Linux (Ubunty Trusty 14.04): |
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.
I guess we can save some space by omitting TOOLCHAIN=
. Just say that "Next arguments for --toolchain tested and can be used...".
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.
I could go either way on this. The CONFIG
does impact the cache. If a user wants a quick build they will need to know which TOOLCHAIN
+ CONFIG
pair to use.
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.
The CONFIG does impact the cache. If a user wants a quick build they will need to know which TOOLCHAIN + CONFIG pair to use
Okay, I see it now.
The configurations listed below have all been tested. In general, most C++11 toolchains should work with minimal effort. A CI comment indicates that the configuration is part of the Travis or Appveyor CI tests, so all Hunter packages will be available in the server side binary cache. | ||
|
||
Linux (Ubunty Trusty 14.04): | ||
* TOOLCHAIN=gcc-5-pic-hid-sections-lto CONFIG=Release # CI |
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.
I guess CONFIG=...
not needed (?)
@@ -17,7 +17,7 @@ python %POLLY_ROOT%\bin\polly.py ^ | |||
--config "%1%" ^ | |||
--toolchain "%2%" ^ | |||
--test ^ | |||
--fwd HUNTER_USE_CACHE_SERVERS=NO ^ | |||
--fwd HUNTER_USE_CACHE_SERVERS=YES ^ | |||
HUNTER_DISABLE_BUILDS=NO ^ |
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.
HUNTER_USE_CACHE_SERVERS=ONLY
HUNTER_DISABLE_BUILDS=YES
?
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.
This script was added based on issue discussions to provide an easy option for local host builds. Once cmake defaults + documentation is cleaned up I think it can be removed (along with some others). It isn't actually used right now in appveyor.yml. The appveyor build-appveyor.cmd
script used in CI still forces cache behavior:
- cmd: bin\build-appveyor.cmd "%CONFIG%" "%TOOLCHAIN%"
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.
ok
☝️ I've tried to incorporate the above changes to the README.md |