123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #!/usr/bin/env bash
- # Script to build and install dolfin_warp with its
- # dependencies (assumes that external packages are ready in
- # the directory)
- sudo torsocks pacman -Sy
- # Install PETSc's (optional and hard) dependencies (from
- # cache files)
- unset deps
- for i in gcc gcc-fortran cmake sowing pkgconf git cython chrpath openmpi lapack libpng libyaml fftw zlib python-mpi4py python-numpy eigen openblas boost cgns gdb hdf5 hwloc metis netcdf-openmpi opencl-headers opencl openmp scotch suitesparse superlu; do
- # Build list of cache files
- file=$(ls /var/cache/pacman/pkg/"${i}"-*.pkg.tar.{xz,zst} \
- 2>/dev/null |
- sort -r | head -n 1)
- # Inform which are found and which aren't
- printf "%s" "${file}... "
- [ -f "${file}" ] &&
- deps=( ${deps[@]} $file) && printf "ok\n" ||
- printf "${i} missing\n"
- done;
- # Download dependencies from repositories
- sudo torsocks pacman -Uw ${deps[@]}
- # Check type of package (zst, xz...)
- pkgtype=$(
- awk -F"=" \
- '/^[[:space:]]*[^#]*PKGEXT/{gsub("'"'"'", ""); print $NF}' \
- /etc/makepkg.conf)
- # These packages are not in Parabola's official repos
- printf "Make sure to have the ${pkgtype} of:\n"
- printf " hypre med mumps petsc scalapack \n"
- printf "Now, hit RET to continue\n"
- read
- deps=( ${deps[@]}
- $(ls {petsc,hypre,med,mumps,scalapack}*.pkg.tar.{xz,zst}\
- 2>/dev/null) )
- set -e
- sudo pacman -U --asdep ${deps[@]}
- unset deps
- # Build and install needed FEniCS packages
- for i in python-ufl-tar python-fiat-tar python-dijitso-tar python-ffc-tar dolfin-tar python-dolfin-tar dolfin_warp; do
- cd "$i";
- pwd;
- git checkout master 1>/dev/null;
- # Retrieve dependencies from PKGBUILD and install them
- # (skip local packages)
- sudo torsocks pacman -S --noconfirm --asdep --needed \
- $(makepkg --printsrcinfo |
- grep -v "\(dijitso\|dolfin\|fiat\|ffc\|ufl\|hypre\|med\|mumps\|petsc\|scalapack\)" |
- awk '/^[[:space:]]*(make)*depends =/{print $NF}')
- for pak in *"${pkgtype}"; do mv "$pak"{,.bak} || break; done
- # Build
- makepkg -moC && makepkg -er;
- # Install
- sudo pacman -U --noconfirm *"${pkgtype}"
- cd -
- done
- set +e
|