Compare commits
24 Commits
rawhide
...
upstream-s
Author | SHA1 | Date | |
---|---|---|---|
|
3639bf06ad | ||
|
21dcbdc5c0 | ||
|
cde76c9b71 | ||
|
4fd2cd92f2 | ||
|
ffa51889d6 | ||
|
eb45f0184d | ||
|
6ca803a724 | ||
|
af708a994a | ||
|
94fd503d9b | ||
|
b92cae125c | ||
|
d65bfa0df9 | ||
|
6035ad5de6 | ||
|
9e1f5c77ca | ||
|
ed32b03ec2 | ||
|
02f2d0a98e | ||
|
8c653b19bc | ||
|
c106106640 | ||
|
a51d8dd1ec | ||
|
9ce56d7a3a | ||
|
ea89ebd8a1 | ||
|
02cd378529 | ||
|
21aa7fd0e7 | ||
|
77f0956b39 | ||
|
618c8b1979 |
13
.copr/Makefile
Normal file
13
.copr/Makefile
Normal file
@ -0,0 +1,13 @@
|
||||
# See https://docs.pagure.org/copr.copr/user_documentation.html#make-srpm
|
||||
# See for the --setopt option in the enabling of copr repo see:
|
||||
# https://pagure.io/copr/copr/issue/184
|
||||
.PHONY: srpm
|
||||
srpm:
|
||||
dnf install -y dnf-plugins-core fedora-packager
|
||||
dnf copr enable -y --setopt=reposdir=/tmp/yum.repos.d @fedora-llvm-team/llvm-snapshot-builder
|
||||
dnf install -y --setopt=reposdir=/tmp/yum.repos.d llvm-snapshot-builder
|
||||
rpmbuild \
|
||||
--define "_srcrpmdir $(outdir)" \
|
||||
--define "_sourcedir $(shell pwd)" \
|
||||
--define "_disable_source_fetch 0" \
|
||||
-bs $(spec)
|
@ -1,134 +0,0 @@
|
||||
From 9deba96d8f15d948e92c49e40a671fbedc328457 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@moritz.systems>
|
||||
Date: Tue, 2 Feb 2021 13:09:45 -0600
|
||||
Subject: [PATCH 1/2] [PATCH][mlir] Support building MLIR standalone
|
||||
|
||||
Add the necessary bits to CMakeLists to make it possible to configure
|
||||
MLIR against installed LLVM, and build it with minimal need for LLVM
|
||||
source tree. The latter is only necessary to run unittests, and if it
|
||||
is missing then unittests are skipped with a warning.
|
||||
|
||||
This change includes the necessary changes to tests, in particular
|
||||
adding some missing substitutions and defining missing variables
|
||||
for lit.site.cfg.py substitution.
|
||||
|
||||
Reviewed By: stephenneuendorffer
|
||||
|
||||
Differential Revision: https://reviews.llvm.org/D85464
|
||||
|
||||
Co-authored-by: Isuru Fernando <isuruf@gmail.com>
|
||||
---
|
||||
mlir/CMakeLists.txt | 33 ++++++++++++++++++++++++++++++++-
|
||||
mlir/cmake/modules/AddMLIR.cmake | 1 +
|
||||
mlir/test/CMakeLists.txt | 5 ++++-
|
||||
mlir/test/lit.cfg.py | 4 ++++
|
||||
4 files changed, 41 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
|
||||
index cbae5fd..baacbdd3 100644
|
||||
--- a/mlir/CMakeLists.txt
|
||||
+++ b/mlir/CMakeLists.txt
|
||||
@@ -1,10 +1,37 @@
|
||||
# MLIR project.
|
||||
+
|
||||
+# Check if MLIR is built as a standalone project.
|
||||
+if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||
+ project(mlir)
|
||||
+ cmake_minimum_required(VERSION 3.13.4)
|
||||
+
|
||||
+ find_package(LLVM CONFIG REQUIRED)
|
||||
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR})
|
||||
+ include(HandleLLVMOptions)
|
||||
+ include(AddLLVM)
|
||||
+ include(TableGen)
|
||||
+
|
||||
+ include_directories(${LLVM_INCLUDE_DIRS})
|
||||
+
|
||||
+ set(LLVM_MAIN_SRC_DIR ${CMAKE_SOURCE_DIR}/../llvm CACHE PATH
|
||||
+ "Path to LLVM source tree")
|
||||
+ set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
|
||||
+ if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h)
|
||||
+ add_subdirectory(${UNITTEST_DIR} utils/unittest)
|
||||
+ endif()
|
||||
+
|
||||
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY
|
||||
+ "${CMAKE_CURRENT_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}")
|
||||
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
|
||||
+endif()
|
||||
+
|
||||
set(MLIR_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
set(MLIR_MAIN_INCLUDE_DIR ${MLIR_MAIN_SRC_DIR}/include )
|
||||
|
||||
set(MLIR_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(MLIR_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
||||
set(MLIR_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/include)
|
||||
+set(MLIR_TOOLS_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
|
||||
|
||||
@@ -106,7 +133,11 @@ add_subdirectory(lib)
|
||||
add_subdirectory(lib/CAPI)
|
||||
if (MLIR_INCLUDE_TESTS)
|
||||
add_definitions(-DMLIR_INCLUDE_TESTS)
|
||||
- add_subdirectory(unittests)
|
||||
+ if (TARGET gtest)
|
||||
+ add_subdirectory(unittests)
|
||||
+ else()
|
||||
+ message(WARNING "gtest not found, unittests will not be available")
|
||||
+ endif()
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
if (MLIR_INCLUDE_INTEGRATION_TESTS)
|
||||
diff --git a/mlir/cmake/modules/AddMLIR.cmake b/mlir/cmake/modules/AddMLIR.cmake
|
||||
index 4cfd351..4a814ea 100644
|
||||
--- a/mlir/cmake/modules/AddMLIR.cmake
|
||||
+++ b/mlir/cmake/modules/AddMLIR.cmake
|
||||
@@ -2,6 +2,7 @@ function(mlir_tablegen ofn)
|
||||
tablegen(MLIR ${ARGV})
|
||||
set(TABLEGEN_OUTPUT ${TABLEGEN_OUTPUT} ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
|
||||
PARENT_SCOPE)
|
||||
+ include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
endfunction()
|
||||
|
||||
# Declare a dialect in the include directory
|
||||
diff --git a/mlir/test/CMakeLists.txt b/mlir/test/CMakeLists.txt
|
||||
index 293d932..5feedd5 100644
|
||||
--- a/mlir/test/CMakeLists.txt
|
||||
+++ b/mlir/test/CMakeLists.txt
|
||||
@@ -43,7 +43,6 @@ configure_lit_site_cfg(
|
||||
|
||||
set(MLIR_TEST_DEPENDS
|
||||
FileCheck count not
|
||||
- MLIRUnitTests
|
||||
mlir-capi-ir-test
|
||||
mlir-capi-pass-test
|
||||
mlir-cpu-runner
|
||||
@@ -61,6 +60,10 @@ set(MLIR_TEST_DEPENDS
|
||||
mlir_async_runtime
|
||||
)
|
||||
|
||||
+if(TARGET gtest)
|
||||
+ list(APPEND MLIR_TEST_DEPENDS MLIRUnitTests)
|
||||
+endif()
|
||||
+
|
||||
if(LLVM_BUILD_EXAMPLES)
|
||||
list(APPEND MLIR_TEST_DEPENDS
|
||||
toyc-ch1
|
||||
diff --git a/mlir/test/lit.cfg.py b/mlir/test/lit.cfg.py
|
||||
index 482513b..bff47851 100644
|
||||
--- a/mlir/test/lit.cfg.py
|
||||
+++ b/mlir/test/lit.cfg.py
|
||||
@@ -61,6 +61,10 @@ tools = [
|
||||
'mlir-capi-ir-test',
|
||||
'mlir-capi-pass-test',
|
||||
'mlir-edsc-builder-api-test',
|
||||
+ 'mlir-cpu-runner',
|
||||
+ 'mlir-linalg-ods-gen',
|
||||
+ 'mlir-reduce',
|
||||
+ 'mlir-sdbm-api-test',
|
||||
]
|
||||
|
||||
# The following tools are optional
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -1,28 +0,0 @@
|
||||
From e09b298273994b20cc8747765a567d716e241fd2 Mon Sep 17 00:00:00 2001
|
||||
From: Isuru Fernando <isuruf@gmail.com>
|
||||
Date: Thu, 4 Feb 2021 01:59:08 +0000
|
||||
Subject: [PATCH 2/2] [PATCH][mlir] Fix building unittests in in-tree build
|
||||
|
||||
Reviewed By: mehdi_amini
|
||||
|
||||
Differential Revision: https://reviews.llvm.org/D95978
|
||||
---
|
||||
mlir/CMakeLists.txt | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
|
||||
index baacbdd3..5d21312 100644
|
||||
--- a/mlir/CMakeLists.txt
|
||||
+++ b/mlir/CMakeLists.txt
|
||||
@@ -133,7 +133,7 @@ add_subdirectory(lib)
|
||||
add_subdirectory(lib/CAPI)
|
||||
if (MLIR_INCLUDE_TESTS)
|
||||
add_definitions(-DMLIR_INCLUDE_TESTS)
|
||||
- if (TARGET gtest)
|
||||
+ if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include/gtest/gtest.h)
|
||||
add_subdirectory(unittests)
|
||||
else()
|
||||
message(WARNING "gtest not found, unittests will not be available")
|
||||
--
|
||||
1.8.3.1
|
||||
|
58
mlir.spec
58
mlir.spec
@ -1,3 +1,11 @@
|
||||
%bcond_without snapshot_build
|
||||
|
||||
%if %{with snapshot_build}
|
||||
# Unlock LLVM Snapshot LUA functions
|
||||
%{llvm_sb_verbose}
|
||||
%{llvm_sb}
|
||||
%endif
|
||||
|
||||
#global rc_ver 3
|
||||
%global maj_ver 13
|
||||
%global min_ver 0
|
||||
@ -5,19 +13,30 @@
|
||||
%global mlir_version %{maj_ver}.%{min_ver}.%{patch_ver}
|
||||
%global mlir_srcdir llvm-project-%{mlir_version}%{?rc_ver:rc%{rc_ver}}.src
|
||||
|
||||
%if %{with snapshot_build}
|
||||
%undefine rc_ver
|
||||
%global maj_ver %{llvm_snapshot_version_major}
|
||||
%global min_ver %{llvm_snapshot_version_minor}
|
||||
%global patch_ver %{llvm_snapshot_version_patch}
|
||||
%global mlir_version %{llvm_snapshot_version_major}.%{llvm_snapshot_version_minor}.%{llvm_snapshot_version_patch}
|
||||
%global mlir_srcdir llvm-project-%{llvm_snapshot_version_major}.%{llvm_snapshot_version_minor}.%{llvm_snapshot_version_patch}.src
|
||||
%endif
|
||||
|
||||
Name: mlir
|
||||
Version: %{mlir_version}%{?rc_ver:~rc%{rc_ver}}
|
||||
Release: 2%{?dist}
|
||||
Version: %{mlir_version}%{?rc_ver:~rc%{rc_ver}}%{?llvm_snapshot_version_suffix:~%{llvm_snapshot_version_suffix}}
|
||||
Release: 1%{?dist}
|
||||
Summary: Multi-Level Intermediate Representation Overview
|
||||
|
||||
License: ASL 2.0 with exceptions
|
||||
URL: http://mlir.llvm.org
|
||||
%if %{with snapshot_build}
|
||||
Source0: %{llvm_snapshot_source_prefix}llvm-project-%{llvm_snapshot_yyyymmdd}.src.tar.xz
|
||||
%{llvm_snapshot_extra_source_tags}
|
||||
%else
|
||||
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{mlir_srcdir}.tar.xz
|
||||
Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{mlir_srcdir}.tar.xz.sig
|
||||
Source2: tstellar-gpg-key.asc
|
||||
|
||||
#Patch0: 0001-PATCH-mlir-Support-building-MLIR-standalone.patch
|
||||
#Patch1: 0002-PATCH-mlir-Fix-building-unittests-in-in-tree-build.patch
|
||||
%endif
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gcc-c++
|
||||
@ -51,13 +70,18 @@ Requires: %{name}-static%{?_isa} = %{version}-%{release}
|
||||
MLIR development files.
|
||||
|
||||
%prep
|
||||
%if %{without snapshot_build}
|
||||
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
|
||||
%endif
|
||||
%autosetup -n %{mlir_srcdir}/%{name} -p2
|
||||
# remove all but keep mlir
|
||||
find ../* -maxdepth 0 ! -name '%{name}' -exec rm -rf {} +
|
||||
|
||||
|
||||
%build
|
||||
# Test if we can default DWARF4 instead of 5
|
||||
%global optflags %(echo %{optflags} " -gdwarf-4 ")
|
||||
|
||||
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_SKIP_RPATH=ON \
|
||||
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
|
||||
@ -66,6 +90,11 @@ find ../* -maxdepth 0 ! -name '%{name}' -exec rm -rf {} +
|
||||
-DLLVM_BUILD_UTILS:BOOL=ON \
|
||||
-DMLIR_INCLUDE_DOCS:BOOL=ON \
|
||||
-DMLIR_INCLUDE_TESTS:BOOL=OFF \
|
||||
\
|
||||
%if %{with snapshot_build}
|
||||
-DLLVM_VERSION_SUFFIX="%{llvm_snapshot_version_suffix}" \
|
||||
%endif
|
||||
\
|
||||
-DMLIR_INCLUDE_INTEGRATION_TESTS:BOOL=OFF \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
%if 0%{?__isa_bits} == 64
|
||||
@ -77,35 +106,50 @@ find ../* -maxdepth 0 ! -name '%{name}' -exec rm -rf {} +
|
||||
export LD_LIBRARY_PATH=%{_builddir}/%{mlir_srcdir}/%{name}/%{_build}/%{_lib}
|
||||
%cmake_build
|
||||
|
||||
|
||||
%install
|
||||
%cmake_install
|
||||
|
||||
%check
|
||||
%if %{with check}
|
||||
# build process .exe tools normally use rpath or static linkage
|
||||
%cmake_build --target check-mlir || true
|
||||
%endif
|
||||
|
||||
%files
|
||||
%license LICENSE.TXT
|
||||
%if %{without snapshot_build}
|
||||
%{_libdir}/libmlir_runner_utils.so.%{maj_ver}*
|
||||
%{_libdir}/libmlir_c_runner_utils.so.%{maj_ver}*
|
||||
%{_libdir}/libmlir_async_runtime.so.%{maj_ver}*
|
||||
%endif
|
||||
%{_libdir}/libMLIR*.so.%{maj_ver}*
|
||||
|
||||
%files static
|
||||
%{_libdir}/libMLIR*.a
|
||||
|
||||
%if %{without snapshot_build}
|
||||
# This file is not longer there as a when building snapshots.
|
||||
# Only these exist: libmlir_c_runner_utils.so libmlir_c_runner_utils.so.13
|
||||
%{_libdir}/libmlir_c_runner_utils_static.a
|
||||
%{_libdir}/objects-RelWithDebInfo/obj.MLIRCEXECUTIONENGINE*
|
||||
%endif
|
||||
|
||||
%{_libdir}/objects-RelWithDebInfo/obj.MLIRCAPI*
|
||||
|
||||
%files devel
|
||||
%{_bindir}/mlir-tblgen
|
||||
%{_libdir}/libMLIR*.so
|
||||
%if %{without snapshot_build}
|
||||
%{_libdir}/libmlir_runner_utils.so
|
||||
%{_libdir}/libmlir_c_runner_utils.so
|
||||
%{_libdir}//libmlir_async_runtime.so
|
||||
%{_libdir}/libmlir_async_runtime.so
|
||||
%endif
|
||||
%{_includedir}/mlir
|
||||
%{_includedir}/mlir-c
|
||||
%{_libdir}/cmake/mlir
|
||||
|
||||
%changelog
|
||||
%{?llvm_snapshot_changelog_entry}
|
||||
* Mon Feb 07 2022 Nikita Popov <npopov@redhat.com> - 13.0.1-2
|
||||
- Reenable build on armv7hl
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user