summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoracxz2020-01-18 02:52:41 -0500
committeracxz2020-01-18 02:52:41 -0500
commit445872694726e1a5dbe1b4c40e78490656fd55b4 (patch)
treead8281a72ae0a1fae60b29b07a13f0f72884d267
downloadaur-445872694726e1a5dbe1b4c40e78490656fd55b4.tar.gz
create scotch-git package
-rw-r--r--.SRCINFO25
-rw-r--r--PKGBUILD81
2 files changed, 106 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..e629bdfc6e45
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,25 @@
+pkgbase = scotch-git
+ pkgdesc = Software package and libraries for graph, mesh and hypergraph partitioning, static mapping, and sparse matrix block ordering. This is the all-inclusive version (MPI/serial/esmumps).
+ pkgver = r337.03d9a7d
+ pkgrel = 1
+ url = https://gitlab.inria.fr/scotch/scotch
+ arch = i686
+ arch = x86_64
+ license = custom:CeCILL-C
+ depends = zlib
+ depends = openmpi
+ depends = bzip2
+ provides = scotch
+ provides = ptscotch
+ provides = ptscotch-openmpi
+ provides = scotch_esmumps
+ provides = scotch_ptesmumps
+ conflicts = scotch
+ conflicts = ptscotch-openmpi
+ conflicts = scotch_esmumps
+ conflicts = scotch_esmumps5
+ source = git+https://gitlab.inria.fr/scotch/scotch
+ sha256sums = SKIP
+
+pkgname = scotch-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..eb9f7f5555b4
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,81 @@
+# Maintainer: acxz <akashpatel2008 at yahoo dot com>
+
+pkgname=scotch-git
+pkgver=r337.03d9a7d
+pkgrel=1
+pkgdesc="Software package and libraries for graph, mesh and hypergraph partitioning, static mapping, and sparse matrix block ordering. This is the all-inclusive version (MPI/serial/esmumps)."
+url="https://gitlab.inria.fr/scotch/scotch"
+license=("custom:CeCILL-C")
+depends=('zlib' 'openmpi' 'bzip2')
+provides=('scotch' 'ptscotch' 'ptscotch-openmpi' 'scotch_esmumps' 'scotch_ptesmumps')
+conflicts=('scotch' 'ptscotch-openmpi' 'scotch_esmumps' 'scotch_esmumps5')
+arch=('i686' 'x86_64')
+source=("git+https://gitlab.inria.fr/scotch/scotch")
+sha256sums=('SKIP')
+_pkgname=scotch
+
+pkgver() {
+ cd "$_pkgname"
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+prepare() {
+ cd "${srcdir}/${_pkgname}/src"
+
+ [ -e Makefile.inc ] && rm Makefile.inc
+ cp "Make.inc/Makefile.inc.${CARCH/_/-}_pc_linux2.shlib" Makefile.inc
+
+ # Apply patch to fix shared library ldflags
+ sed -i 's/$(AR) $(ARFLAGS) $(@) $(?)/$(AR) $(ARFLAGS) $(@) $(?) $(LDFLAGS)/g' libscotch/Makefile
+
+ # Use the CFLAGS defined /etc/makepkg.conf
+ sed -i "s/-O3/${CFLAGS} -fPIC/g" Makefile.inc
+
+ # Fix C compiler
+ sed -i "s/CCD\t.*=.*gcc/CCD = mpicc/" Makefile.inc
+
+ # Also enable bzip2 compression
+ sed -i "s/-DCOMMON_FILE_COMPRESS_GZ/-DCOMMON_FILE_COMPRESS_GZ -DCOMMON_FILE_COMPRESS_BZ2/" Makefile.inc
+ sed -i "s/-lz/-lz -lbz2/" Makefile.inc
+
+ # Fix the creation of directories
+ sed -i "s/mkdir/mkdir\ -p/" Makefile.inc
+
+ # To install headers and libs also for esmumps
+ sed -i 's/scotch\*/{scotch,esmumps}\*/g' Makefile
+}
+
+build() {
+ cd "${srcdir}/${_pkgname}/src"
+
+ make scotch
+ make -j1 esmumps
+
+ # MPI implementation is not thread-safe: compile the parallel versions without SCOTCH_PTHREAD
+ sed -i "s/-DSCOTCH_PTHREAD//" Makefile.inc
+
+ make ptscotch
+ make -j1 ptesmumps
+}
+
+check() {
+ cd "${srcdir}/${_pkgname}/src"
+
+ # Thx to sigvald: https://aur.archlinux.org/packages/scotch/?O=20&PP=10#comment-634455
+ # Upstream issue: https://gitlab.inria.fr/scotch/scotch/issues/7
+ sed -i 's/mpirun/mpirun --oversubscribe/' check/Makefile
+
+ make check LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:../../lib"
+ make ptcheck LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:../../lib"
+}
+
+package() {
+ cd "${srcdir}/${_pkgname}/src"
+
+ make install prefix="${pkgdir}/usr" includedir="${pkgdir}/usr/include/scotch"
+
+ # To avoid conflict with extra/gpart, maybe move the package to /opt/scotch ?
+ mv "${pkgdir}/usr/bin/gpart" "${pkgdir}/usr/bin/gpart-scotch"
+
+ install -m 644 -D "../doc/CeCILL-C_V1-en.txt" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
+}