summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorYigit Dallilar2018-05-24 15:52:01 -0400
committerYigit Dallilar2018-05-24 15:52:01 -0400
commit007833cad103a6fb2b44694277e6bcf17275f7ef (patch)
tree8cac92b0a3c81ba06294d90e4fb0b1ee4c97f83e /PKGBUILD
parent0a11da2f7f479ec2820a3cc86f496db7f8022112 (diff)
downloadaur-007833cad103a6fb2b44694277e6bcf17275f7ef.tar.gz
optional intel-mkl, fallback openblas-lapack
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD63
1 files changed, 54 insertions, 9 deletions
diff --git a/PKGBUILD b/PKGBUILD
index f48cc53e138d..9a8c0fa08006 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,14 +1,15 @@
# Maintainer: Yigit Dallilar <yigit.dallilar@gmail.com>
+# Note: you need to install either atlas-lapack or openblas-lapack
pkgname=astromatic-sextractor
_pkgname=sextractor
pkgver=2.25.0
-pkgrel=1
+pkgrel=2
pkgdesc="builds a catalogue of objects from an astronomical image (build from source) "
url="http://www.astromatic.net/software/sextractor"
arch=('x86_64')
license=('GPL')
-depends=('fftw' 'atlas-lapack')
+depends=('fftw' 'blas' 'cblas' 'lapack')
makedepends=()
provides=()
conflicts=('sextractor-bin')
@@ -17,17 +18,61 @@ backup=()
source=(https://github.com/astromatic/sextractor/archive/${pkgver}.tar.gz)
sha1sums=('3ed53d55c0c77cd98a38bff1bde1b0d6fc625c18')
+_use_mkl=1 # If you want to compile against intel mkl, make the value other than 0.
+
+# decide which library to compile against
+configure_options() {
+
+ # First try intel-mkl if _use_mkl switch is on.
+ if [ "$_use_mkl" != 0 ]; then
+ _MKL=`pacman -Qq intel-mkl 2>/dev/null` || true
+ if [ "$_MKL" != "" ]; then
+ _COPTS="--enable-mkl"
+ else
+ echo "_use_mkl=1 but can not locate mkl libraries"
+ exit 1
+ fi
+ echo "Compiling against intel-mkl"
+ return
+ fi
+
+ # Try atlas-lapack first
+ _ATLAS=`pacman -Qq atlas-lapack 2>/dev/null` || true
+ if [ "$_ATLAS" != "" ]; then
+ _COPTS=""
+ echo "Compiling against atlas-lapack"
+ return
+ fi
+
+ # If atlas-lapack not installed, fall back to openblas-lapack
+ _OBLAS=`pacman -Qq opeblas-lapack 2>/dev/null` || true
+ if [ "$_OBLAS" != "" ]; then
+ _COPTS="--enable-openblas"
+ echo "Compiling against openblas-lapack"
+ return
+ fi
+
+ # If all fails exit and throw error.
+ echo "Failed to locate appropriate library: atlas-lapack, openblas-lapack, intel-mkl"
+ exit 1
+}
+
build() {
- cd $srcdir/${_pkgname}-${pkgver}
- sh autogen.sh
- ./configure --prefix=/usr
- make
+
+ configure_options
+
+ cd $srcdir/${_pkgname}-${pkgver}
+ sh autogen.sh
+ ./configure --prefix=/usr $_COPTS
+ make
}
package() {
- cd $srcdir/${_pkgname}-${pkgver}
- make DESTDIR="$pkgdir" install
- install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
+ cd $srcdir/${_pkgname}-${pkgver}
+ make DESTDIR="$pkgdir" install
+
+ install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
+
}