%global commit aab71d44431eabfb65fbbc8a2930cb6d34b7e2be %global shortcommit %(c=%{commit}; echo ${c:0:9}) %global shortname clc # this stop us generating an empty debuginfo %global debug_package %{nil} Name: libclc Version: 0.2.0 Release: 100.50.git%{shortcommit}%{?dist} Summary: An open source implementation of the OpenCL 1.1 library requirements License: BSD URL: https://libclc.llvm.org Source0: %{name}-%{shortcommit}.tar.xz #Patch0: %{name}-pkgconfig.patch ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 %{power64} s390x BuildRequires: clang-devel BuildRequires: libedit-devel BuildRequires: llvm-devel >= 3.9 BuildRequires: python BuildRequires: zlib-devel BuildRequires: cmake BuildRequires: ninja-build BuildRequires: spirv-llvm-translator-tools %description libclc is an open source, BSD licensed implementation of the library requirements of the OpenCL C programming language, as specified by the OpenCL 1.1 Specification. The following sections of the specification impose library requirements: * 6.1: Supported Data Types * 6.2.3: Explicit Conversions * 6.2.4.2: Reinterpreting Types Using as_type() and as_typen() * 6.9: Preprocessor Directives and Macros * 6.11: Built-in Functions * 9.3: Double Precision Floating-Point * 9.4: 64-bit Atomics * 9.5: Writing to 3D image memory objects * 9.6: Half Precision Floating-Point libclc is intended to be used with the Clang compiler's OpenCL frontend. libclc is designed to be portable and extensible. To this end, it provides generic implementations of most library requirements, allowing the target to override the generic implementation at the granularity of individual functions. libclc currently only supports the PTX target, but support for more targets is welcome. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %prep %setup -q -n %{name}-%{shortcommit} #%patch0 -p0 %build export CFLAGS="%{build_cflags} -D__extern_always_inline=inline" %set_build_flags #./configure.py --prefix=%{_prefix} --libexecdir=%{_libdir}/%{shortname}/ --pkgconfigdir=%{_libdir}/pkgconfig/ %cmake -B "%{_vpath_builddir}" \ -G Ninja \ -DCMAKE_INSTALL_INCLUDEDIR:PATH=%{_includedir} \ -DCMAKE_INSTALL_DATADIR:PATH=%{_libdir} %ninja_build -C "%{_vpath_builddir}" %install %ninja_install -C "%{_vpath_builddir}" %files %license LICENSE.TXT %doc README.TXT CREDITS.TXT %dir %{_libdir}/%{shortname} %{_libdir}/%{shortname}/*.bc %{_libdir}/%{shortname}/*.spv %{_includedir}/%{shortname} %files devel %{_libdir}/pkgconfig/%{name}.pc %changelog