summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 36e377011a11b58f8d9b28fe5d2a4fb678db2514 (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
# Maintainer: Jingbei Li <i@jingbei.lli>
pkgdesc='A fast parallel implementation of CTC, on both CPU and GPU.'
pkgname='torch7-warp-ctc'
pkgver=v1.0.r32.gbc29dcf
pkgrel=1
makedepends=('cmake' 'git' 'torch7-cutorch-git')
depends=('torch7-git>=r819')
optdepends=('torch7-cutorch-git')
arch=('x86_64' 'i686')
url='https://github.com/baidu-research/warp-ctc'
license=('APACHE')
source=("${pkgname}::git+${url}")
sha512sums=('SKIP')

pkgver () {
	cd "${pkgname}"
	(
		set -o pipefail
		git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
		printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
	)
}

build () {
	CFLAGS="${CFLAGS/-fno-plt/} -fPIC"
	CXXFLAGS="${CXXFLAGS/-fno-plt/} -fPIC"

	cd "${pkgname}"
	sed 's/luajit/luajit-5.1/g' -i CMakeLists.txt
	# Uncomment this line if you are using a Pascal GPU
	# sed -e 's/compute_[0-9]\{2\}/compute_61/g' -e 's/sm_[0-9]\{2\}/sm_61/g' -i CMakeLists.txt
	cmake . \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_C_COMPILER=gcc-8 \
		-DCMAKE_BUILD_TYPE=Release
	make
}

package () {
	cd "${pkgname}"
	make DESTDIR=$pkgdir install
}