File: cmake_init

package info (click to toggle)
adios 1.13.1-16
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 23,248 kB
  • sloc: ansic: 133,236; f90: 8,791; sh: 7,806; python: 7,480; xml: 3,793; makefile: 3,002; cpp: 2,340; java: 626; sed: 16; perl: 8
file content (710 lines) | stat: -rwxr-xr-x 24,289 bytes parent folder | download
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
#!/bin/bash
#
# This script is for configuring adios on the authors' machines
# You can study it to figure out how to configure adios on your system
#

SRCDIR=`dirname ${BASH_SOURCE[0]}`


if [ `hostname | cut -c 1-4` == "rhea" ]; then
    source /etc/profile.d/modules.sh
    source /etc/profile.d/modules.sh
    TARGET=`module list 2>&1 | grep "PE"- | sed "s/^.*PE-\([a-z]*\).*/\1/"`

    if [ -z "$TARGET" ]; then
        echo "Cannot determine Programming environment. Exit"
        exit 1
    fi
    echo "Configure on Rhea for $TARGET env. for user ${USER}"
    module unload hdf5
    module unload netcdf
    # Use both seq hdf5 (for utils) and 
    #   parallel hdf5 (for PHDF5 method)
    module load hdf5/1.8.11
    export SEQ_HDF5_DIR=$HDF5_DIR
    export SEQ_HDF5_CLIB=$HDF5_CLIB
    module unload hdf5
    module load hdf5-parallel/1.8.11
    export PAR_HDF5_DIR=$HDF5_DIR
    export PAR_HDF5_CLIB=$HDF5_CLIB
    module unload hdf5
    # Seq NetCDF 4 for bp2ncd
#    module load netcdf/4.1.3
#    export SEQ_NC_DIR=$NETCDF_DIR
#    module unload netcdf
#    module load netcdf/4.1.1_ompi1.3.1
#    export PAR_NC_DIR=$NETCDF_DIR
#    module unload netcdf

    export BUILD_WRITE=ON
    export BUILD_FORTRAN=ON
    export adios_timers=ON
    export INSTALL_PREFIX="/ccs/home/jya/ADIOS/lens.$TARGET"
    export CC=mpicc
    export CXX=mpiCC
    export FC=mpif90
    if [ "$TARGET" == "pgi" ]; then
#        export CC=pgcc
#        export CXX=pgCC
#        export FC=pgf90
        export EXTRA_CFLAGS=""
    elif [ "$TARGET" == "gnu" ]; then
#        export CC=gcc
#        export CXX=g++
#        export FC=gfortran
        export EXTRA_CFLAGS=""
    elif [ "$TARGET" == "intel" ]; then
#        export CC=icc
#        export CXX=icpc
#        export FC=ifort
        export EXTRA_CFLAGS="-std=c99"
    else
        echo "TARGET must be pgi or gnu"
        exit 1
    fi

    export CFLAGS="-g -fPIC ${EXTRA_CFLAGS}"
    cmake $SRCDIR


elif [ `hostname | cut -c 1-5` == "titan" ]; then

    BUILD_STAGING=true
    if [ $BUILD_STAGING == "false" ]; then
    
        ################
        # Titan #
        ################
        TARGET=pgi
        echo "Configure on TITAN (XK7) for $TARGET env."
        #export CFLAGS="-Wall -g" 
        source /opt/modules/default/etc/modules.sh
        module unload szip
        module unload hdf5
        module unload netcdf
        module unload netcdf-hdf5parallel
        module unload hdf5-parallel
        module unload PrgEnv-gnu
        module unload PrgEnv-pgi
        module unload PrgEnv-intel
        module unload PrgEnv-cray
        module load PrgEnv-$TARGET
        module load craype-target-compute_node
        module load craype-interlagos
        module load cmake
        export CRAYPE_LINK_TYPE=static
        module load cray-mpich
        module load szip
        export CRAY_UGNI_DIR="/opt/cray/ugni/4.0-1.0401.5928.9.5.gem"
        export CRAY_PMI_DIR="/opt/cray/pmi/4.0.1-1.0000.9421.73.3.gem"
        export LUSTRE_DIR="/usr/lib64"
    	export BUILD_WRITE=ON
    	export BUILD_FORTRAN=ON
        export CFLAGS="-g -fPIC -O0" 
    	export adios_timers=ON
    	export INSTALL_PREFIX="/ccs/home/jya/ADIOS/titan.$TARGET"
            
    else 
    
        ##########################
        # Titan + staging #
        ##########################
        TARGET=pgi
        echo "Configure on TITAN (XK7) including staging methods for $TARGET env."
        source /opt/modules/default/etc/modules.sh
        module unload szip
        module unload hdf5
        module unload netcdf
        module unload hdf5-parallel
        module unload netcdf-hdf5parallel
        module unload PrgEnv-gnu
        module unload PrgEnv-pgi
        module unload PrgEnv-intel
        module unload PrgEnv-cray
        module load PrgEnv-$TARGET
        module load craype-target-compute_node
        module load craype-interlagos
        module load cmake
        export CRAYPE_LINK_TYPE=static
        module load cray-mpich
        module load cray-netcdf-hdf5parallel
        module load szip

        unset EXTRA_LIBS
        unset LDFLAGS
        export PAR_HDF5_DIR=$HDF5_DIR
        export PAR_HDF5_LIBS=${HDF5_DIR}/lib/libhdf5_parallel.a
        export PAR_NC_DIR=${NETCDF_DIR}
        export PAR_NC_LIBS=${NETCDF_DIR}/lib/libnetcdf_parallel.a
        export LUSTRE_DIR=/usr/lib64
        export BZIP2_DIR=${SYSROOT_DIR}/usr
        if [ "$TARGET" == "pgi" ]; then
            module load dataspaces/1.6.0
            export DATASPACES_LIBDIR=${DATASPACES_DIR}/lib
            export LDFLAGS="-pgcpplibs -Wl,-Bstatic" 
#            export FLEXPATH_DIR="/ccs/proj/e2e/chaos/titan/$TAGET"
            export EXTRA_LIBS="/opt/gcc/4.9.0/snos/lib64/libstdc++.a"
        elif [ "$TARGET" == "gnu" ]; then
            # currently dependencies are not available for > 4.7.2
            module load gcc/4.7.2
            module load dataspaces/1.6.0
            export DATASPACES_DIR=$DATASPACES_DIR
            export FLEXPATH_DIR="/ccs/proj/e2e/chaos/titan/gnu"
#            module load fastbit/svn
#            export FASTBIT_DIR=$FASTBIT_DIR
            # NSSI needs libstdc++
            export EXTRA_LIBS="${GCC_PATH}/snos/lib64/libstdc++.a"
        else
            unset DATASPACES_DIR
        fi
     
        # NOTE hdf5-parallel module does not work with C++ compiler
        # use the two lines below for openmpi
        export CRAY_UGNI_DIR="/opt/cray/ugni/default"
        export CRAY_PMI_DIR="/opt/cray/pmi/default"
        export BUILD_WRITE=ON
        export BUILD_FORTRAN=ON
        export CFLAGS="-g -fPIC -O0"
        export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK -DDART_DO_VERSIONING"
        export adios_timers=ON
        export INSTALL_PREFIX="/ccs/proj/e2e/pnorbert/ADIOS/titan.cmake.$TARGET" 
    fi
    cmake $SRCDIR
    

elif [ `hostname | cut -c 1-4` == "eos-" ]; then

      #################
      # EOS Cray XC30 #
      #################
      TARGET=`module list 2>&1 | grep "PrgEnv"- | sed "s/^.*PrgEnv-\([a-z]*\).*/\1/"`
      echo "Configure on EOS (Cray XC30) for $TARGET env."
      #export CFLAGS="-Wall -g" 
      source /opt/modules/default/etc/modules.sh
      module unload szip
      module unload hdf5
      module unload netcdf
      module unload netcdf-hdf5parallel
      module unload hdf5-parallel
      module unload PrgEnv-gnu
      module unload PrgEnv-pgi
      module unload PrgEnv-intel
      module unload PrgEnv-cray
      module load PrgEnv-$TARGET
      module load craype-target-compute_node
      module load cmake
      export CRAYPE_LINK_TYPE=static
      module load cray-mpich
      export BUILD_WRITE=ON
      export BUILD_FORTRAN=ON
      if [ "$TARGET" == "pgi" ]; then
          # NSSI needs -pgcpplibs flag 
          export LDFLAGS="-pgcpplibs"
          unset EXTRA_LIBS 
      elif [ "$TARGET" == "gnu" ]; then
          # NSSI needs libstdc++
          unset LDFLAGS 
          export EXTRA_LIBS="/opt/gcc/4.8.1/snos/lib64/libstdc++.a"
          module swap gcc gcc/4.8.1
      elif [ "$TARGET" == "intel" ]; then
          export LDFLAGS=
      else
          unset LDFLAGS 
          unset EXTRA_LIBS 
      fi
      module load pmi
      export CFLAGS="-g -fPIC"
      export INSTALL_PREFIX="/ccs/home/jya/ADIOS/eos.$TARGET"
      cmake $SRCDIR


elif [ `hostname | cut -c 1-7` == "chester" ]; then

      ###############
      # Chester XK6 #
      ###############
      TARGET=`module list 2>&1 | grep "PrgEnv"- | sed "s/^.*PrgEnv-\([a-z]*\).*/\1/"`
      echo "Configure on Chester (XK6) for $TARGET env."
      #export CFLAGS="-Wall -g" 
      source /opt/modules/default/etc/modules.sh
      module unload szip
      module unload hdf5
      module unload netcdf
      module unload netcdf-hdf5parallel
      module unload hdf5-parallel
      module unload PrgEnv-gnu
      module unload PrgEnv-pgi
      module unload PrgEnv-intel
      module unload PrgEnv-cray
      module unload papi
      module unload pmi
      module unload ugni
      module load PrgEnv-$TARGET
      module load craype-target-compute_node
      module load cmake
      export CRAYPE_LINK_TYPE=static
      module load cray-mpich
      module load cray-netcdf-hdf5parallel
      module load szip
      module load pmi
      module load ugni
      export PAR_HDF5_DIR=$HDF5_DIR
      export PAR_HDF5_LIBS=${HDF5_DIR}/lib/libhdf5_parallel.a
      #export PAR_NC_DIR=${NETCDF_DIR}
      #export PAR_NC_LIBS=${NETCDF_DIR}/lib/libnetcdf_parallel.a
      export LUSTRE_DIR=/usr/lib64
      export BZIP2_DIR=${SYSROOT_DIR}/usr
      export CRAY_PMI_DIR=$(echo "${CRAY_PMI_POST_LINK_OPTS}" | sed 's|.*-L\([^ ]*\)/lib64.*|\1|')
      export CRAY_UGNI_DIR=$(echo "${CRAY_UGNI_POST_LINK_OPTS}" | sed 's|.*-L\([^ ]*\)/lib64.*|\1|')
      export BUILD_WRITE=ON
      export BUILD_FORTRAN=ON
      if [ "$TARGET" == "pgi" ]; then
          # NSSI needs -pgcpplibs flag 
          export LDFLAGS="-pgcpplibs" 
          module load dataspaces/1.4.0
          export DATASPACES_LIBDIR=${DATASPACES_DIR}/lib
          unset EXTRA_LIBS 
      elif [ "$TARGET" == "gnu" ]; then
          # NSSI needs libstdc++
          unset LDFLAGS 
          export EXTRA_LIBS="/opt/gcc/4.7.1/snos/lib64/libstdc++.a"
          module load dataspaces/1.4.0
          export DATASPACES_LIBDIR=${DATASPACES_DIR}/lib
          #module swap gcc gcc/4.4.4
      else
          unset LDFLAGS 
          unset EXTRA_LIBS 
#          WITHDART=""
      fi
      export CFLAGS="-g -fPIC" 
      cmake $SRCDIR

elif [ `hostname -f | cut -c 1-9` == "summitdev" ]; then
    #####################
    #  SUMMITDEV IBM    #
    #####################
    MLIST=`module list 2>&1 ` #| grep "PrgEnv"- | sed "s/^.*PrgEnv-\([a-z]*\).*/\1/"`
    TARGET=`echo $MLIST | grep " xl\/" | sed "s/^.* xl\/.*/xl/"`
    if [ -z $TARGET ]; then
        TARGET=`echo $MLIST | grep " pgi\/" | sed "s/^.* pgi\/.*/pgi/"`
        if [ -z $TARGET ]; then
            TARGET=`echo $MLIST | grep " gcc\/" | sed "s/^.* gcc\/.*/gcc/"`
            if [ -z $TARGET ]; then
                TARGET=`echo $MLIST | grep " clang\/" | sed "s/^.* clang\/.*/clang/"`
            fi
        fi
    fi
    echo "Configure on Summitdev for $TARGET env."

    export CC=mpicc
    export CXX=mpic++
    export FC=mpif90
    export CFLAGS="-g -O0"

    if [ "$TARGET" == "xl" ]; then
        #export LIBS="-lrdmacm -libverbs"
        export DATASPACES_DIR=/ccs/proj/e2e/dataspaces/summitdev/1.6.1/xl
    elif [ "$TARGET" == "pgi" ]; then
        export DATASPACES_DIR=/ccs/proj/e2e/dataspaces/summitdev/1.6.1/pgi
    elif [ "$TARGET" == "gcc" ]; then
        export DATASPACES_DIR=/ccs/proj/e2e/dataspaces/summitdev/1.6.1/gcc
    elif [ "$TARGET" == "clang" ]; then
        export BUILD_FORTRAN=OFF
        unset DATASPACES_DIR
    fi

    export INSTALL_PREFIX=/ccs/proj/e2e/pnorbert/ADIOS/summitdev.$TARGET  
    cmake $SRCDIR

elif [ `hostname | cut -c 1-4` == "sith" ]; then

    ########
    # Sith #
    ########
    source /etc/profile.d/modules.sh
    TARGET=`module list 2>&1 | grep "PE"- | sed "s/^.*PE-\([a-z]*\).*/\1/"`

    if [ -z "$TARGET" ]; then
        echo "Cannot determine Programming environment. Exit"
        exit 1
    fi
    echo "Configure on SITH for $TARGET env."
    source /etc/profile.d/modules.sh
    module unload hdf5
    module unload netcdf
    module unload PE-gnu
    module unload PE-pgi
    module unload PE-intel
    module unload PE-pathscale
    module unload pgi gcc intel pathscale
    module unload python
    module load PE-$TARGET
    module load python
    module load szip
    module load bzip2
    export LUSTRE_DIR="/usr/lib64"
#    export FGR_DIR="/ccs/proj/e2e/qliu/tap"
    export GLIB_DIR="/ccs/proj/e2e/qliu/glib"
    export BUILD_WRITE=ON
    export BUILD_FORTRAN=ON
    export adios_timers=ON
    export research_transports=ON
    export CC=mpicc
    export CXX=mpiCC
    export FC=mpif90
    export INSTALL_PREFIX="/ccs/home/jya/ADIOS/sith.$TARGET"
    export APLOD_DIR="/ccs/proj/e2e/ncsu/sith.gnu"
    export ISOBAR_DIR="/ccs/proj/e2e/ncsu/sith.gnu"
    export ALACRITY_DIR="/ccs/proj/e2e/pnorbert/ALACRITY-ADIOS/synced/build.sith/build.gnu" 
    export NCSU_TIMER_DIR
    if [ "$TARGET" == "pgi" ]; then
        module load hdf5/1.8.10
        export SEQ_HDF5_DIR=$HDF5_DIR
        export SEQ_HDF5_LIBS="-L/sw/sith/hdf5/1.8.10/rhel6_pgi12.8/lib -L/sw/sith/szip/2.1/rhel6_pgi12.8/lib -lhdf5_hl -lhdf5 -lsz -lz -lm"
        module unload hdf5/1.8.10
        module load hdf5/1.8.10_par
        export PAR_HDF5_DIR=$HDF5_DIR
        export PAR_HDF5_LIBS="-L/sw/sith/hdf5/1.8.10/rhel6_pgi13.4_ompi1.6.3/lib -L/sw/sith/szip/2.1/rhel6_pgi13.4/lib -lhdf5_hl -lhdf5 -lsz -lz -lm"
        module unload hdf5/1.8.10_par
        module load netcdf/4.1.3
        export SEQ_NC_DIR=$NETCDF_DIR
        export SEQ_NC_LIBS="-L/sw/sith/netcdf/4.1.3/rhel6_pgi12.8/lib -L/sw/sith/hdf5/1.8.10/rhel6_pgi12.8/lib -L/sw/sith/szip/2.1/rhel6_pgi12.8/lib -lnetcdf -lcurl -lhdf5_hl -lhdf5 -lsz -lz -lm"
        module unload netcdf/4.1.3
        module load netcdf/4.1.3_par
        export PAR_NC_DIR=$NETCDF_DIR
        export PAR_NC_LIBS="-L/sw/sith/netcdf/4.1.3/rhel6_pgi13.4_ompi1.6.3/lib -L/sw/sith/hdf5/1.8.10/rhel6_pgi13.4_ompi1.6.3/lib -L/sw/sith/szip/2.1/rhel6_pgi13.4/lib -lnetcdf -lcurl -lhdf5_hl -lhdf5 -lsz -lz -lm"
        module unload netcdf/4.1.3_par

        export DATASPACES_DIR="/ccs/proj/e2e/dataspaces/sith/$TARGET"
        export FLEXPATH_DIR="/ccs/proj/e2e/chaos/sith/$TARGET"
        export FASTBIT_DIR="/sw/redhat6/fastbit/svn/rhel6_gnu4.8.2"
    elif [ "$TARGET" == "gnu" ]; then
        module load hdf5/1.8.10
        export SEQ_HDF5_DIR=$HDF5_DIR
        export SEQ_HDF5_LIBS="-L/sw/sith/hdf5/1.8.10/rhel6_gnu4.7.1/lib -lhdf5_hl -lhdf5 -L/sw/sith/szip/2.1/rhel6_gnu4.7.1/lib -lsz -lz -lm"
        module unload hdf5/1.8.10
        module load hdf5/1.8.10_par
        export PAR_HDF5_DIR=$HDF5_DIR
        export PAR_HDF5_LIBS="-L/sw/sith/hdf5/1.8.10/rhel6_gnu4.7.1_ompi1.6.3/lib -lhdf5_hl -lhdf5 -L/sw/sith/szip/2.1/rhel6_gnu4.7.1/lib -lsz -lz -lm"
        module unload hdf5/1.8.10_par
        module load netcdf/4.1.3
        export SEQ_NC_DIR=$NETCDF_DIR
        export SEQ_NC_LIBS="-L/sw/sith/netcdf/4.1.3/rhel6_gnu4.7.1/lib -L/sw/sith/hdf5/1.8.10/rhel6_gnu4.7.1/lib -L/sw/sith/szip/2.1/rhel6_gnu4.7.1/lib -lnetcdf -lm -lcurl -lhdf5_hl -lhdf5 -lsz -lz -lm"
        module unload netcdf/4.1.3
