A new user interface for you! Read more...

File pocl.spec of Package pocl

#
# spec file for package pocl
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2014 Guillaume GARDET <guillaume@opensuse.org>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           pocl
Summary:        Portable Computing Language - an OpenCL implementation
License:        MIT
Group:          Productivity/Other
Version:        0.13
Release:        0
# 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)
Url:            http://portablecl.org/
Source0:        pocl-master.zip
Source99:       pocl-rpmlintrc
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# Only armv7l is supported
# PPC support is currently broken, due to path problems
# s390(x) and aarch64 also not supported, so use ExclusiveArch
ExclusiveArch:  %{ix86} x86_64 armv7l armv7hl
BuildRequires:  boost-devel
BuildRequires:  cmake >= 2.8.12
BuildRequires:  libtool
BuildRequires:  libtool-ltdl-devel
BuildRequires:  llvm-r600 >= 3.3
BuildRequires:  llvm-r600-clang >= 3.3
BuildRequires:  llvm-r600-clang-devel >= 3.3
BuildRequires:  llvm-r600-devel >= 3.3
BuildRequires:  ncurses-devel
BuildRequires:  opencl-headers unzip
BuildRequires:  pkgconfig
BuildRequires:  uthash-devel
BuildRequires:  pkgconfig(OpenCL)
BuildRequires:  pkgconfig(hwloc)
#BuildRequires:	vecmath-devel
Requires:       libstdc++-devel
Requires:       llvm-r600-clang >= 3.3
Requires:       uthash

%description
Portable Computing Language (pocl) aims to become a MIT-licensed open source
implementation of the OpenCL standard which can be easily adapted for new targets
and devices, both for homogeneous CPU and heterogenous GPUs/accelerators.

pocl uses Clang as an OpenCL C frontend and LLVM for the kernel compiler
implementation, and as a portability layer. Thus, if your desired target
has an LLVM backend, it should be able to get OpenCL support easily by using pocl.

The goal is to accomplish improved performance portability using a kernel
compiler that can generate multi-work-item work-group functions that exploit
various types of parallel hardware resources: VLIW, superscalar, SIMD, SIMT,
multicore, multithread ...

Additional purpose of the project is to serve as a research platform for
issues in parallel programming on heterogeneous platforms.


%package devel
Summary:        Portable Computing Language - development files
Group:          Development/Languages/Other 
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires:       opencl-headers

%description devel
Portable Computing Language (pocl) aims to become a MIT-licensed open source
implementation of the OpenCL standard which can be easily adapted for new targets
and devices, both for homogeneous CPU and heterogenous GPUs/accelerators.

This Subpackage provides the development files needed for pocl.


%prep
%setup -q -n pocl-master

%build
mkdir build
cd build
cmake ..\
        -DCMAKE_INSTALL_PREFIX=%{_prefix} \
	-DCMAKE_C_COMPILER=clang  \
	-DCMAKE_CXX_COMPILER=clang++ \
	-DWITH_LLVM_CONFIG=/usr/bin/llvm-config
make %{?_smp_mflags}

# docs
#cd doc/sphinx
#make html

%install
%cmake_install

# FIXME - should be handled upstream
chmod 755 %{buildroot}/%{_bindir}/pocl-standalone

# 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

%check
cd build
ctest %{?_smp_mflags} ||:

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc CHANGES README doc/sphinx/source/*.rst
%dir %{_sysconfdir}/OpenCL/
%dir %{_sysconfdir}/OpenCL/vendors
%{_sysconfdir}/OpenCL/vendors/pocl.icd
%{_bindir}/pocl-standalone
%{_libdir}/libpocl.so.*
%{_libdir}/libpoclu.so.*
%{_libdir}/pocl/
%{_datadir}/pocl/

%files devel
%defattr(-,root,root)
%{_libdir}/libpoclu.so
%{_libdir}/libpocl.so
%{_libdir}/pkgconfig/pocl.pc
%{_includedir}/poclu.h

%changelog