File: configure.in

package info (click to toggle)
gpivtools 0.6.0-3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 2,008 kB
  • sloc: ansic: 6,813; sh: 3,364; perl: 1,035; makefile: 305; python: 207
file content (265 lines) | stat: -rw-r--r-- 6,912 bytes parent folder | download | duplicates (2)
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
AC_INIT(src/evaluate/rr.c)
AM_INIT_AUTOMAKE(gpivtools, 0.6.0)
AM_CONFIG_HEADER(config.h)

AM_SANITY_CHECK
AC_ISC_POSIX

AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC

AM_MAINTAINER_MODE

dnl hints from autoscan START
AC_C_CONST
AC_FUNC_VPRINTF
AC_PROG_AWK
AC_PROG_RANLIB
AC_TYPE_SIZE_T
dnl hints from autoscan END


AC_CHECK_PROG(GNUPLOT, gnuplot, true, false)
AM_CONDITIONAL(HAVE_GNUPLOT, $GNUPLOT, ,
	AC_MSG_ERROR("gnuplot not installed");)
dnl if test x$GNUPLOT = xfalse ; then
dnl  	AC_MSG_ERROR("gnuplot not installed");
dnl fi

dnl dnl PKG_CHECK_MODULES(gpiv, glib >= 1.2.0)
dnl AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR("glib not installed"))
dnl AC_CHECK_LIB(glib, g_malloc0, , 
dnl	AC_MSG_ERROR("libglib not installed"))
dnl AC_CHECK_HEADER(glib-1.2/glib.h, ,
dnl AC_MSG_ERROR("missing glib-1.2/glib.h")
dnl )

PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.0.0)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)

AC_CHECK_LIB(glib-2.0, g_malloc0, ,
        AC_MSG_ERROR("libglib not installed"))

AC_CHECK_PROG(PERL, perl, true, false)
AM_CONDITIONAL(HAVE_PERL, $PERL)
AC_CHECK_PROG(PYTHON, python, true, false)
AM_CONDITIONAL(HAVE_PYTHON, $PYTHON)
AC_CHECK_PROG(CONVERT, convert, true, false)
AM_CONDITIONAL(HAVE_CONVERT, $CONVERT)
AC_CHECK_PROG(PLOTMTV, plotmtv, true, false)
AM_CONDITIONAL(HAVE_PLOTMTV, $PLOTMTV)

AC_CHECK_LIB(fftw3, fftw_plan_dft_r2c_2d, , 
			AC_MSG_ERROR("libfftw3 not installed"))

AC_CHECK_LIB(gslcblas, main, ,
        AC_MSG_ERROR("libgslcblas not installed"))

AC_CHECK_LIB(gsl, main, , 
 	AC_MSG_ERROR("libgsl not installed"))

dnl AC_CHECK_HEADER(gpiv.h, ,
dnl AC_MSG_ERROR("missing gpiv.h"))


dnl
dnl Enabling Message Passing Interface (MPI) for parallel computing
dnl
AC_ARG_ENABLE(mpi, 
         [  --enable-mpi            enable Message Protocol Interface (MPI)],
         [ENABLE_MPI="-DENABLE_MPI"]
         )
AC_SUBST(ENABLE_MPI)


if test  "${ENABLE_MPI}" == '-DENABLE_MPI'; then
	ACX_MPI(AC_MSG_WARN("libmpi HAS BEEN installed"), 
		AC_MSG_ERROR("libmpi IS NOT installed"))

	CC="$MPICC"
	LIBS="$MPILIBS $LIBS"

	AC_CHECK_LIB(mpi, main, , 
		AC_MSG_ERROR("libmpi not installed"))
	AC_CHECK_HEADER(mpi.h, ,
		AC_MSG_ERROR("missing mpi.h"))

	AC_CHECK_LIB(gpiv_mpi, gpiv_piv_mpi_bcast_pivpar, ,
	AC_MSG_ERROR("gpiv_piv_mpi_bcast_pivpar is not working in libgpiv_mpi. \
Enable MPI in libgpiv or disable it here by leaving out --enable-mpi during ./configure"))

	AC_CHECK_PROG(MPIPYTHON, mpipython, true, false)

else
	AC_CHECK_LIB(gpiv, gpiv_warning, ,
		AC_MSG_ERROR("libgpiv has not been installed"))
fi


AC_CHECK_HEADERS([ stdlib.h string.h unistd.h \
	fftw3.h \
	gpiv.h \
], ,
dnl	 AC_MSG_ERROR("missing one of the required library headers")
)




AC_ARG_ENABLE(cam, 
         [  --enable-cam            enable (IEEE-1394) camera],
         [ENABLE_CAM="-DENABLE_CAM"]
         )
AC_SUBST(ENABLE_CAM)


AC_ARG_ENABLE(trig, 
         [  --enable-trig           enable (realtime) triggering],
         [ENABLE_TRIG="-DENABLE_TRIG"]
         )
AC_SUBST(ENABLE_TRIG)


