File ispc.spec of Package ispc

#
# spec file for package ispc
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2020 LISA GmbH, Bingen, 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 https://bugs.opensuse.org/
#


Name:           ispc
Version:        1.15.0
Release:        11.5
Summary:        C-based SPMD programming language compiler
License:        BSD-3-Clause
Group:          Development/Languages/C and C++
URL:            https://ispc.github.io/
Source:         https://github.com/%{name}/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
BuildRequires:  bison
BuildRequires:  clang-devel
BuildRequires:  cmake >= 3.13
BuildRequires:  doxygen
BuildRequires:  flex
BuildRequires:  llvm-devel
BuildRequires:  ncurses-devel
BuildRequires:  zlib-devel
BuildRequires:  pkgconfig(python3)
ExclusiveArch:  %{arm} x86_64
Packager: Alessandro de Oliveira Faria (A.K.A. CABELO) <cabelo@opensuse.org>
%ifarch x86_64
# for some reason, ispc want to link to /usr/lib/crt1.o from glibc-devel-32bit for x86_64
BuildRequires:  glibc-devel-32bit glibc-32bit
%endif

%description
A compiler for a variant of the C programming language, with extensions for
"single program, multiple data" (SPMD) programming.
 
%prep
%setup -q

# other distributions seem to provide curses compatibility links to ncurses
sed -i 's|${PROJECT_NAME} pthread z tinfo curses)|${PROJECT_NAME} pthread z tinfo ncurses)|' CMakeLists.txt

# fix clang library modules for new clang as carried in TW and 15.2
%if 0%{?_llvm_sonum} >= 10 || ( 0%{?sle_version} == 150200 && 0%{?is_opensuse} )
sed -i 's|set(CLANG_LIBRARY_LIST .*)|set(CLANG_LIBRARY_LIST clang-cpp)|' CMakeLists.txt
%endif

%build
%define _lto_cflags "-flto=thin"
echo "optflags: %{optflags}"
# our llvm is built without assertions, which is required for DUMPS to be operational
%cmake \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=%{_prefix} \
        -DCMAKE_C_FLAGS:STRING="$CFLAGS %{optflags} -fPIE" \
        -DCMAKE_CXX_FLAGS:STRING="$CXXFLAGS %{optflags} -fPIE" \
        -DCMAKE_EXE_LINKER_FLAGS="%{optflags} -pie" \
        -DISPC_INCLUDE_EXAMPLES=OFF \
        -DISPC_INCLUDE_TESTS=OFF \
        -DISPC_NO_DUMPS=ON

%cmake_build

%install
%cmake_install

%files
%license LICENSE.txt
%doc *.md
%{_bindir}/%{name}
%{_bindir}/check_isa

%changelog
* Fri Nov  6 2020 Hans-Peter Jansen <hpj@urpla.net>
  Note, we don't do any GPU builds yet, because
  - API is not stable
  - additional dependencies (that are not available, yet)
- Update to version v1.14.1:
  A minor ISPC update with a bug fix for AVX512 detection problem on macOS
  (for more details see issue #1854) and update of GPU version to use Level0 v1.0.
  CPU binaries are based on patched LLVM 10.0.1.
- Update to version v1.14.0:
  An ISPC release with several improvements for CPU and initial support of Intel
  graphics hardware architectures. The binaries in this release include CPU versions
  for Windows, Linux, and macOS, as previous releases, plus a GPU-enabled Linux binary,
  which supports both CPU and GPU. CPU binaries are based on patched LLVM 10.0.1.
  CPU changes include:
  + new avx2-i8x32, avx2-i16x16, avx512skx-i8x64, avx512skx-i16x32 targets.
    "generic" targets were removed.
  + several stability fixes, including bugs discovered during fuzzing ISPC by YARPGen.
  + integer division performance improvements.
  + support for __vectorcall calling convention on Windows x64 (enabled by
    '--vectorcall')
* Wed Jul  8 2020 Hans-Peter Jansen <hpj@urpla.net>
- fix build with 15.2
* Sun Apr 26 2020 Hans-Peter Jansen <hpj@urpla.net>
- Use lto option "thin"
* Sun Apr 26 2020 Hans-Peter Jansen <hpj@urpla.net>
- Switch to full llvm compilation (remove gcc enforcement)
* Sat Apr 25 2020 Hans-Peter Jansen <hpj@urpla.net>
- Fix llvm version dependency tweaking
- Exclude %%{ix86} for now
* Sat Apr 25 2020 Martin Pluskal <mpluskal@suse.com>
- Clarify cmake dependency
* Fri Apr 24 2020 Hans-Peter Jansen <hpj@urpla.net>
- Version 1.13.0: initial release
- Add patch 0001-Link-against-libclang-cpp.so.patch
- Add patch 0002-fix-compiler-flags.patch
- Conditional to build with older clang as well
openSUSE Build Service is sponsored by