123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220 |
- # Maintainer: eDgar contact edgar At open mail Dot Cc
- pkgname=(
- "getfem-git"
- "getfem-docs"
- # "getfem-git-docs"
- )
- realname=getfem
- pkgver=5.4.1.r41.g9ac4e7f2
- pkgrel=1
- pkgdesc="A finite element framework to solve partial differential equations"
- arch=('x86_64')
- url="http://getfem.org"
- license=('LGPL3')
- makedepends=("m4" "automake" "doxygen" "parallel")
- source=("${realname}::git+https://git.savannah.nongnu.org/git/${realname}.git"
- "http://download-mirror.savannah.gnu.org/releases/getfem/doc/getfem-5.4.1-docs-html.tar.gz")
- md5sums=('SKIP'
- '98a8df7266f4237b5ff896dc8701bc61')
- generic_flags="-fPIC -fopenmp -O3 -march=x86_64 -mtune=generic"
- export COPTFLAGS=-O3
- export CPPOPTFLAGS=-O3
- export CXXOPTFLAGS=-O3
- export CFLAGS="$generic_flags -I/usr/include/scotch -L/usr/lib/openmpi/"
- # Fortify is optional
- export CPPFLAGS="$generic_flags -O2 -D_FORTIFY_SOURCE=2 -I/usr/include/scotch"
- export CXXFLAGS="$generic_flags -O2 -D_FORTIFY_SOURCE=2 -I/usr/include/scotch"
- export FFLAGS="$generic_flags"
- export FCFLAGS="$generic_flags"
- export F90FLAGS="$generic_flags"
- export F77FLAGS="$generic_flags"
- [[ -f /usr/bin/mpicxx ]] &&
- export MPICXX=/usr/bin/mpicxx # CXX=/usr/bin/mpicxx CPP=/usr/bin/mpicxx
- [[ -f /usr/bin/mpicc ]] &&
- export MPICC=/usr/bin/mpicc # CC=/usr/bin/mpicc
- export LANG=en_IE.UTF-8 LANGUAGE=en_IE.UTF-8 LC_ALL=en_IE.UTF-8
- # to allow mpi (not working from config) ########
- export LIBS="-ldmumps -lmpi -fopenmp -Wl,-rpath -Wl,/usr/lib -Wl,-rpath -Wl,/lib -Wl,-rpath -Wl,/usr/lib -Wl,-rpath -Wl,/usr/lib/openmpi -lmpi -lpord -lblas -lscotch -lmumps_common -llapack -lopenblas -lesmumps -lptscotch -lptscotcherr -lmetis -lpthread -lstdc++ -fopenmp"
- export MUMPS_LIBS="-ldmumps -lmpi -fopenmp -Wl,-rpath -Wl,/usr/lib -Wl,-rpath -Wl,/lib -Wl,-rpath -Wl,/usr/lib -Wl,-rpath -Wl,/usr/lib/openmpi -lmpi -lpord -lblas -lscotch -lmumps_common -llapack -lopenblas -lesmumps -lptscotch -lptscotcherr -lmetis -lpthread -lstdc++ -fopenmp"
- #################################################
- pkgver() {
- cd "${srcdir}/${realname}"
- git describe --long --tags --match '*.*' | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/_//;s/^v//g;'
- }
- prepare(){
- cd "${realname}"
- ./autogen.sh
- }
- build() {
- cd "${realname}"
- local config_file="${srcdir}/${realname}"/configure
- local CONFOPTS=(
- # Less verbose
- --quiet
- --enable-silent-rules
- # Directories configuratoin
- --srcdir="${srcdir}/${realname}"
- # target directory
- --prefix=/usr
- # read-only single-machine data (Make.common)
- --sysconfdir=/etc
- # Binary directory
- --bindir=/usr/bin
- # Base data dir (affects doc and others)
- --datadir=/usr/share
- # Make sure that the documentation is in the right place
- --docdir=/usr/share/doc/${realname}
- # use relative addresses for jumps
- --with-pic
- # get -march flag for this system
- --enable-march
- # shared libraries
- --enable-shared
- # Python interface
- --enable-python
- )
- # BLAS: calls for basic algebra routines
- if [[ "$(ldconfig -p | grep libopenblas.so)" \
- =~ "libopenblas.so" ]]; then
- CONFOPTS=( "${CONFOPTS[@]}"
- --enable-blas-interface
- --enable-blas64-support)
- fi
- # METIS support (automatic meshing partitioning)
- if [[ $(ldconfig -p | grep libmetis.so) \
- =~ "libmetis.so" ]]; then
- CONFOPTS=( "${CONFOPTS[@]}" --enable-metis)
- fi
- # Parallel support
- if [[ $(ldconfig -p | grep libmpi.so) =~ "libmpi.so" ]] &&
- [[ "$(ldconfig -p | grep libomp.so)" \
- =~ "libomp.so" ]]; then
- CONFOPTS=( "${CONFOPTS[@]}"
- --enable-paralevel
- --enable-multithread-blas)
- fi
- # MUMPS library. A direct solver for large sparse linear
- # systems.
- if [[ "$(ldconfig -p | grep libmumps_common.so )" \
- =~ "libmumps_common.so" ]]; then
- if [[ "${CONFOPTS[@]}" \
- =~ "--enable-paralevel" ]]; then
- CONFOPTS=( "${CONFOPTS[@]}" --enable-par-mumps )
- # CONFOPTS=( "${CONFOPTS[@]}"
- # # doc/sphinx/source/userdoc/linalg.rst
- # --with-mumps-include-dir="-I/usr/include"
- # --with-mumps="-lmumps_common"
- # )
- elif [[ ! "$(ldconfig -p | grep libmumps_seq.so )" \
- =~ "libmumps_seq.so" ]]; then
- --enable-mumps=no
- fi;
- fi;
- # OpenMP: 64 bits integer blas and lapack
- if [[ "$(ldconfig -p | grep libomp.so)" \
- =~ "libomp.so" ]]; then
- CONFOPTS=( "${CONFOPTS[@]}" )
- fi
- # OpenMP: Multi-threaded version of GetFEM
- if [[ "$(ldconfig -p | grep libomp.so)" \
- =~ "libomp.so" ]]; then
- CONFOPTS=( "${CONFOPTS[@]} --enable-openmp" )
- fi
- # qhull library (required for generation of non regular
- # meshes)
- if [[ "$(ldconfig -p | grep libqhull.so)" \
- =~ "libqhull.so" ]]; then
- CONFOPTS=( "${CONFOPTS[@]} --enable-qhull")
- fi
- # SuperLU (sparse linear systems)
- if [[ "$(ldconfig -p | grep libsuperlu.so)" \
- =~ "libsuperlu.so" ]]; then
- CONFOPTS=( "${CONFOPTS[@]} --enable-superlu")
- fi
- for (( i=1; i<=${#CONFOPTS[@]}; i++)); do
- echo "${CONFOPTS[$i]}";
- done
- $config_file $(for (( i=1; i<=${#CONFOPTS[@]}; i++)); do
- echo "${CONFOPTS[$i]}";
- done)
- make
- }
- package_getfem-git() {
- # package() {
- depends=('python-numpy' 'python-scipy')
- optdepends=('blas' 'lapack' 'metis' 'mumps' 'openblas'
- 'openmp' 'qd' 'qhull' 'superlu' "getfem-docs")
- provides=('gmm')
- conflicts=('gmm' 'getfem')
- cd "${realname}"
- make DESTDIR="$pkgdir/" install
- [[ -d "${pkgdir}/etc/share/getfem" ]] ||
- mkdir -p "${pkgdir}/etc/share/getfem"
- mv "${pkgdir}/usr/getfem_toolbox" "${pkgdir}/etc/share/getfem"
- }
- # ==== Work in progress ====
- # # package() {
- # package_getfem-git-docs() {
- # provides=('getfem-docs')
- # conflicts=('getfem-docs')
- # depends=('getfem-git')
- # cd "${realname}"
- # mkdir -p ${pkgdir}/usr/share/doc/getfem
- # sed -i "s%OUTPUT_DIRECTORY.*%OUTPUT_DIRECTORY=${pkgdir}/usr/share/doc/getfem%g" doc/doxygen/Doxyfile
- # doxygen doc/doxygen/Doxyfile
- # # make -f doc/sphinx/Makefile # cd doc/sphinx
- # # make DESTDIR="${pkgdir}"/usr/share/doc/"${realname}"/ html
- # # make DESTDIR="${pkgdir}"/usr/share/doc/"${realname}"/ latex
- # }
- package_getfem-docs() {
- provides=('getfem-docs')
- conflicts=('getfem-docs')
- depends=('getfem-git')
- # Documentation from the web
- version=$(printf "%s" "${pkgver}" |
- sed 's_\([[:digit:]].[[:digit:]].[[:digit:]]\).*_\1_g')
- cd "${srcdir}"/"${realname}"-${version}-docs-html
- install -d "${pkgdir}"/usr/share/doc/getfem/html/
- # Try to get the number of cpus for parallel
- ncpus="$(printf "%s" "${MAKEFLAGS}" | sed 's_.*\(-j[[:digit:]]+\).*_\1_g')"
- parallel "${ncpus}" install \
- -D {} "${pkgdir}"/usr/share/doc/getfem/html/{}\
- ::: "$(find . -type f)"
- # Doxygen (reference)
- cd "${srcdir}"/"${realname}"
- mkdir -p ${pkgdir}/usr/share/doc/getfem
- sed -i "s%OUTPUT_DIRECTORY.*%OUTPUT_DIRECTORY=${pkgdir}/usr/share/doc/getfem%g" doc/doxygen/Doxyfile
- doxygen doc/doxygen/Doxyfile
- }
|