-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.in
executable file
·150 lines (127 loc) · 4.75 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#! /bin/sh
# -------------------------------------------------------------
# file: configure.in
# -------------------------------------------------------------
# -------------------------------------------------------------
# Battelle Memorial Institute
# Pacific Northwest Laboratory
# -------------------------------------------------------------
# -------------------------------------------------------------
# Created March 25, 2003 by William A. Perkins
# Last Change: 2015-04-27 12:12:06 d3g096
# -------------------------------------------------------------
# -------------------------------------------------------------
# Initialization
# -------------------------------------------------------------
AC_INIT(MASS2, 0.5)
AM_INIT_AUTOMAKE()
AC_CANONICAL_HOST()
AM_MAINTAINER_MODE()
# -------------------------------------------------------------
# Checks for Programs we need
# -------------------------------------------------------------
AC_PROG_INSTALL()
AC_PROG_FC()
AC_LANG(Fortran)
# -------------------------------------------------------------
# We need an MPI compiler, so check for that first
# -------------------------------------------------------------
ACX_MPI([mpi_ok=1])
if test "x$mpi_ok" != "x1" ; then
AC_MSG_ERROR([Failed to find MPI or F90 MPI compiler], 10)
fi
FC="$MPIFC"
AC_MSG_NOTICE([Configuring parallel MASS2 using MPI])
dnl Make sure the compiler choice is passed to subdirectories
ac_configure_args="$ac_configure_args FC=$FC"
AX_F90_MODULE_EXTENSION()
if test x$ax_cv_f90_modext = x ; then
AC_MSG_ERROR([unable to find f90 modules extension])
fi
AC_SUBST(F90MODEXT)
F90MODEXT=$ax_cv_f90_modext
AX_F90_MODULE_FLAG()
if test x$ax_cv_f90_modflag = x"not found" ; then
AC_MSG_ERROR([unable to determine f90 modules flag])
fi
AC_SUBST(F90MODFLAG)
F90MODFLAG="$ax_cv_f90_modflag"
AC_ARG_VAR(FC_CPPFLAG, [Fortran compiler flag to run C-preprocessor])
# -------------------------------------------------------------
# Check CGNS library
# -------------------------------------------------------------
top_FCFLAGS="$FCFLAGS"
FCFLAGS="$top_FCFLAGS $FC_CPPFLAG"
ACX_CGNS77()
FCFLAGS="$top_FCFLAGS"
# -------------------------------------------------------------
# Check Global Arrays, version 5.0 required
# -------------------------------------------------------------
# Define and check the Global Arrays library
AC_SUBST(GA_FCFLAGS)
AC_SUBST(GA_LIBS)
AC_ARG_VAR(GA_MPILIBS, [extra libraries required by Global Arrays])
AC_ARG_WITH(global-arrays,
AC_HELP_STRING([--with-global-arrays=dir], [Specify the Global Arrays directory]),
GA_DIR=$withval,
GA_DIR="")
# if no target is set, assume GA 5.0 or later which has a different
# set of libraries
GA_LIBS="-lga -larmci ${GA_MPILIBS} -lm"
if test -n "$GA_DIR"; then
GA_FCFLAGS="$GA_FCFLAGS -I${GA_DIR}/include"
GA_LIBS="-L${GA_DIR}/lib ${GA_LIBS}"
if test -n "$GA_TARGET"; then
GA_FCFLAGS="$GA_FCFLAGS -D${GA_TARGET}"
GA_LIBS="-L${GA_DIR}/lib/${GA_TARGET} ${GA_LIBS}"
fi
fi
# -------------------------------------------------------------
# Check PETSc
# -------------------------------------------------------------
petsc_ok=
ACX_PETSC([petsc_ok=1], [petsc_ok=0])
if test x$petsc_ok != x1; then
AC_MSG_ERROR([A working PETSc version 3.x library is required])
fi
# -------------------------------------------------------------
# Some version substitutions
# -------------------------------------------------------------
AC_PATH_PROG(svnversioncommand, svnversion)
if test "X$svnversioncommand" = "X" || test `$svnversioncommand -n '.'` = "exported"; then
svnver=`cat saved_svn_version.txt`
else
svnver=`$svnversioncommand -n '.' `
echo "$svnver" > saved_svn_version.txt
fi
AC_DEFINE_UNQUOTED(MASS2_SVN_REVISION, "$svnver", [svn repository reversion])
AC_PATH_PROG(svncommand, svn)
if test "X$svncommand" = "X"; then
svnver=`cat saved_svn_version_date.txt`
svnpath=`cat saved_svn_path.txt`
else
$svncommand info '.' > /dev/null
if test $? = 0; then
$svncommand info '.' | \
$AWK '/Last Changed Date:/ {sub(/Last Changed Date: */, ""); print $0}' \
> saved_svn_version_date.txt
$svncommand info '.' | \
$AWK '/Relative URL:/ {sub(/Relative URL: *../, ""); print $0}' \
> saved_svn_path.txt
fi
svnver=`cat saved_svn_version_date.txt`
svnpath=`cat saved_svn_path.txt`
fi
AC_DEFINE_UNQUOTED(MASS2_SVN_REVISION_DATE, "$svnver", [svn repository date])
AC_DEFINE_UNQUOTED(MASS2_SVN_PATH, "$svnpath", [svn repository relative path])
unset svnver
# -------------------------------------------------------------
# Output
# -------------------------------------------------------------
AC_CONFIG_FILES([
Makefile
util/Makefile
util/cart_grid/Makefile
])
AC_CONFIG_SUBDIRS(time_series)
AC_OUTPUT()