mirror of https://gitlab.com/QEF/q-e.git
Merge commit '871f1d7f' into gpu-develop
This commit is contained in:
commit
38f8b24a47
|
@ -53,7 +53,6 @@ SUBROUTINE f2libcpv(lib_comm,nim,npt,npl,nta,nbn,ndg,retval,infile)
|
|||
USE mp_pools, ONLY : intra_pool_comm
|
||||
USE mp_world, ONLY : world_comm
|
||||
USE mp_bands, ONLY : inter_bgrp_comm, intra_bgrp_comm
|
||||
USE mp_diag, ONLY : mp_start_diag
|
||||
USE io_global, ONLY : ionode, ionode_id
|
||||
USE environment, ONLY : environment_start
|
||||
USE check_stop, ONLY : check_stop_init
|
||||
|
@ -62,6 +61,9 @@ SUBROUTINE f2libcpv(lib_comm,nim,npt,npl,nta,nbn,ndg,retval,infile)
|
|||
USE parallel_include
|
||||
!
|
||||
IMPLICIT NONE
|
||||
!
|
||||
include 'laxlib.fh'
|
||||
!
|
||||
INTEGER, INTENT(IN) :: lib_comm, nim, npt, npl, nta, nbn, ndg
|
||||
INTEGER, INTENT(INOUT) :: retval
|
||||
CHARACTER(LEN=80) :: infile
|
||||
|
@ -95,7 +97,7 @@ SUBROUTINE f2libcpv(lib_comm,nim,npt,npl,nta,nbn,ndg,retval,infile)
|
|||
!
|
||||
CALL mp_startup ( my_world_comm=lib_comm )
|
||||
ndiag_ = ndg
|
||||
CALL mp_start_diag ( ndiag_, world_comm, intra_bgrp_comm, &
|
||||
CALL laxlib_start ( ndiag_, world_comm, intra_bgrp_comm, &
|
||||
do_distr_diag_inside_bgrp_ = diag_in_band_group_)
|
||||
CALL set_mpi_comm_4_solvers( intra_pool_comm, intra_bgrp_comm, inter_bgrp_comm)
|
||||
CALL environment_start ( 'CP' )
|
||||
|
@ -124,6 +126,7 @@ SUBROUTINE f2libcpv(lib_comm,nim,npt,npl,nta,nbn,ndg,retval,infile)
|
|||
!
|
||||
CALL cpr_loop( 1 )
|
||||
!
|
||||
CALL laxlib_end()
|
||||
CALL stop_run()
|
||||
retval = 0
|
||||
!
|
||||
|
|
|
@ -50,13 +50,15 @@ SUBROUTINE f2libpwscf(lib_comm,nim,npt,npl,nta,nbn,ndg,retval,infile)
|
|||
USE environment, ONLY : environment_start
|
||||
USE mp_global, ONLY : mp_startup
|
||||
USE mp_bands, ONLY : intra_bgrp_comm, inter_bgrp_comm
|
||||
USE mp_diag, ONLY : mp_start_diag
|
||||
USE mp_pools, ONLY : intra_pool_comm
|
||||
USE read_input, ONLY : read_input_file
|
||||
USE command_line_options, ONLY: set_command_line
|
||||
USE parallel_include
|
||||
!
|
||||
IMPLICIT NONE
|
||||
!
|
||||
include 'laxlib.fh'
|
||||
!
|
||||
INTEGER, INTENT(IN) :: lib_comm, nim, npt, npl, nta, nbn, ndg
|
||||
INTEGER, INTENT(INOUT) :: retval
|
||||
CHARACTER(LEN=80) :: infile
|
||||
|
@ -88,7 +90,7 @@ SUBROUTINE f2libpwscf(lib_comm,nim,npt,npl,nta,nbn,ndg,retval,infile)
|
|||
nband=nbn, ndiag=ndg )
|
||||
CALL mp_startup ( my_world_comm=lib_comm , start_images = .true. )
|
||||
ndiag_ = ndg
|
||||
CALL mp_start_diag( ndiag_ , lib_comm, intra_pool_comm, do_distr_diag_inside_bgrp_ = .false.)
|
||||
CALL laxlib_start( ndiag_ , lib_comm, intra_pool_comm, do_distr_diag_inside_bgrp_ = .false.)
|
||||
CALL set_mpi_comm_4_solvers ( intra_pool_comm, intra_bgrp_comm, inter_bgrp_comm)
|
||||
CALL environment_start ( 'PWSCF' )
|
||||
!
|
||||
|
@ -98,6 +100,7 @@ SUBROUTINE f2libpwscf(lib_comm,nim,npt,npl,nta,nbn,ndg,retval,infile)
|
|||
!
|
||||
CALL run_pwscf ( retval )
|
||||
!
|
||||
CALL laxlib_end()
|
||||
CALL stop_run( retval )
|
||||
!
|
||||
END SUBROUTINE f2libpwscf
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2001-2016 Quantum ESPRESSO Foundation
|
||||
# Copyright (C) 2001-2020 Quantum ESPRESSO Foundation
|
||||
|
||||
AC_DEFUN([X_AC_QE_BLAS], [
|
||||
|
||||
|
@ -11,389 +11,139 @@ have_essl=0
|
|||
have_mkl=0
|
||||
have_armpl=0
|
||||
|
||||
|
||||
AC_ARG_WITH(netlib,
|
||||
[AS_HELP_STRING([--with-netlib],
|
||||
[compile with Netlib LAPACK and BLAS (default: no)])],
|
||||
[if test "$withval" = "yes" ; then
|
||||
use_netlib=1
|
||||
else
|
||||
use_netlib=0
|
||||
fi],
|
||||
[use_netlib=0])
|
||||
|
||||
if test "$use_netlib" -eq 0
|
||||
if test "$blas_libs" != ""
|
||||
then
|
||||
if test "$blas_libs" = ""
|
||||
then
|
||||
# check directories in LD_LIBRARY_PATH too
|
||||
# (maybe they are already searched by default, but I'm not sure)
|
||||
ld_library_path=`echo $LD_LIBRARY_PATH | sed 's/:/ /g'`
|
||||
echo setting BLAS from \$BLAS_LIBS with no check ... $blas_libs
|
||||
have_blas=1
|
||||
else
|
||||
# check directories in LD_LIBRARY_PATH too
|
||||
# (maybe they are already searched by default: useless?)
|
||||
ld_library_path=`echo $LD_LIBRARY_PATH | sed 's/:/ /g'`
|
||||
|
||||
case "$arch:$f90" in
|
||||
case "$arch:$f90" in
|
||||
|
||||
x86_64:path* | x86_64:openf95 | crayxt*:* )
|
||||
# check for acml - note that it contains lapack as well
|
||||
try_libdirs="/opt/acml*/pathscale64/lib/"
|
||||
try_libdirs="$ld_library_path $libdirs $try_libdirs"
|
||||
|
||||
for dir in none $try_libdirs
|
||||
do
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
if test "$dir" = "none"
|
||||
then
|
||||
try_loption=
|
||||
else
|
||||
echo $ECHO_N "in $dir: " $ECHO_C
|
||||
try_loption="-L$dir"
|
||||
fi
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$test_ldflags $try_loption"
|
||||
LIBS=""
|
||||
|
||||
if test "$use_openmp" -eq 0; then
|
||||
AC_SEARCH_LIBS(dgemm, acml, have_blas=1 have_lapack=1
|
||||
have_acml=1 blas_libs="$try_loption $LIBS")
|
||||
else
|
||||
AC_SEARCH_LIBS(dgemm, acml_mp, have_blas=1 have_lapack=1
|
||||
have_acml=1 blas_libs="$try_loption $LIBS")
|
||||
fi
|
||||
|
||||
if test "$ac_cv_search_dgemm" != "no"
|
||||
then break ; fi
|
||||
done
|
||||
;;
|
||||
|
||||
x86_64:pgf* )
|
||||
try_libdirs="/opt/acml*/pathscale64/lib/"
|
||||
try_libdirs="$ld_library_path $libdirs $try_libdirs"
|
||||
|
||||
# Check first MKL...
|
||||
for dir in none $try_libdirs
|
||||
do
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
if test "$dir" = "none"
|
||||
then
|
||||
try_loption=
|
||||
else
|
||||
echo $ECHO_N "in $dir: " $ECHO_C
|
||||
try_loption="-L$dir"
|
||||
fi
|
||||
|
||||
# Check first MKL...
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$MKL_FLAGS $test_ldflags $try_loption"
|
||||
LIBS=""
|
||||
|
||||
if test "$use_openmp" -eq 0; then
|
||||
AC_SEARCH_LIBS(dgemm, mkl_intel_lp64,
|
||||
have_blas=1 have_mkl=1
|
||||
blas_libs="$try_loption $LIBS -lmkl_sequential -lmkl_core"
|
||||
ldflags="$MKL_FLAGS $ldflags",
|
||||
echo "MKL not found",
|
||||
-lmkl_sequential -lmkl_core -ldl)
|
||||
else
|
||||
# Detect (again) PGI version
|
||||
pgf_version=`$mpif90 -V 2>&1 | sed '/^$/d' | grep "^pgf" | cut -d ' ' -f2`
|
||||
# From version 19.1, the new llvm backend requires linking to mkl_intel_thread
|
||||
ompimp=""
|
||||
AS_VERSION_COMPARE([$pgf_version], [19.1], [ ompimp="pgi" ], [ ompimp="intel" ], [ ompimp="intel" ] )
|
||||
|
||||
lib_string="-lmkl_${ompimp}_thread -lmkl_core -ldl -lpthread -lm"
|
||||
|
||||
AC_SEARCH_LIBS(dgemm, mkl_intel_lp64,
|
||||
have_blas=1 have_mkl=1
|
||||
blas_libs="$try_loption $LIBS -lmkl_core -lmkl_${ompimp}_thread"
|
||||
ldflags="$MKL_FLAGS $ldflags",
|
||||
echo "MKL not found",
|
||||
$lib_string)
|
||||
fi
|
||||
|
||||
if test "$ac_cv_search_dgemm" != "no"
|
||||
then break ; fi
|
||||
done
|
||||
|
||||
# ... then ACML
|
||||
for dir in none $try_libdirs
|
||||
do
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
if test "$dir" = "none"
|
||||
then
|
||||
try_loption=
|
||||
else
|
||||
echo $ECHO_N "in $dir: " $ECHO_C
|
||||
try_loption="-L$dir"
|
||||
fi
|
||||
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$test_ldflags $try_loption"
|
||||
LIBS=""
|
||||
|
||||
if test "$use_openmp" -eq 0; then
|
||||
AC_SEARCH_LIBS(dgemm, acml, have_blas=1 have_lapack=1
|
||||
have_acml=1 blas_libs="$try_loption $LIBS")
|
||||
else
|
||||
AC_SEARCH_LIBS(dgemm, acml_mp, have_blas=1 have_lapack=1
|
||||
have_acml=1 blas_libs="$try_loption $LIBS")
|
||||
fi
|
||||
|
||||
if test "$ac_cv_search_dgemm" != "no"
|
||||
then break ; fi
|
||||
done
|
||||
;;
|
||||
|
||||
ia64:* )
|
||||
# check for mkl
|
||||
if test "$MKLROOT" == ""
|
||||
then
|
||||
MKLROOT=/opt/intel/mkl
|
||||
fi
|
||||
try_libdirs="$libdirs $MKLROOT/lib/64 $ld_library_path"
|
||||
|
||||
for dir in none $try_libdirs
|
||||
do
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
if test "$dir" = "none"
|
||||
then
|
||||
try_loption=" "
|
||||
else
|
||||
echo $ECHO_N "in $dir: " $ECHO_C
|
||||
try_loption="-L$dir"
|
||||
fi
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$MKL_FLAGS $test_ldflags $try_loption"
|
||||
LIBS=""
|
||||
#
|
||||
# should work for recent MKL versions only
|
||||
#
|
||||
if test "$use_openmp" -eq 0; then
|
||||
if test "$f90" = "gfortran" ; then
|
||||
AC_SEARCH_LIBS(dgemm, mkl_gf_ipf,
|
||||
have_blas=1 have_mkl=1
|
||||
blas_libs="$try_loption $LIBS -lmkl_sequential -lmkl_core"
|
||||
ldflags="$MKL_FLAGS $ldflags",
|
||||
echo "MKL not found",
|
||||
-lmkl_sequential -lmkl_core)
|
||||
else
|
||||
AC_SEARCH_LIBS(dgemm, mkl_intel_ipf,
|
||||
have_blas=1 have_mkl=1
|
||||
blas_libs="$try_loption $LIBS -lmkl_sequential -lmkl_core"
|
||||
ldflags="$MKL_FLAGS $ldflags",
|
||||
echo "MKL not found",
|
||||
-lmkl_sequential -lmkl_core)
|
||||
fi
|
||||
else
|
||||
if test "$f90" = "gfortran"; then
|
||||
AC_SEARCH_LIBS(dgemm, mkl_gf_ipf,
|
||||
have_blas=1 have_mkl=1
|
||||
blas_libs="$try_loption $LIBS -lmkl_gnu_thread -lmkl_core"
|
||||
ldflags="$MKL_FLAGS $ldflags",
|
||||
echo "MKL not found",
|
||||
-lmkl_sequential -lmkl_core)
|
||||
else
|
||||
AC_SEARCH_LIBS(dgemm, mkl_intel_ipf,
|
||||
have_blas=1 have_mkl=1
|
||||
blas_libs="$try_loption $LIBS -lmkl_intel_thread -lmkl_core"
|
||||
ldflags="$MKL_FLAGS $ldflags",
|
||||
echo "MKL not found",
|
||||
-lmkl_sequential -lmkl_core)
|
||||
fi
|
||||
fi
|
||||
if test "$ac_cv_search_dgemm" != "no"
|
||||
then break ; fi
|
||||
done
|
||||
;;
|
||||
|
||||
x86_64:* )
|
||||
if test "$MKLROOT" == ""
|
||||
then
|
||||
MKLROOT=/opt/intel/mkl
|
||||
fi
|
||||
try_libdirs="$libdirs $MKLROOT/lib/intel64 $ld_library_path"
|
||||
|
||||
for dir in none $try_libdirs
|
||||
do
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
if test "$dir" = "none"
|
||||
then
|
||||
try_loption=" "
|
||||
else
|
||||
echo $ECHO_N "in $dir: " $ECHO_C
|
||||
try_loption="-L$dir"
|
||||
fi
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$MKL_FLAGS $test_ldflags $try_loption"
|
||||
LIBS=""
|
||||
#
|
||||
# should work for recent MKL versions only
|
||||
#
|
||||
if test "$use_openmp" -eq 0; then
|
||||
if test "$f90" = "gfortran" ; then
|
||||
AC_SEARCH_LIBS(dgemm, mkl_gf_lp64,
|
||||
have_blas=1 have_mkl=1
|
||||
blas_libs="$try_loption $LIBS -lmkl_sequential -lmkl_core"
|
||||
ldflags="$MKL_FLAGS $ldflags",
|
||||
echo "MKL not found",
|
||||
-lmkl_sequential -lmkl_core)
|
||||
else
|
||||
AC_SEARCH_LIBS(dgemm, mkl_intel_lp64,
|
||||
have_blas=1 have_mkl=1
|
||||
blas_libs="$try_loption $LIBS -lmkl_sequential -lmkl_core"
|
||||
ldflags="$MKL_FLAGS $ldflags",
|
||||
echo "MKL not found",
|
||||
-lmkl_sequential -lmkl_core)
|
||||
fi
|
||||
else
|
||||
if test "$f90" = "gfortran" ; then
|
||||
AC_SEARCH_LIBS(dgemm, mkl_gf_lp64,
|
||||
have_blas=1 have_mkl=1
|
||||
blas_libs="$try_loption $LIBS -lmkl_gnu_thread -lmkl_core"
|
||||
ldflags="$MKL_FLAGS $ldflags",
|
||||
echo "MKL not found",
|
||||
-lmkl_sequential -lmkl_core)
|
||||
else
|
||||
AC_SEARCH_LIBS(dgemm, mkl_intel_lp64,
|
||||
have_blas=1 have_mkl=1
|
||||
blas_libs="$try_loption $LIBS -lmkl_intel_thread -lmkl_core"
|
||||
ldflags="$MKL_FLAGS $ldflags",
|
||||
echo "MKL not found",
|
||||
-lmkl_sequential -lmkl_core)
|
||||
fi
|
||||
fi
|
||||
if test "$ac_cv_search_dgemm" != "no"
|
||||
then break ; fi
|
||||
done
|
||||
;;
|
||||
|
||||
ia32:* )
|
||||
# check for mkl
|
||||
if test "$MKLROOT" == ""
|
||||
then
|
||||
MKLROOT=/opt/intel/mkl
|
||||
fi
|
||||
try_libdirs="$libdirs $MKLROOT/lib/ia32 $ld_library_path"
|
||||
|
||||
for dir in none $try_libdirs
|
||||
do
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
if test "$dir" = "none"
|
||||
then
|
||||
try_loption="-L "
|
||||
else
|
||||
echo $ECHO_N "in $dir: " $ECHO_C
|
||||
try_loption="-L$dir"
|
||||
fi
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$MKL_FLAGS $test_ldflags $try_loption"
|
||||
LIBS=""
|
||||
#
|
||||
# should work for recent MKL versions only
|
||||
#
|
||||
if test "$use_openmp" -eq 0; then
|
||||
if test "$f90" = "gfortran"; then
|
||||
AC_SEARCH_LIBS(dgemm, mkl_gf,
|
||||
have_blas=1 have_mkl=1
|
||||
blas_libs="$try_loption $LIBS -lmkl_sequential -lmkl_core"
|
||||
ldflags="$MKL_FLAGS $ldflags",
|
||||
echo "MKL not found",
|
||||
-lmkl_sequential -lmkl_core)
|
||||
else
|
||||
AC_SEARCH_LIBS(dgemm, mkl_intel,
|
||||
have_blas=1 have_mkl=1
|
||||
blas_libs="$try_loption $LIBS -lmkl_sequential -lmkl_core"
|
||||
ldflags="$MKL_FLAGS $ldflags",
|
||||
echo "MKL not found",
|
||||
-lmkl_sequential -lmkl_core)
|
||||
fi
|
||||
else
|
||||
if test "$f90" = "gfortran" ; then
|
||||
AC_SEARCH_LIBS(dgemm, mkl_gf,
|
||||
have_blas=1 have_mkl=1
|
||||
blas_libs="$try_loption $LIBS -lmkl_gnu_thread -lmkl_core"
|
||||
ldflags="$MKL_FLAGS $ldflags",
|
||||
echo "MKL not found",
|
||||
-lmkl_sequential -lmkl_core)
|
||||
else
|
||||
AC_SEARCH_LIBS(dgemm, mkl_intel,
|
||||
have_blas=1 have_mkl=1
|
||||
blas_libs="$try_loption $LIBS -lmkl_intel_thread -lmkl_core"
|
||||
ldflags="$MKL_FLAGS $ldflags",
|
||||
echo "MKL not found",
|
||||
-lmkl_sequential -lmkl_core)
|
||||
fi
|
||||
fi
|
||||
if test "$ac_cv_search_dgemm" != "no"
|
||||
then break ; fi
|
||||
|
||||
done
|
||||
;;
|
||||
|
||||
necsx:* )
|
||||
#sx5-nec or sx6-nec or sx8-nec: check in (/SX)/usr/lib
|
||||
#sx8-nec-idris: check in /SX/opt/mathkeisan/inst/lib0
|
||||
try_libdirs="/SX/usr/lib /SX/opt/mathkeisan/inst/lib0"
|
||||
for dir in none $try_libdirs
|
||||
do
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
if test "$dir" = "none"
|
||||
then
|
||||
try_loption=
|
||||
else
|
||||
echo $ECHO_N "in $dir: " $ECHO_C
|
||||
try_loption="-L$dir"
|
||||
fi
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$test_ldflags $try_loption"
|
||||
LIBS=""
|
||||
AC_SEARCH_LIBS(dgemm, blas, have_blas=1
|
||||
blas_libs="$try_loption $LIBS")
|
||||
if test "$ac_cv_search_dgemm" != "no"
|
||||
then break ; fi
|
||||
done
|
||||
;;
|
||||
ppc64:* )
|
||||
# check for essl
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$test_ldflags"
|
||||
LIBS=""
|
||||
AC_SEARCH_LIBS(dgemm, essl, have_blas=1
|
||||
blas_libs="$LIBS" )
|
||||
# notice that some IBM machines may not need -lessl
|
||||
# to load blas so the above test may fail
|
||||
if test "`echo $blas_libs | grep essl`" != ""
|
||||
then
|
||||
have_essl=1
|
||||
try_dflags="$try_dflags -D__LINUX_ESSL"
|
||||
fi
|
||||
# OBM:Yet another work-around if the above search
|
||||
# returns "none required"
|
||||
if test "$ac_cv_search_dgemm" = "none required"
|
||||
then
|
||||
echo "There is no need for -lessl in this machine"
|
||||
have_essl=1
|
||||
try_dflags="$try_dflags -D__LINUX_ESSL"
|
||||
fi
|
||||
# search for architecture-specific libraries
|
||||
|
||||
x86_64:* | mac686:* )
|
||||
#
|
||||
# search for MKL in directory $MKL_ROOT
|
||||
#
|
||||
# Following architectures no longer supported:
|
||||
# ia64 $MKLROOT/lib/64 -lmkl_gf_ipf, -lmkl_intel_ipf
|
||||
# ia32 $MKLROOT/lib/ia32 -lmkl_gf , -lmkl_intel
|
||||
#
|
||||
if test "$MKLROOT" == ""; then
|
||||
MKLROOT=/opt/intel/mkl
|
||||
fi
|
||||
case "$f90" in
|
||||
ifort* )
|
||||
mkl_lib="mkl_intel_lp64"
|
||||
mkl_omp="mkl_intel_thread"
|
||||
if test "$arch" == "mac686"; then
|
||||
add_mkl_flag="-openmp"
|
||||
add_mkl_lib="-lpthread"
|
||||
add_mkl_omp="-lpthread"
|
||||
fi
|
||||
;;
|
||||
gfortran* )
|
||||
mkl_lib="mkl_gf_lp64"
|
||||
mkl_omp="mkl_gnu_thread"
|
||||
;;
|
||||
pgf* )
|
||||
# Detect (again) PGI version
|
||||
pgf_version=`$mpif90 -V 2>&1 | sed '/^$/d' | grep "^pgf" | cut -d ' ' -f2`
|
||||
# From version 19.1, the new llvm backend requires linking to mkl_intel_thread
|
||||
ompimp=""
|
||||
AS_VERSION_COMPARE([$pgf_version], [19.1], [ ompimp="pgi" ], [ ompimp="intel" ], [ ompimp="intel" ] )
|
||||
mkl_lib="mkl_${ompimp}_lp64"
|
||||
mkl_omp="mkl_${ompimp}_thread"
|
||||
add_mkl_flag="-pgf90libs"
|
||||
;;
|
||||
esac
|
||||
try_libdirs="$libdirs $MKLROOT/lib/intel64 $ld_library_path"
|
||||
for dir in none $try_libdirs
|
||||
do
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
if test "$dir" = "none"
|
||||
then
|
||||
try_loption=" "
|
||||
else
|
||||
echo $ECHO_N "in $dir: " $ECHO_C
|
||||
try_loption="-L$dir"
|
||||
fi
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$add_mkl_flag $test_ldflags $try_loption"
|
||||
# LIBS=""
|
||||
# not sure the above is needed
|
||||
if test "$use_openmp" -eq 0; then
|
||||
# test MKL (no OMP)
|
||||
AC_SEARCH_LIBS(dgemm, $mkl_lib,
|
||||
have_blas=1 have_mkl=1
|
||||
blas_libs="$try_loption $LIBS -lmkl_sequential -lmkl_core"
|
||||
ldflags="$add_mkl_flag $ldflags",
|
||||
echo "MKL not found",
|
||||
-lmkl_sequential -lmkl_core $add_mkl_lib)
|
||||
else
|
||||
# test MKL (OMP)
|
||||
AC_SEARCH_LIBS(dgemm, $mkl_lib,
|
||||
have_blas=1 have_mkl=1
|
||||
blas_libs="$try_loption $LIBS -l$mkl_omp -lmkl_core"
|
||||
ldflags="$add_mkl_flag $ldflags",
|
||||
echo "MKL not found",
|
||||
-l$mkl_omp -lmkl_core $add_mkl_omp)
|
||||
fi
|
||||
if test "$ac_cv_search_dgemm" != "no"
|
||||
then break ; fi
|
||||
done
|
||||
;;
|
||||
|
||||
ppc64:* )
|
||||
#
|
||||
# search for ESSL - newer (?) powerPC machines
|
||||
#
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$test_ldflags"
|
||||
LIBS=""
|
||||
AC_SEARCH_LIBS(dgemm, essl, have_blas=1
|
||||
blas_libs="$LIBS" )
|
||||
# notice that some IBM machines may not need -lessl
|
||||
# to load blas so the above test may fail
|
||||
if test "`echo $blas_libs | grep essl`" != ""
|
||||
then
|
||||
have_essl=1
|
||||
try_dflags="$try_dflags -D__LINUX_ESSL"
|
||||
fi
|
||||
# OBM:Yet another work-around if the above search
|
||||
# returns "none required"
|
||||
if test "$ac_cv_search_dgemm" = "none required"
|
||||
then
|
||||
echo "There is no need for -lessl in this machine"
|
||||
have_essl=1
|
||||
try_dflags="$try_dflags -D__LINUX_ESSL"
|
||||
fi
|
||||
# we need esslsmp for hybrid (MPI+OpenMP) build
|
||||
if test "$have_essl"="1"; then
|
||||
if test "$use_openmp" -ne 0 ; then
|
||||
blas_libs="-lesslsmp"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
;;
|
||||
|
||||
ppc64-*:* )
|
||||
# assume essl
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$test_ldflags"
|
||||
have_blas=1
|
||||
have_essl=1
|
||||
ppc64-*:* )
|
||||
#
|
||||
# assume ESSL without testing - old powerPC machines, BlueGene
|
||||
#
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$test_ldflags"
|
||||
have_blas=1
|
||||
have_essl=1
|
||||
# BlueGene: for some obscure reason there is no need to
|
||||
# specify a library path to have essl linked, while
|
||||
# in reality it is needed to specify where essl are
|
||||
if test "$arch"="ppc64-bg"; then
|
||||
try_dflags="$try_dflags -D__LINUX_ESSL"
|
||||
if test "$arch"="ppc64-bg"; then
|
||||
try_dflags="$try_dflags -D__LINUX_ESSL"
|
||||
if test "$blas_libs"=""; then
|
||||
if test "$use_openmp" -eq 0 ; then
|
||||
blas_libs="-L/opt/ibmmath/essl/4.4/lib/ -lesslbg"
|
||||
|
@ -401,185 +151,209 @@ then
|
|||
blas_libs="-L/opt/ibmmath/essl/4.4/lib/ -lesslsmpbg"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
try_dflags="$try_dflags -D__LINUX_ESSL"
|
||||
fi
|
||||
;;
|
||||
mac686:* )
|
||||
try_libdirs="$libdirs /opt/intel/mkl/lib $ld_library_path"
|
||||
else
|
||||
try_dflags="$try_dflags -D__LINUX_ESSL"
|
||||
fi
|
||||
;;
|
||||
|
||||
arm:armflang )
|
||||
# search for ARM libs - ARM compiler
|
||||
if test "$use_openmp" -eq 0; then
|
||||
FFLAGS="-armpl"
|
||||
else
|
||||
FFLAGS="-fopenmp -armpl=parallel"
|
||||
fi
|
||||
AC_SEARCH_LIBS(dgemm, armpl_arm,
|
||||
have_blas=1 have_armpl=1
|
||||
blas_libs=""
|
||||
ldflags="$ldflags \$(FFLAGS)",
|
||||
echo "armpl not found",
|
||||
yes)
|
||||
if test "$have_armpl" -eq 1; then
|
||||
if test "$use_openmp" -eq 0; then
|
||||
fflags="$fflags -armpl"
|
||||
else
|
||||
fflags="$fflags -armpl=parallel"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
for dir in none $try_libdirs
|
||||
do
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
if test "$dir" = "none"
|
||||
then
|
||||
try_loption=""
|
||||
arm:gfortran )
|
||||
# search for ARM libs - gfortran compiler
|
||||
try_libdirs="$libdirs $ARMPL_LIBRARIES $ld_library_path"
|
||||
for dir in none $try_libdirs
|
||||
do
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
if test "$dir" = "none"
|
||||
then
|
||||
try_loption=" "
|
||||
else
|
||||
echo $ECHO_N "in $dir: " $ECHO_C
|
||||
try_loption="-L$dir"
|
||||
fi
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$test_ldflags $try_loption"
|
||||
# LIBS=""
|
||||
# not sure the above is needed
|
||||
#
|
||||
if test "$use_openmp" -eq 0; then
|
||||
AC_SEARCH_LIBS(dgemm, armpl,
|
||||
have_blas=1 have_armpl=1
|
||||
blas_libs="$try_loption $LIBS "
|
||||
ldflags="$ldflags",
|
||||
echo "armpl not found",
|
||||
)
|
||||
else
|
||||
echo $ECHO_N "in $dir: " $ECHO_C
|
||||
try_loption="-L$dir"
|
||||
fi
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$MKL_FLAGS $test_ldflags $try_loption"
|
||||
LIBS=""
|
||||
#
|
||||
if test "$use_openmp" -eq 0; then
|
||||
AC_SEARCH_LIBS(dgemm, mkl_intel,
|
||||
have_blas=1 have_mkl=1
|
||||
blas_libs="$try_loption $LIBS -lmkl_sequential -lmkl_core -lpthread"
|
||||
ldflags="$MKL_FLAGS $ldflags",
|
||||
echo "MKL not found",
|
||||
-lmkl_sequential -lmkl_core -lpthread)
|
||||
else
|
||||
AC_SEARCH_LIBS(dgemm, mkl_intel,
|
||||
have_blas=1 have_mkl=1
|
||||
blas_libs="$try_loption $LIBS -lmkl_intel_thread -lmkl_core -openmp -lpthread"
|
||||
ldflags="$MKL_FLAGS $ldflags",
|
||||
echo "MKL not found",
|
||||
-lmkl_intel_thread -lmkl_core -openmp -lpthread)
|
||||
fi
|
||||
#
|
||||
if test "$ac_cv_search_dgemm" != "no"
|
||||
then break ; fi
|
||||
done
|
||||
;;
|
||||
arm:armflang )
|
||||
if test "$use_openmp" -eq 0; then
|
||||
FFLAGS="-armpl"
|
||||
add_ld_flags="-armpl"
|
||||
else
|
||||
FFLAGS="-fopenmp -armpl=parallel"
|
||||
add_ld_flags="-armpl=parallel"
|
||||
fi
|
||||
AC_SEARCH_LIBS(dgemm, armpl_arm,
|
||||
have_blas=1 have_armpl=1
|
||||
blas_libs=""
|
||||
ldflags="$ldflags \$(FFLAGS)",
|
||||
echo "armpl not found",
|
||||
yes)
|
||||
if test "$have_armpl" -eq 1; then
|
||||
if test "$use_openmp" -eq 0; then
|
||||
fflags="$fflags -armpl"
|
||||
else
|
||||
fflags="$fflags -armpl=parallel"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
arm:gfortran )
|
||||
try_libdirs="$libdirs $ARMPL_LIBRARIES $ld_library_path"
|
||||
for dir in none $try_libdirs
|
||||
do
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
if test "$dir" = "none"
|
||||
then
|
||||
try_loption=" "
|
||||
else
|
||||
echo $ECHO_N "in $dir: " $ECHO_C
|
||||
try_loption="-L$dir"
|
||||
fi
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$test_ldflags $try_loption"
|
||||
LIBS=""
|
||||
#
|
||||
if test "$use_openmp" -eq 0; then
|
||||
AC_SEARCH_LIBS(dgemm, armpl,
|
||||
have_blas=1 have_armpl=1
|
||||
blas_libs="$try_loption $LIBS "
|
||||
ldflags="$ldflags",
|
||||
echo "armpl not found",
|
||||
)
|
||||
else
|
||||
AC_SEARCH_LIBS(dgemm, armpl_mp,
|
||||
have_blas=1 have_armpl=1
|
||||
blas_libs="$try_loption $LIBS "
|
||||
ldflags="$ldflags",
|
||||
echo "armpl not found",
|
||||
)
|
||||
fi
|
||||
if test "$ac_cv_search_dgemm" != "no"
|
||||
then break ; fi
|
||||
done
|
||||
|
||||
;;
|
||||
esac
|
||||
# blas not (yet) found: look for more possibilities
|
||||
if test "$have_blas" -eq 0
|
||||
then
|
||||
case "$f90" in
|
||||
pgf* )
|
||||
# check for PGI blas
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$test_ldflags"
|
||||
LIBS=""
|
||||
AC_SEARCH_LIBS(dgemm, blas, have_blas=1 blas_libs="$LIBS")
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
AC_SEARCH_LIBS(dgemm, armpl_mp,
|
||||
have_blas=1 have_armpl=1
|
||||
blas_libs="$try_loption $LIBS "
|
||||
ldflags="$ldflags",
|
||||
echo "armpl not found",
|
||||
)
|
||||
fi
|
||||
if test "$ac_cv_search_dgemm" != "no"
|
||||
then break ; fi
|
||||
done
|
||||
;;
|
||||
|
||||
if test "$have_blas" -eq 0
|
||||
then
|
||||
# check for atlas (in several directories)
|
||||
try_libdirs="/usr/local/lib"
|
||||
try_libdirs="$libdirs $try_libdirs $ld_library_path"
|
||||
# obsolescent or obsolete architectures
|
||||
|
||||
crayxt*:* )
|
||||
# check for acml - OBSOLETE?
|
||||
try_libdirs="$ld_library_path $libdirs"
|
||||
for dir in none $try_libdirs
|
||||
do
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
if test "$dir" = "none"
|
||||
then
|
||||
try_loption=
|
||||
else
|
||||
echo $ECHO_N "in $dir: " $ECHO_C
|
||||
try_loption="-L$dir"
|
||||
fi
|
||||
|
||||
for dir in none $try_libdirs
|
||||
do
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
if test "$dir" = "none"
|
||||
then
|
||||
try_loption=
|
||||
else
|
||||
echo $ECHO_N "in $dir: " $ECHO_C
|
||||
try_loption="-L$dir"
|
||||
fi
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$test_ldflags $try_loption"
|
||||
LIBS="-latlas"
|
||||
AC_SEARCH_LIBS(dgemm, f77blas, have_blas=1 have_atlas=1
|
||||
blas_libs="$try_loption $LIBS", , -lg2c)
|
||||
if test "$ac_cv_search_dgemm" != "no"
|
||||
then break ; fi
|
||||
done
|
||||
fi
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$test_ldflags $try_loption"
|
||||
LIBS=""
|
||||
|
||||
# blas still not found
|
||||
if test "$use_openmp" -eq 0; then
|
||||
AC_SEARCH_LIBS(dgemm, acml, have_blas=1 have_lapack=1
|
||||
have_acml=1 blas_libs="$try_loption $LIBS")
|
||||
else
|
||||
AC_SEARCH_LIBS(dgemm, acml_mp, have_blas=1 have_lapack=1
|
||||
have_acml=1 blas_libs="$try_loption $LIBS")
|
||||
fi
|
||||
|
||||
if test "$have_blas" -eq 0
|
||||
then
|
||||
# check for blas (in several directories)
|
||||
try_libdirs="/usr/local/lib"
|
||||
try_libdirs="$libdirs $try_libdirs $ld_library_path"
|
||||
if test "$ac_cv_search_dgemm" != "no"
|
||||
then break ; fi
|
||||
done
|
||||
;;
|
||||
|
||||
for dir in none $try_libdirs
|
||||
do
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
if test "$dir" = "none"
|
||||
then
|
||||
try_loption=
|
||||
else
|
||||
echo $ECHO_N "in $dir: " $ECHO_C
|
||||
try_loption="-L$dir"
|
||||
fi
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$test_ldflags $try_loption"
|
||||
LIBS=""
|
||||
AC_SEARCH_LIBS(dgemm, blas-3 openblas blas, have_blas=1
|
||||
blas_libs="$try_loption $LIBS")
|
||||
if test "$ac_cv_search_dgemm" != "no"
|
||||
then break ; fi
|
||||
done
|
||||
fi
|
||||
else
|
||||
# blas provided in BLAS_LIBS - not checked!
|
||||
have_blas=1
|
||||
fi
|
||||
necsx:* )
|
||||
#sx5-nec or sx6-nec or sx8-nec: check in (/SX)/usr/lib
|
||||
#sx8-nec-idris: check in /SX/opt/mathkeisan/inst/lib0
|
||||
try_libdirs="/SX/usr/lib /SX/opt/mathkeisan/inst/lib0"
|
||||
for dir in none $try_libdirs
|
||||
do
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
if test "$dir" = "none"
|
||||
then
|
||||
try_loption=
|
||||
else
|
||||
echo $ECHO_N "in $dir: " $ECHO_C
|
||||
try_loption="-L$dir"
|
||||
fi
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$test_ldflags $try_loption"
|
||||
LIBS=""
|
||||
AC_SEARCH_LIBS(dgemm, blas, have_blas=1
|
||||
blas_libs="$try_loption $LIBS")
|
||||
if test "$ac_cv_search_dgemm" != "no"
|
||||
then break ; fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
# blas not (yet) found: look for more possibilities
|
||||
|
||||
if test "$have_blas" -eq 0
|
||||
then
|
||||
case "$f90" in
|
||||
pgf* )
|
||||
# check for PGI blas
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$test_ldflags"
|
||||
LIBS=""
|
||||
AC_SEARCH_LIBS(dgemm, blas, have_blas=1 blas_libs="$LIBS")
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test "$have_blas" -eq 0
|
||||
then
|
||||
# check for atlas (in several directories)
|
||||
try_libdirs="$libdirs /usr/local/lib $ld_library_path"
|
||||
|
||||
for dir in none $try_libdirs
|
||||
do
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
if test "$dir" = "none"
|
||||
then
|
||||
try_loption=
|
||||
else
|
||||
echo $ECHO_N "in $dir: " $ECHO_C
|
||||
try_loption="-L$dir"
|
||||
fi
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$test_ldflags $try_loption"
|
||||
LIBS="-latlas"
|
||||
AC_SEARCH_LIBS(dgemm, f77blas, have_blas=1 have_atlas=1
|
||||
blas_libs="$try_loption $LIBS", , -lg2c)
|
||||
if test "$ac_cv_search_dgemm" != "no"
|
||||
then break ; fi
|
||||
done
|
||||
fi
|
||||
|
||||
if test "$have_blas" -eq 0
|
||||
then
|
||||
# check for blas (in several directories)
|
||||
try_libdirs="$libdirs /usr/local/lib $ld_library_path"
|
||||
|
||||
for dir in none $try_libdirs
|
||||
do
|
||||
unset ac_cv_search_dgemm # clear cached value
|
||||
if test "$dir" = "none"
|
||||
then
|
||||
try_loption=
|
||||
else
|
||||
echo $ECHO_N "in $dir: " $ECHO_C
|
||||
try_loption="-L$dir"
|
||||
fi
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$test_ldflags $try_loption"
|
||||
LIBS=""
|
||||
AC_SEARCH_LIBS(dgemm, blas-3 openblas blas, have_blas=1
|
||||
blas_libs="$try_loption $LIBS")
|
||||
if test "$ac_cv_search_dgemm" != "no"
|
||||
then break ; fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$have_blas" -eq 0 ; then
|
||||
# No blas library found: use internal
|
||||
blas_libs_switch="internal"
|
||||
blas_libs="\$(TOPDIR)/LAPACK/libblas.a"
|
||||
else
|
||||
blas_libs_switch="external"
|
||||
echo setting BLAS_LIBS... $blas_libs
|
||||
fi
|
||||
blas_line="BLAS_LIBS=$blas_libs"
|
||||
echo setting BLAS_LIBS... $blas_libs
|
||||
|
||||
|
||||
AC_SUBST(blas_libs)
|
||||
AC_SUBST(blas_line)
|
||||
AC_SUBST(blas_libs_switch)
|
||||
|
||||
]
|
||||
)
|
||||
|
|
|
@ -71,7 +71,7 @@ arm:armflang )
|
|||
try_ldflags="-mcpu=native"
|
||||
try_fflags_openmp="-fopenmp"
|
||||
try_ldfflags_openmp="-fopenmp"
|
||||
try_f90flags="\$(FFLAGS) -x f95-cpp-input"
|
||||
try_f90flags="\$(FFLAGS) -cpp"
|
||||
try_ldflags="-g -mcpu=native"
|
||||
try_ldflags_openmp="-fopenmp"
|
||||
try_ldflags_static="-static -static-flang-libs"
|
||||
|
@ -229,7 +229,7 @@ ppc64-bgq:*xlf* )
|
|||
try_fflags="-O2 -g -pedantic -Wall -Wextra -Wconversion -fimplicit-none -fbacktrace -ffree-line-length-0 -fcheck=all"
|
||||
fi
|
||||
try_fflags_openmp="-fopenmp"
|
||||
try_f90flags="\$(FFLAGS) -x f95-cpp-input"
|
||||
try_f90flags="\$(FFLAGS) -cpp"
|
||||
try_fflags_noopt="-O0 -g"
|
||||
try_ldflags="-g"
|
||||
try_ldflags_openmp="-pthread -fopenmp"
|
||||
|
|
|
@ -1,41 +1,48 @@
|
|||
# Copyright (C) 2001-2016 Quantum ESPRESSO Foundation
|
||||
# Copyright (C) 2001-2020 Quantum ESPRESSO Foundation
|
||||
|
||||
AC_DEFUN([X_AC_QE_FFT], [
|
||||
|
||||
have_fft=0
|
||||
have_fft_include=0
|
||||
|
||||
AC_MSG_CHECKING([FFT])
|
||||
|
||||
# check for FFT libraries (no check for explicit openmp)
|
||||
# supported vendor replacements:
|
||||
# essl on IBM linux machines
|
||||
# ASL/Mathkeisan on Nec
|
||||
# acml on amd
|
||||
if test "$fft_libs" = "" && test "$use_openmp" -eq 0
|
||||
then
|
||||
AC_MSG_CHECKING([FFT])
|
||||
|
||||
if test "$fft_libs" = ""; then
|
||||
# if FFT_LIBS is defined, use it without further checking
|
||||
|
||||
if test "$have_mkl" -eq 1; then
|
||||
# no check needed if MKL libraries have been detected
|
||||
try_dflags="$try_dflags -D__DFTI"
|
||||
# If not set on input, MKLROOT was set when checking blas
|
||||
try_iflags="$try_iflags -I$MKLROOT/include"
|
||||
have_fft=1
|
||||
|
||||
elif test "$have_armpl" -eq 1; then
|
||||
# no check needed if ARM libraries have been detected
|
||||
try_dflags="$try_dflags -D__ARM_LIB"
|
||||
have_fft=1
|
||||
|
||||
elif test "$have_essl" -eq 1; then
|
||||
# no check needed for ESSL on PPC64 machine: TO BE VERIFIED
|
||||
case "$arch" in
|
||||
ppc64* )
|
||||
try_dflags="$try_dflags -D__LINUX_ESSL"
|
||||
;;
|
||||
esac
|
||||
|
||||
elif test "$use_openmp" -eq 0; then
|
||||
|
||||
# check for OBSOLETE? FFT libraries (not for explicit openmp)
|
||||
# ASL/Mathkeisan on Nec (OBSOLETE)
|
||||
# acml on amd
|
||||
|
||||
# check directories in LD_LIBRARY_PATH too
|
||||
# (maybe they are already searched by default, but I'm not sure)
|
||||
ld_library_path=`echo $LD_LIBRARY_PATH | sed 's/:/ /g'`
|
||||
|
||||
case "$arch" in
|
||||
ppc64 | ppc64-mn )
|
||||
# check for essl
|
||||
unset ac_cv_search_dcft # clear cached value
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$test_ldflags"
|
||||
LIBS="$fft_libs"
|
||||
AC_SEARCH_LIBS(dcft, essl, have_fft=1 fft_libs="$LIBS")
|
||||
;;
|
||||
ppc64-bg | ppc64-bgq )
|
||||
# check for esslbg
|
||||
unset ac_cv_search_dcft # clear cached value
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$test_ldflags"
|
||||
LIBS="$fft_libs $blas_libs"
|
||||
AC_SEARCH_LIBS(dcft, esslbg, have_fft=1 fft_libs="$LIBS")
|
||||
;;
|
||||
necsx )
|
||||
# NEC-SX: OBSOLETE?
|
||||
if test "$use_fft_mathkeisan" -ne 0
|
||||
then
|
||||
#sx5-nec or sx6-nec or sx8-nec: check in (/SX)/usr/lib
|
||||
|
@ -97,28 +104,13 @@ then
|
|||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
fi
|
||||
|
||||
if test "$have_fft" -eq 0
|
||||
then
|
||||
# if MKL have been found, select dfti (no need to recheck)
|
||||
if test "$have_mkl" -eq 1
|
||||
then
|
||||
try_dflags="$try_dflags -D__DFTI"
|
||||
# If not set on input, MKLROOT was set when checking blas
|
||||
try_iflags="$try_iflags -I$MKLROOT/include"
|
||||
have_fft=1
|
||||
else
|
||||
if test "$have_armpl" -eq 1; then
|
||||
have_fft=1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check fftw v3 (both native and MKL interfaces)
|
||||
|
||||
if test "$have_fft" -eq 0
|
||||
if test "$have_fft" -eq 0
|
||||
then
|
||||
|
||||
# Nothing found: look for fftw v3
|
||||
|
||||
try_libdirs="/usr/local/lib"
|
||||
try_libdirs="$libdirs $try_libdirs $ld_library_path "
|
||||
for dir in none $try_libdirs
|
||||
|
@ -171,25 +163,23 @@ then
|
|||
|
||||
done
|
||||
fi
|
||||
|
||||
# if no valid FFT library was found, use the local copy
|
||||
if test "$have_fft" -eq 0
|
||||
then
|
||||
echo "using internal copy of FFTW"
|
||||
try_dflags="$try_dflags -D__FFTW"
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
echo "using FFT_LIBS with no testing ... "
|
||||
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT(${fft_libs})
|
||||
|
||||
AC_MSG_RESULT(${fft_libs})
|
||||
fft_line="FFT_LIBS=$fft_libs"
|
||||
|
||||
# if no valid FFT library was found, use the local copy
|
||||
if test "$have_fft" -eq 0
|
||||
then
|
||||
case "$arch" in
|
||||
ppc64-bg | ppc64-bgq )
|
||||
try_dflags="$try_dflags -D__LINUX_ESSL"
|
||||
;;
|
||||
* )
|
||||
try_dflags="$try_dflags -D__FFTW"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
AC_SUBST(fft_libs)
|
||||
AC_SUBST(fft_line)
|
||||
|
||||
|
|
|
@ -1,15 +1,19 @@
|
|||
# Copyright (C) 2001-2016 Quantum ESPRESSO Foundation
|
||||
# Copyright (C) 2001-2020 Quantum ESPRESSO Foundation
|
||||
|
||||
AC_DEFUN([X_AC_QE_LAPACK], [
|
||||
|
||||
have_lapack=0
|
||||
|
||||
# check for lapack - almost all cases implemented here are OBSOLETE
|
||||
if test "$have_mkl" -ne 0 || test "$have_armpl" -ne 0 || test "$have_acml" -ne 0 || test "$have_essl" -ne 0
|
||||
then
|
||||
# MKL or ARM libraries or ACML (obsolete) or ESSL (obsolete?) found:
|
||||
# no need to check for lapack
|
||||
have_lapack=1
|
||||
else
|
||||
# check for lapack
|
||||
have_lapack=0
|
||||
fi
|
||||
#
|
||||
# same supported vendor replacements as for blas
|
||||
# internal version is used if none is found
|
||||
if test "$use_netlib" -eq 0
|
||||
then
|
||||
if test "$have_lapack" -eq 0
|
||||
then
|
||||
if test "$lapack_libs" = ""
|
||||
then
|
||||
# check directories in LD_LIBRARY_PATH too
|
||||
|
@ -18,52 +22,8 @@ if test "$use_netlib" -eq 0
|
|||
|
||||
case "$arch:$f90" in
|
||||
|
||||
ia32:* | ia64:*| x86_64:* )
|
||||
# check for mkl_lapack (if mkl found and acml not found)
|
||||
# OBSOLETE - recent versions of mkl contain lapack
|
||||
if test "$have_mkl" -ne 0 && test "$have_acml" -eq 0
|
||||
then
|
||||
unset ac_cv_search_dspev ac_lib # clear cached value
|
||||
FFLAGS="$test_fflags"
|
||||
LIBS=" $blas_libs"
|
||||
LDFLAGS="$MKL_FLAGS $test_ldflags"
|
||||
AC_SEARCH_LIBS(dspev, mkl_lapack, have_lapack=1)
|
||||
if test "$ac_lib" != "" ; then lapack_libs="-l$ac_lib"; fi
|
||||
fi
|
||||
;;
|
||||
arm:armflang )
|
||||
if test "$have_armpl" -ne 0
|
||||
then
|
||||
unset ac_cv_search_dspev ac_lib
|
||||
if test "$use_openmp" -eq 0; then
|
||||
FFLAGS="-fopenmp -armpl=parallel"
|
||||
else
|
||||
FFLAGS="-armpl"
|
||||
fi
|
||||
AC_SEARCH_LIBS(dspev, armpl_arm, have_lapack=1)
|
||||
fi
|
||||
;;
|
||||
arm:gfortran )
|
||||
if test "$have_armpl" -ne 0
|
||||
then
|
||||
have_lapack=1
|
||||
fi
|
||||
;;
|
||||
ppc64:* )
|
||||
# check for essl
|
||||
unset ac_cv_search_dspev # clear cached value
|
||||
FFLAGS="$test_fflags"
|
||||
LDFLAGS="$test_ldflags"
|
||||
LIBS="$blas_libs"
|
||||
AC_SEARCH_LIBS(dspev, essl, have_lapack=1
|
||||
lapack_libs="$try_loption $LIBS"
|
||||
try_dflags="$try_dflags -D__LINUX_ESSL")
|
||||
# essl may not have been found in previous test on blas
|
||||
if test "$have_lapack" -eq 1; then have_essl=1; fi
|
||||
;;
|
||||
|
||||
necsx:* )
|
||||
# OBSOLETE
|
||||
# NECSX: OBSOLETE?
|
||||
try_libdirs="/SX/usr/lib /SX/opt/mathkeisan/inst/lib0"
|
||||
for dir in none $try_libdirs
|
||||
do
|
||||
|
@ -88,7 +48,7 @@ if test "$use_netlib" -eq 0
|
|||
|
||||
if test "$have_lapack" -eq 0
|
||||
then
|
||||
# check for lapack (in several directories)
|
||||
# generic check for lapack (in several directories)
|
||||
try_libdirs="/usr/local/lib"
|
||||
try_libdirs="$libdirs $try_libdirs $ld_library_path"
|
||||
|
||||
|
@ -107,44 +67,33 @@ if test "$use_netlib" -eq 0
|
|||
LIBS="$blas_libs"
|
||||
AC_SEARCH_LIBS(dspev, lapack-3 lapack, have_lapack=1
|
||||
lapack_libs="$try_loption $LIBS")
|
||||
if test "$ac_cv_search_dspev" != "no"; then
|
||||
# essl must precede lapack (if present)
|
||||
if test "$have_essl" -ne 0 ; then
|
||||
lapack_libs="$blas_libs $lapack_libs"
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
else
|
||||
# lapack provided in LAPACK_LIBS - not checked!
|
||||
# lapack provided in LAPACK_LIBS: not checked
|
||||
echo setting LAPACK from \$LAPACK_LIBS with no check ... $lapack_libs
|
||||
have_lapack=1
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# No lapack library found: use internal lapack
|
||||
|
||||
# No lapack library found or internal lapack esplicitly required
|
||||
|
||||
if test "$have_lapack" -eq 0 -o "$have_blas" -eq 0 -o "$use_netlib" -eq 1 ; then
|
||||
lapack_libs="\$(TOPDIR)/LAPACK/liblapack.a \$(TOPDIR)/LAPACK/libblas.a"
|
||||
if test "$have_lapack" -eq 0 ; then
|
||||
lapack_libs="\$(TOPDIR)/LAPACK/liblapack.a"
|
||||
echo setting LAPACK to internal library ... $lapack_libs
|
||||
lapack_libs_switch="internal"
|
||||
blas_libs_switch="external"
|
||||
else
|
||||
lapack_libs_switch="external"
|
||||
blas_libs_switch="external"
|
||||
fi
|
||||
lapack_line="LAPACK_LIBS=$lapack_libs"
|
||||
|
||||
lapack_line="LAPACK_LIBS=$lapack_libs"
|
||||
AC_SUBST(lapack_libs)
|
||||
AC_SUBST(lapack_libs_switch)
|
||||
AC_SUBST(lapack_line)
|
||||
|
||||
AC_SUBST(lapack_libs)
|
||||
AC_SUBST(lapack_libs_switch)
|
||||
AC_SUBST(lapack_line)
|
||||
|
||||
AC_SUBST(blas_libs_switch)
|
||||
AC_SUBST(lapack_libs_switch)
|
||||
|
||||
AC_CONFIG_FILES(install/make_lapack.inc)
|
||||
AC_CONFIG_FILES(install/make_lapack.inc)
|
||||
|
||||
]
|
||||
)
|
||||
|
|
|
@ -138,8 +138,6 @@ case "$arch" in
|
|||
version=`echo $pgf_version | cut -d ' ' -f2`
|
||||
echo "${ECHO_T}pgf90 $version"
|
||||
f90_in_mpif90="pgf90"
|
||||
# flag to test MKL with PGI
|
||||
MKL_FLAGS="-pgf90libs"
|
||||
elif test "$gfortran_version" != ""
|
||||
then
|
||||
version=`echo $gfortran_version | cut -d ' ' -f3`
|
||||
|
|
Loading…
Reference in New Issue