-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.ac
104 lines (100 loc) · 2.76 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([komega], [1.1.0], [[email protected]])
AC_CONFIG_AUX_DIR([config])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_HEADERS([config.h])
echo ""
echo " Check compiler"
echo ""
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"],[
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 " Check BLAS and LAPACK"
echo ""
AX_BLAS
AX_LAPACK
#
# Shread-safe
#
AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING([--enable-threadsafe],
[Thread-safe mode (experimental).])],,
[enable_threadsafe=no])
if test x"$enable_threadsafe" != xno; then
FCFLAGS="$FCFLAGS -D__KOMEGA_THREAD"
fi
#
# zdotc and adotu
#
AC_ARG_ENABLE(zdot, [AS_HELP_STRING([--disable-zdot],
[Do not use ZDOTC and ZDOTU in BLAS.])],,
[enable_zdot=yes])
if test x"$enable_zdot" != xyes; then
FCFLAGS="$FCFLAGS -D__NO_ZDOT"
fi
echo ""
echo " Output files"
echo ""
AC_CONFIG_FILES([
Makefile
src/Makefile
test/Makefile
app/src/Makefile
])
AC_OUTPUT
echo ""
echo " SUMMARY"
echo ""
echo " FC = ${FC}"
echo " FCFLAGS = ${FCFLAGS}"
echo " LAPACK_LIBS = ${LAPACK_LIBS}"
echo " BLAS_LIBS = ${BLAS_LIBS}"
echo ""
echo " Configure done."
echo ""