From ca5468b914a550bd00f8fabcd3e2e39d185a02db Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=A2=85=ED=98=84/On-Device=20Lab=28SR=29/Staff?= =?utf8?q?=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Thu, 10 Jan 2019 13:08:54 +0900 Subject: [PATCH] Introduce Abseil Source package (#2802) * Introduce Abseil Source package This commit introduces Abseil (C++) source package as a nncc external package. Signed-off-by: Jonghyun Park * Update comment --- CMakeLists.txt | 1 + cmake/packages/AbseilSourceConfig.cmake | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 cmake/packages/AbseilSourceConfig.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index fc03855..4459362 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,7 @@ option(DOWNLOAD_PYTORCH "Download Pytorch source" ON) # TODO: we need protoc version 2.6 and higher but server has 2.5 only # that's why we can't compile onnx.proto option(DOWNLOAD_ONNX "Download ONNX source" OFF) +option(DOWNLOAD_ABSEIL "Download Abseil-cpp source" ON) option(BUILD_GTEST "Download and build Google Test" ON) diff --git a/cmake/packages/AbseilSourceConfig.cmake b/cmake/packages/AbseilSourceConfig.cmake new file mode 100644 index 0000000..d980ac6 --- /dev/null +++ b/cmake/packages/AbseilSourceConfig.cmake @@ -0,0 +1,24 @@ +function(_AbseilSource_import) + if(NOT DOWNLOAD_ABSEIL) + set(AbseilSource_FOUND FALSE PARENT_SCOPE) + return() + endif(NOT DOWNLOAD_ABSEIL) + + nncc_include(ExternalSourceTools) + nncc_include(OptionTools) + + # NOTE TensorFlow 1.12 downloads abseil from the following URL + # - https://github.com/abseil/abseil-cpp/archive/48cd2c3f351ff188bc85684b84a91b6e6d17d896.tar.gz + # + # The last change of "48cd2c3f351" was commited on 2018.09.27 + # + # Let's use the latest released version (2018-12 release) + envoption(ABSEIL_URL https://github.com/abseil/abseil-cpp/archive/20181200.tar.gz) + + ExternalSource_Download(ABSEIL ${ABSEIL_URL}) + + set(AbseilSource_DIR ${ABSEIL_SOURCE_DIR} PARENT_SCOPE) + set(AbseilSource_FOUND TRUE PARENT_SCOPE) +endfunction(_AbseilSource_import) + +_AbseilSource_import() -- 2.7.4