#        module load netcdf/4.1.3_par
#        export PAR_NC_DIR=$NETCDF_DIR
#        export PAR_NC_LIBS=""
#        module unload netcdf/4.1.3_par
#        export DATASPACES_DIR="/ccs/proj/e2e/dataspaces/sith/$TARGET"
        export FLEXPATH_DIR="/ccs/proj/e2e/chaos/sith/$TARGET"
        export FASTBIT_DIR="/sw/redhat6/fastbit/svn/rhel6_gnu4.8.2"
    elif [ "$TARGET" == "intel" ]; then
        module load hdf5/1.8.10
        export SEQ_HDF5_DIR=$HDF5_DIR
        export SEQ_HDF5_LIBS="-L/sw/sith/hdf5/1.8.10/rhel6_intel11.1/lib -lhdf5_hl -lhdf5 -L/sw/sith/szip/2.1/rhel6_intel11.1.072/lib -lsz -lz -lm"
        module unload hdf5/1.8.10
        module load hdf5/1.8.10_par
        export PAR_HDF5_DIR=$HDF5_DIR
        export PAR_HDF5_LIBS="-L/sw/sith/hdf5/1.8.10/rhel6_intel11.1_ompi1.6.3/lib -lhdf5_hl -lhdf5 -L/sw/sith/szip/2.1/rhel6_intel11.1.072/lib -lsz -lz -lm"
        module unload hdf5/1.8.10_par
        module load netcdf/4.1.3
        export SEQ_NC_DIR=$NETCDF_DIR
        export SEQ_NC_LIBS="-L/sw/sith/netcdf/4.1.3/rhel6_intel11.1/lib -L/sw/sith/hdf5/1.8.10/rhel6_intel11.1/lib -L/sw/sith/szip/2.1/rhel6_intel11.1.072/lib -lnetcdf -lm -lcurl -lhdf5_hl -lhdf5 -lsz -lz -lm"
        module unload netcdf/4.1.3
#        module load netcdf/4.1.3_par
#        export PAR_NC_DIR=$NETCDF_DIR
#        export PAR_NC_LIBS=""
#        module unload netcdf/4.1.3_par
#        export DATASPACES_DIR="/ccs/proj/e2e/dataspaces/sith/$TARGET"
        export FLEXPATH_DIR=
    else
        echo "TARGET must be pgi or gnu or intel"
        exit 1
    fi
        
    export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK" 
    export CFLAGS="-g -fPIC" 
    cmake $SRCDIR


elif [ "x"`hostname -f | cut -c 8-15` == "xintrepid" ]; then
    #####################
    # Intrepid BlueGene #
    #####################
    echo "Configure on Intrepid (BlueGene)"
    export CC=mpixlc_r
    export FC=mpixlf90
    export CFLAGS=""
#    export FC=xlf90
#    export CC=xlc_r
    cmake $SRCDIR

    
elif [ `hostname | cut -c 1-4` == "nid0" ]; then
    ############
    # Franklin #
    ############
    TARGET=pgi
    echo "Configure on FRANKLIN for $TARGET env."
    export CC=cc
    export CXX=CC
    export FC=ftn
    module unload hdf5
    module unload netcdf
    module unload hdf5-parallel
    module unload netcdf-hdf5parallel
    module unload PrgEnv-gnu
    module unload PrgEnv-pgi
    module unload PrgEnv-pathscale
    module unload PrgEnv-cray
    module load PrgEnv-$TARGET
    #if [ "${TARGET}" == "pgi" ]; then
    #    module swap pgi pgi/10.5.0
    #fi
    export LDFLAGS="-pgcpplibs"
    export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK"
    export CFLAGS="-fPIC"
    cmake $SRCDIR
    

elif [ `hostname | cut -c 1-6` == "hopper" ]; then
    ##########
    # Hopper #
    ##########
    TARGET=pgi
    echo "Configure on HOPPER for $TARGET env."
    export CC=cc
    export CXX=CC
    export FC=ftn
    module unload hdf5
    module unload netcdf
    module unload hdf5-parallel
    module unload netcdf-hdf5parallel
    module unload PrgEnv-gnu
    module unload PrgEnv-pgi
    module unload PrgEnv-pathscale
    module unload PrgEnv-cray
    TARGET=pgi
    module load PrgEnv-$TARGET
    module load python
    if [ "$TARGET" == "pgi" ]; then
        export LDFLAGS="-pgcpplibs"
    elif [ "$TARGET" == "gnu" ]; then
        export LDFLAGS=""
    elif [ "$TARGET" == "intel" ]; then
        export LDFLAGS=""
    else
        echo "TARGET must be pgi or gnu or intel"
        exit 1
    fi
    export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK"
    export CFLAGS="-fPIC"
    cmake $SRCDIR


