Unverified Commit 3f383e52 authored by Sang Ik Lee's avatar Sang Ik Lee Committed by GitHub

LLVM 9.0.1 (#4275)

* Code cleanup.

* Update LLVM to 9.0.1
Co-authored-by: 's avatarRobert Kimball <robert.kimball@intel.com>
Co-authored-by: 's avatarScott Cyphers <diyessi@users.noreply.github.com>
parent b6078c37
...@@ -28,26 +28,21 @@ if(NGRAPH_USE_PREBUILT_LLVM) ...@@ -28,26 +28,21 @@ if(NGRAPH_USE_PREBUILT_LLVM)
message(STATUS "LLVM: Using prebuilt LLVM") message(STATUS "LLVM: Using prebuilt LLVM")
# Override default LLVM binaries # Override default LLVM binaries
if(NOT DEFINED LLVM_TARBALL_URL) if(NOT DEFINED LLVM_TARBALL_URL)
set(NGRAPH_LLVM_VERSION 9.0.1)
if(APPLE) if(APPLE)
set(NGRAPH_LLVM_VERSION 8.0.0) set(LLVM_TARBALL_URL https://github.com/llvm/llvm-project/releases/download/llvmorg-${NGRAPH_LLVM_VERSION}/clang+llvm-${NGRAPH_LLVM_VERSION}-x86_64-apple-darwin.tar.xz)
set(LLVM_TARBALL_URL http://releases.llvm.org/${NGRAPH_LLVM_VERSION}/clang+llvm-${NGRAPH_LLVM_VERSION}-x86_64-apple-darwin.tar.xz) set(LLVM_SHA1_HASH 693e7c2d2fcd005f0d8198ea0174ae30ec78bb7c)
set(LLVM_SHA1_HASH a5674f2ce5b9ed1b67d92689d319ed3b46d66e29)
elseif(UNIX AND NOT APPLE) elseif(UNIX AND NOT APPLE)
set(NGRAPH_LLVM_VERSION 8.0.0)
if(EXISTS /etc/lsb-release) if(EXISTS /etc/lsb-release)
execute_process(COMMAND grep DISTRIB_RELEASE /etc/lsb-release OUTPUT_VARIABLE UBUNTU_VER_LINE) execute_process(COMMAND grep DISTRIB_RELEASE /etc/lsb-release OUTPUT_VARIABLE UBUNTU_VER_LINE)
string(REGEX MATCH "[0-9.]+" UBUNTU_VER ${UBUNTU_VER_LINE}) string(REGEX MATCH "[0-9.]+" UBUNTU_VERSION ${UBUNTU_VER_LINE})
message(STATUS "Ubuntu version: ${UBUNTU_VER} detected.") message(STATUS "Ubuntu version: ${UBUNTU_VERSION} detected.")
set(LLVM_TARBALL_URL http://releases.llvm.org/${NGRAPH_LLVM_VERSION}/clang+llvm-${NGRAPH_LLVM_VERSION}-x86_64-linux-gnu-ubuntu-${UBUNTU_VER}.tar.xz) if(UBUNTU_VERSION VERSION_LESS 16.04)
if(UBUNTU_VER MATCHES "14.04")
set(LLVM_SHA1_HASH 552ea458b70961b7922a4bbe9de1434688342dbf)
elseif(UBUNTU_VER MATCHES "16.04")
set(LLVM_SHA1_HASH 2be69be355b012ae206dbc0ea7d84b831d77dc27)
elseif(UBUNTU_VER MATCHES "18.04")
set(LLVM_SHA1_HASH 6aeb8aa0998d37be67d886b878f27de5e5ccc5e4)
else()
message(FATAL_ERROR "No prebuilt LLVM available for Ubuntu ${UBUNTU_VER} on llvm.org, please set LLVM_TARBALL_URL manually.") message(FATAL_ERROR "No prebuilt LLVM available for Ubuntu ${UBUNTU_VER} on llvm.org, please set LLVM_TARBALL_URL manually.")
else()
set(LLVM_SHA1_HASH 608285fb0503ee6d15ce9acb8f4575bba4d78e06)
endif() endif()
set(LLVM_TARBALL_URL https://github.com/llvm/llvm-project/releases/download/llvmorg-${NGRAPH_LLVM_VERSION}/clang+llvm-${NGRAPH_LLVM_VERSION}-x86_64-linux-gnu-ubuntu-16.04.tar.xz)
else() else()
message(FATAL_ERROR "Prebuilt LLVM: Only Ubuntu Linux is supported.") message(FATAL_ERROR "Prebuilt LLVM: Only Ubuntu Linux is supported.")
endif() endif()
...@@ -73,14 +68,14 @@ if(NGRAPH_USE_PREBUILT_LLVM) ...@@ -73,14 +68,14 @@ if(NGRAPH_USE_PREBUILT_LLVM)
INSTALL_COMMAND "" INSTALL_COMMAND ""
UPDATE_COMMAND "" UPDATE_COMMAND ""
SOURCE_DIR @LLVM_INSTALL_ROOT@ SOURCE_DIR @LLVM_INSTALL_ROOT@
DOWNLOAD_NO_PROGRESS TRUE DOWNLOAD_NO_PROGRESS OFF
) )
else() else()
message(STATUS "LLVM: Building LLVM from source") message(STATUS "LLVM: Building LLVM from source")
# Revert prior changes to make incremental build work. set(LLVM_GIT_REPOSITORY https://github.com/llvm/llvm-project.git)
set(LLVM_PATCH_REVERT_COMMAND cd @LLVM_PROJECT_ROOT@/llvm/src/ext_llvm && git reset HEAD --hard) set(LLVM_GIT_TAG llvmorg-9.0.1)
set(LLVM_CMAKE_ARGS @NGRAPH_FORWARD_CMAKE_ARGS@ set(LLVM_CMAKE_ARGS @NGRAPH_FORWARD_CMAKE_ARGS@
-DCMAKE_INSTALL_PREFIX=@LLVM_INSTALL_ROOT@ -DCMAKE_INSTALL_PREFIX=@LLVM_INSTALL_ROOT@
...@@ -103,40 +98,33 @@ else() ...@@ -103,40 +98,33 @@ else()
-DLLVM_ENABLE_PEDANTIC=OFF -DLLVM_ENABLE_PEDANTIC=OFF
-DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_OMPT_SUPPORT=OFF
-DCLANG_ENABLE_ARCMT=OFF -DCLANG_ENABLE_ARCMT=OFF
-DCLANG_ANALYZER_ENABLE_Z3_SOLVER=OFF
-DCLANG_ENABLE_STATIC_ANALYZER=OFF) -DCLANG_ENABLE_STATIC_ANALYZER=OFF)
if(${CMAKE_VERSION} VERSION_LESS 3.7) if(CMAKE_VERSION VERSION_LESS 3.7)
ExternalProject_Add( ExternalProject_Add(
ext_llvm ext_llvm
PREFIX llvm PREFIX llvm
GIT_REPOSITORY https://github.com/llvm/llvm-project.git GIT_REPOSITORY ${LLVM_GIT_REPOSITORY}
GIT_TAG llvmorg-8.0.0 GIT_TAG ${LLVM_GIT_TAG}
CMAKE_GENERATOR "${CMAKE_GENERATOR}" CMAKE_GENERATOR "${CMAKE_GENERATOR}"
CMAKE_GENERATOR_PLATFORM "${CMAKE_GENERATOR_PLATFORM}" CMAKE_GENERATOR_PLATFORM "${CMAKE_GENERATOR_PLATFORM}"
CMAKE_GENERATOR_TOOLSET "${CMAKE_GENERATOR_TOOLSET}" CMAKE_GENERATOR_TOOLSET "${CMAKE_GENERATOR_TOOLSET}"
UPDATE_COMMAND "" UPDATE_COMMAND ""
CONFIGURE_COMMAND ${CMAKE_COMMAND} ../ext_llvm/llvm -G "@CMAKE_GENERATOR@" -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM} -DCMAKE_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET} ${LLVM_CMAKE_ARGS} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} CONFIGURE_COMMAND ${CMAKE_COMMAND} ../ext_llvm/llvm -G "@CMAKE_GENERATOR@" -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM} -DCMAKE_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET} ${LLVM_CMAKE_ARGS} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
PATCH_COMMAND ${LLVM_PATCH_REVERT_COMMAND}
COMMAND git apply --ignore-space-change --ignore-whitespace @CMAKE_CURRENT_SOURCE_DIR@/cmake/llvm.patch
DOWNLOAD_NO_PROGRESS TRUE
) )
else() else()
ExternalProject_Add( ExternalProject_Add(
ext_llvm ext_llvm
PREFIX llvm PREFIX llvm
GIT_REPOSITORY https://github.com/llvm/llvm-project.git GIT_REPOSITORY ${LLVM_GIT_REPOSITORY}
GIT_TAG llvmorg-8.0.0 GIT_TAG ${LLVM_GIT_TAG}
GIT_SHALLOW 1 GIT_SHALLOW 1
CMAKE_GENERATOR "${CMAKE_GENERATOR}" CMAKE_GENERATOR "${CMAKE_GENERATOR}"
CMAKE_GENERATOR_PLATFORM "${CMAKE_GENERATOR_PLATFORM}" CMAKE_GENERATOR_PLATFORM "${CMAKE_GENERATOR_PLATFORM}"
CMAKE_GENERATOR_TOOLSET "${CMAKE_GENERATOR_TOOLSET}" CMAKE_GENERATOR_TOOLSET "${CMAKE_GENERATOR_TOOLSET}"
CMAKE_ARGS ${LLVM_CMAKE_ARGS} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} CMAKE_ARGS ${LLVM_CMAKE_ARGS} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
UPDATE_COMMAND "" UPDATE_COMMAND ""
PATCH_COMMAND ${LLVM_PATCH_REVERT_COMMAND}
COMMAND git apply --ignore-space-change --ignore-whitespace @CMAKE_CURRENT_SOURCE_DIR@/cmake/llvm.patch
SOURCE_SUBDIR llvm SOURCE_SUBDIR llvm
DOWNLOAD_NO_PROGRESS TRUE
) )
endif() endif()
endif() endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment