summaryrefslogtreecommitdiff
path: root/embree-isa/PKGBUILD
blob: 3ce25955302b444529e99c6a4fac63b9ee7e79d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Contributor: Lukas Jirkovsky <l.jirkovsky@gmail.com>
# Contributor: gucong <gucong43216@gmail.com>
# Maintainer: Erich Eckner <arch at eckner dot net>

pkgname=embree-isa
pkgver=3.11.0
pkgrel=7
pkgdesc="A collection of high-performance ray tracing kernels (with build-time ISA detection)"
arch=('x86_64')
url="https://embree.github.io/"
license=('Apache')
_pinned_dependencies=(
  'gcc-libs=10.2.0'
  'glibc>=2.31'
  'intel-tbb=2020.2'
)
depends=("${_pinned_dependencies[@]}")
provides=('embree')
conflicts=('embree')
makedepends=('cmake' 'ispc' 'freeglut' 'libxmu' 'openexr')
source=("embree-${pkgver}.tar.gz::https://github.com/embree/embree/archive/v${pkgver}.tar.gz")
sha512sums=('a20acb07103d322eebc85d41152210466f8d9b97e7a332589c692f649ee02079465f89561748ddc8448fb40bc63f2595d728cc31a927f7b95bea13446c5c775d')

build() {
  cd "$srcdir/embree-$pkgver"

  MAX_ISA="SSE2"
  cat /proc/cpuinfo | grep sse3 > /dev/null && MAX_ISA="SSE3"
  cat /proc/cpuinfo | grep sse4_1 > /dev/null && MAX_ISA="SSE4.1"
  cat /proc/cpuinfo | grep sse4_2 > /dev/null && MAX_ISA="SSE4.2"
  cat /proc/cpuinfo | grep avx > /dev/null && MAX_ISA="AVX"
  cat /proc/cpuinfo | grep avx2 > /dev/null && MAX_ISA="AVX2"
  # ICC required for avx512 ?

  echo MAX_ISA:  $MAX_ISA

  cmake . \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DCMAKE_BUILD_TYPE=Release \
    -DEMBREE_TUTORIALS=OFF \
    -DEMBREE_MAX_ISA="$MAX_ISA"
  make
}

package() {
  cd "$srcdir/embree-$pkgver"
  make DESTDIR="$pkgdir" install
}