From 271dc07a6bc6bc2d3fcdf223ea54d4b9c4cd512d Mon Sep 17 00:00:00 2001 From: edoapra Date: Tue, 14 Nov 2023 22:06:36 -0800 Subject: [PATCH] fix openblas installs --- travis/build_env.sh | 9 ++++++--- travis/nwchem.bashrc | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/travis/build_env.sh b/travis/build_env.sh index 3f8c24ea54..898f3b19d6 100755 --- a/travis/build_env.sh +++ b/travis/build_env.sh @@ -100,6 +100,9 @@ echo DISTR is "$DISTR" fi if [[ "$BLAS_ENV" == "brew_openblas" ]]; then brew install openblas + if [ -z "$HOMEBREW_PREFIX" ] ; then + HOMEBREW_PREFIX=/usr/local + fi PKG_CONFIG_PATH=$HOMEBREW_PREFIX/opt/openblas/lib/pkgconfig pkg-config --libs openblas fi # if [[ "$MPI_IMPL" == "openmpi" ]]; then @@ -131,9 +134,6 @@ if [[ "$os" == "Linux" ]]; then which mpif90 mpif90 -show else - if [[ "$BLAS_ENV" == "lib*openblas*" ]]; then - $MYSUDO apt-get install -y $BLAS_ENV - fi if [[ "$MPI_IMPL" == "openmpi" ]]; then mpi_bin="openmpi-bin" ; mpi_libdev="libopenmpi-dev" scalapack_libdev="libscalapack-openmpi-dev" fi @@ -169,6 +169,9 @@ if [[ "$os" == "Linux" ]]; then if [[ "$USE_LIBXC" == "-1" ]]; then pkg_extra+=" libxc-dev" fi + if [[ "$BLAS_ENV" == "lib*openblas*" ]]; then + pkg_extra+=" $BLAS_ENV" + fi echo pkg to install: gfortran python3-dev make perl python3 rsync $mpi_libdev $mpi_bin $pkg_extra tries=0 ; until [ "$tries" -ge 10 ] ; do \ $MYSUDO apt-get -y install gfortran python3-dev make perl python3 rsync $mpi_libdev $mpi_bin $pkg_extra \ diff --git a/travis/nwchem.bashrc b/travis/nwchem.bashrc index bb5b89c174..7d910ff419 100644 --- a/travis/nwchem.bashrc +++ b/travis/nwchem.bashrc @@ -139,6 +139,9 @@ elif [[ "$BLAS_ENV" == lib*openblas* ]] || [[ "$BLAS_ENV" == "brew_openblas" ]]; myob="openblas" fi if [[ "$BLAS_ENV" == "brew_openblas" ]]; then + if [ -z "$HOMEBREW_PREFIX" ] ; then + HOMEBREW_PREFIX=/usr/local + fi export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOMEBREW_PREFIX/opt/openblas/lib/pkgconfig fi export BLASOPT=$(pkg-config --libs $myob)