summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiuseppe Borzi2015-10-28 09:46:45 +0100
committerGiuseppe Borzi2015-10-28 09:46:45 +0100
commit7c4db3d05d2a42fbebee8a950f832e9e51cc0263 (patch)
tree98e111df339acceb3ef1a59a46613065bbd38479
parentca47fcd4450517c3954e5f188d8b5695fa8fde7b (diff)
downloadaur-7c4db3d05d2a42fbebee8a950f832e9e51cc0263.tar.gz
Minor fix for grep
-rw-r--r--PKGBUILD13
1 files changed, 10 insertions, 3 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 97248550fc3e..0d3f5a327b71 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -20,14 +20,21 @@ build() {
unset CFLAGS
unset CXXFLAGS
- make USE_OPENMP=1 NO_LAPACK=1 LIBPREFIX=libcblas MAJOR_VERSION=3 \
- ONLY_CBLAS=1 libs shared
+ NPROC=`/usr/bin/grep "physical id" /proc/cpuinfo|sort|uniq|wc -l`
+ NCORE4PROC=`/usr/bin/grep "cores" /proc/cpuinfo|sort|tail -n 1|sed -e 's/cpu cores.*: //'`
+ let NCORE=NPROC*NCORE4PROC
+ make USE_OPENMP=1 NO_LAPACK=1 NUM_THREADS=$NCORE LIBPREFIX=libcblas \
+ MAJOR_VERSION=3 ONLY_CBLAS=1 libs shared
}
package() {
cd "$srcdir/$_pkgname-$pkgver"
- make PREFIX="$pkgdir/usr" LIBPREFIX=libcblas MAJOR_VERSION=3 install
+ NPROC=`/usr/bin/grep "physical id" /proc/cpuinfo|sort|uniq|wc -l`
+ NCORE4PROC=`/usr/bin/grep "cores" /proc/cpuinfo|sort|tail -n 1|sed -e 's/cpu cores.*: //'`
+ let NCORE=NPROC*NCORE4PROC
+ make PREFIX="$pkgdir/usr" NUM_THREADS=$NCORE LIBPREFIX=libcblas \
+ MAJOR_VERSION=3 install
rm -f "$pkgdir"/usr/include/lapacke* "$pkgdir"/usr/include/f77blas.h
mv "$pkgdir"/usr/include/openblas_config.h "$pkgdir"/usr/include/opencblas_config.h
sed -i -e 's/openblas_config/opencblas_config/' "$pkgdir"/usr/include/cblas.h