forked from HomerReid/buff-em
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.ac
More file actions
143 lines (116 loc) · 4.79 KB
/
Copy pathconfigure.ac
File metadata and controls
143 lines (116 loc) · 4.79 KB
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
AC_INIT(buff-em, 0.1, homer@homerreid.com)
AC_CONFIG_SRCDIR([README])
# Shared-library version. This has a technical
# meaning related to binary compatibility and is NOT
# the same as the human version number. See http://tinyurl.com/yegqrlz
SHARED_VERSION_INFO="0:0:0" # CURRENT:REVISION:AGE
AM_INIT_AUTOMAKE
LT_INIT
AM_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_MAINTAINER_MODE
AC_SUBST(SHARED_VERSION_INFO)
AC_DISABLE_SHARED dnl shared libs by default cause too much trouble
AC_PROG_CXX
AC_PROG_F77
AC_F77_WRAPPERS
AC_PROG_INSTALL
AC_LANG([C++])
##################################################
# compiler flags
##################################################
AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug],[compile for debugging])], enable_debug=$enableval, enable_debug=no)
if test "x$enable_debug" = xyes; then
CXXFLAGS=-g
FFLAGS=-g
fi
# TODO: set optimization flags? Does it matter, or is the default -g -O2 okay?
# add gcc warnings in debug or maintainer mode
if test "x$enable_debug" = xyes || test "$USE_MAINTAINER_MODE" = yes; then
if test "$ac_test_CFLAGS" != "set"; then
if test $ac_cv_prog_gcc = yes; then
CXXFLAGS="$CXXFLAGS -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align -pedantic -Wno-long-long -Wshadow -Wwrite-strings -Wredundant-decls -pedantic"
fi
fi
fi
##################################################
# threading library
##################################################
AC_ARG_WITH(openmp, [AC_HELP_STRING([--without-openmp],[do not use OpenMP directives for parallelism])], with_openmp=$withval, with_openmp=yesdefault)
if test "x$with_openmp" = xyesdefault; then with_openmp=yes; fi
if test "x$with_openmp" = xyes; then
AC_DEFINE([USE_OPENMP], [1], [Define to use OpenMP threading.])
AX_OPENMP([], [AC_MSG_ERROR([Could not find OpenMP flag; configure with --without-openmp])])
CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS"
fi
# libpthread is needed only for its rwlock implementation
AC_CHECK_LIB(pthread, pthread_rwlock_init)
##################################################
# checks for blas/lapack
##################################################
ACX_BLAS([], [AC_MSG_ERROR([BLAS was not found!])])
ACX_LAPACK([], [AC_MSG_ERROR([LAPACK was not found!])])
LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS"
##################################################
# checks for readline
# (which is used by some test programs)
##################################################
AC_CHECK_LIB(readline, readline)
##################################################
# checks for backtrace functionality, used to
# output useful debugging info to log files in
# the event of code crashes
##################################################
AC_CHECK_HEADERS([execinfo.h])
AC_CHECK_FUNCS([backtrace])
##################################################
# Checks for miscellaneous math functions
##################################################
AC_CHECK_FUNCS([isnan isinf erf erfc copysign])
##################################################
# Checks for scuff-em
##################################################
AC_LANG_PUSH([C++])
AC_CHECK_LIB(scuff, cevaluator_create, [],
[AC_MSG_ERROR([Could not find SCUFF-EM libraries; add -L/path/to/scuff-installation/libs to LDFLAGS.])])
AC_CHECK_HEADERS([libscuff.h], [],
[AC_MSG_ERROR([Could not find SCUFF-EM headers; add -I/path/to/scuff-installation/include/scuff-em to CPPFLAGS.])])
AC_LANG_POP
##################################################
# flags to enable/disable buff-em specific features
##################################################
AC_ARG_ENABLE([torque-integrals],
[AS_HELP_STRING([--enable-torque-integrals],
[enable Taylor-Duffy torque integrals])],
[AC_DEFINE([WITH_TORQUE_INTEGRALS], [], [enable Taylor-Duffy torque integrals])])
##################################################
##################################################
##################################################
AC_CONFIG_FILES([
Makefile
m4/Makefile
src/Makefile
src/libs/Makefile
src/libs/libbuff/Makefile
src/libs/libTTaylorDuffy/Makefile
src/libs/libTTaylorDuffy/UpsilonFiles/Makefile
src/applications/Makefile
src/applications/buff-analyze/Makefile
src/applications/buff-scatter/Makefile
src/applications/buff-neq/Makefile
src/unitTests/Makefile
examples/Makefile
examples/MieScattering/Makefile
examples/JanusParticles/Makefile
examples/SiO2Spheres/Makefile
examples/Pinwheels/Makefile
examples/PhotonTorpedoes/Makefile
])
AC_OUTPUT
##################################################
##################################################
##################################################
AC_MSG_NOTICE([**])
AC_MSG_NOTICE([** The configure process was successful.])
AC_MSG_NOTICE([** Now type 'make' to compile and sudo 'make install'.])
AC_MSG_NOTICE([**])