source: configure.ac @ 4bce076

Revision 4bce076, 5.9 KB checked in by Oleg Batrashev <ogbash@…>, 2 years ago (diff)

Add program that creates Mesh from 'triangle' files.

  • Property mode set to 100644
Line 
1
2AC_INIT(doug, 0.0.263, [olegus@ut.ee])
3[pvmaj=`expr "$PACKAGE_VERSION" : '\([0-9]*\)\.[0-9]*'`]
4[pvmin=`expr "$PACKAGE_VERSION" : '[0-9]*\.\([0-9]*\)'`]
5[pvtiny=`expr "$PACKAGE_VERSION" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`]
6AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], $pvmaj, [DOUG major version])
7AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], $pvmin, [DOUG minor version])
8AC_DEFINE_UNQUOTED([PACKAGE_VERSION_TINY], $pvtiny, [DOUG sub-minor version])
9
10AC_CONFIG_SRCDIR([src/main/DOUG.f90])
11
12# Specify directory for auxillary build tools (e.g., install-sh,
13# config.sub, config.guess) and M4 files.
14AC_CONFIG_AUX_DIR(config)
15
16AM_INIT_AUTOMAKE
17
18mode=normal
19AC_ARG_ENABLE([mode],
20  [AC_HELP_STRING([--enable-mode=<mode>], [normal or no-compile (normal is default)])],
21  [if test "x$enableval" = "xno-compile"; then mode=no-compile; fi])
22
23AM_CONDITIONAL([NO_COMPILE],[test "x$mode" = "xno-compile"])
24
25# ***** MODE=NORMAL
26if test "x$mode" = xnormal; then
27
28AC_DEFINE([D_REAL],,[Use real/complex])
29MAKE_INCLUDE=include
30AC_SUBST([MAKE_INCLUDE])
31
32# ------------------------------------------------------------------------
33# Check to see if MPI enabled and if any special configuration done
34# ------------------------------------------------------------------------
35
36TAC_ARG_CONFIG_MPI
37
38# --- Programs ---
39
40fi # ***** MODE=NORMAL cannot omit AC_PROG_CC, automake will break otherwise
41AC_PROG_CC()
42AC_PROG_LIBTOOL
43# ***** MODE=NORMAL
44if test "$mode" == normal; then
45
46AC_PROG_FC([ifort g95 gfortran], [Fortran 95]) #fortran 95 compiler and dialect
47
48DOUG_CHECK_FC()
49
50# Fortran naming convention
51
52lam_fortran_double_underscore=0
53GET_FORTRAN_EXT_NAME_CONVENTION($FC)
54AC_DEFINE_UNQUOTED(FORTRANDOUBLEUNDERSCORE,
55    $lam_fortran_double_underscore,
56    [Whether fortran symbols have a trailing double underscore or not])
57
58# Sizes of types
59AC_CHECK_SIZEOF(void *)
60AC_CHECK_SIZEOF(int)
61AC_CHECK_SIZEOF(long)
62# (config/get_sizeof_fortran_type.m4)
63SIZEOF_FORTRAN_INT=0
64SIZEOF_FORTRAN_REAL=0
65SIZEOF_FORTRAN_DBLPREC=0
66SIZEOF_FORTRAN_COMPLEX=0
67SIZEOF_FORTRAN_DBLCOMPLEX=0
68GET_SIZEOF_FORTRAN_TYPE(INTEGER, SIZEOF_FORTRAN_INT)
69GET_SIZEOF_FORTRAN_TYPE(REAL, SIZEOF_FORTRAN_REAL)
70GET_SIZEOF_FORTRAN_TYPE(DOUBLE PRECISION, SIZEOF_FORTRAN_DBLPREC)
71GET_SIZEOF_FORTRAN_TYPE(COMPLEX, SIZEOF_FORTRAN_COMPLEX)
72GET_SIZEOF_FORTRAN_TYPE(DOUBLE COMPLEX, SIZEOF_FORTRAN_DBLCOMPLEX)
73AC_DEFINE_UNQUOTED([SIZEOF_FORTRAN_INT], $SIZEOF_FORTRAN_INT, [Size of fortran INTEGER])
74AC_DEFINE_UNQUOTED([SIZEOF_FORTRAN_REAL], $SIZEOF_FORTRAN_REAL, [Size of fortran REAL])
75AC_DEFINE_UNQUOTED([SIZEOF_FORTRAN_DBLPREC], $SIZEOF_FORTRAN_DBLPREC, [Size of fortran DOUBLE PRECISION])
76AC_DEFINE_UNQUOTED([SIZEOF_FORTRAN_COMPLEX], $SIZEOF_FORTRAN_COMPLEX, [Size of fortran COMPLEX])
77AC_DEFINE_UNQUOTED([SIZEOF_FORTRAN_DBLCOMPLEX], $SIZEOF_FORTRAN_DBLCOMPLEX, [Size of fortran DOUBLE COMPLEX])
78
79AC_SUBST(FCFLAGS_F95)
80
81# ------------------------------------------------------------------------
82# MPI link check
83# ------------------------------------------------------------------------
84TAC_ARG_CHECK_MPI
85CHECK_MPI_ABORT_ERROR_CODE_SHIFT()
86AC_DEFINE_UNQUOTED([MPI_ABORT_ERROR_CODE_SHIFT],
87        [$MPI_ABORT_ERROR_CODE_SHIFT],
88        [number of bits error code should be shift when passing to MPI_Abort()])
89
90# Check libraries
91
92AC_LANG_PUSH(Fortran)
93AC_ARG_ENABLE(plplot,[AC_HELP_STRING([--disable-plplot],[do not use plplot])],
94  [if test "X$enableval" != "Xno"; then _search_plplot=yes; fi],[_search_plplot=yes])
95
96if test "X$_search_plplot" = Xyes; then
97AC_CHECK_LIB(plplotf77d, plsdev,
98                         [plplot_found=yes
99                          AC_DEFINE(D_WANT_PLPLOT_YES, [], [Use plplot])
100                          PLPLOT_LIBS="-lplplotf77cd -lplplotf77d"
101                          LIBS="$PLPLOT_LIBS $LIBS"],
102                         [plplot_found=no
103                          AC_DEFINE(D_WANT_PLPLOT_NO, [], [Do not use plplot])],
104                         [-lplplotf77cd])
105else
106AC_DEFINE(D_WANT_PLPLOT_NO, [], [Do not use plplot])
107fi
108
109AC_CHECK_LIB(metis, metis_partgraphkway,,
110                    [AC_MSG_ERROR([metis not found])])
111
112AC_ARG_ENABLE(fxdr,[AC_HELP_STRING([--enable-fxdr],[use Fortran XDR library])],
113  [if test "X$enableval" != "Xno"; then _search_fxdr=yes; fi],[_search_fxdr=no])
114
115
116if test X"$_search_fxdr" = Xyes ; then
117  AC_CHECK_LIB(fxdr, initxdr, [
118    fxdr_found=yes
119    AC_DEFINE([HAVE_LIBFXDR],[1], [Use Fortran XDR IO])
120    LIBS="$LIBS -lfxdr"
121  ], [
122    AC_MSG_ERROR([fxdr not found])
123    fxdr_found=no])
124else
125  fxdr_found=no
126fi
127
128
129AC_LANG_POP(Fortran)
130
131# BLAS
132DOUG_BLAS([blas-intel blas-3 blas goto])
133
134# UMFPACK
135DOUG_UMFPACK([amd-intel amd], [umfpack-intel umfpack4 umfpack])
136
137# MUMPS
138AC_LANG_PUSH(Fortran)
139AC_CHECK_LIB(mumps, dmumps,
140                    [mumps_lib=yes
141                     LIBS="-lmumps $LIBS"
142                     AC_DEFINE([D_WANT_MUMPS_YES],,[Use mumps])],
143                    [mumps_lib=no
144                     AC_DEFINE([D_WANT_MUMPS_NO],,[Do not use mumps])])
145AC_LANG_POP(Fortran)
146
147# Fortran intrinsics
148
149# isnan intrinsic (currently check compiler, but should write test)
150if test -n "`$FC --version|grep gfortran`"; then
151   _has_isnan=0
152   _has_isinf=0
153else
154   _has_isnan=1
155   _has_isinf=0
156fi
157AC_DEFINE_UNQUOTED([HAS_ISNAN],[$_has_isnan], [has isnan intrinsic])
158AC_DEFINE_UNQUOTED([HAS_ISINF],[$_has_isinf], [has isinf intrinsic])
159
160fi # this is the end for mode!=normal
161
162# --- Output ---
163
164AC_CONFIG_HEADERS([src/doug_config.h])
165AC_CONFIG_FILES([Makefile
166        src/Makefile
167        src/main/Makefile
168        src/ext/C/Makefile
169        src/ext/triangle/Makefile
170        doc/Doxyfile
171        doc/Makefile
172        doc/pictures/Makefile
173        scripts/Makefile])
174
175AC_OUTPUT
176
177# Summary
178cat <<EOF
179Summary:
180  mode = $mode
181  FC = $FC
182  blas: $blas_found, BLAS_LIBS = $BLAS_LIBS
183  amd: $amd_found, AMD_LIBS = $AMD_LIBS
184  umfpack: $umfpack_found, UMFPACK_LIBS = $UMFPACK_LIBS
185  plplot: $plplot_found, PLPLOT_LIBS = $PLPLOT_LIBS
186  mumps: $mumps_found, MUMPS_LIBS = $MUMPS_LIBS
187  fxdr: $fxdr_found
188
189  CPPFLAGS = $CPPFLAGS
190  FCFLAGS = $FCFLAGS
191  LDFLAGS = $LDFLAGS
192  LIBS = $LIBS
193
194EOF
Note: See TracBrowser for help on using the repository browser.