-
Notifications
You must be signed in to change notification settings - Fork 8
/
configure.in
553 lines (434 loc) · 17.9 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
AC_PREREQ(2.57)
AC_INIT([FronTier],[1.0])
#AC_ARG_PROGRAM
AC_CONFIG_SRCDIR([src/intfc/array.h])
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_CANONICAL_BUILD
AC_PROG_AWK
#echo "BUILD CPU=${build_cpu}"
#echo "BUILD OS=${build_os}"
#scriptotherlibs=" "
AC_ARG_WITH(devel, [ --with-devel Enables dependency tracking in examples for FronTier files],[ checklibs=FT_libs ] [ check_libs="" ] )
AC_SUBST(devel, ${checklibs})
# Checks for programs.
AC_ARG_WITH(seaborg,[ --with-seaborg Setup for seaborg],[seaborgg="yes"],[seaborgg="no"])
if test $seaborgg = 'yes'; then
module add GNU
module load gcc
fi
########################### BUILD GAS ##############################
subgrid=" "
rotsym=" "
gascleann=" "
basecode="full"
AC_ARG_WITH(adv,[ --with-adv Compilation of the Advanced FronTier++ code ],[basecode="adv"],[])
AC_ARG_WITH(base,[ --with-base Compilation of the Basic FronTier++ code ],[basecode="base"],[])
AC_ARG_WITH(gd,[ --with-gd=PFX Links with gd library for 1d post processing],[scriptotherlibsinc=" -L$withval/lib "${scriptotherlibs} scriptotherlibs="-lgd "${scriptotherlibs} gdincs=" -D__GD__ -I"${withval}"/include "],[gdincs=""])
AC_ARG_WITH(gsl,[ --with-gsl=PFX Links with gsl library for 1d post processing],[scriptotherlibsinc=" -L$withval/lib "${scriptotherlibs} scriptotherlibs="-lgsl "${scriptotherlibs} gslincs=" -D__GSL__ -I"${withval}"/include "],[gslincs=""])
AC_ARG_WITH(gpu,[--with-gpu Support GPU],[gpuincs=" -D__GPU__ " ],[gpuincs="" ])
if test "$gpuincs" = ""; then
echo "GPU not enabled"
AC_SUBST(USEGPU,${USEGPU})
else
echo "GPU enabled"
AC_SUBST(USEGPU,${USEGPU})
fi
AC_ARG_WITH(hypre,[--with-hypre Support HYPRE],[hypreincs=" -D__HYPRE__ " ],[hypreincs="" ])
if test "$hypreincs" = ""; then
echo "HYPRE not enabled"
AC_SUBST(USEHYPRE,${USEHYPRE})
else
echo "HYPRE enabled"
AC_SUBST(USEHYPRE,${USEHYPRE})
fi
############################ Compiler Checks #########################
AC_PROG_CC(gcc gcc295 cc)
AC_PROG_CXX
AC_PROG_F77(gfortran)
AC_LANG(C)
############################ Compiler Checks Ends ####################
AC_ARG_WITH(mpi, [ --with-mpi generic MPI support. See manual.], [ ompincs=" -D__MPI__ " mpi=$withval],[ mpi="no"])
AC_ARG_WITH(openmpi, [ --with-openmpi=path use openmpi for MPI], [ompi=$withval],[ompi="no"])
if test $ompi != "no" ; then
ompincs=" -D__MPI__ -I"$ompi"/include "
scriptotherlibsinc=${scriptotherlibsinc}" -L"$withval"/lib "
scriptotherlibs=${scriptotherlibs}" -lmpi -lmpi_cxx "
fi
AC_ARG_WITH(extra-incs,[ --with-extra-incs a spot to put extra includes.],[extrai=$withval ],[extrai=" "])
AC_ARG_WITH(extra-libs,[ --with-extra-libs a spot to put extra libs.],[extral=${withval} ],[extral=" " ])
scriptotherlibs=${scriptotherlibs}${extral}
AC_CHECK_HEADER(malloc.h,[malloch='yes'],[malloch='no'])
systemincs=" "
if test $malloch = 'no'; then
# darwin places malloc.h in malloc/malloc.h
AC_CHECK_HEADER(malloc/malloc.h,[mallochd='yes'],[mallochd='no'])
#systemincs=${systemincs}"-I/usr/include/malloc/ -I/usr/include/sys/"
systemincs=${systemincs}"-I/usr/include/malloc/ "
if test $mallochd = 'no'; then
AC_MSG_ERROR([malloc.h cannot be found please do something about this.])
fi
fi
AC_CHECK_FUNC(malloc,[malloc='yes'],[malloc='no'])
if test $malloc = 'no'; then
AC_MSG_ERROR([malloc cannot be found please do something about this.])
fi
#################################################
### TESTS TO BE PREFORMED FOR FRONTIER
################################################
# checks for the function feenableexcept. If found -DHAS_FENV is set.
AC_CHECK_LIB(m,feenableexcept,[fenv=" -DHAS_FENV "],[fenv=""])
#done feenableeexpcept test
# checks for libieee
AC_CHECK_LIB(ieee,main,[],[])
AC_CHECK_LIB(hdf,main,[scriptotherlibs=${scriptotherlibs}" -lhdf " testhdff='yes'],[testhdff='no'])
#done with ieee check
testmpi="no"
mpiprexif="no"
mpichprexif="no"
testovertureprefix="neither"
libover="neither"
app="neither"
testappprefix="neither"
# check for overture
AC_ARG_WITH(hdf,[ --with-hdf Support for the hdf library],[hdffprefix=$withval hdff="yes"],[hdff="no"])
if test $hdff = 'yes';then
hdfincs=" -I"${hdffprefix}"/include -DUSE_HDF "
scriptotherlibsinc=${scriptotherlibsinc}" -L/usr/lib -L"${hdffprefix}"/lib "
scriptotherlibs=${scriptotherlibs}" -lmfhdf -ldf -ljpeg -lz "
fi
AC_ARG_WITH(hdf5,[ --with-hdf5 Support for the hdf5 library],[hdff5prefix=$withval hdff5="yes"],[hdff5="no"])
if test $hdff5 = 'yes';then
hdf5incs=" -I"${hdff5prefix}"/include -DUSE_HDF5 "
scriptotherlibsinc=${scriptotherlibsinc}" -L"${hdff5prefix}"/lib "
scriptotherlibs=${scriptotherlibs}" -lhdf5"
fi
AC_ARG_WITH(overture-prefix,[ --with-overture-prefix=PFX Prefix where overture is installed],[testovertureprefix="yes" overtureprefix=$withval],[testovertureprefix="no"])
if test $testovertureprefix = 'no' && test $libover = 'no'; then
AC_MSG_ERROR([libOverture.so can not be found on this system, and its location is not specified. Please specify where it is using the --with-overture-prefix, or do not select the overture option.])
fi
AC_ARG_WITH(no-debugging,[ --with-no-debugging Removes the -g option while compiling],[debug=" "],[debug=" -g "])
##########################################################################################
# || all things requird for overture. ||
#if overture is opted for and found, check for A++, Mesa, Xlibs, and hdf and others
if test $libover = 'yes' || test $testovertureprefix = 'yes'; then
AC_CHECK_LIB(libApp,main,[app="yes"],[app="no"])
##check for mesa on syste
AC_CHECK_LIB(MesaGL,main,[mesagl="yes"],[mesagl="no"])
AC_CHECK_LIB(MesaGLU,main,[mesaglu="yes"],[mesaglu="no"])
AC_CHECK_LIB(GLw,main,[glw="yes"],[glw="no"])
sysmesa=yes
if test $mesagl = 'no' || test mesaglu = 'no'|| test GLw = 'no';then
sysmesa='no'
fi
### check for X libs
AC_PATH_X
## check for hdf
AC_CHECK_LIB(mfhdf,main,[mfhdf="yes"],[mfhdf="no"])
AC_CHECK_LIB(df,main,[df="yes"],[df="no"])
AC_CHECK_LIB(jpeg,main,[jpeg="yes"],[jpeg="no"])
AC_CHECK_LIB(z,main,[z="yes"],[z="no"])
syshdf=yes
if test $mfhdf = 'no' || test $df = 'no' || test $jpeg = 'no' || test $z = 'no';then
syshdf='no'
fi
#now check for user specified.
AC_ARG_WITH(overture-hdf-prefix,[ --with-overture-hdf-prefix=PFX Prefix where HDF is installed (necessary for Overture)],[testhdfprefix="yes" hdfprefix=$withval],[testhdfprefix="no"])
AC_ARG_WITH(overture-mesa-prefix,[ --with-overture-mesa-prefix=PFX Prefix where mesa is installed (necessary for Overture)],[testmesaprefix="yes" mesaprefix=$withval],[testmesaprefix="no"])
AC_ARG_WITH(overture-app-prefix,[ --with-overture-app-prefix=PFX Prefix where A++ is installed(necessary for overture)],[testappprefix="yes" appprefix=$withval],[testappprefix="no"])
# stop configure if neither is found.
if test $app = 'no' && test $testappprefix = 'no'; then
AC_MSG_ERROR([libApp.so can not be found on this system, and its location is not specified. It you are using overture, it is also necessary to use this library. Please specify where it is using the --with-overture-app-prefix, or do not select the overture option.])
fi
if test $sysmesa = 'no' && test $testmesaprefix = 'no';then
AC_MSG_ERROR([parts of, or all of the mesa libraries are missing, and their location is not specified. If you are using overture it is necessary to use this library. Please specify where it is using the --with-overture-mesa-prefix, or do not select the overture option.])
fi
if test $syshdf = 'no' && test $testhdfprefix = 'no';then
AC_MSG_ERROR([parts of, or all of the hdf libraries are missing, and their location is not specified. If you are using overture it is necessary to use this library. Please specify where it is using the --with-overture-hdf-prefix, or do not select the overture option.])
fi
fi
############################################################################################
#done with overture
########################### TSTT check #####################
AC_ARG_ENABLE(itaps,
AS_HELP_STRING([--enable-itaps],[compiles in extra data into intfc structure needed for all itaps components (iMesh)]),
[if (test "$enableval" = "yes") ; then
itapsd=' -DIMESH '
else
itapsd=' '
fi
])
AC_ARG_ENABLE(imesh,
AS_HELP_STRING([--enable-imesh],[compiles in extra data into intfc structure needed for iMesh]),
[if (test "$enableval" = "yes") ; then
itapsd='-DIMESH'
fi
])
####################################################3
# check generic for mpich
#/////////////////////////////
AC_ARG_WITH(mpich,[ --with-mpich=PFX Support for the mpich library, add the =PFX where PFX is the path to mpich, if it not in a system location,FronTier may suport other mpi implementations, that can put here also.],[mpichprefix=$withval mpichh="yes"],[mpichh="no"])
if test $mpichh = 'yes';then
mpichincs=" -I"${mpichprefix}"/include -D__MPI__ "
scriptotherlibsinc=${scriptotherlibsinc}" -L"${mpichprefix}"/lib "
scriptotherlibs=${scriptotherlibs}" -lmpich -lpthread"
fi
AC_ARG_WITH(petsc, [ --with-petsc=path compile with petsc support], [petscdir=$withval iFluid="cd iFluid && \$(MAKE)"], [petscdir="" iFluid=""])
if test "$petscdir" = ""; then
echo "PETSC not enabled, cannot build iFluid"
else
if test $mpichh = 'no' -a $ompi = 'no' -a $mpi = 'no' ;then
echo "Cannot enable PETSC without mpi"
petscdir=""
iFluid=""
else
echo "PETSC enabled"
AC_SUBST(PETSC_DIR,${PETSC_DIR})
AC_SUBST(PETSC_ARCH,${PETSC_ARCH})
AC_SUBST(PETSC_LIB,${PETSC_LIB})
AC_SUBST(PETSC_INCLUDE,${PETSC_INCLUDE})
fi
fi
AC_SUBST(iFluid, ${iFluid})
#/////////////////////////////
#ibasename='no'
#idirname='no'
# check for irix
if test $build_os = "irix" || test $build_cpu = "irix" || test $build_vendor = "irix" || test $build_os = "IRIX" || test $build_cpu = "IRIX"|| test $build_vendor = "IRIX";then
echo made it in
AC_CHECK_LIB(gen,basename,[ibasename='yes'],[ibasename='no'])
AC_CHECK_LIB(gen,dirname,[idirname='yes'],[idirname='no'])
firix=" -DFTIRIX -common "
scriptotherlibs=${scriptotherlibs}" -lgen -lmalloc "
fi
# done with irix
echo $build_os
#check for linux
if test $build_os = "linux" || test $build_os = "linux-gnu";then
echo using linux GCC optimizations when no debug option
if test $debug = " "; then
optimization=" -O3 "
else
optimization=" "
fi
fi
#done with linux
if test $build_os = "darwin7.8.0" || test $build_os = "darwin";then
echo using GCC optimizations
optimization=" -O3 "
scriptotherlibs=${scriptotherlibs}" "
fi
# check for sun
if test $build_os = "sun" || test $build_cpu = "sun" || test $build_vendor = "sun" || test $build_os = "SUN" || test $build_cpu = "SUN"|| test $build_vendor = "SUN";then
scriptotherlibs=${scriptotherlibs}" -lmalloc "
fsun=" -ext_names -w "
fi
# done with sun
AC_CHECK_FUNC(basename,[basename='yes'],[basename='no'])
AC_CHECK_FUNC(dirname,[dirname='yes'],[dirname='no'])
if test $basename = 'no' && test $ibasename = 'no';then
echo using alternate basename and dirname.
AC_SUBST(name,name)
noname=" -DNO_DIRNAME "
echo ${scriptotherlibsinc}
scriptotherlibsinc=${scriptotherlibsinc}" -L""../util/name "
echo ${scriptotherlibsinc}
else
AC_SUBST(name,[])
noname=""
echo not using name.h
fi
#########################################
##############################################################
# Setting C++ as the compiler
###############################################################
echo "Using C++"
#AC_SUBST(ccft,$CXX)
AC_SUBST(CC,$CC)
AC_SUBST(CXX,$CXX)
AC_SUBST(F77,$F77)
AC_SUBST(F77_LIBS,$F77_LIBS)
AC_SUBST(libext,"")
cppflagss=" "
################################################################
# Done checking for C++
##########################################################
###################################################################
# FT build instructions
#############################################################3#
##############################################################
# Done FT build instructions
##############################################################
######################################################
##### CHANGING VARIBLES BASED ON ABOVE TESTS AND INPUT
#########################################################
# Generic MPI
mpiincs=''
mpi=''
if test $testmpi = 'yes';then
mpi=" -D__MPI__ "
if test $seaborgg = 'yes';then
echo ""
echo "hohoho seaborg and mpi what a blast!"
echo ""
mpiincs="-mpe"
aixmpichangback=${scriptotherlibs}
fi
scriptotherlibs=${scriptotherlibs}" -lmpi "
if test $seaborgg = 'yes';then
scriptotherlibs=${aixmpichangback}
fi
fi
#overture
###############################
if test $testovertureprefix = 'yes'; then
# flag to compile overture part of frontier
over=" -DUSE_OVERTURE "
#includes nesscary to compile overter code in frontier
overinc=" -I"${overtureprefix}"/include/ "
# overture requires g++
AC_SUBST(CC,$CXX)
# paralell overture requires mpif77
if test $testmpich = 'yes' || test $testmpi = 'yes' || test $mpichprefix = 'yes';then
AC_SUBST(F77,"mpif77")
fi
# all the extra libs needed!
overlib=" -lOverture -lOverture_static -lXm -lXpm -lXp -lXt -lXmu -lXi -lXext -lX11 -lmfhdf -ldf -ljpeg -lz -lMesaGL -lMesaGLU -lGLw -lApp -lApp_static "
scriptotherlibs=${scriptotherlibs}${overlib}
scriptotherlibsinc=${scriptotherlibsinc}" -L"${overtureprefix}"/lib/ -L"${x_libraries}" -L"${hdfprefix}"/lib -L"${mesaprefix}"/lib -L"$appprefix"/lib "
fi
## if A++ and Overture installed in the system.
if test $testappprefix = 'yes'; then
appinc="-I"${appprefix}"/include "
fi
if test [[$testover = 'yes']];then
over="-DUSE_OVERTURE "
fi
###################################
#end overture
ftlibdubug=" "
optimization=$optimization
######################################################################
## The complete varibles as the are sent to thier parts of the code.
#####################################################################
# included in all code in: driver
# front
# hyp
# intfc
# tri
scriptftlibincs=" -I.. -I../util"${debug}${cppflagss}${amrincs}${hdfincs}${hdf5incs}${mpichincs}${overinc}${appinc}${ftlibdubug}${itapsd}${fenv}${optimization}${over}${firix}${noname}${hdfinc}${systemincs}${ompincs}${gdincs}${gpuincs}${gslincs}${hypreincs}${subgrid}
#included in all code in: example and testfront
scriptexampleincs=${mpichincs}${amrincs}${hdfincs}${hdf5incs}${hdfinc}${systemincs}${ompincs}${gpuincs}${gslincs}${hypreincs}${subgrid}
#included in all code in: util/util
scriptutilincs=" -I../.. -I../ "${debug}${cppflagss}${mpichincs}${amrincs}${hdfincs}${hdf5incs}${fenv}${optimization}${firix}${noname}${hdfinc}${systemincs}${ompincs}${gpuincs}${gslincs}${hypreincs}${subgrid}
#include in all conde in: util/dutil
scriptdutilincs=" -I../.. -I../ "${debug}${cppflagss}${mpichincs}${amrincs}${hdfincs}${hdf5incs}${fenv}${optimization}${firix}${noname}${hdfinc}${systemincs}${ompincs}${gpuincs}${gslincs}${hypreincs}${subgrid}
flagsss=$FFLAGS${optimization}${firix}${fsun}${debug}${cppflagss}
headers=`find ./src/util/ ./src/intfc ./src/front -name \*\.*h | perl -e "s/\.\/src\/(.*)\n/include\/FronTier\/\1 /g" -p`
include_dirs="include/FronTier/intfc include/FronTier/front include/FronTier/util"
AC_SUBST(headers, $headers)
AC_SUBST(include_dirs, $include_dirs)
# Substitute these changes in the makefile.ins
AC_SUBST(sn_ellip,$snyesorno)
AC_SUBST(debugg,$debug)
AC_SUBST(tsttyesornoo,$tsttyesorno)
AC_SUBST(FFLAGS,$flagsss)
#AC_SUBST(f77ft,$F77)
#AC_SUBST(f77ft,"gfortran")
AC_SUBST(ftlibincs,$scriptftlibincs)
AC_SUBST(utilincs,$scriptutilincs)
AC_SUBST(exampleincs,$scriptexampleincs)
AC_SUBST(dutilincs,$scriptdutilincs)
AC_SUBST(CFLAGS,"")
AC_SUBST(otherlibs,$scriptotherlibs)
AC_SUBST(otherlibsinc,$scriptotherlibsinc)
AC_SUBST(randy,$RANLIB)
AC_SUBST_FILE(ftbuild)
ftbuild=./src/util/ftrules
#AC_SUBST(AWK,"awk")
# Write the makefiles
if test $basecode = "full"; then
filelist='Makefile
src/Makefile
src/util/Makefile
src/front/Makefile
src/intfc/Makefile
airfoil/Makefile
parachute/Makefile
parachute2d/Makefile
sprModel/Makefile
subsurf/Makefile
crystal/Makefile
example2d/Makefile
example3d/Makefile
iTaps/Makefile
finance/Makefile
melting/Makefile
curvature/Makefile
cell/Makefile
pde/Makefile
MonteCarlo/Makefile
timeSeries/Makefile
iFluid/Makefile
vFluid/Makefile
rgbody/Makefile
climate/Makefile
poisson/Makefile
cFluid/Makefile
wings/Makefile
cim/Makefile
DG/Makefile
inverse/Makefile
solver/Makefile
weno/Makefile
proj/Makefile
swap/Makefile
devel-deps.inc
iMesh-Defs.inc'
fi
if test $basecode = "adv"; then
filelist='Makefile
src/Makefile
src/util/Makefile
src/front/Makefile
src/intfc/Makefile
example2d/Makefile
example3d/Makefile
cFluid/Makefile
iFluid/Makefile
solver/Makefile
crystal/Makefile
devel-deps.inc
iMesh-Defs.inc'
fi
if test $basecode = "base"; then
filelist='Makefile
src/Makefile
src/util/Makefile
src/front/Makefile
src/intfc/Makefile
example2d/Makefile
example3d/Makefile
cFluid/Makefile
devel-deps.inc
iMesh-Defs.inc'
fi
AC_CONFIG_FILES($filelist)
AC_OUTPUT
mkdir -p lib/
mkdir -p lib/${build_cpu}
mkdir -p src/front/${build_cpu}
mkdir -p src/intfc/${build_cpu}
mkdir -p src/util/${build_cpu}
mkdir -p src/util/d${build_cpu}
echo " Compiling with :"
echo $ccft
echo $F77
echo "The util flags are:" $scriptutilincs
echo
echo "The dutil flags are:" $scriptdutilincs
echo
echo "The front flags are:" $scriptftlibincs
echo
echo "The example/testfront flags are:"$scriptexampleincs
echo ""