elif [ `hostname | cut -c 1-6` == "kraken" ]; then
    ##########
    # Kraken #
    ##########
    source /opt/modules/default/etc/modules.sh
    TARGET=`module list 2>&1 | grep PrgEnv | sed "s/^.*Env-\([a-z]*\).*/\1/"`

    if [ -z "$TARGET" ]; then
        echo "Cannot determine Programming environment. Exit"
        exit 1
    fi
    echo ""
    echo "Configure KRAKEN for the $TARGET compiler"
    echo ""
    export CC=cc
    export FC=ftn
    export CXX=CC
    module unload szip
    module unload hdf5
    module unload netcdf
    module unload hdf5-parallel
    module unload netcdf-hdf5parallel
    module unload xt-papi
    module unload papi
    if [ "$TARGET" == "pgi" ]; then
        #module swap pgi pgi/10.4.0
        # NSSI needs -pgcpplibs flag 
        export EXTRA_LIBS=""
        export LDFLAGS="-pgcpplibs" 
    elif [ "$TARGET" == "gnu" ]; then
        # NSSI needs libstdc++
        export EXTRA_LIBS="/opt/gcc/4.4.4/snos/lib64/libstdc++.a"
        export LDFLAGS="" 
        #module swap gcc gcc/4.4.4
    fi

    module load szip
    module load subversion
    export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK" 
    export CFLAGS="-fPIC -g -O0" 
    cmake $SRCDIR


elif [ `hostname | cut -c 1-4` == "dyn9" -o `hostname | cut -c 1-3` == "pnb" ]; then

    #######
    # Mac #
    #######
    echo "Configure on Mac"
    # Installed Homebrew, gcc/gfortran 5.3.0 and OpenMPI 1.10.2 in /usr/local
    # But should work with default mpicc and gcc, using --disable-fortran or with Homebrew gfortran
    #
    USE_GCC5=false
    if [ $USE_GCC5 == "true" ]; then
        # If want to use gcc/gfortran 5.3.0
        export OMPI_CC=/usr/local/bin/gcc-5
        export OMPI_CXX=/usr/local/bin/g++-5
        export OMPI_FC=/usr/local/bin/gfortran
        export ALACRITY_DIR="/opt/alacrity/gcc5"
        unset FASTBIT_DIR
        echo "Configure using gcc-5"
    else
        # If want to use clang C/C++ and gfortran 5.3.0
        unset OMPI_CC
        unset OMPI_CXX
        unset OMPI_FC
        export FASTBIT_DIR="/opt/fastbit"
        export ALACRITY_DIR="/opt/alacrity/clang"
        echo "Configure using clang"
    fi
    # The rest is common for all
    # The rest is common for all
    export CC=mpicc #/usr/local/bin/mpicc
    export FC=mpif90 #/usr/local/bin/mpif90
    export CXX=mpicxx #/usr/local/bin/mpicxx
    export CFLAGS="-g -Wall -DO_LARGEFILE=0 -fno-common" 
    export BUILD_WRITE=ON
    export BUILD_FORTRAN=ON
    export adios_timers=ON
    export INSTALL_PREFIX="/opt/adios"
#export PAR_HDF5_DIR=/usr/local
#export PAR_HDF5_LIBS="-L/usr/local/lib -lhdf5_hl -lhdf5 -lm"
    unset SEQ_HDF5_DIR
    unset SEQ_HDF5_LIBS
    unset SEQ_NC_DIR
    unset SEQ_NC_LIBS
    unset PAR_NC_DIR
    unset PAR_NC_LIBS
    cmake $SRCDIR


elif [ `hostname | cut -c 1-7` == "ubuntu" ]; then

    #########################
    # Scott's ubuntu laptop #
    #########################
    echo "Configure on UBUNTU"
    export CC=mpicc
    cmake $SRCDIR


elif [ `hostname | cut -c 1-6` == "tomato" ]; then

    #########################
    # Todd's ubuntu laptop #
    #########################
    echo "Configure on UBUNTU"
    export CC=mpicc
    cmake $SRCDIR


