# # spec file for package arrayfire # # Copyright (c) 2024 SUSE LLC # # 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 https://bugs.opensuse.org/ # %define libname libaf %define sonum 3 Name: arrayfire Summary: A general purpose GPU library License: BSD-3-Clause Group: Productivity/Scientific/Other Version: 3.9.0 Release: 0 URL: https://arrayfire.com/ Source: https://github.com/arrayfire/arrayfire/releases/download/v%{version}/arrayfire-full-%{version}.tar.bz2 BuildRequires: Mesa-devel BuildRequires: cmake BuildRequires: doxygen BuildRequires: fdupes BuildRequires: forge-devel >= 1.0.4 BuildRequires: freeimage-devel BuildRequires: gcc-c++ BuildRequires: git BuildRequires: gtest BuildRequires: lapacke-devel BuildRequires: libboost_headers-devel >= 1.70 BuildRequires: openblas-devel BuildRequires: memory-constraints BuildRequires: pkg-config BuildRequires: pkgconfig(fftw3) BuildRequires: pkgconfig(fmt) BuildRequires: pkgconfig(glfw3) BuildRequires: pkgconfig(python3) BuildRequires: pkgconfig(spdlog) # BuildRequires: ocl-icd-devel # BuildRequires: opencl-headers %description ArrayFire is a high performance software library for parallel computing with an easy-to-use API. Its array based function set makes parallel programming simple. ArrayFire's multiple backends (CUDA, OpenCL and native CPU) make it platform independent and highly portable. ArrayFire provides visualization capabilities using our OpenGL-based, high performance visualization library. A few lines of code in ArrayFire can replace dozens of lines of parallel computing code, saving you valuable time and lowering development costs. %package -n %{libname}%{sonum} Group: System/Libraries Summary: ArrayFire: A general purpose GPU library %description -n %{libname}%{sonum} ArrayFire is a high performance software library for parallel computing with an easy-to-use API. Its array based function set makes parallel programming simple. ArrayFire's multiple backends (CUDA, OpenCL and native CPU) make it platform independent and highly portable. ArrayFire provides visualization capabilities using our OpenGL-based, high performance visualization library. A few lines of code in ArrayFire can replace dozens of lines of parallel computing code, saving you valuable time and lowering development costs. This package provides the backend-independent arrayfire library. %package -n %{libname}cpu%{sonum} Group: System/Libraries Summary: ArrayFire CPU Backend %description -n %{libname}cpu%{sonum} ArrayFire is a high performance software library for parallel computing with an easy-to-use API. Its array based function set makes parallel programming simple. ArrayFire's multiple backends (CUDA, OpenCL and native CPU) make it platform independent and highly portable. ArrayFire provides visualization capabilities using our OpenGL-based, high performance visualization library. A few lines of code in ArrayFire can replace dozens of lines of parallel computing code, saving you valuable time and lowering development costs. This package provides the CPU-based computation backend for ArrayFire. %package devel Group: Development/Libraries/C and C++ Summary: Development files for ArrayFire Requires: %{libname}%{sonum} = %{version} Requires: %{libname}cpu%{sonum} = %{version} Requires: forge-devel Requires: freeimage-devel Requires: lapacke-devel Requires: openblas-devel Requires: pkgconfig(fftw3) Requires: pkgconfig(glfw3) Requires: pkgconfig(python3) %description devel ArrayFire is a high performance software library for parallel computing with an easy-to-use API. Its array based function set makes parallel programming simple. ArrayFire's multiple backends (CUDA, OpenCL and native CPU) make it platform independent and highly portable. ArrayFire provides visualization capabilities using our OpenGL-based, high performance visualization library. A few lines of code in ArrayFire can replace dozens of lines of parallel computing code, saving you valuable time and lowering development costs. This package provides development libraries and headers needed to build software using ArrayFire. %package doc Group: Documentation/Other Recommends: %{name}-devel = %{version} Summary: Help files for ArrayFire BuildArch: noarch %description doc ArrayFire is a high performance software library for parallel computing with an easy-to-use API. Its array based function set makes parallel programming simple. ArrayFire's multiple backends (CUDA, OpenCL and native CPU) make it platform independent and highly portable. ArrayFire provides visualization capabilities using our OpenGL-based, high performance visualization library. A few lines of code in ArrayFire can replace dozens of lines of parallel computing code, saving you valuable time and lowering development costs. This package provides documentation and examples for using ArrayFire. %prep %setup -q -n arrayfire-full-v%{version} # Don't abort on (false) doxygen warning, see https://github.com/doxygen/doxygen/issues/6779 sed -i -e 's/\(WARN_AS_ERROR *\)=.*/\1= NO/' docs/doxygen.mk # AF insists on splitting debuginfo itself, disable sed -i -e 's/SPLIT_TOOL_EXISTS ON/SPLIT_TOOL_EXISTS OFF/' CMakeModules/SplitDebugInfo.cmake # Hack - AF calls FetchContent_Populate with with a git URI, but the shipped # directory omit the required .git contents # see `af_dep_check_and_populate` calls in CMakeLists.txt # https://github.com/arrayfire/arrayfire/issues/3527 git config --global user.email "obs" (cd extern/af_glad-src/; git init -b origin/main; git add . ; git commit -m initial) (cd extern/span-lite-src/; git init -b origin/main; git add . ; git commit -m initial ; git tag ccf2351) (cd extern/af_assets-src/; git init -b origin/master; git add . ; git commit -m initial) sed -i -e 's/REF 4d4a4f0.*/REF 4d4a4f0/' src/backend/cpu/CMakeLists.txt (cd extern/af_threads-src/; git init -b origin/master; git add . ; git commit -m initial ; git tag 4d4a4f0) sed -i -e 's/REF 0144a599.*/REF 0144a599/' test/CMakeLists.txt (cd extern/af_test_data-src/; git init -b origin/master; git add . ; git commit -m initial ; git tag 0144a599) # Fix a syntax error breaking lazy evaluation - https://github.com/arrayfire/arrayfire/issues/3528 sed -i.orig -e '/OpenCL::OpenCL/ s/: */:/g' src/api/unified/CMakeLists.txt %build %cmake \ -DCMAKE_CXX_FLAGS="${CXXFLAGS:-%optflags} -DNDEBUG -pthread" \ -DAF_BUILD_DOCS=ON \ -DAF_BUILD_FORGE=OFF \ -DAF_BUILD_NONFREE=OFF \ %{?with_tests:-DBUILD_TESTING=ON} \ -DBoost_NO_BOOST_CMAKE=ON \ -DCMAKE_POLICY_DEFAULT_CMP0093=OLD \ -DAF_INSTALL_CMAKE_DIR=%{_libdir}/cmake/ArrayFire/ \ -DAF_INSTALL_DOC_DIR=%{_docdir}/%{name}/ \ -DAF_INSTALL_EXAMPLE_DIR=%{_docdir}/%{name}/examples/ \ -DAF_INSTALL_LIB_DIR=%{_libdir} %limit_build -m 800 %cmake_build %install %cmake_install # We are not interested in the licenses of any linked libraries # which are not distributed with arrayfire. See COPYRIGHT.md: # "The ArrayFire source code does not contain any source code from ..." rm -Rf %{buildroot}/%{_prefix}/LICENSES # Debian specific hack, remove # https://github.com/arrayfire/arrayfire/issues/3364 rm %{buildroot}/%{_prefix}/etc/arrayfire_version.txt %fdupes %{buildroot}%{_docdir} %check export LD_LIBRARY_PATH=%{buildroot}%{_libdir} ./build/test/print_info %ifarch %{ix86} %ctest || true %else %ctest %endif %post -n %{libname}%{sonum} -p /sbin/ldconfig %postun -n %{libname}%{sonum} -p /sbin/ldconfig %post -n %{libname}cpu%{sonum} -p /sbin/ldconfig %postun -n %{libname}cpu%{sonum} -p /sbin/ldconfig %files -n %{libname}%{sonum} %doc ACKNOWLEDGEMENTS.md README.md %license COPYRIGHT.md LICENSE %{_libdir}/%{libname}.so.%{sonum} %{_libdir}/%{libname}.so.%{sonum}.* %files -n %{libname}cpu%{sonum} %doc ACKNOWLEDGEMENTS.md README.md %license COPYRIGHT.md LICENSE %{_libdir}/%{libname}cpu.so.%{sonum} %{_libdir}/%{libname}cpu.so.%{sonum}.* %files devel %doc ACKNOWLEDGEMENTS.md README.md %license COPYRIGHT.md LICENSE %{_libdir}/%{libname}.so %{_libdir}/%{libname}cpu.so %{_libdir}/cmake/ArrayFire/ %{_includedir}/arrayfire.h %{_includedir}/af/ %files doc %doc ACKNOWLEDGEMENTS.md README.md %license COPYRIGHT.md LICENSE %dir %{_docdir}/%{name}/ %{_docdir}/%{name}/examples/ %{_docdir}/%{name}/html/ %changelog