Commit c32bdb9e authored by Andreas Marek's avatar Andreas Marek

Merge branch 'u/loh/master'

parents 86172a69 fefba0f7
*.o
*.lo
*.deps
*.dirstamp
*.libs
*.fortran_dependencies
modules/
......@@ -126,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gnu_make.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/fdep/fortran_dependencies.m4 \
$(top_srcdir)/m4/ax_prog_cxx_mpi.m4 \
$(top_srcdir)/m4/ax_prog_fc_mpi.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
......@@ -674,6 +675,7 @@ LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MPICXX = @MPICXX@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
......
This diff is collapsed.
......@@ -31,7 +31,14 @@ AC_PROG_INSTALL
AM_PROG_CC_C_O
AM_PROG_AR
AM_PROG_AS
AC_PROG_CXX
#AC_PROG_CXX
m4_include([m4/ax_prog_cxx_mpi.m4])
AX_PROG_CXX_MPI([],[have_mpi=yes],[have_mpi=no
if test "x${have_mpi}" = xno; then
AC_MSG_ERROR([no mpi found])
fi])
dnl variables needed for the tests
......@@ -76,7 +83,8 @@ install_complex_avx_block1=no
install_complex_avx_block2=no
AC_MSG_CHECKING(whether SSE assembler kernel can be compiled)
echo " .globl double_hh_trafo_
echo <<EOF > ./test.s
.globl double_hh_trafo_
.globl single_hh_trafo_complex_
.text
......@@ -633,7 +641,8 @@ test_2:
return2:
ret
.align 16,0x90" > ./test.s
.align 16,0x90
EOF
$CC -c ./test.s
if test "$?" == 0; then
......@@ -706,8 +715,9 @@ if test x"${with_avx_optimization}" = xyes; then
CXXFLAGS="$CXXFLAGS -funsafe-loop-optimizations -funsafe-math-optimizations -ftree-vect-loop-version -ftree-vectorize"
fi
AC_LANG(Fortran)
AC_LANG([Fortran])
m4_include([m4/ax_prog_fc_mpi.m4])
dnl check whether an mpi compiler is available;
dnl if not abort since it is mandatory
AX_PROG_FC_MPI([],[have_mpi=yes],[have_mpi=no
......@@ -817,6 +827,7 @@ else
fi
dnl now blacs
AC_SEARCH_LIBS([bi_f77_init],[mpiblacsF77init],[],[],[-lmpiblacs])
AC_SEARCH_LIBS([blacs_gridinit],[mpiblacs],[have_blacs=yes],[have_blacs=no])
AC_MSG_CHECKING([whether we can link a program with a blacs lib])
AC_MSG_RESULT([${have_blacs}])
......@@ -828,7 +839,7 @@ else
fi
dnl now scalapack
AC_SEARCH_LIBS([pdtran],[mpiscalapack],[have_scalapack=yes],[have_scalapack=no])
AC_SEARCH_LIBS([pdtran],[mpiscalapack scalapack],[have_scalapack=yes],[have_scalapack=no])
AC_MSG_CHECKING([whether we can link a program with a scalapack lib])
AC_MSG_RESULT([${have_scalapack}])
......
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_prog_cc_mpi.html
# http://www.gnu.org/software/autoconf-archive/ax_prog_cxx_mpi.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PROG_CC_MPI([MPI-WANTED-TEST[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]])
# AX_PROG_CXX_MPI([MPI-WANTED-TEST[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]])
#
# DESCRIPTION
#
# This macro tries to find out how to compile C programs that use MPI
# This macro tries to find out how to compile C++ programs that use MPI
# (Message Passing Interface), a standard API for parallel process
# communication (see http://www-unix.mcs.anl.gov/mpi/).
# The macro has to be used instead of the standard macro AC_PROG_CC
# and will replace the standard variable CC with the found compiler.
#
# MPI-WANTED-TEST is used to test whether MPI is actually wanted by
# the user. If the test fails, the macro will not try to find MPI
# and call AC_PROG_CC to find a standard C compiler instead. If the
# test is omitted, the macro will try to find MPI and fail if it is
# not found.
#
# When MPI is found, ACTION-IF-FOUND will be executed, otherwise
# ACTION-IF-NOT-FOUND is executed. If ACTION-IF-FOUND is not set,
# the macro will define HAVE_MPI.
#
# EXAMPLE
#
# # If --with-mpi=auto is used, try to find MPI, but use standard C
# compiler if it is not found.
# # If --with-mpi=yes is used, try to find MPI and fail if it isn't
# # found.
# # If --with-mpi=no is used, use a standard C compiler instead.
# AC_ARG_WITH(mpi, [AS_HELP_STRING([--with-mpi],
# [compile with MPI (parallelization) support. If none is found,
# MPI is not used. Default: auto])
# ],,[with_mpi=auto])
#
# AX_PROG_CC_MPI([test x"$with_mpi" != xno],[use_mpi=yes],[
# use_mpi=no
# if test x"$with_mpi" = xyes; then
# AC_MSG_FAILURE([MPI compiler requested, but couldn't use MPI.])
# else
# AC_MSG_WARN([No MPI compiler found, won't use MPI.])
# fi
# ])
# communication (see http://www-unix.mcs.anl.gov/mpi/). The macro has to
# be used instead of the standard macro AC_PROG_CXX and will replace the
# standard variable CXX with the found compiler.
#
# MPI-WANTED-TEST is used to test whether MPI is actually wanted by the
# user. If MPI-WANTED_TEST is omitted or if it succeeds, the macro will
# try to find out how to use MPI, if it fails, the macro will call
# AC_PROG_CC to find a standard C compiler instead.
#
# When MPI is found, ACTION-IF-FOUND will be executed, if MPI is not found
# (or MPI-WANTED-TEST fails) ACTION-IF-NOT-FOUND is executed. If
# ACTION-IF-FOUND is not set, the macro will define HAVE_MPI.
#
# The following example demonstrates usage of the macro:
#
# # If --with-mpi=auto is used, try to find MPI, but use standard C compiler if it is not found.
# # If --with-mpi=yes is used, try to find MPI and fail if it isn't found.
# # If --with-mpi=no is used, use a standard C compiler instead.
# AC_ARG_WITH(mpi, [AS_HELP_STRING([--with-mpi],
# [compile with MPI (parallelization) support. If none is found,
# MPI is not used. Default: auto])
# ],,[with_mpi=auto])
#
# AX_PROG_CXX_MPI([test x"$with_mpi" != xno],[use_mpi=yes],[
# use_mpi=no
# if test x"$with_mpi" = xyes; then
# AC_MSG_FAILURE([MPI compiler requested, but couldn't use MPI.])
# else
# AC_MSG_WARN([No MPI compiler found, won't use MPI.])
# fi
# ])
#
# LICENSE
#
......@@ -75,41 +72,60 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 1
#serial 2
AC_DEFUN([AX_PROG_CC_MPI], [
AC_PREREQ(2.50) dnl for AC_LANG_CASE
AC_DEFUN([AX_PROG_CXX_MPI], [
AC_PREREQ(2.50)
# Check for compiler
AC_REQUIRE([_AX_PROG_CC_MPI],[_AX_PROG_CC_MPI([$1])])
# Needs to be split off into an extra macro to ensure right expansion
# order.
AC_REQUIRE([_AX_PROG_CXX_MPI],[_AX_PROG_CXX_MPI([$1])])
AS_IF([test x"$_ax_prog_cc_mpi_mpi_wanted" = xno],
[ ax_prog_cc_mpi_mpi_found=no ],
AS_IF([test x"$_ax_prog_cxx_mpi_mpi_wanted" = xno],
[ _ax_prog_cxx_mpi_mpi_found=no ],
[
# test whether MPI_Init is available now
AC_CHECK_FUNC(MPI_Init,[ ax_prog_cc_mpi_mpi_found=yes ],
[
# if not, try to find it in a library
AC_SEARCH_LIBS(MPI_Init, [mpi mpich],
[ ax_prog_cc_mpi_mpi_found=yes ],
[ ax_prog_cc_mpi_mpi_found=no ])
])
AC_LANG_PUSH([C++])
# test whether MPI_Init() is available
# We do not use AC_SEARCH_LIBS here, as it caches its outcome and
# thus disallows corresponding calls in the other AX_PROG_*_MPI
# macros.
for lib in NONE mpi mpich; do
save_LIBS=$LIBS
if test x"$lib" = xNONE; then
AC_MSG_CHECKING([for function MPI_Init])
else
AC_MSG_CHECKING([for function MPI_Init in -l$lib])
LIBS="-l$lib $LIBS"
fi
AC_LINK_IFELSE([
AC_LANG_PROGRAM([
extern "C" { void MPI_Init(); }
],[MPI_Init();])],
[ _ax_prog_cxx_mpi_mpi_found=yes ],
[ _ax_prog_cxx_mpi_mpi_found=no ])
AC_MSG_RESULT($_ax_prog_cxx_mpi_mpi_found)
if test "x$_ax_prog_cxx_mpi_mpi_found" = "xyes"; then
break;
fi
LIBS=$save_LIBS
done
echo "ax_prog_cc_mpi_mpi_found=$ax_prog_cc_mpi_mpi_found"
# Check for header
AS_IF([test x"$ax_only_mpi_found" = xyes], [
AS_IF([test x"$_ax_prog_cxx_mpi_mpi_found" = xyes], [
AC_MSG_CHECKING([for mpi.h])
AC_TRY_COMPILE([#include <mpi.h>],,[
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
ax_prog_cc_mpi_mpi_found=no
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <mpi.h>])],
[ AC_MSG_RESULT(yes)],
[ AC_MSG_RESULT(no)
_ax_prog_cxx_mpi_mpi_found=no
])
])
AC_LANG_POP([C++])
])
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
AS_IF([test x"$ax_prog_cc_mpi_mpi_found" = xyes], [
AS_IF([test x"$_ax_prog_cxx_mpi_mpi_found" = xyes], [
ifelse([$2],,[AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.])],[$2])
:
],[
......@@ -117,29 +133,46 @@ AS_IF([test x"$ax_prog_cc_mpi_mpi_found" = xyes], [
:
])
])dnl AX_PROG_CC_MPI
])dnl AX_PROG_CXX_MPI
dnl _AX_PROG_CC_MPI is an internal macro required by AX_PROG_CC_MPI.
dnl To ensure the right expansion order, the main function AX_PROG_CC_MPI
dnl _AX_PROG_CXX_MPI is an internal macro required by AX_PROG_CXX_MPI.
dnl To ensure the right expansion order, the main function AX_PROG_CXX_MPI
dnl has to be split into two parts.
AC_DEFUN([_AX_PROG_CC_MPI], [
AC_ARG_VAR(MPICC,[MPI C compiler command])
ifelse([$1],,[_ax_prog_cc_mpi_mpi_wanted=yes],[
dnl
dnl Known MPI C++ compilers:
dnl mpic++
dnl mpicxx
dnl mpiCC
dnl sxmpic++ NEC SX
dnl hcp
dnl mpxlC_r
dnl mpxlC
dnl mpixlcxx_r
dnl mpixlcxx
dnl mpg++
dnl mpc++
dnl mpCC
dnl cmpic++
dnl mpiFCC Fujitsu
dnl CC
dnl
AC_DEFUN([_AX_PROG_CXX_MPI], [
AC_ARG_VAR(MPICXX,[MPI C++ compiler command])
ifelse([$1],,[_ax_prog_cxx_mpi_mpi_wanted=yes],[
AC_MSG_CHECKING([whether to compile using MPI])
if $1; then
_ax_prog_cc_mpi_mpi_wanted=yes
_ax_prog_cxx_mpi_mpi_wanted=yes
else
_ax_prog_cc_mpi_mpi_wanted=no
_ax_prog_cxx_mpi_mpi_wanted=no
fi
AC_MSG_RESULT($_ax_prog_cc_mpi_mpi_wanted)
AC_MSG_RESULT($_ax_prog_cxx_mpi_mpi_wanted)
])
if test x"$_ax_prog_cc_mpi_mpi_wanted" = xyes; then
if test -z "$CC" && test -n "$MPICC"; then
CC="$MPICC"
if test x"$_ax_prog_cxx_mpi_mpi_wanted" = xyes; then
if test -z "$CXX" && test -n "$MPICXX"; then
CXX="$MPICXX"
else
AC_CHECK_TOOLS([CC], [mpicc hcc mpxlc_r mpxlc mpcc cmpicc])
AC_CHECK_TOOLS([CXX], [mpic++ mpicxx mpiCC sxmpic++ hcp mpxlC_r mpxlC mpixlcxx_r mpixlcxx mpg++ mpc++ mpCC cmpic++ mpiFCC CCicpc pgCC pathCC sxc++ xlC_r xlC bgxlC_r bgxlC openCC sunCC crayCC g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC])
fi
fi
AC_PROG_CC
])dnl _AX_PROG_CC_MPI
AC_PROG_CXX
])dnl _AX_PROG_CXX_MPI
This diff is collapsed.
......@@ -41,7 +41,6 @@ endef
# $2 stem
# $3 program
define module_targets
$(info called module_targets($1,$2,$3))
$(eval _$(3)_use_mods += $(dir $1)$(2)$(call strip_fortran_ext,$(notdir $1)).use_mods.$(call object_extension,$3))
$(dir $1)$(2)$(call strip_fortran_ext,$(notdir $1)).use_mods.$(call object_extension,$3): $1 $(dir $1)$(am__dirstamp)
$(call _f90_verbose,F90 USE [$3] $$<)$(FORTRAN_CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $($p_CPPFLAGS) $(CPPFLAGS) -o /dev/stdout $$< | grep -i -o '^ *use [^ ,!:]*' | sort -u > $$@
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment