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