Package Details: dolfinx-git 0.9.0.dev0_r27933.de18733-1

Git Clone URL: https://aur.archlinux.org/dolfinx-git.git (read-only, click to copy)
Package Base: dolfinx-git
Description: Next generation FEniCS problem solving environment
Upstream URL: https://fenicsproject.org
Licenses: MIT
Conflicts: dolfinx
Provides: dolfinx
Submitter: rmsc
Maintainer: rmsc (carlosal1015)
Last Packager: rmsc
Votes: 1
Popularity: 0.000058
First Submitted: 2023-08-23 15:57 (UTC)
Last Updated: 2024-09-17 17:36 (UTC)

Latest Comments

rmsc commented on 2023-09-29 10:12 (UTC)

First of all, thanks for the comment.

This is a split PKGBUILD and it's meant to produce two packages by design. That way the user may choose to install just the c++ library if he chooses to. Compilation is already only done once.

See here: https://man.archlinux.org/man/PKGBUILD.5#PACKAGE_SPLITTING

entshuld commented on 2023-09-28 21:05 (UTC)

In this way, you avoid multiple installations and buildings (it's a hack):

_base=dolfinx
pkgname=(dolfinx-git dolfinx-git-test)
...
build() {
  [ -n "$PETSC_DIR" ] && [ -f /etc/profile.d/petsc.sh ] && source /etc/profile.d/petsc.sh
  [ -n "$SLEPC_DIR" ] && [ -f /etc/profile.d/slepc.sh ] && source /etc/profile.d/slepc.sh

  build_dir="${_base}"/cpp/build
  CONFOPTS=(
    -S "${_base}"/cpp
    -B "${build_dir}"
    -DCMAKE_BUILD_TYPE=None
    -DCMAKE_INSTALL_PREFIX=/usr
    -DBUILD_SHARED_LIBS=TRUE
    -DCMAKE_CXX_STANDARD=20
    -DCMAKE_C_COMPILER=mpicc
    -DCMAKE_CXX_COMPILER=mpicxx
    -DDOLFINX_ENABLE_ADIOS2=ON
    -DDOLFINX_ENABLE_SCOTCH=ON
    -DDOLFINX_ENABLE_PARMETIS=OFF
    -DDOLFINX_ENABLE_SLEPC=OFF
    -Wno-dev
    # CMAKE_BUILD_PARALLEL_LEVEL
  )
  cmake ${CONFOPTS[@]}

  cmake --build "${build_dir}" --target all --parallel
}

package_dolfinx-git() {
  DESTDIR="${pkgdir}" cmake --install "${_base}"/cpp/build
  install -Dm 644 "${_base}"/COPYING -t "${pkgdir}/usr/share/licenses/${_base}"
  # Remove insecure runpath
  chrpath --delete "${pkgdir}/usr/lib/libdolfinx.so"

  cd "${_base_dir}"/python
  export CMAKE_PREFIX_PATH="${pkgdir}"/usr CMAKE_BUILD_PARALLEL_LEVEL=6
  python -m build --wheel --no-isolation --skip-dependency-check
  PYTHONPYCACHEPREFIX="${PWD}/.cache/cpython/" \
                     python -m installer --destdir="$pkgdir" dist/*.whl

  # Remove insecure runpath
  find "$pkgdir" -iname "cpp.cpython*so" | parallel chrpath --delete
}

package_dolfinx-git-test() {
  # KISS check (instead of installing 3 times)
  cd "${_base_dir}"
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer python/dist/*.whl
  test-env/bin/python -m pytest -ra || printf "Tests failed\n"
}