Update LLVM_SRC, LLVM_BUILD env vars to LLVM_PROJ_SRC, LLVM_PROJ_BUILD since MLIR is now parallel to LLVM in llvm-project repository.
This commit is contained in:
parent
56e8c4c147
commit
38e7d2d068
|
@ -33,7 +33,7 @@ jobs:
|
||||||
name: Install ONNF
|
name: Install ONNF
|
||||||
command: |
|
command: |
|
||||||
mkdir build && cd build
|
mkdir build && cd build
|
||||||
LLVM_SRC=$(pwd)/../llvm-project/llvm LLVM_BUILD=$(pwd)/../llvm-project/build cmake ..
|
LLVM_PROJ_SRC=$(pwd)/../llvm-project/ LLVM_PROJ_BUILD=$(pwd)/../llvm-project/build cmake ..
|
||||||
make all
|
make all
|
||||||
LIT_OPTS=-v make check-mlir-lit
|
LIT_OPTS=-v make check-mlir-lit
|
||||||
- run:
|
- run:
|
||||||
|
|
46
MLIR.cmake
46
MLIR.cmake
|
@ -1,38 +1,38 @@
|
||||||
# Path to LLVM source folder.
|
# Path to LLVM source folder.
|
||||||
if(DEFINED ENV{LLVM_SRC})
|
if(DEFINED ENV{LLVM_PROJ_SRC})
|
||||||
set(LLVM_SRC $ENV{LLVM_SRC})
|
set(LLVM_PROJ_SRC $ENV{LLVM_PROJ_SRC})
|
||||||
if(EXISTS ${LLVM_SRC})
|
if(EXISTS ${LLVM_PROJ_SRC})
|
||||||
message(STATUS "LLVM_SRC " ${LLVM_SRC})
|
message(STATUS "LLVM_PROJ_SRC " ${LLVM_PROJ_SRC})
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "The path specified by LLVM_SRC does not exist: "
|
message(FATAL_ERROR "The path specified by LLVM_PROJ_SRC does not exist: "
|
||||||
${LLVM_SRC})
|
${LLVM_PROJ_SRC})
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "env variable LLVM_SRC not set")
|
message(FATAL_ERROR "env variable LLVM_PROJ_SRC not set")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Path to LLVM build folder
|
# Path to LLVM build folder
|
||||||
if(DEFINED ENV{LLVM_BUILD})
|
if(DEFINED ENV{LLVM_PROJ_BUILD})
|
||||||
set(LLVM_BUILD $ENV{LLVM_BUILD})
|
set(LLVM_PROJ_BUILD $ENV{LLVM_PROJ_BUILD})
|
||||||
if(EXISTS ${LLVM_BUILD})
|
if(EXISTS ${LLVM_PROJ_BUILD})
|
||||||
message(STATUS "LLVM_BUILD " ${LLVM_BUILD})
|
message(STATUS "LLVM_PROJ_BUILD " ${LLVM_PROJ_BUILD})
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "The path specified by LLVM_BUILD does not exist: "
|
message(FATAL_ERROR "The path specified by LLVM_PROJ_BUILD does not exist: "
|
||||||
${LLVM_BUILD})
|
${LLVM_PROJ_BUILD})
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "env variable LLVM_BUILD not set")
|
message(FATAL_ERROR "env variable LLVM_PROJ_BUILD not set")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# LLVM project lib folder
|
# LLVM project lib folder
|
||||||
set(LLVM_PROJECT_LIB ${LLVM_BUILD}/lib)
|
set(LLVM_PROJECT_LIB ${LLVM_PROJ_BUILD}/lib)
|
||||||
|
|
||||||
# Include paths for MLIR
|
# Include paths for MLIR
|
||||||
set(LLVM_SRC_INCLUDE_PATH ${LLVM_SRC}/include)
|
set(LLVM_SRC_INCLUDE_PATH ${LLVM_PROJ_SRC}/llvm/include)
|
||||||
set(LLVM_BIN_INCLUDE_PATH ${LLVM_BUILD}/include)
|
set(LLVM_BIN_INCLUDE_PATH ${LLVM_PROJ_BUILD}/include)
|
||||||
set(MLIR_SRC_INCLUDE_PATH ${LLVM_SRC}/../mlir/include)
|
set(MLIR_SRC_INCLUDE_PATH ${LLVM_PROJ_SRC}/mlir/include)
|
||||||
set(MLIR_BIN_INCLUDE_PATH ${LLVM_BUILD}/tools/mlir/include)
|
set(MLIR_BIN_INCLUDE_PATH ${LLVM_PROJ_BUILD}/tools/mlir/include)
|
||||||
set(MLIR_TOOLS_DIR ${LLVM_BUILD}/bin)
|
set(MLIR_TOOLS_DIR ${LLVM_PROJ_BUILD}/bin)
|
||||||
|
|
||||||
set(ONNF_TOOLS_DIR ${ONNF_BIN_ROOT}/bin)
|
set(ONNF_TOOLS_DIR ${ONNF_BIN_ROOT}/bin)
|
||||||
set(ONNF_LIT_TEST_SRC_DIR ${CMAKE_SOURCE_DIR}/test/mlir)
|
set(ONNF_LIT_TEST_SRC_DIR ${CMAKE_SOURCE_DIR}/test/mlir)
|
||||||
|
@ -173,7 +173,7 @@ function(whole_archive_link target lib_dir)
|
||||||
endfunction(whole_archive_link)
|
endfunction(whole_archive_link)
|
||||||
|
|
||||||
function(whole_archive_link_mlir target)
|
function(whole_archive_link_mlir target)
|
||||||
whole_archive_link(${target} ${LLVM_BUILD}/lib ${ARGN})
|
whole_archive_link(${target} ${LLVM_PROJ_BUILD}/lib ${ARGN})
|
||||||
endfunction(whole_archive_link_mlir)
|
endfunction(whole_archive_link_mlir)
|
||||||
|
|
||||||
function(whole_archive_link_onnf target)
|
function(whole_archive_link_onnf target)
|
||||||
|
@ -184,7 +184,7 @@ function(whole_archive_link_onnf target)
|
||||||
endfunction(whole_archive_link_onnf)
|
endfunction(whole_archive_link_onnf)
|
||||||
|
|
||||||
set(LLVM_CMAKE_DIR
|
set(LLVM_CMAKE_DIR
|
||||||
"${LLVM_BUILD}/lib/cmake/llvm"
|
"${LLVM_PROJ_BUILD}/lib/cmake/llvm"
|
||||||
CACHE PATH "Path to LLVM cmake modules")
|
CACHE PATH "Path to LLVM cmake modules")
|
||||||
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
|
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
|
||||||
include(AddLLVM)
|
include(AddLLVM)
|
||||||
|
@ -205,5 +205,5 @@ endfunction()
|
||||||
# table gen utility itself can be detected and cause re-compilation of .td file.
|
# table gen utility itself can be detected and cause re-compilation of .td file.
|
||||||
add_executable(mlir-tblgen IMPORTED)
|
add_executable(mlir-tblgen IMPORTED)
|
||||||
set_property(TARGET mlir-tblgen
|
set_property(TARGET mlir-tblgen
|
||||||
PROPERTY IMPORTED_LOCATION ${LLVM_BUILD}/bin/mlir-tblgen)
|
PROPERTY IMPORTED_LOCATION ${LLVM_PROJ_BUILD}/bin/mlir-tblgen)
|
||||||
set(MLIR_TABLEGEN_EXE mlir-tblgen)
|
set(MLIR_TABLEGEN_EXE mlir-tblgen)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
set(LLVM_LIT ${LLVM_SRC}/utils/lit/lit.py)
|
set(LLVM_LIT ${LLVM_PROJ_SRC}/utils/lit/lit.py)
|
||||||
set(LLVM_DEFAULT_EXTERNAL_LIT ${LLVM_BUILD}/bin/llvm-lit)
|
set(LLVM_DEFAULT_EXTERNAL_LIT ${LLVM_PROJ_BUILD}/bin/llvm-lit)
|
||||||
|
|
||||||
configure_lit_site_cfg(${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
|
configure_lit_site_cfg(${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
|
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import lit.llvm
|
import lit.llvm
|
||||||
|
|
||||||
config.llvm_tools_dir = "@MLIR_TOOLS_DIR@"
|
config.llvm_tools_dir = "@MLIR_TOOLS_DIR@"
|
||||||
config.mlir_obj_root = "@LLVM_BUILD@"
|
config.mlir_obj_root = "@LLVM_PROJ_BUILD@"
|
||||||
config.mlir_tools_dir = "@MLIR_TOOLS_DIR@"
|
config.mlir_tools_dir = "@MLIR_TOOLS_DIR@"
|
||||||
config.suffixes = ['.mlir']
|
config.suffixes = ['.mlir']
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue