File Shark4.spec of Package Shark4
#
# spec file for package Shark4
#
# Copyright (c) 2018 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/
#
%define min_boost_version 1.48.0
%define libname libshark0
Name: Shark4
Summary: C++ machine learning library
License: LGPL-3.0
Group: Development/Languages/C and C++
Version: 4.0.1
Release: 0
URL: http://www.shark-ml.org/
Source0: https://github.com/Shark-ML/Shark/archive/v%{version}.zip#/Shark-%{version}.zip
# PATCH-FIX-UPSTREAM - Shark-fix_lib64_usage.patch: install in lib64 instead of lib for 64-bit
Patch1: Shark-fix_lib64_usage.patch
BuildRequires: cblas-devel
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: hdf5-devel
BuildRequires: libboost_filesystem-devel >= %{min_boost_version}
BuildRequires: libboost_serialization-devel >= %{min_boost_version}
BuildRequires: libboost_system-devel >= %{min_boost_version}
BuildRequires: libboost_test-devel >= %{min_boost_version}
# BuildRequires: libOpenCL1
# BuildRequires: Mesa-libOpenCL
BuildRequires: openblas-devel
# BuildRequires: opencl-cpp-headers
BuildRequires: unzip
BuildRequires: zlib-devel
%description
Shark is a fast, modular, feature-rich open-source C++ machine learning library.
It provides methods for linear and nonlinear optimization, kernel-based learning algorithms,
neural networks, and various other machine learning techniques.
It serves as a powerful toolbox for real world applications as well as for research.
Shark works on Windows, MacOS X, and Linux. It comes with extensive documentation.
%package -n %{libname}
Summary: Libraries for SHARK
Group: Development/Languages/C and C++
%description -n %{libname}
This package contains the development files required to compile programs that use SHARK.
%package examples
Summary: Examples for SHARK C++ machine learning library
Group: Development/Languages/C and C++
Requires: %{libname} == %{version}
%description examples
This package contains some examples to use SHARK.
%package devel
Summary: Development header files and libraries for SHARK
Group: Development/Languages/C and C++
Requires: %{libname} == %{version}
Requires: %{name} == %{version}
%description devel
This package contains the development files required to compile programs that use SHARK.
%prep
%setup -q -n Shark-%{version}
%patch1 -p1
%build
# CLBLAST (Uses CLBLAST as OpenCL linear algebra backend) is experimental, so disable it for now
%cmake \
-DENABLE_CBLAS:BOOL=ON \
-DENABLE_OPENMP:BOOL=ON \
-DENABLE_OPENCL:BOOL=OFF \
-DENABLE_CLBLAST:BOOL=OFF \
-DENABLE_SIMD:BOOL=ON \
-DBUILD_TESTING:BOOL=ON \
-DBUILD_EXAMPLES:BOOL=ON
make %{?_smp_mflags}
%install
%cmake_install
# Move examples ELF binaries to _bindir
pushd %{buildroot}/usr/share/shark/examples/
for file in \
Data/Datasets Data/Import Data/Normalization Data/Subsets \
EA/MOO/MOCMAApproximated EA/MOO/MOCMAExperiment EA/MOO/MOCMASimple EA/SOO/AckleyES EA/SOO/Archive EA/SOO/CMAExperiment EA/SOO/CMAPlot EA/SOO/CMASimple EA/SOO/ElitistCMASimpleMain EA/SOO/TSP \
Statistiscs/Statistics \
Supervised/CSvmGridSearchTutorial Supervised/CSvmLinear Supervised/CSvmMaxLikelihoodMS Supervised/CSvmTutorial Supervised/CVFolds Supervised/DeepNetworkTrainingRBM Supervised/FFNNBasicTutorial \
Supervised/KNNCrossValidationTutorial Supervised/KNNTutorial Supervised/KTA-tutorial Supervised/KernelBudgetedSGDTutorial Supervised/KernelLogisticRegression Supervised/KernelRegression \
Supervised/KernelSelection Supervised/LDATutorial Supervised/LassoRegression Supervised/MNISTForExperts Supervised/McSvm Supervised/McSvmLinear Supervised/MklKernelTutorial Supervised/MultiTaskSvm \
Supervised/OneVersusOne Supervised/RFTutorial Supervised/StoppingCriteriaTutorial Supervised/SubrangeKernelTutorial Supervised/linearRegressionTutorial Supervised/quickstartTutorial Supervised/regressionTutorial \
Unsupervised/AutoencoderTutorial Unsupervised/BinaryRBM Unsupervised/HierarchicalClustering Unsupervised/KMeansTutorial Unsupervised/OneClassSvm Unsupervised/PCA Unsupervised/PCATutorial Unsupervised/VariationalAutoencoder; do
mkdir -p %{buildroot}%{_bindir}
mv $file %{buildroot}%{_bindir}/`basename $file`
done
popd
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%files
%doc README.txt
%license COPYING COPYING.LESSER
%{_bindir}/SharkVersion
%files -n %{libname}
%{_libdir}/*.so.*
%files examples
%dir %{_datadir}/shark
%{_datadir}/shark/*
%{_bindir}/*
%exclude %{_bindir}/SharkVersion
%files devel
%{_includedir}/*
%{_libdir}/*.so
%dir %{_libdir}/cmake/Shark
%{_libdir}/cmake/Shark/*.cmake
%changelog