Skip to content

Commit

Permalink
Set all apps to be off for the build (#533)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: flashlight/flashlight#533

- set all apps to OFF for build
- add docs on objdet build
- resolve issue flashlight/flashlight#528

Reviewed By: jacobkahn

Differential Revision: D27644353

fbshipit-source-id: 070de6fd69adf8c03aa24f7097aa3dbfea9a632b
  • Loading branch information
Tatiana Likhomanenko authored and facebook-github-bot committed Apr 15, 2021
1 parent a6dcdc4 commit 447f3b6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
11 changes: 3 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ option(FL_BUILD_CORE "Build flashlight core" ON)
cmake_dependent_option(FL_BUILD_CONTRIB
"Build and link additional flashlight contrib assets." ON
"FL_BUILD_CORE" OFF)
cmake_dependent_option(FL_BUILD_APPS
"Build flashlight apps" ON
"FL_BUILD_CORE;FL_BUILD_CONTRIB;FL_BUILD_LIBRARIES" OFF)

# Flashlight backend
set(FL_BACKEND "CUDA" CACHE STRING "Backend with which to build flashlight")
Expand Down Expand Up @@ -275,11 +272,9 @@ if (FL_BUILD_CORE)
endif() # if FL_BUILD_CORE

# --------------------------- Apps ---------------------------
if (FL_BUILD_APPS)
message(STATUS "Will build Flashlight applications.")
set(FL_APPS_DIR "${FL_ROOT_DIR}/app")
include(${FL_APPS_DIR}/CMakeLists.txt)
endif()

set(FL_APPS_DIR "${FL_ROOT_DIR}/app")
include(${FL_APPS_DIR}/CMakeLists.txt)

# --------------------------- Cleanup ---------------------------
setup_install_targets(INSTALL_TARGETS ${INSTALLABLE_TARGETS})
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ tensor library.
Native support in C++ and simple extensibility makes Flashlight a powerful research framework that's *hackable to its core* and enables fast iteration on new experimental setups and algorithms without sacrificing performance. In a single repository, Flashlight provides [apps](https://github.com/facebookresearch/flashlight/tree/master/flashlight/app) for research across multiple domains:
- [Automatic speech recognition](https://github.com/facebookresearch/flashlight/tree/master/flashlight/app/asr) (the [wav2letter](https://github.com/facebookresearch/wav2letter/) project) — [Documentation](flashlight/app/asr) | [Tutorial](flashlight/app/asr/tutorial)
- [Image classification](flashlight/app/imgclass)
- [Object detection](flashlight/app/objdet)
- [Language modeling](flashlight/app/lm)


Expand Down Expand Up @@ -217,7 +218,7 @@ cmake .. -DCMAKE_BUILD_TYPE=Release -DFL_BACKEND=[backend] [...build options]
make -j$(nproc)
make install
```
Setting the `MKLROOT` environment variable (`export MKLROOT=/opt/intel/oneapi/mkl/latest` or `export MKLROOT=/opt/intel/mkl` on most Linux-based systems) can help CMake find Intel MKL if not initially found.
Setting the `MKLROOT` environment variable (`export MKLROOT=/opt/intel/oneapi/mkl/latest` or `export MKLROOT=/opt/intel/mkl` on most Linux-based systems) can help CMake find Intel MKL if not initially found.

To build a smaller subset of Flashlight features/apps, see the [build options](#build-options) below for a complete list of options.

Expand Down Expand Up @@ -279,6 +280,11 @@ Dependencies marked with `†` are installable via `vcpkg`. See the [instruction
<td>Any</td>
<td>-</td>
</tr>
<tr>
<td>app: objdet</td>
<td>Any</td>
<td>-</td>
</tr>
<tr>
<td>app: lm</td>
<td>Any</td>
Expand Down Expand Up @@ -342,33 +348,39 @@ The Flashlight CMake build accepts the following build options (prefixed with `-
<td>Build contrib APIs subject to breaking changes.</td>
</tr>
<tr>
<td>FL_BUILD_APPS</td>
<td>FL_BUILD_ALL_APPS</td>
<td>ON, OFF</td>
<td>ON</td>
<td>Build apps (see below).</td>
<td>OFF</td>
<td>Defines default value for every app (see below).</td>
</tr>
<tr>
<td>FL_BUILD_APP_ASR</td>
<td>ON, OFF</td>
<td>ON</td>
<td>FL_BUILD_ALL_APPS</td>
<td>Build the automatic speech recognition app.</td>
</tr>
<tr>
<td>FL_BUILD_APP_IMGCLASS</td>
<td>ON, OFF</td>
<td>ON</td>
<td>FL_BUILD_ALL_APPS</td>
<td>Build the image classification app.</td>
</tr>
<tr>
<td>FL_BUILD_APP_OBJDET</td>
<td>ON, OFF</td>
<td>FL_BUILD_ALL_APPS</td>
<td>Build automatic speech recognition app tools.</td>
</tr>
<tr>
<td>FL_BUILD_APP_LM</td>
<td>ON, OFF</td>
<td>ON</td>
<td>FL_BUILD_ALL_APPS</td>
<td>Build the language modeling app.</td>
</tr>
<tr>
<td>FL_BUILD_APP_ASR_TOOLS</td>
<td>ON, OFF</td>
<td>ON</td>
<td>FL_BUILD_APP_ASR</td>
<td>Build automatic speech recognition app tools.</td>
</tr>
<tr>
Expand Down Expand Up @@ -410,6 +422,7 @@ Flashlight is most-easily linked to using CMake. Flashlight exports the followin
- `flashlight::flashlight` — contains flashlight libraries as well as the flashlight core autograd and neural network library.
- `flashlight::flashlight-app-asr` — contains the automatic speech recognition app along with the flashlight core and flashlight libraries.
- `flashlight::flashlight-app-imgclass` — contains the image classification app along with the flashlight core and flashlight libraries.
- `flashlight::flashlight-app-objdet` — contains the object detection app along with the flashlight core and flashlight libraries.
- `flashlight::flashlight-app-lm` — contains the language modeling app along with the flashlight core and flashlight libraries.

Given a simple `project.cpp` file that includes and links to Flashlight:
Expand Down

0 comments on commit 447f3b6

Please sign in to comment.