-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
83 lines (79 loc) · 2.19 KB
/
configure.ac
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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([libtetrabz], [2.0.0], [mkawamura@issp.u-tokyo.ac.jp])
AC_CONFIG_AUX_DIR([config])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_HEADERS([config.h])
echo ""
echo " Check compiler"
echo ""
AC_PROG_CC
AC_PROG_F77
AC_ARG_WITH(mpi, [AS_HELP_STRING([--with-mpi],
[compile with MPI (parallelization) support.
If none is found, MPI is not used. Default: no])],,
[with_mpi=no])
if test x"$with_mpi" != xno; then
AX_PROG_FC_MPI(,[FCFLAGS="$FCFLAGS -D__MPI"],[
AC_MSG_FAILURE([MPI compiler requested, but couldn't use MPI.])
])
else
AC_PROG_FC
fi
echo ""
echo " Check OpenMP"
echo ""
AC_ARG_WITH(openmp, [AS_HELP_STRING([--with-openmp],
[compile with OpenMP (parallelization) support.
If none is found, OpenMP is not used. Default: yes])],,
[with_openmp=yes])
if test x"$with_openmp" != xno; then
AX_OPENMP([FCFLAGS="$FCFLAGS $OPENMP_CFLAGS";CFLAGS="$CFLAGS $OPENMP_CFLAGS"],[
AC_MSG_WARN([OpenMP requested, but couldn't use OpenMP.])
])
fi
echo ""
echo " Check fortran module"
echo ""
# Find out how to add to the Fortran include path.
AX_F90_MODULE_FLAG
# The module flag may be "-I " or so, and some make implementations
# swallow trailing space in variable settings, so we employ a little
# trick.
AC_SUBST([empty], [""])
AC_SUBST([FC_MODINC], [$ax_cv_f90_modflag'${empty}'])
# Find out the file name extensions of Fortran module files.
AX_F90_MODULE_EXTENSION
if test "x$ax_f90_modext" != xunknown; then
FC_MODEXT=$ax_cv_f90_modext
else
FC_MODEXT=$ax_cv_f90_modext
fi
AC_SUBST([FC_MODEXT])
echo ""
echo " Check library generation"
echo ""
AM_PROG_AR
AC_PROG_LIBTOOL
#
echo ""
echo " Output files"
echo ""
AC_CONFIG_FILES([
Makefile
src/Makefile
test/Makefile
example/Makefile
])
AC_OUTPUT
echo ""
echo " SUMMARY"
echo ""
echo " FC = ${FC}"
echo " CC = ${CC}"
echo " FCFLAGS = ${FCFLAGS}"
echo " CFLAGS = ${CFLAGS}"
echo ""
echo " Configure done."
echo ""