summarylogtreecommitdiffstats
path: root/test_optdepends.sh
diff options
context:
space:
mode:
authoreDgar2021-09-19 20:20:43 -0500
committereDgar2021-09-19 20:20:43 -0500
commit797eae7e2136892b394836ecd75cd45b3fbb1aa1 (patch)
tree34a15b5938ff128312b60505bd965a80e3d1e3f7 /test_optdepends.sh
parent483c0558a92ca886d9cbaec70948f088f8563101 (diff)
downloadaur-797eae7e2136892b394836ecd75cd45b3fbb1aa1.tar.gz
Squashed commit of the following:
commit b1d62b2e31965eb7aecf2af6aa63b3623cc6ae62 Author: eDgar <eDgar_|at|_openmail.cc> Date: Sat Sep 18 14:59:25 2021 -0500 upd8 SRCINFO commit 76d2570563dac06c24a8b6e1af07a415947b269e Author: eDgar <eDgar_|at|_openmail.cc> Date: Sat Sep 18 14:15:31 2021 -0500 upd8 contribs, move flags to CONFOPTS, rm LD_PRELOAD libfakeroot commit 95a9ee5d8ab02cb266b9987e9c34f043c3f8ebb2 Author: eDgar <eDgar_|at|_openmail.cc> Date: Sat Sep 18 14:15:11 2021 -0500 test_optdepends: use type instead of which where appropriate commit 3cd56907d05db1e243cf5967c3ff6db1e7e13386 Author: eDgar <eDgar_|at|_openmail.cc> Date: Sat Sep 18 00:18:31 2021 -0500 3.15.4; fix petsc4py with patch (SUDO_USER) commit 594139c1e91a1df97b7964b4f829786c43116240 Author: eDgar <edgar@openmail.cc> Date: Fri Sep 17 17:49:39 2021 -0500 disable env flags; enable debug messages (make tests); move sed BlasLapack.py into build commit 91af4923fc0348e2f6e5b46b2ad0e9f2bac873c4 Author: eDgar <eDgar_|at|_openmail.cc> Date: Fri Sep 17 16:40:31 2021 -0500 test_optdepends.sh: GDB, comment out OpenGL (not working) commit e06da72ea7b391d44f45b14135ef414374866440 Author: eDgar <eDgar_|at|_openmail.cc> Date: Fri Sep 17 16:38:42 2021 -0500 3.15.4, get rid of BlasLapack.py (testing) commit 666743cdc9920832e4efee7e4c29bcf2f7da3ce3 Author: eDgar <eDgar_|at|_openmail.cc> Date: Fri Sep 17 16:37:15 2021 -0500 _base, remove _config, clean CONFOPTS commit 52f73e80d4da9f75a1b2f961376c85f2dcd95945 Author: eDgar <eDgar_|at|_openmail.cc> Date: Tue Aug 31 01:08:18 2021 -0500 add pets4py by means of PYTHONPATH commit a08bf9f41335bea69bc68a24d8fd59ff6779a796 Author: eDgar <eDgar_|at|_openmail.cc> Date: Tue Aug 31 01:07:23 2021 -0500 remove cruft (comments) and add legibility commit 878a7afa08083d5ada268ea77a4c2c54570bccd2 Author: eDgar <eDgar_|at|_openmail.cc> Date: Tue Aug 31 01:04:06 2021 -0500 use git release in pkgversion instead of date commit 9b4cc7b57cb785f71344e5a7f46e52f093f1de8b Author: eDgar <eDgar_|at|_openmail.cc> Date: Tue Aug 31 01:03:33 2021 -0500 /usr/local → /usr commit 48647091e2d5d40da337e1c90318d448d65abc72 Author: eDgar <eDgar_|at|_openmail.cc> Date: Tue Aug 31 01:02:47 2021 -0500 change top-legend commit 4cbe05b6a9a2135abde29e8d3b12d795ff851c37 Author: eDgar <eDgar_|at|_openmail.cc> Date: Tue Aug 31 01:02:13 2021 -0500 Make description much shorter commit c43a1d27045c3b4daa920ec07928efa4da38d11f Author: eDgar <edgar@openmail.cc> Date: Sun Aug 29 12:44:09 2021 -0500 silent make, better pkgver, march=native commit cc9bcc54dd9721fdcdc97c0558701309a268968e Author: eDgar <edgar@openmail.cc> Date: Sun Aug 29 12:42:10 2021 -0500 enable X (libX11.so; for ksp_xmonitor) commit b03b8a642ad55fc755111657d5116236a55b1e9d Author: eDgar <edgar@openmail.cc> Date: Mon Aug 16 17:23:58 2021 -0500 remove petsc4py (not working); split package to petsc{,-doc} commit b66ba61a72cb28df67b119e631096a9ea8773111 Author: eDgar <edgar@openmail.cc> Date: Thu Aug 5 09:26:21 2021 -0500 test_optdepends.sh: openblas with pkgconfig commit 2ee1827afab76692742fe23149936e2152c12c75 Author: eDgar <edgar@openmail.cc> Date: Wed Aug 4 22:50:06 2021 -0500 hypre is makedepends, not optdepends commit 28571fb8ce884e009bd84bd7cd1afc414bcda39b Author: eDgar <edgar@openmail.cc> Date: Fri May 21 00:43:24 2021 -0500 flags in multi-lines, set libHYPRE.so directly commit f9eb15bd087212a5eef9a369e22a88d859fce15e Author: eDgar <edgar@openmail.cc> Date: Wed May 19 09:56:06 2021 -0500 use whereis, ldconfig, pkgconf to find optional deps commit 1057e3d5e8db9faaf99a6c397fa186232e3cbcf6 Author: eDgar <edgar@openmail.cc> Date: Tue May 18 13:04:49 2021 -0500 remove petsc4py.patch commit 98e3afef3525b2d44d3ac419adb9c87d47cfdf03 Author: eDgar <edgar@openmail.cc> Date: Tue May 18 12:00:57 2021 -0500 clean flags (add doc), sane petsc4py, resort optdepends, staticlibs commit 12884b165c3017a87a2da2bb40b8b5758b493ac2 Author: eDgar <edgar@openmail.cc> Date: Wed May 12 13:58:54 2021 -0500 use ldconfig with test_optdepends.sh commit 53d06c02010af2da62a7e78475affa60912eba22 Author: eDgar <edgar@openmail.cc> Date: Mon Mar 15 16:21:38 2021 -0600 recover missing directories from AUR; add option for petsc4py commit cc36baddff61dfa2a3bd158301d2729cd45250b9 Author: eDgar <edgar@openmail.cc> Date: Mon Mar 15 00:06:32 2021 -0600 use python instead of python2 commit afe93d89fb79ccc1f1b2647d0351bb2bbabc0d71 Author: Lucas Heitzmann Gabrielli <heitzmann@gmail.com> Date: Wed Feb 3 17:03:02 2021 -0300 Fix petsc4py build commit 1260bb53b9c1ddbe8814504ed46adb8a644a7933 Author: Lucas Heitzmann Gabrielli <heitzmann@gmail.com> Date: Tue May 12 12:13:21 2020 -0300 Changes by eDgar: use test_optdepends, remove patch commit 2a92162ebdef2c5e2fba43eeded92499713927aa Author: eDgar <edgar@openmail.cc> Date: Tue May 12 23:21:34 2020 -0500 improve dependencies (whereis, add zlib); use slepc-maint (heitzmann) commit 92ccc72c2dfa39630e7597917fce3b2b6b6cd0d7 Author: eDgar <edgar@openmail.cc> Date: Mon May 11 21:29:50 2020 -0500 OpenCL > test_optdepends.sh commit bdb874186d686eb8cd9255156cd5a87f49828aff Author: eDgar <edgar@openmail.cc> Date: Sun May 10 18:50:20 2020 -0500 mtune=generic commit 37ec0108f6ccdb87f759c0e1a537d228ab187f17 Author: eDgar <edgar@openmail.cc> Date: Sun May 10 18:21:35 2020 -0500 update deps: sowing,med>=4.0/add FORTIFY-SOURCE=2 to flags commit e3d46fcf98e9f3aad40be3f66913d139f872c518 Author: eDgar <edgar@openmail.cc> Date: Mon Dec 30 15:29:26 2019 +0100 export flags for all functions; del flags also in test_optdepends commit 538517d9ca8e28b4d7263af91ad4eab8834235aa Author: eDgar <edgar@openmail.cc> Date: Wed Dec 25 19:25:01 2019 +0100 Added openblas (hacked BlasLapack.py) commit ed0b0b66dc38da1a2b68be1185ad557d1201c5e6 Author: eDgar <edgar@openmail.cc> Date: Sat Dec 21 22:22:36 2019 +0100 enable openmp, hwloc, opengl, eigen, cgns, libpng commit 05e824313dc9b367bd0d34ee22f5f70da936a4f4 Author: eDgar <edgar@openmail.cc> Date: Fri Dec 20 22:06:17 2019 +0100 generic_flags; future extra packages list commit d623eca1b515d52149ceae860a5c479d60584b7b Author: eDgar <edgar@openmail.cc> Date: Fri Dec 20 10:31:34 2019 +0100 openmpi=4, test_optdepends commit 3fc79265b9729b90846da4cbacc315fe5de62677 Author: eDgar <edgar@openmail.cc> Date: Mon Nov 4 15:52:49 2019 +0100 custom build eDgar
Diffstat (limited to 'test_optdepends.sh')
-rw-r--r--test_optdepends.sh276
1 files changed, 276 insertions, 0 deletions
diff --git a/test_optdepends.sh b/test_optdepends.sh
new file mode 100644
index 000000000000..21e68917ac11
--- /dev/null
+++ b/test_optdepends.sh
@@ -0,0 +1,276 @@
+#!/bin/bash
+
+# Test if external packages for PETSC are installed
+
+# CONFOPTS=""
+
+# # External downloads
+# for external_pkg in hypre fblaslapack metis parmetis superlu_dist mumps scalapack; do
+# CONFOPTS+=" --download-${external_pkg}=1"
+# done
+
+type mpicc >/dev/null && CONFOPTS+=" --with-cc=mpicc"
+type mpicxx >/dev/null && CONFOPTS+=" --with-cxx=mpicxx"
+type mpifort >/dev/null && CONFOPTS+=" --with-fc=mpifort"
+
+# BOOST: Free peer-reviewed portable C++ source libraries
+if [ -f "$(whereis -b libboost_mpi.so | cut -d' ' -f2)" ]; then
+ CONFOPTS+=" --with-boost=1"
+fi;
+
+# CGNS: Recording and recovering computer data
+if [ -f "$(whereis -b libcgns.so | cut -d' ' -f2)" ]; then
+ CONFOPTS+=" --with-cgns=1"
+fi
+
+# eigen: Lightweight C++ template library for vector and matrix math
+EIGEN_DIR="$(pkgconf --cflags-only-I eigen3)"
+EIGEN_DIR="${EIGEN_DIR##-I}"
+if [ -d "${EIGEN_DIR}" ]; then
+ CONFOPTS+=" --with-eigen=1 --with-eigen-include=${EIGEN_DIR}"
+fi
+
+# fftw: Fast-Fourier Transform
+if [ -f "$(whereis -b libfftw3_mpi.so | cut -d' ' -f2)" ]; then
+ CONFOPTS+=" --with-fftw=1"
+fi
+
+# GDB: GNU debugger
+if [ -f "$(whereis -b gdb | cut -d' ' -f2)" ]; then
+ CONFOPTS+=" --with-debugger=gdb"
+fi
+
+# # GLUT (requires OpenGL)
+# if [ -f "$(whereis -b libglut.so | cut -d' ' -f2)" ]; then
+# CONFOPTS+=" --with-glut=1"
+# CONFOPTS+=" --with-glut-pkg-config="
+# CONFOPTS+="$(dirname $(pkgconf --path glut))"
+# fi
+
+# HDF5: large files
+if [[ "$(h5stat -V)" ]]; then
+ CONFOPTS+=" --with-hdf5=1"
+fi
+
+# hwloc: abstraction of hierarchical architectures
+if [ -f "$(whereis -b libhwloc.so | cut -d' ' -f2)" ]; then
+ CONFOPTS+=" --with-hwloc=1"
+ CONFOPTS+=" --with-hwloc-pkg-config="
+ CONFOPTS+="$(dirname $(pkgconf --path hwloc))"
+fi
+
+# Hypre: Large and sparse linear with massive parallel computing
+if [ -f "$(whereis -b libHYPRE.so | cut -d' ' -f2)" ]; then
+ CONFOPTS+=" --with-hypre=1"
+ CONFOPTS+=" --with-hypre-lib=[/usr/lib/libHYPRE.so]"
+ CONFOPTS+=" --with-hypre-include=/usr/include"
+fi
+
+# MED: Data Modelization and Exchanges (meshes)
+if [ -f "$(whereis -b libmed.so | cut -d' ' -f2)" ]; then
+ CONFOPTS+=" --with-med=1"
+fi
+
+# METIS: Automatic meshing partitioning
+if [ -f "$(whereis -b libmetis.so | cut -d' ' -f2)" ]; then
+ CONFOPTS+=" --with-metis=1"
+ # parmetis support
+ if [ -f "/usr/include/parmetis.h" ]; then
+ CONFOPTS+=" --with-parmetis=1"
+ fi
+fi
+
+# # MPI4Py
+# if [ -n "$(pacman -Qsq mpi4py)" ]; then
+# mpi4py_inc="$(pacman -Ql python-mpi4py | awk '/mpi4py.h$/{print $NF}')"
+# CONFOPTS+=" --with-mpi4py=1"
+# CONFOPTS+=" --with-mpi4py-include="
+# CONFOPTS+="$(dirname $mpi4py_inc)"
+# CONFOPTS+=" --with-mpi4py-lib="
+# CONFOPTS+="$(pacman -Ql python-mpi4py | awk '/.*\.so$/{print $NF}' | tr ' \n' ',')"
+# fi
+
+# MUMPS: Sparse solver library
+if [ -f "$(whereis -b libmumps_common.so | cut -d' ' -f2)" ]; then
+ CONFOPTS+=" --with-mumps=1"
+ # MUMPS_LIBS="[/usr/lib/libcmumps.so,"
+ # MUMPS_LIBS+="/usr/lib/libdmumps.so,"
+ # MUMPS_LIBS+="/usr/lib/libsmumps.so,"
+ # MUMPS_LIBS+="/usr/lib/libzmumps.so,"
+ # MUMPS_LIBS+="/usr/lib/libmumps_common.so,"
+ # MUMPS_LIBS+="/usr/lib/libpord.so]"
+ # CONFOPTS+=" --with-mumps-lib=${MUMPS_LIBS}"
+ # CONFOPTS+=" --with-mumps-include=/usr/include"
+ # CONFOPTS+=" --with-mumps-dir=/usr/"
+fi
+
+# NetCDF
+if [ -f "$(whereis -b libnetcdf.so | cut -d' ' -f2)" ]; then
+ CONFOPTS+=" --with-netcdf=1"
+ CONFOPTS+=" --with-netcdf-pkg-config="
+ CONFOPTS+="$(dirname $(pkgconf --path netcdf))"
+fi
+
+# PNG
+if [ -f "$(whereis -b libpng.so | cut -d' ' -f2)" ]; then
+ CONFOPTS+=" --with-png=1"
+ CONFOPTS+=" --with-png-pkg-config="
+ CONFOPTS+="$(dirname $(pkgconf --path libpng))"
+fi
+
+# PNetCDF
+if [ -f "$(whereis -b libpnetcdf.so | cut -d' ' -f2)" ]; then
+ CONFOPTS+=" --with-pnetcdf=1"
+ CONFOPTS+=" --with-pnetcdf-pkg-config="
+ CONFOPTS+="$(dirname $(pkgconf --path pnetcdf))"
+fi
+
+# OpenBLAS: Linear algebra libraries
+OPENBLAS_SO="$(whereis -b libblas.so | cut -d' ' -f2)"
+if [ -f "${OPENBLAS_SO}" ]; then
+ CONFOPTS+=" --with-openblas=1"
+ # CONFOPTS+=" --with-openblas-lib=[-lopenblas,-lm,-lpthread,-lgfortran,-lm,-lpthread,-lgfortran]"
+ # CONFOPTS+=" --with-openblas-include=/usr/include"
+ CONFOPTS+=" --with-openblas-pkg-config="
+ CONFOPTS+="$(dirname $(pkgconf --path openblas))"
+ # CONFOPTS+=" --download-openblas=0"
+ CONFOPTS+=" --download-f2cblaslapack=0"
+fi
+
+# OpenCL: GPU computing
+# Check header files
+# (from opencl-headers package; how to do this in a consistent way?)
+OPENCL_INC="/usr/include/CL/cl.h"
+# Check library (find libOpenCL.so)
+OPENCL_SO="$(whereis -b libOpenCL.so | cut -d' ' -f2)"
+if [ -f "${OPENCL_SO}" ] && [ -f "${OPENCL_INC}" ]; then
+ CONFOPTS+=" --with-opencl=1"
+fi
+
+# # OpenGL (mesa)
+# # echo /lib64/libOpenGL.so /lib64/libGLX.so /lib64/libGLU.so
+# # FindOpenGL found both a legacy GL library:
+# #
+# # OPENGL_gl_LIBRARY: /lib64/libGL.so
+# #
+# # and GLVND libraries for OpenGL and GLX:
+# #
+# # OPENGL_opengl_LIBRARY: /lib64/libOpenGL.so
+# # OPENGL_glx_LIBRARY: /lib64/libGLX.so
+# OPENGLIB="$(whereis -b libOpenGL.so | cut -d' ' -f2)"
+# if [ -f "${OPENGLIB}" ]; then
+# # OPENGLIB+=",$(whereis -b libGL | cut -d' ' -f2),"
+# # OPENGLIB+=",$(whereis -b libGLX | cut -d' ' -f2)"
+# # OPENGLIB+=",$(whereis -b libGLX | cut -d' ' -f2)"
+# # # OPENGLIB+="$(pacman -Ql mesa | awk '/\.so$/{print $NF}' | tr ' \n' ',')"
+# # CONFOPTS+=" --with-opengl=1"
+# # CONFOPTS+=" --with-opengl-lib=[${OPENGLIB}]"
+# # CONFOPTS+=" --with-opengl-include=[/usr/include/GL/glew.h]"
+# CONFOPTS+=" --with-opengl=1"
+# CONFOPTS+=" --with-opengl-pkg-config="
+# CONFOPTS+="$(dirname $(pkgconf --path opengl))"
+# # CONFOPTS+="$(pacman -Ql mesa | awk '/\/include\/[^/]*\/$/{print $NF}' | tr ' \n' ',')]"
+# fi
+
+# OpenMP: 64 bits blas and lapack, multi-threaded
+if [ -f "$(whereis -b libomp.so | cut -d' ' -f2)" ]; then
+ CONFOPTS+=" --with-openmp=1"
+fi
+
+# # OpenMPI (dependency; should be found by pacman)
+# MPILIBDIR=$(dirname "$(pacman -Qlq openmpi | grep 'libmpi.so$')")
+# MPIINC="$(pacman -Qlq openmpi | grep 'mpi.h$')"
+# if [ -d "${MPILIBDIR}" ]; then
+# CONFOPTS+=" --with-mpi=1"
+# CONFOPTS+=" --with-mpi-dir=/usr/"
+# fi
+
+# Scalapack: Parallel memory linear algebra
+if [ -f "$(whereis -b libscalapack.so | cut -d' ' -f2)" ]; then
+ CONFOPTS+=" --with-scalapack=1"
+fi
+
+# Scotch: Partitioning with sparse matrices
+# TODO: programatic way
+SCOTCH_DIR="/usr/include/scotch"
+if [ -d "${SCOTCH_DIR}" ]; then
+ # SCOTCH_LIBS="$(ldconfig -p | awk '/scotch/{printf("'"${SCOTCH_DIR}"'/%s,", $1)}')"
+ SCOTCH_LIBS="libesmumps.so,libptscotch.so,libptscotcherr.so,libscotch.so,libscotcherr.so"
+
+ # Include bzip2 if scotch was built with bzip2 support
+ if [ -f "$(whereis -b libbz2.so | cut -d' ' -f2)" ]; then
+ SCOTCH_LIBS+=",${SCOTCH_DIR}/libbz2.so"
+ fi
+ # Add [], remove trailing ,
+ SCOTCH_LIBS="[${SCOTCH_LIBS}]"
+ CONFOPTS+=" --with-ptscotch=1"
+ CONFOPTS+=" --with-ptscotch-lib=${SCOTCH_LIBS}"
+ CONFOPTS+=" --with-ptscotch-include=${SCOTCH_DIR}"
+fi
+
+# SuiteSparse: Sparse matrix library
+if [ -f "$(whereis -b libsuitesparseconfig.so | cut -d' ' -f2)" ]; then
+ CONFOPTS+=" --with-suitesparse=1"
+fi
+
+# SuperLU: Subroutines for sparsse linear systems
+# TODO: programatic way
+SUPERLU_DIR="/usr/include/superlu"
+if [ -d "${SUPERLU_DIR}" ]; then
+ CONFOPTS+=" --with-superlu=1 --with-superlu-lib=-lsuperlu --with-superlu-include=${SUPERLU_DIR}"
+fi
+
+# YAML: configuration files
+# Check library (find libyaml.so)
+OPENCL_SO="$(whereis -b libyaml.so | cut -d' ' -f2)"
+if [ -f "${OPENCL_SO}" ]; then
+ CONFOPTS+=" --with-yaml=1"
+fi
+
+# X: to enable ksp_xmonitor
+LIBX11="$(whereis -b libX11.so | cut -d' ' -f2)"
+LIBX11_DIR="$(dirname ${LIBX11})"
+if [ -f "${LIBX11}" ]; then
+ LIBX11_INC="--keep-system-cflags --cflags-only-I";
+ LIBX11_INC="$(pkgconf ${LIBX11_INC} x11)";
+ CONFOPTS+=" --with-x-lib=[${LIBX11_DIR}/";
+ # As per X11.pc, it seems that xcb.so is needed
+ CONFOPTS+="libX11-xcb.so,${LIBX11}]"
+ CONFOPTS+=" --with-x-include=${LIBX11_INC//-I/}"
+fi
+
+# ZLIB
+if [ -f "$(whereis -b libzlib.so | cut -d' ' -f2)" ]; then
+ CONFOPTS+=" --with-zlib=1"
+ CONFOPTS+=" --with-zlib-pkg-config="
+ CONFOPTS+="$(dirname $(pkgconf --path zlib))"
+fi
+
+# # trilinos support
+#
+# if [ "${TRILINOS_DIR}" ]; then
+# CONFOPTS+=" --with-ml-dir=${TRILINOS_DIR}"
+# # boost support (may be useful for trilinos)
+# CONFOPTS+=" --with-boost=1"
+# fi
+
+# Incompatible with complex
+# # sundials support
+# SUNDIALS_DIR="/usr/include/sundials/"
+# if [ -d "${SUNDIALS_DIR}" ]; then
+# CONFOPTS+=" --with-sundials=1 --with-sundials-include=${SUNDIALS_DIR}"
+# fi
+
+# # pastix support (non-free)
+# PASTIX_CONF=$(which pastix-conf)
+# if [ -f "${PASTIX_CONF}" ]; then
+# PASTIX_DIR="$($PASTIX_CONF --incs | sed 's/-I//')"
+# if [ ! -d ${PASTIX_DIR} ]; then
+# PASTIX_DIR="[]"
+# fi
+# #PASTIX_LIBS="$($PASTIX_CONF --libs)"
+# PASTIX_LIBS="[libpastix.a,librt.so,libhwloc.so,libpthread.a]"
+# CONFOPTS+=" --with-pastix=1 --with-pastix-lib=${PASTIX_LIBS} --with-pastix-include=${PASTIX_DIR}"
+# fi
+
+echo "${CONFOPTS}"