updated copyright statement
[gpivtools.git] / configure.in
blob1d0d3d696f625998150bb560f13850268916dc02
1 AC_INIT(src/evaluate/rr.c)
2 AM_INIT_AUTOMAKE(gpivtools, 0.6.0)
3 AM_CONFIG_HEADER(config.h)
5 AM_SANITY_CHECK
6 AC_ISC_POSIX
8 AC_PROG_CC
9 AM_PROG_CC_STDC
10 AC_HEADER_STDC
12 AM_MAINTAINER_MODE
14 dnl hints from autoscan START
15 AC_C_CONST
16 AC_FUNC_VPRINTF
17 AC_PROG_AWK
18 AC_PROG_RANLIB
19 AC_TYPE_SIZE_T
20 dnl hints from autoscan END
23 AC_CHECK_PROG(GNUPLOT, gnuplot, true, false)
24 AM_CONDITIONAL(HAVE_GNUPLOT, $GNUPLOT, ,
25         AC_MSG_ERROR("gnuplot not installed");)
26 dnl if test x$GNUPLOT = xfalse ; then
27 dnl     AC_MSG_ERROR("gnuplot not installed");
28 dnl fi
30 dnl dnl PKG_CHECK_MODULES(gpiv, glib >= 1.2.0)
31 dnl AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR("glib not installed"))
32 dnl AC_CHECK_LIB(glib, g_malloc0, , 
33 dnl     AC_MSG_ERROR("libglib not installed"))
34 dnl AC_CHECK_HEADER(glib-1.2/glib.h, ,
35 dnl AC_MSG_ERROR("missing glib-1.2/glib.h")
36 dnl )
38 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.0.0)
39 AC_SUBST(GLIB_CFLAGS)
40 AC_SUBST(GLIB_LIBS)
42 AC_CHECK_LIB(glib-2.0, g_malloc0, ,
43         AC_MSG_ERROR("libglib not installed"))
45 AC_CHECK_PROG(PERL, perl, true, false)
46 AM_CONDITIONAL(HAVE_PERL, $PERL)
47 AC_CHECK_PROG(PYTHON, python, true, false)
48 AM_CONDITIONAL(HAVE_PYTHON, $PYTHON)
49 AC_CHECK_PROG(CONVERT, convert, true, false)
50 AM_CONDITIONAL(HAVE_CONVERT, $CONVERT)
51 AC_CHECK_PROG(PLOTMTV, plotmtv, true, false)
52 AM_CONDITIONAL(HAVE_PLOTMTV, $PLOTMTV)
54 AC_CHECK_LIB(fftw3, fftw_plan_dft_r2c_2d, , 
55                         AC_MSG_ERROR("libfftw3 not installed"))
57 AC_CHECK_LIB(gslcblas, main, ,
58         AC_MSG_ERROR("libgslcblas not installed"))
60 AC_CHECK_LIB(gsl, main, , 
61         AC_MSG_ERROR("libgsl not installed"))
63 dnl AC_CHECK_HEADER(gpiv.h, ,
64 dnl AC_MSG_ERROR("missing gpiv.h"))
65 AC_CHECK_LIB(gpiv, gpiv_warning, ,
66         AC_MSG_ERROR("libgpiv has not been installed"))
67 dnl AC_CHECK_LIB(gpiv, gpiv_scan_resourcefiles, ,
68 dnl     AC_MSG_ERROR("libgpiv has not been installed"))
69 dnl AC_CHECK_LIB(gpiv, gpiv_alloc_img, ,
70 dnl     AC_MSG_ERROR("libgpiv has not been installed"))
73 AC_CHECK_HEADERS([ stdlib.h string.h unistd.h \
74         fftw3.h \
75         gpiv.h \
76 ], ,
77 dnl      AC_MSG_ERROR("missing one of the required library headers")
83 AC_ARG_ENABLE(cam, 
84          [  --enable-cam            enable (IEEE-1394) camera],
85          [ENABLE_CAM="-DENABLE_CAM"]
86          )
87 AC_SUBST(ENABLE_CAM)
90 AC_ARG_ENABLE(trig, 
91          [  --enable-trig           enable (realtime) triggering],
92          [ENABLE_TRIG="-DENABLE_TRIG"]
93          )
94 AC_SUBST(ENABLE_TRIG)
97 dnl
98 dnl Enabling IEEE1394 camera
99 dnl
100 if test  "${ENABLE_CAM}" == '-DENABLE_CAM'; then
101         AC_CHECK_LIB(gpiv, gpiv_cam_get_camvar, ,
102         AC_MSG_ERROR("(IEEE-1394) camera is not working in libgpiv. \
103 Enable (IEEE-1394) camera in libgpiv or disable it here by leaving out --enable-cam during ./configure"))
105         AC_CHECK_LIB(raw1394, raw1394_destroy_handle, ,
106         AC_MSG_ERROR("libraw1394 not installed"))
108         AC_CHECK_LIB(dc1394_control, dc1394_create_handle, ,
109         AC_MSG_ERROR("libdc1394_control not installed"))
111         AC_CHECK_HEADER(libdc1394/dc1394_control.h, ,
112         AC_MSG_ERROR("missing dc1394_control.h"))
114         AC_CHECK_HEADER(libraw1394/raw1394.h, ,
115         AC_MSG_ERROR("missing raw1394.h"))
120 dnl Enabling triggering using RTL/RTAI
122 if test  "${ENABLE_TRIG}" == '-DENABLE_TRIG'; then
123         AC_CHECK_LIB(gpiv, gpiv_trig_openrtfs, ,
124         AC_MSG_ERROR("(Realtime) triggering is not working in libgpiv. \
125 Enable (realtime) triggering in libgpiv or disable it here by leaving out --enable-trig during ./configure"))
129 AC_CHECK_PROG(CONTROL, gpiv_control, true, false)
130 AM_CONDITIONAL(HAVE_CONTROL, $CONTROL)
134 AC_ARG_ENABLE(rta, 
135         [  --disable-rta=RTATOPDIR     place where the RTAI code \
136 resides (default /usr/lib/realtime)],
137         [RTA_TOPDIR="$enableval"],
138         [RTA_TOPDIR="/usr/lib/realtime"]
139         )
140 AC_SUBST(RTA_TOPDIR)
142 AC_ARG_ENABLE(k, 
143         [  --enable-k=KTOPDIR     place where the installed kernel \
144 headers resides (default /usr/src/kernel-headers-2.4.27-adeos)],
145         [K_TOPDIR="$enableval"],
146         [K_TOPDIR="/usr/src/kernel-headers-2.4.27-adeos"]
147         )
148 AC_SUBST(K_TOPDIR)
152 dnl Enabling Message Passing Interface (MPI) for parallel computing
154 AC_ARG_ENABLE(mpi, 
155          [  --enable-mpi            enable Message Protocol Interface (MPI)],
156          [ENABLE_MPI="-DENABLE_MPI"]
157          )
158 AC_SUBST(ENABLE_MPI)
159 dnl USE_LAM 1
160 dnl AC_SUBST(USE_LAM)
162 if test  "${ENABLE_MPI}" == '-DENABLE_MPI'; then
163         ACX_MPI(AC_MSG_WARN("libmpi HAS BEEN installed"), 
164                 AC_MSG_ERROR("libmpi IS NOT installed"))
166         CC="$MPICC"
167         LIBS="$MPILIBS $LIBS"
169         AC_CHECK_LIB(mpi, main, , 
170                 AC_MSG_ERROR("libmpi not installed"))
171         AC_CHECK_HEADER(mpi.h, ,
172                 AC_MSG_ERROR("missing mpi.h"))
174         AC_CHECK_LIB(gpiv, gpiv_piv_mpi_bcast_pivpar, ,
175         AC_MSG_ERROR("gpiv_piv_mpi_bcast_pivpar is not working in libgpiv. \
176 Enable MPI in libgpiv or disable it here by leaving out --enable-mpi during ./configure"))
178         AC_CHECK_PROG(MPIPYTHON, mpipython, true, false)
182 AM_CONDITIONAL(HAVE_MPIPYTHON, $MPIPYTHON)
183 AM_CONDITIONAL(BUILD_MPI, test "${ENABLE_MPI}" == '-DENABLE_MPI')
187 dnl Enabling Open Multi-Processing (OMP) for parallel computing
189 AC_ARG_ENABLE(omp, 
190          [  --enable-omp            enable Open Multi-Processing (OMP)],
191          [ENABLE_OMP="ENABLE_OMP"]
192         )
194 if test  "${ENABLE_OMP}" == 'ENABLE_OMP'; then
195         CC="$CC -fopenmp"
197         AC_CHECK_LIB(gomp, main, , 
198                 AC_MSG_ERROR("libgomp not installed"))
199         AC_CHECK_HEADER(omp.h, ,
200                 AC_MSG_ERROR("missing omp.h"))
202 dnl No need to use -DENABLE_OMP: gcc will do that!
206 AC_FUNC_ALLOCA
207 AC_OUTPUT([
208         Makefile
209         src/Makefile
210         src/dac/Makefile
211         src/image/Makefile
212         src/evaluate/Makefile
213         src/validate/Makefile
214         src/post/Makefile
215         src/misc/Makefile
216         man/Makefile
219 echo "===================================================================="
220  if test x$PERL = xfalse ; then
221         echo "Perl has not been found on this system."
222         echo "Though, this is not provided for the building process"
223         echo "Only some independant scripts will not work"
224         echo ""
225  fi
227  if test x$CONVERT = xfalse ; then
228         echo "Convert has not been found on this system."
229         echo "Though, this is not provided for the building process"
230         echo "Only some independant scripts will not work"
231         echo ""
232  fi
234  if test x$PLOTMTV = xfalse ; then
235         echo "Plotmtv has not been found on this system."
236         echo "Though, this is not provided for the building process"
237         echo "Only some independant scripts will not work"
238         echo ""
239  fi
242  echo "Configuration succesfully finished"
243  if test $ENABLE_CAM; then 
244         echo "with (IEEE-1394) camera enabled"
245  fi
247  if test $ENABLE_TRIG; then 
248         echo "with (realtime) triggering enabled."
249         if test x$CONTROL = xfalse ; then
250                 echo "Gpiv_control has not been found on this system, and probably gpivtrig-rtl isn't"
251                 echo "resident as well. This script eases to install and uninstall the gpivtrig-rtl"
252                 echo "and RTAI kernel modules that are needed for the triggering of camera and lasers."
253                 echo ""
254          fi
255  fi
257  if test $ENABLE_MPI; then 
258         echo "Using Message Passing Interface (MPI)"
259         echo "for processing on distributed memory systems"
260  fi
262  if test $ENABLE_OMP; then
263         echo "Using Open Multi-Processing (OMP)"
264         echo "for processing on shared memory systems"
267  echo "Type 'make' and 'make install' to build and install the gpiv-tools."
268 echo "===================================================================="