-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in.ac
187 lines (141 loc) · 5.7 KB
/
configure.in.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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
################################################################################
# Copyright (c) 2012 Los Alamos National Security, LLC
# All rights reserved.
################################################################################
#------------------------------------------------------------------------------#
# Initialize autoconf
#------------------------------------------------------------------------------#
AC_INIT(ocl-mla, VERSION_TAG, [email protected])
AC_CONFIG_AUX_DIR(config)
VERSION_INFORMATION="VERSION_TAG"
AC_SUBST(VERSION_INFORMATION)
AC_CONFIG_HEADERS([local/ocl_config.h:local/ocl_config.h.in])
#------------------------------------------------------------------------------#
# Initialize automake
#------------------------------------------------------------------------------#
AM_INIT_AUTOMAKE
#------------------------------------------------------------------------------#
# Machine file specification
#------------------------------------------------------------------------------#
CONFIG_WITH_MACHINE("$srcdir/machine")
#------------------------------------------------------------------------------#
# Configuration targets
#------------------------------------------------------------------------------#
AC_CONFIG_FILES([Makefile DEVEL_TARGETS \
lib/Makefile \
utils/Makefile \
local/ocl_local.h \
test/Makefile \
test/c/Makefile \
test/c/atlocal \
test/fc/Makefile \
test/fc/atlocal \
examples/Makefile \
examples/direct/Makefile \
doc/Makefile \
doc/doxygen.conf
])
AC_SUBST(DEVDIRS, ["DEVEL_DIRS"])
#------------------------------------------------------------------------------#
# Defualt device configuration
#------------------------------------------------------------------------------#
if test -z "$OCL_DEVICES" ; then
AC_SUBST(OCL_DEVICES,
["OCL_PERFORMANCE_DEVICE,Intel(R) OpenCL,ocl_init_generic_cpu"])
fi
#------------------------------------------------------------------------------#
# Direct flags
#------------------------------------------------------------------------------#
AC_ARG_VAR([DIRECT_CPPFLAGS], [User specified flags for direct example])
AC_ARG_VAR([DIRECT_LDFLAGS], [User specified link flags for direct example])
if test -z "$DIRECT_CPPFLAGS" ; then
AC_SUBST(DIRECT_CPPFLAGS, [-DENABLE_OCL])
fi
#------------------------------------------------------------------------------#
# Test harness
#------------------------------------------------------------------------------#
AC_CONFIG_TESTDIR([test/c])
AC_CONFIG_TESTDIR([test/fc])
#------------------------------------------------------------------------------#
# Program options
#------------------------------------------------------------------------------#
if test -z "$CFLAGS" ; then
AC_SUBST(CFLAGS, ["-std=c99"])
fi
AC_PROG_CC
AC_PROG_FC
AC_PROG_LIBTOOL
CONFIG_PROG_DOXYGEN
#------------------------------------------------------------------------------#
# With options
#------------------------------------------------------------------------------#
CONFIG_GENERIC_WITH(ocl_devices, OCL_DEVICES, [default])
CONFIG_GENERIC_WITH(fc_module_path_flag, FC_MODULE_PATH_FLAG, [-J])
#------------------------------------------------------------------------------#
# Enable options
#------------------------------------------------------------------------------#
CONFIG_GENERIC_ENABLE(opencl_profiling, OPENCL_PROFILING)
CONFIG_GENERIC_ENABLE(ocl_verbose, OCL_VERBOSE)
CONFIG_GENERIC_ENABLE(ocl_assertions, OCL_ASSERTIONS)
CONFIG_GENERIC_ENABLE(ocl_compiler_log, OCL_COMPILER_LOG)
#------------------------------------------------------------------------------#
# OpenCL
#------------------------------------------------------------------------------#
if test -z "$OPENCL_FRAMEWORK" ; then
if test -z "$OPENCL_CPPFLAGS" ; then
AC_SUBST(OPENCL_CPPFLAGS, ["-I/usr/include"])
fi
if test -z "$OPENCL_LDFLAGS" ; then
AC_SUBST(OPENCL_LDFLAGS, ["-L/usr/lib64"])
fi
if test -z "$OPENCL_LIBS" ; then
AC_SUBST(OPENCL_LIBS, ["-lOpenCL"])
fi
fi
if test -z "$OPENCL_CHECKHEADER" ; then
AC_SUBST(OPENCL_CHECKHEADER, ["CL/opencl.h"])
fi
CONFIG_GENERIC_LIB(opencl, OPENCL, [clReleaseMemObject ((cl_mem) 0)], C)
EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS $OPENCL_CPPFLAGS"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $OPENCL_LDFLAGS"
EXTRA_LIBS="$EXTRA_LIBS $OPENCL_LIBS"
#------------------------------------------------------------------------------#
# HashMark
#------------------------------------------------------------------------------#
if test -z "$HM_CPPFLAGS" ; then
AC_SUBST(HM_CPPFLAGS, ["-I/usr/include"])
fi
if test -z "$HM_LDFLAGS" ; then
AC_SUBST(HM_LDFLAGS, ["-L/usr/lib"])
fi
if test -z "$HM_LIBS" ; then
AC_SUBST(HM_LIBS, ["-lhm"])
fi
if test -z "$HM_CHECKHEADER" ; then
AC_SUBST(HM_CHECKHEADER, ["hash_mark.h"])
fi
CONFIG_GENERIC_LIB(hm, HM,
[hm_add ((size_t) 0, (const char *) 0, (void *) 0)], C)
EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS $HM_CPPFLAGS"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $HM_LDFLAGS"
EXTRA_LIBS="$EXTRA_LIBS $HM_LIBS"
#------------------------------------------------------------------------------#
# Set extras
#------------------------------------------------------------------------------#
AC_SUBST(EXTRA_CPPFLAGS)
AC_SUBST(EXTRA_LDFLAGS)
AC_SUBST(EXTRA_LIBS)
#------------------------------------------------------------------------------#
# Handle Doxygen
#------------------------------------------------------------------------------#
if test "$HAS_DOXYGEN" = "yes" ; then
AC_SUBST(DOC, [doc])
AC_CONFIG_COMMANDS([doc], [make doc])
fi
AC_CONFIG_COMMANDS([links], [make links])
AC_CONFIG_COMMANDS([devices], [make devices])
AC_CONFIG_COMMANDS([remind], [make reminder])
#------------------------------------------------------------------------------#
# Output
#------------------------------------------------------------------------------#
AC_OUTPUT