Commit 96a796e3 authored by Mulas, Giacomo's avatar Mulas, Giacomo
Browse files

fix autoconf to add explicit blas libs (needed for iterative refinement and lapacke)

parent 1b8b28ea
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
LDADD=libnptm/libnptm.la -L/usr/lib64 ${USER_LDFLAGS} ${HDF5_LDFLAGS} ${LAPACKLDFLAGS} ${MAGMALDFLAGS}
LDADD=libnptm/libnptm.la -L/usr/lib64 ${USER_LDFLAGS} ${HDF5_LDFLAGS} ${LAPACKLDFLAGS} ${BLASLDFLAGS} ${MAGMALDFLAGS}
lib_LTLIBRARIES=libnptm/libnptm.la
libnptm_libnptm_la_SOURCES=../src/libnptm/algebraic.cpp ../src/libnptm/clu_subs.cpp ../src/libnptm/Commons.cpp ../src/libnptm/Configuration.cpp ../src/libnptm/file_io.cpp ../src/libnptm/lapack_calls.cpp ../src/libnptm/logging.cpp ../src/libnptm/magma_calls.cpp ../src/libnptm/Parsers.cpp ../src/libnptm/sph_subs.cpp ../src/libnptm/utils.cpp ../src/libnptm/tfrfme.cpp ../src/libnptm/TransitionMatrix.cpp ../src/libnptm/tra_subs.cpp
if BUILDFORTRAN
+1 −1
Original line number Diff line number Diff line
@@ -636,7 +636,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
LDADD = libnptm/libnptm.la -L/usr/lib64 ${USER_LDFLAGS} ${HDF5_LDFLAGS} ${LAPACKLDFLAGS} ${MAGMALDFLAGS}
LDADD = libnptm/libnptm.la -L/usr/lib64 ${USER_LDFLAGS} ${HDF5_LDFLAGS} ${LAPACKLDFLAGS} ${BLASLDFLAGS} ${MAGMALDFLAGS}
lib_LTLIBRARIES = libnptm/libnptm.la
libnptm_libnptm_la_SOURCES = ../src/libnptm/algebraic.cpp ../src/libnptm/clu_subs.cpp ../src/libnptm/Commons.cpp ../src/libnptm/Configuration.cpp ../src/libnptm/file_io.cpp ../src/libnptm/lapack_calls.cpp ../src/libnptm/logging.cpp ../src/libnptm/magma_calls.cpp ../src/libnptm/Parsers.cpp ../src/libnptm/sph_subs.cpp ../src/libnptm/utils.cpp ../src/libnptm/tfrfme.cpp ../src/libnptm/TransitionMatrix.cpp ../src/libnptm/tra_subs.cpp
@BUILDFORTRAN_FALSE@PROGS = cluster/np_cluster inclusion/np_inclusion sphere/np_sphere trapping/np_trapping testing/test_ParticleDescriptor testing/test_TEDF testing/test_TTMS
+29 −5
Original line number Diff line number Diff line
@@ -25208,6 +25208,8 @@ then :
      LAPACK_LDSPEC=""
      MKL_BUILD="mkl-dynamic-lp64-gomp"
    fi # end of 64-bit decision tree
    BLAS_INCLUDE=""
    BLASLDFLAGS=""
    pkg-config --version > /dev/null
    use_pkg_config=$?
    if test "x$use_pkg_config" = "x0"; then
@@ -25221,7 +25223,17 @@ then :
        export LAPACKFLAGS="-DUSE_LAPACK -DUSE_MKL ${LAPACK_ILP64_FLAG} ${MKL_INCLUDE}"
        export LAPACKLDFLAGS=$(pkg-config --libs ${MKL_BUILD})
      else
        # MKL was not found, so configuration searches for LAPACKe
        # MKL was not found, so configuration searches for BLAS
        declare -a pkg_array=$(pkg-config --list-all | grep blas${LAPACK_LDSPEC})
        for i in "${pkg_array[@]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep blas${LAPACK_LDSPEC} > /dev/null
        result=$?
        if test "x$result" = "x0"; then
          # BLAS was found
          BLAS_INCLUDE=$(pkg-config --cflags-only-I blas${LAPACK_LDSPEC})
	  export BLASFLAGS=${BLAS_INCLUDE}
	  export BLASLDFLAGS=$(pkg-config --libs blas${LAPACK_LDSPEC})
        fi # end of BLAS decision tree
        # search for LAPACKe
        declare -a pkg_array=$(pkg-config --list-all | grep lapacke${LAPACK_LDSPEC})
        for i in "${pkg_array[@]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep lapacke${LAPACK_LDSPEC} > /dev/null
        result=$?
@@ -25292,6 +25304,8 @@ else case e in #(
      LAPACK_LDSPEC=""
      MKL_BUILD="mkl-dynamic-lp64-gomp"
    fi # end of 64-bit decision tree
    BLAS_INCLUDE=""
    BLASLDFLAGS=""
    pkg-config --version > /dev/null
    use_pkg_config=$?
    if test "x$use_pkg_config" = "x0"; then
