Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
63d3986
Turn hosting project off by default
tmccrmck Apr 11, 2019
70b3843
Attmept to install boost with cmake
tmccrmck Apr 11, 2019
acfc5f8
Switching to downloading file manually
tmccrmck Apr 11, 2019
b6aed7e
Install with b2 execute_process
tmccrmck Apr 11, 2019
2268b40
Trying building boost programs with ExternalProject_Add
tmccrmck Apr 11, 2019
61425c1
Dont build each component individually
tmccrmck Apr 11, 2019
13e9a30
Install in
tmccrmck Apr 12, 2019
65e9513
Install into boost root dir
tmccrmck Apr 12, 2019
47ab5be
Cache path of of BOOST_ROOT_DIR
tmccrmck Apr 12, 2019
18e55e5
Merge branch 'master' of github.com:NonStatic2014/onnxruntime into tr…
tmccrmck Apr 12, 2019
fd877ab
Manually set BOOST_ROOT
tmccrmck Apr 12, 2019
7be4927
Switch to using FindBoost
tmccrmck Apr 12, 2019
ef62a23
Revert "Switch to using FindBoost"
tmccrmck Apr 12, 2019
d566725
Boost should build in source dir
tmccrmck Apr 12, 2019
8397b23
Bring back hosting unit tests
tmccrmck Apr 12, 2019
836197f
Use http and comment out find_package for now
tmccrmck Apr 12, 2019
a07abfc
Hopefully installs in correct directory by using prefix
tmccrmck Apr 12, 2019
e231524
Install and use toolset=gcc and set Boost include_dir and librarydir
tmccrmck Apr 12, 2019
3c2a61d
Set Boost_INLUDE_DIR and Boost_LIBRARIES
tmccrmck Apr 12, 2019
ea4dc69
Remove vcpkg submodule
tmccrmck Apr 13, 2019
6024c58
Merge branch 'trmccorm/boost_cmake' of github.com:NonStatic2014/onnxr…
tmccrmck Apr 13, 2019
78e83d3
Enable hosting unit tests, remove useless search for installed Boost
tmccrmck Apr 13, 2019
53355fa
Correctly check variant of boost build
tmccrmck Apr 13, 2019
b227d02
Clean up get_boost, remove find_package
tmccrmck Apr 13, 2019
ccb6b2c
Fix typo of boostrap
tmccrmck Apr 13, 2019
f91b6b6
Use ExternalProject to download and unzip
tmccrmck Apr 13, 2019
a17c1ef
Merge branch 'trmccorm/boost_cmake' of github.com:NonStatic2014/onnxr…
tmccrmck Apr 13, 2019
5d7f7f4
Fix bad indentation
tmccrmck Apr 13, 2019
2f85138
Boost sha1, version, and use_static_libs read as cache vars
tmccrmck Apr 15, 2019
5dd7924
Create fatal error if trying to use Boost on Windows
tmccrmck Apr 15, 2019
da5d6fa
Set Boost toolset to CMake's C compiler
tmccrmck Apr 15, 2019
4c0282b
Removes unused Boost variables
tmccrmck Apr 15, 2019
c02ba60
Remote setting BOOST_ROOT, mark Boost_LIBRARIES and Boost_INCLDUDE_DI…
tmccrmck Apr 15, 2019
10ad748
Convert indentation to 2 spaces
tmccrmck Apr 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
[submodule "cmake/external/re2"]
path = cmake/external/re2
url = https://github.com/google/re2.git
[submodule "cmake/external/vcpkg"]
path = cmake/external/vcpkg
url = https://github.com/Microsoft/vcpkg.git
[submodule "cmake/external/onnx-tensorrt"]
path = cmake/external/onnx-tensorrt
url = https://github.com/onnx/onnx-tensorrt.git
7 changes: 4 additions & 3 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,10 @@ if (onnxruntime_BUILD_SHARED_LIB)
include(onnxruntime.cmake)
endif()

if (onnxruntime_BUILD_HOSTING)
include(onnxruntime_hosting.cmake)
endif()

# some of the tests rely on the shared libs to be
# built; hence the ordering
if (onnxruntime_BUILD_UNIT_TESTS)
Expand Down Expand Up @@ -612,6 +616,3 @@ if (onnxruntime_BUILD_CSHARP)
include(onnxruntime_csharp.cmake)
endif()

