]>
Commit | Line | Data |
---|---|---|
c7dfe9a1 | 1 | |
ac26e2aa | 2 | # requires the OpenCL patches |
15cf855e JK |
3 | %define llvm_version 7.0.1 |
4 | %define llvm_rpm_version %{llvm_version}-3 | |
ac26e2aa | 5 | |
c7dfe9a1 JK |
6 | %define spirv_llvm_translator_version 7.0.1 |
7 | ||
8 | Summary: Intel Graphics Compute Runtime for OpenCL | |
9 | Name: opencl-clang | |
10 | Version: 8.0.1 | |
11 | Release: 1 | |
12 | License: University of Illinois/NCSA Open Source License | |
13 | Group: Libraries | |
14 | Source0: https://github.com/intel/opencl-clang/archive/v%{version}/%{name}-%{version}.tar.gz | |
15 | # Source0-md5: cb6b746c837a6cac6c8906911b2ea9de | |
16 | Patch0: llvm_clang_vfs.patch | |
17 | URL: https://01.org/compute-runtime | |
eac18d9c | 18 | BuildRequires: SPIRV-LLVM-Translator-devel >= %{spirv_llvm_translator_version} |
15cf855e JK |
19 | BuildRequires: clang >= %{llvm_rpm_version} |
20 | BuildRequires: clang-devel >= %{llvm_rpm_version} | |
c7dfe9a1 | 21 | BuildRequires: cmake >= 3.4.3 |
15cf855e | 22 | BuildRequires: llvm-devel >= %{llvm_rpm_version} |
c7dfe9a1 | 23 | BuildRequires: pkgconfig |
c7dfe9a1 JK |
24 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
25 | ||
26 | %description | |
27 | Common clang is a thin wrapper library around clang. Common clang has | |
28 | OpenCL-oriented API and is capable to compile OpenCL C kernels to | |
29 | SPIR-V modules. | |
30 | ||
31 | %package devel | |
32 | Summary: Header files for %{name} library | |
33 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki %{name} | |
34 | Group: Development/Libraries | |
15cf855e | 35 | %requires_eq clang-devel |
c7dfe9a1 JK |
36 | Requires: %{name} = %{version}-%{release} |
37 | ||
38 | %description devel | |
39 | Header files for %{name} library. | |
40 | ||
41 | %description devel -l pl.UTF-8 | |
42 | Pliki nagłówkowe biblioteki %{name}. | |
43 | ||
44 | %prep | |
45 | %setup -q | |
46 | ||
47 | %patch0 -p1 | |
48 | ||
49 | %build | |
50 | install -d build | |
51 | cd build | |
52 | %cmake \ | |
53 | -DUSE_PREBUILT_LLVM=ON \ | |
54 | -DPREFERRED_LLVM_VERSION="%{llvm_version}" \ | |
55 | -DLLVMSPIRV_INCLUDED_IN_LLVM=OFF \ | |
56 | -DSPIRV_TRANSLATOR_DIR="%{_prefix}" \ | |
0a767a56 | 57 | -DGIT_EXECUTABLE=/bin/false \ |
c7dfe9a1 JK |
58 | ../ |
59 | %{__make} | |
60 | ||
61 | cd .. | |
62 | ||
63 | %install | |
64 | rm -rf $RPM_BUILD_ROOT | |
65 | ||
66 | %{__make} -C build install \ | |
67 | DESTDIR=$RPM_BUILD_ROOT | |
68 | ||
69 | mv $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.7 $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.%{llvm_version} | |
70 | ln -s libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so.7 | |
71 | ln -sf libopencl-clang.so.%{llvm_version} $RPM_BUILD_ROOT%{_libdir}/libopencl-clang.so | |
72 | ||
73 | %post -p /sbin/ldconfig | |
74 | %postun -p /sbin/ldconfig | |
75 | ||
76 | %clean | |
77 | rm -rf $RPM_BUILD_ROOT | |
78 | ||
79 | %files | |
80 | %defattr(644,root,root,755) | |
81 | %doc README.md | |
82 | %attr(755,root,root) %{_libdir}/libopencl-clang.so.%{llvm_version} | |
83 | %ghost %attr(755,root,root) %{_libdir}/libopencl-clang.so.7 | |
84 | ||
85 | %files devel | |
86 | %defattr(644,root,root,755) | |
87 | %attr(755,root,root) %{_libdir}/libopencl-clang.so | |
88 | %{_includedir}/cclang |