@@ -25305,7 +25319,17 @@ else case e in #(
        export LAPACKFLAGS="-DUSE_LAPACK -DUSE_MKL ${LAPACK_ILP64_FLAG} ${MKL_INCLUDE}"
        export LAPACKLDFLAGS=$(pkg-config --libs ${MKL_BUILD})
      else
        # MKL was not found, so configuration searches for LAPACKe
        # MKL was not found, so configuration searches for BLAS
        declare -a pkg_array=$(pkg-config --list-all | grep blas${LAPACK_LDSPEC})
        for i in "${pkg_array[@]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep blas${LAPACK_LDSPEC} > /dev/null
        result=$?
        if test "x$result" = "x0"; then
          # BLAS was found
          BLAS_INCLUDE=$(pkg-config --cflags-only-I blas${LAPACK_LDSPEC})
	  export BLASFLAGS=${BLAS_INCLUDE}
	  export BLASLDFLAGS=$(pkg-config --libs blas${LAPACK_LDSPEC})
        fi # end of BLAS decision tree
        # search for LAPACKe
        declare -a pkg_array=$(pkg-config --list-all | grep lapacke${LAPACK_LDSPEC})
        for i in "${pkg_array[@]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep lapacke${LAPACK_LDSPEC} > /dev/null
        result=$?
@@ -25346,8 +25370,8 @@ else case e in #(
    if test "x$LAPACKLDFLAGS" != "x"
then :
  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: LAPACK detected. Activating by default (use --without-lapack to disble)." >&5
printf "%s\n" "$as_me: LAPACK detected. Activating by default (use --without-lapack to disble)." >&6;}
  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: LAPACK detected. Activating by default (use --without-lapack to disable)." >&5
printf "%s\n" "$as_me: LAPACK detected. Activating by default (use --without-lapack to disable)." >&6;}
else case e in #(
  e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No LAPACK found." >&5
printf "%s\n" "$as_me: No LAPACK found." >&6;}
@@ -25696,7 +25720,7 @@ else case e in #(
 ;;
esac
fi
CXXFLAGS="$CLANGFLAGS $OPTFLAGS -ggdb $DEBUGFLAGS $OFFLOADFLAGS $USER_INCLUDE -I$HDF5_INCLUDE $OMPFLAGS $MPIFLAGS $LAPACKFLAGS $MAGMAFLAGS $NVTXFLAGS $REFINEFLAGS"
CXXFLAGS="$CLANGFLAGS $OPTFLAGS -ggdb $DEBUGFLAGS $OFFLOADFLAGS $USER_INCLUDE -I$HDF5_INCLUDE $OMPFLAGS $MPIFLAGS $LAPACKFLAGS $BLASFLAGS $MAGMAFLAGS $NVTXFLAGS $REFINEFLAGS"
SUBDIRS="cluster libnptm sphere testing trapping"
# Generate the output
+15 −3
Original line number Diff line number Diff line
@@ -93,6 +93,8 @@ m4_define(
      LAPACK_LDSPEC=""
      MKL_BUILD="mkl-dynamic-lp64-gomp"
    fi # end of 64-bit decision tree
    BLAS_INCLUDE=""
    BLASLDFLAGS=""
    pkg-config --version > /dev/null
    use_pkg_config=$?
    if test "x$use_pkg_config" = "x0"; then
@@ -106,7 +108,17 @@ m4_define(
        export LAPACKFLAGS="-DUSE_LAPACK -DUSE_MKL ${LAPACK_ILP64_FLAG} ${MKL_INCLUDE}"
        export LAPACKLDFLAGS=$(pkg-config --libs ${MKL_BUILD})
      else
        # MKL was not found, so configuration searches for LAPACKe
        # MKL was not found, so configuration searches for BLAS
        declare -a pkg_array=$(pkg-config --list-all | grep blas${LAPACK_LDSPEC})
        for i in "${pkg_array[[@]]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep blas${LAPACK_LDSPEC} > /dev/null
        result=$?
        if test "x$result" = "x0"; then
          # BLAS was found
          BLAS_INCLUDE=$(pkg-config --cflags-only-I blas${LAPACK_LDSPEC})
	  export BLASFLAGS=${BLAS_INCLUDE}
	  export BLASLDFLAGS=$(pkg-config --libs blas${LAPACK_LDSPEC})
        fi # end of BLAS decision tree
        # search for LAPACKe
        declare -a pkg_array=$(pkg-config --list-all | grep lapacke${LAPACK_LDSPEC})
        for i in "${pkg_array[[@]]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep lapacke${LAPACK_LDSPEC} > /dev/null
        result=$?
@@ -552,7 +564,7 @@ AC_ARG_WITH(
    M4_DETECT_LAPACK
    AS_IF(
      [test "x$LAPACKLDFLAGS" != "x"],
      [AC_MSG_NOTICE([LAPACK detected. Activating by default (use --without-lapack to disble).])],
      [AC_MSG_NOTICE([LAPACK detected. Activating by default (use --without-lapack to disable).])],
      [AC_MSG_NOTICE([No LAPACK found.])]
    )
    AC_SUBST([LAPACKFLAGS], [${LAPACKFLAGS}])
@@ -669,7 +681,7 @@ AS_IF(
  [AC_SUBST([OMPFLAGS], [""])],
  [AC_SUBST([OMPFLAGS], [$OMPFLAGS])]
)
CXXFLAGS="$CLANGFLAGS $OPTFLAGS -ggdb $DEBUGFLAGS $OFFLOADFLAGS $USER_INCLUDE -I$HDF5_INCLUDE $OMPFLAGS $MPIFLAGS $LAPACKFLAGS $MAGMAFLAGS $NVTXFLAGS $REFINEFLAGS"
CXXFLAGS="$CLANGFLAGS $OPTFLAGS -ggdb $DEBUGFLAGS $OFFLOADFLAGS $USER_INCLUDE -I$HDF5_INCLUDE $OMPFLAGS $MPIFLAGS $LAPACKFLAGS $BLASFLAGS $MAGMAFLAGS $NVTXFLAGS $REFINEFLAGS"
SUBDIRS="cluster libnptm sphere testing trapping"

# Generate the output