if (onnxruntime_BUILD_HOSTING)
include(onnxruntime_hosting.cmake)
endif()
1 change: 0 additions & 1 deletion cmake/external/vcpkg
Submodule vcpkg deleted from 660ba9
74 changes: 74 additions & 0 deletions cmake/get_boost.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
set(BOOST_REQUESTED_VERSION 1.69.0 CACHE STRING "")
set(BOOST_SHA1 8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406 CACHE STRING "")
set(BOOST_USE_STATIC_LIBS false CACHE BOOL "")

set(BOOST_COMPONENTS program_options system thread)

if(WIN32)
message(FATAL_ERROR "Windows not currently supported")
endif()

if(BOOST_USE_STATIC_LIBS)
set(LIBRARY_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
set(LIBRARY_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
else()
set(LIBRARY_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX})
set(LIBRARY_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()

foreach(component ${BOOST_COMPONENTS})
list(APPEND BOOST_COMPONENTS_FOR_BUILD --with-${component})
endforeach()

set(BOOST_ROOT_DIR ${CMAKE_BINARY_DIR}/boost CACHE PATH "")

# TODO: let user give their own Boost installation
macro(DOWNLOAD_BOOST)
if(NOT BOOST_REQUESTED_VERSION)
message(FATAL_ERROR "BOOST_REQUESTED_VERSION is not defined.")
endif()

string(REPLACE "." "_" BOOST_REQUESTED_VERSION_UNDERSCORE ${BOOST_REQUESTED_VERSION})

set(BOOST_MAYBE_STATIC)
if(BOOST_USE_STATIC_LIBS)
set(BOOST_MAYBE_STATIC "link=static")
endif()

set(VARIANT "release")
if(CMAKE_BUILD_TYPE MATCHES Debug)
set(VARIANT "debug")
endif()

message(STATUS "Adding Boost components")
include(ExternalProject)
ExternalProject_Add(
Boost
URL http://dl.bintray.com/boostorg/release/${BOOST_REQUESTED_VERSION}/source/boost_${BOOST_REQUESTED_VERSION_UNDERSCORE}.tar.bz2
URL_HASH SHA256=${BOOST_SHA1}
DOWNLOAD_DIR ${BOOST_ROOT_DIR}
SOURCE_DIR ${BOOST_ROOT_DIR}
UPDATE_COMMAND ""
CONFIGURE_COMMAND ./bootstrap.sh --prefix=${BOOST_ROOT_DIR}
BUILD_COMMAND ./b2 install ${BOOST_MAYBE_STATIC} --prefix=${BOOST_ROOT_DIR} variant=${VARIANT} ${BOOST_COMPONENTS_FOR_BUILD}
BUILD_IN_SOURCE true
INSTALL_COMMAND ""
INSTALL_DIR ${BOOST_ROOT_DIR}
LOG_BUILD ON
)

ExternalProject_Get_Property(Boost INSTALL_DIR)
set(Boost_INCLUDE_DIR ${INSTALL_DIR}/include)

macro(libraries_to_fullpath varname)
set(${varname})
foreach(component ${BOOST_COMPONENTS})
list(APPEND ${varname} ${INSTALL_DIR}/lib/${LIBRARY_PREFIX}boost_${component}${LIBRARY_SUFFIX})
endforeach()
endmacro()

libraries_to_fullpath(Boost_LIBRARIES)
mark_as_advanced(Boost_LIBRARIES Boost_INCLUDE_DIR)
endmacro()

DOWNLOAD_BOOST()
3 changes: 2 additions & 1 deletion cmake/onnxruntime_hosting.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if(NOT WIN32)
endif()

# Setup dependencies
find_package(Boost 1.69 COMPONENTS system context thread program_options REQUIRED)
include(get_boost.cmake)
set(re2_src ${REPO_ROOT}/cmake/external/re2)

# Setup source code
Expand Down Expand Up @@ -61,6 +61,7 @@ target_include_directories(onnxruntime_hosting_http_core_lib
${Boost_INCLUDE_DIR}
${re2_src}
)
add_dependencies(onnxruntime_hosting_http_core_lib Boost)
target_link_libraries(onnxruntime_hosting_http_core_lib PRIVATE
${Boost_LIBRARIES}
)
Expand Down
5 changes: 2 additions & 3 deletions cmake/onnxruntime_unittests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ endfunction(AddTest)
#can propagate correctly.

file(GLOB onnxruntime_test_utils_src
"${TEST_SRC_DIR}/util/http/*.h"
"${TEST_SRC_DIR}/util/include/*.h"
"${TEST_SRC_DIR}/util/*.cc"
)

Expand Down Expand Up @@ -551,10 +551,9 @@ if (onnxruntime_BUILD_HOSTING)
endif()
endif()

find_package(Boost 1.69 COMPONENTS system context thread program_options REQUIRED)
add_library(onnxruntime_test_utils_for_hosting ${onnxruntime_test_hosting_src})
onnxruntime_add_include_to_target(onnxruntime_test_utils_for_hosting onnxruntime_test_utils gtest gmock gsl onnx onnx_proto hosting_proto)
add_dependencies(onnxruntime_test_utils_for_hosting onnxruntime_hosting ${onnxruntime_EXTERNAL_DEPENDENCIES})
add_dependencies(onnxruntime_test_utils_for_hosting onnxruntime_hosting Boost ${onnxruntime_EXTERNAL_DEPENDENCIES})
target_include_directories(onnxruntime_test_utils_for_hosting PUBLIC ${Boost_INCLUDE_DIR} ${REPO_ROOT}/cmake/external/re2 ${CMAKE_CURRENT_BINARY_DIR}/onnx ${ONNXRUNTIME_ROOT}/hosting/http ${ONNXRUNTIME_ROOT}/hosting/http/core PRIVATE ${ONNXRUNTIME_ROOT} )
target_link_libraries(onnxruntime_test_utils_for_hosting ${Boost_LIBRARIES} ${onnx_test_libs})

Expand Down
17 changes: 0 additions & 17 deletions tools/ci_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,6 @@ def install_python_deps(numpy_version=""):
dep_packages.append('numpy==%s' % numpy_version if numpy_version else 'numpy')
run_subprocess([sys.executable, '-m', 'pip', 'install', '--trusted-host', 'files.pythonhosted.org'] + dep_packages)

def install_hosting_deps(source_dir):
vcpkg_folder_path = os.path.join(source_dir, "cmake", "external", "vcpkg")
vcpkg_executable = os.path.join(vcpkg_folder_path, 'vcpkg')

if (not os.path.exists(vcpkg_executable)):
file_ending = '.bat' if is_windows() else '.sh'
boostrap_path = os.path.join(vcpkg_folder_path, 'bootstrap-vcpkg' + file_ending)
run_subprocess([boostrap_path])

run_subprocess([vcpkg_executable, 'install', 'boost-beast', 'boost-program-options', 'boost-uuid'])

def check_md5(filename, expected_md5):
if not os.path.exists(filename):
return False
Expand Down Expand Up @@ -361,10 +350,6 @@ def generate_build_tree(cmake_path, source_dir, build_dir, cuda_home, cudnn_home
if path_to_protoc_exe:
cmake_args += ["-DONNX_CUSTOM_PROTOC_EXECUTABLE=%s" % path_to_protoc_exe]

if args.build_hosting:
toolchain_path = os.path.join(cmake_dir, 'external', 'vcpkg', 'scripts', 'buildsystems', 'vcpkg.cmake')
cmake_args += ["-DCMAKE_TOOLCHAIN_FILE=" + toolchain_path]

if args.gen_doc:
cmake_args += ["-Donnxruntime_PYBIND_EXPORT_OPSCHEMA=ON"]

Expand Down Expand Up @@ -713,8 +698,6 @@ def main():
install_python_deps(args.numpy_version)
if (not args.skip_submodule_sync):
update_submodules(source_dir)
if (args.build_hosting):
install_hosting_deps(source_dir)

if args.enable_onnx_tests or args.download_test_data:
if not args.test_data_url or not args.test_data_checksum:
Expand Down
4 changes: 1 addition & 3 deletions tools/ci_build/github/linux/ubuntu16.04/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ apt-get update && apt-get install -y --no-install-recommends \
unzip \
rsync libunwind8 \
python3-setuptools python3-numpy python3-wheel python python3-pip \
software-properties-common
g++

add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get update && apt-get install -y --no-install-recommends g++-7

locale-gen en_US.UTF-8
update-locale LANG=en_US.UTF-8
Expand Down