dnl
dnl Enabling IEEE1394 camera
dnl
if test  "${ENABLE_CAM}" == '-DENABLE_CAM'; then
	AC_CHECK_LIB(gpiv, gpiv_cam_get_camvar, ,
	AC_MSG_ERROR("(IEEE-1394) camera is not working in libgpiv. \
Enable (IEEE-1394) camera in libgpiv or disable it here by leaving out --enable-cam during ./configure"))

	AC_CHECK_LIB(raw1394, raw1394_destroy_handle, ,
	AC_MSG_ERROR("libraw1394 not installed"))

	AC_CHECK_LIB(dc1394_control, dc1394_create_handle, ,
	AC_MSG_ERROR("libdc1394_control not installed"))

	AC_CHECK_HEADER(libdc1394/dc1394_control.h, ,
	AC_MSG_ERROR("missing dc1394_control.h"))

	AC_CHECK_HEADER(libraw1394/raw1394.h, ,
	AC_MSG_ERROR("missing raw1394.h"))
fi


dnl
dnl Enabling triggering using RTL/RTAI
dnl
if test  "${ENABLE_TRIG}" == '-DENABLE_TRIG'; then
	AC_CHECK_LIB(gpiv, gpiv_trig_openrtfs, ,
	AC_MSG_ERROR("(Realtime) triggering is not working in libgpiv. \
Enable (realtime) triggering in libgpiv or disable it here by leaving out --enable-trig during ./configure"))
fi


AC_CHECK_PROG(CONTROL, gpiv_control, true, false)
AM_CONDITIONAL(HAVE_CONTROL, $CONTROL)



AC_ARG_ENABLE(rta, 
	[  --disable-rta=RTATOPDIR     place where the RTAI code \
resides (default /usr/lib/realtime)],
	[RTA_TOPDIR="$enableval"],
	[RTA_TOPDIR="/usr/lib/realtime"]
	)
AC_SUBST(RTA_TOPDIR)

AC_ARG_ENABLE(k, 
	[  --enable-k=KTOPDIR     place where the installed kernel \
headers resides (default /usr/src/kernel-headers-2.4.27-adeos)],
	[K_TOPDIR="$enableval"],
	[K_TOPDIR="/usr/src/kernel-headers-2.4.27-adeos"]
	)
AC_SUBST(K_TOPDIR)


AM_CONDITIONAL(HAVE_MPIPYTHON, $MPIPYTHON)
AM_CONDITIONAL(BUILD_MPI, test "${ENABLE_MPI}" == '-DENABLE_MPI')


dnl
dnl Enabling Open Multi-Processing (OMP) for parallel computing
dnl
AC_ARG_ENABLE(omp, 
         [  --enable-omp            enable Open Multi-Processing (OMP)],
         [ENABLE_OMP="ENABLE_OMP"]
	)

if test  "${ENABLE_OMP}" == 'ENABLE_OMP'; then
	CC="$CC -fopenmp"

	AC_CHECK_LIB(gomp, main, , 
		AC_MSG_ERROR("libgomp not installed"))
	AC_CHECK_HEADER(omp.h, ,
		AC_MSG_ERROR("missing omp.h"))
fi
dnl No need to use -DENABLE_OMP: gcc will do that!



AC_FUNC_ALLOCA
AC_OUTPUT([
	Makefile
	src/Makefile
	src/dac/Makefile
	src/image/Makefile
	src/evaluate/Makefile
	src/validate/Makefile
	src/post/Makefile
	src/misc/Makefile
	man/Makefile
])

echo "===================================================================="
 if test x$PERL = xfalse ; then
	echo "Perl has not been found on this system."
	echo "Though, this is not provided for the building process"
	echo "Only some independant scripts will not work"
	echo ""
 fi

 if test x$CONVERT = xfalse ; then
	echo "Convert has not been found on this system."
	echo "Though, this is not provided for the building process"
	echo "Only some independant scripts will not work"
	echo ""
 fi

 if test x$PLOTMTV = xfalse ; then
	echo "Plotmtv has not been found on this system."
	echo "Though, this is not provided for the building process"
	echo "Only some independant scripts will not work"
	echo ""
 fi


 echo "Configuration succesfully finished"
 if test $ENABLE_CAM; then 
	echo "with (IEEE-1394) camera enabled"
 fi

 if test $ENABLE_TRIG; then 
	echo "with (realtime) triggering enabled."
	if test x$CONTROL = xfalse ; then
		echo "Gpiv_control has not been found on this system, and probably gpivtrig-rtl isn't"
		echo "resident as well. This script eases to install and uninstall the gpivtrig-rtl"
		echo "and RTAI kernel modules that are needed for the triggering of camera and lasers."
		echo ""
	 fi
 fi

 if test $ENABLE_MPI; then 
	echo "Using Message Passing Interface (MPI)"
	echo "for processing on distributed memory systems"
 fi

 if test $ENABLE_OMP; then
	echo "Using Open Multi-Processing (OMP)"
	echo "for processing on shared memory systems"
fi

 echo "Type 'make' and 'make install' to build and install the gpiv-tools."
echo "===================================================================="