-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathconfigure.in
187 lines (150 loc) · 4.01 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
# AC_PREREQ(2.61)
AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
AM_INIT_AUTOMAKE
AM_CONDITIONAL([am__fastdepOBJC], false)
AM_CONDITIONAL([am__fastdepCXX], false)
dnl Include GNU make check
builtin(include,src/confdb/check_gnu_make.m4)
dnl Include Fortran related definitions
builtin(include,src/confdb/aclocal_fc.m4)
dnl Include OpenMP related definitions
builtin(include,src/confdb/ax_pthread.m4)
builtin(include,src/confdb/ax_openmp.m4)
dnl Include MPI related definitions
# builtin(include,src/confdb/ax_check_libmpi.m4)
builtin(include,src/confdb/ax_mpi.m4)
dnl Include BLAS library check
builtin(include,src/confdb/ax_blas.m4)
builtin(include,src/confdb/ax_blas_f77_func.m4)
dnl Include hdf5 Check
builtin(include,src/confdb/ax_lib_hdf5.m4)
dnl Include pkg-config Check
builtin(include,src/confdb/pkg.m4)
AC_CONFIG_SRCDIR([src/programs/SPH_MHD/main_sph_MHD_w_psf.f90])
# AC_CONFIG_HEADER([config.h])
AC_ARG_ENABLE(fftw3,
[ --enable-fftw3 Use fftw3 library],[USE_fftw3='yes'],[USE_fftw3='no'])
AC_MSG_RESULT(enable_fftw3... "${USE_fftw3}")
AC_MSG_RESULT(with-blas... "${with_blas}")
# Checks for programs.
AC_PROG_CC
AC_PROG_FC
if test -z ${AR}
then
ar_bin="ar"
else
ar_bin="${AR}"
fi
AC_SUBST(ar_bin)
AC_PROG_MAKE_SET
AC_PROG_RANLIB
# GNU make check
CHECK_GNU_MAKE()
GMAKE=$_cv_gnu_make_command
AC_SUBST(GMAKE)
# libtool check
PKG_PROG_PKG_CONFIG
# Checks using C compiler
AC_LANG_SAVE
AC_LANG(C)
# Check OpenMP
AX_OPENMP
AC_SUBST(OPENMP_CFLAGS)
# Check MPI
AX_MPI
AC_LANG_RESTORE
# Checks using Fortran Compiler
AC_LANG_SAVE
AC_LANG(Fortran)
# Check OpenMP
AX_OPENMP
AC_SUBST(OPENMP_FCFLAGS)
# Check MPI
AX_MPI
AC_LANG_RESTORE
AC_SUBST(MPIDIR)
AC_SUBST(MPILIBS)
AC_SUBST(MPIINCDIR)
# AC_MSG_RESULT(MPIDIR..."${MPIDIR}")
# AC_MSG_RESULT(MPIINCDIR..."${MPIINCDIR}")
# AC_MSG_RESULT(MPILIBS..."${MPILIBS}")
# hdf5 check
AX_LIB_HDF5(parallel)
AC_MSG_RESULT(HDF5_LDFLAGS... "${HDF5_LDFLAGS}")
AC_MSG_RESULT(HDF5_PFLIBS... "${HDF5_PFLIBS}")
# Check BLAS
if test -n "${with_blas}"; then
AX_BLAS
# AX_BLAS_F77_FUNC
fi
AC_SUBST(BLAS_LIBS)
#
# Check subroutien name for Fortran-C connection
#
enable_connect_to_c="no"
if test ${USE_fftw3} = "yes"
then
enable_connect_to_c="yes"
fi
AC_MSG_RESULT(enable_connect_to_c..."${enable_connect_to_c}")
if test ${enable_connect_to_c} = "yes"
then
PAC_PROG_FC_NAME_MANGLE
DFC_NAME_MANGLE="-D${FC_NAME_MANGLE}"
AC_SUBST(DFC_NAME_MANGLE)
AC_MSG_RESULT(DFC_NAME_MANGLE..."${DFC_NAME_MANGLE}")
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([floor memset sqrt strrchr strtol])
# Check FFTW3
if test ${USE_fftw3} = "yes"
then
PKG_CHECK_MODULES([FFTW3], fftw3, have_fftw3=yes, AC_MSG_ERROR(Cannot find FFTW 3.x))
echo "have_fftw3=$have_fftw3"
fi
if test ${have_fftw3} = "yes"
then
PKGFLAGS_FFTW3="fftw3"
fi
AC_SUBST(PKGFLAGS_FFTW3)
AC_SUBST(FFTW3_CFLAGS)
AC_SUBST(FFTW3_LIBS)
fi
AC_MSG_RESULT()
AC_MSG_RESULT(----- Configuration summary -------------------------------)
AC_MSG_RESULT()
if test -n "${OPENMP_FCFLAGS}"; then
AC_MSG_RESULT( Use OpenMP ... yes)
else
AC_MSG_RESULT( Use OpenMP ... no)
fi
AC_MSG_RESULT()
if test -n "${BLAS_LIBS}"; then
AC_MSG_RESULT( Use BLAS ... yes)
else
AC_MSG_RESULT( Use BLAS ... no)
fi
AC_MSG_RESULT()
if test -n "${FFTW3_LIBS}"; then
AC_MSG_RESULT( Use FFTW3 ... yes)
else
AC_MSG_RESULT( Use FFTW3 ... no)
fi
if test -n "${HDF5_PFLIBS}"; then
AC_MSG_RESULT( Use parallel HDF5 ... yes)
else
AC_MSG_RESULT( Use parallel HDF5 ... no)
fi
AC_MSG_RESULT()
AC_MSG_RESULT(---------------------------------------------------------------)
AC_MSG_RESULT()
AC_CONFIG_FILES([Makefile])
AC_OUTPUT