Build time_tests with OpenVINO install (#3484)
This commit is contained in:
parent
fc40104c7f
commit
5cc08367b2
@ -9,6 +9,9 @@ if (CMAKE_BUILD_TYPE STREQUAL "")
|
||||
set(CMAKE_BUILD_TYPE "Release")
|
||||
endif()
|
||||
|
||||
find_package(InferenceEngineDeveloperPackage REQUIRED)
|
||||
find_package(InferenceEngineDeveloperPackage QUIET)
|
||||
if (NOT InferenceEngineDeveloperPackage_FOUND)
|
||||
find_package(InferenceEngine REQUIRED)
|
||||
endif()
|
||||
|
||||
add_subdirectory(src)
|
||||
|
@ -6,19 +6,27 @@ pipelines and calcuates the average execution time.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
To build the time tests, you need to have the `build` folder, which is created
|
||||
when you configure and build OpenVINO™.
|
||||
To build the time tests, you need to have OpenVINO™ installed or build from source.
|
||||
|
||||
## Measure Time
|
||||
|
||||
To build and run the tests, open a terminal and run the commands below:
|
||||
To build and run the tests, open a terminal, set OpenVINO™ environment and run
|
||||
the commands below:
|
||||
|
||||
1. Build tests:
|
||||
``` bash
|
||||
mkdir build && cd build
|
||||
cmake .. && make time_tests
|
||||
```
|
||||
|
||||
If you don't have OpenVINO™ installed you need to have the `build` folder, which
|
||||
is created when you configure and build OpenVINO™ from sources:
|
||||
|
||||
``` bash
|
||||
cmake .. -DInferenceEngineDeveloperPackage_DIR=$(realpath ../../../build) && make time_tests
|
||||
```
|
||||
|
||||
|
||||
2. Run test:
|
||||
``` bash
|
||||
./scripts/run_timetest.py ../../bin/intel64/Release/timetest_infer -m model.xml -d CPU
|
||||
|
@ -4,10 +4,40 @@
|
||||
|
||||
set (TARGET_NAME "timetests_helper")
|
||||
|
||||
find_package(gflags REQUIRED)
|
||||
|
||||
file (GLOB SRC *.cpp)
|
||||
add_library(${TARGET_NAME} STATIC ${SRC})
|
||||
target_include_directories(${TARGET_NAME} PUBLIC "${CMAKE_SOURCE_DIR}/include")
|
||||
|
||||
target_link_libraries(${TARGET_NAME} gflags)
|
||||
find_package(gflags QUIET)
|
||||
if (gflags_FOUND)
|
||||
set(GFLAGS_LIBRARIES gflags) # use gflags from developer package
|
||||
else()
|
||||
include(ExternalProject)
|
||||
find_package(Threads)
|
||||
set(gflags_PREFIX ${CMAKE_BINARY_DIR}/external/gflags-prefix)
|
||||
set(gflags_INSTALL ${CMAKE_BINARY_DIR}/external/gflags-install)
|
||||
set(gflags_LIB ${gflags_INSTALL}/lib/libgflags.a)
|
||||
|
||||
ExternalProject_Add(
|
||||
gflags
|
||||
PREFIX ${gflags_PREFIX}
|
||||
GIT_REPOSITORY "https://github.com/gflags/gflags.git"
|
||||
GIT_TAG "v2.2.2"
|
||||
UPDATE_COMMAND ""
|
||||
INSTALL_DIR ${gflags_INSTALL}
|
||||
CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE}
|
||||
CMAKE_GENERATOR ${CMAKE_GENERATOR}
|
||||
CMAKE_GENERATOR_PLATFORM ${CMAKE_GENERATOR_PLATFORM}
|
||||
CMAKE_GENERATOR_TOOLSET ${CMAKE_GENERATOR_TOOLSET}
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${gflags_INSTALL}
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
BUILD_BYPRODUCTS ${gflags_LIB}
|
||||
LOG_DOWNLOAD 1
|
||||
LOG_INSTALL 1
|
||||
)
|
||||
set(GFLAGS_LIBRARIES ${gflags_LIB} ${CMAKE_THREAD_LIBS_INIT})
|
||||
add_dependencies(${TARGET_NAME} gflags)
|
||||
target_include_directories(${TARGET_NAME} PRIVATE "${gflags_INSTALL}/include")
|
||||
endif()
|
||||
|
||||
target_link_libraries(${TARGET_NAME} ${GFLAGS_LIBRARIES})
|
||||
|
Loading…
Reference in New Issue
Block a user