Skip to content
Snippets Groups Projects
Commit 9ce968e8 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Also check Fortran MPI module flags during configure.

parent 295c78fd
No related branches found
No related tags found
No related merge requests found
......@@ -47,14 +47,20 @@ dnl
dnl ######################################################################
dnl Checks for MPI.
dnl ######################################################################
ACX_FORTRAN_PACKAGE([MPI],[mpif.h],,,
[AC_MSG_ERROR([Required include mpif.h not found or not compilable.])],
[mpi_waitall],[mpi mpi_f90 mpi_f77 mpich],[[-lmpi_f77 -lmpi],[-lmpi]],,
[AC_MSG_ERROR([Cannot link Fortran MPI programs.])],[])
ACX_C_PACKAGE([MPI],[mpi.h],,,
[AC_MSG_ERROR([Required header mpi.h not found or not compilable.])],
[MPI_Waitall],[mpi mpich],,,
[AC_MSG_ERROR([Cannot link C MPI programs.])])
ACX_FORTRAN_PACKAGE([MPI],[mpif.h],,,
[AC_MSG_ERROR([Required include mpif.h not found or not compilable.])],
[mpi_waitall],[mpi mpi_f90 mpi_f77 mpich],[[-lmpi_f77 -lmpi],[-lmpi]],,
[AC_MSG_ERROR([Cannot link Fortran MPI programs.])],[])
ACX_F90_PACKAGE([MPI],[mpi],,,
[AC_MSG_ERROR([Required Fortran 90 module not found or incompatible.])],
[mpi_waitall],[mpi mpi_f90 mpi_f77 mpich],[[-lmpi_f77 -lmpi],[-lmpi]],,
[AC_MSG_ERROR([Cannot link Fortran 90 MPI programs.])],,
[ INTEGER :: req(1), stat(mpi_status_size, 1), ierror
],[(1, req, stat, ierror)])
# the following is needed for source parts from libraries with
# optional MPI dependencies
......
dnl acx_fortran_check_include.m4 --- check module inclusion in compilation
dnl
dnl Copyright (C) 2012 Thomas Jahns <jahns@dkrz.de>
dnl
dnl Version: 1.0
dnl Keywords:
dnl Author: Thomas Jahns <jahns@dkrz.de>
dnl Maintainer: Thomas Jahns <jahns@dkrz.de>
dnl URL: https://www.dkrz.de/redmine/projects/show/scales-ppm
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions are
dnl met:
dnl
dnl Redistributions of source code must retain the above copyright notice,
dnl this list of conditions and the following disclaimer.
dnl
dnl Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl Neither the name of the DKRZ GmbH nor the names of its contributors
dnl may be used to endorse or promote products derived from this software
dnl without specific prior written permission.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
dnl IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
dnl TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
dnl PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
dnl OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
dnl EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
dnl PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
dnl PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
dnl LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
dnl NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
dnl SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
dnl
# _ACX_FORTRAN_CHECK_MOD_IFELSE(MOD-FILE,
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
# [PREAMBLE])
# ------------------------------------------------------------------
# Check the compiler accepts MOD-FILE. The PREAMBLE might be defaulted.
m4_defun([_ACX_FORTRAN_CHECK_MOD_IFELSE],
[AC_LANG_PUSH([Fortran])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([program conftest
$4
use $1
end program conftest])],
[AS_VAR_SET([acx_Mod], [yes])])
AC_LANG_POP([Fortran])
AS_VAR_SET_IF([acx_Mod],[$2],[$3])dnl
])# _ACX_FORTRAN_CHECK_MOD_IFELSE
# ACX_FORTRAN_CHECK_MOD_PATHS_IFELSE(MOD-FILE, PATH...
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
# [MODS], [MOD-FLAGS], [TAG])
# ------------------------------------------------------------------
# Check the compiler loads MOD-FILE. The MODS might be defaulted.
# TAG defaults to extra
AC_DEFUN([ACX_FORTRAN_CHECK_MOD_PATHS_IFELSE],
[AC_REQUIRE([AC_PROG_FC])
AC_REQUIRE([ACX_SL_FC_CHECK_MOD_PATH_FLAG])
AS_VAR_PUSHDEF([acx_Mod], [acx_cv_fortran_mod_$1])dnl
AC_MSG_CHECKING([for $1 m4_default([$7],[extra]) module path])
AC_CACHE_VAL([acx_Mod],dnl
[ac_mod_search_FCFLAGS_SAVE="$FCFLAGS"
for ac_moddir in '' $2; do
AS_IF([test -z "$ac_moddir"],
[ac_res="none required"
FCFLAGS="m4_ifval([$6],[$6 ])$ac_mod_search_FCFLAGS_SAVE"],
[ac_res="$FC_MOD_FLAG$ac_moddir"
FCFLAGS="m4_ifval([$6],[$6 ])$ac_res $ac_mod_search_FCFLAGS_SAVE"])
_ACX_FORTRAN_CHECK_MOD_IFELSE([$1],dnl
[AS_IF([test -z "$ac_moddir"],dnl
[AS_VAR_SET([acx_Mod],["$6"])],dnl
[AS_VAR_SET([acx_Mod],["]m4_ifval([$6],[$6 ])[$FC_MOD_FLAG$ac_moddir"])])],,[$5])
AS_VAR_SET_IF([acx_Mod], [break])dnl
done
FCFLAGS="$ac_mod_search_FCFLAGS_SAVE"])
AS_VAR_SET_IF([acx_Mod],dnl
[AS_IF([test x"AS_VAR_GET([acx_Mod])" = x],dnl
[AC_MSG_RESULT([(none required)])],dnl
[AC_MSG_RESULT([AS_VAR_GET([acx_Mod])])])],
[AC_MSG_RESULT([not found])])
AS_VAR_SET_IF([acx_Mod], [$3], [$4])[]dnl
AS_VAR_POPDEF([acx_Mod])dnl
])# ACX_FORTRAN_CHECK_MOD_PATHS_IFELSE
dnl
dnl Local Variables:
dnl mode: autoconf
dnl license-project-url: "https://www.dkrz.de/redmine/projects/show/scales-ppm"
dnl license-default: "bsd"
dnl End:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment