Hi Jaroslav,

Yes, by adding the following to my $FENICS_INSTALL_HASHDIST_PROFILE

    parameters:
      [...]
      HOST_BLAS_DIR: /usr/local/lib/openblas/current
      HOST_LAPACK: /usr/local/lib/openblas/current
      HOST_OPENBLAS_DIR: /usr/local/lib/openblas/current
      [...]

      PROLOGUE: | # by default, PROLOGUE is a no-op
        source /sfw/Modules/default/init/bash || true; echo "loading
modules"; module use /sfw/Modules/modulefiles; module purge; module load
openblas/0.2.15
      [...]

    packages:
      [...]
      blas:
        use: host-openblas
      lapack:
        use: host-openblas
      openblas:
        use: host-openblas
      [...]

and with a slight generalisation of your suggested host-openblas.yaml
from
https://github.com/JaroslavHron/hashstack/blob/master/pkgs/host-openblas.yaml
to explicitly include -L<dir> command line options for the linker and
patching the FEniCS install script to include this

    cat <<EOF > host-openblas.yaml
    when_build_dependency:
      - {set: 'BLAS_LDFLAGS', value: '-L${OPENBLAS_DIR} -lopenblas'}
      - {set: 'LAPACK_LDFLAGS', value: '-L${OPENBLAS_DIR} -lopenblas'}
      - {prepend_path: 'LD_LIBRARY_PATH', value: '${OPENBLAS_DIR}'}
      - {prepend_path: 'LIBRARY_PATH', value: '${OPENBLAS_DIR}'}
      - {set: 'OPENBLAS_DIR', value: '{{HOST_OPENBLAS_DIR}}'}
    EOF
    sed -i -e '111i# FIXME: This patch is needed to avoid compiling
OpenBLAS from source along with FEniCS leading to a non-portable FEniCS
installation\ncd hashstack; cp -p ../../host-openblas.yaml
pkgs/host-openblas.yaml || true && cd ..\n' fenics-install.sh

I indeed managed to compile a FEniCS 1.6.0 installation that is portable
across compute servers sharing the same operating system but having
different CPUs by relying on the OpenBLAS library compiled for every
compute server independently.

It would have been nice if I could have avoided compiling Python, numpy
etc. along with FEniCS 1.5.0 & 1.6.0, too, because the software is
installed in different paths already anyway. But as of now that seems to
require a few more changes to the build system than the one suggested by
Johannes.

Thanks for the help
Sven
_______________________________________________
fenics-support mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics-support

Reply via email to