Contribution: Arch Linux PKGBUILD for Code_Saturne

All questions about installation
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
CAVT
Posts: 9
Joined: Wed Mar 14, 2012 9:10 pm

Contribution: Arch Linux PKGBUILD for Code_Saturne

Post by CAVT »

Hello to everyone:

As I am using Arch Linux X86_64 on my own PC, I noticed there was no package for Code_Saturne, the MED package was outdated and so were Salome packages. For those unfamiliar with Arch, it has a ports-like system similar to BSD or Gentoo's ebuilds, which in Arch are called Pkgbuilds. They are used along binary distribution of common software, and many of them are stored in the AUR (an official but unsupported repo for pkgbuilds).
I'm posting two pkgbuilds, one for MED 3.0.5 and another for Code_Saturne 2.3.2, both should work on i686 and X86_64. I have partially tested both installations, so I cannot guarantee yet reliable functioning. Install first MED and then Code_Saturne, as doing opposite would yield Code_Saturne pulling MED 2.6 instead of 3.0.5. I have not included CGNS as a dependency because while Saturne asks for CGNS>3.1, Arch binary package is for version 2.X.X and is a dependency of Paraview. It can be solved but it may imply rebuilding Paraview, which is readily available as a binary in Arch.
Well, for all those interested, feel free to test and modify a piacere these pkgbuilds. I may upload them to the AUR if I see there's no problem.

PKGBUILD for MED:

Code: Select all

# Maintainer: Michele Mocciola <mickele>
# Contributor: Brice Méalier <mealier_brice@yahoo.fr>
# Modified by: César Vecchio <cesar UNDERSTRIKE vecchio AT yahoo DOT com>

pkgname=med
pkgver=3.0.5
pkgrel=1
pkgdesc="MED stands for Modelisation et Echanges de Donnees, i.e. Data Modelization and Exchanges - MED is code-aster exchange module linked to hdf5"
url="http://www.code-aster.org/outils/med/"
license="LGPL"
depends=('hdf5' 'zlib')
makedepends=('gcc-fortran' 'coreutils')
provides=()
conflicts=('med_fichier')
replaces=('med_fichier')
backup=()
arch=('i686' 'x86_64')
source=("http://files.salome-platform.org/Salome/other/${pkgname}-${pkgver}.tar.gz")
md5sums=('192a152e26ee388178500b38ba6b5e7f')

build() {
  if [ "$CARCH" = "x86_64" ]; then
    export FFLAGS="-fopenmp -fPIC -fdefault-double-8 -fdefault-integer-8 -fdefault-real-8 -ffixed-line-length-0 ${CFLAGS}"
    export FCFLAGS="-fopenmp -fPIC -fdefault-double-8 -fdefault-integer-8 -fdefault-real-8 -ffixed-line-length-0 ${CFLAGS}"
    export CPPFLAGS="-DHAVE_F77INT64 ${CPPFLAGS}"
  else # i686
    export FFLAGS="-fopenmp -fPIC -ffixed-line-length-0 ${CFLAGS}"
    export FCFLAGS="-fopenmp -fPIC -ffixed-line-length-0 ${CFLAGS}"
  fi

  cd ${srcdir}/${pkgname}-${pkgver}_SRC || return 1

  ./configure --with-f90=gfortran --prefix=/usr || return 1
  make || return 1
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}_SRC || return 1

  make DESTDIR=${pkgdir} install || return 1

  #mv ${pkgdir}/usr/share/doc ${pkgdir}/usr/share/doc-tmp || return 1
  #mkdir -p ${pkgdir}/usr/share/doc/ || return 1
  #mv ${pkgdir}/usr/share/doc-tmp ${pkgdir}/usr/share/doc/${pkgname} || return 1
#
  #cd ${pkgdir} || return 1
  #for _FILE in `grep -Rl "\-L${srcdir}/${pkgname}-${pkgver}_SRC/src" *`
  #do
    #sed -e "s| \-L${srcdir}/${pkgname}-${pkgver}_SRC/src||" \
    	#-i ${_FILE}
  #done
}
PKGBUILD for Code_Saturne

Code: Select all

# Maintainer: César Vecchio <cesar UNDERSTRIKE vecchio AT yahoo DOT com>

pkgname=code_saturne
pkgver=2.3.2
pkgrel=1
pkgdesc="Open source CFD with GUI. Several turbulence and specific physical models available."
arch=('i686' 'x86_64')
url="http://code-saturne.org"
license=('GPL2')
# groups=()
depends=('python2-pyqt' 'gcc-fortran' 'med' 'libxml2' 'ptscotch-openmpi' 'zlib')
# makedepends=()
# optdepends=()
source=(http://code-saturne.org/cms/sites/default/files/releases/$pkgname-$pkgver.tar.gz)
md5sums=(a3a85f06daf317d5b2ddb0467ceb716a) #generate with 'makepkg -g'

build() {
  cd "$srcdir/$pkgname-$pkgver"

  ./configure --prefix=/usr --libexecdir=/usr/lib --without-cgns PYTHON=/usr/bin/python2 PYUIC4=/usr/bin/python2-pyuic4 FCFLAGS="-fopenmp -fPIC ${CFLAGS}"
  make
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  make DESTDIR="$pkgdir/" install
}
Post Reply