-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
1746 lines (1569 loc) · 69.8 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
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
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
################################################################################
# Standard Stuff
################################################################################
AC_CONFIG_SRCDIR([moab.make.in])
AC_CONFIG_SRCDIR([config/MOABConfig.cmake.in])
AC_CONFIG_SRCDIR([examples/makefile.config.in])
AC_CONFIG_MACRO_DIR([config])
AC_CONFIG_AUX_DIR([config])
AC_CANONICAL_TARGET
m4_ifdef([AM_SILENT_RULES],
[m4_define([mb_am_oldtests], [[color-tests] [parallel-tests]])],
[m4_define([mb_am_oldtests], [])])
AM_INIT_AUTOMAKE([subdir-objects] mb_am_oldtests)
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CHECK_PROG( [SED], [sed], [sed], [true] )
# Infer the source directory as the path to the ./configure script
project_topsrcdir=`dirname $0`
project_topbuilddir="$PWD"
USER_CONFIGURE_CMD="$0 $ac_configure_args"
################################################################################
# Operating system
################################################################################
build_linux=no
build_windows=no
build_mac=no
# Detect the target system
case "${target_os}" in
linux*)
build_linux=yes
;;
cygwin*|mingw*)
build_windows=yes
;;
darwin*)
build_mac=yes
;;
*)
AC_MSG_ERROR(["OS $target_os is not supported"])
;;
esac
# Pass the conditionals to automake
AM_CONDITIONAL([LINUX], [test "$build_linux" = "yes"])
AM_CONDITIONAL([WINDOWS], [test "$build_windows" = "yes"])
AM_CONDITIONAL([OSX], [test "$build_mac" = "yes"])
################################################################################
# Compilers
################################################################################
INITIALIZE_EXTERNAL_PACKAGES
MB_CPPFLAGS=""
MB_DEFS=""
ENABLE_FORTRAN=no
AC_ARG_ENABLE([fortran],
[AS_HELP_STRING([--disable-fortran], [Disable Fortran support and name mangling in ITAPS/MBCN C headers])])
if (test "x$enable_fortran" != "xno"); then
ENABLE_FORTRAN=yes
fi
AC_SUBST(ENABLE_FORTRAN)
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --enable-fortran=$ENABLE_FORTRAN"
FCMANGLE_SUFFIX="_" # GNU, Intel
AC_ARG_WITH(fc-mangling-suffix,
[AS_HELP_STRING([--with-fc-mangling-suffix=<lib>], [use the provided suffix for Fortran mangled symbols])])
case $with_fc_mangling_suffix in
yes | no | "") ;;
*) FCMANGLE_SUFFIX="$with_fc_mangling_suffix" ;;
esac
AC_SUBST(FCMANGLE_SUFFIX)
# Find out the appropriate compiler based on user options
FATHOM_CHECK_COMPILERS([yes],[yes],[$ENABLE_FORTRAN])
AM_CONDITIONAL(PARALLEL,[test "x$enablempi" != "xno"])
AM_CONDITIONAL(ENABLE_FORTRAN,[test "x$ENABLE_FORTRAN" != "xno"])
MPI_DIR=$WITH_MPI
AC_SUBST(MPI_DIR)
AC_SUBST(enablempi)
# Invoke and find all necessary flags for C, C++, FC
FATHOM_COMPILER_FLAGS([yes],[yes],[$ENABLE_FORTRAN])
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_MKDIR_P
AC_DISABLE_SHARED
AC_SUBST(enable_static)
AC_SUBST(enable_shared)
# All language options initialized -- now call
# libtool initialization
# AC_PROG_LIBTOOL is deprecated
LT_INIT([dlopen])
LT_LANG([C++])
AC_C_BIGENDIAN
AC_CHECK_PROG([ZCAT],[gunzip],[gunzip -c],[])
AC_CHECK_PROG([ZCAT],[gzip],[gzip -cd],[])
AC_CHECK_PROG([ZCAT],[zcat],[zcat],[])
if test "x" = "x$ZCAT"; then
AC_MSG_WARN([[Cannot run tests: no way to uncompress input files.]])
fi
AC_SUBST([ZCAT])
AM_CONDITIONAL([HAVE_ZCAT],[test "x" = "x$ZCAT"])
FATHOM_TEMPLATE_SPECIALIZATION
FATHOM_TEMPLATE_FUNC_SPECIALIZATION
MB_DEFS="$MB_DEFS $TEMPLATE_SPECIALIZATION $TEMPLATE_FUNC_SPECIALIZATION"
FATHOM_CHECK_CXX_WORKS([], [AC_MSG_ERROR([Cannot build without C++ compiler])])
################################################################################
# Check for need for extra flags to support cray pointers
################################################################################
if test "xyes" = "x$ENABLE_FORTRAN" && test "x" != "x$F77"; then
PAC_PROG_F77_CRAY_POINTER([
FFLAGS="$FFLAGS $CRAYPTR_FFLAGS"
])
fi
if test "xyes" = "x$ENABLE_FORTRAN" && test "x" != "x$FC"; then
PAC_PROG_FC_CRAY_POINTER([
FCFLAGS="$FCFLAGS $CRAYPTR_FCFLAGS"
])
fi
################################################################################
# Basic Portability Stuff
################################################################################
AC_CHECK_FUNC([vsnprintf], [AC_DEFINE([HAVE_VSNPRINTF],[1],[Define if vsnprintf is available.])] )
AC_CHECK_FUNC([vsprintf], [AC_DEFINE([HAVE_VSPRINTF], [1],[Define if vsprintf is available.])] )
AC_CHECK_FUNC([clock], [AC_DEFINE([HAVE_CLOCK], [1],[Define if clock is available.])] )
AC_CHECK_FUNC([times], [AC_DEFINE([HAVE_TIMES], [1],[Define if times is available.])] )
AC_CHECK_FUNC([cbrt], [AC_DEFINE([HAVE_CBRT], [1],[Define if cbrt is available.])] )
FATHOM_VECTOR_TEMPLATE_INSERT
FATHOM_OLD_STD_COUNT
MB_DEFS="$MB_DEFS $NO_VECTOR_TEMPLATE_INSERT $OLD_STD_COUNT"
################################################################################
# Headers
################################################################################
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h strings.h sys/file.h sys/time.h unistd.h)
AC_CHECK_HEADER([inttypes.h], [AC_DEFINE(HAVE_INTTYPES_H, [1], [MOAB qualified HAVE_INTTYPES_H]) ])
AC_CHECK_HEADER([stdint.h], [AC_DEFINE(HAVE_STDINT_H, [1], [MOAB qualified HAVE_STDINT_H]) ])
AC_CHECK_HEADER([stddef.h], [AC_DEFINE(HAVE_STDDEF_H, [1], [MOAB qualified HAVE_STDDEF_H]) ])
AC_CHECK_HEADER([stdlib.h], [AC_DEFINE(HAVE_STDLIB_H, [1], [MOAB qualified HAVE_STDLIB_H]) ])
AC_CHECK_HEADER([ieeefp.h], [AC_DEFINE(HAVE_IEEEFP_H, [1], [MOAB qualified HAVE_IEEEFP_H]) ])
AC_CHECK_HEADER([termios.h], [AC_DEFINE(HAVE_TERMIOS_H, [1], [MOAB qualified HAVE_TERMIOS_H]) ])
AC_CHECK_HEADER([sys/types.h],[AC_DEFINE(HAVE_SYS_TYPES_H, [1], [MOAB qualified HAVE_SYS_TYPES_H])])
AC_CHECK_HEADER([sys/ioctl.h],[AC_DEFINE(HAVE_SYS_IOCTL_H, [1], [MOAB qualified HAVE_SYS_IOCTL_H])])
SIZEOF_MBENTITYHANDLE=0
AC_CHECK_SIZEOF([void *])
SIZEOF_VOID_P=$ac_cv_sizeof_void_p
AC_SUBST(SIZEOF_VOID_P)
AC_ARG_ENABLE([64bit-handles],
[AS_HELP_STRING([--enable-64bit-handles],[Force EntityHandle to be 64 bits])],
[AC_CHECK_TYPE([uint64_t],
[AC_DEFINE(FORCE_64_BIT_HANDLES,[1],[Use int64_t for handles])
SIZEOF_MBENTITYHANDLE=8
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --enable-64bit-handles"],
[AC_MSG_ERROR([Platform does not have uint64_t. Cannot force 64-bit handles])])
])
AC_ARG_ENABLE([32bit-handles],
[AS_HELP_STRING([--enable-32bit-handles],[Force EntityHandle to be 32 bits])],
[AC_CHECK_TYPE([uint32_t],
[AC_DEFINE(FORCE_32_BIT_HANDLES,[1],[Use int32_t for handles])
SIZEOF_MBENTITYHANDLE=4
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --enable-32bit-handles"],
[AC_MSG_ERROR([Platform does not have uint32_t. Cannot force 32-bit handles])])
])
if test "x$SIZEOF_MBENTITYHANDLE" = "x0"; then
SIZEOF_MBENTITYHANDLE=$SIZEOF_VOID_P
AC_CHECK_TYPE([size_t],
[AC_DEFINE(HAVE_SIZE_T,[1],[System provides size_t typedef])],
[AC_CHECK_SIZEOF([unsigned long])
SIZEOF_UNSIGNGED_LONG=$ac_cv_sizeof_unsigned_long
if test "$SIZEOF_UNSIGNED_LONG" -ne "$SIZEOF_VOID_P"; then
AC_MSG_ERROR([Cannot define handle with sizeof void*: size_t not found and long is of incorrect size.])
fi]
)
AC_CHECK_TYPE([ptrdiff_t],
[AC_DEFINE(HAVE_PTRDIFF_T,[1],[System provides ptrdiff_t typedef])],
[AC_CHECK_SIZEOF([long])
AC_CHECK_SIZEOF([void *])
SIZEOF_VOID_P=$ac_cv_sizeof_void_p
SIZEOF_LONG=$ac_cv_sizeof_long
if test "$SIZEOF_LONG" -ne "$SIZEOF_VOID_P"; then
AC_MSG_ERROR([Cannot define handle with sizeof void*: ptrdiff_t not found and long is of incorrect size.])
fi]
)
fi
# Use 64-bit off_t value for file offsets. W/out this, the stat/fseek calls
# in serial_open_file and other places will fail on 32-bit systems if the file
# is larger that 2GB.
if (test "x$enable_32bit_handles" != "x"); then
MB_DEFS="$MB_DEFS -D_FILE_OFFSET_BITS=64"
# AC_DEFINE_UNQUOTED([FILE_OFFSET_BITS], [64], [Support for handling files larger than 2GB on 32-bit machines])
fi
AC_CHECK_LIB(dl, dlopen, LIBS="$LIBS -ldl")
AC_CHECK_LIB(z, compress, LIBS="$LIBS -lz")
if (test "$cxx_compiler" != "Intel"); then
AC_CHECK_LIB(m, pow, LIBS="$LIBS -lm")
fi
### Check for BLAS and Lapack dense solvers
AC_ARG_ENABLE( [blaslapack],
[AS_HELP_STRING([--disable-blaslapack], [Enable/disable external BLAS/LAPACK interface; If disabled, Eigen3 should be enabled.])],
[enable_blaslapack=no],
[enable_blaslapack=yes] )
if (test "x$enable_blaslapack" != "xno"); then
AX_BLAS
AX_LAPACK
LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS"
fi
################################################################################
# pymoab
################################################################################
# function for detecting python modules
AC_DEFUN([AC_PYTHON_MODULE],
[AC_MSG_CHECKING(for module $1 in python)
echo "import $1" | python -
if test $? -ne 0 ; then
AC_MSG_RESULT(not found)
AC_MSG_ERROR(You need the module $1 available to python for this package)
fi
AC_MSG_RESULT(found)
])
filter_sources="NO"
filter_program=""
python_patterns=""
AC_MSG_CHECKING([if pymoab interface was requested by user])
AC_ARG_ENABLE( [pymoab],
[AS_HELP_STRING([--enable-pymoab],[Build support for pymoab interface.])],
[enable_pymoab=$enableval],
[enable_pymoab=no] )
AC_ARG_VAR([PYMOAB_PREFIX],
Custom location for install of PyMOAB module)
pymoab_custom_install=no
AC_MSG_RESULT([$enable_pymoab])
if (test "xyes" != "x$enable_pymoab" && test "xno" != "x$enable_pymoab"); then
AC_MSG_ERROR([Unknown argument --enable-pymoab=$enableval])
else
if (test "x$enable_pymoab" != "xno"); then
ENABLE_pymoab=yes
AM_PATH_PYTHON([2.7],,[:])
AX_PYTHON_DEVEL()
AC_MSG_CHECKING([for the numpy Python package])
ac_numpy_result=`$PYTHON -c "import numpy" 2>&1`
if test $? -eq 0; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([cannot import Python module "numpy".
Please check your Python installation. The error was:
$ac_numpy_result])
PYTHON_VERSION=""
fi
AC_MSG_CHECKING([for the setuptools Python package])
ac_setuptools_result=`$PYTHON -c "import setuptools" 2>&1`
if test $? -eq 0; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([cannot import Python module "setuptools".
Please check your Python installation. The error was:
$ac_setuptools_result])
PYTHON_VERSION=""
fi
# if enabling PyMOAB, turn cython file filter oni
filter_sources="YES"
filter_program=$PYTHON" cython_filter.py 2>/dev/null"
python_patterns="*.py *.pyx"
if (test "x$enable_devmode" != "xno"); then
# Developers updating the PyMOAB modules need Cython (> 0.25)
AC_PYTHON_MODULE(cython)
AC_MSG_CHECKING(for proper cython capabilities)
cython --cplus $srcdir/pymoab/cmake/cython_test.pyx --output-file ./.cython_test_out && rm .cython_test_out
if test $? -ne 0 ; then
AC_MSG_ERROR(cython is not the correct version for pymoab)
fi
AC_CHECK_PROG(CYTHON_AVAILABLE, cython, yes, no)
if test x"$CYTHON_AVAILABLE" != x"yes" ; then
AC_MSG_ERROR([Cython is not installed. Use 'easy_install cython'.])
else
CYTHON=`which cython`
AC_SUBST(CYTHON)
fi
fi
AC_CONFIG_SRCDIR([pymoab/setup.py.in])
# link source files to build location
AC_CONFIG_LINKS([pymoab/pymoab/moab.pxd:pymoab/pymoab/moab.pxd
pymoab/pymoab/eh.pxd:pymoab/pymoab/eh.pxd
pymoab/pymoab/tag.pyx:pymoab/pymoab/tag.pyx
pymoab/pymoab/tag.pxd:pymoab/pymoab/tag.pxd
pymoab/pymoab/core.pyx:pymoab/pymoab/core.pyx
pymoab/pymoab/core.pxd:pymoab/pymoab/core.pxd
pymoab/pymoab/rng.pyx:pymoab/pymoab/rng.pyx
pymoab/pymoab/rng.pxd:pymoab/pymoab/rng.pxd
pymoab/pymoab/hcoord.pyx:pymoab/pymoab/hcoord.pyx
pymoab/pymoab/hcoord.pxd:pymoab/pymoab/hcoord.pxd
pymoab/pymoab/types.pyx:pymoab/pymoab/types.pyx
pymoab/pymoab/topo_util.pyx:pymoab/pymoab/topo_util.pyx
pymoab/pymoab/topo_util.pxd:pymoab/pymoab/topo_util.pxd
pymoab/pymoab/scd.pyx:pymoab/pymoab/scd.pyx
pymoab/pymoab/scd.pxd:pymoab/pymoab/scd.pxd
pymoab/pymoab/skinner.pyx:pymoab/pymoab/skinner.pyx
pymoab/pymoab/skinner.pxd:pymoab/pymoab/skinner.pxd
pymoab/pymoab/tag_conventions.pxd:pymoab/pymoab/tag_conventions.pxd
pymoab/pymoab/__init__.pxd:pymoab/pymoab/__init__.pxd
pymoab/pymoab/__init__.py:pymoab/pymoab/__init__.py])
# link test files to build location
AC_CONFIG_LINKS([pymoab/tests/driver.py:pymoab/tests/driver.py
pymoab/tests/test_core.py:pymoab/tests/test_core.py
pymoab/tests/test_tag.py:pymoab/tests/test_tag.py
pymoab/tests/test_scd.py:pymoab/tests/test_scd.py
pymoab/tests/test_hom.py:pymoab/tests/test_hom.py
pymoab/tests/test_topo_util.py:pymoab/tests/test_topo_util.py
pymoab/tests/test_range.py:pymoab/tests/test_range.py
pymoab/tests/test_skinner.py:pymoab/tests/test_skinner.py
pymoab/tests/cyl_grps.h5m:pymoab/tests/cyl_grps.h5m
pymoab/tests/cyl_grps.vtk:pymoab/tests/cyl_grps.vtk])
# if a python install location is specified, use that
if test "x$PYMOAB_PREFIX" != "x"; then
pymoab_custom_install=yes
pymoab_prefix=${PYMOAB_PREFIX}
pythondir=$pymoab_prefix
else
# if a prefix was supplied, then install under the lib directory
# of the specified prefix location
if test "x$prefix" != "xNONE"; then
pymoab_prefix=$prefix/lib/python${PYTHON_VERSION}/site-packages
pymoab_custom_install=yes
pythondir=$pymoab_prefix
else
# if no specific location is used and no prefix was supplied,
# then install to the system location
pymoab_prefix=/usr/lib/python${PYTHON_VERSION}/dist-packages
pythondir=$pymoab_prefix
fi
fi
AC_SUBST([pymoab_prefix])
# ensure shared libraries are enabled
if (test "xyes" != "x$enable_shared" || test "xno" = "x$enable_shared"); then
AC_MSG_ERROR([Cannot build static libraries and the python interface. Please build with shared libraries (--enable-shared) or build without MOAB's python interface.])
fi
# ensure 32 bit objects are NOT enabled
if (test "xyes" = "x$enable_32bit" || test "xno" != "x$enable_32bit"); then
AC_MSG_ERROR([Cannot build pymoab with 32bit objects enabled. Please remove the --enable-32bit configuration option or build without MOAB's python interface.])
fi
# ensure 32 bit handles are NOT enabled
if (test "x$enable_32bit_handles" != "x"); then
AC_MSG_ERROR([Cannot build pymoab with 32bit EntityHandles enabled. Please remove the --enable-32bit-handles configuration option or build without MOAB's python interface.])
fi
UNAME_S=`uname -s`
if (test "x$UNAME_S" = "xDarwin"); then
SLIBENVPATH="DYLD_LIBRARY_PATH"
else
SLIBENVPATH="LD_LIBRARY_PATH"
fi
AC_SUBST(SLIBENVPATH)
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --enable-pymoab=$ENABLE_pymoab"
else
ENABLE_pymoab=no
fi
fi
AM_CONDITIONAL([ENABLE_pymoab],[test "xyes" = "x$ENABLE_pymoab"])
AC_MSG_CHECKING([if pymoab interface is enabled])
AC_MSG_RESULT([$ENABLE_pymoab])
AC_SUBST([filter_sources])
AC_SUBST([filter_program])
AC_SUBST([python_patterns])
################################################################################
# iMesh Part 1 of 2
################################################################################
AC_ARG_ENABLE( [imesh],
[AS_HELP_STRING([--disable-imesh],[Do not build support for iMesh interface.])],
[disable_imesh=$enableval],
[disable_imesh=yes] )
if (test "xyes" != "x$disable_imesh" && test "xno" != "x$disable_imesh"); then
AC_MSG_ERROR([Unknown argument --disable-imesh=$enableval])
else
if (test "$disable_imesh" != "no"); then
ENABLE_imesh=yes
else
ENABLE_imesh=no
fi
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --enable-imesh=$ENABLE_imesh"
fi
################################################################################
# FBiGeom Part 1 of 2
################################################################################
AC_ARG_ENABLE( [fbigeom],
[AS_HELP_STRING([--enable-fbigeom],[Build mesh-based (facets) iGeom implementation])],
[enable_fbigeom=$enableval],[enable_fbigeom=no] )
if (test "xyes" != "x$enable_fbigeom" && test "xno" != "x$enable_fbigeom"); then
AC_MSG_ERROR([Unknown argument --enable-fbigeom=$enableval])
else
ENABLE_fbigeom=$enable_fbigeom
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --enable-fbigeom=$enable_fbigeom"
fi
################################################################################
# iMesh/FBiGeom Part 2 of 2
################################################################################
# The iMesh option must be checked before configuring the compilers
# so that we know if we need Fortran. This stuff has to be done
# after configuring the compilers so that we know what size of
# various types are.
AC_MSG_CHECKING([size of EntityHandle])
AC_MSG_RESULT([$SIZEOF_MBENTITYHANDLE])
ITAPS_VALID_HANDLE_SIZE=yes
if test $SIZEOF_VOID_P -ne $SIZEOF_MBENTITYHANDLE; then
ITAPS_VALID_HANDLE_SIZE=no
AC_MSG_WARN([Cannot build iMesh or FBiGeom API because sizeof(EntityHandle) != sizeof(void*)])
ENABLE_imesh=no
ENABLE_fbigeom=no
fi
AC_MSG_CHECKING([if FBiGeom support is to be built])
AC_MSG_RESULT([$ENABLE_fbigeom])
AM_CONDITIONAL([ENABLE_fbigeom],[test "xyes" = "x$ENABLE_fbigeom"])
if test "x$ENABLE_fbigeom" = "xyes"; then
if test "x$ITAPS_VALID_HANDLE_SIZE" != "xyes"; then
AC_MSG_ERROR([Cannot build FBiGeom API with sizeof(EntityHandle) != sizeof(void*)])
fi
AC_DEFINE([HAVE_FBIGEOM],[1],[Define if configured with FBiGeom interfaces.])
fi
HAVE_FBIGEOM=$ENABLE_fbigeom
AC_SUBST(HAVE_FBIGEOM)
AC_MSG_CHECKING([if iMesh support is to be built])
AC_MSG_RESULT([$ENABLE_imesh])
AM_CONDITIONAL([ENABLE_imesh],[test "xyes" = "x$ENABLE_imesh"])
if test "x$ENABLE_imesh" = "xyes"; then
if test "x$ITAPS_VALID_HANDLE_SIZE" != "xyes"; then
AC_MSG_ERROR([Cannot build iMesh API with sizeof(EntityHandle) != sizeof(void*)])
fi
AC_DEFINE([HAVE_IMESH],[1],[Define if configured with iMesh interfaces.])
fi
################################################################################
# iRel/Lasso Part 1 of 2
################################################################################
AC_ARG_ENABLE( [irel],
[AS_HELP_STRING([--enable-irel],[Build relational geometry-mesh query interface implementation])],
[enable_irel=$enableval],[enable_irel=no] )
if (test "xyes" != "x$enable_irel" && test "xno" != "x$enable_irel"); then
AC_MSG_ERROR([Unknown argument --enable-irel=$enableval])
else
ENABLE_irel=$enable_irel
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --enable-irel=$enable_irel"
fi
################################################################################
# Mesquite Part 1 of 2
################################################################################
AC_ARG_ENABLE( [mesquite],
[AS_HELP_STRING([--enable-mesquite],[Build support for Mesquite interfaces.])],
[enable_mesquite=$enableval],
[enable_mesquite=no] )
if (test "xyes" != "x$enable_mesquite" && test "xno" != "x$enable_mesquite"); then
AC_MSG_ERROR([Unknown argument --enable-mesquite=$enableval])
else
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --enable-mesquite=$enable_mesquite"
fi
################################################################################
# Version Stuff
################################################################################
AC_DEFINE(VERSION,["AC_PACKAGE_VERSION"],[MOAB Version])
VERSION_MAJOR=`expr AC_PACKAGE_VERSION : '\([[0-9]]*\)'`
VERSION_MINOR=`expr AC_PACKAGE_VERSION : '[[0-9]]*\.\([[0-9]]*\)'`
VERSION_PATCH=`expr AC_PACKAGE_VERSION : '[[0-9]]*\.[[0-9]]*\.\(.*\)'`
test "x" != "x$VERSION_MAJOR" || AC_MSG_ERROR("Invalid version string: AC_PACKAGE_VERSION")
test "x" != "x$VERSION_MINOR" || AC_MSG_ERROR("Invalid version string: AC_PACKAGE_VERSION")
AC_DEFINE_UNQUOTED(VERSION_MAJOR,$VERSION_MAJOR,[MOAB Major Version])
AC_DEFINE_UNQUOTED(VERSION_MINOR,$VERSION_MINOR,[MOAB Minor Version])
if test "x" != "x$VERSION_PATCH"; then
AC_DEFINE_UNQUOTED(VERSION_PATCH,$VERSION_PATCH,[MOAB Patch Level])
VERSION_STRING="AC_PACKAGE_STRING"
elif test $VERSION_MINOR -eq 99; then
VERSION_STRING="AC_PACKAGE_STRING (Alpha)"
else
VERSION_STRING="AC_PACKAGE_STRING (Beta)"
fi
AC_DEFINE_UNQUOTED(VERSION_STRING,"${VERSION_STRING}",[MOAB Version String])
################################################################################
# Create libtool script
################################################################################
# We need the libtool script both for the calls to the ITAPS_LIBTOOL_VAR
# macro and for us in testing for libraries. If we're using a newer
# version of libtool, the script normally isn't generated until AC_OUTPUT
# at the end of the configure script. Ask that it be created now instead.
m4_ifdef([LT_OUTPUT],[LT_OUTPUT])
################################################################################
# Extract libtool config
################################################################################
FATHOM_LIBTOOL_VAR( [CXX], [compiler_lib_search_path], [MOAB_CXX_LINKFLAGS])
FATHOM_LIBTOOL_VAR( [CXX], [postdeps], [MOAB_CXX_LIBS_TMP])
MOAB_CXX_LIBS=
for lib in $MOAB_CXX_LIBS_TMP; do
case $lib in
-lgcc_s)
;;
-lm)
;;
-lc)
;;
*)
MOAB_CXX_LIBS="$MOAB_CXX_LIBS $lib"
;;
esac
done
AC_SUBST(MOAB_CXX_LINKFLAGS)
AC_SUBST(MOAB_CXX_LIBS)
################################################################################
# System Headers
################################################################################
HAVE_IEEEFP=0
AC_CHECK_HEADER([ieeefp.h],[HAVE_IEEEFP_H=1] )
AM_CONDITIONAL(HAVE_IEEEFP_H, [test "$HAVE_IEEEFP"!="0"])
if (test "$HAVE_IEEEFP" != "0"); then
AC_DEFINE(HAVE_IEEEFP, [1], [Defined if configured with IEEE Floating point support])
fi
## Check for some mathematical functions
AX_CXX_HAVE_STDISFINITE
AX_CXX_HAVE_ISFINITE
AX_CXX_HAVE_FINITE
HAVE_VALGRIND=0
if test "xyes" = "x$enable_debug"; then
AC_CHECK_HEADER( [valgrind/memcheck.h], [HAVE_VALGRIND=1] )
if (test "$HAVE_IEEEFP" != "0"); then
AC_DEFINE(HAVE_VALGRIND, [1], [Defined if configured with Valgrind support])
fi
fi
AM_CONDITIONAL(HAVE_VALGRIND, [test "$HAVE_VALGRIND"!="0"])
################################################################################
# BOOST OPTIONS
################################################################################
dnl FATHOM_CHECK_BOOST( [boost/pool/object_pool.hpp] )
# MK_CHECK_UNORDERED_MAP([CPPFLAGS="$CPPFLAGS -DUNORDERED_MAP_NS=$result -DHAVE_UNORDERED_MAP=${incdir}unordered_map -DHAVE_UNORDERED_SET=${incdir}unordered_set"])
MK_CHECK_UNORDERED_MAP([AC_DEFINE_UNQUOTED([UNORDERED_MAP_NS], [$result], [Unordered map namespace])
AC_DEFINE_UNQUOTED([HAVE_UNORDERED_MAP], [${incdir}unordered_map], [Specify if unordered map is available])
AC_DEFINE_UNQUOTED([HAVE_UNORDERED_SET], [${incdir}unordered_set], [Specify if unordered set is available])])
################################################################################
# MPI OPTIONS
################################################################################
FATHOM_CHECK_MPI
FATHOM_CONFIG_MPI_EXEC
if (test "xno" != "x$enablempi"); then
AC_DEFINE([HAVE_MPI],[1],[Define if configured with support for parallel computations.])
fi
AM_CONDITIONAL(HAVE_MPI, [test "xno" != "x$enablempi"])
# Used to generate moab_mpi.h
if test "xyes" = "x$MPI_CXX_HELP_NEEDED"; then
AC_DEFINE( [MPI_CXX_CONFLICT], [1],
[MPICH_IGNORE_CXX_SEEK is not sufficient to avoid conflicts] )
AC_DEFINE_UNQUOTED([SEEK_SET],[$SEEK_SET],["Value of C SEEK_SET"])
AC_DEFINE_UNQUOTED([SEEK_CUR],[$SEEK_CUR],["Value of C SEEK_CUR"])
AC_DEFINE_UNQUOTED([SEEK_END],[$SEEK_END],["Value of C SEEK_END"])
fi
FATHOM_CHECK_MPITYPE
if (test "$MPIFAMILY" = "OPENMPI" && test "x$ENABLE_FORTRAN" != "xno"); then
FCLIBS="$FCLIBS -lmpi_cxx"
fi
if test "xyes" = "x$enablempi"; then
FATHOM_CHECK_MPE
AC_SUBST([WITH_MPE])
AC_SUBST([MPE_LIBS])
test "xyes" != "x$WITH_MPE" || MB_DEFS="$MB_DEFS -DUSE_MPE"
fi
################################################################################
# Eigen3 OPTIONS
################################################################################
FATHOM_CONFIGURE_EIGEN3
if (test "x$enable_blaslapack" != "xyes" && test "x$enableeigen" != "xyes"); then
AC_MSG_ERROR("Either external BLAS/LAPACK libraries or Eigen headers need to be provided.")
fi
################################################################################
# HYPRE OPTIONS
################################################################################
enablehypre=no
if (test "x$enablempi" != "xno" && test "x$enableeigen" != "xno"); then
CONFIGURE_HYPRE
if (test "xno" != "x$enablehypre"); then
AC_DEFINE([HAVE_HYPRE],[1],["Define if configured with HYPRE solver support."])
fi
fi
AM_CONDITIONAL(HAVE_HYPRE, [test "xno" != "x$enablehypre"])
################################################################################
# HDF5 OPTIONS
################################################################################
FATHOM_CHECK_HDF5
################################################################################
# CCMIO OPTIONS
################################################################################
old_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $HDF5_LDFLAGS"
FATHOM_CHECK_CCMIO
LDFLAGS="$old_LDFLAGS"
if test "xno" != "x$HAVE_CCMIO"; then
AC_DEFINE([HAVE_CCMIO],[1],["Define if configured with CCM I/O support."])
fi
AM_CONDITIONAL(HAVE_CCMIO, [test "xno" != "x$HAVE_CCMIO"])
MB_CPPFLAGS="$CCMIO_CPPFLAGS $MB_CPPFLAGS"
EXPORT_LDFLAGS="$CCMIO_LDFLAGS $EXPORT_LDFLAGS"
AC_SUBST(CCMIO_LIBS)
################################################################################
# DAMSEL OPTIONS
################################################################################
old_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $HDF5_LDFLAGS"
FATHOM_CHECK_DAMSEL
LDFLAGS="$old_LDFLAGS"
if (test "xno" != "x$HAVE_DAMSEL" && test "x" != "x$HAVE_DAMSEL"); then
AC_DEFINE([HAVE_DAMSEL],[1],["Define if configured with Damsel I/O format support."])
fi
AM_CONDITIONAL(HAVE_DAMSEL, [test "xno" != "x$HAVE_DAMSEL" && test "x" != "x$HAVE_DAMSEL"])
MB_CPPFLAGS="$DAMSEL_CPPFLAGS $MB_CPPFLAGS"
EXPORT_LDFLAGS="$DAMSEL_LDFLAGS $EXPORT_LDFLAGS"
AC_SUBST(DAMSEL_LIBS)
################################################################################
# NetCDF OPTIONS
################################################################################
# now pnetcdf
FATHOM_CHECK_PNETCDF([65536],[524288])
if test "xyes" = "x$enablepnetcdf"; then
AC_DEFINE([HAVE_PNETCDF],[1],["Define if configured with PNetCDF support."])
fi
AM_CONDITIONAL(HAVE_PNETCDF, [test "xyes" = "x$enablepnetcdf"])
MB_CPPFLAGS="$PNETCDF_CPPFLAGS $MB_CPPFLAGS"
EXPORT_LDFLAGS="$PNETCDF_LDFLAGS $EXPORT_LDFLAGS"
AC_SUBST(PNETCDF_LIBS)
AC_SUBST(enablepnetcdf)
old_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $PNETCDF_LDFLAGS $HDF5_LDFLAGS"
FATHOM_CHECK_NETCDF([65536],[524288])
LDFLAGS="$old_LDFLAGS"
if test "xyes" = "x$enablenetcdf"; then
AC_DEFINE([HAVE_NETCDF],[1],["Define if configured with NetCDF support."])
fi
AM_CONDITIONAL(HAVE_NETCDF, [test "xno" != "x$enablenetcdf"])
MB_CPPFLAGS="$NETCDF_CPPFLAGS $MB_CPPFLAGS"
EXPORT_LDFLAGS="$NETCDF_LDFLAGS $EXPORT_LDFLAGS"
AC_SUBST(NETCDF_LIBS)
AC_SUBST(enablenetcdf)
################################################################################
# CGNS OPTIONS
################################################################################
old_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $HDF5_LDFLAGS"
FATHOM_CHECK_CGNS
LDFLAGS="$old_LDFLAGS"
if test "xno" != "x$HAVE_CGNS"; then
AC_DEFINE([HAVE_CGNS],[1],["Define if configured with CGNS support."])
fi
AM_CONDITIONAL(HAVE_CGNS, [test "xno" != "x$HAVE_CGNS"])
MB_CPPFLAGS="$CGNS_CPPFLAGS $MB_CPPFLAGS"
EXPORT_LDFLAGS="$CGNS_LDFLAGS $EXPORT_LDFLAGS"
AC_SUBST(CGNS_LIBS)
#################################################################################
# Documentation
#################################################################################
AC_ARG_ENABLE([docs],
[AS_HELP_STRING([--enable-docs],[indicate to check for doxygen installation])],
[ENABLE_DOCS=yes],[ENABLE_DOCS=no] )
AC_ARG_WITH([doxygen],
[AS_HELP_STRING([--with-doxygen=DIR],[Specify directory where Doxygen program is installed. By default, it is /usr/bin])],
[WITH_DOXYGEN="$withval"], [WITH_DOXYGEN=no])
if test "x$WITH_DOXYGEN" != "xno"; then
AC_PATH_PROGS( [DOXYGEN], [doxygen], [no],[$WITH_DOXYGEN] )
else
AC_PATH_PROGS( [DOXYGEN], [doxygen], [no],[$PATH])
fi
if test "x$ENABLE_DOCS" = "xyes"; then
if test "x$DOXYGEN" = "xno"; then
AC_MSG_ERROR("Doxygen executable not found.")
fi
fi
AC_SUBST([DOXYGEN])
AM_CONDITIONAL([ENABLE_DOCS],[test "x$ENABLE_DOCS" != "xno"])
################################################################################
# Zoltan - Part 1 of 2
################################################################################
WITH_ZOLTAN=no
ZOLTAN_DIR=
ZOLTAN_ARCH=
WITH_PARAMETIS=no
PARMETIS_DIR=
METIS_DIR=
SCOTCH_DIR=
PTSCOTCH_DIR=
SCOTCH_LIBS=
WITH_SCOTCH=no
ZOLTAN_LIBS=
ZOLTAN_LIB_FLAGS=
ZOLTAN_INC_FLAGS=
# If user specified zoltan-arch, but not zoltan, assume
# they want zoltan support, otherwise assume no zoltan
ZOLTAN_DEFAULT=no
# Some versions of Zoltan put libraries in directories such as Obj_Linux,
# where the part after the Obj_ prefix is the zoltan architecture. Here
# we allow the user to specify this architecture. We try to avoid requiring
# this option, but we allow the user to specify it in case something is
# going wrong with the logic to choose one automatically. The 'choose one
# automatically' logic is basically to add everything that matches Obj_*
# to the search path, with the assumption that the linker will ignore libraries
# for other architectures.
AC_ARG_WITH( [zoltan-arch],
[AS_HELP_STRING([--with-zoltan-arch=OS],[Specify zoltan architecture])],
[case "x$withval" in
xyes|xno)
AC_MSG_ERROR([Expeted value for --with-zoltan-arch])
;;
x*)
ZOLTAN_ARCH="$withval"
ZOLTAN_DEFAULT=yes
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-zoltan-arch=\"${withval}\""
;;
esac])
# Enable support for Zoltan, and optionally specify directory in which
# to search for Zoltan libs and headers. Specifying this also enables
# mbzoltan unless it is explicitly disabled.
AC_ARG_WITH( [zoltan],
[AS_HELP_STRING([--with-zoltan=DIR],[Enable Zoltan support, and optionally specify Zoltan location])],
[case "x$withval" in
xyes)
WITH_ZOLTAN=yes
;;
xno)
WITH_ZOLTAN=no
;;
x*)
WITH_ZOLTAN=yes
ZOLTAN_DIR="$withval"
test -d "$withval" || AC_MSG_ERROR([Not a directory: with-zoltan=$withval])
if test -d "$withval/include"; then
ZOLTAN_INC_FLAGS="-I$withval/include"
else
ZOLTAN_INC_FLAGS="-I$withval"
fi
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-zoltan=\"${withval}\""
;;
esac],[WITH_ZOLTAN=$ZOLTAN_DEFAULT] )
FATHOM_CONFIGURE_METIS
FATHOM_CONFIGURE_PARMETIS
# If user specified with-scotch, then assume they are trying
# to add an additional library search directory in which to check
# for the scotch library.
AC_ARG_WITH([scotch],
[AS_HELP_STRING([--with-scotch=DIR],[Directory containing Scotch library for Zoltan])],
[SCOTCH_DIR="$withval"; enablescotch=yes],[SCOTCH_DIR=""; enablescotch=no] )
if (test "$enablescotch" != "no"); then
case "x$SCOTCH_DIR" in
xyes|xno)
# error out -- expecting directory path
AC_MSG_ERROR([Please specify the Scotch installation directory])
;;
x*)
test -d "$SCOTCH_DIR" || AC_MSG_ERROR([Not a directory: with-scotch=$SCOTCH_DIR])
if test -d "$SCOTCH_DIR/lib"; then
ZOLTAN_LIB_FLAGS="$ZOLTAN_LIB_FLAGS -L$SCOTCH_DIR/lib"
if (test -f "$SCOTCH_DIR/lib/libscotch.a" || test -f "$SCOTCH_DIR/lib/libscotch.so" || test -f "$SCOTCH_DIR/lib/libscotch.dylib"); then
SCOTCH_LIBS="-lscotch -lscotcherr -lscotcherrexit"
AC_DEFINE([HAVE_SCOTCH],[1],["Define if configured with Scotch library partitioning support."])
else
AC_MSG_ERROR([Scotch libraries not found at $SCOTCH_DIR/lib])
fi
else
ZOLTAN_LIB_FLAGS="$ZOLTAN_LIB_FLAGS -L$SCOTCH_DIR"
if (test -f "$SCOTCH_DIR/libscotch.a" || test -f "$SCOTCH_DIR/libscotch.so" || test -f "$SCOTCH_DIR/libscotch.dylib"); then
SCOTCH_LIBS="-lscotch -lscotcherr -lscotcherrexit"
else
AC_MSG_ERROR([Scotch libraries not found at $SCOTCH_DIR])
fi
fi
if test -d "$SCOTCH_DIR/include"; then
ZOLTAN_INC_FLAGS="$ZOLTAN_INC_FLAGS -I$SCOTCH_DIR/include"
else
ZOLTAN_INC_FLAGS="$ZOLTAN_INC_FLAGS -I$SCOTCH_DIR"
fi
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-scotch=\"${SCOTCH_DIR}\""
;;
esac
fi
# If user specified with-ptscotch, then assume they are trying
# to add an additional library search directory in which to check
# for the parallel scotch library.
AC_ARG_WITH([ptscotch],
[AS_HELP_STRING([--with-ptscotch=DIR],[Directory containing PTScotch library for Zoltan])],
[PTSCOTCH_DIR="$withval"; enableptscotch=yes],[PTSCOTCH_DIR="$SCOTCH_DIR"; enableptscotch=$enablescotch] )
if (test "$enableptscotch" != "no"); then
case "x$PTSCOTCH_DIR" in
xyes|xno)
# error out -- expecting directory path
AC_MSG_ERROR([Please specify the parallel Scotch installation directory])
;;
x*)
PTSCOTCH_DIR="$PTSCOTCH_DIR"
test -d "$PTSCOTCH_DIR" || AC_MSG_ERROR([Not a directory: with-ptscotch=$PTSCOTCH_DIR])
if test -d "$PTSCOTCH_DIR/lib"; then
ZOLTAN_LIB_FLAGS="$ZOLTAN_LIB_FLAGS -L$PTSCOTCH_DIR/lib"
if (test -f "$SCOTCH_DIR/lib/libptscotch.a" || test -f "$SCOTCH_DIR/lib/libptscotch.so" || test -f "$SCOTCH_DIR/lib/libptscotch.dylib"); then
SCOTCH_LIBS="-lptscotch -lptscotcherr -lptscotcherrexit $SCOTCH_LIBS"
AC_DEFINE([HAVE_SCOTCH],[1],["Define if configured with Parallel Scotch library partitioning support."])
else
AC_MSG_ERROR([Scotch libraries not found at $SCOTCH_DIR/lib])
fi
else
ZOLTAN_LIB_FLAGS="$ZOLTAN_LIB_FLAGS -L$PTSCOTCH_DIR"
if (test -f "$SCOTCH_DIR/libptscotch.a" || test -f "$SCOTCH_DIR/libptscotch.so" || test -f "$SCOTCH_DIR/libptscotch.dylib"); then
SCOTCH_LIBS="-lptscotch -lptscotcherr -lptscotcherrexit $SCOTCH_LIBS"
else
AC_MSG_ERROR([Scotch libraries not found at $SCOTCH_DIR])
fi
fi
if test -d "$PTSCOTCH_DIR/include"; then
ZOLTAN_INC_FLAGS="$ZOLTAN_INC_FLAGS -I$PTSCOTCH_DIR/include"
else
ZOLTAN_INC_FLAGS="$ZOLTAN_INC_FLAGS -I$PTSCOTCH_DIR"
fi
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-ptscotch=\"${PTSCOTCH_DIR}\""
;;
esac
fi
################################################################################
# Optional Libraries
################################################################################
AC_ARG_WITH([vtk],
[AS_HELP_STRING([--with-vtk=DIR],[Enable VTK support, and specify VTK location])],
[WITH_VTK=$withval
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-vtk=\"${withval}\""
],[WITH_VTK=])
VTKMOAB_DEFAULT=no
if (test "x$WITH_VTK" != "xno" && test "x$WITH_VTK" != "x"); then
VTKMOAB_DEFAULT=yes
fi
AC_ARG_WITH( [vtk-lib-suffix],
[AS_HELP_STRING([--with-vtk-lib-suffix=SUFFIX],[Specify optional suffix to VTK library names, e.g. -pv3.98])],
[case "x$withval" in
xyes)
AC_MSG_ERROR([Must specify a non-empty suffix!])
VTK_LIB_SUFFIX=
;;
xno)
AC_MSG_ERROR([Must specify a non-empty suffix!])
VTK_LIB_SUFFIX=
;;
x*)
VTK_LIB_SUFFIX="$withval"
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-vtk-lib-suffix=\"${withval}\""
;;
esac],[VTK_LIB_SUFFIX=] )
# Provide downloadable option for TempestRemap library
# Supported TempestRemap versions: 2.0.3
# Arguments: 1) Default Version Number, 2) Download by default ?
AUSCM_CONFIGURE_DOWNLOAD_TEMPESTREMAP([2.0.3],[no])
# Configuration for TempestRemap library
AC_ARG_WITH([tempestremap],
[AS_HELP_STRING([--with-tempestremap=DIR],[Enable intersection/remapping support through interface to TempestRemap])],
[WITH_TEMPEST=$withval
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-tempestremap=\"${withval}\""
],[WITH_TEMPEST=$TEMPESTREMAP_DIR])
HAVE_TEMPEST=no
if (test "x$WITH_TEMPEST" != "xno" && test "x$WITH_TEMPEST" != "x"); then
if (test "x$enableeigen" != "xyes"); then
AC_MSG_WARN([TempestRemap remapping operators cannot be computed without Eigen3 support])
else
# Test for Tempest headers
AC_LANG_PUSH([C++])
old_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$WITH_TEMPEST/include"
AC_CHECK_HEADER([TempestConfig.h],[TEMPESTREMAP_INCLUDE="-I$WITH_TEMPEST/include"],
[WITH_TEMPEST=no
AC_MSG_WARN([TempestConfig.h: header not found in $WITH_TEMPEST/include.])],
[#include <stdlib.h>])
CPPFLAGS="$old_CPPFLAGS"
AC_SUBST(TEMPESTREMAP_INCLUDE)
# Test for TempestRemap library, possibly requiring NetCDF
old_LDFLAGS="$LDFLAGS"
old_LIBS="$LIBS"
LDFLAGS="$LDFLAGS -L$WITH_TEMPEST/lib $PNETCDF_LDFLAGS $NETCDF_LDFLAGS $HDF5_LDFLAGS"
LIBS="$NETCDF_LIBS $LAPACK_LIBS $BLAS_LIBS $LIBS"
AC_CHECK_LIB([TempestRemap],[GenerateOfflineMap],[TEMPESTREMAP_LIBS="-L$WITH_TEMPEST/lib -lTempestRemap $NETCDF_LIBS $LAPACK_LIBS $BLAS_LIBS"],
[unset ac_cv_lib_TempestRemap_GenerateOfflineMap
LIBS="$NETCDF_LIBS $PNETCDF_LIBS $HDF5_LIBS $LAPACK_LIBS $BLAS_LIBS $LIBS"
AC_CHECK_LIB([TempestRemap],[GenerateOfflineMap],
[TEMPESTREMAP_LIBS="-L$WITH_TEMPEST/lib -lTempestRemap $NETCDF_LIBS $PNETCDF_LIBS $LAPACK_LIBS $BLAS_LIBS"],
[AC_MSG_ERROR([TempestRemap library not found or not usable.])]
[$NETCDF_LIBS $PNETCDF_LIBS])],[$NETCDF_LIBS])
LDFLAGS="$old_LDFLAGS"
LIBS="$old_LIBS"
AC_LANG_POP([C++])
AC_SUBST(TEMPESTREMAP_LIBS)
# Define macro HAVE_TEMPESTREMAP
AC_DEFINE([HAVE_TEMPESTREMAP],[1],[Enable use of TempestRemap library API for computing intersection and remapping for Climate problems])
HAVE_TEMPEST=yes
# We also need std-c++11 enabled
AX_CXX_COMPILE_STDCXX_0X
fi
fi
AM_CONDITIONAL( HAVE_TEMPESTREMAP, [test "x$HAVE_TEMPEST" = "xyes"] )
################################################################################
# Zoltan - Part 2 of 2
################################################################################
#if test "xyes" = "x$ENABLE_mbpart"; then
# WITH_ZOLTAN=yes
#else
# WITH_ZOLTAN=no
#fi