python-ctranslate2-cuda
LOW
maintainer rubin55
0 votes
base
ctranslate2-cuda
scanned 2026-10-08 10:08:28.062655
Why flagged
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
Triggered rules
Low
Few votes, recently uploaded
zero_votes_recent
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
PKGBUILD
1
# Maintainer: Rubin Simons <me@rubin55.org>
2
# Contributor: Lubosz Sarnecki <lubosz@gmail.com>
3
# Contributor: Mark Wagie <mark dot wagie at proton dot me>
4
5
# Set in ~/.makepkg.conf to build for your GPU only, e.g. '8.6;8.9'
6
: ${_cuda_arch_list:='7.5;8.0;8.6;8.9;9.0+PTX'}
7
8
pkgname=(
9
'ctranslate2-cuda'
10
'python-ctranslate2-cuda'
11
)
12
pkgbase=ctranslate2-cuda
13
pkgver=4.8.2
14
pkgrel=1
15
pkgdesc="A C++ and Python library for efficient inference with Transformer models (with CUDA)."
16
arch=('x86_64')
17
url="https://github.com/OpenNMT/CTranslate2"
18
license=('MIT')
19
makedepends=(
20
'cmake'
21
'ninja'
22
'cuda'
23
'git'
24
'openblas'
25
'pybind11'
26
'python-build'
27
'python-installer'
28
'python-setuptools'
29
'python-wheel'
30
)
31
# LTO merges nvcc objects; each defines fatbinData, so lto-wrapper fails
32
options=('!lto')
33
source=("git+https://github.com/OpenNMT/CTranslate2.git#tag=v$pkgver"
34
'git+https://github.com/jarro2783/cxxopts.git'
35
'git+https://github.com/NVIDIA/cccl.git'
36
'git+https://github.com/google/cpu_features.git'
37
'git+https://github.com/gabime/spdlog.git'
38
'git+https://github.com/google/ruy.git'
39
'git+https://github.com/pytorch/cpuinfo.git'
40
'git+https://github.com/NVIDIA/cutlass.git')
41
sha256sums=('3ebe3d22a615f1b04710e19aa7d94c26c704bdd1e3ed3b3d31f7f7e77dfc2ebd'
42
'SKIP'
43
'SKIP'
44
'SKIP'
45
'SKIP'
46
'SKIP'
47
'SKIP'
48
'SKIP')
49
50
prepare() {
51
cd CTranslate2
52
git submodule init third_party/thrust
53
git config submodule."third_party/thrust".url "$srcdir/cccl"
54
for submodule in cxxopts cpu_features spdlog ruy cutlass; do
55
git submodule init "third_party/${submodule}"
56
git config submodule."third_party/${submodule}".url "$srcdir/${submodule}"
57
done
58
git -c protocol.file.allow=always submodule update
59
60
pushd third_party/ruy
61
git submodule init third_party/cpuinfo
62
git config submodule."cpuinfo".url "$srcdir/cpuinfo"
63
git -c protocol.file.allow=always submodule update
64
popd
65
66
git clean python -dfx
67
68
# Relax pybind11 version
69
sed -i 's/pybind11==2.11.1/pybind11/g' python/pyproject.toml
70
71
# Remove the /usr/local RUNPATH from the Python extension
72
sed -i '/-Wl,-rpath/d' python/setup.py
73
}
74
75
build() {
76
local cmake_options=(
77
-B build
78
-G Ninja
79
-S CTranslate2
80
-W no-dev
81
-D CMAKE_BUILD_TYPE='RelWithDebInfo'
82
-D CMAKE_INSTALL_PREFIX='/usr'
83
-D OPENMP_RUNTIME='COMP'
84
-D WITH_MKL='OFF'
85
-D WITH_DNNL='OFF'
86
-D WITH_OPENBLAS='ON'
87
-D OPENBLAS_INCLUDE_DIR='/usr/include/openblas'
88
-D WITH_RUY='ON'
89
# CUDA 13 dropped archs below sm_75, so 'Common' fails
90
# FindCUDA does not parse 10.0 and up; 9.0 PTX JIT covers those
91
-D WITH_CUDA='ON'
92
-D CUDA_ARCH_LIST="$_cuda_arch_list"
93
-D CMAKE_POLICY_VERSION_MINIMUM='3.5'
94
)
95
cmake "${cmake_options[@]}"
96
cmake --build build
97
98
pushd CTranslate2/python
99
CTRANSLATE2_ROOT=.. LIBRARY_PATH="$srcdir/build" python -m build --wheel --no-isolation
100
popd
101
}
102
103
package_ctranslate2-cuda() {
104
pkgdesc="A C++ library for efficient inference with Transformer models (with CUDA)."
105
provides=("ctranslate2=$pkgver")
106
conflicts=('ctranslate2')
107
depends=(
108
'cuda'
109
'openblas'
110
'libgcc'
111
'libstdc++'
112
'libgomp'
113
'glibc'
114
)
115
116
DESTDIR="$pkgdir" cmake --install build
117
118
# Avoid conflict with nlohmann-json
119
rm -r "$pkgdir/usr/include/nlohmann"
120
121
install -Dm644 CTranslate2/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
122
}
123
124
package_python-ctranslate2-cuda() {
125
pkgdesc="A Python library for efficient inference with Transformer models (with CUDA)."
126
provides=("python-ctranslate2=$pkgver")
127
conflicts=('python-ctranslate2')
128
depends=(
129
'ctranslate2-cuda'
130
'python-numpy'
131
'python-yaml'
132
'python'
133
'libgcc'
134
'glibc'
135
'libstdc++'
136
)
137
optdepends=(
138
'python-pytorch: model converters'
139
'python-transformers: Hugging Face model converter'
140
)
141
142
cd CTranslate2/python
143
python -m installer --destdir="$pkgdir" dist/*.whl
144
145
install -Dm644 ../LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
146
}
147
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-10-08 10:08:28 | Low | 1 |