summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d6aec12f3cdb5a738f51972bd6c47320d5142b2d (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Maintainer: Scott Gigante <scottgigante@gmail.com>

_name=torch_geometric
_fullname=py$_name
pkgbase=python-$_fullname
pkgname=("python-$_fullname" "python-$_fullname-cuda")
pkgver=1.6.3
pkgrel=2
pkgdesc='Geometric Deep Learning Extension Library for PyTorch'
arch=(any)
url="https://github.com/rusty1s/$_fullname"
license=(MIT)
depends=(python gcc cuda cmake python-setuptools python-ase python-rdflib python-numpy python-tqdm python-scipy python-networkx python-louvain python-scikit-learn python-numba python-requests python-pandas python-h5py python-jinja python-googledrivedownloader python-pytest python-pytest-cov python-mock python-trimesh python-pytorch python-pytorch_scatter python-pytorch_cluster python-pytorch_spline_conv python-pytorch_sparse)
_tarball="${_name}-${pkgver}.tar.gz"
source=("${url}/archive/${pkgver}.tar.gz")
sha256sums=('1907c0f5eb7ab8f6f79a7e43703579b39b514501dd956ed0fc3d33210bcbb4c2')
_srcdir="${_fullname}-${pkgver}"

prepare() {
    export CXX=g++
}

build() {
    cd $_srcdir
    python setup.py build
    cd ..
}

check() {
    cd $_srcdir
    # skip test requiring torchvision
    rm test/transforms/test_to_superpixels.py
    # skip test requiring gdist
    rm test/utils/test_geodesic.py
    # skip test requiring compilation with METIS
    rm test/data/test_cluster.py
    python setup.py test
    cd ..
}

_package() {
    cd $_srcdir
    python setup.py bdist_wheel
    local site="$pkgdir/usr/lib/$(readlink /bin/python3)/site-packages"
    mkdir -p "$site"
    unzip "$(ls -1 dist/${_name}-${pkgver}-*.whl)" -d "$site"
    cd ..
}


package_python-pytorch_geometric() {
  _package
}


package_python-pytorch_geometric-cuda() {
  pkgdesc="Geometric Deep Learning Extension Library for PyTorch (with CUDA)"
  depends+=(cuda cudnn python-pytorch-cuda python-pytorch_scatter-cuda python-pytorch_cluster-cuda python-pytorch_spline_conv-cuda python-pytorch_sparse-cuda)
  conflicts=(python-pytorch_geometric)
  provides=(python-pytorch_geometric)
  
  export CUDA_HOME=/opt/cuda
  export PATH=$CUDA_HOME/bin:$PATH
  export CPATH=$CUDA_HOME/include:$CPATH
  export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH
  _package
}