elif [ `hostname | cut -c 1-4` == "qliu" ]; then

    #########################
    # Gary's ubuntu laptop #
    #########################
    echo "Configure on UBUNTU"
    export CC=mpicc
    export CFLAGS="-g -O0 -fPIC"
    cmake $SRCDIR

elif [ `hostname | cut -c 1-7` == "esimmon" ]; then

    #######################
    # Esimmon Virtual Box #
    #######################
    echo "Configure on ESIMMON VirtualBox ."
    export BUILD_WRITE=ON
    export BUILD_FORTRAN=ON
    export adios_timers=ON
    export CC=mpicc
    export CXX=mpicxx
    export FC=mpif90
    export INSTALL_PREFIX="/opt/adios/1.5.0"
    export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK"
    export CFLAGS="-g -fPIC"
    export SEQ_HDF5_DIR=/opt/hdf5
    export SEQ_HDF5_LIBS="-L/opt/hdf5/lib -lhdf5_hl -lhdf5 -lm"
    export PAR_HDF5_DIR=/opt/phdf5
    export PAR_HDF5_LIBS="-L/opt/phdf5/lib -lhdf5_hl -lhdf5 -lm"
    export SEQ_NC_DIR=/opt/netcdf3
    export SEQ_NC_LIBS="-L/opt/netcdf3/lib -lnetcdf"
    export PAR_NC_DIR=/opt/nc4par
    export PAR_NC_LIBS="-L/opt/nc4par/lib -lnetcdf"
    cmake $SRCDIR

elif [ `hostname | cut -c 1-9` == "PC0098504" ]; then

    #######################
    #      Linux PC       # 
    #######################
    echo "Configure on Linux PC."
    export BUILD_WRITE=ON
    export BUILD_FORTRAN=ON
    export adios_timers=ON
    export CC=mpicc
    export CXX=mpicxx
    export FC=mpif90
    export INSTALL_PREFIX="/opt/adios"
    export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK"
    export CFLAGS="-g -O0 -fPIC -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast"
    export LDFLAGS="-lpthread"
    cmake $SRCDIR

elif [ `hostname | cut -c 1-7` == "adiosVM" ]; then

    #######################
    # ADIOS Virtual Box   #
    #######################
    echo "Configure on adiosVM VirtualBox ."
    export BUILD_WRITE=ON
    export BUILD_FORTRAN=ON
    export adios_timers=ON
    export CC=mpicc
    export CXX=mpicxx
    export FC=mpif90
    export INSTALL_PREFIX="/opt/adios1"
    export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK"
    export CFLAGS="-g -O0 -fPIC -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast"
    export BZIP2_DIR="/usr/lib"
    export LZ4_DIR="/usr/lib"
    export SZ_DIR="/opt/SZ/1.4.12.3"
    export BLOSC_DIR="/opt/blosc"
    export MGARD_DIR="/home/adios/work/Software/MGARD"
    export ZCHECKER_DIR="/opt/Z-checker/0.1.2"
    export ISOBAR_DIR="/opt/isobar"
    export FLEXPATH_DIR="/opt/korvo/dev"
    export DATASPACES_DIR="/opt/dataspaces"
    export FASTBIT_DIR="/opt/fastbit"
    export ALACRITY_DIR="/opt/alacrity"
    export SEQ_HDF5_DIR=/opt/hdf5-1.8.17
    export SEQ_HDF5_LIBS="-L/opt/hdf5-1.8.17/lib -lhdf5_hl -lhdf5 -lm"
    export PAR_HDF5_DIR=/opt/hdf5-1.8.17-parallel
    export PAR_HDF5_LIBS="-L/opt/hdf5-1.8.17-parallel/lib -lhdf5_hl -lhdf5 -lm"
    export SEQ_NC_DIR=/opt/netcdf-4.4.0
    export SEQ_NC_LIBS="-L/opt/netcdf-4.4.0/lib -lnetcdf"
    cmake $SRCDIR
else
    echo "Could not determine what machine is this."
    echo "This script is for configuring adios on the authors' machines."
    echo "You can study it to figure out how to configure adios on your system."
fi