-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vineel Pratap
committed
Jan 5, 2021
1 parent
64e54f8
commit 2399848
Showing
25 changed files
with
160 additions
and
14 deletions.
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
44 changes: 44 additions & 0 deletions
44
recipes/streaming_convnets/inference/cmake/BuildGoogleTest.cmake
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,44 @@ | ||
cmake_minimum_required(VERSION 3.5.1) | ||
|
||
include(ExternalProject) | ||
|
||
set(gtest_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/googletest/src/googletest/googletest/include) | ||
set(gtest_URL https://github.com/google/googletest.git) | ||
set(gtest_BUILD ${CMAKE_CURRENT_BINARY_DIR}/googletest/) | ||
set(gtest_TAG 703bd9caab50b139428cea1aaff9974ebee5742e) # release 1.10.0 | ||
|
||
if (NOT TARGET gtest) | ||
# Download googletest | ||
ExternalProject_Add( | ||
gtest | ||
PREFIX googletest | ||
GIT_REPOSITORY ${gtest_URL} | ||
GIT_TAG ${gtest_TAG} | ||
BUILD_IN_SOURCE 1 | ||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release | ||
INSTALL_COMMAND "" | ||
CMAKE_CACHE_ARGS | ||
-DCMAKE_BUILD_TYPE:STRING=Release | ||
-DBUILD_GMOCK:BOOL=ON | ||
-DBUILD_GTEST:BOOL=ON | ||
-Dgtest_force_shared_crt:BOOL=OFF | ||
) | ||
endif () | ||
|
||
ExternalProject_Get_Property(gtest source_dir) | ||
set(GTEST_SOURCE_DIR ${source_dir}) | ||
ExternalProject_Get_Property(gtest binary_dir) | ||
set(GTEST_BINARY_DIR ${binary_dir}) | ||
|
||
# Library and include dirs | ||
set(GTEST_LIBRARIES | ||
"${GTEST_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}" | ||
"${GTEST_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}" | ||
"${GTEST_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gmock${CMAKE_STATIC_LIBRARY_SUFFIX}" | ||
"${GTEST_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gmock_main${CMAKE_STATIC_LIBRARY_SUFFIX}" | ||
) | ||
|
||
set(GTEST_INCLUDE_DIR | ||
${GTEST_SOURCE_DIR}/googletest/include | ||
${GTEST_SOURCE_DIR}/googlemock/include | ||
) |
83 changes: 83 additions & 0 deletions
83
recipes/streaming_convnets/inference/cmake/Findkenlm.cmake
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,83 @@ | ||
# Try to find the KenLM library | ||
# | ||
# The following variables are optionally searched for defaults | ||
# KENLM_ROOT: Base directory where all KENLM components are found | ||
# | ||
# The following are set after configuration is done: | ||
# KENLM_FOUND | ||
# KENLM_LIBRARIES | ||
# KENLM_INCLUDE_DIRS | ||
# KENLM_INCLUDE_DIRS_LM | ||
# | ||
|
||
message(STATUS "Looking for KenLM") | ||
|
||
find_library( | ||
KENLM_LIB | ||
kenlm | ||
HINTS | ||
${KENLM_ROOT}/lib | ||
${KENLM_ROOT}/build/lib | ||
PATHS | ||
$ENV{KENLM_ROOT}/lib | ||
$ENV{KENLM_ROOT}/build/lib | ||
) | ||
|
||
find_library( | ||
KENLM_UTIL_LIB | ||
kenlm_util | ||
HINTS | ||
${KENLM_ROOT}/lib | ||
${KENLM_ROOT}/build/lib | ||
PATHS | ||
$ENV{KENLM_ROOT}/lib | ||
$ENV{KENLM_ROOT}/build/lib | ||
) | ||
|
||
if(KENLM_LIB) | ||
message(STATUS "Using kenlm library found in ${KENLM_LIB}") | ||
else() | ||
message(FATAL_ERROR "kenlm library not found; please set CMAKE_LIBRARY_PATH, KENLM_LIB or KENLM_ROOT environment variable") | ||
endif() | ||
|
||
if(KENLM_UTIL_LIB) | ||
message(STATUS "Using kenlm utils library found in ${KENLM_UTIL_LIB}") | ||
else() | ||
message(FATAL_ERROR "kenlm utils library not found; please set CMAKE_LIBRARY_PATH, KENLM_UTIL_LIB or KENLM_ROOT environment variable") | ||
endif() | ||
|
||
# find a model header, then get the entire include directory. We need to do this because | ||
# cmake consistently confuses other things along this path | ||
find_path(KENLM_MODEL_HEADER | ||
model.hh | ||
PATH_SUFFIXES | ||
kenlm/lm | ||
include/kenlm/lm | ||
HINTS | ||
${KENLM_ROOT}/lm | ||
${KENLM_ROOT}/include/kenlm/lm | ||
PATHS | ||
$ENV{KENLM_ROOT}/lm | ||
$ENV{KENLM_ROOT}/include/kenlm/lm | ||
) | ||
|
||
if(KENLM_MODEL_HEADER) | ||
message(STATUS "kenlm model.hh found in ${KENLM_MODEL_HEADER}") | ||
else() | ||
message(FATAL_ERROR "kenlm model.hh not found; please set CMAKE_INCLUDE_PATH, KENLM_MODEL_HEADER or KENLM_ROOT environment variable") | ||
endif() | ||
get_filename_component(KENLM_INCLUDE_LM ${KENLM_MODEL_HEADER} DIRECTORY) | ||
get_filename_component(KENLM_INCLUDE_DIR ${KENLM_INCLUDE_LM} DIRECTORY) | ||
|
||
set(KENLM_LIBRARIES ${KENLM_LIB} ${KENLM_UTIL_LIB}) | ||
# Some KenLM include paths are relative to [include dir]/kenlm, not just [include dir] (bad) | ||
set(KENLM_INCLUDE_DIRS_LM ${KENLM_INCLUDE_LM}) | ||
set(KENLM_INCLUDE_DIRS ${KENLM_INCLUDE_DIR}) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(kenlm DEFAULT_MSG KENLM_INCLUDE_DIRS KENLM_LIBRARIES) | ||
|
||
if (kenlm_FOUND) | ||
message(STATUS "Found kenlm (include: ${KENLM_INCLUDE_DIRS}, library: ${KENLM_LIBRARIES})") | ||
mark_as_advanced(KENLM_ROOT KENLM_INCLUDE_DIRS KENLM_LIBRARIES) | ||
endif() |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,18 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
add_executable( | ||
StreamingTDSModelConverter | ||
StreamingTDSModelConverter.cpp | ||
) | ||
|
||
target_include_directories( | ||
StreamingTDSModelConverter | ||
PRIVATE | ||
${PROJECT_SOURCE_DIR} | ||
) | ||
|
||
target_link_libraries( | ||
StreamingTDSModelConverter | ||
PRIVATE | ||
flashlight::flashlight-app-asr | ||
) |