forked from N-BodyShop/changa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
171 lines (156 loc) · 5.09 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
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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT([ChaNGa], [3.1], [[email protected]])
AC_DEFINE_UNQUOTED([NBODY_PACKAGE_VERSION], [$PACKAGE_VERSION])
AC_CONFIG_SRCDIR([Reductions.h])
AC_CONFIG_HEADER([config.h ../utility/structures/config.h])
AC_ARG_VAR([CHARMC], "Charm compiler")
# Checks for programs.
AC_PATH_PROG([CHARMC], [charmc], [no], [$CHARM_DIR/bin:$PATH:../charm/bin:../../charm/bin])
if test "$CHARMC" = "no" ; then
AC_MSG_WARN([Cannnot locate charmc])
AC_MSG_WARN([Try setting your CHARM_DIR environment variable to point at the charm source directory])
exit
fi
CHARM_PATH=${CHARMC%/bin/charmc}
CONV_CONFIG=${CHARM_PATH}/tmp/conv-config.sh
CHARMINC=${CHARM_PATH}/include
AC_SUBST([CHARM_PATH])
. ${CONV_CONFIG}
CXX=${CMK_SEQ_CXX}
CC=${CMK_SEQ_CC}
LD=${CMK_SEQ_LD}
LDXX=${CMK_SEQ_LDXX}
AC_SUBST([AR], [${CMK_AR}])
CPPFLAGS="$CPPFLAGS -I.."
AC_CHECK_FILE(../libs, [LDFLAGS="$LDFLAGS -L../libs"])
AC_PROG_CXX($CHARMC)
# AC_PROG_CC($CHARMC)
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([sys/bittypes.h endian.h limits.h malloc.h stddef.h stdint.h stdlib.h string.h sys/param.h unistd.h values.h])
AC_CHECK_HEADER(netinet/in.h,,[MISSING_NETINET=yes])
if test "${MISSING_NETINET}" = "yes" ; then
CPPFLAGS="$CPPFLAGS -I/usr/include"
fi
AC_CHECK_HEADERS([rpc/types.h])
AC_CHECK_HEADER([rpc/xdr.h],,[MISSING_XDR=yes],
[#ifdef HAVE_RPC_TYPES_H
#include <rpc/types.h>
#endif
])
AC_SEARCH_LIBS([xdr_float], [xdr],,[MISSING_XDR=yes])
if test "${MISSING_XDR}" = "yes" ; then
echo "XDR missing, attempting to use xdr with package"
if test -d ../xdr ; then
ln -s $PWD/../xdr ../rpc
else
echo "Try downloading the xdr package and place it in the parent directory."
echo "And do a make in ../xdr"
exit
fi
CPPFLAGS="$CPPFLAGS -I.."
LDFLAGS="$LDFLAGS -L../xdr"
fi
# physical softening in comoving coordinates:
AC_ARG_ENABLE([changesoft],
[AS_HELP_STRING([--enable-changesoft], [enable physical softening])],
[changesoft=$enableval], [changesoft=yes])
if test "$changesoft" = "yes" ; then
echo "CHANGESOFT selected"
FLAG_CHANGESOFT="-DCHANGESOFT"
else
FLAG_CHANGESOFT=""
fi
AC_SUBST([FLAG_CHANGESOFT])
# 128 bit keys:
AC_ARG_ENABLE([bigkeys],
[AS_HELP_STRING([--enable-bigkeys], [enable 128 bit hash keys])],
[bigkeys=$enableval], [bigkeys=no])
if test "$bigkeys" = "yes" ; then
echo "BIGKEYS selected"
FLAG_BIGKEYS="-DBIGKEYS"
else
FLAG_BIGKEYS=""
fi
AC_SUBST([FLAG_BIGKEYS])
# Wendland C4 Kernel:
AC_ARG_ENABLE([wendland],
[AS_HELP_STRING([--enable-wendland], [enable Wendland C4 Kernel])],
[wendland=$enableval], [wendland=no])
if test "$wendland" = "yes" ; then
echo "WENDLAND selected"
FLAG_KERNEL="-DWENDLAND"
else
FLAG_KERNEL=""
fi
AC_SUBST([FLAG_KERNEL])
# Cooling:
AC_ARG_ENABLE([cooling],
[AS_HELP_STRING([--enable-cooling], [enable gas cooling (planet,cosmo)])],
[cooling=$enableval], [cooling=no])
OBJECTS_COOLING=""
if test "$cooling" = "no" ; then
echo "Adiabatic SPH only selected"
FLAG_COOLING="-DCOOLING_NONE"
elif test "$cooling" = "planet" ; then
echo "Planet cooling selected"
FLAG_COOLING="-DCOOLING_PLANET"
OBJECTS_COOLING="cooling_planet.o stiff.o"
elif test "$cooling" = "cosmo" ; then
echo "Cosmo cooling selected"
FLAG_COOLING="-DCOOLING_COSMO"
OBJECTS_COOLING="cooling_cosmo.o stiff.o"
elif test "$cooling" = "grackle" ; then
echo "Grackle cooling selected"
FLAG_COOLING="-DCOOLING_GRACKLE"
OBJECTS_COOLING="cooling_grackle.o"
ac_cv_libhdf5="yes"
AC_CHECK_LIB([hdf5], [H5Fcreate], [], [ac_cv_libhdf5=no])
if test $ac_cv_libhdf5 = "no" ; then
AC_MSG_WARN([HDF5 library needed for Grackle, but not found]);
AC_MSG_WARN([Try setting LDFLAGS environment with -L<hd5libdir>]);
exit
fi
ac_cv_libgrackle="yes"
AC_CHECK_HEADER(grackle.h, [], [],
[[
#define CONFIG_BFLOAT_8
]])
if test "$ac_cv_header_grackle_h" == no
then
AC_MSG_WARN([grackle header needed for Grackle, but not found])
AC_MSG_WARN([Try setting CPPFLAGS environment with -I <grackledir>])
exit
fi
AC_CHECK_LIB([grackle], [initialize_chemistry_data], [], [ac_cv_libgrackle=no], [-lhdf5])
if test $ac_cv_libgrackle = "no" ; then
AC_MSG_WARN([grackle library needed for Grackle, but not found]);
AC_MSG_WARN([Try setting LDFLAGS environment with -L<gracklelibdir>]);
AC_MSG_WARN([Also remember to set LD_LIBRARY_PATH when running, if grackle and hdf5 are dynamic libraries]);
exit
fi
else
echo "Unknown cooling selected, using Adiabatic"
FLAG_COOLING="-DCOOLING_NONE"
cooling="no"
fi
AC_SUBST([FLAG_COOLING])
AC_SUBST([OBJECTS_COOLING])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_CHECK_TYPES([u_int64_t, u_quad_t, int64_t, quad_t, quad])
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([floor memset pow sqrt strchr])
AC_CHECK_LIB([xdr], [xdr_hyper])
AC_CHECK_FUNCS([xdr_hyper])
AC_CONFIG_FILES([Makefile
../utility/structures/Makefile
])
AC_OUTPUT