-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathconfigure.in
638 lines (553 loc) · 18.6 KB
/
configure.in
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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during vol2bird
dnl installation to configure the system for the local environment.
AC_INIT([vol2bird],[0.5.0])
if test "${prefix}" = "NONE"; then
prefix=/opt/radar/vol2bird
fi
dnl Since I can not expand the localstatedir I do this instead
if test "${localstatedir}" = "\${prefix}/var"; then
localstatedir="`echo ${prefix}`/var"
fi
AC_PROG_CC
AC_PROG_CPP
SAVED_LIBS="$LIBS"
LIBS="$LIBS -lm"
dnl Check that we install libmistnet
dnl
TORCH_DIR=
TORCH_SUPPRESSED=no
TORCH_INCLUDE_FLAG=
TORCH_LIBRARY_FLAG=
MISTNET_LIB=
MISTNET_CFLAG=
AC_ARG_WITH(libtorch,[ --with-libtorch=DIR The libtorch root installation directory. Specify to enable Mistnet],
,withval=no)
case $withval in
yes)
AC_MSG_ERROR("path of libtorch installation not specified by --with-libtorch=<libtorch path>")
;;
no)
AC_MSG_CHECKING(for libtorch lib)
AC_MSG_RESULT(suppressed)
TORCH_SUPPRESSED=yes
;;
*)
if [[ "$withval" != "" ]]; then
AC_MSG_CHECKING(for libtorch library path)
AC_MSG_RESULT(found)
TORCH_DIR="`echo $withval`"
TORCH_INCLUDE_FLAG="-I$TORCH_DIR/include"
TORCH_LIBRARY_FLAG="-L$TORCH_DIR/lib"
MISTNET_LIB="-lmistnet -ltorch -lc10"
MISTNET_CFLAG=-DMISTNET
else
AC_MSG_ERROR("Odd argument passed for libtorch")
fi
;;
esac
dnl Check that we have libconfuse installed
dnl
CONFUSE_INCLUDE_DIR=
CONFUSE_LIB_DIR=
GOT_CONFUSE_INC=no
GOT_CONFUSE_LIB=no
CONFUSE_SUPPRESSED=no
AC_ARG_WITH(confuse,[ --with-confuse=DIR The confuse root installation directory],
,withval=yes)
case $withval in
yes)
AC_CHECK_HEADERS(confuse.h,GOT_CONFUSE_INC=yes)
AC_CHECK_LIB(confuse,cfg_init,GOT_CONFUSE_LIB=yes)
;;
no)
AC_MSG_CHECKING(for confuse lib)
AC_MSG_RESULT(suppressed)
CONFUSE_SUPPRESSED=yes
;;
*)
if [[ "$withval" != "" ]]; then
if [[ "`echo $withval | grep ','`" = "" ]]; then
confuse_inc=$withval/include
confuse_lib=$withval/lib
else
confuse_inc="`echo $withval |cut -f1 -d,`"
confuse_lib="`echo $withval |cut -f2 -d,`"
fi
if [[ "$confuse_inc" != "" ]]; then
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$confuse_inc"
AC_CHECK_HEADERS([confuse.h],GOT_CONFUSE_INC=yes)
if [[ "$GOT_CONFUSE_INC" = "yes" ]]; then
CONFUSE_INCLUDE_DIR="-I$confuse_inc"
else
CPPFLAGS="$saved_CPPFLAGS"
fi
else
AC_CHECK_HEADERS([confuse.h],GOT_CONFUSE_INC=yes)
fi
if [[ "$confuse_lib" != "" ]]; then
saved_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -L$confuse_lib"
AC_CHECK_LIB(confuse,cfg_init,GOT_CONFUSE_LIB=yes)
if [[ "$GOT_CONFUSE_LIB" = "yes" ]]; then
CONFUSE_LIB_DIR="-L$confuse_lib"
else
LDFLAGS="$saved_LDFLAGS"
fi
else
AC_CHECK_LIB(confuse,cfg_init,GOT_CONFUSE_LIB=yes)
fi
else
AC_MSG_ERROR("Odd argument passed for confuse")
fi
;;
esac
if [[ "x$CONFUSE_SUPPRESSED" = "xno" ]]; then
if [[ "x$GOT_CONFUSE_INC" = "xno" -o "x$GOT_CONFUSE_LIB" = "xno" ]]; then
AC_MSG_ERROR("Could not successfully find the confuse library")
fi
fi
CONFUSE_LIBRARY_FLAG=${CONFUSE_LIB_DIR}
CONFUSE_INCLUDE_FLAG=${CONFUSE_INCLUDE_DIR}
dnl Check that we have libgsl installed
dnl
GSL_INCLUDE_DIR=
GSL_LIB_DIR=
GSL_LIB=
GOT_GSL_INC=no
GOT_GSL_LIB=no
GSL_SUPPRESSED=no
AC_ARG_WITH(gsl,[ --with-gsl=DIR|INC,LIB The GSL (GNU Scientific Library) installation directory],,withval=yes)
case $withval in
yes)
AC_CHECK_HEADERS([gsl_multimin.h gsl_vector.h] ,GOT_GSL_INC=yes)
AC_CHECK_LIB([m],[cos])
AC_CHECK_LIB([gslcblas],[cblas_dgemm])
AC_CHECK_LIB([gsl],[gsl_blas_dgemm], GOT_GSL_LIB=yes)
;;
no)
AC_MSG_CHECKING(for gsl lib)
AC_MSG_RESULT(suppressed)
GSL_SUPPRESSED=yes
;;
*)
if [[ "$withval" != "" ]]; then
if [[ "`echo $withval | grep ','`" = "" ]]; then
gsl_inc=$withval/include
gsl_lib=$withval/lib
else
gsl_inc="`echo $withval |cut -f1 -d,`"
gsl_lib="`echo $withval |cut -f2 -d,`"
fi
if [[ "$gsl_inc" != "" ]]; then
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$gsl_inc"
AC_CHECK_HEADERS(gsl/gsl_multimin.h,GOT_GSL_INC=yes)
if [[ "$GOT_GSL_INC" = "yes" ]]; then
GSL_INCLUDE_DIR="-I$gsl_inc"
else
CPPFLAGS="$saved_CPPFLAGS"
fi
else
AC_CHECK_HEADERS(gsl/gsl_multimin.h,GOT_GSL_INC=yes)
fi
if [[ "$gsl_lib" != "" ]]; then
saved_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -L$gsl_lib"
AC_CHECK_LIB([m],[cos])
AC_CHECK_LIB([gslcblas],[cblas_dgemm])
AC_CHECK_LIB([gsl],[gsl_blas_dgemm], GOT_GSL_LIB=yes)
if [[ "$GOT_GSL_LIB" = "yes" ]]; then
GSL_LIB_DIR="-L$gsl_lib"
else
LDFLAGS="$saved_LDFLAGS"
fi
else
AC_CHECK_LIB([m],[cos])
AC_CHECK_LIB([gslcblas],[cblas_dgemm])
AC_CHECK_LIB([gsl],[gsl_blas_dgemm], GOT_GSL_LIB=yes)
fi
else
AC_MSG_ERROR("Odd argument passed for GSL")
fi
;;
esac
if [[ "x$GSL_SUPPRESSED" = "xno" ]]; then
if [[ "x$GOT_GSL_INC" = "xno" -o "x$GOT_GSL_LIB" = "xno" ]]; then
AC_MSG_ERROR("Could not successfully find GSL the GNU scientific library")
fi
fi
GSL_LIBRARY_FLAG=${GSL_LIB_DIR}
GSL_INCLUDE_FLAG=${GSL_INCLUDE_DIR}
GSL_LIB=-lgsl
dnl Check that we have librsl installed
dnl
RSL_INCLUDE_DIR=
RSL_LIB_DIR=
RSL_CFLAG=
RSL_LIB=
GOT_RSL_INC=no
GOT_RSL_LIB=no
RSL_SUPPRESSED=no
echo "LIBS: $LIBS"
AC_ARG_WITH(rsl,[ --with-rsl=DIR The RSL root installation directory],
,withval=yes)
case $withval in
yes)
AC_CHECK_HEADERS(rsl.h,GOT_RSL_INC=yes)
AC_CHECK_LIB(rsl,wsr88d_read_sweep,GOT_RSL_LIB=yes)
;;
no)
AC_MSG_CHECKING(for RSL library)
AC_MSG_RESULT(suppressed)
RSL_SUPPRESSED=yes
;;
*)
if [[ "$withval" != "" ]]; then
if [[ "`echo $withval | grep ','`" = "" ]]; then
rsl_inc=$withval/include
rsl_lib=$withval/lib
else
rsl_inc="`echo $withval |cut -f1 -d,`"
rsl_lib="`echo $withval |cut -f2 -d,`"
fi
if [[ "$rsl_inc" != "" ]]; then
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$rsl_inc"
AC_CHECK_HEADERS(rsl.h,GOT_RSL_INC=yes)
if [[ "$GOT_RSL_INC" = "yes" ]]; then
RSL_INCLUDE_DIR="-I$rsl_inc"
else
CPPFLAGS="$saved_CPPFLAGS"
fi
else
AC_CHECK_HEADERS(rsl.h,GOT_RSL_INC=yes)
fi
if [[ "$rsl_lib" != "" ]]; then
saved_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -L$rsl_lib"
AC_CHECK_LIB(rsl,wsr88d_read_sweep,GOT_RSL_LIB=yes)
if [[ "$GOT_RSL_LIB" = "yes" ]]; then
RSL_LIB_DIR="-L$rsl_lib"
else
LDFLAGS="$saved_LDFLAGS"
fi
else
AC_CHECK_LIB(rsl,wsr88d_read_sweep,GOT_RSL_LIB=yes)
fi
else
AC_MSG_ERROR("Odd argument passed for rsl")
fi
;;
esac
RSL_LIBRARY_FLAG=${RSL_LIB_DIR}
RSL_INCLUDE_FLAG=${RSL_INCLUDE_DIR}
AC_MSG_CHECKING(for RSL installation)
if [[ "$GOT_RSL_INC" = "yes" ]]; then
if [[ "$GOT_RSL_LIB" = "yes" ]]; then
AC_MSG_RESULT(yes)
RSL_CFLAG=-DRSL
RSL_LIB=-lrsl
else
AC_MSG_RESULT(no)
fi
else
AC_MSG_RESULT(no)
fi
dnl First verify that we have a proper rave installation. We can not live without it
dnl
RAVE_ROOT_DIR=
RAVE_INCLUDE_FLAG=
RAVE_LIB_FLAG=
AC_ARG_WITH(rave,[ --with-rave=ROOT The RAVE root installation directory],
,withval=yes)
case $withval in
no)
AC_MSG_ERROR(You cannot remove dependencies to RAVE);
;;
*)
AC_MSG_CHECKING(for RAVE installation)
TMPDIR=
if [[ "yes" = "$withval" ]]; then
TMPFIL=`python -c "import _rave; print eval(\"_rave.__\"+\"file__\")" 2>&1 | head -1`
if [[ -f "$TMPFIL" ]]; then
TMPDIR=`echo "$TMPFIL" | sed -e"s/\/Lib\/_rave\.so//"`
fi
else
if [[ -d "$withval" -a -f "$withval/lib/libravetoolbox.so" ]]; then
TMPDIR=$withval
fi
fi
if [[ "$TMPDIR" = "" ]]; then
AC_MSG_RESULT(not found)
else
AC_MSG_RESULT(found)
RAVE_ROOT_DIR=$TMPDIR
fi
;;
esac
if [[ "$RAVE_ROOT_DIR" = "" ]]; then
AC_MSG_ERROR("Could not identify a RAVE installation")
fi
AC_MSG_CHECKING(existance of RAVE build configuration)
if [[ -f "$RAVE_ROOT_DIR/mkf/def.mk" ]]; then
RAVE_INCLUDE_FLAG=-I$RAVE_ROOT_DIR/include
RAVE_LIB_FLAG=-L$RAVE_ROOT_DIR/lib
AC_MSG_RESULT(found)
else
AC_MSG_RESULT(not found);
AC_MSG_FAILURE(The RAVE installation does not contain def.mk. Is this an old installation);
fi
dnl Now we should extract some variables from raves def.mk file to give user a possibility to change
dnl then when necessary
AC_MSG_CHECKING(for RAVE cc compiler)
RAVECC=`cat $RAVE_ROOT_DIR/mkf/def.mk | sed -n "/^CC=/p" | sed -n -e"s/^CC=[[ \t]]*\(.*\)/\1/p"`
AC_MSG_RESULT($RAVECC)
AC_MSG_CHECKING(for RAVE cc options)
RAVECCOPTS=`cat $RAVE_ROOT_DIR/mkf/def.mk | sed -n "/^OPTS=/p" | sed -n -e"s/^OPTS=[[ ]]*\(.*\)/\1/p"`
AC_MSG_RESULT($RAVECCOPTS)
dnl Remove strict prototype from cc options
dnl
AC_MSG_CHECKING(for cpp options)
CPPOPTS=`echo "$RAVECCOPTS" | sed -e "s/-Wstrict-prototypes//"`
AC_MSG_RESULT($CPPOPTS)
AC_MSG_CHECKING(if RAVE is using old or new PROJ API)
RAVEUSE_PROJ4_API=`cat $RAVE_ROOT_DIR/mkf/def.mk | sed -n "/^USE_PROJ4_API=/p" | sed -n -e"s/^USE_PROJ4_API=[[ ]]*\(.*\)/\1/p"`
AC_MSG_RESULT($RAVEUSE_PROJ4_API)
if [[ "$RAVEUSE_PROJ4_API" = "yes" -o "$RAVEUSE_PROJ4_API" = "" ]]; then
RAVECCOPTS="$RAVECCOPTS -DUSE_PROJ4_API"
fi
AC_MSG_CHECKING(for RAVE ld flags)
RAVELDFLAGS=`cat $RAVE_ROOT_DIR/mkf/def.mk | sed -n "/^LDFLAGS=/p" | sed -n -e"s/^LDFLAGS=[[ ]]*\(.*\)/\1/p"`
AC_MSG_RESULT($RAVELDFLAGS)
AC_MSG_CHECKING(for RAVE shared flag)
RAVECCSHARED=`cat $RAVE_ROOT_DIR/mkf/def.mk | sed -n "/^CCSHARED=/p" | sed -n -e"s/^CCSHARED=[[ ]]*\(.*\)/\1/p"`
AC_MSG_RESULT($RAVECCSHARED)
AC_MSG_CHECKING(for Python include flag)
PYTHON_INCLUDE_FLAG=`cat $RAVE_ROOT_DIR/mkf/def.mk | sed -n "/^INCLUDE_PYTHON=/p" | sed -n -e"s/^INCLUDE_PYTHON=[[ ]]*\(.*\)/\1/p"`
AC_MSG_RESULT($INCLUDE_PYTHON)
AC_MSG_CHECKING(for numpy include flag)
NUMPY_INCLUDE_FLAG=`cat $RAVE_ROOT_DIR/mkf/def.mk | sed -n "/^NUMPY_INCLUDE_DIR=/p" | sed -n -e"s/^NUMPY_INCLUDE_DIR=[[ ]]*\(.*\)/\1/p"`
AC_MSG_RESULT($PROJ_INCLUDE_FLAG)
AC_MSG_CHECKING(for proj include flag used by RAVE)
PROJ_INCLUDE_FLAG=`cat $RAVE_ROOT_DIR/mkf/def.mk | sed -n "/^PROJ_INCLUDE_DIR=/p" | sed -n -e"s/^PROJ_INCLUDE_DIR=[[ ]]*\(.*\)/\1/p"`
AC_MSG_RESULT($PROJ_INCLUDE_FLAG)
AC_MSG_CHECKING(for proj library flag used by RAVE)
PROJ_LIBRARY_FLAG=`cat $RAVE_ROOT_DIR/mkf/def.mk | sed -n "/^PROJ_LIB_DIR=/p" | sed -n -e"s/^PROJ_LIB_DIR=[[ ]]*\(.*\)/\1/p"`
AC_MSG_RESULT($PROJ_LIBRARY_FLAG)
AC_MSG_CHECKING(for expat include flag used by RAVE)
EXPAT_INCLUDE_FLAG=`cat $RAVE_ROOT_DIR/mkf/def.mk | sed -n "/^EXPAT_INCLUDE_DIR=/p" | sed -n -e"s/^EXPAT_INCLUDE_DIR=[[ ]]*\(.*\)/\1/p"`
AC_MSG_RESULT($EXPAT_INCLUDE_FLAG)
AC_MSG_CHECKING(for expat library flag used by RAVE)
EXPAT_LIBRARY_FLAG=`cat $RAVE_ROOT_DIR/mkf/def.mk | sed -n "/^EXPAT_LIB_DIR=/p" | sed -n -e"s/^EXPAT_LIB_DIR=[[ ]]*\(.*\)/\1/p"`
AC_MSG_RESULT($EXPAT_LIBRARY_FLAG)
AC_MSG_CHECKING(if expat is supressed)
EXPAT_SUPPRESSED=`cat $RAVE_ROOT_DIR/mkf/def.mk | sed -n "/^EXPAT_SUPPRESSED=/p" | sed -n -e"s/^EXPAT_SUPPRESSED=[[ ]]*\(.*\)/\1/p"`
AC_MSG_RESULT($EXPAT_SUPPRESSED)
AC_MSG_CHECKING(for hlhdf include flag used by RAVE)
HLHDF_INCLUDE_FLAG=-I`cat $RAVE_ROOT_DIR/mkf/def.mk | sed -n "/^HLHDF_INCLUDE_DIR=/p" | sed -n -e"s/^HLHDF_INCLUDE_DIR=[[ ]]*\(.*\)/\1/p"`
AC_MSG_RESULT($HLHDF_INCLUDE_FLAG)
AC_MSG_CHECKING(for hlhdf library flag used by RAVE)
HLHDF_LIBRARY_FLAG=-L`cat $RAVE_ROOT_DIR/mkf/def.mk | sed -n "/^HLHDF_LIB_DIR=/p" | sed -n -e"s/^HLHDF_LIB_DIR=[[ ]]*\(.*\)/\1/p"`
AC_MSG_RESULT($HLHDF_LIBRARY_FLAG)
AC_MSG_CHECKING(for hlhdf config file)
HLHDF_MK_FILE=`cat $RAVE_ROOT_DIR/mkf/def.mk | sed -n "/^HLHDF_HLDEF_MK_FILE=/p" | sed -n -e"s/^HLHDF_HLDEF_MK_FILE=[[ ]]*\(.*\)/\1/p"`
AC_MSG_RESULT($HLHDF_MK_FILE)
AC_MSG_CHECKING(for hlhdf ld shared)
HLHDFLDSHARED=`cat $HLHDF_MK_FILE | sed -n "/^LDSHARED=/p" | sed -n -e"s/^LDSHARED=[[ ]]*\(.*\)/\1/p"`
AC_MSG_RESULT($HLHDFLDSHARED)
AC_MSG_CHECKING(for g++ ld shared options)
LDCPPSHARED=`echo "$HLHDFLDSHARED" | awk '{$1=""}1'`
AC_MSG_RESULT($LDCPPSHARED)
AC_MSG_CHECKING(for hdf5 software used by hlhdf)
HLHDF_HDF5_LIB=`cat $HLHDF_MK_FILE | sed -n "/^HDF5_LIBDIR=/p" | sed -n -e"s/^HDF5_LIBDIR=[[ ]]*\(.*\)/\1/p"`
AC_MSG_RESULT($HLHDF_HDF5_LIB)
AC_MSG_CHECKING(for zlib software used by hlhdf)
HLHDF_ZLIB_LIB=`cat $HLHDF_MK_FILE | sed -n "/^ZLIB_LIBDIR=/p" | sed -n -e"s/^ZLIB_LIBDIR=[[ ]]*\(.*\)/\1/p"`
AC_MSG_RESULT($HLHDF_ZLIB_LIB)
AC_MSG_CHECKING(for szlib software used by hlhdf)
HLHDF_SZLIB_LIB=`cat $HLHDF_MK_FILE | sed -n "/^SZLIB_LIBDIR=/p" | sed -n -e"s/^SZLIB_LIBDIR=[[ ]]*\(.*\)/\1/p"`
AC_MSG_RESULT($HLHDF_SZLIB_LIB)
AC_MSG_CHECKING(for RAVE module libraries)
RAVE_MODULE_LIBRARIES=`cat $RAVE_ROOT_DIR/mkf/def.mk | sed -n "/^RAVE_MODULE_LIBRARIES=/p" | sed -n -e"s/^RAVE_MODULE_LIBRARIES=[[ ]]*\(.*\)/\1/p"`
AC_MSG_RESULT($RAVE_MODULE_LIBRARIES)
dnl Update LDFLAGS and CPPFLAGS with those obtained from RAVE
LDFLAGS="$RAVE_LIB_FLAG $HLHDF_LIBRARY_FLAG $PROJ_LIBRARY_FLAG $LDFLAGS"
CPPFLAGS="$RAVECCOPTS $RAVE_INCLUDE_FLAG $HLHDF_INCLUDE_FLAG $PROJ_INCLUDE_FLAG $CPPFLAGS $PYTHON_INCLUDE_FLAG"
dnl Check that we have Vaisala IRIS library installed as part of RAVE
dnl
IRIS_CFLAG=
IRIS_LIB=
GOT_IRIS_INC=no
GOT_IRIS_LIB=no
IRIS_SUPPRESSED=no
AC_ARG_WITH(iris,[ --with-iris Add Vaisala IRIS support using iris2odim rave module],
,withval=yes)
case $withval in
yes)
AC_CHECK_HEADERS(iris2odim.h,GOT_IRIS_INC=yes)
AC_CHECK_LIB(iris2odim,populateObject,GOT_IRIS_LIB=yes,,[$RAVE_MODULE_LIBRARIES])
;;
no)
AC_MSG_CHECKING(for iris2odim rave module)
AC_MSG_RESULT(suppressed)
IRIS_SUPPRESSED=yes
;;
*)
if [[ "$withval" != "" ]]; then
AC_MSG_WARN("iris2odim should be installed as a library module of RAVE - ignoring specified path '$withval'")
AC_CHECK_HEADERS(iris2odim.h,GOT_IRIS_INC=yes)
AC_CHECK_LIB(iris2odim,populateObject,GOT_IRIS_LIB=yes,,[$RAVE_MODULE_LIBRARIES])
else
AC_MSG_ERROR("Odd argument passed for iris")
fi
;;
esac
AC_MSG_CHECKING(for Vaisala IRIS support)
if [[ "$GOT_IRIS_INC" = "yes" ]]; then
if [[ "$GOT_IRIS_LIB" = "yes" ]]; then
AC_MSG_RESULT(yes)
IRIS_CFLAG=-DIRIS
IRIS_LIB=-liris2odim
else
AC_MSG_RESULT(no)
fi
else
AC_MSG_RESULT(no)
fi
dnl Check that we have SELEX Rainbow library installed as part of RAVE
dnl
dnl rb52odim depends on libxml, including it here hard-coded
dnl TODO: add explicit checking for presence of xml2
dnl BUG: this solution works on Mac OSX but not on linux
CPPFLAGS="$CPPFLAGS -I/usr/include/libxml2"
RAINBOW_CFLAG=
RAINBOW_LIB=
GOT_RAINBOW_INC=no
GOT_RAINBOW_LIB=no
RAINBOW_SUPPRESSED=no
AC_ARG_WITH(rainbow,[ --with-rainbow Add SELEX Rainbow 5 support using rb52odim rave module],
,withval=yes)
case $withval in
yes)
AC_CHECK_HEADERS(rb52odim.h,GOT_RAINBOW_INC=yes)
AC_CHECK_LIB(rb52odim,populateObject,GOT_RAINBOW_LIB=yes,,[$RAVE_MODULE_LIBRARIES -lxml2])
;;
no)
AC_MSG_CHECKING(for rb52odim rave module)
AC_MSG_RESULT(suppressed)
IRIS_SUPPRESSED=yes
;;
*)
if [[ "$withval" != "" ]]; then
AC_MSG_WARN("rb52odim should be installed as a library module of RAVE - ignoring specified path '$withval'")
AC_CHECK_HEADERS(rb52odim.h,GOT_RAINBOW_INC=yes)
AC_CHECK_LIB(rb52odim,populateObject,GOT_RAINBOW_LIB=yes,,[$RAVE_MODULE_LIBRARIES -lxml2])
else
AC_MSG_ERROR("Odd argument passed for rainbow")
fi
;;
esac
AC_MSG_CHECKING(for SELEX Rainbow support)
if [[ "$GOT_RAINBOW_INC" = "yes" ]]; then
if [[ "$GOT_RAINBOW_LIB" = "yes" ]]; then
AC_MSG_RESULT(yes)
RAINBOW_CFLAG=-DRAINBOW
RAINBOW_LIB=-lrb52odim
else
AC_MSG_RESULT(no)
fi
else
AC_MSG_RESULT(no)
fi
dnl Generate the ld library printout
dnl
LD_PRINTOUT=$prefix/lib
if [[ "$RAVE_LIB_FLAG" != "" ]]; then
LD_PRINTOUT=$LD_PRINTOUT:`echo "$RAVE_LIB_FLAG" | sed -e"s/[[ \t]]*-L//"`
fi
if [[ "$HLHDF_LIBRARY_FLAG" != "" ]]; then
LD_PRINTOUT=$LD_PRINTOUT:`echo "$HLHDF_LIBRARY_FLAG" | sed -e"s/[[ \t]]*-L//"`
fi
if [[ "$HLHDF_HDF5_LIB" != "" ]]; then
LD_PRINTOUT=$LD_PRINTOUT:`echo "$HLHDF_HDF5_LIB" | sed -e"s/[[ \t]]*-L//"`
fi
if [[ "$PROJ_LIBRARY_FLAG" != "" ]]; then
LD_PRINTOUT=$LD_PRINTOUT:`echo "$PROJ_LIBRARY_FLAG" | sed -e"s/[[ \t]]*-L//"`
fi
if [[ "$EXPAT_LIBRARY_FLAG" != "" ]]; then
LD_PRINTOUT=$LD_PRINTOUT:`echo "$EXPAT_LIBRARY_FLAG" | sed -e"s/[[ \t]]*-L//"`
fi
if [[ "$HLHDF_ZLIB_LIB" != "" ]]; then
LD_PRINTOUT=$LD_PRINTOUT:`echo "$HLHDF_ZLIB_LIB" | sed -e"s/[[ \t]]*-L//"`
fi
if [[ "$HLHDF_SZLIB_LIB" != "" ]]; then
LD_PRINTOUT=$LD_PRINTOUT:`echo "$HLHDF_SZLIB_LIB" | sed -e"s/[[ \t]]*-L//"`
fi
if [[ "$TORCH_LIBRARY_FLAG" != "" ]]; then
LD_PRINTOUT=$LD_PRINTOUT:`echo "$TORCH_LIBRARY_FLAG" | sed -e"s/[[ \t]]*-L//"`
fi
if [[ "$GSL_LIBRARY_FLAG" != "" ]]; then
LD_PRINTOUT=$LD_PRINTOUT:`echo "$GSL_LIBRARY_FLAG" | sed -e"s/[[ \t]]*-L//"`
fi
if [[ "$RSL_LIBRARY_FLAG" != "" ]]; then
LD_PRINTOUT=$LD_PRINTOUT:`echo "$RSL_LIBRARY_FLAG" | sed -e"s/[[ \t]]*-L//"`
fi
LIBS=$SAVED_LIBS
AC_SUBST(RAVE_ROOT_DIR)
AC_SUBST(RAVE_INCLUDE_FLAG)
AC_SUBST(RAVE_LIB_FLAG)
AC_SUBST(RAVECC)
AC_SUBST(RAVECCOPTS)
AC_SUBST(RAVELDFLAGS)
AC_SUBST(RAVECCSHARED)
AC_SUBST(PYTHON_INCLUDE_FLAG)
AC_SUBST(NUMPY_INCLUDE_FLAG)
AC_SUBST(PROJ_INCLUDE_FLAG)
AC_SUBST(PROJ_LIBRARY_FLAG)
AC_SUBST(EXPAT_INCLUDE_FLAG)
AC_SUBST(EXPAT_LIBRARY_FLAG)
AC_SUBST(EXPAT_SUPPRESSED)
AC_SUBST(HLHDF_INCLUDE_FLAG)
AC_SUBST(HLHDF_LIBRARY_FLAG)
AC_SUBST(HLHDFLDSHARED)
AC_SUBST(CONFUSE_INCLUDE_FLAG)
AC_SUBST(CONFUSE_LIBRARY_FLAG)
AC_SUBST(GSL_INCLUDE_FLAG)
AC_SUBST(GSL_LIBRARY_FLAG)
AC_SUBST(GSL_LIB)
AC_SUBST(RSL_INCLUDE_FLAG)
AC_SUBST(RSL_LIBRARY_FLAG)
AC_SUBST(RSL_CFLAG)
AC_SUBST(RSL_LIB)
AC_SUBST(GOT_RSL_LIB)
AC_SUBST(IRIS_CFLAG)
AC_SUBST(IRIS_LIB)
AC_SUBST(GOT_IRIS_LIB)
AC_SUBST(RAINBOW_CFLAG)
AC_SUBST(RAINBOW_LIB)
AC_SUBST(GOT_RAINBOW_LIB)
AC_SUBST(TORCH_DIR)
AC_SUBST(TORCH_INCLUDE_FLAG)
AC_SUBST(TORCH_LIBRARY_FLAG)
AC_SUBST(MISTNET_LIB)
AC_SUBST(MISTNET_CFLAG)
AC_SUBST(LIBS)
AC_SUBST(LD_PRINTOUT)
AC_CONFIG_FILES(def.mk)
AC_CONFIG_FILES(vol2bird.sh)
AC_CONFIG_FILES(rsl2odim.sh)
if [[ "x$TORCH_SUPPRESSED" = "xno" ]]; then
AC_CONFIG_FILES(libmistnet/configure)
fi
AC_OUTPUT
chmod 755 ./vol2bird.sh
chmod 755 ./rsl2odim.sh
if [[ "x$TORCH_SUPPRESSED" = "xno" ]]; then
AC_MSG_NOTICE(starting CMake configuration of libmistnet)
cd libmistnet
chmod 755 configure
./configure
AC_MSG_RESULT(done)
fi