Hi!
I am creating a package to build GetFEM from the Git sources for
pacman-based distros (e.g. Parabola, Artix, Arch Linux) through a
PKGBUILD.
I would like to how to build the sphinx documentation.
So far, the doxygen documentation works. I am attaching the draft of the
PKGBUILD.
The PKGBUILD basically does this to build the documentation:
make html-recursive
where realname=getfem (thanks to the logic of makepkg). I first got the
following message:
Traceback (most recent call last):
File "getfem/interface/src/python/getfem.py", line 46, in <module>
from ._getfem import *
ImportError: attempted relative import with no known parent package
Then, I got rid of the try: except: and replaced it with `from _getfem
import *' only in getfem.py around line 48 and got
ImportError: /usr/lib/libcmumps.so: undefined symbol: mpi_send_
I already have getfem 5.4.1 (commit 9ac4e7f2. I haven't tested it yet)
with openmpi 4.0.5 and mumps 5.3.5.
Thanks :) .
# Maintainer: eDgar <edgar At open mail Dot Cc>
pkgname=(
# "getfem-git"
"getfem-git-docs"
)
realname=getfem
pkgver=v5.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")
source=("${realname}::git+https://git.savannah.nongnu.org/git/${realname}.git")
md5sums=('SKIP')
generic_flags="-fPIC -fopenmp -O3 -march=amdfam10 -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
pkgver() {
cd "${srcdir}/${realname}"
git describe --long --tags --match '*.*' | sed
's/\([^-]*-g\)/r\1/;s/-/./g;s/_//'
}
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"
# )
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"
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
make html-recursive
}
package_getfem-git() {
# package() {
depends=('python-numpy' 'python-scipy')
optdepends=('blas' 'lapack' 'metis' 'mumps' 'openblas'
'openmp' 'qd' 'qhull' 'superlu')
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"
}
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
}