source: CONFIG_DEVT/IPSLCM6.5_work_ENSEMBLES/oasis3-mct/lib/mct/mpi-serial/configure.ac @ 5725

Last change on this file since 5725 was 5725, checked in by aclsce, 3 years ago

Added new oasis3-MCT version to be used to handle ensembles simulations with XIOS.

File size: 3.9 KB
Line 
1dnl initialize autoconf
2AC_INIT
3AC_CONFIG_SRCDIR([mpi.h])
4dnl specify config header file
5AC_CONFIG_HEADERS([config.h])
6dnl find c compiler, and fort compiler
7AC_PROG_CC
8AC_PROG_FC
9
10# ARCHIVE COMMAND SIMILAR ACROSS ALL PLATFORMS
11AC_ARG_VAR(AR,Archive Command)
12if test -z "$AR"; then
13   AR="ar cruv"
14fi
15
16# RANLIB
17AC_ARG_VAR(RANLIB,Archive index update command)
18if test -z "$RANLIB"; then
19    # Necessary on Darwin to deal with common symbols (particularly when
20    # using ifort).
21    if test "$SYSDEF"x = DARWINx; then
22        RANLIB="ranlib -c"
23    else
24        AC_PROG_RANLIB
25    fi
26fi
27
28dnl determine fortran name-mangling
29dnl result functions end up in config.h
30AC_FC_WRAPPERS
31
32dnl to determine type of integer needed for fortran
33AC_CHECK_SIZEOF(long)
34
35dnl these are to specify the possible arguments to configure.
36AC_ARG_ENABLE([test-internal],
37 [ --enable-test-internal  Specify internal test as opposed to full suite test]
38 ,AC_DEFINE([TEST_INTERNAL],[],
39  [Perform tests on data copies internally instead of using MPI_Send]))
40
41AC_ARG_ENABLE([info],[ --enable-info  Print extra debugging info],
42 AC_DEFINE([INFO],[],[Print extra debug info]))
43
44AC_ARG_ENABLE([fort-real],
45 [ --enable-fort-real=SIZE    Specify Fortran real size],
46 AC_DEFINE_UNQUOTED([CONFIG_FORT_REAL],[$enable_fort_real],
47  [User-set Fortran real size]))
48AC_ARG_ENABLE([fort-double],
49 [ --enable-fort-double=SIZE  Specify Fortran double size],
50  AC_DEFINE_UNQUOTED([CONFIG_FORT_DOUBLE],[$enable_fort_double],
51   [User-set Fortran double size]))
52AC_ARG_ENABLE([type-checking],
53 [ --enable-type-checking     Perform type checking during communications],
54 AC_DEFINE([TYPE_CHECKING],[],[Perform type checking during communications]))
55
56
57# Determine flag for fortran module include path
58# taken from the MCT configure
59
60AC_ARG_VAR(INCLUDEFLAG,Fortran compiler flag for specifying module search path)
61AC_LANG_PUSH(Fortran)
62AX_FC_VERSION()
63AC_LANG_POP(Fortran)
64
65
66if echo $ac_fc_version_output | grep -i absoft >/dev/null 2>&1; then
67   echo "Fortran Compiler is Absoft"
68   if test -z "$INCLUDEFLAG"; then
69      INCLUDEFLAG="-p"
70   fi
71elif echo $ac_fc_version_output | grep -i workshop >/dev/null 2>&1; then
72   echo "Fortran Compiler is Workshop"
73   if test -z "$INCLUDEFLAG"; then
74      INCLUDEFLAG="-M"
75   fi
76elif echo $ac_fc_version_output | grep -i pgf >/dev/null 2>&1; then
77   echo "Fortran Compiler is Portland Group"
78   LIBS="$LIBS -pgf90libs"
79elif echo $ac_fc_version_output | grep -i nag >/dev/null 2>&1; then
80   echo "Fortran Compiler is NAG"
81   CPRDEF="NAG"
82   if test -z "$FCFLAGS"; then
83     FCFLAGS="-mismatch"
84   fi
85fi
86
87# Test to see if fortran compiler supports the flag
88# -fallow-argument-mismatch flag introduced in gfortran 10.
89#
90# Also allow support for NAG compiler using the -mismatch_all flag.
91#
92# See https://github.com/Unidata/netcdf-fortran/issues/212
93# See https://github.com/Unidata/netcdf-fortran/issues/218
94ac_save_FCFLAGS="$FCFLAGS"
95AC_MSG_CHECKING([if Fortran compiler supports allow-mismatch flag])
96cat <<EOF >conftest.f90
97Program test
98USE ISO_C_BINDING, ONLY: C_PTRDIFF_T
99End Program
100EOF
101doit='$FC -c ${FCFLAGS} ${FCFLAGS_f90} -fallow-argument-mismatch conftest.f90'
102if AC_TRY_EVAL(doit); then
103   nf_allow_mismatch=yes
104   FCFLAGS="${FCFLAGS} -fallow-argument-mismatch"
105  else
106   nf_allow_mismatch=no
107fi
108AC_MSG_RESULT([$nf_allow_mismatch])
109# End testing of gfortan allow-mismatch flags.
110
111AC_MSG_CHECKING([if Fortran compiler supports mismatch_all flag])
112cat <<EOF >conftest.f90
113Program test
114USE ISO_C_BINDING, ONLY: C_PTRDIFF_T
115End Program
116EOF
117doit='$FC -c ${FCFLAGS} ${FCFLAGS_f90} -mismatch_all conftest.f90'
118if AC_TRY_EVAL(doit); then
119   nf_mismatch_all=yes
120   FCFLAGS="${FCFLAGS} -mismatch_all"
121  else
122   nf_mismatch_all=no
123fi
124AC_MSG_RESULT([$nf_mismatch_all])
125
126#end testing of NAG mismatch_all flag.
127
128##
129# End mismatch checks
130##
131
132# INCLUDE FLAG IF NOT ALREADY SET IS MOST LIKELY -I
133if test -z "$INCLUDEFLAG"; then
134   INCLUDEFLAG="-I"
135fi
136
137
138AC_CONFIG_FILES([Makefile.conf])
139AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.