summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorsukanka2023-04-11 21:47:56 +0800
committersukanka2023-04-11 21:47:56 +0800
commitc7fb3e0d0627d2b236a8de7439dd59a3938a33c5 (patch)
treee0d0096394497334219cbba347eb3fe14275265b
parent810d542a9c02984374722f5fa48bfb9339a5df0b (diff)
downloadaur-c7fb3e0d0627d2b236a8de7439dd59a3938a33c5.tar.gz
use some system libs
-rw-r--r--.SRCINFO13
-rw-r--r--PKGBUILD31
-rw-r--r--local11
3 files changed, 48 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d5ceb44ec169..83b77e9faca7 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = stanc
pkgdesc = A package for obtaining Bayesian inference using the No-U-Turn sampler, a variant of Hamiltonian Monte Carlo.
pkgver = 2.32.0_rc1
- pkgrel = 1
+ pkgrel = 2
url = https://mc-stan.org/
arch = i686
arch = x86_64
@@ -9,9 +9,20 @@ pkgbase = stanc
makedepends = texlive-bin
makedepends = texlive-core
makedepends = doxygen
+ makedepends = gtest
+ makedepends = benchmark
+ makedepends = sundials
+ makedepends = boost
+ makedepends = eigen
+ makedepends = stanmath
+ makedepends = python-cpplint
+ makedepends = opencl-headers
+ makedepends = rapidjson
depends = gcc-libs
provides = cmdstan
source = https://github.com/stan-dev/cmdstan/releases/download/v2.32.0-rc1/cmdstan-2.32.0-rc1.tar.gz
+ source = local
sha512sums = 6e734ce47561bf9b2d8674bedd0ddd1e22f476d324ac546a368e0ee925ebcb02f1c3da6d8bdc65fcbca15133f2a19c5a4ce46defee1a1b7264b458f76a151a87
+ sha512sums = 94f898b78f66e517b61d6ce2295e72a07e0a9154852c8b8607600fcb968bf106870f3dcde94ae32d7d8f6663e69cfaa021cdea9a2dc88a96479e86686e126950
pkgname = stanc
diff --git a/PKGBUILD b/PKGBUILD
index 57893791b6ac..c2e95b28671e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,23 +4,41 @@
pkgname='stanc'
pkgdesc="A package for obtaining Bayesian inference using the No-U-Turn sampler, a variant of Hamiltonian Monte Carlo."
pkgver=2.32.0_rc1
-pkgrel=1
+pkgrel=2
arch=('i686' 'x86_64')
url='https://mc-stan.org/'
license=('BSD')
depends=('gcc-libs')
makedepends=('texlive-bin' 'texlive-core' 'doxygen'
# needed if compile against system library
-
-# 'gtest' 'benchmark' 'sundials' 'boost' 'eigen' 'tbb' 'stanmath'
-# 'python-cpplint' 'opencl-headers' 'rapidjson' 'cli11'
+'gtest' 'benchmark' 'sundials' 'boost' 'eigen' 'stanmath'
+'python-cpplint' 'opencl-headers' 'rapidjson'
+# 'cli11'
+# 'tbb': no <tbb/tbb_stddef.h>
)
provides=("cmdstan")
-source=(https://github.com/stan-dev/cmdstan/releases/download/v${pkgver/_/-}/cmdstan-${pkgver/_/-}.tar.gz)
-sha512sums=('6e734ce47561bf9b2d8674bedd0ddd1e22f476d324ac546a368e0ee925ebcb02f1c3da6d8bdc65fcbca15133f2a19c5a4ce46defee1a1b7264b458f76a151a87')
+source=(https://github.com/stan-dev/cmdstan/releases/download/v${pkgver/_/-}/cmdstan-${pkgver/_/-}.tar.gz
+local
+)
+sha512sums=('6e734ce47561bf9b2d8674bedd0ddd1e22f476d324ac546a368e0ee925ebcb02f1c3da6d8bdc65fcbca15133f2a19c5a4ce46defee1a1b7264b458f76a151a87'
+ '94f898b78f66e517b61d6ce2295e72a07e0a9154852c8b8607600fcb968bf106870f3dcde94ae32d7d8f6663e69cfaa021cdea9a2dc88a96479e86686e126950')
+prepare(){
+ cd "${srcdir}/cmdstan-${pkgver/_/-}"
+ cp ${srcdir}/local make/local
+ cp ${srcdir}/local stan/make/local
+ # sed -i 's|CLI11/CLI11.hpp|CLI/CLI.hpp|g' src/cmdstan/stansummary.cpp
+}
build() {
cd "${srcdir}/cmdstan-${pkgver/_/-}"
+ cd stan/lib/stan_math/lib/tbb_2020.3/
+ mkdir ${srcdir}/tbb
+ make tbb
+ find build -type f -executable -exec install -DTm644 "{}" "${srcdir}/tbb/{}" \;
+ mv build/*_release/*.so* ${srcdir}/tbb/
+ cd "${srcdir}/cmdstan-${pkgver/_/-}"
+ export LDFLAGS="-L${srcdir}/tbb -ltbb -Wl,-rpath,/usr/lib/stan"
+ export CXXFLAGS="-fPIC -Isrc -Istan/src -I/usr/include/eigen3 -Istan/lib/stan_math/lib/tbb_2020.3/include/ -D_REENTRANT -Ilib/CLI11-1.9.1/"
make build
}
@@ -48,4 +66,5 @@ package() {
# Install LICENSE file:
install -dm755 "${pkgdir}/usr/share/licenses/stan"
cp -r "stan/licenses/." "${pkgdir}/usr/share/licenses/stan/."
+ install -Dm755 ${srcdir}/tbb/*.so* -t "${pkgdir}/usr/lib/stan"
}
diff --git a/local b/local
new file mode 100644
index 000000000000..098f41b340c8
--- /dev/null
+++ b/local
@@ -0,0 +1,11 @@
+MATH = /usr/include/stan/
+BOOST = /usr/include/boost
+EIGEN = /usr/include/eigen3
+OPENCL = /usr/include/CL
+#TBB = /usr/include/tbb
+SUNDIALS = /usr/include/sundials
+BENCHMARK = /usr/include/benchmark
+GTEST = /usr/include/gtest
+CPPLINT = /usr/lib/python3.10/site-packages/
+RAPIDJSON = /usr/include/rapidjson/
+#CLI11 = /usr/include/CLI/