%global sover 1
Summary: Portable Computing Language - an OpenCL implementation
Name: pocl
Version: 0.13
Release: 7%{?dist}
# The whole code is under MIT
# except include/utlist.h which is under BSD (and unbundled) and
# except lib/kernel/vecmath which is under GPLv3+ or LGPLv3+ (and unbundled in future)
License: MIT and BSD and (GPLv3+ or LGPLv3+)
URL: http://pocl.sourceforge.net
Source0: http://downloads.sourceforge.net/project/pocl/%{name}-%{version}.tar.gz
# https://github.com/pocl/pocl/issues/318#issuecomment-205864382
Patch0: i686-fix.patch
# aarch64 seems to have a build system problem that makes it pass -march=(unknown).
# ppc64 builds fine, but: 41% tests passed, 64 tests failed out of 108.
# ppc64le fails with compilation errors.
# s390(x) clang build still seems to be suffering from bug 1309055.
ExcludeArch: aarch64 ppc64 ppc64le s390 s390x
BuildRequires: cmake
BuildRequires: clang clang-devel
BuildRequires: llvm llvm-devel
BuildRequires: hwloc-devel
BuildRequires: libtool
BuildRequires: libtool-ltdl-devel
BuildRequires: mesa-libGL-devel
BuildRequires: mesa-libEGL-devel
BuildRequires: ocl-icd-devel
BuildRequires: uthash-devel
BuildRequires: zlib-devel
BuildRequires: libedit-devel
BuildRequires: glew-devel
#BuildRequires: vecmath-devel
%description
Pocl's goal is to become an efficient open source (MIT-licensed) implementation
of the OpenCL 1.2 (and soon OpenCL 2.0) standard.
In addition to producing an easily portable open-source OpenCL implementation,
another major goal of this project is improving performance portability of
OpenCL programs with compiler optimizations, reducing the need for
target-dependent manual optimizations.
At the core of pocl is the kernel compiler that consists of a set of LLVM
passes used to statically transform kernels into work-group functions with
multiple work-items, even in the presence of work-group barriers. These
functions are suitable for parallelization in multiple ways (SIMD, VLIW,
superscalar,...).
%package devel
Summary: Portable Computing Language development files
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: ocl-icd-devel%{?_isa}
Requires: clang%{?_isa}
Requires: opencl-filesystem
Requires: uthash-devel
Requires: libstdc++-devel%{?_isa}
# Runtime dependency, because libm.so is required for kernels
Requires: glibc-devel%{?_isa}
%description devel
Portable Computing Language development files.
%prep
%autosetup -p1
# Unbundle uthash
find . -depth -name utlist* | xargs rm -f
mkdir build/
%build
pushd build
%cmake ../ \
-DENABLE_ICD=1 \
-DEXTRA_KERNEL_CXX_FLAGS="%{optflags} -std=c++11" \
%ifarch %{ix86} x86_64
-DKERNELLIB_HOST_CPU_VARIANTS=distro
%endif
# -DENABLE_TESTSUITES=all Requires clBLAS
%make_build
popd
%install
pushd build
%make_install
popd
# Unbundle vecmath
#rm -vf %%{buildroot}/%%{_libdir}/pocl/vecmath/
#ln -vs %%{_includedir}/vecmath %%{buildroot}/%%{_libdir}/pocl/vecmath
# <visit0r> but you need to run the .py to generate the files under the pocl dir
# https://github.com/pocl/pocl/issues/369
echo lib%{name}.so.%{sover} > %{buildroot}%{_sysconfdir}/OpenCL/vendors/%{name}.icd
chmod +x %{buildroot}%{_bindir}/%{name}-standalone
%check
pushd build
# https://github.com/pocl/pocl/issues/318
ctest -VV --output-on-failure \
%ifarch %{ix86}
|| :
%else
;
%endif
popd
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%doc README doc/sphinx/source/*.rst
%{_sysconfdir}/OpenCL/vendors/%{name}.icd
%{_libdir}/lib%{name}.so.%{sover}*
%{_libdir}/lib%{name}u.so.%{sover}*
%files devel
%{_bindir}/%{name}-standalone
%{_libdir}/lib%{name}.so
%{_libdir}/lib%{name}u.so
%{_libdir}/%{name}/
%{_libdir}/pkgconfig/%{name}.pc
%{_includedir}/%{name}u.h
%{_datadir}/%{name}/
%changelog
* Wed Aug 31 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.13-7
- Couple of fixes
* Wed Aug 31 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.13-6
- Rebuild for OpenCL 2.1
* Sun Aug 14 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.13-5
- Remove virtual provides for opencl-icd
* Fri Apr 08 2016 Björn Esser <fedora@besser82.io> - 0.13-4
- add virtual Provides for ocl-icd (RHBZ #1317605)
* Fri Apr 08 2016 Björn Esser <fedora@besser82.io> - 0.13-3
- changes as suggested in rhbz #1324438
- enable builds for %%{arm}
- fix spelling error in devel-pkg %%description and %%summary
- fix rpmlint warnings for spec-file and srpm
* Tue Apr 05 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.13-2
- use -DKERNELLIB_HOST_CPU_VARIANTS=distro
- add --output-on-failure for ctest invocation
* Tue Apr 05 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.13-1
- Update to 0.13 (RHBZ #1323866)
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.12-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Jan 27 2016 Adam Jackson <ajax@redhat.com> 0.12-2
- Rebuild for llvm 3.7.1 library split
* Thu Nov 05 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.12-1
- 0.12 release
* Tue Oct 06 2015 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.12-0.1.git20151006.eb665eb
- Todays snapshot (eb665eb)
* Thu Sep 17 2015 Dave Airlie <airlied@redhat.com> 0.11-3
- snapshot pocl master - for llvm 3.7 support
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Mon Apr 13 2015 Björn Esser <bjoern.esser@gmail.com> - 0.11-1
- temporarily ignore testsuite fails on fc >= 23
* Fri Apr 10 2015 Björn Esser <bjoern.esser@gmail.com> - 0.11-1
- pocl 0.11
- adds support for LLVM >= 3.5
* Fri Apr 10 2015 Björn Esser <bjoern.esser@gmail.com> - 0.10-3
- rebuild for libLLVM-3.6.so
* Tue Oct 28 2014 Adam Jackson <ajax@redhat.com> 0.10-2
- BuildRequires: libedit-devel
- Rebuild for llvm 3.5
* Tue Oct 14 2014 Adam Jackson <ajax@redhat.com> 0.10-1
- pocl 0.10
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Thu May 22 2014 Björn Esser <bjoern.esser@gmail.com> - 0.9-5
- require uthash-devel instead of uthash
- small cleanups
* Mon Apr 07 2014 Fabian Deutsch <fabiand@fedoraproject.org> - 0.9.4
- Provide isas for correct requires rhbz#1082364
* Mon Mar 31 2014 Fabian Deutsch <fabiand@fedoraproject.org> - 0.9-3
- Add glibc-devel requirement
* Fri Jan 31 2014 Rex Dieter <rdieter@fedoraproject.org> 0.9-2
- rebuild (llvm 3.4 again)
* Wed Jan 29 2014 Fabian Deutsch <fabiand@fedoraproject.org> - 0.9-1
- Update to 0.9
* Fri Jan 17 2014 Fabian Deutsch <fabiand@fedoraproject.org> - 0.9-0.9.rc2
- Update to 0.9RC2
* Wed Jan 15 2014 Dave Airlie <airlied@redhat.com> 0.9-0.8.git20131209.9374f32
- bump for rebuild against llvm 3.4
* Mon Dec 09 2013 Fabian Deutsch <fabiand@fedoraproject.org> - 0.9-0.7.git20131209.9374f32
- Enable LLVM API mode
* Mon Dec 09 2013 Fabian Deutsch <fabiand@fedoraproject.org> - 0.9-0.6.git20131209.7fc5dd0
- Update to a working snapshot
- Drop utlist.h from Makefile
- Set LLC_HOST_CPU to workaround incorrect CPU detection/missing LLVM support
* Mon Nov 11 2013 Fabian Deutsch <fabiand@fedoraproject.org> - 0.9-0.5.git20131111.8a26561
- Fix Requirement
* Mon Nov 11 2013 Fabian Deutsch <fabiand@fedoraproject.org> - 0.9-0.4.git20131111.8a26561
- Add BR on gcc-c++ temporarily
- Update to a newer snapshot
* Mon Oct 07 2013 Fabian Deutsch <fabiand@fedoraproject.org> - 0.9-0.3.git20131007.94d0cce
- Update to 94d0cce4b368bdc963e97952ccf88e55e6a8b4ba
- Includes implementations for clSetEventCallback
* Wed Oct 02 2013 Fabian Deutsch <fabiand@fedoraproject.org> - 0.9-0.2.git20130925.b190740
- Update package summary to include OpenCL
* Tue Oct 01 2013 Björn Esser <bjoern.esser@gmail.com> - 0.9-0.1.git20130925.b190740
- update to recent git-snapshot
- minor cleanup
- include some more documentation
* Sun Sep 29 2013 Dan Horák <dan[at]danny.cz> - 0.8-8
- switch to ExclusiveArch as it needs explicit porting to new arches
* Wed Aug 28 2013 Fabian Deutsch <fabiand@fedoraproject.org> - 0.8-7
- Add requirements on opencl-filesystem and uthash
- Remove uthash sources during prep
- Fix license field
* Mon Aug 19 2013 Fabian Deutsch <fabiand@fedoraproject.org> - 0.8-6
- Move includedir to base package. This is required to build
kernels at runtime.
* Thu Aug 15 2013 Fabian Deutsch <fabiand@fedoraproject.org> - 0.8-5
- Unbundle uthash
- Updated licenses
* Wed Aug 14 2013 Fabian Deutsch <fabiand@fedoraproject.org> - 0.8-4
- Drop -libs subpackage
- Fix -devel BR on base package
* Wed Aug 14 2013 Fabian Deutsch <fabiand@fedoraproject.org> - 0.8-3
- Add check
- Enforce ICD usage
- Fix duplicate file warnings
* Tue Aug 13 2013 Fabian Deutsch <fabiand@fedoraproject.org> - 0.8-2
- Own some dirs
- Fix -devel libraries
- Add hwloc, llvm, mesa-libGL BR
- Glob for bc and type files
- ExcludeArch armv7hl
* Mon Aug 12 2013 Fabian Deutsch <fabiand@fedoraproject.org> - 0.8-1
- Update to 0.8
- Better description
- Fix SourceUrl
* Sun Aug 11 2013 Fabian Deutsch <fabiand@fedoraproject.org> - 0.8pre-0.2
- Updated bzr snapshot
* Wed Feb 27 2013 Dave Airlie <airlied@redhat.com> - 0.8pre-0.1
- first import