File viennacl.spec of Package viennacl

#
# spec file for package viennacl
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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:           viennacl
Version:        1.7.1
Release:        0
Summary:        Linear algebra and solver library using CUDA, OpenCL, and OpenMP
License:        MIT and ISC
Group:          Development/Libraries/C and C++
Url:            http://viennacl.sourceforge.net/
Source:         ViennaCL-%{version}.tar.gz
BuildRequires:  boost-devel
BuildRequires:  cmake
BuildRequires:  eigen3-devel
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  openmpi-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
ViennaCL provides high level C++ interfaces for linear algebra routines on CPUs
and GPUs using CUDA, OpenCL, and OpenMP. The focus is on generic implementations
of iterative solvers often used for large linear systems and simple integration
into existing projects.

%package devel
Summary:        Linear algebra and solver library using CUDA, OpenCL, and OpenMP
Group:          Development/Libraries/C and C++
Suggests:       eigen3-devel boost-devel openmpi-devel

%description devel
ViennaCL provides high level C++ interfaces for linear algebra routines on CPUs
and GPUs using CUDA, OpenCL, and OpenMP. The focus is on generic implementations
of iterative solvers often used for large linear systems and simple integration
into existing projects.

%prep
%setup -q -n ViennaCL-%{version}

%build
%cmake -DCMAKE_BUILD_TYPE=Release \
	-DENABLE_OPENCL=0 \
	-DENABLE_OPENMP=1 \
	-DINSTALL_CMAKE_DIR:PATH=%{_datadir}/cmake/Modules \
	-DBUILD_TESTING=ON
make %{?_smp_mflags}

%install
# The library is headers-only for C++
# Note, that there will be libviennacl.so in further releases
# It is intended for use with C / Fortran applications
# We will have three flavors: libviennacl-cpu libviennacl-openmp
# libviennacl-opencl
%fdupes -s doc
%cmake_install

%check
%__ctest --output-on-failure --force-new-ctest-process %{?_smp_mflags} -E libviennacl-blas*

%files devel
%defattr(-,root,root)
%doc changelog README LICENSE doc
%{_includedir}/viennacl/
%{_datadir}/cmake/Modules/FindOpenCL.cmake
%{_datadir}/cmake/Modules/ViennaCLConfig.cmake
%{_datadir}/cmake/Modules/ViennaCLConfigVersion.cmake

%changelog
openSUSE Build Service is sponsored by