[adios] 01/207: Initial checkin, 1.2.1

Alastair McKinstry mckinstry at moszumanska.debian.org
Fri Jun 12 06:04:22 UTC 2015


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to branch master
in repository adios.

commit e70cff6c0fb31a7a74cdd8e444c73b1b55304ef4
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Wed Apr 27 19:13:46 2011 +0100

    Initial checkin, 1.2.1
---
 AUTHORS                                            |     4 +
 COPYING                                            |    25 +
 ChangeLog                                          |     0
 INSTALL                                            |   190 +
 KNOWN_BUGS                                         |    17 +
 Makefile.am                                        |    28 +
 Makefile.in                                        |   798 +
 NEWS                                               |    27 +
 README                                             |    16 +
 TODO                                               |    50 +
 aclocal.m4                                         |  7293 ++++
 adios_config                                       |   123 +
 adios_config.flags.in                              |    26 +
 config.h.in                                        |   214 +
 config/ac_dart.m4                                  |   116 +
 config/ac_datatap.m4                               |   142 +
 config/ac_dimes.m4                                 |   119 +
 config/ac_dmalloc.m4                               |    62 +
 config/ac_hdf5.m4                                  |   133 +
 config/ac_infiniband.m4                            |   132 +
 config/ac_mxml.m4                                  |   112 +
 config/ac_nc4par.m4                                |   147 +
 config/ac_netcdf.m4                                |   144 +
 config/ac_nssi.m4                                  |   183 +
 config/ac_pablo.m4                                 |    70 +
 config/ac_phdf5.m4                                 |   159 +
 config/ac_portals.m4                               |   341 +
 config/acx_mpi.m4                                  |   187 +
 config/acx_pthread.m4                              |   263 +
 config/cercs.m4                                    |   256 +
 config/compile                                     |   140 +
 config/config.guess                                |  1411 +
 config/config.sub                                  |  1500 +
 config/install-sh                                  |   322 +
 config/ltmain.sh                                   |  6911 ++++
 config/missing                                     |   353 +
 configure                                          | 33332 +++++++++++++++++++
 configure.ac                                       |   459 +
 examples/C/Makefile.am                             |     1 +
 examples/C/Makefile.in                             |   599 +
 examples/C/arrays/Makefile.am                      |    17 +
 examples/C/arrays/Makefile.in                      |   553 +
 examples/C/arrays/arrays.xml                       |    16 +
 examples/C/arrays/arrays_read.c                    |    83 +
 examples/C/arrays/arrays_write.c                   |    53 +
 examples/C/arrays/gread_arrays.ch                  |    11 +
 examples/C/arrays/gwrite_arrays.ch                 |     9 +
 examples/C/arrays/job.pbs                          |     7 +
 examples/C/attributes/Makefile.am                  |    20 +
 examples/C/attributes/Makefile.in                  |   555 +
 examples/C/attributes/attributes.xml               |    32 +
 examples/C/attributes/attributes_read.c            |    79 +
 examples/C/attributes/attributes_write.c           |    54 +
 examples/C/attributes/gread_temperature.ch         |    15 +
 examples/C/attributes/gwrite_temperature.ch        |    13 +
 examples/C/global-array-time/Makefile.am           |    23 +
 examples/C/global-array-time/Makefile.in           |   574 +
 examples/C/global-array-time/adios_globaltime.c    |    53 +
 examples/C/global-array-time/adios_globaltime.xml  |    20 +
 .../C/global-array-time/adios_globaltime_no_xml.c  |   103 +
 .../C/global-array-time/adios_read_globaltime.c    |    91 +
 examples/C/global-array-time/gread_temperature.ch  |    11 +
 examples/C/global-array-time/gwrite_temperature.ch |     9 +
 examples/C/global-array-time/job.pbs               |     7 +
 examples/C/global-array/Makefile.am                |    32 +
 examples/C/global-array/Makefile.in                |   595 +
 examples/C/global-array/adios_global.c             |    53 +
 examples/C/global-array/adios_global.xml           |    18 +
 examples/C/global-array/adios_global_2files.c      |    52 +
 examples/C/global-array/adios_global_no_xml.c      |   127 +
 examples/C/global-array/adios_read_global.c        |    90 +
 examples/C/global-array/adios_read_global_no_xml.c |    84 +
 examples/C/global-array/gread_temperature.ch       |    11 +
 examples/C/global-array/gwrite_temperature.ch      |     9 +
 examples/C/global-array/job.pbs                    |     7 +
 examples/C/manual/1_nonadios_example.c             |    40 +
 examples/C/manual/2_adios_write.c                  |    63 +
 examples/C/manual/3_adios_read.c                   |    53 +
 examples/C/manual/4_adios_nfiles.c                 |    61 +
 examples/C/manual/Makefile.am                      |    27 +
 examples/C/manual/Makefile.in                      |   578 +
 examples/C/manual/config.xml                       |    21 +
 examples/C/manual/gread_temperature.ch             |     7 +
 examples/C/manual/gwrite_temperature.ch            |     5 +
 examples/C/read_all/Makefile.am                    |    14 +
 examples/C/read_all/Makefile.in                    |   548 +
 examples/C/read_all/README                         |    12 +
 examples/C/read_all/read_all.c                     |   211 +
 examples/C/scalars/Makefile.am                     |    19 +
 examples/C/scalars/Makefile.in                     |   553 +
 examples/C/scalars/README                          |    33 +
 examples/C/scalars/gread_scalars.ch                |    29 +
 examples/C/scalars/gwrite_scalars.ch               |    27 +
 examples/C/scalars/job.pbs                         |     7 +
 examples/C/scalars/scalars.xml                     |    30 +
 examples/C/scalars/scalars_read.c                  |   101 +
 examples/C/scalars/scalars_write.c                 |    84 +
 examples/C/stat/Makefile.am                        |    19 +
 examples/C/stat/Makefile.in                        |   553 +
 examples/C/stat/gread_stat.ch                      |    11 +
 examples/C/stat/gwrite_stat.ch                     |    11 +
 examples/C/stat/job.pbs                            |     7 +
 examples/C/stat/stat.xml                           |    17 +
 examples/C/stat/stat_read.c                        |   108 +
 examples/C/stat/stat_write.c                       |    67 +
 examples/Fortran/Makefile.am                       |     2 +
 examples/Fortran/Makefile.in                       |   600 +
 examples/Fortran/arrays/Makefile.am                |    26 +
 examples/Fortran/arrays/Makefile.in                |   555 +
 examples/Fortran/arrays/README                     |    28 +
 examples/Fortran/arrays/arrays.xml                 |    16 +
 examples/Fortran/arrays/arrays_read.F90            |    90 +
 examples/Fortran/arrays/arrays_write.F90           |    58 +
 examples/Fortran/arrays/gread_arrays.fh            |    11 +
 examples/Fortran/arrays/gwrite_arrays.fh           |     9 +
 examples/Fortran/arrays/job.pbs                    |     7 +
 examples/Fortran/global-array-time/Makefile.am     |    21 +
 examples/Fortran/global-array-time/Makefile.in     |   546 +
 .../Fortran/global-array-time/adios_globaltime.F90 |    62 +
 .../Fortran/global-array-time/adios_globaltime.xml |    20 +
 .../Fortran/global-array-time/gread_temperature.fh |    11 +
 .../global-array-time/gwrite_temperature.fh        |     9 +
 examples/Fortran/global-array-time/job.pbs         |     7 +
 examples/Fortran/global-array/Makefile.am          |    26 +
 examples/Fortran/global-array/Makefile.in          |   556 +
 examples/Fortran/global-array/adios_global.F90     |    49 +
 examples/Fortran/global-array/adios_global.xml     |    18 +
 .../Fortran/global-array/adios_global_no_xml.F90   |   110 +
 examples/Fortran/global-array/gread_temperature.fh |    11 +
 .../Fortran/global-array/gwrite_temperature.fh     |     9 +
 examples/Fortran/global-array/job.pbs              |     7 +
 examples/Fortran/scalars/Makefile.am               |    26 +
 examples/Fortran/scalars/Makefile.in               |   556 +
 examples/Fortran/scalars/README                    |    33 +
 examples/Fortran/scalars/gread_scalars.fh          |    29 +
 examples/Fortran/scalars/gwrite_scalars.fh         |    27 +
 examples/Fortran/scalars/job.pbs                   |     7 +
 examples/Fortran/scalars/scalars.xml               |    30 +
 examples/Fortran/scalars/scalars_read.F90          |    80 +
 examples/Fortran/scalars/scalars_write.F90         |    61 +
 examples/Makefile.am                               |     7 +
 examples/Makefile.in                               |   601 +
 runconf                                            |   300 +
 scripts/create.nssi.config.sh                      |    30 +
 scripts/kill.nssi.staging.sh                       |    12 +
 scripts/start.nssi.staging.sh                      |    13 +
 src/Makefile.am                                    |   331 +
 src/Makefile.in                                    |  1994 ++
 src/adios.c                                        |   334 +
 src/adios.h                                        |   172 +
 src/adios_bp_v1.c                                  |  2323 ++
 src/adios_bp_v1.h                                  |   322 +
 src/adios_dart.c                                   |   510 +
 src/adios_datatap.c                                |  1082 +
 src/adios_dimes.c                                  |   485 +
 src/adios_endianness.c                             |   139 +
 src/adios_endianness.h                             |    37 +
 src/adios_error.c                                  |    48 +
 src/adios_error.h                                  |    40 +
 src/adios_internals.c                              |  4993 +++
 src/adios_internals.h                              |   561 +
 src/adios_internals_mxml.c                         |  3398 ++
 src/adios_internals_mxml.h                         |    28 +
 src/adios_mpi.c                                    |  2452 ++
 src/adios_mpi_amr.c                                |  3181 ++
 src/adios_mpi_lustre.c                             |  2106 ++
 src/adios_nc4.c                                    |  1796 +
 src/adios_nssi.c                                   |  1564 +
 src/adios_nssi_args.x                              |   165 +
 src/adios_nssi_config.c                            |   380 +
 src/adios_nssi_config.h                            |    31 +
 src/adios_nssi_filter.c                            |  1446 +
 src/adios_phdf5.c                                  |  1195 +
 src/adios_posix.c                                  |  1394 +
 src/adios_posix1.c                                 |   888 +
 src/adios_read.c                                   |   135 +
 src/adios_read.h                                   |   245 +
 src/adios_read_hooks.c                             |    60 +
 src/adios_read_hooks.h                             |    89 +
 src/adios_socket.c                                 |   171 +
 src/adios_socket.h                                 |    48 +
 src/adios_transport_hooks.c                        |   157 +
 src/adios_transport_hooks.h                        |   158 +
 src/adios_types.h                                  |    43 +
 src/adiosf.c                                       |   487 +
 src/adiosf_read.c                                  |   431 +
 src/aggregation.cpp                                |  1120 +
 src/aggregation.h                                  |    58 +
 src/bp_types.h                                     |    90 +
 src/bp_utils.c                                     |  1706 +
 src/bp_utils.h                                     |    67 +
 src/buffer.c                                       |   162 +
 src/buffer.h                                       |    26 +
 src/common_adios.c                                 |   712 +
 src/common_adios.h                                 |    96 +
 src/common_read.c                                  |   361 +
 src/common_read.h                                  |    60 +
 src/futils.c                                       |    51 +
 src/futils.h                                       |    28 +
 src/globals.c                                      |   139 +
 src/globals.h                                      |    55 +
 src/io_timer.h                                     |    27 +
 src/mpidummy.c                                     |   101 +
 src/mpidummy.h                                     |    62 +
 src/nssi_staging_server.cpp                        |   827 +
 src/read_bp.c                                      |  3057 ++
 src/read_dart.c                                    |   434 +
 src/read_dimes.c                                   |   448 +
 tests/C/Makefile.am                                |    17 +
 tests/C/Makefile.in                                |   551 +
 tests/C/adios_test_c.c                             |   413 +
 tests/C/config_c.xml                               |    36 +
 tests/Fortran/Makefile.am                          |    21 +
 tests/Fortran/Makefile.in                          |   553 +
 tests/Fortran/adios_test_f.F90                     |   198 +
 tests/Fortran/config_fortran.xml                   |    36 +
 tests/Makefile.am                                  |     8 +
 tests/Makefile.in                                  |   601 +
 tests/bp_read/Makefile.am                          |    46 +
 tests/bp_read/Makefile.in                          |   616 +
 tests/bp_read/README                               |     3 +
 tests/bp_read/bp_read_c.c                          |   200 +
 tests/bp_read/bp_read_f.F90                        |   157 +
 tests/bp_read/genbp.c                              |   109 +
 tests/genarray/Makefile.am                         |    50 +
 tests/genarray/Makefile.in                         |   620 +
 tests/genarray/copyarray.F90                       |   300 +
 tests/genarray/copyarray2D.F90                     |   374 +
 tests/genarray/genarray.F90                        |   270 +
 tests/genarray/genarray.xml                        |    51 +
 tests/genarray/genarray2D.F90                      |   309 +
 tests/genarray/genarray3d.xml                      |    48 +
 tests/genarray/job.ewok                            |    19 +
 tests/genarray/job2D.ewok                          |    17 +
 tests/suite/HOWTO-Add-new-test                     |    45 +
 tests/suite/HOWTO-Run                              |    50 +
 tests/suite/Makefile.am                            |     7 +
 tests/suite/Makefile.in                            |   607 +
 tests/suite/cleanup.sh                             |     8 +
 tests/suite/programs/Makefile.am                   |    52 +
 tests/suite/programs/Makefile.in                   |   646 +
 tests/suite/programs/posix_method.F90              |   105 +
 tests/suite/programs/posix_method.xml              |    16 +
 tests/suite/reference/arrays_bpls.txt              |    14 +
 tests/suite/reference/arrays_read.txt              |    15 +
 tests/suite/reference/attributes_bpls.txt          |    20 +
 tests/suite/reference/attributes_read.txt          |     8 +
 tests/suite/reference/global_array_bpls.txt        |    22 +
 tests/suite/reference/global_array_no_xml_bpls.txt |    28 +
 tests/suite/reference/global_array_no_xml_read.txt |     3 +
 tests/suite/reference/global_array_read.txt        |     7 +
 tests/suite/reference/global_array_time_bpls.txt   |    15 +
 tests/suite/reference/global_array_time_read.txt   |     9 +
 tests/suite/reference/scalars_read_c.txt           |    13 +
 tests/suite/reference/scalars_read_f.txt           |   Bin 0 -> 316 bytes
 tests/suite/reference/scalars_write_bpls.txt       |    23 +
 tests/suite/test.sh                                |   155 +
 tests/suite/tests/01_scalars.sh                    |   101 +
 tests/suite/tests/02_attributes.sh                 |    59 +
 tests/suite/tests/03_arrays.sh                     |    58 +
 tests/suite/tests/04_global_array.sh               |    89 +
 tests/suite/tests/05_global_array_time.sh          |    88 +
 tests/suite/tests/06_posix_method.sh               |    56 +
 tests/suite/tests/07_global_array_no_xml.sh        |    89 +
 tools/matlab/Makefile                              |    30 +
 tools/matlab/adios.m                               |    54 +
 tools/matlab/adiosclose.m                          |   151 +
 tools/matlab/adiosclosec.c                         |   114 +
 tools/matlab/adiosopen.m                           |   188 +
 tools/matlab/adiosopenc.c                          |   427 +
 tools/matlab/adiosread.m                           |   268 +
 tools/matlab/adiosreadc.c                          |   458 +
 utils/Makefile.am                                  |    10 +
 utils/Makefile.in                                  |   604 +
 utils/README                                       |    41 +
 utils/adios_lint/Makefile.am                       |    17 +
 utils/adios_lint/Makefile.in                       |   576 +
 utils/adios_lint/adios_lint.c                      |    68 +
 utils/bp2ascii/Makefile.am                         |    17 +
 utils/bp2ascii/Makefile.in                         |   575 +
 utils/bp2ascii/bp2ascii.c                          |   277 +
 utils/bp2h5/Makefile.am                            |    20 +
 utils/bp2h5/Makefile.in                            |   582 +
 utils/bp2h5/README                                 |    91 +
 utils/bp2h5/bp2h5.c                                |   115 +
 utils/bp2h5/hw-utils.c                             |  1665 +
 utils/bp2h5/hw-utils.h                             |   163 +
 utils/bp2ncd/Makefile.am                           |    19 +
 utils/bp2ncd/Makefile.in                           |   576 +
 utils/bp2ncd/bp2ncd.c                              |   849 +
 utils/bp2ncd/bp2ncd.h                              |    69 +
 utils/bpdump/Makefile.am                           |    17 +
 utils/bpdump/Makefile.in                           |   575 +
 utils/bpdump/bpdump.c                              |  1221 +
 utils/bpls/Makefile.am                             |    17 +
 utils/bpls/Makefile.in                             |   576 +
 utils/bpls/bpls.c                                  |  1496 +
 utils/bpls/bpls.h                                  |    49 +
 utils/bpsplit/Makefile.am                          |    30 +
 utils/bpsplit/Makefile.in                          |   613 +
 utils/bpsplit/bpappend.c                           |   562 +
 utils/bpsplit/bpgettime.c                          |   204 +
 utils/bpsplit/bpsplit.c                            |   679 +
 utils/gpp/Makefile.am                              |     2 +
 utils/gpp/Makefile.in                              |   470 +
 utils/gpp/gpp.py                                   |    41 +
 utils/gpp/gpp_types.py                             |    45 +
 utils/gpp/xmlparser.py                             |   335 +
 308 files changed, 135976 insertions(+)

diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..0bb40b8
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,4 @@
+
+Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+Copyright (c) 2008 - 2009.  Georgia Institute of Technology. All rights reserved.
+
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..69bb532
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,25 @@
+ADIOS is freely available under the terms of the BSD license given below.
+
+Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+Copyright (c) 2008 - 2009.  Georgia Institute of Technology. All rights reserved.
+
+Produced at the National Center for Computational Sciences in Oak Ridge National Laboratory.
+
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the disclaimer (as noted below) in the documentation and/or other materials provided with the distribution.
+    * Neither the name of the UT-BATTELLE, LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROF [...]
+
+
+Additional BSD Notice
+
+1. This notice is required to be provided under our contract with the U.S. Department of Energy (DOE). This work was produced at Oak Ridge National Laboratory under Contract No. DEAC05-00OR22725  with the DOE.
+
+2. Neither the United States Government nor UT-BATTELLE, LLC nor any of their employees, makes any warranty, express or implied, or assumes any liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately-owned rights.
+
+3. Also, reference herein to any specific commercial products, process, or services by trade name, trademark, manufacturer or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or UT-BATTELLE, LLC. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or UT-BATTELLE, LLC, and shall not be used for advertising or product endorsement purposes.
+
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..e69de29
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..910bb35
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,190 @@
+Installation Instructions for ADIOS Software
+==================================================
+
+This file provides instructions for installing the ADIOS software.
+If you have any problems with the installation, please see the 
+ADIOS support page at the following location:
+
+    http://www.nccs.gov/user-support/adios
+
+Obtaining ADIOS
+===============
+
+    You can download the latest ADIOS source package from the ADIOS 
+    home page.
+
+Requirements and optional features
+==================================
+
+ - ADIOS requires MPI and MPI-IO. 
+
+ - ADIOS requires a version 2.5 or higher of Mini-XML.
+   The Mini-XML library is used to parse XML configuration files. 
+   It can be downloaded from 
+      http://www.minixml.org/software.php
+
+ - A Fortran 90 compiler is optional.
+   The Fortran API is built only if a Fortran 90 compiler is available.
+   Use --disable-fortran at configuration time to disable this feature. 
+
+ - NetCDF-3 is optional.
+   The bp2ncd converter utility to NetCDF format is built only if NetCDF
+   is available. Currently ADIOS uses the NetCDF-3 library. Use the option
+   --with netcdf=<path> or ensure that the NETCDF_DIR environment variable 
+   is set before configuring ADIOS. 
+   
+   NetCDF version 3.6.2 can be downloaded from
+       http://www.unidata.ucar.edu/downloads/netcdf
+
+ - HDF5 is optional.
+   The bp2h5 converter utility to HDF5 format is built only if a HDF5 
+   library is available. Currently ADIOS uses the 1.6 version of the HDF5 
+   API but it can be built and used with the 1.8.x version of the HDF5 
+   library too. Use the option --with hdf5=<path> to configure ADIOS.
+
+   HDF5 can be downloaded from
+       http://www.hdfgroup.org/downloads
+
+ - Parallel HDF5 is optional.
+   The transport method writing files in the Parallel HDF5 format is built 
+   only if a parallel version of the HDF5 library is (also) available. You
+   need to use the option   with phdf5=<path> to build this transport method.
+
+   If you define Parallel HDF5 and do not define serial HDF5, then bp2h5 will
+   be built with the parallel library. 
+   
+   Note that if you build this transport method, ADIOS will depend on PHDF5 
+   when you link any application with ADIOS even if you the application does 
+   not intend to use this method. 
+
+   If you have problems compiling ADIOS with PHDF5 due to missing flags or 
+   libraries, you can define them using 
+   --with-phdf5-incdir=<path>,
+   --with-phdf5-libdir=<path> and 
+   --with-phdf5-libs=<link time flags and libraries>
+
+ - NetCDF-4 Parallel is optional.
+   The NC4 transport method writes files using the NetCDF-4 library which in 
+   turn is based on the parallel HDF5 library. You need to use the option 
+   -- with nc4par=<path> to build this transport method. Also, you need the
+   parallel HDF5 library. 
+
+   NetCDF version 4.0.1 can be downloaded from
+       http://www.unidata.ucar.edu/downloads/netcdf
+
+   You need to build NetCDF-4 with a parallel HDF5 library as described at
+   http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-install/parallel.html
+
+ - Matlab is optional.
+   If you have Matlab, you can build the ADIOS reader for Matlab separatly
+   after building ADIOS. See details below in the Matlab section but before
+   configuring ADIOS.
+
+
+Quick Installation
+==================
+
+   The following steps are needed to configure, build and install ADIOS.
+   For example, to install ADIOS to /usr/local/adios on a machine where
+   mpicc and mpif90 are the compilers:
+
+   $ tar zxf adios-1.0.tar.gz
+   $ cd adios-1.0
+   $ CC=mpicc FC=mpif90 ./configure --prefix=/usr/local/adios 
+       --with-mxml=<location of mini-xml installation>
+       --with-hdf5=<location of HDF5 installation>
+       --with-netcdf=<location of netCDF installation>
+   $ make
+   $ make install
+
+
+Full installation instructions
+==============================
+
+Architectures and compilers
+---------------------------
+
+   Cray XT machines
+   ----------------
+   Use "CC=cc CXX=CC FC=ftn" for the configure command. 
+   These wrappers should be using the actual C, C++ and Fortran compilers on 
+   such machines. ADIOS can be compiled with GNU, PGI and Intel compilers
+   but it does not compile with the Cray compiler. If you are using the
+   Cray compilers to build your application build the ADIOS library with 
+   the GNU compiler.
+
+   BlueGene machines
+   -----------------
+   Use the following compiler settings for the configure command:
+     MPICC=mpixlc_r MPIFC=mpixlf90_r CC=xlc_r FC=xlf90_r
+
+   Mac OSX
+   -------
+   Use separate MPICC/MPIFC and CC/FC compilers
+   Add 
+     export CFLAGS="-DO_LARGEFILE=0 -fno-common"
+   before configuring adios. 
+   If you do not want to install a fortran compiler on Mac, use
+   --disable-fortran at configure.
+
+   We have built ADIOS on OS X 10.6 using MacPorts and GCC4.4 
+   and OpenMPI 1.4.2 ports. GCC4.4 contains the gfortran compiler too. 
+   
+   Linux
+   -----
+   ADIOS should configure and build fine on Linux. One possible issue
+   is that configure may break in one of the tests for the fortran compiler
+   test with mpif90. If you have set FC=mpif90 before configure, try to 
+   configure without setting it. Then configure will test the default
+   f90 compiler (gfortran most likely) and pass but still will use mpif90 to 
+   build ADIOS. Or try MPIFC=mpif90 and FC=<whatever fortran compiler you have>
+
+Configuring
+-----------
+   Hint: look at the runconf script in the distribution directory. This 
+   script is used to configure ADIOS on our systems. It may help you 
+   in configuring ADIOS for your system. 
+
+   ./configure --help 
+   lists the options that you can use. 
+
+Matlab
+------
+   Matlab MEX compiler uses GNU gcc to compile codes so you need to build
+   ADIOS with gcc. It also requires relocatable code, therefore you need to
+   specify -fPIC in your C compiler flags when configuring ADIOS:
+
+   $ CFLAGS="-fPIC" ./configure
+   $ make
+
+   After building ADIOS, you can build the reader for Matlab. Ensure that 
+   the MEX compiler 'mex' is in the path:
+
+   $ cd tools/matlab
+   $ make matlab
+
+   You need to install the ADIOS M and MEX files in tools/matlab manually
+   to a directory where Matlab can find them (you can tell Matlab where to 
+   look for them by setting the MATLABPATH environment variable).
+    
+HDF5
+----
+   If you have parallel HDF5 installed and use it with --with-phdf5 and you
+   do not specify a serial HDF5 library with --with-hdf5, then configure
+   will use the parallel library for both HDF5 and PHDF5. This may or 
+   may not work to build utils/bp2h5. If not, you need to use a serial
+   version of HDF5 to build bp2h5. Use the --with-hdf5 option to tell 
+   configure where to look for the serial HDF5 library.
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/KNOWN_BUGS b/KNOWN_BUGS
new file mode 100644
index 0000000..625c9ae
--- /dev/null
+++ b/KNOWN_BUGS
@@ -0,0 +1,17 @@
+
+Writing data
+============
+
+1. If the size specified to the adios_group_size is too small, the output
+will be silently corrupt. Work around: make the size bigger. An error
+message will be added in later releases.
+
+Reading data
+============
+
+1. The read API defines void *mins and void *maxs returned by the adios_inq_var() funtion to contain the min/max of an array per timestep. In the current release these pointers are NULL always. 
+Only the gmin and gmax single values as global min/max of an array over all timesteps are available. 
+
+
+
+
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..eddca2a
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,28 @@
+SUBDIRS=src utils tests examples
+
+EXTRA_DIST = runconf \
+             KNOWN_BUGS \
+             adios_config \
+             tools/matlab/Makefile \
+             tools/matlab/adios.m \
+             tools/matlab/adiosclose.m \
+             tools/matlab/adiosopen.m \
+             tools/matlab/adiosread.m \
+             tools/matlab/adiosclosec.c \
+             tools/matlab/adiosopenc.c \
+             tools/matlab/adiosreadc.c \
+             scripts/create.nssi.config.sh \
+             scripts/kill.nssi.staging.sh \
+             scripts/start.nssi.staging.sh
+
+bin_SCRIPTS = adios_config 
+
+if HAVE_NSSI
+    bin_SCRIPTS += scripts/create.nssi.config.sh \
+                   scripts/kill.nssi.staging.sh  \
+                   scripts/start.nssi.staging.sh
+endif
+
+install-data-hook:
+	cp adios_config.flags $(DESTDIR)$(bindir)
+        
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..5b4cbbc
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,798 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = .
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+ at HAVE_NSSI_TRUE@am__append_1 = scripts/create.nssi.config.sh \
+ at HAVE_NSSI_TRUE@                   scripts/kill.nssi.staging.sh  \
+ at HAVE_NSSI_TRUE@                   scripts/start.nssi.staging.sh
+
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(srcdir)/adios_config.flags.in \
+	$(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \
+	ChangeLog INSTALL NEWS TODO config/compile config/config.guess \
+	config/config.sub config/install-sh config/ltmain.sh \
+	config/missing
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno configure.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = adios_config.flags
+am__installdirs = "$(DESTDIR)$(bindir)"
+binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+SCRIPTS = $(bin_SCRIPTS)
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  { test ! -d $(distdir) \
+    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+SUBDIRS = src utils tests examples
+EXTRA_DIST = runconf \
+             KNOWN_BUGS \
+             adios_config \
+             tools/matlab/Makefile \
+             tools/matlab/adios.m \
+             tools/matlab/adiosclose.m \
+             tools/matlab/adiosopen.m \
+             tools/matlab/adiosread.m \
+             tools/matlab/adiosclosec.c \
+             tools/matlab/adiosopenc.c \
+             tools/matlab/adiosreadc.c \
+             scripts/create.nssi.config.sh \
+             scripts/kill.nssi.staging.sh \
+             scripts/start.nssi.staging.sh
+
+bin_SCRIPTS = adios_config $(am__append_1)
+all: config.h
+	$(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+am--refresh:
+	@:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
+	      cd $(srcdir) && $(AUTOMAKE) --gnu  \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    echo ' $(SHELL) ./config.status'; \
+	    $(SHELL) ./config.status;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	$(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+config.h: stamp-h1
+	@if test ! -f $@; then \
+	  rm -f stamp-h1; \
+	  $(MAKE) stamp-h1; \
+	else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+	@rm -f stamp-h1
+	cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in:  $(am__configure_deps) 
+	cd $(top_srcdir) && $(AUTOHEADER)
+	rm -f stamp-h1
+	touch $@
+
+distclean-hdr:
+	-rm -f config.h stamp-h1
+adios_config.flags: $(top_builddir)/config.status $(srcdir)/adios_config.flags.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+install-binSCRIPTS: $(bin_SCRIPTS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+	@list='$(bin_SCRIPTS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  if test -f $$d$$p; then \
+	    f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+	    echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	    $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
+	  else :; fi; \
+	done
+
+uninstall-binSCRIPTS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_SCRIPTS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
+	done
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	$(am__remove_distdir)
+	mkdir $(distdir)
+	$(mkdir_p) $(distdir)/. $(distdir)/config $(distdir)/scripts $(distdir)/tools/matlab
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+	-find $(distdir) -type d ! -perm -755 -exec chmod a+rwx,go+rx {} \; -o \
+	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+	|| chmod -R a+r $(distdir)
+dist-gzip: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+dist-bzip2: distdir
+	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+	$(am__remove_distdir)
+
+dist-tarZ: distdir
+	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+	$(am__remove_distdir)
+
+dist-shar: distdir
+	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	$(am__remove_distdir)
+
+dist-zip: distdir
+	-rm -f $(distdir).zip
+	zip -rq $(distdir).zip $(distdir)
+	$(am__remove_distdir)
+
+dist dist-all: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+	case '$(DIST_ARCHIVES)' in \
+	*.tar.gz*) \
+	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+	*.tar.bz2*) \
+	  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+	*.tar.Z*) \
+	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+	*.shar.gz*) \
+	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+	*.zip*) \
+	  unzip $(distdir).zip ;;\
+	esac
+	chmod -R a-w $(distdir); chmod a+w $(distdir)
+	mkdir $(distdir)/_build
+	mkdir $(distdir)/_inst
+	chmod a-w $(distdir)
+	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+	  && cd $(distdir)/_build \
+	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	    $(DISTCHECK_CONFIGURE_FLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
+	  && $(MAKE) $(AM_MAKEFLAGS) check \
+	  && $(MAKE) $(AM_MAKEFLAGS) install \
+	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+	        distuninstallcheck \
+	  && chmod -R a-w "$$dc_install_base" \
+	  && ({ \
+	       (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
+	  && rm -rf "$$dc_destdir" \
+	  && $(MAKE) $(AM_MAKEFLAGS) dist \
+	  && rm -rf $(DIST_ARCHIVES) \
+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+	$(am__remove_distdir)
+	@(echo "$(distdir) archives ready for distribution: "; \
+	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+	  sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
+distuninstallcheck:
+	@cd $(distuninstallcheck_dir) \
+	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+	   || { echo "ERROR: files left after uninstall:" ; \
+	        if test -n "$(DESTDIR)"; then \
+	          echo "  (check DESTDIR support)"; \
+	        fi ; \
+	        $(distuninstallcheck_listfiles) ; \
+	        exit 1; } >&2
+distcleancheck: distclean
+	@if test '$(srcdir)' = . ; then \
+	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+	  exit 1 ; \
+	fi
+	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+	  || { echo "ERROR: files left in build directory after distclean:" ; \
+	       $(distcleancheck_listfiles) ; \
+	       exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(SCRIPTS) config.h
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr \
+	distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+	@$(NORMAL_INSTALL)
+	$(MAKE) $(AM_MAKEFLAGS) install-data-hook
+
+install-exec-am: install-binSCRIPTS
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -rf $(top_srcdir)/autom4te.cache
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-binSCRIPTS uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
+	check-am clean clean-generic clean-libtool clean-recursive \
+	ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
+	dist-shar dist-tarZ dist-zip distcheck distclean \
+	distclean-generic distclean-hdr distclean-libtool \
+	distclean-recursive distclean-tags distcleancheck distdir \
+	distuninstallcheck dvi dvi-am html html-am info info-am \
+	install install-am install-binSCRIPTS install-data \
+	install-data-am install-data-hook install-exec install-exec-am \
+	install-info install-info-am install-man install-strip \
+	installcheck installcheck-am installdirs installdirs-am \
+	maintainer-clean maintainer-clean-generic \
+	maintainer-clean-recursive mostlyclean mostlyclean-generic \
+	mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
+	tags tags-recursive uninstall uninstall-am \
+	uninstall-binSCRIPTS uninstall-info-am
+
+
+install-data-hook:
+	cp adios_config.flags $(DESTDIR)$(bindir)
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..4f8c99a
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,27 @@
+1.2.1 Released Aug 25, 2010
+    - Bug fix in read API (arrays written every timestep but without time dimension caused aborts)
+    - DIMES method from Rutgers
+
+1.2 Released July 15, 2010
+    - XML and non-XML write APIs are available
+    - More statistics (min/max/avg/std.dev) available without
+      overhead in write performance
+    - Added MPI_AMR method for advanced mesh refinement codes and
+      for aggregated writing (N procs to P writers to M disks)
+    - Added support for subfiles
+      - POSIX method many-file output can be read as one file
+      - MPI_AMR method uses subfiles to improve write performance
+    - Added NetCDF-4 transport method
+    - Asynchronous, staging methods on Jaguar XT5 at ORNL
+      - DataTap from Georgia Tech
+      - DataSpaces from Rutgers
+      - NSSI from Sandia
+    - MPI_LUSTRE method for best performance on Lustre file system
+
+
+1.0.1  Released on Dec 9, 2009
+    - fix: builds read API on Mac (was broken at utils/bpdump)
+    - fix: Fortran written BP files are correctly read by Fortran readers
+    - added adios_mpi_stripe2 method for improved performance on Lustre file system
+
+1.0  Released on Nov 18, 2009
diff --git a/README b/README
new file mode 100644
index 0000000..d793d17
--- /dev/null
+++ b/README
@@ -0,0 +1,16 @@
+ADIOS 1.2 Release
+-----------------
+
+Please look at the examples/ directory for the example codes on how to 
+use ADIOS. If you need more detailed information, please, read the User's 
+manual.
+
+Please read COPYING for the copyright. 
+
+This release contains only a limited set of transport methods for different
+I/O uses. There are more methods, actively researched ones, available.
+Contact us to get them.
+
+
+
+
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..4e58486
--- /dev/null
+++ b/TODO
@@ -0,0 +1,50 @@
+-  Make a utility for HPSS that will make an index only file
+
+-  fsck utility to fix files that were not fully completely created correctly.
+
+-  Is the Fortran module interface complete?
+
+-  Do we need the ADIOS_WRITE macros anymore? If so, we need to do this:
+
+#define ADIOS_WRITE(a,b) call adios_write(a,'b'//char(0),b)
+to
+#define ADIOS_WRITE(a,b) call adios_write(a,#b//char(0),b)
+
+-  Auto generate the index file intended for the auto-split output (POSIX).
+
+-  Formalize the resilience features of BP and add any features necessary.
+
+-  fix MPI_STRIPE method to not require the conditional compilation to work
+properly.
+
+-  Figure out why and fix append mode slowdown.
+
+-  Add write="no" back in. This will force any array dimensions that use this
+to be stored as absolute numbers rather than references to vars.
+
+-  Figure out how to use the same XML file for the app and staging. We need
+some flag to recognize and parse differently. The idea is that we will specify
+the transport for a group is the staging method, but add a parameter, for
+example, that states which method to actually use in the staging area to write
+the data to disk. There might be more changes necessary to make this work.
+
+-  Make the group_size optional. This would require making the buffer a
+maximum size and delaying the offset calculation until the close operation.
+There is also the issue of what to do if the buffer is exceeded. It probably
+only makes sense to abort. Otherwise, we'd have to do a big synch point that
+some processes might not be expecting. I don't think this is really a reasonable
+thing to do. Abort is about the only thing that can really work consistently.
+
+-  Consider refiniements to the free-memory-percentage to better address
+very dynamic memory usage.
+
+-  Add explicit support for "no values present" like NetCDF has.
+
+-  Add a checksum data characteristic to the writing so that we can validate
+the data on reading.
+
+-  fix the phdf5 method so that it uses the progressive assembly approach
+of the nc4 method.
+
+-  fix the tests/genarray so that the 2d and 3d XML files don't collide on
+the group name internally (gpp.py will overwrite one with the other).
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..fd62727
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,7293 @@
+# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005  Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+
+# serial 48 AC_PROG_LIBTOOL
+
+
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -----------------------------------------------------------
+# If this macro is not defined by Autoconf, define it here.
+m4_ifdef([AC_PROVIDE_IFELSE],
+         [],
+         [m4_define([AC_PROVIDE_IFELSE],
+	         [m4_ifdef([AC_PROVIDE_$1],
+		           [$2], [$3])])])
+
+
+# AC_PROG_LIBTOOL
+# ---------------
+AC_DEFUN([AC_PROG_LIBTOOL],
+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+  AC_PROVIDE_IFELSE([AC_PROG_CXX],
+    [AC_LIBTOOL_CXX],
+    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+  ])])
+dnl And a similar setup for Fortran 77 support
+  AC_PROVIDE_IFELSE([AC_PROG_F77],
+    [AC_LIBTOOL_F77],
+    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
+])])
+
+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+    [AC_LIBTOOL_GCJ],
+    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+      [AC_LIBTOOL_GCJ],
+      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+	[AC_LIBTOOL_GCJ],
+      [ifdef([AC_PROG_GCJ],
+	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([A][M_PROG_GCJ],
+	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([LT_AC_PROG_GCJ],
+	     [define([LT_AC_PROG_GCJ],
+		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
+])])# AC_PROG_LIBTOOL
+
+
+# _AC_PROG_LIBTOOL
+# ----------------
+AC_DEFUN([_AC_PROG_LIBTOOL],
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Prevent multiple expansion
+define([AC_PROG_LIBTOOL], [])
+])# _AC_PROG_LIBTOOL
+
+
+# AC_LIBTOOL_SETUP
+# ----------------
+AC_DEFUN([AC_LIBTOOL_SETUP],
+[AC_PREREQ(2.50)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+
+AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+dnl
+
+AC_LIBTOOL_SYS_MAX_CMD_LEN
+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+AC_LIBTOOL_OBJDIR
+
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+_LT_AC_PROG_ECHO_BACKSLASH
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e 1s/^X//'
+[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
+
+# Same as above, but do not quote variable references.
+[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+AC_CHECK_TOOL(AR, ar, false)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    AC_PATH_MAGIC
+  fi
+  ;;
+esac
+
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+enable_win32_dll=yes, enable_win32_dll=no)
+
+AC_ARG_ENABLE([libtool-lock],
+    [AC_HELP_STRING([--disable-libtool-lock],
+	[avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+AC_ARG_WITH([pic],
+    [AC_HELP_STRING([--with-pic],
+	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [pic_mode="$withval"],
+    [pic_mode=default])
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+AC_LIBTOOL_LANG_C_CONFIG
+_LT_AC_TAGCONFIG
+])# AC_LIBTOOL_SETUP
+
+
+# _LT_AC_SYS_COMPILER
+# -------------------
+AC_DEFUN([_LT_AC_SYS_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_AC_SYS_COMPILER
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+AC_DEFUN([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+  case $cc_temp in
+    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+])
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+AC_DEFUN([_LT_COMPILER_BOILERPLATE],
+[ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+AC_DEFUN([_LT_LINKER_BOILERPLATE],
+[ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+])# _LT_LINKER_BOILERPLATE
+
+
+# _LT_AC_SYS_LIBPATH_AIX
+# ----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
+[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_AC_SYS_LIBPATH_AIX
+
+
+# _LT_AC_SHELL_INIT(ARG)
+# ----------------------
+AC_DEFUN([_LT_AC_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+	 [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_AC_SHELL_INIT
+
+
+# _LT_AC_PROG_ECHO_BACKSLASH
+# --------------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
+[_LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+  ;;
+esac
+
+echo=${ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X[$]1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+  # Yippee, $echo works!
+  :
+else
+  # Restart under the correct shell.
+  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+[$]*
+EOF
+  exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
+       echo_test_string=`eval $cmd` &&
+       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+    then
+      break
+    fi
+  done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+   test "X$echo_testing_string" = "X$echo_test_string"; then
+  :
+else
+  # The Solaris, AIX, and Digital Unix default echo programs unquote
+  # backslashes.  This makes it impossible to quote backslashes using
+  #   echo "$something" | sed 's/\\/\\\\/g'
+  #
+  # So, first we look for a working echo in the user's PATH.
+
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for dir in $PATH /usr/ucb; do
+    IFS="$lt_save_ifs"
+    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      echo="$dir/echo"
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  if test "X$echo" = Xecho; then
+    # We didn't find a better echo, so look for alternatives.
+    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      # This shell has a builtin print -r that does the trick.
+      echo='print -r'
+    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+	 test "X$CONFIG_SHELL" != X/bin/ksh; then
+      # If we have ksh, try running configure again with it.
+      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+      export ORIGINAL_CONFIG_SHELL
+      CONFIG_SHELL=/bin/ksh
+      export CONFIG_SHELL
+      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+    else
+      # Try using printf.
+      echo='printf %s\n'
+      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+	 test "X$echo_testing_string" = "X$echo_test_string"; then
+	# Cool, printf works
+	:
+      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+	   test "X$echo_testing_string" = 'X\t' &&
+	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+	export CONFIG_SHELL
+	SHELL="$CONFIG_SHELL"
+	export SHELL
+	echo="$CONFIG_SHELL [$]0 --fallback-echo"
+      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+	   test "X$echo_testing_string" = 'X\t' &&
+	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	echo="$CONFIG_SHELL [$]0 --fallback-echo"
+      else
+	# maybe with a smaller string...
+	prev=:
+
+	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+	  then
+	    break
+	  fi
+	  prev="$cmd"
+	done
+
+	if test "$prev" != 'sed 50q "[$]0"'; then
+	  echo_test_string=`eval $prev`
+	  export echo_test_string
+	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+	else
+	  # Oops.  We lost completely, so just stick with echo.
+	  echo=echo
+	fi
+      fi
+    fi
+  fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(ECHO)
+])])# _LT_AC_PROG_ECHO_BACKSLASH
+
+
+# _LT_AC_LOCK
+# -----------
+AC_DEFUN([_LT_AC_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+    [AC_HELP_STRING([--disable-libtool-lock],
+	[avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *ELF-32*)
+      HPUX_IA64_MODE="32"
+      ;;
+    *ELF-64*)
+      HPUX_IA64_MODE="64"
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+   if test "$lt_cv_prog_gnu_ld" = yes; then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -melf32bsmip"
+      ;;
+    *N32*)
+      LD="${LD-ld} -melf32bmipn32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -melf64bmip"
+      ;;
+    esac
+   else
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -32"
+      ;;
+    *N32*)
+      LD="${LD-ld} -n32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -64"
+      ;;
+    esac
+   fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+    *32-bit*)
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_i386"
+          ;;
+        ppc64-*linux*|powerpc64-*linux*)
+          LD="${LD-ld} -m elf32ppclinux"
+          ;;
+        s390x-*linux*)
+          LD="${LD-ld} -m elf_s390"
+          ;;
+        sparc64-*linux*)
+          LD="${LD-ld} -m elf32_sparc"
+          ;;
+      esac
+      ;;
+    *64-bit*)
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          LD="${LD-ld} -m elf64_s390"
+          ;;
+        sparc*-*linux*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_PUSH(C)
+     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_POP])
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)    LD="${LD-ld} -64" ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+  ])
+esac
+
+need_locks="$enable_libtool_lock"
+
+])# _LT_AC_LOCK
+
+
+# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
+[AC_REQUIRE([LT_AC_PROG_SED])
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$3"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+])
+
+if test x"[$]$2" = xyes; then
+    ifelse([$5], , :, [$5])
+else
+    ifelse([$6], , :, [$6])
+fi
+])# AC_LIBTOOL_COMPILER_OPTION
+
+
+# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                          [ACTION-SUCCESS], [ACTION-FAILURE])
+# ------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
+[AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&AS_MESSAGE_LOG_FD
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
+     else
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+    ifelse([$4], , :, [$4])
+else
+    ifelse([$5], , :, [$5])
+fi
+])# AC_LIBTOOL_LINKER_OPTION
+
+
+# AC_LIBTOOL_SYS_MAX_CMD_LEN
+# --------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
+[# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+  i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    # If test is not a shell built-in, we'll probably end up computing a
+    # maximum length that is only half of the actual maximum length, but
+    # we can't tell.
+    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+	       = "XX$teststring") >/dev/null 2>&1 &&
+	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
+	    lt_cv_sys_max_cmd_len=$new_result &&
+	    test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      teststring=$teststring$teststring
+    done
+    teststring=
+    # Add a significant safety factor because C++ compilers can tack on massive
+    # amounts of additional arguments before passing them to the linker.
+    # It appears as though 1/2 is a usable value.
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    ;;
+  esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+  AC_MSG_RESULT(none)
+fi
+])# AC_LIBTOOL_SYS_MAX_CMD_LEN
+
+
+# _LT_AC_CHECK_DLFCN
+# ------------------
+AC_DEFUN([_LT_AC_CHECK_DLFCN],
+[AC_CHECK_HEADERS(dlfcn.h)dnl
+])# _LT_AC_CHECK_DLFCN
+
+
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ---------------------------------------------------------------------
+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+  [$4]
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+    exit (status);
+}]
+EOF
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_dlunknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_AC_TRY_DLOPEN_SELF
+
+
+# AC_LIBTOOL_DLOPEN_SELF
+# ----------------------
+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+   ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+   ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    AC_CHECK_LIB([dl], [dlopen],
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ])
+   ;;
+
+  *)
+    AC_CHECK_FUNC([shl_load],
+	  [lt_cv_dlopen="shl_load"],
+      [AC_CHECK_LIB([dld], [shl_load],
+	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
+	[AC_CHECK_FUNC([dlopen],
+	      [lt_cv_dlopen="dlopen"],
+	  [AC_CHECK_LIB([dl], [dlopen],
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+	    [AC_CHECK_LIB([svld], [dlopen],
+		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+	      [AC_CHECK_LIB([dld], [dld_link],
+		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+	      ])
+	    ])
+	  ])
+	])
+      ])
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    AC_CACHE_CHECK([whether a program can dlopen itself],
+	  lt_cv_dlopen_self, [dnl
+	  _LT_AC_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+    ])
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+    	  lt_cv_dlopen_self_static, [dnl
+	  _LT_AC_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
+      ])
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+])# AC_LIBTOOL_DLOPEN_SELF
+
+
+# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
+# ---------------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler
+AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+     fi
+   fi
+   chmod u+w . 2>&AS_MESSAGE_LOG_FD
+   $rm conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+   $rm out/* && rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
+])
+])# AC_LIBTOOL_PROG_CC_C_O
+
+
+# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
+# -----------------------------------------
+# Check to see if we can do hard links to lock some files if needed
+AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
+[AC_REQUIRE([_LT_AC_LOCK])dnl
+
+hard_links="nottested"
+if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  AC_MSG_CHECKING([if we can lock with hard links])
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  AC_MSG_RESULT([$hard_links])
+  if test "$hard_links" = no; then
+    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
+
+
+# AC_LIBTOOL_OBJDIR
+# -----------------
+AC_DEFUN([AC_LIBTOOL_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+])# AC_LIBTOOL_OBJDIR
+
+
+# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
+# ----------------------------------------------
+# Check hardcoding attributes.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_AC_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
+   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
+   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_AC_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
+
+
+# AC_LIBTOOL_SYS_LIB_STRIP
+# ------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
+[striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+   darwin*)
+       if test -n "$STRIP" ; then
+         striplib="$STRIP -x"
+         AC_MSG_RESULT([yes])
+       else
+  AC_MSG_RESULT([no])
+fi
+       ;;
+   *)
+  AC_MSG_RESULT([no])
+    ;;
+  esac
+fi
+])# AC_LIBTOOL_SYS_LIB_STRIP
+
+
+# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
+[AC_MSG_CHECKING([dynamic linker characteristics])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+  else
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[[01]] | aix4.[[01]].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[[45]]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[[123]]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  freebsd*) # from 4.6 on
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext_cmds='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+interix3*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # find out which ABI we are using
+  libsuff=
+  case "$host_cpu" in
+  x86_64*|s390x*|powerpc64*)
+    echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+    if AC_TRY_EVAL(ac_compile); then
+      case `/usr/bin/file conftest.$ac_objext` in
+      *64-bit*)
+        libsuff=64
+        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+        ;;
+      esac
+    fi
+    rm -rf conftest*
+    ;;
+  esac
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+knetbsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[[89]] | openbsd2.[[89]].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+    shlibpath_overrides_runpath=no
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    shlibpath_overrides_runpath=yes
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+
+
+# _LT_AC_TAGCONFIG
+# ----------------
+AC_DEFUN([_LT_AC_TAGCONFIG],
+[AC_ARG_WITH([tags],
+    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
+        [include additional configurations @<:@automatic@:>@])],
+    [tagnames="$withval"])
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    AC_MSG_WARN([output file `$ofile' does not exist])
+  fi
+
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
+    else
+      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
+    fi
+  fi
+  if test -z "$LTCFLAGS"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
+  fi
+
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
+    "") ;;
+    *)  AC_MSG_ERROR([invalid tag name: $tagname])
+	;;
+    esac
+
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      AC_MSG_ERROR([tag name \"$tagname\" already exists])
+    fi
+
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
+
+      case $tagname in
+      CXX)
+	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+	    (test "X$CXX" != "Xg++"))) ; then
+	  AC_LIBTOOL_LANG_CXX_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      F77)
+	if test -n "$F77" && test "X$F77" != "Xno"; then
+	  AC_LIBTOOL_LANG_F77_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      GCJ)
+	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+	  AC_LIBTOOL_LANG_GCJ_CONFIG
+	else
+	  tagname=""
+	fi
+	;;
+
+      RC)
+	AC_LIBTOOL_LANG_RC_CONFIG
+	;;
+
+      *)
+	AC_MSG_ERROR([Unsupported tag name: $tagname])
+	;;
+      esac
+
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    AC_MSG_ERROR([unable to update list of available tagged configurations.])
+  fi
+fi
+])# _LT_AC_TAGCONFIG
+
+
+# AC_LIBTOOL_DLOPEN
+# -----------------
+# enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN],
+ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_DLOPEN
+
+
+# AC_LIBTOOL_WIN32_DLL
+# --------------------
+# declare package support for building win32 DLLs
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_WIN32_DLL
+
+
+# AC_ENABLE_SHARED([DEFAULT])
+# ---------------------------
+# implement the --enable-shared flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_SHARED],
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([shared],
+    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
+])# AC_ENABLE_SHARED
+
+
+# AC_DISABLE_SHARED
+# -----------------
+# set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)
+])# AC_DISABLE_SHARED
+
+
+# AC_ENABLE_STATIC([DEFAULT])
+# ---------------------------
+# implement the --enable-static flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_STATIC],
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([static],
+    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
+])# AC_ENABLE_STATIC
+
+
+# AC_DISABLE_STATIC
+# -----------------
+# set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)
+])# AC_DISABLE_STATIC
+
+
+# AC_ENABLE_FAST_INSTALL([DEFAULT])
+# ---------------------------------
+# implement the --enable-fast-install flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([fast-install],
+    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
+])# AC_ENABLE_FAST_INSTALL
+
+
+# AC_DISABLE_FAST_INSTALL
+# -----------------------
+# set the default to --disable-fast-install
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)
+])# AC_DISABLE_FAST_INSTALL
+
+
+# AC_LIBTOOL_PICMODE([MODE])
+# --------------------------
+# implement the --with-pic flag
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)
+])# AC_LIBTOOL_PICMODE
+
+
+# AC_PROG_EGREP
+# -------------
+# This is predefined starting with Autoconf 2.54, so this conditional
+# definition can be removed once we require Autoconf 2.54 or later.
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
+   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi])
+ EGREP=$ac_cv_prog_egrep
+ AC_SUBST([EGREP])
+])])
+
+
+# AC_PATH_TOOL_PREFIX
+# -------------------
+# find a file program which can recognise shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] |  ?:[\\/]*])
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="ifelse([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$1; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  AC_MSG_RESULT($MAGIC_CMD)
+else
+  AC_MSG_RESULT(no)
+fi
+])# AC_PATH_TOOL_PREFIX
+
+
+# AC_PATH_MAGIC
+# -------------
+# find a file program which can recognise a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])# AC_PATH_MAGIC
+
+
+# AC_PROG_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH([gnu-ld],
+    [AC_HELP_STRING([--with-gnu-ld],
+	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
+    [test "$withval" = no || with_gnu_ld=yes],
+    [with_gnu_ld=no])
+AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by $CC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]]* | ?:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_PROG_LD_GNU
+])# AC_PROG_LD
+
+
+# AC_PROG_LD_GNU
+# --------------
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# AC_PROG_LD_GNU
+
+
+# AC_PROG_LD_RELOAD_FLAG
+# ----------------------
+# find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+])# AC_PROG_LD_RELOAD_FLAG
+
+
+# AC_DEPLIBS_CHECK_METHOD
+# -----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognise dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[[45]]*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | kfreebsd*-gnu | dragonfly*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix3*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+nto-qnx*)
+  lt_cv_deplibs_check_method=unknown
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+])# AC_DEPLIBS_CHECK_METHOD
+
+
+# AC_PROG_NM
+# ----------
+# find the pathname to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then 
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+	# Check to see if the nm accepts a BSD-compat flag.
+	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	#   nm: unknown option "B" ignored
+	# Tru64's nm complains that /dev/null is an invalid object file
+	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+	*/dev/null* | *'Invalid file or object type'*)
+	  lt_cv_path_NM="$tmp_nm -B"
+	  break
+	  ;;
+	*)
+	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	  */dev/null*)
+	    lt_cv_path_NM="$tmp_nm -p"
+	    break
+	    ;;
+	  *)
+	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	    continue # so that we can try to find one that supports BSD flags
+	    ;;
+	  esac
+	  ;;
+	esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+])# AC_PROG_NM
+
+
+# AC_CHECK_LIBM
+# -------------
+# check for math library
+AC_DEFUN([AC_CHECK_LIBM],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+  # These system don't have libm, or don't need it
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, cos, LIBM="-lm")
+  ;;
+esac
+])# AC_CHECK_LIBM
+
+
+# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl convenience library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-convenience to the configure arguments.  Note that
+# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
+# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
+# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
+# (note the single quotes!).  If your package is not flat and you're not
+# using automake, define top_builddir and top_srcdir appropriately in
+# the Makefiles.
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  case $enable_ltdl_convenience in
+  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+  "") enable_ltdl_convenience=yes
+      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+  esac
+  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_CONVENIENCE
+
+
+# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl installable library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-install to the configure arguments.  Note that
+# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
+# and an installed libltdl is not found, it is assumed to be `libltdl'.
+# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
+# '${top_srcdir}/' (note the single quotes!).  If your package is not
+# flat and you're not using automake, define top_builddir and top_srcdir
+# appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  AC_CHECK_LIB(ltdl, lt_dlinit,
+  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+  [if test x"$enable_ltdl_install" = xno; then
+     AC_MSG_WARN([libltdl not installed, but installation disabled])
+   else
+     enable_ltdl_install=yes
+   fi
+  ])
+  if test x"$enable_ltdl_install" = x"yes"; then
+    ac_configure_args="$ac_configure_args --enable-ltdl-install"
+    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  else
+    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+    LIBLTDL="-lltdl"
+    LTDLINCL=
+  fi
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_INSTALLABLE
+
+
+# AC_LIBTOOL_CXX
+# --------------
+# enable support for C++ libraries
+AC_DEFUN([AC_LIBTOOL_CXX],
+[AC_REQUIRE([_LT_AC_LANG_CXX])
+])# AC_LIBTOOL_CXX
+
+
+# _LT_AC_LANG_CXX
+# ---------------
+AC_DEFUN([_LT_AC_LANG_CXX],
+[AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
+])# _LT_AC_LANG_CXX
+
+# _LT_AC_PROG_CXXCPP
+# ------------------
+AC_DEFUN([_LT_AC_PROG_CXXCPP],
+[
+AC_REQUIRE([AC_PROG_CXX])
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  AC_PROG_CXXCPP
+fi
+])# _LT_AC_PROG_CXXCPP
+
+# AC_LIBTOOL_F77
+# --------------
+# enable support for Fortran 77 libraries
+AC_DEFUN([AC_LIBTOOL_F77],
+[AC_REQUIRE([_LT_AC_LANG_F77])
+])# AC_LIBTOOL_F77
+
+
+# _LT_AC_LANG_F77
+# ---------------
+AC_DEFUN([_LT_AC_LANG_F77],
+[AC_REQUIRE([AC_PROG_F77])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
+])# _LT_AC_LANG_F77
+
+
+# AC_LIBTOOL_GCJ
+# --------------
+# enable support for GCJ libraries
+AC_DEFUN([AC_LIBTOOL_GCJ],
+[AC_REQUIRE([_LT_AC_LANG_GCJ])
+])# AC_LIBTOOL_GCJ
+
+
+# _LT_AC_LANG_GCJ
+# ---------------
+AC_DEFUN([_LT_AC_LANG_GCJ],
+[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
+])# _LT_AC_LANG_GCJ
+
+
+# AC_LIBTOOL_RC
+# -------------
+# enable support for Windows resource files
+AC_DEFUN([AC_LIBTOOL_RC],
+[AC_REQUIRE([LT_AC_PROG_RC])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
+])# AC_LIBTOOL_RC
+
+
+# AC_LIBTOOL_LANG_C_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
+AC_DEFUN([_LT_AC_LANG_C_CONFIG],
+[lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF
+
+# Report which library types will actually be built
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case $host_os in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+    ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_C_CONFIG
+
+
+# AC_LIBTOOL_LANG_CXX_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
+AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
+[AC_LANG_PUSH(C++)
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Dependencies to place before and after the object being linked:
+_LT_AC_TAGVAR(predep_objects, $1)=
+_LT_AC_TAGVAR(postdep_objects, $1)=
+_LT_AC_TAGVAR(predeps, $1)=
+_LT_AC_TAGVAR(postdeps, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+  $as_unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+  lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+  $as_unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+else
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+  AC_PROG_LD
+
+  # Check if GNU C++ uses GNU ld as the underlying linker, since the
+  # archiving commands below assume that GNU ld is being used.
+  if test "$with_gnu_ld" = yes; then
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+    #     investigate it a little bit more. (MM)
+    wlarc='${wl}'
+
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+	grep 'no-whole-archive' > /dev/null; then
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    with_gnu_ld=no
+    wlarc=
+
+    # A generic and very simple default shared library creation
+    # command for GNU C++ for the case where it uses the native
+    # linker, instead of GNU ld.  If possible, this setting should
+    # overridden to take advantage of the native linker features on
+    # the platform it is being used on.
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+  fi
+
+  # Commands to make compiler produce verbose output that lists
+  # what "hidden" libraries, object files and flags are used when
+  # linking a shared library.
+  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+else
+  GXX=no
+  with_gnu_ld=no
+  wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  aix4* | aix5*)
+    if test "$host_cpu" = ia64; then
+      # On IA64, the linker does run time linking by default, so we don't
+      # have to do anything special.
+      aix_use_runtimelinking=no
+      exp_sym_flag='-Bexport'
+      no_entry_flag=""
+    else
+      aix_use_runtimelinking=no
+
+      # Test if we are trying to use run time linking or normal
+      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+      # need to do runtime linking.
+      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+	for ld_flag in $LDFLAGS; do
+	  case $ld_flag in
+	  *-brtl*)
+	    aix_use_runtimelinking=yes
+	    break
+	    ;;
+	  esac
+	done
+	;;
+      esac
+
+      exp_sym_flag='-bexport'
+      no_entry_flag='-bnoentry'
+    fi
+
+    # When large executables or shared objects are built, AIX ld can
+    # have problems creating the table of contents.  If linking a library
+    # or program results in "error TOC overflow" add -mminimal-toc to
+    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+    _LT_AC_TAGVAR(archive_cmds, $1)=''
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+    if test "$GXX" = yes; then
+      case $host_os in aix4.[[012]]|aix4.[[012]].*)
+      # We only want to do this on AIX 4.2 and lower, the check
+      # below for broken collect2 doesn't work under 4.3+
+	collect2name=`${CC} -print-prog-name=collect2`
+	if test -f "$collect2name" && \
+	   strings "$collect2name" | grep resolve_lib_name >/dev/null
+	then
+	  # We have reworked collect2
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	else
+	  # We have old collect2
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+	fi
+	;;
+      esac
+      shared_flag='-shared'
+      if test "$aix_use_runtimelinking" = yes; then
+	shared_flag="$shared_flag "'${wl}-G'
+      fi
+    else
+      # not using gcc
+      if test "$host_cpu" = ia64; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	shared_flag='-G'
+      else
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag='${wl}-G'
+	else
+	  shared_flag='${wl}-bM:SRE'
+	fi
+      fi
+    fi
+
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+    if test "$aix_use_runtimelinking" = yes; then
+      # Warning - without using the other runtime loading flags (-brtl),
+      # -berok will link without error, but may produce a broken library.
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      _LT_AC_SYS_LIBPATH_AIX
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+      else
+	# Determine the default libpath from the value encoded in an empty executable.
+	_LT_AC_SYS_LIBPATH_AIX
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	# Warning - without using the other run time loading flags,
+	# -berok will link without error, but may produce a broken library.
+	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	# Exported symbols can be pulled into shared objects from archives
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+	# This is similar to how AIX traditionally builds its shared libraries.
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+
+  beos*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+      # support --undefined.  This deserves some investigation.  FIXME
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+    ;;
+
+  chorus*)
+    case $cc_basename in
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+    # as there is no search path for DLLs.
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+    _LT_AC_TAGVAR(always_export_symbols, $1)=no
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	cp $export_symbols $output_objdir/$soname.def;
+      else
+	echo EXPORTS > $output_objdir/$soname.def;
+	cat $export_symbols >> $output_objdir/$soname.def;
+      fi~
+      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+  ;;
+      darwin* | rhapsody*)
+        case $host_os in
+        rhapsody* | darwin1.[[012]])
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[[012]])
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      else
+          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+        fi
+        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+          ;;
+      esac
+      fi
+        ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++*)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      ghcx*)
+	# Green Hills C++ Compiler
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  freebsd[[12]]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  freebsd-elf*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    ;;
+  freebsd* | kfreebsd*-gnu | dragonfly*)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+				# but as the default
+				# location of the library.
+
+    case $cc_basename in
+    CC*)
+      # FIXME: insert proper C++ library support
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    aCC*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      #
+      # There doesn't appear to be a way to prevent this compiler from
+      # explicitly linking system object files so we need to strip them
+      # from the output so that they don't get included in the library
+      # dependencies.
+      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+        # FIXME: insert proper C++ library support
+        _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+      case $host_cpu in
+      hppa*64*|ia64*)
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+        ;;
+      *)
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        ;;
+      esac
+    fi
+    case $host_cpu in
+    hppa*64*|ia64*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+    *)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    esac
+
+    case $cc_basename in
+      CC*)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      aCC*)
+	case $host_cpu in
+	hppa*64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	  ;;
+	ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	  ;;
+	*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	  ;;
+	esac
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test $with_gnu_ld = no; then
+	    case $host_cpu in
+	    hppa*64*)
+	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      ;;
+	    ia64*)
+	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      ;;
+	    *)
+	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      ;;
+	    esac
+	  fi
+	else
+	  # FIXME: insert proper C++ library support
+	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  interix3*)
+    _LT_AC_TAGVAR(hardcode_direct, $1)=no
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+    # Instead, shared libraries are loaded at an image base (0x10000000 by
+    # default) and relocated if they conflict, which is a slow very memory
+    # consuming and fragmenting process.  To avoid this, we pick a random,
+    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC*)
+	# SGI C++
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	# Archives containing C++ object files must be created using
+	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+	# necessary to make sure instantiated templates are included
+	# in the archive.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test "$with_gnu_ld" = no; then
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	  else
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+	  fi
+	fi
+	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+	;;
+    esac
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    ;;
+  linux*)
+    case $cc_basename in
+      KCC*)
+	# Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	# KCC will only create a shared library if the output file
+	# ends with ".so" (or ".sl" for HP-UX), so rename the library
+	# to its proper name (with version) after linking.
+	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+	;;
+      icpc*)
+	# Intel C++
+	with_gnu_ld=yes
+	# version 8.0 and above of icpc choke on multiply defined symbols
+	# if we add $predep_objects and $postdep_objects, however 7.1 and
+	# earlier do not add the objects themselves.
+	case `$CC -V 2>&1` in
+	*"Version 7."*)
+  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+  	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  ;;
+	*)  # Version 8.0 or newer
+	  tmp_idyn=
+	  case $host_cpu in
+	    ia64*) tmp_idyn=' -i_dynamic';;
+	  esac
+  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  ;;
+	esac
+	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	;;
+      pgCC*)
+        # Portland Group C++ compiler
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+  	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+        ;;
+      cxx*)
+	# Compaq C++
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+	runpath_var=LD_RUN_PATH
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx*)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    fi
+    # Workaround some broken pre-1.5 toolchains
+    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+    ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  openbsd*)
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
+  osf3*)
+    case $cc_basename in
+      KCC*)
+	# Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	# KCC will only create a shared library if the output file
+	# ends with ".so" (or ".sl" for HP-UX), so rename the library
+	# to its proper name (with version) after linking.
+	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+
+	;;
+      RCC*)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      cxx*)
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	  # Commands to make compiler produce verbose output that lists
+	  # what "hidden" libraries, object files and flags are used when
+	  # linking a shared library.
+	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+	else
+	  # FIXME: insert proper C++ library support
+	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  osf4* | osf5*)
+    case $cc_basename in
+      KCC*)
+	# Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	# KCC will only create a shared library if the output file
+	# ends with ".so" (or ".sl" for HP-UX), so rename the library
+	# to its proper name (with version) after linking.
+	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Archives containing C++ object files must be created using
+	# the KAI C++ compiler.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
+	;;
+      RCC*)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      cxx*)
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+	  echo "-hidden">> $lib.exp~
+	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
+	  $rm $lib.exp'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	  # Commands to make compiler produce verbose output that lists
+	  # what "hidden" libraries, object files and flags are used when
+	  # linking a shared library.
+	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+	else
+	  # FIXME: insert proper C++ library support
+	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC*)
+	# Sun C++ 4.x
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      lcc*)
+	# Lucid
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC*)
+	# Sun C++ 4.2, 5.x and Centerline C++
+        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
+	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	$CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	case $host_os in
+	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+	  *)
+	    # The C++ compiler is used as linker so we must use $wl
+	    # flag to pass the commands to the underlying system
+	    # linker. We must also pass each convience library through
+	    # to the system linker between allextract/defaultextract.
+	    # The C++ compiler will combine linker options so we
+	    # cannot just pass the convience library names through
+	    # without $wl.
+	    # Supported since Solaris 2.6 (maybe 2.5.1?)
+	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+	    ;;
+	esac
+	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+	output_verbose_link_cmd='echo'
+
+	# Archives containing C++ object files must be created using
+	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	# necessary to make sure instantiated templates are included
+	# in the archive.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	;;
+      gcx*)
+	# Green Hills C++ Compiler
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+	# The C++ compiler must be used to create the archive.
+	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	;;
+      *)
+	# GNU C++ compiler with Solaris linker
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+	  if $CC --version | grep -v '^2\.7' > /dev/null; then
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+	  else
+	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	    # platform.
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+	  fi
+
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+	fi
+	;;
+    esac
+    ;;
+  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    runpath_var='LD_RUN_PATH'
+
+    case $cc_basename in
+      CC*)
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      *)
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+    esac
+    ;;
+  sysv5* | sco3.2v5* | sco5v6*)
+    # Note: We can NOT use -z defs as we might desire, because we do not
+    # link with -lc, and that would cause any symbols used from libc to
+    # always be unresolved, which means just about no library would
+    # ever link correctly.  If we're not using GNU ld we use -z text
+    # though, which does catch some bad symbols but isn't as heavy-handed
+    # as -z defs.
+    # For security reasons, it is highly recommended that you always
+    # use absolute paths for naming shared libraries, and exclude the
+    # DT_RUNPATH tag from executables and libraries.  But doing so
+    # requires that you compile everything twice, which is a pain.
+    # So that behaviour is only enabled if SCOABSPATH is set to a
+    # non-empty value in the environment.  Most likely only useful for
+    # creating official distributions of packages.
+    # This is a hack until libtool officially supports absolute path
+    # names for shared libraries.
+    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+    runpath_var='LD_RUN_PATH'
+
+    case $cc_basename in
+      CC*)
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      *)
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+    esac
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC*)
+	# NonStop-UX NCC 3.20
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+esac
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$GXX"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_POSTDEP_PREDEP($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+])# AC_LIBTOOL_LANG_CXX_CONFIG
+
+# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
+# ------------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library.  It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
+int a;
+void foo (void) { a = 0; }
+EOF
+],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+],[$1],[F77],[cat > conftest.$ac_ext <<EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+EOF
+],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
+
+  for p in `eval $output_verbose_link_cmd`; do
+    case $p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" \
+	  || test $p = "-R"; then
+	 prev=$p
+	 continue
+       else
+	 prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 case $p in
+	 -L* | -R*)
+	   # Internal compiler library paths should come after those
+	   # provided the user.  The postdeps already come after the
+	   # user supplied libs so there is no need to process them.
+	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+	   else
+	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+	   fi
+	   ;;
+	 # The "-l" case would never come before the object being
+	 # linked, so don't bother handling this case.
+	 esac
+       else
+	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
+	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
+	 else
+	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
+	 fi
+       fi
+       ;;
+
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+	 pre_test_object_deps_done=yes
+	 continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
+	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
+	 else
+	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
+	 fi
+       else
+	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
+	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
+	 else
+	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$rm -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+ifelse([$1],[CXX],
+[case $host_os in
+interix3*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  _LT_AC_TAGVAR(predep_objects,$1)=
+  _LT_AC_TAGVAR(postdep_objects,$1)=
+  _LT_AC_TAGVAR(postdeps,$1)=
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC*)
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
+    ;;
+  esac
+  ;;
+esac
+])
+
+case " $_LT_AC_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+])# AC_LIBTOOL_POSTDEP_PREDEP
+
+# AC_LIBTOOL_LANG_F77_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
+AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
+[AC_REQUIRE([AC_PROG_F77])
+AC_LANG_PUSH(Fortran 77)
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case $host_os in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+  ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+_LT_AC_TAGVAR(GCC, $1)="$G77"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_F77_CONFIG
+
+
+# AC_LIBTOOL_LANG_GCJ_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
+AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_GCJ_CONFIG
+
+
+# AC_LIBTOOL_LANG_RC_CONFIG
+# -------------------------
+# Ensure that the configuration vars for the Windows resource compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
+AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_RC_CONFIG
+
+
+# AC_LIBTOOL_CONFIG([TAGNAME])
+# ----------------------------
+# If TAGNAME is not passed, then create an initial libtool script
+# with a default configuration from the untagged config vars.  Otherwise
+# add code to config.status for appending the configuration named by
+# TAGNAME from the matching tagged config vars.
+AC_DEFUN([AC_LIBTOOL_CONFIG],
+[# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    _LT_AC_TAGVAR(compiler, $1) \
+    _LT_AC_TAGVAR(CC, $1) \
+    _LT_AC_TAGVAR(LD, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
+    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
+    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
+    _LT_AC_TAGVAR(old_archive_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
+    _LT_AC_TAGVAR(predep_objects, $1) \
+    _LT_AC_TAGVAR(postdep_objects, $1) \
+    _LT_AC_TAGVAR(predeps, $1) \
+    _LT_AC_TAGVAR(postdeps, $1) \
+    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+    _LT_AC_TAGVAR(archive_cmds, $1) \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(postinstall_cmds, $1) \
+    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
+    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
+    _LT_AC_TAGVAR(no_undefined_flag, $1) \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
+    _LT_AC_TAGVAR(hardcode_automatic, $1) \
+    _LT_AC_TAGVAR(module_cmds, $1) \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+    _LT_AC_TAGVAR(exclude_expsyms, $1) \
+    _LT_AC_TAGVAR(include_expsyms, $1); do
+
+    case $var in
+    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
+    _LT_AC_TAGVAR(module_cmds, $1) | \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\[$]0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
+    ;;
+  esac
+
+ifelse([$1], [],
+  [cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  AC_MSG_NOTICE([creating $ofile])],
+  [cfgfile="$ofile"])
+
+  cat <<__EOF__ >> "$cfgfile"
+ifelse([$1], [],
+[#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e 1s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG],
+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
+
+# Is the compiler the GNU C compiler?
+with_gcc=$_LT_AC_TAGVAR(GCC, $1)
+
+gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
+gcc_ver=\`gcc -dumpversion\`
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=\`echo $lt_[]_LT_AC_TAGVAR(predep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=\`echo $lt_[]_LT_AC_TAGVAR(postdep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=\`echo $lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
+
+# Symbols that must always be exported.
+include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
+
+ifelse([$1],[],
+[# ### END LIBTOOL CONFIG],
+[# ### END LIBTOOL TAG CONFIG: $tagname])
+
+__EOF__
+
+ifelse([$1],[], [
+  case $host_os in
+  aix3*)
+    cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+EOF
+    ;;
+  esac
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+])
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+])# AC_LIBTOOL_CONFIG
+
+
+# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+
+_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
+
+
+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+# ---------------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_NM])
+AC_REQUIRE([AC_OBJEXT])
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+linux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDGIRSTW]]'
+    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris*)
+  symcode='[[BDRT]]'
+  ;;
+sco3.2v5*)
+  symcode='[[DT]]'
+  ;;
+sysv4.2uw2*)
+  symcode='[[DT]]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[[ABDT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+	mv -f "$nlist"T "$nlist"
+      else
+	rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if grep ' nm_test_var$' "$nlist" >/dev/null; then
+	if grep ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+	  cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[[]] =
+{
+EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+	  cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftstm.$ac_objext
+	  lt_save_LIBS="$LIBS"
+	  lt_save_CFLAGS="$CFLAGS"
+	  LIBS="conftstm.$ac_objext"
+	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+	    pipe_works=yes
+	  fi
+	  LIBS="$lt_save_LIBS"
+	  CFLAGS="$lt_save_CFLAGS"
+	else
+	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+    fi
+  else
+    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+    cat conftest.$ac_ext >&5
+  fi
+  rm -f conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  AC_MSG_RESULT(failed)
+else
+  AC_MSG_RESULT(ok)
+fi
+]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+
+
+# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
+# ---------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
+[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+ ifelse([$1],[CXX],[
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	;;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	else
+	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+	  ;;
+	esac
+	;;
+       darwin*)
+         # PIC is the default on this platform
+         # Common symbols not allowed in MH_DYLIB files
+         case $cc_basename in
+           xlc*)
+           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           ;;
+         esac
+       ;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | kfreebsd*-gnu | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    if test "$host_cpu" != ia64; then
+	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      interix*)
+	# This is c89, which is MS Visual C++ (no shared libs)
+	# Anyone wants to do a port?
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux*)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    ;;
+	  icpc* | ecpc*)
+	    # Intel C++
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;;
+	  pgCC*)
+	    # Portland Group C++ compiler.
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  cxx*)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+	case $cc_basename in
+	  CC*)
+	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	esac
+	;;
+      vxworks*)
+	;;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+	;;
+    esac
+  fi
+],
+[
+  if test "$GCC" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    newsos6)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      ccc*)
+        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    solaris*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    unicos*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
+    uts4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
+    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+  $lt_tmp_static_flag,
+  [],
+  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
+])
+
+
+# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
+# ------------------------------------
+# See if the linker supports building shared libraries.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
+[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ifelse([$1],[CXX],[
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+    else
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  *)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+],[
+  runpath_var=
+  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_AC_TAGVAR(archive_cmds, $1)=
+  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
+  _LT_AC_TAGVAR(module_cmds, $1)=
+  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
+  _LT_AC_TAGVAR(always_export_symbols, $1)=no
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_AC_TAGVAR(include_expsyms, $1)=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  _LT_CC_BASENAME([$compiler])
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+
+      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=no
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    interix3*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	esac
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) 
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+	  else
+	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+	  fi
+	;;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
+      runpath_var=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+	else
+	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
+
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# need to do runtime linking.
+	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+	  for ld_flag in $LDFLAGS; do
+  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+  	    aix_use_runtimelinking=yes
+  	    break
+  	  fi
+	  done
+	  ;;
+	esac
+
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      _LT_AC_TAGVAR(archive_cmds, $1)=''
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+      if test "$GCC" = yes; then
+	case $host_os in aix4.[[012]]|aix4.[[012]].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" && \
+  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
+	  then
+  	  # We have reworked collect2
+  	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	  else
+  	  # We have old collect2
+  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+  	  # It fails to find uninstalled libraries when the uninstalled
+  	  # path is not listed in the libpath.  Setting hardcode_minus_L
+  	  # to unsupported forces relinking
+  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+  	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='${wl}-G'
+	  else
+	    shared_flag='${wl}-bM:SRE'
+	  fi
+	fi
+      fi
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       _LT_AC_SYS_LIBPATH_AIX
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 _LT_AC_SYS_LIBPATH_AIX
+	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	  # Exported symbols can be pulled into shared objects from archives
+	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      # see comment about different semantics on the GNU ld section
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    bsdi[[45]]*)
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+      # FIXME: Should let the user specify the lib program.
+      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[[012]])
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[[012]])
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+    if test "$GCC" = yes ; then
+    	output_verbose_link_cmd='echo'
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    freebsd1*)
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      else
+	case $host_cpu in
+	hppa*64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  ;;
+	*)
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    openbsd*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	   ;;
+	 *)
+	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    solaris*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	wlarc=''
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
+      esac
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+        ;;
+	motorola)
+	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_AC_TAGVAR(archive_cmds, $1) in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+        then
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+        else
+	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+        fi
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+      ;;
+    esac
+  fi
+  ;;
+esac
+])# AC_LIBTOOL_PROG_LD_SHLIBS
+
+
+# _LT_AC_FILE_LTDLL_C
+# -------------------
+# Be careful that the start marker always follows a newline.
+AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# #  ifdef __CYGWIN32__
+# #    define __CYGWIN__ __CYGWIN32__
+# #  endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+#   __hDllInstance_base = hInst;
+#   return TRUE;
+# }
+# /* ltdll.c ends here */
+])# _LT_AC_FILE_LTDLL_C
+
+
+# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
+# ---------------------------------
+AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+
+
+# old names
+AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
+AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
+AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
+AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
+
+# This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])
+
+AC_DEFUN([LT_AC_PROG_GCJ],
+[AC_CHECK_TOOL(GCJ, gcj, no)
+  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+  AC_SUBST(GCJFLAGS)
+])
+
+AC_DEFUN([LT_AC_PROG_RC],
+[AC_CHECK_TOOL(RC, windres, no)
+])
+
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+AC_DEFUN([LT_AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f $lt_ac_sed && continue
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test $lt_ac_count -gt 10 && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test $lt_ac_count -gt $lt_ac_max; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])
+
+# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+	 [AM_AUTOMAKE_VERSION([1.9.6])])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 7
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 3
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # So let's grep whole file.
+  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+    dirpart=`AS_DIRNAME("$mf")`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`AS_DIRNAME(["$file"])`
+    AS_MKDIR_P([$dirpart/$fdir])
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 12
+
+# This macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.58])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+	      		     [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $1 | $1:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot.  For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes.	            -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Copyright (C) 1999, 2000, 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_PROG_CC_C_O
+# --------------
+# Like AC_PROG_CC_C_O, but changed for automake.
+AC_DEFUN([AM_PROG_CC_C_O],
+[AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
+#
+# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
+# created by `make install' are always world readable, even if the
+# installer happens to have an overly restrictive umask (e.g. 077).
+# This was a mistake.  There are at least two reasons why we must not
+# use `-m 0755':
+#   - it causes special bits like SGID to be ignored,
+#   - it may be too restrictive (some setups expect 775 directories).
+#
+# Do not use -m 0755 and let people choose whatever they expect by
+# setting umask.
+#
+# We cannot accept any implementation of `mkdir' that recognizes `-p'.
+# Some implementations (such as Solaris 8's) are not thread-safe: if a
+# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
+# concurrently, both version can detect that a/ is missing, but only
+# one can create it and the other will error out.  Consequently we
+# restrict ourselves to GNU make (using the --version option ensures
+# this.)
+AC_DEFUN([AM_PROG_MKDIR_P],
+[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
+  #   $(mkdir_p) $(somedir)
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
+else
+  # On NextStep and OpenStep, the `mkdir' command does not
+  # recognize any option.  It will interpret all options as
+  # directories to create, and then abort because `.' already
+  # exists.
+  for d in ./-p ./--version;
+  do
+    test -d $d && rmdir $d
+  done
+  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+  if test -f "$ac_aux_dir/mkinstalldirs"; then
+    mkdir_p='$(mkinstalldirs)'
+  else
+    mkdir_p='$(install_sh) -d'
+  fi
+fi
+AC_SUBST([mkdir_p])])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+#     $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([config/ac_dart.m4])
+m4_include([config/ac_datatap.m4])
+m4_include([config/ac_dimes.m4])
+m4_include([config/ac_dmalloc.m4])
+m4_include([config/ac_hdf5.m4])
+m4_include([config/ac_infiniband.m4])
+m4_include([config/ac_mxml.m4])
+m4_include([config/ac_nc4par.m4])
+m4_include([config/ac_netcdf.m4])
+m4_include([config/ac_nssi.m4])
+m4_include([config/ac_pablo.m4])
+m4_include([config/ac_phdf5.m4])
+m4_include([config/ac_portals.m4])
+m4_include([config/acx_mpi.m4])
+m4_include([config/acx_pthread.m4])
+m4_include([config/cercs.m4])
diff --git a/adios_config b/adios_config
new file mode 100755
index 0000000..030c271
--- /dev/null
+++ b/adios_config
@@ -0,0 +1,123 @@
+#!/bin/bash
+#
+# Print compiler/linker flags to use ADIOS
+
+#
+# Configuration values from configure script
+#
+
+FLAGSFILE=`dirname $0`/adios_config.flags
+if [ ! -f ${FLAGSFILE} ]; then
+    echo "ERROR: settings file ${FLAGSFILE} not found."
+    exit 1
+fi
+. ${FLAGSFILE}
+
+function Usage () {
+    echo "`basename $0` [-d | -c | -l] [-f] [-r] [-s]
+Arguments
+   -d   Print base directory for ADIOS install
+   -c   Print compiler flags for C/C++, using ADIOS write/read methods
+   -l   Print linker flags for C/C++, using ADIOS write/read methods
+   -f   Print above flags for Fortran90
+   -r   Print above flags for using ADIOS read library only.
+   -s   Print above flags for using ADIOS read library only and
+          in a sequential code (no MPI). 
+          -r is implicit for -s, because the write API is parallel-only. 
+Notes
+   - Multiple options of d,c,l are enabled. In such a case, the output is
+     a list of FLAG=flags, where FLAG is one of (DIR, CFLAGS, LDFLAGS)
+   - If none of d,c,l are given, all of them is printed
+   - If none of f,r,s are given, flags for C/C++, using ADIOS write/read 
+     methods are printed
+"
+}
+
+# default
+PRINT_DIR=no
+PRINT_CFLAGS=no
+PRINT_LDFLAGS=no
+OPT_FORTRAN=no
+OPT_READ=no
+OPT_SEQ=no
+NFLAGS_ASKED=0
+
+while getopts ":dclfrsh" Option
+do          
+  case $Option in               
+        d) PRINT_DIR=yes; let "NFLAGS_ASKED=NFLAGS_ASKED+1";;
+        c) PRINT_CFLAGS=yes; let "NFLAGS_ASKED=NFLAGS_ASKED+1";;
+        l) PRINT_LDFLAGS=yes; let "NFLAGS_ASKED=NFLAGS_ASKED+1";;
+        f) OPT_FORTRAN=yes;;
+        r) OPT_READ=yes;;
+        s) OPT_SEQ=yes;;
+        h) Usage; exit 0;;
+        *) echo "Invalid option -$Option."; Usage; exit 255;;   # DEFAULT
+  esac
+done
+shift $(($OPTIND - 1))
+
+if [ $NFLAGS_ASKED == 0 ]; then
+    NFLAGS_ASKED=3;
+    PRINT_DIR=yes
+    PRINT_CFLAGS=yes
+    PRINT_LDFLAGS=yes
+fi
+
+if [ "$OPT_SEQ" == "yes" ]; then
+    OPT_READ=yes
+fi
+
+# Print requested values
+if [ "$PRINT_DIR" == "yes" ]; then
+    if [ $NFLAGS_ASKED -gt 1 ]; then
+        echo -n "DIR="
+    fi
+    echo $ADIOS_DIR
+fi
+
+if [ "$PRINT_CFLAGS" == "yes" ]; then
+    if [ "$OPT_READ" == "yes" ]; then
+        if [ "$OPT_SEQ" == "yes" ]; then
+            CFLAGS="$ADIOSREAD_SEQ_INC"
+        else
+            CFLAGS="$ADIOSREAD_INC"
+        fi 
+    else
+        CFLAGS="$ADIOS_INC"
+    fi
+    if [ $NFLAGS_ASKED -gt 1 ]; then
+        echo -n "CFLAGS="
+    fi
+    echo $CFLAGS
+fi
+
+if [ "$PRINT_LDFLAGS" == "yes" ]; then
+    if [ "$OPT_SEQ" == "yes" ]; then
+        if [ "$OPT_FORTRAN" == "yes" ]; then
+            LDFLAGS="$ADIOSREAD_SEQ_FLIB"
+        else
+            LDFLAGS="$ADIOSREAD_SEQ_CLIB"
+        fi
+    elif [ "$OPT_READ" == "yes" ]; then
+        if [ "$OPT_FORTRAN" == "yes" ]; then
+            LDFLAGS="$ADIOSREAD_FLIB"
+        else
+            LDFLAGS="$ADIOSREAD_CLIB"
+        fi
+    else
+        if [ "$OPT_FORTRAN" == "yes" ]; then
+            LDFLAGS="$ADIOS_FLIB"
+        else
+            LDFLAGS="$ADIOS_CLIB"
+        fi
+    fi 
+    if [ $NFLAGS_ASKED -gt 1 ]; then
+        echo -n "LDFLAGS="
+    fi
+    echo $LDFLAGS
+fi
+
+
+
+
diff --git a/adios_config.flags.in b/adios_config.flags.in
new file mode 100755
index 0000000..dfdea3b
--- /dev/null
+++ b/adios_config.flags.in
@@ -0,0 +1,26 @@
+#
+# Configuration values from configure script
+#
+
+# Install directory
+ADIOS_DIR="@prefix@"
+
+# Flags to build code using ADIOS write API (and read API)
+ADIOS_INC="-I${ADIOS_DIR}/include @ADIOSLIB_CPPFLAGS@ @ADIOSLIB_CFLAGS@"
+ADIOS_CLIB="-L${ADIOS_DIR}/lib -ladios @ADIOSLIB_LDFLAGS@ @ADIOSLIB_LDADD@ @LDFLAGS@ @LIBS@"
+ADIOS_FLIB="-L${ADIOS_DIR}/lib -ladiosf @ADIOSLIB_LDFLAGS@ @ADIOSLIB_LDADD@ @LDFLAGS@ @LIBS@"
+
+# Flags to build code using ADIOS read API only
+ADIOSREAD_INC="-I${ADIOS_DIR}/include @ADIOSREADLIB_CPPFLAGS@ @ADIOSREADLIB_CFLAGS@"
+ADIOSREAD_CLIB="-L${ADIOS_DIR}/lib -ladiosread @ADIOSREADLIB_LDFLAGS@ @ADIOSREADLIB_LDADD@"
+ADIOSREAD_FLIB="-L${ADIOS_DIR}/lib -ladiosreadf @ADIOSREADLIB_LDFLAGS@ @ADIOSREADLIB_LDADD@"
+
+# Flags to build code using ADIOS read API only in a sequential code (no MPI)
+ADIOSREAD_SEQ_INC="-I${ADIOS_DIR}/include @ADIOSREADLIB_SEQ_CPPFLAGS@ @ADIOSREADLIB_SEQ_CFLAGS@"
+ADIOSREAD_SEQ_CLIB="-L${ADIOS_DIR}/lib -ladiosread_nompi @ADIOSREADLIB_SEQ_LDFLAGS@ @ADIOSREADLIB_SEQ_LDADD@"
+ADIOSREAD_SEQ_FLIB="-L${ADIOS_DIR}/lib -ladiosreadf_nompi @ADIOSREADLIB_SEQ_LDFLAGS@ @ADIOSREADLIB_SEQ_LDADD@"
+
+#The following flags are not used. It is only for internal utilities of ADIOS, using libadios_internal_nompi.a
+ADIOS_SEQ_INC="-I${ADIOS_DIR}/include @ADIOSLIB_SEQ_CPPFLAGS@ @ADIOSLIB_SEQ_CFLAGS@"
+ADIOS_SEQ_CLIB="-L${ADIOS_DIR}/lib -ladios_internal_nompi @ADIOSLIB_SEQ_LDFLAGS@ @ADIOSLIB_SEQ_LDADD@ @LDFLAGS@ @LIBS@"
+
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 0000000..433243b
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,214 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to dummy `main' function (if any) required to link to the Fortran
+   libraries. */
+#undef FC_DUMMY_MAIN
+
+/* Define if F77 and FC dummy `main' functions are identical. */
+#undef FC_DUMMY_MAIN_EQ_F77
+
+/* Define to a macro mangling the given C identifier (in lower and upper
+   case), which must not contain underscores, for linking with Fortran. */
+#undef FC_FUNC
+
+/* As FC_FUNC, but for C identifiers containing underscores. */
+#undef FC_FUNC_
+
+/* Define to 1 if your Fortran compiler doesn't accept -c and -o together. */
+#undef FC_NO_MINUS_C_MINUS_O
+
+/* Define to 1 if you have the <Attributes.h> header file. */
+#undef HAVE_ATTRIBUTES_H
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#undef HAVE_CLOCK_GETTIME
+
+/* Define if you have Cray Portals. */
+#undef HAVE_CRAY_PORTALS
+
+/* Define if you have the DART. */
+#undef HAVE_DART
+
+/* Define to 1 if you have the <dart.h> header file. */
+#undef HAVE_DART_H
+
+/* Define if you have the DIMES. */
+#undef HAVE_DIMES
+
+/* Define to 1 if you have the <dimes.h> header file. */
+#undef HAVE_DIMES_H
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define if you have DMALLOC. */
+#undef HAVE_DMALLOC
+
+/* Define to 1 if you have the <dmalloc.h> header file. */
+#undef HAVE_DMALLOC_H
+
+/* Define to 1 if you have the `fdatasync' function. */
+#undef HAVE_FDATASYNC
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define if you have HDF5. */
+#undef HAVE_HDF5
+
+/* Define to 1 if you have the <hdf5.h> header file. */
+#undef HAVE_HDF5_H
+
+/* Define to 1 if you have <infiniband/verbs.h>. */
+#undef HAVE_IBVERBS_H
+
+/* Define if you have the Infiniband. */
+#undef HAVE_INFINIBAND
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `rt' library (-lrt). */
+#undef HAVE_LIBRT
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define if you have the MPI library. */
+#undef HAVE_MPI
+
+/* Define if you have the MXML. */
+#undef HAVE_MXML
+
+/* Define to 1 if you have the <mxml.h> header file. */
+#undef HAVE_MXML_H
+
+/* Define if you have NC4PAR. */
+#undef HAVE_NC4PAR
+
+/* Define if you have NETCDF. */
+#undef HAVE_NETCDF
+
+/* Define to 1 if you have the <netcdf.h> header file. */
+#undef HAVE_NETCDF_H
+
+/* Define if you have NSSI. */
+#undef HAVE_NSSI
+
+/* Define to 1 if you have the <p3nal_utcp.h> header file. */
+#undef HAVE_P3NAL_UTCP_H
+
+/* Define to 1 if you have the <p3rt/p3rt.h> header file. */
+#undef HAVE_P3RT_P3RT_H
+
+/* Define if you have the Pablo. */
+#undef HAVE_PABLO
+
+/* Define if you have PHDF5. */
+#undef HAVE_PHDF5
+
+/* Define if you have the Portals. */
+#undef HAVE_PORTALS
+
+/* Define to 1 if you have <portals3.h>. */
+#undef HAVE_PORTALS3_H
+
+/* Define to 1 if you have <portals/portals3.h>. */
+#undef HAVE_PORTALS_PORTALS3_H
+
+/* Define if you have POSIX threads libraries and header files. */
+#undef HAVE_PTHREAD
+
+/* Define to 1 if you have the `pthread_yield' function. */
+#undef HAVE_PTHREAD_YIELD
+
+/* Define to 1 if you have the `PtlACEntry' function. */
+#undef HAVE_PTLACENTRY
+
+/* Define to 1 if you have the `PtlErrorStr' function. */
+#undef HAVE_PTLERRORSTR
+
+/* Define to 1 if you have the `PtlEventKindStr' function. */
+#undef HAVE_PTLEVENTKINDSTR
+
+/* Define to 1 if you have the `PtlGetJid' function. */
+#undef HAVE_PTLGETJID
+
+/* Define to 1 if you have the `PtlNIFailStr' function. */
+#undef HAVE_PTLNIFAILSTR
+
+/* Define to 1 if the system has the type `ptl_eq_handler_t'. */
+#undef HAVE_PTL_EQ_HANDLER_T
+
+/* Define if you have PTL_NOACK_REQ. */
+#undef HAVE_PTL_NOACK_REQ
+
+/* Define if you have PTL_NO_ACK_REQ. */
+#undef HAVE_PTL_NO_ACK_REQ
+
+/* Define to 1 if the system has the type `ptl_time_t'. */
+#undef HAVE_PTL_TIME_T
+
+/* Define to 1 if you have the `sched_yield' function. */
+#undef HAVE_SCHED_YIELD
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if cpp supports the ANSI # stringizing operator. */
+#undef HAVE_STRINGIZE
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Datatap is disabled */
+#undef NO_DATATAP
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to the necessary symbol if this constant uses a non-standard name on
+   your system. */
+#undef PTHREAD_CREATE_JOINABLE
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Need to use MPI compiler for sequential utils */
+#undef USE_PARALLEL_COMPILER
+
+/* Version number of package */
+#undef VERSION
diff --git a/config/ac_dart.m4 b/config/ac_dart.m4
new file mode 100644
index 0000000..34ccd08
--- /dev/null
+++ b/config/ac_dart.m4
@@ -0,0 +1,116 @@
+#
+#
+# AC_PROG_DART
+#
+# Test for DART installation
+# and set $DART to the correct value.
+#
+#
+dnl @synopsis AC_PROG_DART
+dnl
+dnl This macro test if DART is installed. If DART
+dnl is installed, it set $DART to the right value
+dnl
+dnl @version 1.0
+dnl @author Norbert Podhorszki, pnorbert at ornl.gov
+dnl
+AC_DEFUN([AC_PROG_DART],[
+
+AM_CONDITIONAL(HAVE_DART,true)
+
+AC_ARG_WITH(dart,
+        [AS_HELP_STRING([--with-dart=DIR],
+           [Build the DART transport method. Point to the DART installation.])],
+        [DART_LDFLAGS="-L$withval/lib";
+         DART_CPPFLAGS="-I$withval/include";],
+        [with_dart=check])
+
+dnl If --without-dart was given set HAVE_DART to false and do nothing more
+if test "x$with_dart" == "xno"; then
+
+   AM_CONDITIONAL(HAVE_DART,false)
+
+else
+
+    dnl allow args --with-dart incdir and --with-dart-libdir
+    AC_ARG_WITH(dart-incdir,
+                [  --with-dart-incdir=<location of dart includes>],
+                [DART_INCDIR=$withval
+                 with_dart=detailed])
+    
+    AC_ARG_WITH(dart-libdir,
+                [  --with-dart-libdir=<location of dart library>],
+                [DART_LIBDIR=$withval
+                 with_dart=detailed])
+    
+    
+    dnl If we know DART_DIR, then we can know DART_INCDIR.
+    dnl We don't overwrite DART_INCDIR.
+    if test -n "${DART_DIR}" -a -z "${DART_INCDIR}"; then
+            DART_INCDIR="${DART_DIR}/include";
+    dnl We may have DART denoting the dir (e.g. on ewok BUT on franklin it contains all flags)
+    elif test -n "${DART}" -a -d "${DART}"; then
+            DART_INCDIR="${DART}/include"
+    fi
+
+    dnl If we know DART_DIR, then we can know DART_LIBDIR.
+    dnl We don't overwrite DART_LIBDIR.
+    if test -n "${DART_DIR}" -a -z "${DART_LIBDIR}"; then
+            DART_LIBDIR="${DART_DIR}/lib";
+    dnl We may have DART denoting the dir (e.g. on ewok BUT on franklin it contains all flags)
+    elif test -n "${DART}" -a -d "${DART}"; then
+            DART_LIBDIR="${DART}/lib"
+    fi
+
+    dnl Add "-I" to DART_INCDIR.
+    if test -n "${DART_INCDIR}"; then
+            DART_CPPFLAGS="-I${DART_INCDIR}"
+    else
+            ac_dart_ok=no
+    fi
+
+    dnl Add "-L" to DART_LIBDIR.
+    if test -n "${DART_LIBDIR}"; then
+            DART_LDFLAGS="-L${DART_LIBDIR}"
+    else
+            ac_dart_ok=no
+    fi
+
+    save_CPPFLAGS="$CPPFLAGS"
+    save_LIBS="$LIBS"
+    save_LDFLAGS="$LDFLAGS"
+    LIBS="$LIBS -ldart2 -lspaces"
+    LDFLAGS="$LDFLAGS $DART_LDFLAGS"
+    CPPFLAGS="$CPPFLAGS $DART_CPPFLAGS"
+    
+    if test -z "${HAVE_DART_TRUE}"; then
+            AC_CHECK_HEADERS(dart.h,
+                    ,
+                    [AM_CONDITIONAL(HAVE_DART,false)])
+    fi
+    
+    # Check for the Mini-XML library and headers
+    AC_TRY_COMPILE([#include "dart.h"],
+            [int err; err = dart_init(1,1);],
+            [DART_LIBS="-ldart2 -lspaces"],
+            [AM_CONDITIONAL(HAVE_DART,false)])
+    
+    LIBS="$save_LIBS"
+    LDFLAGS="$save_LDFLAGS"
+    CPPFLAGS="$save_CPPFLAGS"
+    
+    AC_SUBST(DART_LIBS)
+    AC_SUBST(DART_LDFLAGS)
+    AC_SUBST(DART_CPPFLAGS)
+    
+    # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+    if test -z "${HAVE_DART_TRUE}"; then
+            ifelse([$1],,[AC_DEFINE(HAVE_DART,1,[Define if you have the DART.])],[$1])
+            :
+    else
+            $2
+            :
+    fi
+
+fi
+])dnl AC_DART
diff --git a/config/ac_datatap.m4 b/config/ac_datatap.m4
new file mode 100644
index 0000000..dd0d915
--- /dev/null
+++ b/config/ac_datatap.m4
@@ -0,0 +1,142 @@
+
+AC_DEFUN([AC_DATATAP], [
+
+AC_REQUIRE([AC_INFINIBAND])
+AC_REQUIRE([AC_PORTALS])
+
+dnl give an option to the user to enable datatap (with either ib or portals)
+dnl by default datatap will be disabled
+
+DT_SRCDIR=""
+DT_CPPFLAGS=""
+DT_LDFLAGS=""
+DT_LIBS=""
+
+datatap=disable
+
+temptest=enable
+
+datatap_dir=""
+
+
+AC_ARG_WITH(datatap, 
+	[  --with-datatap=DIR 	Location of DataTap], 
+	[ ac_with_datatap=$withval], [with_datatap=no])
+
+if test "x$with_datatap" = "xno"; then
+	AC_DEFINE(NO_DATATAP, 1, [Datatap is disabled])
+	datatap=disable
+	temptest=disable
+
+elif test x"$with_datatap" = xyes -o x"$with_datatap" = xcheck; then
+		
+	AC_DEFINE(NO_DATATAP, 0, [Datatap is disabled])
+
+	if test x"$ac_with_infiniband" = xyes; then
+		CERCS_REQUIRE_PACKAGE(ibpbio, thin_ib.h, libibclient.la)
+		CERCS_REQUIRE_PACKAGE(ffs, ffs.h, libffs.la)
+		CERCS_REQUIRE_PACKAGE(gen_thread, gen_thread.h, libgen_thread.la)
+		if test -n "$cercs_cv_ibpbio_link_dir";then
+			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ibpbio_link_dir"
+			DT_LIBS="$DT_LIBS -libclient"
+			datatap=ibverbs
+		else
+			temptest=disable
+		fi
+		if test -n "$cercs_cv_ffs_link_dir";then
+                   	DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ffs_link_dir"
+			DT_LIBS="$DT_LIBS -lgen_thread"
+			datatap=ibverbs
+		else
+			temptest=disable
+		fi
+		if test -n "$cercs_cv_gen_thread_link_dir";then
+			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_gen_thread_link_dir"
+			DT_LIBS="$DT_LIBS -lgen_thread"
+			datatap=ibverbs
+		else
+			temptest=disable
+		fi		
+				
+        elif test x"$ac_with_portals" = xyes; then
+		CERCS_REQUIRE_PACKAGE(ptlpbio, thin_portal.h, libptlclient.a)
+
+		if test -n "$cercs_cv_ptlpbio_link_dir";then
+			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ptlpbio_link_dir"
+			DT_LIBS="$DT_LIBS -lptlclient"
+			datatap=portals
+		else
+			temptest=disable
+		fi
+
+	else
+		echo "Neither portals nor infiniband found. Disabling datatap"
+		AC_DEFINE(NO_DATATAP, 1, [Datatap is disabled])
+		datatap=disable
+		temptest=disable
+	fi
+else
+dnl directory given .. add it to search path with CERCS_REQUIRE_PACKAGE
+	AC_MSG_NOTICE([Datatap with custom library path: $withval])
+	
+	datatap_dir=$withval
+
+	AC_DEFINE(NO_DATATAP, 0, [Datatap is disabled])
+
+	if test x"$ac_with_infiniband" = xyes; then
+		CERCS_REQUIRE_PACKAGE(ibpbio, thin_ib.h, libibclient.la)
+		CERCS_REQUIRE_PACKAGE(ffs, ffs.h, libffs.la)
+		CERCS_REQUIRE_PACKAGE(gen_thread, gen_thread.h, libgen_thread.la)
+		if test -n "$cercs_cv_ibpbio_link_dir";then
+			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ibpbio_link_dir"
+			DT_LIBS="$DT_LIBS -libclient"
+			datatap=ibverbs
+		else
+			temptest=disable
+		fi
+		if test -n "$cercs_cv_ffs_link_dir";then
+			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ffs_link_dir"
+			DT_LIBS="$DT_LIBS -lgen_thread"
+			datatap=ibverbs
+		else
+			temptest=disable
+		fi
+		if test -n "$cercs_cv_gen_thread_link_dir";then
+			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_gen_thread_link_dir"
+			DT_LIBS="$DT_LIBS -lgen_thread"
+			datatap=ibverbs
+		else
+			temptest=disable
+		fi		
+				
+        elif test x"$ac_with_portals" = xyes; then
+		CERCS_REQUIRE_PACKAGE(ptlpbio, thin_portal.h, libptlclient.a)
+
+		if test -n "$cercs_cv_ptlpbio_link_dir";then
+			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ptlpbio_link_dir"
+			DT_LIBS="$DT_LIBS -lptlclient"
+			datatap=portals
+		else
+			temptest=disable
+		fi
+
+	else
+		echo "Neither portals nor infiniband found. Disabling datatap"
+		AC_DEFINE(NO_DATATAP, 1, [Datatap is disabled])
+		datatap=disable
+		temptest=disable
+	fi	
+fi
+
+if test x"$temptest" = xdisable; then
+	datatap=disable
+	echo "Datatap dependency check failed"
+	AC_DEFINE(NO_DATATAP, 1, [Datatap is disabled])
+fi
+
+AC_SUBST(DT_LIBS)
+AC_SUBST(DT_CPPFLAGS)
+AC_SUBST(DT_LDFLAGS)
+
+
+]) dnl AC_DATATAP
diff --git a/config/ac_dimes.m4 b/config/ac_dimes.m4
new file mode 100644
index 0000000..df51b10
--- /dev/null
+++ b/config/ac_dimes.m4
@@ -0,0 +1,119 @@
+#
+#
+# AC_PROG_DIMES
+#
+# Test for DIMES installation
+# and set $DIMES to the correct value.
+#
+#
+
+dnl @synopsis AC_PROG_DIMES
+dnl
+dnl This macro test if DIMES is installed. If DIMES
+dnl is installed, it set $DIMES to the right value
+dnl
+dnl @version 1.0
+dnl @author Fan Zhang,  zhangfan at cac.rutgers.edu
+dnl @author Norbert Podhorszki, pnorbert at ornl.gov
+dnl
+AC_DEFUN([AC_PROG_DIMES],[
+
+AM_CONDITIONAL(HAVE_DIMES,true)
+
+AC_ARG_WITH(dimes,
+        [AS_HELP_STRING([--with-dimes=DIR],
+           [Build the DIMES transport method. Point to the DIMES installation.])],
+        [DIMES_LDFLAGS="-L$withval/lib";
+         DIMES_CPPFLAGS="-I$withval/include";],
+        [with_dimes=check])
+
+dnl If --without-dimes was given set HAVE_DIMES to false and do nothing more
+if test "x$with_dimes" == "xno"; then
+
+   AM_CONDITIONAL(HAVE_DIMES,false)
+
+else
+
+    dnl allow args --with-dimes incdir and --with-dimes-libdir
+    AC_ARG_WITH(dimes-incdir,
+                [  --with-dimes-incdir=<location of dimes includes>],
+                [DIMES_INCDIR=$withval
+                 with_dimes=detailed])
+    
+    AC_ARG_WITH(dimes-libdir,
+                [  --with-dimes-libdir=<location of dimes library>],
+                [DIMES_LIBDIR=$withval
+                 with_dimes=detailed])
+    
+    
+    dnl If we know DIMES_DIR, then we can know DIMES_INCDIR.
+    dnl We don't overwrite DIMES_INCDIR.
+    if test -n "${DIMES_DIR}" -a -z "${DIMES_INCDIR}"; then
+            DIMES_INCDIR="${DIMES_DIR}/include";
+    dnl We may have DIMES denoting the dir (e.g. on ewok BUT on franklin it contains all flags)
+    elif test -n "${DIMES}" -a -d "${DIMES}"; then
+            DIMES_INCDIR="${DIMES}/include"
+    fi
+
+    dnl If we know DIMES_DIR, then we can know DIMES_LIBDIR.
+    dnl We don't overwrite DIMES_LIBDIR.
+    if test -n "${DIMES_DIR}" -a -z "${DIMES_LIBDIR}"; then
+            DIMES_LIBDIR="${DIMES_DIR}/lib";
+    dnl We may have DIMES denoting the dir (e.g. on ewok BUT on franklin it contains all flags)
+    elif test -n "${DIMES}" -a -d "${DIMES}"; then
+            DIMES_LIBDIR="${DIMES}/lib"
+    fi
+
+    dnl Add "-I" to DIMES_INCDIR.
+    if test -n "${DIMES_INCDIR}"; then
+            DIMES_CPPFLAGS="-I${DIMES_INCDIR}"
+    else
+            ac_dimes_ok=no
+    fi
+
+    dnl Add "-L" to DIMES_LIBDIR.
+    if test -n "${DIMES_LIBDIR}"; then
+            DIMES_LDFLAGS="-L${DIMES_LIBDIR}"
+    else
+            ac_dimes_ok=no
+    fi
+
+    save_CPPFLAGS="$CPPFLAGS"
+    save_LIBS="$LIBS"
+    save_LDFLAGS="$LDFLAGS"
+    LIBS="$LIBS -ldimes_portals -lspaces"
+    LDFLAGS="$LDFLAGS $DIMES_LDFLAGS"
+    CPPFLAGS="$CPPFLAGS $DIMES_CPPFLAGS"
+    
+    if test -z "${HAVE_DIMES_TRUE}"; then
+            AC_CHECK_HEADERS(dimes.h,
+                    ,
+                    [AM_CONDITIONAL(HAVE_DIMES,false)])
+    fi
+    
+    # Check for the Mini-XML library and headers
+    AC_TRY_COMPILE([#include "dimes.h"],
+            [int err; err = dimes_init(1,1,1);],
+            [DIMES_LIBS="-ldimes_portals -lspaces"],
+            [AM_CONDITIONAL(HAVE_DIMES,false)])
+    
+    LIBS="$save_LIBS"
+    LDFLAGS="$save_LDFLAGS"
+    CPPFLAGS="$save_CPPFLAGS"
+    
+    AC_SUBST(DIMES_LIBS)
+    AC_SUBST(DIMES_LDFLAGS)
+    AC_SUBST(DIMES_CPPFLAGS)
+    
+    # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+    if test -z "${HAVE_DIMES_TRUE}"; then
+            ifelse([$1],,[AC_DEFINE(HAVE_DIMES,1,[Define if you have the DIMES.])],[$1])
+            :
+    else
+            $2
+            :
+    fi
+
+fi
+])dnl AC_DIMES
+
diff --git a/config/ac_dmalloc.m4 b/config/ac_dmalloc.m4
new file mode 100644
index 0000000..ac2f8f1
--- /dev/null
+++ b/config/ac_dmalloc.m4
@@ -0,0 +1,62 @@
+#
+#
+# AC_DMALLOC
+#
+#
+#
+dnl @synopsis AC_DMALLOC
+dnl
+dnl This macro test if dmalloc is to be used. 
+dnl Use in C code:
+dnl     #ifdef DMALLOC
+dnl     #include "dmalloc.h"
+dnl     #endif
+dnl
+dnl @version 1.0
+dnl @author Norbert Podhorszki, ORNL
+dnl
+AC_DEFUN([AC_DMALLOC],[
+
+AM_CONDITIONAL(HAVE_DMALLOC,true)
+
+AC_ARG_WITH(dmalloc,
+        [  --with-dmalloc=DIR      Location of dmalloc library],
+        [DMALLOC_LDFLAGS="-L$withval/lib";
+         DMALLOC_CPPFLAGS="-I$withval/include";])
+
+save_CPPFLAGS="$CPPFLAGS"
+save_LIBS="$LIBS"
+save_LDFLAGS="$LDFLAGS"
+LIBS="$LIBS -ldmalloc"
+LDFLAGS="$LDFLAGS $DMALLOC_LDFLAGS"
+CPPFLAGS="$CPPFLAGS $DMALLOC_CPPFLAGS"
+
+if test -z "${HAVE_DMALLOC_TRUE}"; then
+        AC_CHECK_HEADERS(dmalloc.h,
+                ,
+                [AM_CONDITIONAL(HAVE_DMALLOC,false)])
+fi
+
+# Check for the dmalloc library and headers
+AC_TRY_COMPILE([#include "dmalloc.h"],
+        [char * s; s=malloc(sizeof(char)*10); free(s);],
+        [DMALLOC_LIBS="-ldmalloc"],
+        [AM_CONDITIONAL(HAVE_DMALLOC,false)])
+
+LIBS="$save_LIBS"
+LDFLAGS="$save_LDFLAGS"
+CPPFLAGS="$save_CPPFLAGS"
+
+AC_SUBST(DMALLOC_LIBS)
+AC_SUBST(DMALLOC_LDFLAGS)
+AC_SUBST(DMALLOC_CPPFLAGS)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test -z "${HAVE_DMALLOC_TRUE}"; then
+        ifelse([$1],,[AC_DEFINE(HAVE_DMALLOC,1,[Define if you have DMALLOC.])],[$1])
+        :
+else
+        $2
+        :
+fi
+])dnl AC_DMALLOC
diff --git a/config/ac_hdf5.m4 b/config/ac_hdf5.m4
new file mode 100644
index 0000000..96e9004
--- /dev/null
+++ b/config/ac_hdf5.m4
@@ -0,0 +1,133 @@
+dnl ######################################################################
+dnl
+dnl Finds HDF5
+dnl
+dnl ######################################################################
+
+AC_DEFUN([AC_HDF5],
+[
+AC_MSG_NOTICE([=== checking for HDF5 ===])
+
+AM_CONDITIONAL(HAVE_HDF5,true)
+
+dnl Automatic checking for HDF5 is disabled now.
+AC_ARG_WITH(hdf5,
+            [  --with-hdf5=<location of HDF5 installation>],
+            [HDF5_DIR=$withval], [with_hdf5=no])
+
+AC_ARG_WITH(hdf5-incdir,
+            [  --with-hdf5-incdir=<location of HDF5 includes>],
+            [HDF5_INCDIR=$withval
+             with_hdf5=detailed])
+
+AC_ARG_WITH(hdf5-libdir,
+             [  --with-hdf5-libdir=<location of HDF5 library>],
+             [HDF5_LIBDIR=$withval
+              with_hdf5=detailed])
+
+AC_ARG_WITH(hdf5-libs,
+             [  --with-hdf5-libs=<linker flags besides -L<hdf5_libdir>, e.g. -lhdf5 -lhdf5_hl -lz>],
+             [HDF5_LIBS=$withval
+              with_hdf5=detailed])
+
+
+dnl If --without-hdf5 was given set HAVE_HDF5 to false and do nothing more
+dnl If nothing was given, then too, do nothing 
+if test "x$with_hdf5" == "xno"; then
+
+   AM_CONDITIONAL(HAVE_HDF5,false)
+
+else
+
+    dnl If we know HDF5_DIR, then we can know HDF5_INCDIR.
+    dnl We don't overwrite HDF5_INCDIR.
+    if test -z "${HDF5_INCDIR}"; then
+        if test -n "${HDF5_DIR}"; then
+            HDF5_INCDIR="${HDF5_DIR}/include";
+        fi
+    fi
+
+    dnl If we know HDF5_DIR, then we can know HDF5_LIBDIR.
+    dnl We don't overwrite HDF5_LIBDIR.
+    if test -z "${HDF5_LIBDIR}"; then
+        if test -n "${HDF5_DIR}"; then
+            HDF5_LIBDIR="${HDF5_DIR}/lib";
+        fi
+    fi
+
+    dnl Add "-I" to HDF5_INCDIR.
+    HDF5_CPPFLAGS="-I${HDF5_INCDIR}"
+
+    dnl Add "-L" to HDF5_LIBDIR.
+    HDF5_LDFLAGS="-L${HDF5_LIBDIR}"
+
+    dnl if hdf5 libs are not defined then guess and define it
+    if test -z "${HDF5_LIBS}"; then
+        dnl default HDF5 lib is usually just -lhdf5 -lz
+        HDF5_LIBS="-lhdf5 -lz"
+    fi
+
+    save_CC="$CC"
+    save_CPPFLAGS="$CPPFLAGS"
+    save_LIBS="$LIBS"
+    save_LDFLAGS="$LDFLAGS"
+    LIBS="$LIBS $HDF5_LIBS"
+    LDFLAGS="$LDFLAGS $HDF5_LDFLAGS"
+    CPPFLAGS="$CPPFLAGS $HDF5_CPPFLAGS"
+    CC="$MPICC"
+
+    if test -z "${HAVE_HDF5_TRUE}"; then
+        dnl  AC_CHECK_HEADERS(hdf5.h,
+        dnl      ,
+        dnl      [if test "x$with_hdf5" != xcheck; then
+        dnl          AC_MSG_FAILURE( [--with-hdf5 was given, but test for hdf5.h failed])
+        dnl       fi
+        dnl       AM_CONDITIONAL(HAVE_HDF5,false)])
+        AC_MSG_CHECKING([for hdf5.h])
+        if test -f ${HDF5_INCDIR}/hdf5.h; then
+            AC_MSG_RESULT(yes)
+        else
+            AM_CONDITIONAL(HAVE_HDF5,false)
+            AC_MSG_RESULT(no)
+            AC_MSG_FAILURE( [--with-hdf5 was given, but test for ${HDF5_INCDIR}/hdf5.h failed])
+        fi
+    fi
+
+    if test -z "${HAVE_HDF5_TRUE}"; then
+        AC_MSG_CHECKING([if hdf5 code can be compiled])
+        AC_TRY_COMPILE([#include "hdf5.h"],
+            [hid_t file_id;
+             herr_t status;
+             file_id = H5Fcreate("a.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+             status = H5Fclose(file_id);
+            ],
+            [AC_MSG_RESULT(yes)],
+            [AC_MSG_RESULT(no)
+             if test "x$with_hdf5" != xcheck; then
+                AC_MSG_FAILURE( [--with-hdf5 was given, but compile test failed])
+             fi
+             AM_CONDITIONAL(HAVE_HDF5,false)
+            ])
+
+        AC_SUBST(HDF5_LIBS)
+        AC_SUBST(HDF5_LDFLAGS)
+        AC_SUBST(HDF5_CPPFLAGS)
+    fi
+
+    LIBS="$save_LIBS"
+    LDFLAGS="$save_LDFLAGS"
+    CPPFLAGS="$save_CPPFLAGS"
+    CC="$save_CC"
+
+    # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+    if test -z "${HAVE_HDF5_TRUE}"; then
+            ifelse([$1],,[AC_DEFINE(HAVE_HDF5,1,[Define if you have HDF5.])],[$1])
+            :
+    else
+            $2
+            :
+    fi
+
+fi
+
+])
diff --git a/config/ac_infiniband.m4 b/config/ac_infiniband.m4
new file mode 100644
index 0000000..3a20d15
--- /dev/null
+++ b/config/ac_infiniband.m4
@@ -0,0 +1,132 @@
+dnl @synopsis AC_INFINIBAND([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+dnl
+dnl This macro tries to find out how to compile programs that
+dnl use the Infiniband ibverbs API.
+dnl
+dnl On success, it defines HAVE_INFINIBAND and sets INFINIBAND_LIBS
+dnl to any libraries that are needed for linking
+dnl Infiniband (e.g. -libverbs,...).
+dnl
+dnl If you want to compile everything with Portals, you should set:
+dnl
+dnl     LIBS="$PTL_LIBS $LIBS"
+dnl
+dnl ACTION-IF-FOUND is a list of shell commands to run if a Infiniband
+dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands
+dnl to run it if it is not found.  If ACTION-IF-FOUND is not specified,
+dnl the default action will define HAVE_INFINIBAND.
+dnl
+dnl @version $Id: ac_infiniband.m4 676 2006-05-16 20:44:08Z thkorde $
+dnl @author Todd H. Kordenbrock <thkorde at sandia.gov>
+
+AC_DEFUN([AC_INFINIBAND], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([ACX_PTHREAD])
+AC_LANG_SAVE
+AC_LANG_C
+ac_infiniband_hdr_ok=no
+ac_infiniband_lib_ok=no
+ac_with_infiniband=no
+
+
+INFINIBAND_CFLAGS=""
+INFINIBAND_CPPFLAGS=""
+INFINIBAND_LDFLAGS=""
+INFINIBAND_LIBS=""
+
+AC_ARG_WITH(infiniband,
+        [  --with-infiniband=DIR      Location of Infiniband],
+        [ ac_with_infiniband=yes;])
+
+
+
+if test x"$withval" = xno; then
+
+        ac_with_infiniband=no;
+
+elif test x"$withval" = xyes -o x"$withval" = x; then
+
+        INFINIBAND_CPPFLAGS="";
+        INFINIBAND_LDFLAGS="";
+        ac_with_infiniband=yes;
+
+else
+
+        INFINIBAND_CPPFLAGS="-I$withval/include";
+        INFINIBAND_LDFLAGS="-L$withval/lib64 -L$withval/lib";
+        ac_with_infiniband=yes;
+
+fi
+
+AM_CONDITIONAL(HAVE_INFINIBAND,test x$ac_with_infiniband = xyes)
+
+
+dnl Check for command-line disable
+if test x"$ac_with_infiniband" = xyes; then
+
+        dnl Look for Infiniband header files
+        save_CPPFLAGS=$CPPFLAGS;
+        CPPFLAGS="$CPPFLAGS $INFINIBAND_CPPFLAGS"
+        LDFLAGS="$LDFLAGS $INFINIBAND_LDFLAGS"
+
+
+        if test x"$ac_infiniband_hdr_ok" = xno; then
+                AC_CHECK_HEADER(infiniband/verbs.h,
+                         [AC_DEFINE(HAVE_IBVERBS_H, 1,
+                                [Define to 1 if you have <infiniband/verbs.h>.])
+                         ac_infiniband_hdr_ok=yes;
+                         INFINIBAND_CFLAGS="$INFINIBAND_CFLAGS $EXTRA_CFLAGS";
+                         INFINIBAND_CPPFLAGS="$INFINIBAND_CPPFLAGS $EXTRA_CFLAGS"],
+                         [ac_infiniband_hdr_ok=no])
+        fi
+
+        if test x"$ac_infiniband_hdr_ok" = xno; then
+                CPPFLAGS=$save_CPPFLAGS
+        fi
+
+        dnl Look for -libverbs
+        if test x"$ac_infiniband_lib_ok" = xno -a x$ac_infiniband_hdr_ok = xyes; then
+            save_LIBS=$LIBS;
+            LIBS=""
+            AC_SEARCH_LIBS(ibv_alloc_pd,[ibverbs],
+                    [ac_infiniband_lib_ok=yes],
+                    [ac_infiniband_lib_ok=no],
+                    [$save_LIBS $PTHREAD_LDFLAGS $PTHREAD_LIBS])
+            if test -n $LIBS; then
+                INFINIBAND_LIBS="$INFINIBAND_LIBS $LIBS";
+            fi
+            LIBS=$save_LIBS;
+        fi
+
+        if test x"$ac_infiniband_hdr_ok" = xno -o x$ac_infiniband_lib_ok = xno; then
+            AM_CONDITIONAL(HAVE_INFINIBAND,false)
+            INFINIBAND_CFLAGS=""
+            INFINIBAND_CPPFLAGS=""
+            INFINIBAND_LDFLAGS=""
+            INFINIBAND_LIBS=""
+            ac_with_infiniband=no
+        else
+            AM_CONDITIONAL(HAVE_INFINIBAND,true)
+        fi
+
+
+        AC_SUBST(INFINIBAND_CPPFLAGS)
+        AC_SUBST(INFINIBAND_CFLAGS)
+        AC_SUBST(INFINIBAND_LDFLAGS)
+        AC_SUBST(INFINIBAND_LIBS)
+        AC_SUBST(INFINIBAND_HEADER)
+
+
+        # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+        if test x"$ac_infiniband_lib_ok" = xyes; then
+                ifelse([$1],,[AC_DEFINE(HAVE_INFINIBAND,1,[Define if you have the Infiniband.])],[$1])
+                :
+        else
+                $2
+                :
+        fi
+
+fi
+
+AC_LANG_RESTORE
+])dnl AC_INFINIBAND
diff --git a/config/ac_mxml.m4 b/config/ac_mxml.m4
new file mode 100644
index 0000000..1884193
--- /dev/null
+++ b/config/ac_mxml.m4
@@ -0,0 +1,112 @@
+#
+#
+# AC_PROG_MXML
+#
+# Test for Mini-XML
+# and set $MXML to the correct value.
+#
+#
+dnl @synopsis AC_PROG_MXML
+dnl
+dnl This macro test if mini-XML is installed. If mini-XML
+dnl is installed, it set $MXML to the right value
+dnl
+dnl @version 1.0
+dnl @author Jay Lofstead lofstead at cc.gatech.edu
+dnl
+AC_DEFUN([AC_PROG_MXML],[
+
+AM_CONDITIONAL(HAVE_MXML,true)
+
+AC_ARG_WITH(mxml,
+        [  --with-mxml=DIR      Location of Mini-XML library],
+        [MXML_LDFLAGS="-L$withval/lib";
+         MXML_CPPFLAGS="-I$withval/include";])
+
+save_CPPFLAGS="$CPPFLAGS"
+save_LIBS="$LIBS"
+save_LDFLAGS="$LDFLAGS"
+LIBS="$LIBS -lmxml"
+if test -n "$MXML_LDFLAGS"; then
+    LDFLAGS="$LDFLAGS $MXML_LDFLAGS"
+elif test -n "$MXML_LIB"; then
+    LDFLAGS="$LDFLAGS $MXML_LIB"
+    MXML_LDFLAGS="$MXML_LIB"
+fi
+if test -n "$MXML_CPPFLAGS"; then
+    CPPFLAGS="$CPPFLAGS $MXML_CPPFLAGS"
+elif test -n "$MXML_INC"; then
+    CPPFLAGS="$CPPFLAGS $MXML_INC"
+    MXML_CPPFLAGS="$MXML_INC"
+fi 
+
+if test -z "${HAVE_MXML_TRUE}"; then
+        AC_CHECK_HEADERS(mxml.h,
+                ,
+                [AM_CONDITIONAL(HAVE_MXML,false)])
+fi
+
+if test -z "${HAVE_MXML_TRUE}"; then
+    # Check for the Mini-XML library and headers
+    AC_MSG_CHECKING([if mxml code can be linked])
+    AC_TRY_LINK([#include "mxml.h"],
+        [mxml_node_t * n; 
+         char *buffer;
+         char *value;
+         n = mxmlLoadString (0, buffer, MXML_TEXT_CALLBACK);
+         mxmlWalkNext (n, n, MXML_DESCEND);
+         value = mxmlElementGetAttr (n, "value");
+         mxmlRelease (n);
+        ],
+        [MXML_LIBS="-lmxml"
+         AC_MSG_RESULT(yes)
+        ],
+        [AM_CONDITIONAL(HAVE_MXML,false)
+         AC_MSG_RESULT(no)
+        ])
+
+    dnl If Linking above failed, one reason might be that mxml uses pthreads and
+    dnl the compiler does not use it by default. Try getting phtreads
+    if test -z "${HAVE_MXML_FALSE}"; then
+        # Check for the Mini-XML library and headers
+        AC_REQUIRE([ACX_PTHREAD])
+        LDFLAGS="$LDFLAGS $PTHREAD_LDFLAGS $PTHREAD_LIBS"
+        AC_MSG_CHECKING([if mxml code can be linked using pthreads])
+        AC_TRY_LINK([#include "mxml.h"],
+            [mxml_node_t * n; 
+             char *buffer;
+             char *value;
+             n = mxmlLoadString (0, buffer, MXML_TEXT_CALLBACK);
+             mxmlWalkNext (n, n, MXML_DESCEND);
+             value = mxmlElementGetAttr (n, "value");
+             mxmlRelease (n);
+            ],
+            [MXML_LDFLAGS="$MXML_LDFLAGS $PTHREAD_LDFLAGS"
+             MXML_LIBS="-lmxml $PTHREAD_LIBS"
+             AM_CONDITIONAL(HAVE_MXML,true)
+             AC_MSG_RESULT(yes)
+            ],
+            [AM_CONDITIONAL(HAVE_MXML,false)
+             AC_MSG_RESULT(no)
+            ])
+    fi
+fi
+
+
+LIBS="$save_LIBS"
+LDFLAGS="$save_LDFLAGS"
+CPPFLAGS="$save_CPPFLAGS"
+
+AC_SUBST(MXML_LIBS)
+AC_SUBST(MXML_LDFLAGS)
+AC_SUBST(MXML_CPPFLAGS)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test -z "${HAVE_MXML_TRUE}"; then
+        ifelse([$1],,[AC_DEFINE(HAVE_MXML,1,[Define if you have the MXML.])],[$1])
+        :
+else
+        $2
+        :
+fi
+])dnl AC_MXML
diff --git a/config/ac_nc4par.m4 b/config/ac_nc4par.m4
new file mode 100644
index 0000000..b5343c9
--- /dev/null
+++ b/config/ac_nc4par.m4
@@ -0,0 +1,147 @@
+dnl ######################################################################
+dnl
+dnl Finds netCDF 4 parallel
+dnl
+dnl ######################################################################
+
+AC_DEFUN([AC_NC4PAR],
+[
+AC_MSG_NOTICE([=== checking NetCDF 4 Parallel ===])
+
+AM_CONDITIONAL(HAVE_NC4PAR,true)
+
+AC_ARG_WITH(nc4par,
+            [  --with-nc4par=<location of NetCDF 4 Parallel installation>],
+            [NC4PAR_DIR=$withval], [with_nc4par=check])
+
+dnl If --without-nc4par was given set HAVE_NC4PAR to false and do nothing more
+if test "x$with_nc4par" == "xno"; then
+
+   AM_CONDITIONAL(HAVE_NC4PAR,false)
+
+else
+
+    ac_use_cray_netcdf=no
+
+    dnl allow args --with-nc4par incdir and --with-nc4par-libdir
+    AC_ARG_WITH(nc4par-incdir,
+                [  --with-nc4par-incdir=<location of NetCDF 4 Parallel includes>],
+                [NC4PAR_INCDIR=$withval
+                 with_nc4par=detailed])
+    
+    AC_ARG_WITH(nc4par-libdir,
+                [  --with-nc4par-libdir=<location of NetCDF 4 Parallel library>],
+                [NC4PAR_LIBDIR=$withval
+                 with_nc4par=detailed])
+    
+    AC_ARG_WITH(nc4par-libs,
+                [  --with-nc4par-libs=<linker flags besides -L<nc4par_libdir>, e.g. -lnetcdf>],
+                [NC4PAR_LIBS=$withval
+                 with_nc4par=detailed])
+    
+    
+    dnl If we know NC4PAR_DIR, then we can know NC4PAR_INCDIR.
+    dnl If we know CRAY_NETCDF_DIR, then we leave NC4PAR_INCDIR empty.
+    dnl Or, if we know NETCDF_DIR, then we can know NC4PAR_INCDIR.
+    dnl We don't overwrite NC4PAR_INCDIR.
+    if test -z "${NC4PAR_INCDIR}"; then
+        if test -n "${NC4PAR_DIR}"; then
+            NC4PAR_INCDIR="${NC4PAR_DIR}/include";
+        elif test -n "${CRAY_NETCDF_DIR}"; then
+            NC4PAR_INCDIR="";
+            ac_use_cray_netcdf=yes
+        elif test -n "${NETCDF_DIR}"; then
+            NC4PAR_INCDIR="${NETCDF_DIR}/include";
+        fi
+    fi
+    
+    dnl If we know NC4PAR_DIR, then we can know NC4PAR_LIBDIR.
+    dnl If we know CRAY_NETCDF_DIR, then we leave NC4PAR_LIBDIR empty.
+    dnl Or, if we know NETCDF_DIR, then we may know NC4PAR_LIBDIR.
+    dnl We don't overwrite NC4PAR_LIBDIR.
+    if test -z "${NC4PAR_LIBDIR}"; then
+        if test -n "${NC4PAR_DIR}"; then
+            NC4PAR_LIBDIR="${NC4PAR_DIR}/lib";
+        elif test -n "${CRAY_NETCDF_DIR}"; then
+            NC4PAR_LIBDIR="";
+            ac_use_cray_netcdf=yes
+        elif test -n "${NETCDF_DIR}"; then
+            NC4PAR_LIBDIR="${NETCDF_DIR}/lib"
+        fi
+    fi
+    
+    dnl Add "-I" to NC4PAR_INCDIR.
+    if test -n "${NC4PAR_INCDIR}"; then
+            NC4PAR_CPPFLAGS="-I${NC4PAR_INCDIR}"
+    else
+            ac_nc4par=no
+    fi
+    
+    dnl Add "-L" to NC4PAR_LIBDIR + NC4PAR_LIBS.
+    if test -n "${NC4PAR_LIBDIR}"; then
+            NC4PAR_LDFLAGS="-L${NC4PAR_LIBDIR}"
+    else
+            ac_nc4par=no
+    fi
+    
+    dnl if nc4 libs are not defined (and not Cray nc4 lib), then guess and define it
+    if test -z "${NC4PAR_LIBS}"; then
+        if test "${ac_use_cray_netcdf}" != "yes"; then
+            NC4PAR_LIBS="-lnetcdf"
+        fi
+    fi
+
+    save_CPPFLAGS="$CPPFLAGS"
+    save_LIBS="$LIBS"
+    save_LDFLAGS="$LDFLAGS"
+    LIBS="$LIBS $NC4PAR_LIBS"
+    LDFLAGS="$LDFLAGS $NC4PAR_LDFLAGS"
+    CPPFLAGS="$CPPFLAGS $NC4PAR_CPPFLAGS"
+    
+    if test -z "${HAVE_NC4PAR_TRUE}"; then
+        AC_CHECK_HEADERS(netcdf.h,
+           ,
+           [if test "x$with_nc4par" != xcheck; then
+              AC_MSG_FAILURE( [--with-nc4par was given, but test for netcdf.h failed])
+            fi
+            AM_CONDITIONAL(HAVE_NC4PAR,false)])
+    fi
+    
+    if test -z "${HAVE_NC4PAR_TRUE}"; then
+        AC_MSG_CHECKING([if nc4 parallel code can be compiled])
+        AC_TRY_COMPILE([#include "netcdf.h"],
+            [int ncid;
+             MPI_Info info;
+             MPI_Comm comm;
+             nc_create_par("a.nc", NC_NOCLOBBER|NC_MPIIO|NC_NETCDF4, comm, info, ncid);
+             nc_close(ncid);
+            ],
+            [AC_MSG_RESULT(yes)],
+            [AC_MSG_RESULT(no)
+             if test "x$with_nc4par" != xcheck; then
+                 AC_MSG_FAILURE( [--with-nc4par was given, but compile test failed])
+             fi
+             AM_CONDITIONAL(HAVE_NC4PAR,false)
+            ])
+    
+        AC_SUBST(NC4PAR_LIBS)
+        AC_SUBST(NC4PAR_LDFLAGS)
+        AC_SUBST(NC4PAR_CPPFLAGS)
+    fi
+    
+    LIBS="$save_LIBS"
+    LDFLAGS="$save_LDFLAGS"
+    CPPFLAGS="$save_CPPFLAGS"
+    
+    # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+    if test -z "${HAVE_NC4PAR_TRUE}"; then
+            ifelse([$1],,[AC_DEFINE(HAVE_NC4PAR,1,[Define if you have NC4PAR.])],[$1])
+            :
+    else
+            $2
+            :
+    fi
+
+fi
+
+])
diff --git a/config/ac_netcdf.m4 b/config/ac_netcdf.m4
new file mode 100644
index 0000000..8d191a6
--- /dev/null
+++ b/config/ac_netcdf.m4
@@ -0,0 +1,144 @@
+dnl ######################################################################
+dnl
+dnl Finds netCDF
+dnl
+dnl ######################################################################
+
+AC_DEFUN([AC_NETCDF],
+[
+AC_MSG_NOTICE([=== checking for NetCDF ===])
+
+AM_CONDITIONAL(HAVE_NETCDF,true)
+
+AC_ARG_WITH(netcdf,
+            [  --with-netcdf=<location of NetCDF installation>],
+            [NETCDF_DIR=$withval], [with_netcdf=check])
+
+dnl If --without-netcdf was given set HAVE_NETCDF to false and do nothing more
+if test "x$with_netcdf" == "xno"; then
+
+   AM_CONDITIONAL(HAVE_NETCDF,false)
+
+else
+
+    ac_use_cray_netcdf=no
+
+    dnl allow args --with-netcdf incdir and --with-netcdf-libdir
+    AC_ARG_WITH(netcdf-incdir,
+                [  --with-netcdf-incdir=<location of NetCDF includes>],
+                [NETCDF_INCDIR=$withval
+                 with_netcdf=detailed])
+    
+    AC_ARG_WITH(netcdf-libdir,
+                [  --with-netcdf-libdir=<location of NetCDF library>],
+                [NETCDF_LIBDIR=$withval
+                 with_netcdf=detailed])
+    
+    AC_ARG_WITH(netcdf-libs,
+                [  --with-netcdf-libs=<linker flags besides -L<netcdf_libdir>, e.g. -lnetcdf>],
+                [NETCDF_LIBS=$withval
+                 with_netcdf=detailed])
+    
+    dnl If we know NETCDF_DIR, then we can know NETCDF_INCDIR.
+    dnl If we know CRAY_NETCDF_DIR, then we leave NETCDF_INCDIR empty.
+    dnl We may have NETCDF denoting the dir (e.g. on ewok BUT on franklin it contains all flags)
+    dnl We don't overwrite NETCDF_INCDIR.
+    if test -z "${NETCDF_INCDIR}"; then
+        if test -n "${NETCDF_DIR}"; then
+            NETCDF_INCDIR="${NETCDF_DIR}/include";
+        elif test -n "${CRAY_NETCDF_DIR}"; then
+            NETCDF_INCDIR="";
+            ac_use_cray_netcdf=yes
+        elif test -n "${NETCDF}" -a -d "${NETCDF}"; then
+            NETCDF_INCDIR="${NETCDF}/include"
+        fi
+    fi
+    
+    dnl If we know NETCDF_DIR, then we can know NETCDF_LIBDIR.
+    dnl If we know CRAY_NETCDF_DIR, then we leave NETCDF_LIBDIR empty.
+    dnl We may have NETCDF denoting the dir (e.g. on ewok BUT on franklin it contains all flags)
+    dnl We don't overwrite NETCDF_LIBDIR.
+    if test -z "${NETCDF_LIBDIR}"; then
+        if test -n "${NETCDF_DIR}"; then
+            NETCDF_LIBDIR="${NETCDF_DIR}/lib";
+        elif test -n "${CRAY_NETCDF_DIR}"; then
+            NETCDF_LIBDIR="";
+            ac_use_cray_netcdf=yes
+        elif test -n "${NETCDF}" -a -d "${NETCDF}"; then
+            NETCDF_LIBDIR="${NETCDF}/lib"
+        fi
+    fi
+    
+    dnl Add "-I" to NETCDF_INCDIR.
+    if test -n "${NETCDF_INCDIR}"; then
+            NETCDF_CPPFLAGS="-I${NETCDF_INCDIR}"
+    else
+            ac_netcdf_ok=no
+    fi
+
+    dnl Add "-L" to NETCDF_LIBDIR.
+    if test -n "${NETCDF_LIBDIR}"; then
+            NETCDF_LDFLAGS="-L${NETCDF_LIBDIR}"
+    else
+            ac_netcdf_ok=no
+    fi
+
+    dnl if netcdf libs are not defined (and not Cray netcdf lib), then guess and define it
+    if test -z "${NETCDF_LIBS}"; then
+        if test "${ac_use_cray_netcdf}" != "yes"; then
+            NETCDF_LIBS="-lnetcdf"
+        fi
+    fi
+    
+    save_CPPFLAGS="$CPPFLAGS"
+    save_LIBS="$LIBS"
+    save_LDFLAGS="$LDFLAGS"
+    LIBS="$LIBS $NETCDF_LDFLAGS"
+    LDFLAGS="$LDFLAGS $NETCDF_LDFLAGS"
+    CPPFLAGS="$CPPFLAGS $NETCDF_CPPFLAGS"
+    
+    if test -z "${HAVE_NETCDF_TRUE}"; then
+        AC_CHECK_HEADERS(netcdf.h,
+           ,
+           [if test "x$with_netcdf" != xcheck; then
+              AC_MSG_FAILURE( [--with-netcdf was given, but test for netcdf.h failed])
+            fi
+            AM_CONDITIONAL(HAVE_NETCDF,false)])
+    fi
+    
+    if test -z "${HAVE_NETCDF_TRUE}"; then
+        AC_MSG_CHECKING([if netcdf code can be compiled])
+        AC_TRY_COMPILE([#include "netcdf.h"],
+            [int ncid;
+             nc_create("a.nc", NC_CLOBBER, &ncid);
+             nc_close(ncid);
+            ],
+            [AC_MSG_RESULT(yes)],
+            [AC_MSG_RESULT(no)
+             if test "x$with_netcdf" != xcheck; then
+                 AC_MSG_FAILURE( [--with-netcdf was given, but compile test failed])
+             fi
+             AM_CONDITIONAL(HAVE_NETCDF,false)
+            ])
+    
+        AC_SUBST(NETCDF_LIBS)
+        AC_SUBST(NETCDF_LDFLAGS)
+        AC_SUBST(NETCDF_CPPFLAGS)
+    fi
+    
+    LIBS="$save_LIBS"
+    LDFLAGS="$save_LDFLAGS"
+    CPPFLAGS="$save_CPPFLAGS"
+    
+    # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+    if test -z "${HAVE_NETCDF_TRUE}"; then
+            ifelse([$1],,[AC_DEFINE(HAVE_NETCDF,1,[Define if you have NETCDF.])],[$1])
+            :
+    else
+            $2
+            :
+    fi
+
+fi
+
+])
diff --git a/config/ac_nssi.m4 b/config/ac_nssi.m4
new file mode 100644
index 0000000..289c351
--- /dev/null
+++ b/config/ac_nssi.m4
@@ -0,0 +1,183 @@
+dnl @synopsis AC_NSSI([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+dnl
+dnl This macro tries to find out how to compile programs that
+dnl use the NSSI API.
+dnl
+dnl On success, it defines HAVE_NSSI and sets NSSI_LIBS
+dnl to any libraries that are needed for linking
+dnl NSSI (e.g. -lp3utcp, -lp3lib,...).
+dnl
+dnl If you want to compile everything with NSSI, you should set:
+dnl
+dnl     LIBS="$NSSI_LIBS $LIBS"
+dnl
+dnl ACTION-IF-FOUND is a list of shell commands to run if a NSSI
+dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands
+dnl to run it if it is not found.  If ACTION-IF-FOUND is not specified,
+dnl the default action will define HAVE_NSSI.
+dnl
+dnl @version $Id: acx_mpi.m4 676 2006-05-16 20:44:08Z raoldfi $
+dnl @author Ron A. Oldfield <raoldfi at sandia.gov>
+
+AC_DEFUN([AC_NSSI], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PORTALS])
+AC_REQUIRE([AC_INFINIBAND])
+AC_REQUIRE([AC_PABLO])
+
+AC_LANG_PUSH([C++])
+
+dnl AC_LANG_SAVE
+dnl AC_LANG_CPP
+
+ac_nssi_ok=yes
+ac_nssi_path="."
+
+
+AM_CONDITIONAL(HAVE_NSSI,false)
+
+NSSI_SRCDIR=""
+NSSI_BUILDDIR=""
+NSSI_CPPFLAGS=""
+NSSI_LDFLAGS=""
+NSSI_LIBS="-lnssi_client -lnssi_support"
+NSSI_SERVER_LIBS="-lnssi_server -lnssi_support"
+
+AC_ARG_WITH(nssi,
+        [  --with-nssi=DIR      Location of NSSI],
+        [NSSI_LDFLAGS="-L$withval/lib";
+         NSSI_CPPFLAGS="-I$withval/include";
+         ac_nssi_path=$withval])
+
+dnl Look for a header file
+if test x"$ac_nssi_ok" = xyes; then
+        save_CPPFLAGS="$CPPFLAGS"
+        CPPFLAGS="${CPPFLAGS} ${NSSI_CPPFLAGS}"
+        AC_CHECK_HEADER(nssi_client.h,
+                [],
+                [ac_nssi_ok=no])
+        CPPFLAGS="$save_CPPFLAGS"
+fi
+
+if test x"$ac_nssi_ok" = xyes; then
+
+        AC_CHECK_LIB(rt, clock_gettime)
+
+        AC_CHECK_FUNCS(clock_gettime gettimeofday fdatasync pthread_yield sched_yield)
+
+        ac_nssi_ok=no
+
+        dnl Determine which rpc libs to use with NSSI
+        ac_nssi_flags="none"
+        if test x"$ac_with_portals" = xyes; then
+                ac_nssi_flags="$ac_nssi_flags all_portals portals_plus_libcpp portals_plus_pablo"
+        fi
+        if test x"$ac_with_infiniband" = xyes; then
+                ac_nssi_flags="$ac_nssi_flags infiniband"
+        fi
+
+        for flag in $ac_nssi_flags; do
+
+                case $flag in
+                        none)
+                        AC_MSG_CHECKING([whether nssi works without any additional flags])
+                        ;;
+
+                        -l*)
+                        AC_MSG_CHECKING([whether nssi works with library $flag])
+                        EXTRA_LIBS="$flag"
+                        ;;
+
+                        -*)
+                        AC_MSG_CHECKING([whether nssi works with $flag])
+                        EXTRA_LIBS="$flag"
+                        ;;
+
+                        all_portals)
+                        AC_MSG_CHECKING([whether nssi works with ${PORTALS_LIBS}])
+                        EXTRA_LIBS="${PORTALS_LIBS}"
+                        ;;
+
+                        portals_plus_libcpp)
+                        AC_MSG_CHECKING([whether nssi works with ${PORTALS_LIBS}])
+                        EXTRA_LIBS="${PORTALS_LIBS}"
+                        ;;
+
+                        portals_plus_pablo)
+                        AC_MSG_CHECKING([whether nssi works with ${PORTALS_LIBS} ${PABLO_LIBS}])
+                        EXTRA_LIBS="${PORTALS_LIBS} ${PABLO_LIBS}"
+                        ;;
+
+                        infiniband)
+                        AC_MSG_CHECKING([whether nssi works with ${INFINIBAND_LIBS}])
+                        EXTRA_LIBS="${INFINIBAND_LIBS}"
+                        ;;
+                esac
+
+
+                save_LDFLAGS="$LDFLAGS"
+                save_LIBS="$LIBS"
+                save_CPPFLAGS="$CPPFLAGS"
+                save_CFLAGS="$CFLAGS"
+                LDFLAGS="$LDFLAGS $NSSI_LDFLAGS"
+                LIBS="$LIBS $NSSI_LIBS $EXTRA_LIBS"
+                CPPFLAGS="$CPPFLAGS $NSSI_CPPFLAGS"
+                CFLAGS="$CFLAGS $NSSI_CFLAGS $EXTRA_FLAGS"
+
+                dnl AC_MSG_CHECKING([CPPFLAGS=$CPPFLAGS])
+                dnl AC_MSG_CHECKING([LDFLAGS=$LDFLAGS])
+                dnl AC_MSG_CHECKING([LIBS=$LIBS])
+
+                dnl Check for various functions.
+                AC_LINK_IFELSE(AC_LANG_PROGRAM(
+                            [[#include "nssi_client.h"]],
+                            [[nssi_remote_pid server_id;]
+                             [uint64_t timeout;]
+                             [nssi_service svc;]
+                             [nssi_get_service(server_id, timeout, &svc);]]),
+                        [ac_nssi_ok=yes;],
+                        [ac_nssi_ok=no;])
+
+
+                LDFLAGS="$save_LDFLAGS"
+                LIBS="$save_LIBS"
+                CFLAGS="$save_CFLAGS"
+                CPPFLAGS="$save_CPPFLAGS"
+
+                AC_MSG_RESULT($ac_nssi_ok)
+                if test "x$ac_nssi_ok" = xyes; then
+                        NSSI_LIBS="$NSSI_LIBS $EXTRA_LIBS";
+                        NSSI_SERVER_LIBS="$NSSI_SERVER_LIBS $EXTRA_LIBS"
+                        NSSI_CFLAGS="$NSSI_CFLAGS $EXTRA_CFLAGS";
+                        break;
+                fi
+
+                EXTRA_LIBS=""
+                EXTRA_CFLAGS=""
+        done
+fi
+
+AM_CONDITIONAL(HAVE_NSSI, test x$ac_nssi_ok = xyes)
+
+AC_SUBST(NSSI_LIBS)
+AC_SUBST(NSSI_SERVER_LIBS)
+AC_SUBST(NSSI_CFLAGS)
+AC_SUBST(NSSI_CPPFLAGS)
+AC_SUBST(NSSI_LDFLAGS)
+AC_SUBST(NSSI_SRCDIR)
+AC_SUBST(NSSI_BUILDDIR)
+
+AC_LANG_POP([C++])
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$ac_nssi_ok" = xyes; then
+        ifelse([$1],,[AC_DEFINE(HAVE_NSSI,1,[Define if you have NSSI.])],[$1])
+        :
+else
+        $2
+        :
+fi
+
+dnl AC_LANG_RESTORE
+
+])dnl AC_NSSI
diff --git a/config/ac_pablo.m4 b/config/ac_pablo.m4
new file mode 100644
index 0000000..b1960e7
--- /dev/null
+++ b/config/ac_pablo.m4
@@ -0,0 +1,70 @@
+dnl @synopsis AC_PABLO([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+dnl
+dnl This macro tries to find out how to compile programs that
+dnl use the Pablo API.
+dnl
+dnl On success, it defines HAVE_PABLO and sets PABLO_LIBS
+dnl to any libraries that are needed for linking
+dnl Pablo (e.g. -lp3utcp, -lp3lib,...).
+dnl
+dnl If you want to compile everything with Pablo, you should set:
+dnl
+dnl     LIBS="$PABLO_LIBS $LIBS"
+dnl
+dnl ACTION-IF-FOUND is a list of shell commands to run if a Portals
+dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands
+dnl to run it if it is not found.  If ACTION-IF-FOUND is not specified,
+dnl the default action will define HAVE_PORTALS.
+dnl
+dnl @version $Id: acx_mpi.m4 676 2006-05-16 20:44:08Z raoldfi $
+dnl @author Ron A. Oldfield <raoldfi at sandia.gov>
+
+AC_DEFUN([AC_PABLO], [
+
+AM_CONDITIONAL(HAVE_PABLO,true)
+
+AC_ARG_WITH(pablo,
+	[  --with-pablo=DIR      Location of Pablo library],
+	[PABLO_LDFLAGS="-L$withval/lib";
+	 PABLO_CPPFLAGS="-I$withval/include";])
+
+dnl AC_LANG_PUSH([C++])
+
+save_CPPFLAGS="$CPPFLAGS"
+save_LIBS="$LIBS"
+save_LDFLAGS="$LDFLAGS"
+LIBS="$LIBS -lPablo"
+LDFLAGS="$LDFLAGS $PABLO_LDFLAGS"
+CPPFLAGS="$CPPFLAGS $PABLO_CPPFLAGS"
+
+if test -z "${HAVE_PABLO_TRUE}"; then
+        AC_CHECK_HEADERS(Attributes.h,
+		,
+		[AM_CONDITIONAL(HAVE_PABLO,false)])
+fi
+
+# Check for the Pablo library and headers for SDDF
+AC_TRY_COMPILE([#include <Attributes.h>],
+	[Attributes attr;attr.clearEntries();],
+	[PABLO_LIBS="-lPablo"],
+	[AM_CONDITIONAL(HAVE_PABLO,false)])
+
+LIBS="$save_LIBS"
+LDFLAGS="$save_LDFLAGS"
+CPPFLAGS="$save_CPPFLAGS"
+
+AC_SUBST(PABLO_LIBS)
+AC_SUBST(PABLO_LDFLAGS)
+AC_SUBST(PABLO_CPPFLAGS)
+
+dnl AC_LANG_POP([C++])
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test -z "${HAVE_PABLO_TRUE}"; then
+        ifelse([$1],,[AC_DEFINE(HAVE_PABLO,1,[Define if you have the Pablo.])],[$1])
+        :
+else
+        $2
+        :
+fi
+])dnl AC_PABLO
diff --git a/config/ac_phdf5.m4 b/config/ac_phdf5.m4
new file mode 100644
index 0000000..01d06d2
--- /dev/null
+++ b/config/ac_phdf5.m4
@@ -0,0 +1,159 @@
+dnl ######################################################################
+dnl
+dnl Finds PHDF5
+dnl
+dnl ######################################################################
+
+AC_DEFUN([AC_PHDF5],
+[
+AC_MSG_NOTICE([=== checking for Parallel HDF5 ===])
+
+AM_CONDITIONAL(HAVE_PHDF5,true)
+
+AC_ARG_WITH([phdf5],
+            [  --with-phdf5=<location of PHDF5 installation>],
+            [PHDF5_DIR=$withval], [with_phdf5=check])
+
+dnl allow args --with-phdf5 incdir and --with-phdf5-libdir
+
+AC_ARG_WITH(phdf5-incdir,
+    [  --with-phdf5-incdir=<location of PHDF5 includes>],
+    [PHDF5_INCDIR=$withval
+    with_phdf5=detailed])
+
+AC_ARG_WITH(phdf5-libdir,
+    [  --with-phdf5-libdir=<location of PHDF5 library>],
+    [PHDF5_LIBDIR=$withval
+    with_phdf5=detailed])
+
+AC_ARG_WITH(phdf5-libs,
+    [  --with-phdf5-libs=<linker flags besides -L<phdf5_libdir>, e.g. -lhdf5 -lhdf5_hl -lz>],
+    [PHDF5_LIBS=$withval
+    with_phdf5=detailed])
+
+dnl If --without-phdf5 was given set HAVE_PHDF5 to false and do nothing more
+if test "x$with_phdf5" == "xno"; then
+
+   AM_CONDITIONAL(HAVE_PHDF5,false)
+
+else
+
+    ac_use_cray_hdf5=no  dnl will set to yes if we will use CRAY_HDF5_DIR below
+
+    dnl If we know PHDF5_DIR, then we can know PHDF5_INCDIR.
+    dnl If we know CRAY_HDF5_DIR, then we leave PHDF5_INCDIR empty.
+    dnl We don't overwrite PHDF5_INCDIR.
+    if test -z "${PHDF5_INCDIR}"; then
+        if test -n "${CRAY_HDF5_DIR}"; then
+            PHDF5_INCDIR="";
+            ac_use_cray_hdf5=yes
+        elif test -n "${PHDF5_DIR}"; then
+            PHDF5_INCDIR="${PHDF5_DIR}/include";
+            dnl echo "PHDF5_INCDIR set to PHDF5_DIR/include = ${PHDF5_DIR}/include"
+        else
+            ac_phdf5_ok=no
+        fi
+    fi
+
+    dnl If we know PHDF5_DIR, then we can know PHDF5_LIBDIR.
+    dnl If we know CRAY_HDF5_DIR, then we leave PHDF5_LIBDIR empty.
+    dnl We don't overwrite PHDF5_LIBDIR.
+    if test -z "${PHDF5_LIBDIR}"; then
+        if test -n "${CRAY_HDF5_DIR}"; then
+            PHDF5_LIBDIR="";
+            ac_use_cray_hdf5=yes
+        elif test -n "${PHDF5_DIR}"; then
+            PHDF5_LIBDIR="${PHDF5_DIR}/lib";
+            dnl echo "PHDF5_LIBDIR set to PHDF5_DIR/lib = ${PHDF5_DIR}/lib"
+        else
+            ac_phdf5_ok=no
+        fi
+    fi
+
+    if test -n "${PHDF5_INCDIR}"; then
+        dnl Add "-I" to PHDF5_INCDIR.
+        PHDF5_CPPFLAGS="-I${PHDF5_INCDIR}"
+    else
+        ac_use_cray_hdf5=no
+    fi
+
+    if test -n "${PHDF5_LIBDIR}"; then
+        dnl Add "-L" to PHDF5_LIBDIR.
+        PHDF5_LDFLAGS="-L${PHDF5_LIBDIR}"
+    else
+        ac_use_cray_hdf5=no
+    fi
+
+
+    dnl if hdf5 libs are not defined (and not Cray hdf5 lib), then guess and define it
+    if test -z "${PHDF5_LIBS}"; then
+        if test "${ac_use_cray_hdf5}" != "yes"; then
+            dnl default PHDF5 lib is usually just -lhdf5_hl -lhdf -lz
+            PHDF5_LIBS="-lhdf5_hl -lhdf5 -lz"
+        else
+            AC_MSG_NOTICE([Environment CRAY_HDF5_DIR defined, so we use Cray's settings])
+        fi
+    fi
+
+    save_CC="$CC"
+    save_CPPFLAGS="$CPPFLAGS"
+    save_LIBS="$LIBS"
+    save_LDFLAGS="$LDFLAGS"
+    LIBS="$LIBS $PHDF5_LIBS"
+    LDFLAGS="$LDFLAGS $PHDF5_LDFLAGS"
+    CPPFLAGS="$CPPFLAGS $PHDF5_CPPFLAGS"
+    CC="$MPICC"
+
+    dnl echo "---------------------------------"
+    dnl echo "Test PHDF5 with settings:"
+    dnl echo " PHDF5_CPPFLAGS=$PHDF5_CPPFLAGS"
+    dnl echo " PHDF5_LDFLAGS=$PHDF5_LDFLAGS"
+    dnl echo " PHDF5_LIBS=$PHDF5_LIBS"
+    dnl echo "---------------------------------"
+
+    if test -z "${HAVE_PHDF5_TRUE}"; then
+        AC_CHECK_HEADERS(hdf5.h,
+        ,
+        [ AM_CONDITIONAL(HAVE_PHDF5,false) ])
+    fi
+
+    if test -z "${HAVE_PHDF5_TRUE}"; then
+        AC_MSG_CHECKING([if phdf5 code can be compiled])
+        AC_TRY_COMPILE([#include "hdf5.h"],
+            [hid_t file_id;
+             herr_t status;
+#ifdef H5_HAVE_PARALLEL
+             file_id = H5Fcreate("a.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+             status = H5Fclose(file_id);
+#else
+             /* This must deliberately fail */
+             file_id = THE_HDF5_INSTALLATION_FOUND_IS_NOT_PARALLEL_HDF5
+#endif
+            ],
+            [AC_MSG_RESULT(yes)],
+            [AC_MSG_RESULT(no)
+             AM_CONDITIONAL(HAVE_PHDF5,false)
+            ])
+
+        AC_SUBST(PHDF5_LIBS)
+        AC_SUBST(PHDF5_LDFLAGS)
+        AC_SUBST(PHDF5_CPPFLAGS)
+    fi
+
+    LIBS="$save_LIBS"
+    LDFLAGS="$save_LDFLAGS"
+    CPPFLAGS="$save_CPPFLAGS"
+    CC="$save_CC"
+
+    # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+    if test -z "${HAVE_PHDF5_TRUE}"; then
+            ifelse([$1],,[AC_DEFINE(HAVE_PHDF5,1,[Define if you have PHDF5.])],[$1])
+            :
+    else
+            $2
+            :
+    fi
+
+fi
+
+])
diff --git a/config/ac_portals.m4 b/config/ac_portals.m4
new file mode 100644
index 0000000..77e470e
--- /dev/null
+++ b/config/ac_portals.m4
@@ -0,0 +1,341 @@
+dnl @synopsis AC_PORTALS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+dnl
+dnl This macro tries to find out how to compile programs that
+dnl use the Portals API.
+dnl
+dnl On success, it defines HAVE_PORTALS and sets PORTALS_LIBS
+dnl to any libraries that are needed for linking
+dnl Portals (e.g. -lp3utcp, -lp3lib,...).
+dnl
+dnl If you want to compile everything with Portals, you should set:
+dnl
+dnl     LIBS="$PTL_LIBS $LIBS"
+dnl
+dnl ACTION-IF-FOUND is a list of shell commands to run if a Portals
+dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands
+dnl to run it if it is not found.  If ACTION-IF-FOUND is not specified,
+dnl the default action will define HAVE_PORTALS.
+dnl
+dnl @version $Id: acx_mpi.m4 676 2006-05-16 20:44:08Z raoldfi $
+dnl @author Ron A. Oldfield <raoldfi at sandia.gov>
+
+AC_DEFUN([AC_PORTALS], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([ACX_PTHREAD])
+AC_LANG_SAVE
+AC_LANG_C
+ac_portals_hdr_ok=no
+ac_portals_lib_ok=no
+ac_with_portals=no
+
+AM_CONDITIONAL(HAVE_PORTALS,true)
+AM_CONDITIONAL(NEED_DARWIN_SINGLE_MODULE,false)
+
+PORTALS_CFLAGS=""
+PORTALS_CPPFLAGS=""
+PORTALS_LDFLAGS=""
+PORTALS_LIBS=""
+
+dnl PtlInit
+dnl PtlFini
+
+AC_ARG_WITH(portals,
+        [  --with-portals=DIR      Location of Portals (yes/no/path_to_portals)],
+        [ ac_with_portals=yes; ])
+
+if test x"$withval" = xno; then
+
+        AM_CONDITIONAL(HAVE_PORTALS,false)
+        ac_with_portals=no;
+
+elif test x"$withval" = xyes -o x"$withval" = x; then
+
+        PORTALS_LDFLAGS="";
+        PORTALS_CPPFLAGS="";
+        ac_with_portals=yes;
+
+else
+
+        PORTALS_LDFLAGS="-L$withval/lib";
+        PORTALS_CPPFLAGS="-I$withval/include";
+        ac_with_portals=yes;
+
+fi
+
+if test x"$ac_with_portals" = xyes; then
+
+        dnl Look for portals header files
+        save_CPPFLAGS=$CPPFLAGS;
+        CPPFLAGS="$CPPFLAGS $PORTALS_CPPFLAGS"
+        LDFLAGS="$LDFLAGS $PORTALS_LDFLAGS"
+
+
+
+        if test x"$ac_portals_hdr_ok" = xno; then
+                AC_CHECK_HEADER(portals3.h,
+                         [AC_DEFINE(HAVE_PORTALS3_H, 1,
+                                [Define to 1 if you have <portals3.h>.])
+                         ac_portals_hdr_ok=yes;
+                         PORTALS_CFLAGS="$PORTALS_CFLAGS $EXTRA_CFLAGS";
+                         PORTALS_CPPFLAGS="$PORTALS_CPPFLAGS $EXTRA_CFLAGS"],
+                         [ac_portals_hdr_ok=no])
+        fi
+
+        if test x"$ac_portals_hdr_ok" = xno; then
+                AC_CHECK_HEADER(portals/portals3.h,
+                         [AC_DEFINE(HAVE_PORTALS_PORTALS3_H, 1,
+                                [Define to 1 if you have <portals/portals3.h>.])
+                          ac_portals_hdr_ok=yes;
+                         PORTALS_CFLAGS="$PORTALS_CFLAGS $EXTRA_CFLAGS";
+                         PORTALS_CPPFLAGS="$PORTALS_CPPFLAGS $EXTRA_CFLAGS"],
+                         [ac_portals_hdr_ok=no])
+        fi
+
+        dnl Look for other portals files
+        AC_CHECK_HEADERS([p3nal_utcp.h p3rt/p3rt.h], , ,
+             [
+                        [#if defined(HAVE_PORTALS3_H)
+                         #include <portals3.h>
+                         #elif defined(HAVE_PORTALS_PORTALS3_H)
+                         #include <portals/portals3.h>
+                         #endif]
+             ])
+
+        if test x"$ac_portals_hdr_ok" = xno; then
+                CPPFLAGS=$save_CPPFLAGS
+        fi
+
+
+        dnl Look for -lportals
+        if test x"$ac_portals_lib_ok" = xno -a x$ac_portals_hdr_ok = xyes; then
+            save_LIBS=$LIBS;
+            LIBS=""
+            AC_SEARCH_LIBS(PtlInit,[portals],
+                    [ac_portals_lib_ok=yes],
+                    [ac_portals_lib_ok=no],
+                    [$save_LIBS $PTHREAD_LDFLAGS $PTHREAD_LIBS])
+            if test -n $LIBS; then
+                PORTALS_LIBS=$LIBS;
+            fi
+            LIBS=$save_LIBS;
+        fi
+
+        dnl Check for Portals UTCP libraries (Schutt's implementation)
+        dnl Look for PtlInit in -lp3api -lp3lib -lp3rt -lp3utcp
+        if test x"$ac_portals_lib_ok" = xno -a x$ac_portals_hdr_ok = xyes; then
+            save_LIBS=$LIBS;
+            save_LDFLAGS=$LDFLAGS;
+            save_CFLAGS=$CFLAGS;
+
+            extra_LIBS="-lp3api -lp3lib -lp3rt -lp3utcp"
+
+
+            LDFLAGS="$LDFLAGS $PORTALS_LDFLAGS"
+            LIBS="$LIBS $extra_LIBS $PTHREAD_LIBS"
+            CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+            AC_MSG_CHECKING([if portals links with $LDFLAGS $LIBS])
+
+            AC_LINK_IFELSE(AC_LANG_CALL([],[PtlInit]),
+                        [PORTALS_LIBS=$extra_LIBS;
+                        ac_portals_lib_ok=yes;
+                        AC_MSG_RESULT(yes)],
+                        [ac_portals_lib_ok=no;
+                         AC_MSG_RESULT(no)])
+
+            LIBS=$save_LIBS;
+            LDFLAGS=$save_LDFLAGS;
+            CDFLAGS=$save_CFLAGS;
+        fi
+
+        dnl See if PTHREADS is really necessary
+        if test x"$ac_portals_lib_ok" = xyes; then
+
+            ac_portals_flags="none ${PTHREAD_CFLAGS} ${PTHREAD_LIBS}"
+            ac_portals_lib_ok=no
+
+            for flag in $ac_portals_flags; do
+
+                case $flag in
+                    none)
+                        AC_MSG_CHECKING([whether portals works without any additional flags])
+                    ;;
+
+                    -l*)
+                        AC_MSG_CHECKING([whether portals works with library $flag])
+                        EXTRA_LIBS="$flag"
+                        ;;
+
+                    -*)
+                        AC_MSG_CHECKING([whether portals works with library -l$flag])
+                        EXTRA_LIBS="$flag"
+                        ;;
+                esac
+
+                save_LIBS="$LIBS"
+                save_CFLAGS="$CFLAGS"
+                save_CPPFLAGS="$CPPFLAGS"
+                save_LDFLAGS="$LDFLAGS"
+
+                LIBS="$LIBS $PORTALS_LIBS $EXTRA_LIBS"
+                CFLAGS="$CFLAGS $PORTALS_CFLAGS $EXTRA_CFLAGS"
+                CPPFLAGS="$CPPFLAGS $PORTALS_CPPFLAGS"
+                LDFLAGS="$LDFLAGS $PORTALS_LDFLAGS"
+
+                dnl See if Portals will link with the provided flags
+                AC_LINK_IFELSE(AC_LANG_CALL([],[PtlInit]),
+                        [PORTALS_CFLAGS="$PORTALS_CFLAGS $EXTRA_CFLAGS";
+                        PORTALS_CPPFLAGS="$PORTALS_CPPFLAGS $EXTRA_CPPFLAGS";
+                        PORTALS_LIBS="$PORTALS_LIBS $EXTRA_LIBS";
+                        ac_portals_lib_ok=yes],
+                        [ac_portals_lib_ok=no])
+                AC_MSG_RESULT($ac_portals_lib_ok)
+
+                if test "x$ac_portals_lib_ok" = xyes; then
+                        PORTALS_LIBS="$PORTALS_LIBS $EXTRA_LIBS";
+                        PORTALS_CFLAGS="$PORTALS_CFLAGS $EXTRA_CFLAGS";
+                        PORTALS_CPPFLAGS="$PORTALS_CPPFLAGS $EXTRA_CFLAGS";
+                        if test `uname -s` = "Darwin"; then
+                              AM_CONDITIONAL(NEED_DARWIN_SINGLE_MODULE,true)
+                        fi
+                fi
+
+
+                dnl Restore environment variables
+                LIBS="$save_LIBS"
+                CFLAGS="$save_CFLAGS"
+                CPPFLAGS="$save_CPPFLAGS"
+                LDFLAGS="$save_LDFLAGS"
+
+            done
+        fi
+
+
+        if test x"$ac_portals_hdr_ok" = xno -o x$ac_portals_lib_ok = xno; then
+            AM_CONDITIONAL(HAVE_PORTALS,false)
+            PORTALS_CFLAGS=""
+            PORTALS_CPPFLAGS=""
+            PORTALS_LDFLAGS=""
+            PORTALS_LIBS=""
+        else
+            ac_portals_lib_ok=yes;
+            AM_CONDITIONAL(HAVE_PORTALS,true)
+        fi
+
+
+        dnl Create definitions for the include files
+        dnl AC_DEFINE_UNQUOTED([PORTALS_HEADER], ["$PORTALS_HEADER"],
+        dnl 	["Path to portals3.h"])
+        dnl AC_DEFINE_UNQUOTED([PORTALS_RT_HEADER], ["$PORTALS_RT_HEADER"],
+        dnl 	["Path to Portals runtime definitions"])
+        dnl AC_DEFINE_UNQUOTED([PORTALS_NAL_HEADER], ["$PORTALS_NAL_HEADER"],
+        dnl 	["Path to portals NAL definitions"])
+
+        dnl Check for portals types and functions defined in the 3.1 specification
+        if test x"$ac_portals_lib_ok" = xyes; then
+
+                save_CFLAGS=$CFLAGS
+                save_CPPFLAGS=$CPPFLAGS
+                save_LDFLAGS=$LDFLAGS
+                save_LIBS=$LIBS
+
+                CFLAGS="$CFLAGS $PORTALS_CFLAGS"
+                CPPFLAGS="$CPPFLAGS $PORTALS_CPPFLAGS"
+                LDFLAGS="$LDFLAGS $PORTALS_LDFLAGS"
+                LIBS="$LIBS $PORTALS_LIBS"
+
+                dnl See if we have PTL_NO_ACK_REQ or PTL_NOACK_REQ
+                AC_MSG_CHECKING([whether portals uses PTL_NO_ACK_REQ])
+                AC_LINK_IFELSE(AC_LANG_PROGRAM(
+                        [#if defined(HAVE_PORTALS3_H)
+                         #include <portals3.h>
+                         #elif defined(HAVE_PORTALS_PORTALS3_H)
+                         #include <portals/portals3.h>
+                         #else
+                         #error Cound not find include file
+                         #endif
+                 ],[int a = PTL_NO_ACK_REQ;]),
+                 [# Success
+                  AC_DEFINE(HAVE_PTL_NO_ACK_REQ,1,[Define if you have PTL_NO_ACK_REQ.])
+                  AC_MSG_RESULT(yes)
+                 ],
+                 [
+                  AC_MSG_RESULT(no)
+                  AC_MSG_CHECKING([whether portals uses PTL_NOACK_REQ])
+                  AC_LINK_IFELSE(AC_LANG_PROGRAM(
+                              [#if defined(HAVE_PORTALS3_H)
+                               #include <portals3.h>
+                               #elif defined(HAVE_PORTALS_PORTALS3_H)
+                               #include <portals/portals3.h>
+                               #else
+                               #error Cound not find include file
+                               #endif
+                       ],[int a = PTL_NOACK_REQ;]),
+                       [# Success
+                        AC_DEFINE(HAVE_PTL_NOACK_REQ,1,[Define if you have PTL_NOACK_REQ.])
+                        AC_MSG_RESULT(yes)
+                       ],
+                       [
+                        AC_MSG_RESULT(no)
+                       ])
+                 ])
+
+                AC_CHECK_TYPES([ptl_time_t, ptl_eq_handler_t],
+                        , ,
+                        [#if defined(HAVE_PORTALS3_H)
+                         #include <portals3.h>
+                         #elif defined(HAVE_PORTALS_PORTALS3_H)
+                         #include <portals/portals3.h>
+                         #endif])
+
+                AC_CHECK_FUNCS([PtlErrorStr \
+                        PtlNIFailStr \
+                        PtlEventKindStr \
+                        PtlGetJid \
+                        PtlACEntry])
+
+                CFLAGS=$save_CFLAGS
+                CPPFLAGS=$save_CPPFLAGS
+                LDFLAGS=$save_LDFLAGS
+                LIBS=$save_LIBS
+        fi
+
+
+        # This is a big hack.  This is fragile.  Try to determine if we are
+        # using Cray Portals.  Cray Portals generates more data movement
+        # events than Schutt (standard) Portals.  This requires a memory
+        # descriptor threshold adjustment.  Cannot be determined at runtime.
+        #
+        # This test relies on a priori knowledge of specific types and
+        # functions that are (un)defined.  If this list changes, this
+        # test will quickly crumble.
+        #
+        if test x"$ac_cv_func_PtlErrorStr" = xno -a \
+                x"$ac_cv_type_ptl_eq_handler_t" = xyes -a \
+                x"$ac_cv_func_PtlNIFailStr" = xno -a \
+                x"$ac_cv_func_PtlEventKindStr" = xno -a \
+                x"$ac_cv_func_PtlGetJid" = xyes -a \
+                x"$ac_cv_func_PtlACEntry" = xyes; then
+            AC_DEFINE(HAVE_CRAY_PORTALS,1,[Define if you have Cray Portals.])
+        fi
+
+
+        AC_SUBST(PORTALS_CPPFLAGS)
+        AC_SUBST(PORTALS_CFLAGS)
+        AC_SUBST(PORTALS_LDFLAGS)
+        AC_SUBST(PORTALS_LIBS)
+        AC_SUBST(PORTALS_HEADER)
+        AC_SUBST(PORTALS_NAL_HEADER)
+        AC_SUBST(PORTALS_RT_HEADER)
+
+        # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+        if test x"$ac_portals_lib_ok" = xyes; then
+                ifelse([$1],,[AC_DEFINE(HAVE_PORTALS,1,[Define if you have the Portals.])],[$1])
+                :
+        else
+                $2
+                :
+        fi
+fi
+AC_LANG_RESTORE
+])dnl AC_PORTALS
diff --git a/config/acx_mpi.m4 b/config/acx_mpi.m4
new file mode 100644
index 0000000..191d0b8
--- /dev/null
+++ b/config/acx_mpi.m4
@@ -0,0 +1,187 @@
+# ===========================================================================
+#                http://autoconf-archive.cryp.to/acx_mpi.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   ACX_MPI([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+#   This macro tries to find out how to compile programs that use MPI
+#   (Message Passing Interface), a standard API for parallel process
+#   communication (see http://www-unix.mcs.anl.gov/mpi/)
+#
+#   On success, it sets the MPICC, MPICXX, MPIF77, or MPIFC output variable
+#   to the name of the MPI compiler, depending upon the current language.
+#   (This may just be $CC/$CXX/$F77/$FC, but is more often something like
+#   mpicc/mpiCC/mpif77/mpif90.) It also sets MPILIBS to any libraries that
+#   are needed for linking MPI (e.g. -lmpi or -lfmpi, if a special
+#   MPICC/MPICXX/MPIF77/MPIFC was not found).
+#
+#   If you want to compile everything with MPI, you should set:
+#
+#       CC="MPICC" #OR# CXX="MPICXX" #OR# F77="MPIF77" #OR# FC="MPIFC"
+#       LIBS="$MPILIBS $LIBS"
+#
+#   NOTE: The above assumes that you will use $CC (or whatever) for linking
+#   as well as for compiling. (This is the default for automake and most
+#   Makefiles.)
+#
+#   The user can force a particular library/compiler by setting the
+#   MPICC/MPICXX/MPIF77/MPIFC and/or MPILIBS environment variables.
+#
+#   ACTION-IF-FOUND is a list of shell commands to run if an MPI library is
+#   found, and ACTION-IF-NOT-FOUND is a list of commands to run if it is not
+#   found. If ACTION-IF-FOUND is not specified, the default action will
+#   define HAVE_MPI.
+#
+# LAST MODIFICATION
+#
+#   2008-04-12
+#
+# COPYLEFT
+#
+#   Copyright (c) 2008 Steven G. Johnson <stevenj at alum.mit.edu>
+#   Copyright (c) 2008 Julian C. Cummings <cummings at cacr.caltech.edu>
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Macro Archive. When you make and
+#   distribute a modified version of the Autoconf Macro, you may extend this
+#   special exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([ACX_MPI], [
+AC_PREREQ(2.50) dnl for AC_LANG_CASE
+
+AM_CONDITIONAL(HAVE_MPI,true)
+
+AC_ARG_WITH(mpi,
+            [  --with-mpi=<location of MPI installation>],
+            [MPI_DIR=$withval])
+
+AC_LANG_CASE([C], [
+	AC_REQUIRE([AC_PROG_CC])
+	AC_ARG_VAR(MPICC,[MPI C compiler command])
+	AC_CHECK_PROGS(MPICC, mpicc hcc mpxlc_r mpxlc mpcc cmpicc, $CC)
+	acx_mpi_save_CC="$CC"
+	CC="$MPICC"
+	AC_SUBST(MPICC)
+],
+[C++], [
+	AC_REQUIRE([AC_PROG_CXX])
+	AC_ARG_VAR(MPICXX,[MPI C++ compiler command])
+	AC_CHECK_PROGS(MPICXX, mpic++ mpicxx mpiCC hcp mpxlC_r mpxlC mpCC cmpic++, $CXX)
+	acx_mpi_save_CXX="$CXX"
+	CXX="$MPICXX"
+	AC_SUBST(MPICXX)
+],
+[Fortran 77], [
+	AC_REQUIRE([AC_PROG_F77])
+	AC_ARG_VAR(MPIF77,[MPI Fortran 77 compiler command])
+	AC_CHECK_PROGS(MPIF77, mpif77 hf77 mpxlf_r mpxlf mpf77 cmpifc, $F77)
+	acx_mpi_save_F77="$F77"
+	F77="$MPIF77"
+	AC_SUBST(MPIF77)
+],
+[Fortran], [
+	AC_REQUIRE([AC_PROG_FC])
+	AC_ARG_VAR(MPIFC,[MPI Fortran compiler command])
+	AC_CHECK_PROGS(MPIFC, mpif90 mpxlf95_r mpxlf90_r mpxlf95 mpxlf90 mpf90 cmpif90c, $FC)
+	acx_mpi_save_FC="$FC"
+	FC="$MPIFC"
+	AC_SUBST(MPIFC)
+])
+
+if test x = x"$MPILIBS"; then
+	AC_LANG_CASE([C], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])],
+		[C++], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])],
+		[Fortran 77], [AC_MSG_CHECKING([for MPI_Init])
+			AC_LINK_IFELSE([AC_LANG_PROGRAM([],[      call MPI_Init])],[MPILIBS=" "
+				AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])],
+		[Fortran], [AC_MSG_CHECKING([for MPI_Init])
+			AC_LINK_IFELSE([AC_LANG_PROGRAM([],[      call MPI_Init])],[MPILIBS=" "
+				AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])])
+fi
+AC_LANG_CASE([Fortran 77], [
+	if test x = x"$MPILIBS"; then
+		AC_CHECK_LIB(fmpi, MPI_Init, [MPILIBS="-lfmpi"])
+	fi
+	if test x = x"$MPILIBS"; then
+		AC_CHECK_LIB(fmpich, MPI_Init, [MPILIBS="-lfmpich"])
+	fi
+],
+[Fortran], [
+	if test x = x"$MPILIBS"; then
+		AC_CHECK_LIB(fmpi, MPI_Init, [MPILIBS="-lfmpi"])
+	fi
+	if test x = x"$MPILIBS"; then
+		AC_CHECK_LIB(mpichf90, MPI_Init, [MPILIBS="-lmpichf90"])
+	fi
+])
+if test x = x"$MPILIBS"; then
+	AC_CHECK_LIB(mpi, MPI_Init, [MPILIBS="-lmpi"])
+fi
+if test x = x"$MPILIBS"; then
+	AC_CHECK_LIB(mpich, MPI_Init, [MPILIBS="-lmpich"])
+fi
+
+dnl We have to use AC_TRY_COMPILE and not AC_CHECK_HEADER because the
+dnl latter uses $CPP, not $CC (which may be mpicc).
+AC_LANG_CASE([C], [if test x != x"$MPILIBS"; then
+	AC_MSG_CHECKING([for mpi.h])
+	AC_TRY_COMPILE([#include <mpi.h>],[],[AC_MSG_RESULT(yes)], [MPILIBS=""
+		AC_MSG_RESULT(no)])
+fi],
+[C++], [if test x != x"$MPILIBS"; then
+	AC_MSG_CHECKING([for mpi.h])
+	AC_TRY_COMPILE([#include <mpi.h>],[],[AC_MSG_RESULT(yes)], [MPILIBS=""
+		AC_MSG_RESULT(no)])
+fi],
+[Fortran 77], [if test x != x"$MPILIBS"; then
+	AC_MSG_CHECKING([for mpif.h])
+	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[      include 'mpif.h'])],[AC_MSG_RESULT(yes)], [MPILIBS=""
+		AC_MSG_RESULT(no)])
+fi],
+[Fortran], [if test x != x"$MPILIBS"; then
+	AC_MSG_CHECKING([for mpif.h])
+	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[      include 'mpif.h'])],[AC_MSG_RESULT(yes)], [MPILIBS=""
+		AC_MSG_RESULT(no)])
+fi])
+
+AC_LANG_CASE([C], [CC="$acx_mpi_save_CC"],
+	[C++], [CXX="$acx_mpi_save_CXX"],
+	[Fortran 77], [F77="$acx_mpi_save_F77"],
+	[Fortran], [FC="$acx_mpi_save_FC"])
+
+AC_SUBST(MPILIBS)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x = x"$MPILIBS"; then
+        $2
+        :
+else
+        ifelse([$1],,[AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.])],[$1])
+        :
+fi
+])dnl ACX_MPI
diff --git a/config/acx_pthread.m4 b/config/acx_pthread.m4
new file mode 100644
index 0000000..f51bfbc
--- /dev/null
+++ b/config/acx_pthread.m4
@@ -0,0 +1,263 @@
+dnl 
+dnl  ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+dnl 
+dnl Description
+dnl 
+dnl This macro figures out how to build C programs using POSIX threads. It
+dnl sets the PTHREAD_LIBS output variable to the threads library and linker
+dnl flags, and the PTHREAD_CFLAGS output variable to any special C compiler
+dnl flags that are needed. (The user can also force certain compiler
+dnl flags/libs to be tested by setting these environment variables.)
+dnl 
+dnl Also sets PTHREAD_CC to any special C compiler that is needed for
+dnl multi-threaded programs (defaults to the value of CC otherwise). (This is
+dnl necessary on AIX to use the special cc_r compiler alias.)
+dnl 
+dnl NOTE: You are assumed to not only compile your program with these flags,
+dnl but also link it with them as well. e.g. you should link with $PTHREAD_CC
+dnl $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
+dnl 
+dnl If you are only building threads programs, you may wish to use these
+dnl variables in your default LIBS, CFLAGS, and CC:
+dnl 
+dnl        LIBS="$PTHREAD_LIBS $LIBS"
+dnl        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+dnl        CC="$PTHREAD_CC"
+dnl 
+dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
+dnl has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
+dnl (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+dnl 
+dnl ACTION-IF-FOUND is a list of shell commands to run if a threads library
+dnl is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
+dnl is not found. If ACTION-IF-FOUND is not specified, the default action
+dnl will define HAVE_PTHREAD.
+dnl 
+dnl Please let the authors know if this macro fails on any platform, or if
+dnl you have any other suggestions or comments. This macro was based on work
+dnl by SGJ on autoconf scripts for FFTW (www.fftw.org) (with help from M.
+dnl Frigo), as well as ac_pthread and hb_pthread macros posted by AFC to the
+dnl autoconf macro repository. We are also grateful for the helpful feedback
+dnl of numerous users.
+dnl 
+dnl Version: 1.8 (last modified: 2003-05-21)
+dnl Author: Steven G. Johnson <stevenj at alum.mit.edu> and
+dnl         Alejandro Forero Cuervo <bachue at bachue.com>
+dnl 
+dnl from http://www.gnu.org/software/ac-archive/htmldoc/index.html
+dnl 
+dnl License:
+dnl GNU General Public License
+dnl [http://www.gnu.org/software/ac-archive/htmldoc/COPYING.html]
+dnl with this special exception
+dnl [http://www.gnu.org/software/ac-archive/htmldoc/COPYING-Exception.html]. 
+dnl 
+
+AC_DEFUN([ACX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_SAVE
+AC_LANG_C
+acx_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
+        AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
+        AC_MSG_RESULT($acx_pthread_ok)
+        if test x"$acx_pthread_ok" = xno; then
+                PTHREAD_LIBS=""
+                PTHREAD_CFLAGS=""
+        fi
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try.  Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all.
+
+#acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt"
+acx_pthread_flags="pthreads none -Kthread -kthread lthread pthread -pthread -pthreads -mthreads pthread --thread-safe -mt"
+
+# The ordering *is* (sometimes) important.  Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+#       other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+#      doesn't hurt to check since this sometimes defines pthreads too;
+#      also defines -D_REENTRANT)
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+
+case "${host_cpu}-${host_os}" in
+        *solaris*)
+
+        # On Solaris (at least, for some versions), libc contains stubbed
+        # (non-functional) versions of the pthreads routines, so link-based
+        # tests will erroneously succeed.  (We need to link with -pthread or
+        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
+        # a function called by this macro, so we could check for that, but
+        # who knows whether they'll stub that too in a future libc.)  So,
+        # we'll just look for -pthreads and -lpthread first:
+
+        acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
+        ;;
+esac
+
+if test x"$acx_pthread_ok" = xno; then
+for flag in $acx_pthread_flags; do
+
+        case $flag in
+                none)
+                AC_MSG_CHECKING([whether pthreads work without any flags])
+                ;;
+
+                -*)
+                AC_MSG_CHECKING([whether pthreads work with $flag])
+                PTHREAD_CFLAGS="$flag"
+                ;;
+
+                *)
+                AC_MSG_CHECKING([for the pthreads library -l$flag])
+                PTHREAD_LIBS="-l$flag"
+                ;;
+        esac
+
+        save_LIBS="$LIBS"
+        save_CFLAGS="$CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Check for various functions.  We must include pthread.h,
+        # since some functions may be macros.  (On the Sequent, we
+        # need a special flag -Kthread to make this header compile.)
+        # We check for pthread_join because it is in -lpthread on IRIX
+        # while pthread_create is in libc.  We check for pthread_attr_init
+        # due to DEC craziness with -lpthreads.  We check for
+        # pthread_cleanup_push because it is one of the few pthread
+        # functions on Solaris that doesn't have a non-functional libc stub.
+        # We try pthread_create on general principles.
+	dnl AC_TRY_LINK([#include <pthread.h>],
+        dnl            [pthread_t th; pthread_join(th, 0);
+        dnl             pthread_attr_init(0); pthread_cleanup_push(0, 0);
+        dnl             pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
+        dnl            [acx_pthread_ok=yes])
+	AC_LINK_IFELSE(
+		[AC_LANG_PROGRAM(
+		    [[#include <pthread.h>]
+		     [void *start(void *arg){return NULL;}]
+		    ],
+		    [[pthread_attr_t attr;]
+		     [pthread_t th;] 
+		     [pthread_join(th, 0);] 
+		     [pthread_attr_init(&attr);]
+		     [pthread_cleanup_push(NULL, NULL);]
+		     [pthread_create(&th,&attr,start,0);]
+		     [pthread_cleanup_pop(0);]
+		    ])],
+		[acx_pthread_ok=yes],
+		[])
+
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        AC_MSG_RESULT($acx_pthread_ok)
+        if test "x$acx_pthread_ok" = xyes; then
+                break;
+        fi
+
+        PTHREAD_LIBS=""
+        PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$acx_pthread_ok" = xyes; then
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Detect AIX lossage: threads are created detached by default
+        # and the JOINABLE attribute has a nonstandard name (UNDETACHED).
+        AC_MSG_CHECKING([for joinable pthread attribute])
+        AC_TRY_LINK([#include <pthread.h>],
+                    [int attr; attr=PTHREAD_CREATE_JOINABLE;],
+                    ok=PTHREAD_CREATE_JOINABLE, ok=unknown)
+        if test x"$ok" = xunknown; then
+                AC_TRY_LINK([#include <pthread.h>],
+                            [int attr; attr=PTHREAD_CREATE_UNDETACHED;],
+                            ok=PTHREAD_CREATE_UNDETACHED, ok=unknown)
+        fi
+        if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then
+                AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok,
+                          [Define to the necessary symbol if this constant
+                           uses a non-standard name on your system.])
+        fi
+        AC_MSG_RESULT(${ok})
+        if test x"$ok" = xunknown; then
+                AC_MSG_WARN([we do not know how to create joinable pthreads])
+        fi
+
+        AC_MSG_CHECKING([if more special flags are required for pthreads])
+        flag=no
+        case "${host_cpu}-${host_os}" in
+                *-aix* | *-freebsd*)     flag="-D_THREAD_SAFE";;
+                *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+        esac
+        AC_MSG_RESULT(${flag})
+        if test "x$flag" != xno; then
+                PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+        fi
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        # More AIX lossage: must compile with cc_r
+        AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
+else
+        PTHREAD_CC="$CC"
+fi
+
+AC_SUBST(PTHREAD_LIBS)
+AC_SUBST(PTHREAD_CFLAGS)
+AC_SUBST(PTHREAD_CC)
+
+if test x"$acx_pthread_ok" = xyes; then
+    AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads])
+fi
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$acx_pthread_ok" = xyes; then
+        ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
+        :
+else
+        acx_pthread_ok=no
+        $2
+fi
+AC_LANG_RESTORE
+])dnl ACX_PTHREAD
diff --git a/config/cercs.m4 b/config/cercs.m4
new file mode 100644
index 0000000..7742c05
--- /dev/null
+++ b/config/cercs.m4
@@ -0,0 +1,256 @@
+dnl  Mon Jan 28 13:01:16 EST 2008
+dnl
+dnl cercs_require_package(package, include_file, library_file)
+dnl   either include file or library_file may be left off if not needed
+dnl   this macro searches for the files using find_cercs_file().  If
+dnl   found, it adds directory in which the found file resides to either 
+dnl   CPPFLAGS (with a -I prefix)  or LDFLAGS (with a -L prefix)
+dnl
+AC_DEFUN([CERCS_REQUIRE_PACKAGE],
+[
+AC_REQUIRE([CERCS_SET_ARCHIVE])
+AC_REQUIRE([CERCS_HAS_CYGPATH])
+if test -z "$with_local_specified"; then
+CERCS_REQUIRE_OTHER_PACKAGE($1,$2,$3)
+else
+CERCS_REQUIRE_OTHER_PACKAGE($1,$2,$3,1)
+fi
+])
+dnl
+dnl
+AC_DEFUN([CERCS_REQUIRE_OTHER_PACKAGE],
+[
+AC_REQUIRE([CERCS_SET_ARCHIVE])
+AC_REQUIRE([CERCS_HAS_CYGPATH])
+AC_ARG_WITH(translit($1, `/',`_'), translit([  --with-$1=DIR	Where to find $1 package], `/',`_'))
+define([with_translit], translit(with_$1, `/',`_'))
+if test -n "$with_translit"; then
+dnl
+dnl if they did a with, kill the cache variables
+dnl
+translit(unset cercs_cv_$1_include_arg,  `/',`_')
+translit(unset cercs_cv_$1_link_arg,  `/',`_')
+if test `echo $with_translit | sed 's/\(.\).*/\1/g'` != "/"; then
+with_translit=`pwd`/$with_translit
+fi
+fi
+ifelse([$2], , ,
+dnl
+dnl  if arg2 (include_file) is specified
+dnl
+AC_MSG_CHECKING(needed include args for $1 package)
+AC_CACHE_VAL(translit(cercs_cv_$1_include_arg, `/',`_'), 
+[
+ifelse([$4],1,[
+search_list="$PWD/../$1 $PWD/../../$1 $PWD/../../../$1"
+CERCS_SEARCH($search_list)
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+],
+CERCS_FIND_FILE($1, $2, cercs_tmp, $with_translit, include))
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "/usr/include/$2"; then
+translit(cercs_cv_$1_include_arg, `/',`_')=-I`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s#.$2##g"`
+fi
+])
+AC_MSG_RESULT(translit($cercs_cv_$1_include_arg, `/',`_'))
+dnl
+dnl  add the result to CPPFLAGS if it is absent
+dnl
+translit(if test -n "$cercs_cv_$1_include_arg"; then, `/',`_')
+translit(arg="$cercs_cv_$1_include_arg", `/',`_')
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+[if test `echo $DT_CPPFLAGS | grep -c "$no_dash_arg"` -eq 0; then
+if test `echo $arg | grep -c "$1"` -eq 0; then
+DT_CPPFLAGS="$DT_CPPFLAGS $arg";
+else
+DT_CPPFLAGS="$arg $DT_CPPFLAGS"
+fi
+fi]
+fi
+)
+ifelse([$3], , ,
+dnl
+dnl  if arg3 (library_file) is specified
+dnl
+AC_MSG_CHECKING(needed link args for $1 package)
+AC_CACHE_VAL(translit(cercs_cv_$1_link_dir,  `/',`_'), 
+[
+ifelse([$4],1,[
+search_list="$PWD/../$1 $PWD/../../$1 $PWD/../../../$1"
+CERCS_SEARCH($search_list)
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+],
+CERCS_FIND_FILE($1, $3, cercs_tmp, $with_translit, lib))
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "$3"; then
+translit(cercs_cv_$1_link_dir, `/',`_')=`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s/.$3//g"`
+else
+translit(cercs_cv_$1_link_dir="",  `/',`_')
+fi
+])
+AC_MSG_RESULT(translit($cercs_cv_$1_link_dir, `/',`_'))
+ld_arg="-L"
+new_flags=$LDFLAGS
+dnl
+dnl  add the result to LDFLAGS if it is absent
+dnl
+translit(cercs_cv_$1_link_arg=`echo $cercs_cv_$1_link_dir, `/',`_') | sed "/./ s/^/$ld_arg/1"`
+translit(if test -n "$cercs_cv_$1_link_arg"; then, `/',`_')
+translit(arg=$cercs_cv_$1_link_arg, `/',`_')
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+[if test `echo $new_flags | grep -c "$no_dash_arg"` -eq 0; then
+root=`echo $3 | sed 's/\..*//'`
+translit(if test ! -r $cercs_cv_$1_link_dir, `/`, `_`)/$root.la; then
+if eval "test \"\${LIBTOOL+set}\" = set"; then
+translit(arg="$cercs_cv_$1_link_arg "`echo $cercs_cv_$1_link_dir, `/',`_') | sed "/./ s/^/-R/1"`
+fi
+fi
+if test `echo $arg | grep -c "$1"` -eq 0; then
+dnl if arg does not includes a project spec add it at the end
+new_flags="$new_flags $arg"
+else
+new_flags="$arg $new_flags"
+fi
+fi]
+DT_LDFLAGS=$new_flags
+fi
+)
+])dnl
+dnl
+dnl cercs_find_file(package, file_to_find, variable_to_set, suggestion, dir_name)
+dnl    search a set of standard directories to find file_to_find.  When found,
+dnl    set $variable_to_set to the path of the file.  Use package and
+dnl    suggestions to help search.  Mostly this searches ~chaos (if it exists)
+dnl    and the usual suspects like:
+dnl    /usr/{include,lib} /usr/local/{include,lib} /opt/<package>/{include,lib}
+dnl    /opt/misc/{include,lib}.
+dnl
+AC_DEFUN([CERCS_FIND_FILE],
+[
+AC_REQUIRE([CERCS_HAS_CSH])
+AC_REQUIRE([CERCS_SET_ARCHIVE])
+$3=""
+search_list="./$2"
+CHAOS_HOMEDIR=""
+if test -n "$CSH"; then
+CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf  2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR=""
+fi
+if test -n "$4"; then
+if test `echo $4 | cut -c1` = "~"; then
+EXPANDED=`echo "echo $4" | csh -sf 2>/dev/null` || EXPANDED=""
+else
+EXPANDED=$4
+fi
+
+echo "Datatap = $datatap_dir"
+
+search_list="$datatap_dir/$2 $datatap_dir/lib/$2 $datatap_dir/include/$2 $search_list $EXPANDED/$2 $EXPANDED/$5/$2 $EXPANDED/share/$2 $EXPANDED/$cercs_cv_archive/$2 $EXPANDED/$cercs_cv_archive/$5/$2 $EXPANDED/$1/$2 $EXPANDED/$1/$cercs_cv_archive/$2 $EXPANDED/$1/$5/$2 $EXPANDED/$1/$5/$cercs_cv_archive/$2"
+fi
+if test -z "$with_installed_specified"; then
+search_list="$search_list `pwd`/../$1/$2 `pwd`/../$5/$2 `pwd`/../share/$2"
+if test "$CHAOS_HOMEDIR" != "$HOME"; then
+search_list="$search_list $HOME/$1/$2 $HOME/$cercs_cv_archive/$5/$2 $HOME/$5/$2"
+fi
+fi
+if test -n "$CHAOS_HOMEDIR" -a -n "$cercs_cv_archive"; then
+search_list="$search_list $CHAOS_HOMEDIR/$cercs_cv_archive/$1/$5/$2 $CHAOS_HOMEDIR/$cercs_cv_archive/$5/$2 $CHAOS_HOMEDIR/$1/$cercs_cv_archive/$5/$2 $CHAOS_HOMEDIR/$1/$5/$2 $CHAOS_HOMEDIR/$5/$2"
+fi
+if test "$libdir" != '${exec_prefix}/lib'; then
+tmpdir=`echo ${libdir} |  sed 's%/$%%'` 
+search_list="$tmpdir/$2 $search_list"
+fi
+if test "$exec_prefix" != "NONE"; then
+tmpdir=`echo ${exec_prefix} |  sed 's%/$%%'` 
+search_list="$tmpdir/lib/$2 $search_list"
+fi
+if test "$includedir" != '${prefix}/include'; then
+tmpdir=`echo ${includedir} |  sed 's%/$%%'` 
+search_list="$tmpdir/$2 $search_list"
+fi
+if test "$prefix" != "NONE"; then
+tmpdir=`echo ${prefix} |  sed 's%/$%%'` 
+search_list="$tmpdir/$5/$2 $search_list"
+fi
+if test "$5" == "lib"; then
+  for tmp_lib_value in $sys_lib_search_path_spec; do
+     search_list="$search_list $tmp_lib_value/$2"
+  done
+fi
+
+search_list="$datatap_dir/$2 $datatap_dir/lib/$2 $datatap_dir/include/$2 $search_list /usr/$5/$2 /usr/local/$5/$2 /opt/$1/$5/$2 /opt/misc/$5/$2 /opt/misc/$5/$cercs_cv_archive/$2"
+CERCS_SEARCH($search_list)
+if test -n "$tmp_search_results"; then
+$3=$tmp_search_results
+fi
+])dnl
+AC_DEFUN([CERCS_SET_INSTALLED],[AC_ARG_WITH(installed, [  --with-installed        Don't use local copies of CERCS packages],with_installed_specified=1)])
+AC_DEFUN([CERCS_SET_LOCAL],[AC_ARG_WITH(local, [  --with-local            Use only local copies of CERCS packages],with_local_specified=1)])
+dnl
+dnl CERCS_SET_ARCHIVE()
+dnl   set the $cercs_cv_machine_target variable to a standard archive name
+dnl
+AC_DEFUN([CERCS_SET_ARCHIVE],[
+AC_REQUIRE([CERCS_SET_INSTALLED])
+AC_REQUIRE([CERCS_SET_LOCAL])
+AC_REQUIRE([CERCS_HAS_CSH])
+CHAOS_HOMEDIR=""
+if test -n "$CSH"; then
+CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf  2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR=""
+fi
+if test "$cross_compiling" = yes ; then
+  cpu=$host_cpu
+  vendor=$host_vendot
+  os=$host_os
+else
+  cpu=
+  vendor=
+  os=
+fi
+if test -x $CHAOS_HOMEDIR/bin/cercs_arch; then
+cercs_cv_archive=`$CHAOS_HOMEDIR/bin/cercs_arch "$cpu" "$vendor" "$os"`
+else
+cercs_cv_archive=${cercs_cv_archive-`cercs_arch 2>/dev/null`} || cercs_cv_archive=""
+fi
+])dnl
+dnl
+dnl  CERCS_SEARCH(variable to define, options to try)
+define(CERCS_SEARCH,
+[tmp_search_results=""
+echo "configure:__oline__: searching for $1 " >&5
+for tmp_search_value in $1; do 
+   if test -r $tmp_search_value; then 
+	tmp_search_results=$tmp_search_value
+	echo "configure:__oline__: first found $tmp_search_results " >&5
+	break
+   fi 
+done
+])dnl
+dnl
+dnl
+dnl CERCS_LIB_PREFIX
+dnl  this macro tries to set a reasonable default for the prefix value
+dnl  call with two arguments, project name and library name
+dnl
+AC_DEFUN([CERCS_LIB_PREFIX],
+[if test "x$prefix" = xNONE; then
+AC_REQUIRE([CERCS_SET_ARCHIVE])
+search_list=""
+CHAOS_HOMEDIR=""
+if test -n "$CSH"; then
+CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf  2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR=""
+fi
+if test -n "$CHAOS_HOMEDIR"; then
+search_list="$search_list $CHAOS_HOMEDIR/$cercs_cv_archive/lib/$2 $CHAOS_HOMEDIR/lib/$2"
+fi
+search_list="$search_list /usr/lib/$2 /usr/local/lib/$2 /opt/$1/lib/$2 /opt/misc/lib/$2"
+CERCS_SEARCH($search_list)
+if test -n "$tmp_search_results"; then
+    prefix=`echo $tmp_search_results|sed "s%$cercs_cv_archive/lib/$2%%g;s%lib/$2%%g;s%/[^/][^/]*//*[^/][^/]*$%%"`
+    exec_prefix=`echo $tmp_search_results|sed 's%lib/$2%%g;s%/[^/][^/]*//*[^/][^/]*$%%'`
+fi
+fi
+])dnl
+AC_DEFUN([CERCS_HAS_CSH], [AC_PATH_PROG(CSH,csh)])dnl
+AC_DEFUN([CERCS_HAS_CYGPATH], [AC_CHECK_PROG(PATHPROG,cygpath,[cygpath -w],[echo])])dnl
diff --git a/config/compile b/config/compile
new file mode 100755
index 0000000..80b645b
--- /dev/null
+++ b/config/compile
@@ -0,0 +1,140 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand `-c -o'.
+
+scriptversion=2004-09-10.20
+
+# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey at cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand `-c -o'.
+Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file `INSTALL'.
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit 0
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit 0
+    ;;
+esac
+
+ofile=
+cfile=
+eat=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+	# configure might choose to run compile as `compile cc -o foo foo.c'.
+	# So we strip `-o arg' only if arg is an object.
+	eat=1
+	case $2 in
+	  *.o | *.obj)
+	    ofile=$2
+	    ;;
+	  *)
+	    set x "$@" -o "$2"
+	    shift
+	    ;;
+	esac
+	;;
+      *.c)
+	cfile=$1
+	set x "$@" "$1"
+	shift
+	;;
+      *)
+	set x "$@" "$1"
+	shift
+	;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no `-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # `.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use `[/.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  mv "$cofile" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/config/config.guess b/config/config.guess
new file mode 100755
index 0000000..2fc3acc
--- /dev/null
+++ b/config/config.guess
@@ -0,0 +1,1411 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+timestamp='2003-06-17'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Per Bothner <per at bothner.com>.
+# Please send patches to <config-patches at gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub.  If it succeeds, it prints the system name on stdout, and
+# exits with 0.  Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit 0 ;;
+    --version | -v )
+       echo "$version" ; exit 0 ;;
+    --help | --h* | -h )
+       echo "$usage"; exit 0 ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+	for c in cc gcc c89 c99 ; do
+	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+	     CC_FOR_BUILD="$c"; break ;
+	  fi ;
+	done ;
+	if test x"$CC_FOR_BUILD" = x ; then
+	  CC_FOR_BUILD=no_compiler_found ;
+	fi
+	;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi at noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+	PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+## for Red Hat Linux
+if test -f /etc/redhat-release ; then
+    VENDOR=redhat ;
+else
+    VENDOR= ;
+fi
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    *:NetBSD:*:*)
+	# NetBSD (nbsd) targets should (where applicable) match one or
+	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+	# switched to ELF, *-*-netbsd* would select the old
+	# object file format.  This provides both forward
+	# compatibility and a consistent mechanism for selecting the
+	# object file format.
+	#
+	# Note: NetBSD doesn't particularly care about the vendor
+	# portion of the name.  We always set it to "unknown".
+	sysctl="sysctl -n hw.machine_arch"
+	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	case "${UNAME_MACHINE_ARCH}" in
+	    armeb) machine=armeb-unknown ;;
+	    arm*) machine=arm-unknown ;;
+	    sh3el) machine=shl-unknown ;;
+	    sh3eb) machine=sh-unknown ;;
+	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+	esac
+	# The Operating System including object format, if it has switched
+	# to ELF recently, or will in the future.
+	case "${UNAME_MACHINE_ARCH}" in
+	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+		eval $set_cc_for_build
+		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+			| grep __ELF__ >/dev/null
+		then
+		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+		    # Return netbsd for either.  FIX?
+		    os=netbsd
+		else
+		    os=netbsdelf
+		fi
+		;;
+	    *)
+	        os=netbsd
+		;;
+	esac
+	# The OS release
+	# Debian GNU/NetBSD machines have a different userland, and
+	# thus, need a distinct triplet. However, they do not need
+	# kernel version information, so it can be replaced with a
+	# suitable tag, in the style of linux-gnu.
+	case "${UNAME_VERSION}" in
+	    Debian*)
+		release='-gnu'
+		;;
+	    *)
+		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+		;;
+	esac
+	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+	# contains redundant information, the shorter form:
+	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+	echo "${machine}-${os}${release}"
+	exit 0 ;;
+    amiga:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    arc:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    hp300:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mac68k:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    macppc:OpenBSD:*:*)
+	echo powerpc-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvme68k:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvme88k:OpenBSD:*:*)
+	echo m88k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvmeppc:OpenBSD:*:*)
+	echo powerpc-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    pmax:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    sgi:OpenBSD:*:*)
+	echo mipseb-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    sun3:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    wgrisc:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    *:OpenBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    alpha:OSF1:*:*)
+	if test $UNAME_RELEASE = "V4.0"; then
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+	fi
+	# According to Compaq, /usr/sbin/psrinfo has been available on
+	# OSF/1 and Tru64 systems produced since 1995.  I hope that
+	# covers most systems running today.  This code pipes the CPU
+	# types through head -n 1, so we only detect the type of CPU 0.
+	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+	case "$ALPHA_CPU_TYPE" in
+	    "EV4 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV4.5 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "LCA4 (21066/21068)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV5 (21164)")
+		UNAME_MACHINE="alphaev5" ;;
+	    "EV5.6 (21164A)")
+		UNAME_MACHINE="alphaev56" ;;
+	    "EV5.6 (21164PC)")
+		UNAME_MACHINE="alphapca56" ;;
+	    "EV5.7 (21164PC)")
+		UNAME_MACHINE="alphapca57" ;;
+	    "EV6 (21264)")
+		UNAME_MACHINE="alphaev6" ;;
+	    "EV6.7 (21264A)")
+		UNAME_MACHINE="alphaev67" ;;
+	    "EV6.8CB (21264C)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8AL (21264B)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8CX (21264D)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.9A (21264/EV69A)")
+		UNAME_MACHINE="alphaev69" ;;
+	    "EV7 (21364)")
+		UNAME_MACHINE="alphaev7" ;;
+	    "EV7.9 (21364A)")
+		UNAME_MACHINE="alphaev79" ;;
+	esac
+	# A Vn.n version is a released version.
+	# A Tn.n version is a released field test version.
+	# A Xn.n version is an unreleased experimental baselevel.
+	# 1.2 uses "1.2" for uname -r.
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	exit 0 ;;
+    Alpha*:OpenVMS:*:*)
+	echo alpha-hp-vms
+	exit 0 ;;
+    Alpha\ *:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# Should we change UNAME_MACHINE based on the output of uname instead
+	# of the specific Alpha model?
+	echo alpha-pc-interix
+	exit 0 ;;
+    21064:Windows_NT:50:3)
+	echo alpha-dec-winnt3.5
+	exit 0 ;;
+    Amiga*:UNIX_System_V:4.0:*)
+	echo m68k-unknown-sysv4
+	exit 0;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit 0 ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-morphos
+	exit 0 ;;
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
+	exit 0 ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+	echo arm-acorn-riscix${UNAME_RELEASE}
+	exit 0;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+	echo hppa1.1-hitachi-hiuxmpp
+	exit 0;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+	# akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+	if test "`(/bin/universe) 2>/dev/null`" = att ; then
+		echo pyramid-pyramid-sysv3
+	else
+		echo pyramid-pyramid-bsd
+	fi
+	exit 0 ;;
+    NILE*:*:*:dcosx)
+	echo pyramid-pyramid-svr4
+	exit 0 ;;
+    DRS?6000:unix:4.0:6*)
+	echo sparc-icl-nx6
+	exit 0 ;;
+    DRS?6000:UNIX_SV:4.2*:7*)
+	case `/usr/bin/uname -p` in
+	    sparc) echo sparc-icl-nx7 && exit 0 ;;
+	esac ;;
+    sun4H:SunOS:5.*:*)
+	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    i86pc:SunOS:5.*:*)
+	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    sun4*:SunOS:6*:*)
+	# According to config.sub, this is the proper way to canonicalize
+	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+	# it's likely to be more like Solaris than SunOS4.
+	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    sun4*:SunOS:*:*)
+	case "`/usr/bin/arch -k`" in
+	    Series*|S4*)
+		UNAME_RELEASE=`uname -v`
+		;;
+	esac
+	# Japanese Language versions have a version number like `4.1.3-JL'.
+	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	exit 0 ;;
+    sun3*:SunOS:*:*)
+	echo m68k-sun-sunos${UNAME_RELEASE}
+	exit 0 ;;
+    sun*:*:4.2BSD:*)
+	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+	case "`/bin/arch`" in
+	    sun3)
+		echo m68k-sun-sunos${UNAME_RELEASE}
+		;;
+	    sun4)
+		echo sparc-sun-sunos${UNAME_RELEASE}
+		;;
+	esac
+	exit 0 ;;
+    aushp:SunOS:*:*)
+	echo sparc-auspex-sunos${UNAME_RELEASE}
+	exit 0 ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit 0 ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+        exit 0 ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit 0 ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit 0 ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit 0 ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit 0 ;;
+    powerpc:machten:*:*)
+	echo powerpc-apple-machten${UNAME_RELEASE}
+	exit 0 ;;
+    RISC*:Mach:*:*)
+	echo mips-dec-mach_bsd4.3
+	exit 0 ;;
+    RISC*:ULTRIX:*:*)
+	echo mips-dec-ultrix${UNAME_RELEASE}
+	exit 0 ;;
+    VAX*:ULTRIX*:*:*)
+	echo vax-dec-ultrix${UNAME_RELEASE}
+	exit 0 ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+	echo clipper-intergraph-clix${UNAME_RELEASE}
+	exit 0 ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+	int main (int argc, char *argv[]) {
+#else
+	int main (argc, argv) int argc; char *argv[]; {
+#endif
+	#if defined (host_mips) && defined (MIPSEB)
+	#if defined (SYSTYPE_SYSV)
+	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_SVR4)
+	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+	#endif
+	#endif
+	  exit (-1);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c \
+	  && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+	  && exit 0
+	echo mips-mips-riscos${UNAME_RELEASE}
+	exit 0 ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit 0 ;;
+    Motorola:*:4.3:PL8-*)
+	echo powerpc-harris-powermax
+	exit 0 ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+	echo powerpc-harris-powermax
+	exit 0 ;;
+    Night_Hawk:Power_UNIX:*:*)
+	echo powerpc-harris-powerunix
+	exit 0 ;;
+    m88k:CX/UX:7*:*)
+	echo m88k-harris-cxux7
+	exit 0 ;;
+    m88k:*:4*:R4*)
+	echo m88k-motorola-sysv4
+	exit 0 ;;
+    m88k:*:3*:R3*)
+	echo m88k-motorola-sysv3
+	exit 0 ;;
+    AViiON:dgux:*:*)
+        # DG/UX returns AViiON for all architectures
+        UNAME_PROCESSOR=`/usr/bin/uname -p`
+	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+	then
+	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    then
+		echo m88k-dg-dgux${UNAME_RELEASE}
+	    else
+		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+	    fi
+	else
+	    echo i586-dg-dgux${UNAME_RELEASE}
+	fi
+ 	exit 0 ;;
+    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
+	echo m88k-dolphin-sysv3
+	exit 0 ;;
+    M88*:*:R3*:*)
+	# Delta 88k system running SVR3
+	echo m88k-motorola-sysv3
+	exit 0 ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+	echo m88k-tektronix-sysv3
+	exit 0 ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+	echo m68k-tektronix-bsd
+	exit 0 ;;
+    *:IRIX*:*:*)
+	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	exit 0 ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
+	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+	echo i386-ibm-aix
+	exit 0 ;;
+    ia64:AIX:*:*)
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	exit 0 ;;
+    *:AIX:2:3)
+	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+		eval $set_cc_for_build
+		sed 's/^		//' << EOF >$dummy.c
+		#include <sys/systemcfg.h>
+
+		main()
+			{
+			if (!__power_pc())
+				exit(1);
+			puts("powerpc-ibm-aix3.2.5");
+			exit(0);
+			}
+EOF
+		$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+		echo rs6000-ibm-aix3.2.5
+	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+		echo rs6000-ibm-aix3.2.4
+	else
+		echo rs6000-ibm-aix3.2
+	fi
+	exit 0 ;;
+    *:AIX:*:[45])
+	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+		IBM_ARCH=rs6000
+	else
+		IBM_ARCH=powerpc
+	fi
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+	exit 0 ;;
+    *:AIX:*:*)
+	echo rs6000-ibm-aix
+	exit 0 ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+	echo romp-ibm-bsd4.4
+	exit 0 ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	exit 0 ;;                           # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+	echo rs6000-bull-bosx
+	exit 0 ;;
+    DPX/2?00:B.O.S.:*:*)
+	echo m68k-bull-sysv3
+	exit 0 ;;
+    9000/[34]??:4.3bsd:1.*:*)
+	echo m68k-hp-bsd
+	exit 0 ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+	echo m68k-hp-bsd4.4
+	exit 0 ;;
+    9000/[34678]??:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	case "${UNAME_MACHINE}" in
+	    9000/31? )            HP_ARCH=m68000 ;;
+	    9000/[34]?? )         HP_ARCH=m68k ;;
+	    9000/[678][0-9][0-9])
+		if [ -x /usr/bin/getconf ]; then
+		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                    case "${sc_cpu_version}" in
+                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                      532)                      # CPU_PA_RISC2_0
+                        case "${sc_kernel_bits}" in
+                          32) HP_ARCH="hppa2.0n" ;;
+                          64) HP_ARCH="hppa2.0w" ;;
+			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+                        esac ;;
+                    esac
+		fi
+		if [ "${HP_ARCH}" = "" ]; then
+		    eval $set_cc_for_build
+		    sed 's/^              //' << EOF >$dummy.c
+
+              #define _HPUX_SOURCE
+              #include <stdlib.h>
+              #include <unistd.h>
+
+              int main ()
+              {
+              #if defined(_SC_KERNEL_BITS)
+                  long bits = sysconf(_SC_KERNEL_BITS);
+              #endif
+                  long cpu  = sysconf (_SC_CPU_VERSION);
+
+                  switch (cpu)
+              	{
+              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+              	case CPU_PA_RISC2_0:
+              #if defined(_SC_KERNEL_BITS)
+              	    switch (bits)
+              		{
+              		case 64: puts ("hppa2.0w"); break;
+              		case 32: puts ("hppa2.0n"); break;
+              		default: puts ("hppa2.0"); break;
+              		} break;
+              #else  /* !defined(_SC_KERNEL_BITS) */
+              	    puts ("hppa2.0"); break;
+              #endif
+              	default: puts ("hppa1.0"); break;
+              	}
+                  exit (0);
+              }
+EOF
+		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+		    test -z "$HP_ARCH" && HP_ARCH=hppa
+		fi ;;
+	esac
+	if [ ${HP_ARCH} = "hppa2.0w" ]
+	then
+	    # avoid double evaluation of $set_cc_for_build
+	    test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+	    then
+		HP_ARCH="hppa2.0w"
+	    else
+		HP_ARCH="hppa64"
+	    fi
+	fi
+	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	exit 0 ;;
+    ia64:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit 0 ;;
+    3050*:HI-UX:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <unistd.h>
+	int
+	main ()
+	{
+	  long cpu = sysconf (_SC_CPU_VERSION);
+	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+	     results, however.  */
+	  if (CPU_IS_PA_RISC (cpu))
+	    {
+	      switch (cpu)
+		{
+		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+		  default: puts ("hppa-hitachi-hiuxwe2"); break;
+		}
+	    }
+	  else if (CPU_IS_HP_MC68K (cpu))
+	    puts ("m68k-hitachi-hiuxwe2");
+	  else puts ("unknown-hitachi-hiuxwe2");
+	  exit (0);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+	echo unknown-hitachi-hiuxwe2
+	exit 0 ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+	echo hppa1.1-hp-bsd
+	exit 0 ;;
+    9000/8??:4.3bsd:*:*)
+	echo hppa1.0-hp-bsd
+	exit 0 ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+	echo hppa1.0-hp-mpeix
+	exit 0 ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+	echo hppa1.1-hp-osf
+	exit 0 ;;
+    hp8??:OSF1:*:*)
+	echo hppa1.0-hp-osf
+	exit 0 ;;
+    i*86:OSF1:*:*)
+	if [ -x /usr/sbin/sysversion ] ; then
+	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	else
+	    echo ${UNAME_MACHINE}-unknown-osf1
+	fi
+	exit 0 ;;
+    parisc*:Lites*:*:*)
+	echo hppa1.1-hp-lites
+	exit 0 ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+	echo c1-convex-bsd
+        exit 0 ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+        exit 0 ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+	echo c34-convex-bsd
+        exit 0 ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+	echo c38-convex-bsd
+        exit 0 ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+	echo c4-convex-bsd
+        exit 0 ;;
+    CRAY*Y-MP:*:*:*)
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*[A-Z]90:*:*:*)
+	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+	      -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*TS:*:*:*)
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*T3E:*:*:*)
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit 0 ;;
+    *:UNICOS/mp:*:*)
+	echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 
+	exit 0 ;;
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        exit 0 ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	exit 0 ;;
+    sparc*:BSD/OS:*:*)
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	exit 0 ;;
+    *:BSD/OS:*:*)
+	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	exit 0 ;;
+    *:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
+	# Determine whether the default compiler uses glibc.
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <features.h>
+	#if __GLIBC__ >= 2
+	LIBC=gnu
+	#else
+	LIBC=
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
+	exit 0 ;;
+    i*:CYGWIN*:*)
+	echo ${UNAME_MACHINE}-pc-cygwin
+	exit 0 ;;
+    i*:MINGW*:*)
+	echo ${UNAME_MACHINE}-pc-mingw32
+	exit 0 ;;
+    i*:PW*:*)
+	echo ${UNAME_MACHINE}-pc-pw32
+	exit 0 ;;
+    x86:Interix*:[34]*)
+	echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
+	exit 0 ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+	echo i${UNAME_MACHINE}-pc-mks
+	exit 0 ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+	# UNAME_MACHINE based on the output of uname instead of i386?
+	echo i586-pc-interix
+	exit 0 ;;
+    i*:UWIN*:*)
+	echo ${UNAME_MACHINE}-pc-uwin
+	exit 0 ;;
+    p*:CYGWIN*:*)
+	echo powerpcle-unknown-cygwin
+	exit 0 ;;
+    prep*:SunOS:5.*:*)
+	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit 0 ;;
+    *:GNU:*:*)
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	exit 0 ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit 0 ;;
+    arm*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    cris:Linux:*:*)
+	echo cris-axis-linux-gnu
+	exit 0 ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu
+	exit 0 ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    mips:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef mips
+	#undef mipsel
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=mipsel
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=mips
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+	;;
+    mips64:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef mips64
+	#undef mips64el
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=mips64el
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=mips64
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+	;;
+    ppc:Linux:*:*)
+	echo powerpc-${VENDOR:-unknown}-linux-gnu
+	exit 0 ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-${VENDOR:-unknown}-linux-gnu
+	exit 0 ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
+        esac
+	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	exit 0 ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+	# Look for CPU level
+	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+	  *)    echo hppa-unknown-linux-gnu ;;
+	esac
+	exit 0 ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
+	exit 0 ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu
+	exit 0 ;;
+    sh64*:Linux:*:*)
+    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
+    x86_64:Linux:*:*)
+	echo x86_64-${VENDOR:-unknown}-linux-gnu
+	exit 0 ;;
+    i*86:Linux:*:*)
+	# The BFD linker knows what the default object file format is, so
+	# first see if it will tell us. cd to the root directory to prevent
+	# problems with other programs or directories called `ld' in the path.
+	# Set LC_ALL=C to ensure ld outputs messages in English.
+	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+			 | sed -ne '/supported targets:/!d
+				    s/[ 	][ 	]*/ /g
+				    s/.*supported targets: *//
+				    s/ .*//
+				    p'`
+        case "$ld_supported_targets" in
+	  elf32-i386)
+		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+		;;
+	  a.out-i386-linux)
+		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+		exit 0 ;;
+	  coff-i386)
+		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+		exit 0 ;;
+	  "")
+		# Either a pre-BFD a.out linker (linux-gnuoldld) or
+		# one that does not give us useful --help.
+		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+		exit 0 ;;
+	esac
+	# Determine whether the default compiler is a.out or elf
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <features.h>
+	#ifdef __ELF__
+	# ifdef __GLIBC__
+	#  if __GLIBC__ >= 2
+	LIBC=gnu
+	#  else
+	LIBC=gnulibc1
+	#  endif
+	# else
+	LIBC=gnulibc1
+	# endif
+	#else
+	#ifdef __INTEL_COMPILER
+	LIBC=gnu
+	#else
+	LIBC=gnuaout
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+	test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0
+	test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+	;;
+    i*86:DYNIX/ptx:4*:*)
+	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+	# earlier versions are messed up and put the nodename in both
+	# sysname and nodename.
+	echo i386-sequent-sysv4
+	exit 0 ;;
+    i*86:UNIX_SV:4.2MP:2.*)
+        # Unixware is an offshoot of SVR4, but it has its own version
+        # number series starting with 2...
+        # I am not positive that other SVR4 systems won't match this,
+	# I just have to hope.  -- rms.
+        # Use sysv4.2uw... so that sysv4* matches it.
+	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+	exit 0 ;;
+    i*86:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit 0 ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit 0 ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit 0 ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit 0 ;;
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+	else
+		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+	fi
+	exit 0 ;;
+    i*86:*:5:[78]*)
+	case `/bin/uname -X | grep "^Machine"` in
+	    *486*)	     UNAME_MACHINE=i486 ;;
+	    *Pentium)	     UNAME_MACHINE=i586 ;;
+	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+	esac
+	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	exit 0 ;;
+    i*86:*:3.2:*)
+	if test -f /usr/options/cb.name; then
+		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+	elif /bin/uname -X 2>/dev/null >/dev/null ; then
+		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+			&& UNAME_MACHINE=i586
+		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+	else
+		echo ${UNAME_MACHINE}-pc-sysv32
+	fi
+	exit 0 ;;
+    pc:*:*:*)
+	# Left here for compatibility:
+        # uname -m prints for DJGPP always 'pc', but it prints nothing about
+        # the processor, so we play safe by assuming i386.
+	echo i386-pc-msdosdjgpp
+        exit 0 ;;
+    Intel:Mach:3*:*)
+	echo i386-pc-mach3
+	exit 0 ;;
+    paragon:*:*:*)
+	echo i860-intel-osf1
+	exit 0 ;;
+    i860:*:4.*:*) # i860-SVR4
+	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+	else # Add other i860-SVR4 vendors below as they are discovered.
+	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	fi
+	exit 0 ;;
+    mini*:CTIX:SYS*5:*)
+	# "miniframe"
+	echo m68010-convergent-sysv
+	exit 0 ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+	echo m68k-convergent-sysv
+	exit 0 ;;
+    M680?0:D-NIX:5.3:*)
+	echo m68k-diab-dnix
+	exit 0 ;;
+    M68*:*:R3V[567]*:*)
+	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
+	OS_REL=''
+	test -r /etc/.relid \
+	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	  && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && echo i486-ncr-sysv4 && exit 0 ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    mc68030:UNIX_System_V:4.*:*)
+	echo m68k-atari-sysv4
+	exit 0 ;;
+    TSUNAMI:LynxOS:2.*:*)
+	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    rs6000:LynxOS:2.*:*)
+	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit 0 ;;
+    SM[BE]S:UNIX_SV:*:*)
+	echo mips-dde-sysv${UNAME_RELEASE}
+	exit 0 ;;
+    RM*:ReliantUNIX-*:*:*)
+	echo mips-sni-sysv4
+	exit 0 ;;
+    RM*:SINIX-*:*:*)
+	echo mips-sni-sysv4
+	exit 0 ;;
+    *:SINIX-*:*:*)
+	if uname -p 2>/dev/null >/dev/null ; then
+		UNAME_MACHINE=`(uname -p) 2>/dev/null`
+		echo ${UNAME_MACHINE}-sni-sysv4
+	else
+		echo ns32k-sni-sysv
+	fi
+	exit 0 ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel at ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit 0 ;;
+    *:UNIX_System_V:4*:FTX*)
+	# From Gerald Hewes <hewes at openmarket.com>.
+	# How about differentiating between stratus architectures? -djm
+	echo hppa1.1-stratus-sysv4
+	exit 0 ;;
+    *:*:*:FTX*)
+	# From seanf at swdc.stratus.com.
+	echo i860-stratus-sysv4
+	exit 0 ;;
+    *:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo hppa1.1-stratus-vos
+	exit 0 ;;
+    mc68*:A/UX:*:*)
+	echo m68k-apple-aux${UNAME_RELEASE}
+	exit 0 ;;
+    news*:NEWS-OS:6*:*)
+	echo mips-sony-newsos6
+	exit 0 ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+	if [ -d /usr/nec ]; then
+	        echo mips-nec-sysv${UNAME_RELEASE}
+	else
+	        echo mips-unknown-sysv${UNAME_RELEASE}
+	fi
+        exit 0 ;;
+    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
+	echo powerpc-be-beos
+	exit 0 ;;
+    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
+	echo powerpc-apple-beos
+	exit 0 ;;
+    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
+	echo i586-pc-beos
+	exit 0 ;;
+    SX-4:SUPER-UX:*:*)
+	echo sx4-nec-superux${UNAME_RELEASE}
+	exit 0 ;;
+    SX-5:SUPER-UX:*:*)
+	echo sx5-nec-superux${UNAME_RELEASE}
+	exit 0 ;;
+    SX-6:SUPER-UX:*:*)
+	echo sx6-nec-superux${UNAME_RELEASE}
+	exit 0 ;;
+    Power*:Rhapsody:*:*)
+	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	exit 0 ;;
+    *:Rhapsody:*:*)
+	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	exit 0 ;;
+    *:Darwin:*:*)
+	case `uname -p` in
+	    *86) UNAME_PROCESSOR=i686 ;;
+	    powerpc) UNAME_PROCESSOR=powerpc ;;
+	esac
+	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+	exit 0 ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+	UNAME_PROCESSOR=`uname -p`
+	if test "$UNAME_PROCESSOR" = "x86"; then
+		UNAME_PROCESSOR=i386
+		UNAME_MACHINE=pc
+	fi
+	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+	exit 0 ;;
+    *:QNX:*:4*)
+	echo i386-pc-qnx
+	exit 0 ;;
+    NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk${UNAME_RELEASE}
+	exit 0 ;;
+    *:NonStop-UX:*:*)
+	echo mips-compaq-nonstopux
+	exit 0 ;;
+    BS2000:POSIX*:*:*)
+	echo bs2000-siemens-sysv
+	exit 0 ;;
+    DS/*:UNIX_System_V:*:*)
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	exit 0 ;;
+    *:Plan9:*:*)
+	# "uname -m" is not consistent, so use $cputype instead. 386
+	# is converted to i386 for consistency with other x86
+	# operating systems.
+	if test "$cputype" = "386"; then
+	    UNAME_MACHINE=i386
+	else
+	    UNAME_MACHINE="$cputype"
+	fi
+	echo ${UNAME_MACHINE}-unknown-plan9
+	exit 0 ;;
+    *:TOPS-10:*:*)
+	echo pdp10-unknown-tops10
+	exit 0 ;;
+    *:TENEX:*:*)
+	echo pdp10-unknown-tenex
+	exit 0 ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+	echo pdp10-dec-tops20
+	exit 0 ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+	echo pdp10-xkl-tops20
+	exit 0 ;;
+    *:TOPS-20:*:*)
+	echo pdp10-unknown-tops20
+	exit 0 ;;
+    *:ITS:*:*)
+	echo pdp10-unknown-its
+	exit 0 ;;
+    SEI:*:*:SEIUX)
+        echo mips-sei-seiux${UNAME_RELEASE}
+	exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+          "4"
+#else
+	  ""
+#endif
+         ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+	printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+	printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+	echo c1-convex-bsd
+	exit 0 ;;
+    c2*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit 0 ;;
+    c34*)
+	echo c34-convex-bsd
+	exit 0 ;;
+    c38*)
+	echo c38-convex-bsd
+	exit 0 ;;
+    c4*)
+	echo c4-convex-bsd
+	exit 0 ;;
+    esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+    ftp://ftp.gnu.org/pub/gnu/config/
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches at gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config/config.sub b/config/config.sub
new file mode 100755
index 0000000..6b2ff9f
--- /dev/null
+++ b/config/config.sub
@@ -0,0 +1,1500 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+timestamp='2003-06-18'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine.  It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Please send patches to <config-patches at gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit 0 ;;
+    --version | -v )
+       echo "$version" ; exit 0 ;;
+    --help | --h* | -h )
+       echo "$usage"; exit 0 ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit 0;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+	-sun*os*)
+		# Prevent following clause from handling this invalid input.
+		;;
+	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+	-apple | -axis)
+		os=
+		basic_machine=$1
+		;;
+	-sim | -cisco | -oki | -wec | -winbond)
+		os=
+		basic_machine=$1
+		;;
+	-scout)
+		;;
+	-wrs)
+		os=-vxworks
+		basic_machine=$1
+		;;
+	-chorusos*)
+		os=-chorusos
+		basic_machine=$1
+		;;
+ 	-chorusrdb)
+ 		os=-chorusrdb
+		basic_machine=$1
+ 		;;
+	-hiux*)
+		os=-hiuxwe2
+		;;
+	-sco5)
+		os=-sco3.2v5
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco4)
+		os=-sco3.2v4
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2.[4-9]*)
+		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2v[4-9]*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco*)
+		os=-sco3.2v2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-udk*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-isc)
+		os=-isc2.2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-clix*)
+		basic_machine=clipper-intergraph
+		;;
+	-isc*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-lynx*)
+		os=-lynxos
+		;;
+	-ptx*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+		;;
+	-windowsnt*)
+		os=`echo $os | sed -e 's/windowsnt/winnt/'`
+		;;
+	-psos*)
+		os=-psos
+		;;
+	-mint | -mint[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+	# Recognize the basic CPU types without company name.
+	# Some are omitted here because they have special meanings below.
+	1750a | 580 \
+	| a29k \
+	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+	| c4x | clipper \
+	| d10v | d30v | dlx | dsp16xx \
+	| fr30 | frv \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| i370 | i860 | i960 | ia64 \
+	| ip2k \
+	| m32r | m68000 | m68k | m88k | mcore \
+	| mips | mipsbe | mipseb | mipsel | mipsle \
+	| mips16 \
+	| mips64 | mips64el \
+	| mips64vr | mips64vrel \
+	| mips64orion | mips64orionel \
+	| mips64vr4100 | mips64vr4100el \
+	| mips64vr4300 | mips64vr4300el \
+	| mips64vr5000 | mips64vr5000el \
+	| mipsisa32 | mipsisa32el \
+	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa64 | mipsisa64el \
+	| mipsisa64sb1 | mipsisa64sb1el \
+	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipstx39 | mipstx39el \
+	| mn10200 | mn10300 \
+	| msp430 \
+	| ns16k | ns32k \
+	| openrisc | or32 \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| pyramid \
+	| s390 | s390x \
+	| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+	| sh64 | sh64le \
+	| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
+	| strongarm \
+	| tahoe | thumb | tic4x | tic80 | tron \
+	| v850 | v850e \
+	| we32k \
+	| x86 | xscale | xstormy16 | xtensa \
+	| z8k)
+		basic_machine=$basic_machine-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12)
+		# Motorola 68HC11/12.
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+		;;
+
+	# We use `pc' rather than `unknown'
+	# because (1) that's what they normally are, and
+	# (2) the word "unknown" tends to confuse beginning users.
+	i*86 | x86_64)
+	  basic_machine=$basic_machine-pc
+	  ;;
+	# Object if more than one company name word.
+	*-*-*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+	# Recognize the basic CPU types with company name.
+	580-* \
+	| a29k-* \
+	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+	| avr-* \
+	| bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+	| clipper-* | cydra-* \
+	| d10v-* | d30v-* | dlx-* \
+	| elxsi-* \
+	| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+	| h8300-* | h8500-* \
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| i*86-* | i860-* | i960-* | ia64-* \
+	| ip2k-* \
+	| m32r-* \
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | mcore-* \
+	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+	| mips16-* \
+	| mips64-* | mips64el-* \
+	| mips64vr-* | mips64vrel-* \
+	| mips64orion-* | mips64orionel-* \
+	| mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* \
+	| mips64vr5000-* | mips64vr5000el-* \
+	| mipsisa32-* | mipsisa32el-* \
+	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa64-* | mipsisa64el-* \
+	| mipsisa64sb1-* | mipsisa64sb1el-* \
+	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipstx39-* | mipstx39el-* \
+	| msp430-* \
+	| none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
+	| orion-* \
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| pyramid-* \
+	| romp-* | rs6000-* \
+	| s390-* | s390x-* \
+	| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+	| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+	| tahoe-* | thumb-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tron-* \
+	| v850-* | v850e-* | vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
+	| xtensa-* \
+	| ymp-* \
+	| z8k-*)
+		;;
+	# Recognize the various machine names and aliases which stand
+	# for a CPU type and a company and sometimes even an OS.
+	386bsd)
+		basic_machine=i386-unknown
+		os=-bsd
+		;;
+	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+		basic_machine=m68000-att
+		;;
+	3b*)
+		basic_machine=we32k-att
+		;;
+	a29khif)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	adobe68k)
+		basic_machine=m68010-adobe
+		os=-scout
+		;;
+	alliant | fx80)
+		basic_machine=fx80-alliant
+		;;
+	altos | altos3068)
+		basic_machine=m68k-altos
+		;;
+	am29k)
+		basic_machine=a29k-none
+		os=-bsd
+		;;
+	amd64)
+		basic_machine=x86_64-pc
+		;;
+	amdahl)
+		basic_machine=580-amdahl
+		os=-sysv
+		;;
+	amiga | amiga-*)
+		basic_machine=m68k-unknown
+		;;
+	amigaos | amigados)
+		basic_machine=m68k-unknown
+		os=-amigaos
+		;;
+	amigaunix | amix)
+		basic_machine=m68k-unknown
+		os=-sysv4
+		;;
+	apollo68)
+		basic_machine=m68k-apollo
+		os=-sysv
+		;;
+	apollo68bsd)
+		basic_machine=m68k-apollo
+		os=-bsd
+		;;
+	aux)
+		basic_machine=m68k-apple
+		os=-aux
+		;;
+	balance)
+		basic_machine=ns32k-sequent
+		os=-dynix
+		;;
+	c90)
+		basic_machine=c90-cray
+		os=-unicos
+		;;
+	convex-c1)
+		basic_machine=c1-convex
+		os=-bsd
+		;;
+	convex-c2)
+		basic_machine=c2-convex
+		os=-bsd
+		;;
+	convex-c32)
+		basic_machine=c32-convex
+		os=-bsd
+		;;
+	convex-c34)
+		basic_machine=c34-convex
+		os=-bsd
+		;;
+	convex-c38)
+		basic_machine=c38-convex
+		os=-bsd
+		;;
+	cray | j90)
+		basic_machine=j90-cray
+		os=-unicos
+		;;
+	crds | unos)
+		basic_machine=m68k-crds
+		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
+	da30 | da30-*)
+		basic_machine=m68k-da30
+		;;
+	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+		basic_machine=mips-dec
+		;;
+	decsystem10* | dec10*)
+		basic_machine=pdp10-dec
+		os=-tops10
+		;;
+	decsystem20* | dec20*)
+		basic_machine=pdp10-dec
+		os=-tops20
+		;;
+	delta | 3300 | motorola-3300 | motorola-delta \
+	      | 3300-motorola | delta-motorola)
+		basic_machine=m68k-motorola
+		;;
+	delta88)
+		basic_machine=m88k-motorola
+		os=-sysv3
+		;;
+	dpx20 | dpx20-*)
+		basic_machine=rs6000-bull
+		os=-bosx
+		;;
+	dpx2* | dpx2*-bull)
+		basic_machine=m68k-bull
+		os=-sysv3
+		;;
+	ebmon29k)
+		basic_machine=a29k-amd
+		os=-ebmon
+		;;
+	elxsi)
+		basic_machine=elxsi-elxsi
+		os=-bsd
+		;;
+	encore | umax | mmax)
+		basic_machine=ns32k-encore
+		;;
+	es1800 | OSE68k | ose68k | ose | OSE)
+		basic_machine=m68k-ericsson
+		os=-ose
+		;;
+	fx2800)
+		basic_machine=i860-alliant
+		;;
+	genix)
+		basic_machine=ns32k-ns
+		;;
+	gmicro)
+		basic_machine=tron-gmicro
+		os=-sysv
+		;;
+	go32)
+		basic_machine=i386-pc
+		os=-go32
+		;;
+	h3050r* | hiux*)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	h8300hms)
+		basic_machine=h8300-hitachi
+		os=-hms
+		;;
+	h8300xray)
+		basic_machine=h8300-hitachi
+		os=-xray
+		;;
+	h8500hms)
+		basic_machine=h8500-hitachi
+		os=-hms
+		;;
+	harris)
+		basic_machine=m88k-harris
+		os=-sysv3
+		;;
+	hp300-*)
+		basic_machine=m68k-hp
+		;;
+	hp300bsd)
+		basic_machine=m68k-hp
+		os=-bsd
+		;;
+	hp300hpux)
+		basic_machine=m68k-hp
+		os=-hpux
+		;;
+	hp3k9[0-9][0-9] | hp9[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k2[0-9][0-9] | hp9k31[0-9])
+		basic_machine=m68000-hp
+		;;
+	hp9k3[2-9][0-9])
+		basic_machine=m68k-hp
+		;;
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k78[0-9] | hp78[0-9])
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][13679] | hp8[0-9][13679])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][0-9] | hp8[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hppa-next)
+		os=-nextstep3
+		;;
+	hppaosf)
+		basic_machine=hppa1.1-hp
+		os=-osf
+		;;
+	hppro)
+		basic_machine=hppa1.1-hp
+		os=-proelf
+		;;
+	i370-ibm* | ibm*)
+		basic_machine=i370-ibm
+		;;
+# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
+	i*86v32)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv32
+		;;
+	i*86v4*)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv4
+		;;
+	i*86v)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv
+		;;
+	i*86sol2)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-solaris2
+		;;
+	i386mach)
+		basic_machine=i386-mach
+		os=-mach
+		;;
+	i386-vsta | vsta)
+		basic_machine=i386-unknown
+		os=-vsta
+		;;
+	iris | iris4d)
+		basic_machine=mips-sgi
+		case $os in
+		    -irix*)
+			;;
+		    *)
+			os=-irix4
+			;;
+		esac
+		;;
+	isi68 | isi)
+		basic_machine=m68k-isi
+		os=-sysv
+		;;
+	m88k-omron*)
+		basic_machine=m88k-omron
+		;;
+	magnum | m3230)
+		basic_machine=mips-mips
+		os=-sysv
+		;;
+	merlin)
+		basic_machine=ns32k-utek
+		os=-sysv
+		;;
+	mingw32)
+		basic_machine=i386-pc
+		os=-mingw32
+		;;
+	miniframe)
+		basic_machine=m68000-convergent
+		;;
+	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+	mips3*-*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+		;;
+	mips3*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+		;;
+	mmix*)
+		basic_machine=mmix-knuth
+		os=-mmixware
+		;;
+	monitor)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	morphos)
+		basic_machine=powerpc-unknown
+		os=-morphos
+		;;
+	msdos)
+		basic_machine=i386-pc
+		os=-msdos
+		;;
+	mvs)
+		basic_machine=i370-ibm
+		os=-mvs
+		;;
+	ncr3000)
+		basic_machine=i486-ncr
+		os=-sysv4
+		;;
+	netbsd386)
+		basic_machine=i386-unknown
+		os=-netbsd
+		;;
+	netwinder)
+		basic_machine=armv4l-rebel
+		os=-linux
+		;;
+	news | news700 | news800 | news900)
+		basic_machine=m68k-sony
+		os=-newsos
+		;;
+	news1000)
+		basic_machine=m68030-sony
+		os=-newsos
+		;;
+	news-3600 | risc-news)
+		basic_machine=mips-sony
+		os=-newsos
+		;;
+	necv70)
+		basic_machine=v70-nec
+		os=-sysv
+		;;
+	next | m*-next )
+		basic_machine=m68k-next
+		case $os in
+		    -nextstep* )
+			;;
+		    -ns2*)
+		      os=-nextstep2
+			;;
+		    *)
+		      os=-nextstep3
+			;;
+		esac
+		;;
+	nh3000)
+		basic_machine=m68k-harris
+		os=-cxux
+		;;
+	nh[45]000)
+		basic_machine=m88k-harris
+		os=-cxux
+		;;
+	nindy960)
+		basic_machine=i960-intel
+		os=-nindy
+		;;
+	mon960)
+		basic_machine=i960-intel
+		os=-mon960
+		;;
+	nonstopux)
+		basic_machine=mips-compaq
+		os=-nonstopux
+		;;
+	np1)
+		basic_machine=np1-gould
+		;;
+	nv1)
+		basic_machine=nv1-cray
+		os=-unicosmp
+		;;
+	nsr-tandem)
+		basic_machine=nsr-tandem
+		;;
+	op50n-* | op60c-*)
+		basic_machine=hppa1.1-oki
+		os=-proelf
+		;;
+	or32 | or32-*)
+		basic_machine=or32-unknown
+		os=-coff
+		;;
+	OSE68000 | ose68000)
+		basic_machine=m68000-ericsson
+		os=-ose
+		;;
+	os68k)
+		basic_machine=m68k-none
+		os=-os68k
+		;;
+	pa-hitachi)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	paragon)
+		basic_machine=i860-intel
+		os=-osf
+		;;
+	pbd)
+		basic_machine=sparc-tti
+		;;
+	pbb)
+		basic_machine=m68k-tti
+		;;
+	pc532 | pc532-*)
+		basic_machine=ns32k-pc532
+		;;
+	pentium | p5 | k5 | k6 | nexgen | viac3)
+		basic_machine=i586-pc
+		;;
+	pentiumpro | p6 | 6x86 | athlon | athlon_*)
+		basic_machine=i686-pc
+		;;
+	pentiumii | pentium2 | pentiumiii | pentium3)
+		basic_machine=i686-pc
+		;;
+	pentium4)
+		basic_machine=i786-pc
+		;;
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumpro-* | p6-* | 6x86-* | athlon-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentium4-*)
+		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pn)
+		basic_machine=pn-gould
+		;;
+	power)	basic_machine=power-ibm
+		;;
+	ppc)	basic_machine=powerpc-unknown
+		;;
+	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppcle | powerpclittle | ppc-le | powerpc-little)
+		basic_machine=powerpcle-unknown
+		;;
+	ppcle-* | powerpclittle-*)
+		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64)	basic_machine=powerpc64-unknown
+		;;
+	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+		basic_machine=powerpc64le-unknown
+		;;
+	ppc64le-* | powerpc64little-*)
+		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ps2)
+		basic_machine=i386-ibm
+		;;
+	pw32)
+		basic_machine=i586-unknown
+		os=-pw32
+		;;
+	rom68k)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	rm[46]00)
+		basic_machine=mips-siemens
+		;;
+	rtpc | rtpc-*)
+		basic_machine=romp-ibm
+		;;
+	sa29200)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	sb1)
+		basic_machine=mipsisa64sb1-unknown
+		;;
+	sb1el)
+		basic_machine=mipsisa64sb1el-unknown
+		;;
+	sei)
+		basic_machine=mips-sei
+		os=-seiux
+		;;
+	sequent)
+		basic_machine=i386-sequent
+		;;
+	sh)
+		basic_machine=sh-hitachi
+		os=-hms
+		;;
+	sh64)
+		basic_machine=sh64-unknown
+		;;
+	sparclite-wrs | simso-wrs)
+		basic_machine=sparclite-wrs
+		os=-vxworks
+		;;
+	sps7)
+		basic_machine=m68k-bull
+		os=-sysv2
+		;;
+	spur)
+		basic_machine=spur-unknown
+		;;
+	st2000)
+		basic_machine=m68k-tandem
+		;;
+	stratus)
+		basic_machine=i860-stratus
+		os=-sysv4
+		;;
+	sun2)
+		basic_machine=m68000-sun
+		;;
+	sun2os3)
+		basic_machine=m68000-sun
+		os=-sunos3
+		;;
+	sun2os4)
+		basic_machine=m68000-sun
+		os=-sunos4
+		;;
+	sun3os3)
+		basic_machine=m68k-sun
+		os=-sunos3
+		;;
+	sun3os4)
+		basic_machine=m68k-sun
+		os=-sunos4
+		;;
+	sun4os3)
+		basic_machine=sparc-sun
+		os=-sunos3
+		;;
+	sun4os4)
+		basic_machine=sparc-sun
+		os=-sunos4
+		;;
+	sun4sol2)
+		basic_machine=sparc-sun
+		os=-solaris2
+		;;
+	sun3 | sun3-*)
+		basic_machine=m68k-sun
+		;;
+	sun4)
+		basic_machine=sparc-sun
+		;;
+	sun386 | sun386i | roadrunner)
+		basic_machine=i386-sun
+		;;
+	sv1)
+		basic_machine=sv1-cray
+		os=-unicos
+		;;
+	symmetry)
+		basic_machine=i386-sequent
+		os=-dynix
+		;;
+	t3e)
+		basic_machine=alphaev5-cray
+		os=-unicos
+		;;
+	t90)
+		basic_machine=t90-cray
+		os=-unicos
+		;;
+	tic54x | c54x*)
+		basic_machine=tic54x-unknown
+		os=-coff
+		;;
+	tic55x | c55x*)
+		basic_machine=tic55x-unknown
+		os=-coff
+		;;
+	tic6x | c6x*)
+		basic_machine=tic6x-unknown
+		os=-coff
+		;;
+	tx39)
+		basic_machine=mipstx39-unknown
+		;;
+	tx39el)
+		basic_machine=mipstx39el-unknown
+		;;
+	toad1)
+		basic_machine=pdp10-xkl
+		os=-tops20
+		;;
+	tower | tower-32)
+		basic_machine=m68k-ncr
+		;;
+	udi29k)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	ultra3)
+		basic_machine=a29k-nyu
+		os=-sym1
+		;;
+	v810 | necv810)
+		basic_machine=v810-nec
+		os=-none
+		;;
+	vaxv)
+		basic_machine=vax-dec
+		os=-sysv
+		;;
+	vms)
+		basic_machine=vax-dec
+		os=-vms
+		;;
+	vpp*|vx|vx-*)
+		basic_machine=f301-fujitsu
+		;;
+	vxworks960)
+		basic_machine=i960-wrs
+		os=-vxworks
+		;;
+	vxworks68)
+		basic_machine=m68k-wrs
+		os=-vxworks
+		;;
+	vxworks29k)
+		basic_machine=a29k-wrs
+		os=-vxworks
+		;;
+	w65*)
+		basic_machine=w65-wdc
+		os=-none
+		;;
+	w89k-*)
+		basic_machine=hppa1.1-winbond
+		os=-proelf
+		;;
+	xps | xps100)
+		basic_machine=xps100-honeywell
+		;;
+	ymp)
+		basic_machine=ymp-cray
+		os=-unicos
+		;;
+	z8k-*-coff)
+		basic_machine=z8k-unknown
+		os=-sim
+		;;
+	none)
+		basic_machine=none-none
+		os=-none
+		;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+	w89k)
+		basic_machine=hppa1.1-winbond
+		;;
+	op50n)
+		basic_machine=hppa1.1-oki
+		;;
+	op60c)
+		basic_machine=hppa1.1-oki
+		;;
+	romp)
+		basic_machine=romp-ibm
+		;;
+	rs6000)
+		basic_machine=rs6000-ibm
+		;;
+	vax)
+		basic_machine=vax-dec
+		;;
+	pdp10)
+		# there are many clones, so DEC is not a safe bet
+		basic_machine=pdp10-unknown
+		;;
+	pdp11)
+		basic_machine=pdp11-dec
+		;;
+	we32k)
+		basic_machine=we32k-att
+		;;
+	sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+		basic_machine=sh-unknown
+		;;
+	sh64)
+		basic_machine=sh64-unknown
+		;;
+	sparc | sparcv8 | sparcv9 | sparcv9b)
+		basic_machine=sparc-sun
+		;;
+	cydra)
+		basic_machine=cydra-cydrome
+		;;
+	orion)
+		basic_machine=orion-highlevel
+		;;
+	orion105)
+		basic_machine=clipper-highlevel
+		;;
+	mac | mpw | mac-mpw)
+		basic_machine=m68k-apple
+		;;
+	pmac | pmac-mpw)
+		basic_machine=powerpc-apple
+		;;
+	*-unknown)
+		# Make sure to match an already-canonicalized machine name.
+		;;
+	*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+	*-digital*)
+		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+		;;
+	*-commodore*)
+		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+		;;
+	*)
+		;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+        # First match some system type aliases
+        # that might get confused with valid system types.
+	# -solaris* is a basic system type, with this one exception.
+	-solaris1 | -solaris1.*)
+		os=`echo $os | sed -e 's|solaris1|sunos4|'`
+		;;
+	-solaris)
+		os=-solaris2
+		;;
+	-svr4*)
+		os=-sysv4
+		;;
+	-unixware*)
+		os=-sysv4.2uw
+		;;
+	-gnu/linux*)
+		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+		;;
+	# First accept the basic system types.
+	# The portable systems comes first.
+	# Each alternative MUST END IN A *, to match a version number.
+	# -sysv* is not here because it comes later, after sysvr4.
+	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+	      | -aos* \
+	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+	      | -chorusos* | -chorusrdb* \
+	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
+	# Remember, each alternative MUST END IN *, to match a version number.
+		;;
+	-qnx*)
+		case $basic_machine in
+		    x86-* | i*86-*)
+			;;
+		    *)
+			os=-nto$os
+			;;
+		esac
+		;;
+	-nto-qnx*)
+		;;
+	-nto*)
+		os=`echo $os | sed -e 's|nto|nto-qnx|'`
+		;;
+	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+		;;
+	-mac*)
+		os=`echo $os | sed -e 's|mac|macos|'`
+		;;
+	-linux*)
+		os=`echo $os | sed -e 's|linux|linux-gnu|'`
+		;;
+	-sunos5*)
+		os=`echo $os | sed -e 's|sunos5|solaris2|'`
+		;;
+	-sunos6*)
+		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+		;;
+	-opened*)
+		os=-openedition
+		;;
+	-wince*)
+		os=-wince
+		;;
+	-osfrose*)
+		os=-osfrose
+		;;
+	-osf*)
+		os=-osf
+		;;
+	-utek*)
+		os=-bsd
+		;;
+	-dynix*)
+		os=-bsd
+		;;
+	-acis*)
+		os=-aos
+		;;
+	-atheos*)
+		os=-atheos
+		;;
+	-386bsd)
+		os=-bsd
+		;;
+	-ctix* | -uts*)
+		os=-sysv
+		;;
+	-nova*)
+		os=-rtmk-nova
+		;;
+	-ns2 )
+		os=-nextstep2
+		;;
+	-nsk*)
+		os=-nsk
+		;;
+	# Preserve the version number of sinix5.
+	-sinix5.*)
+		os=`echo $os | sed -e 's|sinix|sysv|'`
+		;;
+	-sinix*)
+		os=-sysv4
+		;;
+	-triton*)
+		os=-sysv3
+		;;
+	-oss*)
+		os=-sysv3
+		;;
+	-svr4)
+		os=-sysv4
+		;;
+	-svr3)
+		os=-sysv3
+		;;
+	-sysvr4)
+		os=-sysv4
+		;;
+	# This must come after -sysvr4.
+	-sysv*)
+		;;
+	-ose*)
+		os=-ose
+		;;
+	-es1800*)
+		os=-ose
+		;;
+	-xenix)
+		os=-xenix
+		;;
+	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+		os=-mint
+		;;
+	-aros*)
+		os=-aros
+		;;
+	-kaos*)
+		os=-kaos
+		;;
+	-none)
+		;;
+	*)
+		# Get rid of the `-' at the beginning of $os.
+		os=`echo $os | sed 's/[^-]*-//'`
+		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		exit 1
+		;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+	*-acorn)
+		os=-riscix1.2
+		;;
+	arm*-rebel)
+		os=-linux
+		;;
+	arm*-semi)
+		os=-aout
+		;;
+	c4x-* | tic4x-*)
+		os=-coff
+		;;
+	# This must come before the *-dec entry.
+	pdp10-*)
+		os=-tops20
+		;;
+	pdp11-*)
+		os=-none
+		;;
+	*-dec | vax-*)
+		os=-ultrix4.2
+		;;
+	m68*-apollo)
+		os=-domain
+		;;
+	i386-sun)
+		os=-sunos4.0.2
+		;;
+	m68000-sun)
+		os=-sunos3
+		# This also exists in the configure program, but was not the
+		# default.
+		# os=-sunos4
+		;;
+	m68*-cisco)
+		os=-aout
+		;;
+	mips*-cisco)
+		os=-elf
+		;;
+	mips*-*)
+		os=-elf
+		;;
+	or32-*)
+		os=-coff
+		;;
+	*-tti)	# must be before sparc entry or we get the wrong os.
+		os=-sysv3
+		;;
+	sparc-* | *-sun)
+		os=-sunos4.1.1
+		;;
+	*-be)
+		os=-beos
+		;;
+	*-ibm)
+		os=-aix
+		;;
+	*-wec)
+		os=-proelf
+		;;
+	*-winbond)
+		os=-proelf
+		;;
+	*-oki)
+		os=-proelf
+		;;
+	*-hp)
+		os=-hpux
+		;;
+	*-hitachi)
+		os=-hiux
+		;;
+	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+		os=-sysv
+		;;
+	*-cbm)
+		os=-amigaos
+		;;
+	*-dg)
+		os=-dgux
+		;;
+	*-dolphin)
+		os=-sysv3
+		;;
+	m68k-ccur)
+		os=-rtu
+		;;
+	m88k-omron*)
+		os=-luna
+		;;
+	*-next )
+		os=-nextstep
+		;;
+	*-sequent)
+		os=-ptx
+		;;
+	*-crds)
+		os=-unos
+		;;
+	*-ns)
+		os=-genix
+		;;
+	i370-*)
+		os=-mvs
+		;;
+	*-next)
+		os=-nextstep3
+		;;
+	*-gould)
+		os=-sysv
+		;;
+	*-highlevel)
+		os=-bsd
+		;;
+	*-encore)
+		os=-bsd
+		;;
+	*-sgi)
+		os=-irix
+		;;
+	*-siemens)
+		os=-sysv4
+		;;
+	*-masscomp)
+		os=-rtu
+		;;
+	f30[01]-fujitsu | f700-fujitsu)
+		os=-uxpv
+		;;
+	*-rom68k)
+		os=-coff
+		;;
+	*-*bug)
+		os=-coff
+		;;
+	*-apple)
+		os=-macos
+		;;
+	*-atari*)
+		os=-mint
+		;;
+	*)
+		os=-none
+		;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+	*-unknown)
+		case $os in
+			-riscix*)
+				vendor=acorn
+				;;
+			-sunos*)
+				vendor=sun
+				;;
+			-aix*)
+				vendor=ibm
+				;;
+			-beos*)
+				vendor=be
+				;;
+			-hpux*)
+				vendor=hp
+				;;
+			-mpeix*)
+				vendor=hp
+				;;
+			-hiux*)
+				vendor=hitachi
+				;;
+			-unos*)
+				vendor=crds
+				;;
+			-dgux*)
+				vendor=dg
+				;;
+			-luna*)
+				vendor=omron
+				;;
+			-genix*)
+				vendor=ns
+				;;
+			-mvs* | -opened*)
+				vendor=ibm
+				;;
+			-ptx*)
+				vendor=sequent
+				;;
+			-vxsim* | -vxworks* | -windiss*)
+				vendor=wrs
+				;;
+			-aux*)
+				vendor=apple
+				;;
+			-hms*)
+				vendor=hitachi
+				;;
+			-mpw* | -macos*)
+				vendor=apple
+				;;
+			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+				vendor=atari
+				;;
+			-vos*)
+				vendor=stratus
+				;;
+		esac
+		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+		;;
+esac
+
+echo $basic_machine$os
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config/install-sh b/config/install-sh
new file mode 100755
index 0000000..dd97db7
--- /dev/null
+++ b/config/install-sh
@@ -0,0 +1,322 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2004-09-10.20
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.  It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+chmodcmd="$chmodprog 0755"
+chowncmd=
+chgrpcmd=
+stripcmd=
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=
+dst=
+dir_arg=
+dstarg=
+no_target_directory=
+
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+-c         (ignored)
+-d         create directories instead of installing files.
+-g GROUP   $chgrpprog installed files to GROUP.
+-m MODE    $chmodprog installed files to MODE.
+-o USER    $chownprog installed files to USER.
+-s         $stripprog installed files.
+-t DIRECTORY  install into DIRECTORY.
+-T         report an error if DSTFILE is a directory.
+--help     display this help and exit.
+--version  display version info and exit.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test -n "$1"; do
+  case $1 in
+    -c) shift
+        continue;;
+
+    -d) dir_arg=true
+        shift
+        continue;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+        shift
+        shift
+        continue;;
+
+    --help) echo "$usage"; exit 0;;
+
+    -m) chmodcmd="$chmodprog $2"
+        shift
+        shift
+        continue;;
+
+    -o) chowncmd="$chownprog $2"
+        shift
+        shift
+        continue;;
+
+    -s) stripcmd=$stripprog
+        shift
+        continue;;
+
+    -t) dstarg=$2
+	shift
+	shift
+	continue;;
+
+    -T) no_target_directory=true
+	shift
+	continue;;
+
+    --version) echo "$0 $scriptversion"; exit 0;;
+
+    *)  # When -d is used, all remaining arguments are directories to create.
+	# When -t is used, the destination is already specified.
+	test -n "$dir_arg$dstarg" && break
+        # Otherwise, the last argument is the destination.  Remove it from $@.
+	for arg
+	do
+          if test -n "$dstarg"; then
+	    # $@ is not empty: it contains at least $arg.
+	    set fnord "$@" "$dstarg"
+	    shift # fnord
+	  fi
+	  shift # arg
+	  dstarg=$arg
+	done
+	break;;
+  esac
+done
+
+if test -z "$1"; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src ;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    src=
+
+    if test -d "$dst"; then
+      mkdircmd=:
+      chmodcmd=
+    else
+      mkdircmd=$mkdirprog
+    fi
+  else
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dstarg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dstarg
+    # Protect names starting with `-'.
+    case $dst in
+      -*) dst=./$dst ;;
+    esac
+
+    # If destination is a directory, append the input filename; won't work
+    # if double slashes aren't ignored.
+    if test -d "$dst"; then
+      if test -n "$no_target_directory"; then
+	echo "$0: $dstarg: Is a directory" >&2
+	exit 1
+      fi
+      dst=$dst/`basename "$src"`
+    fi
+  fi
+
+  # This sed command emulates the dirname command.
+  dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+  # Make sure that the destination directory exists.
+
+  # Skip lots of stat calls in the usual case.
+  if test ! -d "$dstdir"; then
+    defaultIFS='
+	 '
+    IFS="${IFS-$defaultIFS}"
+
+    oIFS=$IFS
+    # Some sh's can't handle IFS=/ for some reason.
+    IFS='%'
+    set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+    IFS=$oIFS
+
+    pathcomp=
+
+    while test $# -ne 0 ; do
+      pathcomp=$pathcomp$1
+      shift
+      if test ! -d "$pathcomp"; then
+        $mkdirprog "$pathcomp"
+	# mkdir can fail with a `File exist' error in case several
+	# install-sh are creating the directory concurrently.  This
+	# is OK.
+	test -d "$pathcomp" || exit
+      fi
+      pathcomp=$pathcomp/
+    done
+  fi
+
+  if test -n "$dir_arg"; then
+    $doit $mkdircmd "$dst" \
+      && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+      && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+      && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
+
+  else
+    dstfile=`basename "$dst"`
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+    trap '(exit $?); exit' 1 2 13 15
+
+    # Copy the file name to the temp name.
+    $doit $cpprog "$src" "$dsttmp" &&
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+      && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
+
+    # Now rename the file to the real destination.
+    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
+      || {
+	   # The rename failed, perhaps because mv can't rename something else
+	   # to itself, or perhaps because mv is so ancient that it does not
+	   # support -f.
+
+	   # Now remove or move aside any old file at destination location.
+	   # We try this two ways since rm can't unlink itself on some
+	   # systems and the destination file might be busy for other
+	   # reasons.  In this case, the final cleanup might fail but the new
+	   # file should still install successfully.
+	   {
+	     if test -f "$dstdir/$dstfile"; then
+	       $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+	       || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+	       || {
+		 echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+		 (exit 1); exit
+	       }
+	     else
+	       :
+	     fi
+	   } &&
+
+	   # Now rename the file to the real destination.
+	   $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+	 }
+    }
+  fi || { (exit 1); exit; }
+done
+
+# The final little trick to "correctly" pass the exit status to the exit trap.
+{
+  (exit 0); exit
+}
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/config/ltmain.sh b/config/ltmain.sh
new file mode 100644
index 0000000..0223495
--- /dev/null
+++ b/config/ltmain.sh
@@ -0,0 +1,6911 @@
+# ltmain.sh - Provide generalized library-building support services.
+# NOTE: Changing this file will not affect anything until you rerun configure.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+basename="s,^.*/,,g"
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+# The name of this program:
+progname=`echo "$progpath" | $SED $basename`
+modename="$progname"
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.5.22
+TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
+
+# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+
+# Check that we have a working $echo.
+if test "X$1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X$1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+  # Yippee, $echo works!
+  :
+else
+  # Restart under the correct shell, and then maybe $echo will work.
+  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+$*
+EOF
+  exit $EXIT_SUCCESS
+fi
+
+default_mode=
+help="Try \`$progname --help' for more information."
+magic="%%%MAGIC variable%%%"
+mkdir="mkdir"
+mv="mv -f"
+rm="rm -f"
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  SP2NL='tr \040 \012'
+  NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  SP2NL='tr \100 \n'
+  NL2SP='tr \r\n \100\100'
+  ;;
+esac
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+# We save the old values to restore during execute mode.
+for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+  eval "if test \"\${$lt_var+set}\" = set; then
+         save_$lt_var=\$$lt_var
+         $lt_var=C
+         export $lt_var
+       fi"
+done
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" 	$lt_nl"
+
+if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+  $echo "$modename: not configured to build any kind of library" 1>&2
+  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+  exit $EXIT_FAILURE
+fi
+
+# Global variables.
+mode=$default_mode
+nonopt=
+prev=
+prevopt=
+run=
+show="$echo"
+show_help=
+execute_dlfiles=
+duplicate_deps=no
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+#####################################
+# Shell function definitions:
+# This seems to be the best place for them
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible.  If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+    my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+    if test "$run" = ":"; then
+      # Return a directory name, but don't create it in dry-run mode
+      my_tmpdir="${my_template}-$$"
+    else
+
+      # If mktemp works, use that first and foremost
+      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+      if test ! -d "$my_tmpdir"; then
+	# Failing that, at least try and use $RANDOM to avoid a race
+	my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+	save_mktempdir_umask=`umask`
+	umask 0077
+	$mkdir "$my_tmpdir"
+	umask $save_mktempdir_umask
+      fi
+
+      # If we're not in dry-run mode, bomb out on failure
+      test -d "$my_tmpdir" || {
+        $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
+	exit $EXIT_FAILURE
+      }
+    fi
+
+    $echo "X$my_tmpdir" | $Xsed
+}
+
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+func_win32_libid ()
+{
+  win32_libid_type="unknown"
+  win32_fileres=`file -L $1 2>/dev/null`
+  case $win32_fileres in
+  *ar\ archive\ import\ library*) # definitely import
+    win32_libid_type="x86 archive import"
+    ;;
+  *ar\ archive*) # could be an import, or static
+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
+      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+      win32_nmres=`eval $NM -f posix -A $1 | \
+	$SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
+      case $win32_nmres in
+      import*)  win32_libid_type="x86 archive import";;
+      *)        win32_libid_type="x86 archive static";;
+      esac
+    fi
+    ;;
+  *DLL*)
+    win32_libid_type="x86 DLL"
+    ;;
+  *executable*) # but shell scripts are "executable" too...
+    case $win32_fileres in
+    *MS\ Windows\ PE\ Intel*)
+      win32_libid_type="x86 DLL"
+      ;;
+    esac
+    ;;
+  esac
+  $echo $win32_libid_type
+}
+
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+    if test -n "$available_tags" && test -z "$tagname"; then
+      CC_quoted=
+      for arg in $CC; do
+	case $arg in
+	  *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+	CC_quoted="$CC_quoted $arg"
+      done
+      case $@ in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+	for z in $available_tags; do
+	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+	    # Evaluate the configuration.
+	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    CC_quoted=
+	    for arg in $CC; do
+	    # Double-quote args containing other shell metacharacters.
+	    case $arg in
+	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	      arg="\"$arg\""
+	      ;;
+	    esac
+	    CC_quoted="$CC_quoted $arg"
+	  done
+	    case "$@ " in
+	      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
+	      # The compiler in the base compile command matches
+	      # the one in the tagged configuration.
+	      # Assume this is the tagged configuration we want.
+	      tagname=$z
+	      break
+	      ;;
+	    esac
+	  fi
+	done
+	# If $tagname still isn't set, then no tagged configuration
+	# was found and let the user know that the "--tag" command
+	# line option must be used.
+	if test -z "$tagname"; then
+	  $echo "$modename: unable to infer tagged configuration"
+	  $echo "$modename: specify a tag with \`--tag'" 1>&2
+	  exit $EXIT_FAILURE
+#        else
+#          $echo "$modename: using $tagname tagged configuration"
+	fi
+	;;
+      esac
+    fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    f_ex_an_ar_dir="$1"; shift
+    f_ex_an_ar_oldlib="$1"
+
+    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
+    $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
+      exit $EXIT_FAILURE
+    fi
+}
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+    my_gentop="$1"; shift
+    my_oldlibs=${1+"$@"}
+    my_oldobjs=""
+    my_xlib=""
+    my_xabs=""
+    my_xdir=""
+    my_status=""
+
+    $show "${rm}r $my_gentop"
+    $run ${rm}r "$my_gentop"
+    $show "$mkdir $my_gentop"
+    $run $mkdir "$my_gentop"
+    my_status=$?
+    if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
+      exit $my_status
+    fi
+
+    for my_xlib in $my_oldlibs; do
+      # Extract the objects.
+      case $my_xlib in
+	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+	*) my_xabs=`pwd`"/$my_xlib" ;;
+      esac
+      my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
+      my_xlib_u=$my_xlib
+      while :; do
+        case " $extracted_archives " in
+       *" $my_xlib_u "*)
+         extracted_serial=`expr $extracted_serial + 1`
+         my_xlib_u=lt$extracted_serial-$my_xlib ;;
+       *) break ;;
+       esac
+      done
+      extracted_archives="$extracted_archives $my_xlib_u"
+      my_xdir="$my_gentop/$my_xlib_u"
+
+      $show "${rm}r $my_xdir"
+      $run ${rm}r "$my_xdir"
+      $show "$mkdir $my_xdir"
+      $run $mkdir "$my_xdir"
+      exit_status=$?
+      if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
+	exit $exit_status
+      fi
+      case $host in
+      *-darwin*)
+	$show "Extracting $my_xabs"
+	# Do not bother doing anything if just a dry run
+	if test -z "$run"; then
+	  darwin_orig_dir=`pwd`
+	  cd $my_xdir || exit $?
+	  darwin_archive=$my_xabs
+	  darwin_curdir=`pwd`
+	  darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
+	  darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
+	  if test -n "$darwin_arches"; then 
+	    darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
+	    darwin_arch=
+	    $show "$darwin_base_archive has multiple architectures $darwin_arches"
+	    for darwin_arch in  $darwin_arches ; do
+	      mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+	      cd "$darwin_curdir"
+	      $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+	    done # $darwin_arches
+      ## Okay now we have a bunch of thin objects, gotta fatten them up :)
+	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
+	    darwin_file=
+	    darwin_files=
+	    for darwin_file in $darwin_filelist; do
+	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+	      lipo -create -output "$darwin_file" $darwin_files
+	    done # $darwin_filelist
+	    ${rm}r unfat-$$
+	    cd "$darwin_orig_dir"
+	  else
+	    cd "$darwin_orig_dir"
+ 	    func_extract_an_archive "$my_xdir" "$my_xabs"
+	  fi # $darwin_arches
+	fi # $run
+	;;
+      *)
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+        ;;
+      esac
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+    done
+    func_extract_archives_result="$my_oldobjs"
+}
+# End of Shell function definitions
+#####################################
+
+# Darwin sucks
+eval std_shrext=\"$shrext_cmds\"
+
+disable_libs=no
+
+# Parse our command line options once, thoroughly.
+while test "$#" -gt 0
+do
+  arg="$1"
+  shift
+
+  case $arg in
+  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) optarg= ;;
+  esac
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$prev"; then
+    case $prev in
+    execute_dlfiles)
+      execute_dlfiles="$execute_dlfiles $arg"
+      ;;
+    tag)
+      tagname="$arg"
+      preserve_args="${preserve_args}=$arg"
+
+      # Check whether tagname contains only valid characters
+      case $tagname in
+      *[!-_A-Za-z0-9,/]*)
+	$echo "$progname: invalid tag name: $tagname" 1>&2
+	exit $EXIT_FAILURE
+	;;
+      esac
+
+      case $tagname in
+      CC)
+	# Don't test for the "default" C tag, as we know, it's there, but
+	# not specially marked.
+	;;
+      *)
+	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
+	  taglist="$taglist $tagname"
+	  # Evaluate the configuration.
+	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
+	else
+	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
+	fi
+	;;
+      esac
+      ;;
+    *)
+      eval "$prev=\$arg"
+      ;;
+    esac
+
+    prev=
+    prevopt=
+    continue
+  fi
+
+  # Have we seen a non-optional argument yet?
+  case $arg in
+  --help)
+    show_help=yes
+    ;;
+
+  --version)
+    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
+    $echo
+    $echo "Copyright (C) 2005  Free Software Foundation, Inc."
+    $echo "This is free software; see the source for copying conditions.  There is NO"
+    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+    exit $?
+    ;;
+
+  --config)
+    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
+    # Now print the configurations for the tags.
+    for tagname in $taglist; do
+      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
+    done
+    exit $?
+    ;;
+
+  --debug)
+    $echo "$progname: enabling shell trace mode"
+    set -x
+    preserve_args="$preserve_args $arg"
+    ;;
+
+  --dry-run | -n)
+    run=:
+    ;;
+
+  --features)
+    $echo "host: $host"
+    if test "$build_libtool_libs" = yes; then
+      $echo "enable shared libraries"
+    else
+      $echo "disable shared libraries"
+    fi
+    if test "$build_old_libs" = yes; then
+      $echo "enable static libraries"
+    else
+      $echo "disable static libraries"
+    fi
+    exit $?
+    ;;
+
+  --finish) mode="finish" ;;
+
+  --mode) prevopt="--mode" prev=mode ;;
+  --mode=*) mode="$optarg" ;;
+
+  --preserve-dup-deps) duplicate_deps="yes" ;;
+
+  --quiet | --silent)
+    show=:
+    preserve_args="$preserve_args $arg"
+    ;;
+
+  --tag)
+    prevopt="--tag"
+    prev=tag
+    preserve_args="$preserve_args --tag"
+    ;;
+  --tag=*)
+    set tag "$optarg" ${1+"$@"}
+    shift
+    prev=tag
+    preserve_args="$preserve_args --tag"
+    ;;
+
+  -dlopen)
+    prevopt="-dlopen"
+    prev=execute_dlfiles
+    ;;
+
+  -*)
+    $echo "$modename: unrecognized option \`$arg'" 1>&2
+    $echo "$help" 1>&2
+    exit $EXIT_FAILURE
+    ;;
+
+  *)
+    nonopt="$arg"
+    break
+    ;;
+  esac
+done
+
+if test -n "$prevopt"; then
+  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
+  $echo "$help" 1>&2
+  exit $EXIT_FAILURE
+fi
+
+case $disable_libs in
+no) 
+  ;;
+shared)
+  build_libtool_libs=no
+  build_old_libs=yes
+  ;;
+static)
+  build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+  ;;
+esac
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+if test -z "$show_help"; then
+
+  # Infer the operation mode.
+  if test -z "$mode"; then
+    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
+    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
+    case $nonopt in
+    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
+      mode=link
+      for arg
+      do
+	case $arg in
+	-c)
+	   mode=compile
+	   break
+	   ;;
+	esac
+      done
+      ;;
+    *db | *dbx | *strace | *truss)
+      mode=execute
+      ;;
+    *install*|cp|mv)
+      mode=install
+      ;;
+    *rm)
+      mode=uninstall
+      ;;
+    *)
+      # If we have no mode, but dlfiles were specified, then do execute mode.
+      test -n "$execute_dlfiles" && mode=execute
+
+      # Just use the default operation mode.
+      if test -z "$mode"; then
+	if test -n "$nonopt"; then
+	  $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
+	else
+	  $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
+	fi
+      fi
+      ;;
+    esac
+  fi
+
+  # Only execute mode is allowed to have -dlopen flags.
+  if test -n "$execute_dlfiles" && test "$mode" != execute; then
+    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
+    $echo "$help" 1>&2
+    exit $EXIT_FAILURE
+  fi
+
+  # Change the help message to a mode-specific one.
+  generic_help="$help"
+  help="Try \`$modename --help --mode=$mode' for more information."
+
+  # These modes are in order of execution frequency so that they run quickly.
+  case $mode in
+  # libtool compile mode
+  compile)
+    modename="$modename: compile"
+    # Get the compilation command and the source file.
+    base_compile=
+    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    suppress_opt=yes
+    suppress_output=
+    arg_mode=normal
+    libobj=
+    later=
+
+    for arg
+    do
+      case $arg_mode in
+      arg  )
+	# do not "continue".  Instead, add this to base_compile
+	lastarg="$arg"
+	arg_mode=normal
+	;;
+
+      target )
+	libobj="$arg"
+	arg_mode=normal
+	continue
+	;;
+
+      normal )
+	# Accept any command-line options.
+	case $arg in
+	-o)
+	  if test -n "$libobj" ; then
+	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	  arg_mode=target
+	  continue
+	  ;;
+
+	-static | -prefer-pic | -prefer-non-pic)
+	  later="$later $arg"
+	  continue
+	  ;;
+
+	-no-suppress)
+	  suppress_opt=no
+	  continue
+	  ;;
+
+	-Xcompiler)
+	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
+	  continue      #  The current "srcfile" will either be retained or
+	  ;;            #  replaced later.  I would guess that would be a bug.
+
+	-Wc,*)
+	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+	  lastarg=
+	  save_ifs="$IFS"; IFS=','
+ 	  for arg in $args; do
+	    IFS="$save_ifs"
+
+	    # Double-quote args containing other shell metacharacters.
+	    # Many Bourne shells cannot handle close brackets correctly
+	    # in scan sets, so we specify it separately.
+	    case $arg in
+	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	      arg="\"$arg\""
+	      ;;
+	    esac
+	    lastarg="$lastarg $arg"
+	  done
+	  IFS="$save_ifs"
+	  lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
+
+	  # Add the arguments to base_compile.
+	  base_compile="$base_compile $lastarg"
+	  continue
+	  ;;
+
+	* )
+	  # Accept the current argument as the source file.
+	  # The previous "srcfile" becomes the current argument.
+	  #
+	  lastarg="$srcfile"
+	  srcfile="$arg"
+	  ;;
+	esac  #  case $arg
+	;;
+      esac    #  case $arg_mode
+
+      # Aesthetically quote the previous argument.
+      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+      case $lastarg in
+      # Double-quote args containing other shell metacharacters.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, and some SunOS ksh mistreat backslash-escaping
+      # in scan sets (worked around with variable expansion),
+      # and furthermore cannot handle '|' '&' '(' ')' in scan sets 
+      # at all, so we specify them separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	lastarg="\"$lastarg\""
+	;;
+      esac
+
+      base_compile="$base_compile $lastarg"
+    done # for arg
+
+    case $arg_mode in
+    arg)
+      $echo "$modename: you must specify an argument for -Xcompile"
+      exit $EXIT_FAILURE
+      ;;
+    target)
+      $echo "$modename: you must specify a target with \`-o'" 1>&2
+      exit $EXIT_FAILURE
+      ;;
+    *)
+      # Get the name of the library object.
+      [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+      ;;
+    esac
+
+    # Recognize several different file suffixes.
+    # If the user specifies -o file.o, it is replaced with file.lo
+    xform='[cCFSifmso]'
+    case $libobj in
+    *.ada) xform=ada ;;
+    *.adb) xform=adb ;;
+    *.ads) xform=ads ;;
+    *.asm) xform=asm ;;
+    *.c++) xform=c++ ;;
+    *.cc) xform=cc ;;
+    *.ii) xform=ii ;;
+    *.class) xform=class ;;
+    *.cpp) xform=cpp ;;
+    *.cxx) xform=cxx ;;
+    *.f90) xform=f90 ;;
+    *.for) xform=for ;;
+    *.java) xform=java ;;
+    *.obj) xform=obj ;;
+    esac
+
+    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+
+    case $libobj in
+    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
+    *)
+      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
+      exit $EXIT_FAILURE
+      ;;
+    esac
+
+    func_infer_tag $base_compile
+
+    for arg in $later; do
+      case $arg in
+      -static)
+	build_old_libs=yes
+	continue
+	;;
+
+      -prefer-pic)
+	pic_mode=yes
+	continue
+	;;
+
+      -prefer-non-pic)
+	pic_mode=no
+	continue
+	;;
+      esac
+    done
+
+    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
+    case $qlibobj in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	qlibobj="\"$qlibobj\"" ;;
+    esac
+    test "X$libobj" != "X$qlibobj" \
+	&& $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' 	&()|`$[]' \
+	&& $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
+    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+    if test "X$xdir" = "X$obj"; then
+      xdir=
+    else
+      xdir=$xdir/
+    fi
+    lobj=${xdir}$objdir/$objname
+
+    if test -z "$base_compile"; then
+      $echo "$modename: you must specify a compilation command" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    # Delete any leftover library objects.
+    if test "$build_old_libs" = yes; then
+      removelist="$obj $lobj $libobj ${libobj}T"
+    else
+      removelist="$lobj $libobj ${libobj}T"
+    fi
+
+    $run $rm $removelist
+    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
+
+    # On Cygwin there's no "real" PIC flag so we must build both object types
+    case $host_os in
+    cygwin* | mingw* | pw32* | os2*)
+      pic_mode=default
+      ;;
+    esac
+    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+      # non-PIC code in shared libraries is not supported
+      pic_mode=default
+    fi
+
+    # Calculate the filename of the output object if compiler does
+    # not support -o with -c
+    if test "$compiler_c_o" = no; then
+      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+      lockfile="$output_obj.lock"
+      removelist="$removelist $output_obj $lockfile"
+      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
+    else
+      output_obj=
+      need_locks=no
+      lockfile=
+    fi
+
+    # Lock this critical section if it is needed
+    # We use this script file to make the link, it avoids creating a new file
+    if test "$need_locks" = yes; then
+      until $run ln "$progpath" "$lockfile" 2>/dev/null; do
+	$show "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    elif test "$need_locks" = warn; then
+      if test -f "$lockfile"; then
+	$echo "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit $EXIT_FAILURE
+      fi
+      $echo "$srcfile" > "$lockfile"
+    fi
+
+    if test -n "$fix_srcfile_path"; then
+      eval srcfile=\"$fix_srcfile_path\"
+    fi
+    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
+    case $qsrcfile in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+      qsrcfile="\"$qsrcfile\"" ;;
+    esac
+
+    $run $rm "$libobj" "${libobj}T"
+
+    # Create a libtool object file (analogous to a ".la" file),
+    # but don't create it if we're doing a dry run.
+    test -z "$run" && cat > ${libobj}T <<EOF
+# $libobj - a libtool object file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+EOF
+
+    # Only build a PIC object if we are building libtool libraries.
+    if test "$build_libtool_libs" = yes; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      if test "$pic_mode" != no; then
+	command="$base_compile $qsrcfile $pic_flag"
+      else
+	# Don't build PIC code
+	command="$base_compile $qsrcfile"
+      fi
+
+      if test ! -d "${xdir}$objdir"; then
+	$show "$mkdir ${xdir}$objdir"
+	$run $mkdir ${xdir}$objdir
+	exit_status=$?
+	if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
+	  exit $exit_status
+	fi
+      fi
+
+      if test -z "$output_obj"; then
+	# Place PIC objects in $objdir
+	command="$command -o $lobj"
+      fi
+
+      $run $rm "$lobj" "$output_obj"
+
+      $show "$command"
+      if $run eval "$command"; then :
+      else
+	test -n "$output_obj" && $run $rm $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed, then go on to compile the next one
+      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+	$show "$mv $output_obj $lobj"
+	if $run $mv $output_obj $lobj; then :
+	else
+	  error=$?
+	  $run $rm $removelist
+	  exit $error
+	fi
+      fi
+
+      # Append the name of the PIC object to the libtool object file.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object='$objdir/$objname'
+
+EOF
+
+      # Allow error messages only from the first compilation.
+      if test "$suppress_opt" = yes; then
+        suppress_output=' >/dev/null 2>&1'
+      fi
+    else
+      # No PIC object so indicate it doesn't exist in the libtool
+      # object file.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object=none
+
+EOF
+    fi
+
+    # Only build a position-dependent object if we build old libraries.
+    if test "$build_old_libs" = yes; then
+      if test "$pic_mode" != yes; then
+	# Don't build PIC code
+	command="$base_compile $qsrcfile"
+      else
+	command="$base_compile $qsrcfile $pic_flag"
+      fi
+      if test "$compiler_c_o" = yes; then
+	command="$command -o $obj"
+      fi
+
+      # Suppress compiler output if we already did a PIC compilation.
+      command="$command$suppress_output"
+      $run $rm "$obj" "$output_obj"
+      $show "$command"
+      if $run eval "$command"; then :
+      else
+	$run $rm $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed
+      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+	$show "$mv $output_obj $obj"
+	if $run $mv $output_obj $obj; then :
+	else
+	  error=$?
+	  $run $rm $removelist
+	  exit $error
+	fi
+      fi
+
+      # Append the name of the non-PIC object the libtool object file.
+      # Only append if the libtool object file exists.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object='$objname'
+
+EOF
+    else
+      # Append the name of the non-PIC object the libtool object file.
+      # Only append if the libtool object file exists.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object=none
+
+EOF
+    fi
+
+    $run $mv "${libobj}T" "${libobj}"
+
+    # Unlock the critical section if it was locked
+    if test "$need_locks" != no; then
+      $run $rm "$lockfile"
+    fi
+
+    exit $EXIT_SUCCESS
+    ;;
+
+  # libtool link mode
+  link | relink)
+    modename="$modename: link"
+    case $host in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+      # It is impossible to link a dll without this setting, and
+      # we shouldn't force the makefile maintainer to figure out
+      # which system we are compiling for in order to pass an extra
+      # flag for every libtool invocation.
+      # allow_undefined=no
+
+      # FIXME: Unfortunately, there are problems with the above when trying
+      # to make a dll which has undefined symbols, in which case not
+      # even a static library is built.  For now, we need to specify
+      # -no-undefined on the libtool link line when we can be certain
+      # that all symbols are satisfied, otherwise we get a static library.
+      allow_undefined=yes
+      ;;
+    *)
+      allow_undefined=yes
+      ;;
+    esac
+    libtool_args="$nonopt"
+    base_compile="$nonopt $@"
+    compile_command="$nonopt"
+    finalize_command="$nonopt"
+
+    compile_rpath=
+    finalize_rpath=
+    compile_shlibpath=
+    finalize_shlibpath=
+    convenience=
+    old_convenience=
+    deplibs=
+    old_deplibs=
+    compiler_flags=
+    linker_flags=
+    dllsearchpath=
+    lib_search_path=`pwd`
+    inst_prefix_dir=
+
+    avoid_version=no
+    dlfiles=
+    dlprefiles=
+    dlself=no
+    export_dynamic=no
+    export_symbols=
+    export_symbols_regex=
+    generated=
+    libobjs=
+    ltlibs=
+    module=no
+    no_install=no
+    objs=
+    non_pic_objects=
+    notinst_path= # paths that contain not-installed libtool libraries
+    precious_files_regex=
+    prefer_static_libs=no
+    preload=no
+    prev=
+    prevarg=
+    release=
+    rpath=
+    xrpath=
+    perm_rpath=
+    temp_rpath=
+    thread_safe=no
+    vinfo=
+    vinfo_number=no
+
+    func_infer_tag $base_compile
+
+    # We need to know -static, to get the right output filenames.
+    for arg
+    do
+      case $arg in
+      -all-static | -static | -static-libtool-libs)
+    case $arg in
+    -all-static)
+	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+	  fi
+	  if test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=yes
+	  ;;
+    -static)
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=built
+	  ;;
+    -static-libtool-libs)
+      if test -z "$pic_flag" && test -n "$link_static_flag"; then
+        dlopen_self=$dlopen_self_static
+      fi
+      prefer_static_libs=yes
+      ;;
+    esac
+	build_libtool_libs=no
+	build_old_libs=yes
+	break
+	;;
+      esac
+    done
+
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+    # Go through the arguments, transforming them on the way.
+    while test "$#" -gt 0; do
+      arg="$1"
+      shift
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
+	;;
+      *) qarg=$arg ;;
+      esac
+      libtool_args="$libtool_args $qarg"
+
+      # If the previous option needs an argument, assign it.
+      if test -n "$prev"; then
+	case $prev in
+	output)
+	  compile_command="$compile_command @OUTPUT@"
+	  finalize_command="$finalize_command @OUTPUT@"
+	  ;;
+	esac
+
+	case $prev in
+	dlfiles|dlprefiles)
+	  if test "$preload" = no; then
+	    # Add the symbol object into the linking commands.
+	    compile_command="$compile_command @SYMFILE@"
+	    finalize_command="$finalize_command @SYMFILE@"
+	    preload=yes
+	  fi
+	  case $arg in
+	  *.la | *.lo) ;;  # We handle these cases below.
+	  force)
+	    if test "$dlself" = no; then
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  self)
+	    if test "$prev" = dlprefiles; then
+	      dlself=yes
+	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+	      dlself=yes
+	    else
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  *)
+	    if test "$prev" = dlfiles; then
+	      dlfiles="$dlfiles $arg"
+	    else
+	      dlprefiles="$dlprefiles $arg"
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  esac
+	  ;;
+	expsyms)
+	  export_symbols="$arg"
+	  if test ! -f "$arg"; then
+	    $echo "$modename: symbol file \`$arg' does not exist"
+	    exit $EXIT_FAILURE
+	  fi
+	  prev=
+	  continue
+	  ;;
+	expsyms_regex)
+	  export_symbols_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	inst_prefix)
+	  inst_prefix_dir="$arg"
+	  prev=
+	  continue
+	  ;;
+	precious_regex)
+	  precious_files_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	release)
+	  release="-$arg"
+	  prev=
+	  continue
+	  ;;
+	objectlist)
+	  if test -f "$arg"; then
+	    save_arg=$arg
+	    moreargs=
+	    for fil in `cat $save_arg`
+	    do
+#	      moreargs="$moreargs $fil"
+	      arg=$fil
+	      # A libtool-controlled object.
+
+	      # Check to see that this really is a libtool object.
+	      if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+		pic_object=
+		non_pic_object=
+
+		# Read the .lo file
+		# If there is no directory component, then add one.
+		case $arg in
+		*/* | *\\*) . $arg ;;
+		*) . ./$arg ;;
+		esac
+
+		if test -z "$pic_object" || \
+		   test -z "$non_pic_object" ||
+		   test "$pic_object" = none && \
+		   test "$non_pic_object" = none; then
+		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+		  exit $EXIT_FAILURE
+		fi
+
+		# Extract subdirectory from the argument.
+		xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+		if test "X$xdir" = "X$arg"; then
+		  xdir=
+		else
+		  xdir="$xdir/"
+		fi
+
+		if test "$pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  pic_object="$xdir$pic_object"
+
+		  if test "$prev" = dlfiles; then
+		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		      dlfiles="$dlfiles $pic_object"
+		      prev=
+		      continue
+		    else
+		      # If libtool objects are unsupported, then we need to preload.
+		      prev=dlprefiles
+		    fi
+		  fi
+
+		  # CHECK ME:  I think I busted this.  -Ossama
+		  if test "$prev" = dlprefiles; then
+		    # Preload the old-style object.
+		    dlprefiles="$dlprefiles $pic_object"
+		    prev=
+		  fi
+
+		  # A PIC object.
+		  libobjs="$libobjs $pic_object"
+		  arg="$pic_object"
+		fi
+
+		# Non-PIC object.
+		if test "$non_pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  non_pic_object="$xdir$non_pic_object"
+
+		  # A standard non-PIC object
+		  non_pic_objects="$non_pic_objects $non_pic_object"
+		  if test -z "$pic_object" || test "$pic_object" = none ; then
+		    arg="$non_pic_object"
+		  fi
+		else
+		  # If the PIC object exists, use it instead.
+		  # $xdir was prepended to $pic_object above.
+		  non_pic_object="$pic_object"
+		  non_pic_objects="$non_pic_objects $non_pic_object"
+		fi
+	      else
+		# Only an error if not doing a dry-run.
+		if test -z "$run"; then
+		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+		  exit $EXIT_FAILURE
+		else
+		  # Dry-run case.
+
+		  # Extract subdirectory from the argument.
+		  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+		  if test "X$xdir" = "X$arg"; then
+		    xdir=
+		  else
+		    xdir="$xdir/"
+		  fi
+
+		  pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+		  non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+		  libobjs="$libobjs $pic_object"
+		  non_pic_objects="$non_pic_objects $non_pic_object"
+		fi
+	      fi
+	    done
+	  else
+	    $echo "$modename: link input file \`$save_arg' does not exist"
+	    exit $EXIT_FAILURE
+	  fi
+	  arg=$save_arg
+	  prev=
+	  continue
+	  ;;
+	rpath | xrpath)
+	  # We need an absolute path.
+	  case $arg in
+	  [\\/]* | [A-Za-z]:[\\/]*) ;;
+	  *)
+	    $echo "$modename: only absolute run-paths are allowed" 1>&2
+	    exit $EXIT_FAILURE
+	    ;;
+	  esac
+	  if test "$prev" = rpath; then
+	    case "$rpath " in
+	    *" $arg "*) ;;
+	    *) rpath="$rpath $arg" ;;
+	    esac
+	  else
+	    case "$xrpath " in
+	    *" $arg "*) ;;
+	    *) xrpath="$xrpath $arg" ;;
+	    esac
+	  fi
+	  prev=
+	  continue
+	  ;;
+	xcompiler)
+	  compiler_flags="$compiler_flags $qarg"
+	  prev=
+	  compile_command="$compile_command $qarg"
+	  finalize_command="$finalize_command $qarg"
+	  continue
+	  ;;
+	xlinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $wl$qarg"
+	  prev=
+	  compile_command="$compile_command $wl$qarg"
+	  finalize_command="$finalize_command $wl$qarg"
+	  continue
+	  ;;
+	xcclinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $qarg"
+	  prev=
+	  compile_command="$compile_command $qarg"
+	  finalize_command="$finalize_command $qarg"
+	  continue
+	  ;;
+	shrext)
+  	  shrext_cmds="$arg"
+	  prev=
+	  continue
+	  ;;
+	darwin_framework|darwin_framework_skip)
+	  test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
+	  compile_command="$compile_command $arg"
+	  finalize_command="$finalize_command $arg"
+	  prev=
+	  continue
+	  ;;
+	*)
+	  eval "$prev=\"\$arg\""
+	  prev=
+	  continue
+	  ;;
+	esac
+      fi # test -n "$prev"
+
+      prevarg="$arg"
+
+      case $arg in
+      -all-static)
+	if test -n "$link_static_flag"; then
+	  compile_command="$compile_command $link_static_flag"
+	  finalize_command="$finalize_command $link_static_flag"
+	fi
+	continue
+	;;
+
+      -allow-undefined)
+	# FIXME: remove this flag sometime in the future.
+	$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
+	continue
+	;;
+
+      -avoid-version)
+	avoid_version=yes
+	continue
+	;;
+
+      -dlopen)
+	prev=dlfiles
+	continue
+	;;
+
+      -dlpreopen)
+	prev=dlprefiles
+	continue
+	;;
+
+      -export-dynamic)
+	export_dynamic=yes
+	continue
+	;;
+
+      -export-symbols | -export-symbols-regex)
+	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	  $echo "$modename: more than one -exported-symbols argument is not allowed"
+	  exit $EXIT_FAILURE
+	fi
+	if test "X$arg" = "X-export-symbols"; then
+	  prev=expsyms
+	else
+	  prev=expsyms_regex
+	fi
+	continue
+	;;
+
+      -framework|-arch|-isysroot)
+	case " $CC " in
+	  *" ${arg} ${1} "* | *" ${arg}	${1} "*) 
+		prev=darwin_framework_skip ;;
+	  *) compiler_flags="$compiler_flags $arg"
+	     prev=darwin_framework ;;
+	esac
+	compile_command="$compile_command $arg"
+	finalize_command="$finalize_command $arg"
+	continue
+	;;
+
+      -inst-prefix-dir)
+	prev=inst_prefix
+	continue
+	;;
+
+      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+      # so, if we see these flags be careful not to treat them like -L
+      -L[A-Z][A-Z]*:*)
+	case $with_gcc/$host in
+	no/*-*-irix* | /*-*-irix*)
+	  compile_command="$compile_command $arg"
+	  finalize_command="$finalize_command $arg"
+	  ;;
+	esac
+	continue
+	;;
+
+      -L*)
+	dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  absdir=`cd "$dir" && pwd`
+	  if test -z "$absdir"; then
+	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
+	    absdir="$dir"
+	    notinst_path="$notinst_path $dir"
+	  fi
+	  dir="$absdir"
+	  ;;
+	esac
+	case "$deplibs " in
+	*" -L$dir "*) ;;
+	*)
+	  deplibs="$deplibs -L$dir"
+	  lib_search_path="$lib_search_path $dir"
+	  ;;
+	esac
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
+	  case :$dllsearchpath: in
+	  *":$dir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$dir";;
+	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$testbindir";;
+	  esac
+	  ;;
+	esac
+	continue
+	;;
+
+      -l*)
+	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
+	    # These systems don't actually have a C or math library (as such)
+	    continue
+	    ;;
+	  *-*-os2*)
+	    # These systems don't actually have a C library (as such)
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	    # Do not include libc due to us having libc/libc_r.
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C and math libraries are in the System framework
+	    deplibs="$deplibs -framework System"
+	    continue
+	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  esac
+	elif test "X$arg" = "X-lc_r"; then
+	 case $host in
+	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	   # Do not include libc_r directly, use -pthread flag.
+	   continue
+	   ;;
+	 esac
+	fi
+	deplibs="$deplibs $arg"
+	continue
+	;;
+
+      # Tru64 UNIX uses -model [arg] to determine the layout of C++
+      # classes, name mangling, and exception handling.
+      -model)
+	compile_command="$compile_command $arg"
+	compiler_flags="$compiler_flags $arg"
+	finalize_command="$finalize_command $arg"
+	prev=xcompiler
+	continue
+	;;
+
+     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+	compiler_flags="$compiler_flags $arg"
+	compile_command="$compile_command $arg"
+	finalize_command="$finalize_command $arg"
+	continue
+	;;
+
+      -module)
+	module=yes
+	continue
+	;;
+
+      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+      # -r[0-9][0-9]* specifies the processor on the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+      # +DA*, +DD* enable 64-bit mode on the HP compiler
+      # -q* pass through compiler args for the IBM compiler
+      # -m* pass through architecture-specific compiler args for GCC
+      # -m*, -t[45]*, -txscale* pass through architecture-specific
+      # compiler args for GCC
+      # -pg pass through profiling flag for GCC
+      # @file GCC response files
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
+      -t[45]*|-txscale*|@*)
+
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+	case $arg in
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+        compile_command="$compile_command $arg"
+        finalize_command="$finalize_command $arg"
+        compiler_flags="$compiler_flags $arg"
+        continue
+        ;;
+
+      -shrext)
+	prev=shrext
+	continue
+	;;
+
+      -no-fast-install)
+	fast_install=no
+	continue
+	;;
+
+      -no-install)
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  # The PATH hackery in wrapper scripts is required on Windows
+	  # in order for the loader to find any dlls it needs.
+	  $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
+	  $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
+	  fast_install=no
+	  ;;
+	*) no_install=yes ;;
+	esac
+	continue
+	;;
+
+      -no-undefined)
+	allow_undefined=no
+	continue
+	;;
+
+      -objectlist)
+	prev=objectlist
+	continue
+	;;
+
+      -o) prev=output ;;
+
+      -precious-files-regex)
+	prev=precious_regex
+	continue
+	;;
+
+      -release)
+	prev=release
+	continue
+	;;
+
+      -rpath)
+	prev=rpath
+	continue
+	;;
+
+      -R)
+	prev=xrpath
+	continue
+	;;
+
+      -R*)
+	dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  $echo "$modename: only absolute run-paths are allowed" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+	case "$xrpath " in
+	*" $dir "*) ;;
+	*) xrpath="$xrpath $dir" ;;
+	esac
+	continue
+	;;
+
+      -static | -static-libtool-libs)
+	# The effects of -static are defined in a previous loop.
+	# We used to do the same as -all-static on platforms that
+	# didn't have a PIC flag, but the assumption that the effects
+	# would be equivalent was wrong.  It would break on at least
+	# Digital Unix and AIX.
+	continue
+	;;
+
+      -thread-safe)
+	thread_safe=yes
+	continue
+	;;
+
+      -version-info)
+	prev=vinfo
+	continue
+	;;
+      -version-number)
+	prev=vinfo
+	vinfo_number=yes
+	continue
+	;;
+
+      -Wc,*)
+	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+	  case $flag in
+	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	    flag="\"$flag\""
+	    ;;
+	  esac
+	  arg="$arg $wl$flag"
+	  compiler_flags="$compiler_flags $flag"
+	done
+	IFS="$save_ifs"
+	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+	;;
+
+      -Wl,*)
+	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+	  case $flag in
+	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	    flag="\"$flag\""
+	    ;;
+	  esac
+	  arg="$arg $wl$flag"
+	  compiler_flags="$compiler_flags $wl$flag"
+	  linker_flags="$linker_flags $flag"
+	done
+	IFS="$save_ifs"
+	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+	;;
+
+      -Xcompiler)
+	prev=xcompiler
+	continue
+	;;
+
+      -Xlinker)
+	prev=xlinker
+	continue
+	;;
+
+      -XCClinker)
+	prev=xcclinker
+	continue
+	;;
+
+      # Some other compiler flag.
+      -* | +*)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+	case $arg in
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+	;;
+
+      *.$objext)
+	# A standard object.
+	objs="$objs $arg"
+	;;
+
+      *.lo)
+	# A libtool-controlled object.
+
+	# Check to see that this really is a libtool object.
+	if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  pic_object=
+	  non_pic_object=
+
+	  # Read the .lo file
+	  # If there is no directory component, then add one.
+	  case $arg in
+	  */* | *\\*) . $arg ;;
+	  *) . ./$arg ;;
+	  esac
+
+	  if test -z "$pic_object" || \
+	     test -z "$non_pic_object" ||
+	     test "$pic_object" = none && \
+	     test "$non_pic_object" = none; then
+	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+
+	  # Extract subdirectory from the argument.
+	  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+	  if test "X$xdir" = "X$arg"; then
+	    xdir=
+ 	  else
+	    xdir="$xdir/"
+	  fi
+
+	  if test "$pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    pic_object="$xdir$pic_object"
+
+	    if test "$prev" = dlfiles; then
+	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		dlfiles="$dlfiles $pic_object"
+		prev=
+		continue
+	      else
+		# If libtool objects are unsupported, then we need to preload.
+		prev=dlprefiles
+	      fi
+	    fi
+
+	    # CHECK ME:  I think I busted this.  -Ossama
+	    if test "$prev" = dlprefiles; then
+	      # Preload the old-style object.
+	      dlprefiles="$dlprefiles $pic_object"
+	      prev=
+	    fi
+
+	    # A PIC object.
+	    libobjs="$libobjs $pic_object"
+	    arg="$pic_object"
+	  fi
+
+	  # Non-PIC object.
+	  if test "$non_pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    non_pic_object="$xdir$non_pic_object"
+
+	    # A standard non-PIC object
+	    non_pic_objects="$non_pic_objects $non_pic_object"
+	    if test -z "$pic_object" || test "$pic_object" = none ; then
+	      arg="$non_pic_object"
+	    fi
+	  else
+	    # If the PIC object exists, use it instead.
+	    # $xdir was prepended to $pic_object above.
+	    non_pic_object="$pic_object"
+	    non_pic_objects="$non_pic_objects $non_pic_object"
+	  fi
+	else
+	  # Only an error if not doing a dry-run.
+	  if test -z "$run"; then
+	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+	    exit $EXIT_FAILURE
+	  else
+	    # Dry-run case.
+
+	    # Extract subdirectory from the argument.
+	    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+	    if test "X$xdir" = "X$arg"; then
+	      xdir=
+	    else
+	      xdir="$xdir/"
+	    fi
+
+	    pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+	    non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+	    libobjs="$libobjs $pic_object"
+	    non_pic_objects="$non_pic_objects $non_pic_object"
+	  fi
+	fi
+	;;
+
+      *.$libext)
+	# An archive.
+	deplibs="$deplibs $arg"
+	old_deplibs="$old_deplibs $arg"
+	continue
+	;;
+
+      *.la)
+	# A libtool-controlled library.
+
+	if test "$prev" = dlfiles; then
+	  # This library was specified with -dlopen.
+	  dlfiles="$dlfiles $arg"
+	  prev=
+	elif test "$prev" = dlprefiles; then
+	  # The library was specified with -dlpreopen.
+	  dlprefiles="$dlprefiles $arg"
+	  prev=
+	else
+	  deplibs="$deplibs $arg"
+	fi
+	continue
+	;;
+
+      # Some other compiler argument.
+      *)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+	case $arg in
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+	;;
+      esac # arg
+
+      # Now actually substitute the argument into the commands.
+      if test -n "$arg"; then
+	compile_command="$compile_command $arg"
+	finalize_command="$finalize_command $arg"
+      fi
+    done # argument parsing loop
+
+    if test -n "$prev"; then
+      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+      eval arg=\"$export_dynamic_flag_spec\"
+      compile_command="$compile_command $arg"
+      finalize_command="$finalize_command $arg"
+    fi
+
+    oldlibs=
+    # calculate the name of the file, without its directory
+    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
+    libobjs_save="$libobjs"
+
+    if test -n "$shlibpath_var"; then
+      # get the directories listed in $shlibpath_var
+      eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+    else
+      shlib_search_path=
+    fi
+    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+    if test "X$output_objdir" = "X$output"; then
+      output_objdir="$objdir"
+    else
+      output_objdir="$output_objdir/$objdir"
+    fi
+    # Create the object directory.
+    if test ! -d "$output_objdir"; then
+      $show "$mkdir $output_objdir"
+      $run $mkdir $output_objdir
+      exit_status=$?
+      if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
+	exit $exit_status
+      fi
+    fi
+
+    # Determine the type of output
+    case $output in
+    "")
+      $echo "$modename: you must specify an output file" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+      ;;
+    *.$libext) linkmode=oldlib ;;
+    *.lo | *.$objext) linkmode=obj ;;
+    *.la) linkmode=lib ;;
+    *) linkmode=prog ;; # Anything else should be a program.
+    esac
+
+    case $host in
+    *cygwin* | *mingw* | *pw32*)
+      # don't eliminate duplications in $postdeps and $predeps
+      duplicate_compiler_generated_deps=yes
+      ;;
+    *)
+      duplicate_compiler_generated_deps=$duplicate_deps
+      ;;
+    esac
+    specialdeplibs=
+
+    libs=
+    # Find all interdependent deplibs by searching for libraries
+    # that are linked more than once (e.g. -la -lb -la)
+    for deplib in $deplibs; do
+      if test "X$duplicate_deps" = "Xyes" ; then
+	case "$libs " in
+	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	esac
+      fi
+      libs="$libs $deplib"
+    done
+
+    if test "$linkmode" = lib; then
+      libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+      # Compute libraries that are listed more than once in $predeps
+      # $postdeps and mark them as special (i.e., whose duplicates are
+      # not to be eliminated).
+      pre_post_deps=
+      if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
+	for pre_post_dep in $predeps $postdeps; do
+	  case "$pre_post_deps " in
+	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+	  esac
+	  pre_post_deps="$pre_post_deps $pre_post_dep"
+	done
+      fi
+      pre_post_deps=
+    fi
+
+    deplibs=
+    newdependency_libs=
+    newlib_search_path=
+    need_relink=no # whether we're linking any uninstalled libtool libraries
+    notinst_deplibs= # not-installed libtool libraries
+    case $linkmode in
+    lib)
+	passes="conv link"
+	for file in $dlfiles $dlprefiles; do
+	  case $file in
+	  *.la) ;;
+	  *)
+	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
+	    exit $EXIT_FAILURE
+	    ;;
+	  esac
+	done
+	;;
+    prog)
+	compile_deplibs=
+	finalize_deplibs=
+	alldeplibs=no
+	newdlfiles=
+	newdlprefiles=
+	passes="conv scan dlopen dlpreopen link"
+	;;
+    *)  passes="conv"
+	;;
+    esac
+    for pass in $passes; do
+      if test "$linkmode,$pass" = "lib,link" ||
+	 test "$linkmode,$pass" = "prog,scan"; then
+	libs="$deplibs"
+	deplibs=
+      fi
+      if test "$linkmode" = prog; then
+	case $pass in
+	dlopen) libs="$dlfiles" ;;
+	dlpreopen) libs="$dlprefiles" ;;
+	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+	esac
+      fi
+      if test "$pass" = dlopen; then
+	# Collect dlpreopened libraries
+	save_deplibs="$deplibs"
+	deplibs=
+      fi
+      for deplib in $libs; do
+	lib=
+	found=no
+	case $deplib in
+	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+	  if test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    compiler_flags="$compiler_flags $deplib"
+	  fi
+	  continue
+	  ;;
+	-l*)
+	  if test "$linkmode" != lib && test "$linkmode" != prog; then
+	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
+	    continue
+	  fi
+	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
+	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
+	    for search_ext in .la $std_shrext .so .a; do
+	      # Search the libtool library
+	      lib="$searchdir/lib${name}${search_ext}"
+	      if test -f "$lib"; then
+		if test "$search_ext" = ".la"; then
+		  found=yes
+		else
+		  found=no
+		fi
+		break 2
+	      fi
+	    done
+	  done
+	  if test "$found" != yes; then
+	    # deplib doesn't seem to be a libtool library
+	    if test "$linkmode,$pass" = "prog,link"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      deplibs="$deplib $deplibs"
+	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    continue
+	  else # deplib is a libtool library
+	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+	    # We need to do some special things here, and not later.
+	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      case " $predeps $postdeps " in
+	      *" $deplib "*)
+		if (${SED} -e '2q' $lib |
+                    grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+		  library_names=
+		  old_library=
+		  case $lib in
+		  */* | *\\*) . $lib ;;
+		  *) . ./$lib ;;
+		  esac
+		  for l in $old_library $library_names; do
+		    ll="$l"
+		  done
+		  if test "X$ll" = "X$old_library" ; then # only static version available
+		    found=no
+		    ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+		    test "X$ladir" = "X$lib" && ladir="."
+		    lib=$ladir/$old_library
+		    if test "$linkmode,$pass" = "prog,link"; then
+		      compile_deplibs="$deplib $compile_deplibs"
+		      finalize_deplibs="$deplib $finalize_deplibs"
+		    else
+		      deplibs="$deplib $deplibs"
+		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+		    fi
+		    continue
+		  fi
+		fi
+	        ;;
+	      *) ;;
+	      esac
+	    fi
+	  fi
+	  ;; # -l
+	-L*)
+	  case $linkmode in
+	  lib)
+	    deplibs="$deplib $deplibs"
+	    test "$pass" = conv && continue
+	    newdependency_libs="$deplib $newdependency_libs"
+	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+	    ;;
+	  prog)
+	    if test "$pass" = conv; then
+	      deplibs="$deplib $deplibs"
+	      continue
+	    fi
+	    if test "$pass" = scan; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+	    ;;
+	  *)
+	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
+	    ;;
+	  esac # linkmode
+	  continue
+	  ;; # -L
+	-R*)
+	  if test "$pass" = link; then
+	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+	    # Make sure the xrpath contains only unique directories.
+	    case "$xrpath " in
+	    *" $dir "*) ;;
+	    *) xrpath="$xrpath $dir" ;;
+	    esac
+	  fi
+	  deplibs="$deplib $deplibs"
+	  continue
+	  ;;
+	*.la) lib="$deplib" ;;
+	*.$libext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	    continue
+	  fi
+	  case $linkmode in
+	  lib)
+	    valid_a_lib=no
+	    case $deplibs_check_method in
+	      match_pattern*)
+		set dummy $deplibs_check_method
+	        match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+		if eval $echo \"$deplib\" 2>/dev/null \
+		    | $SED 10q \
+		    | $EGREP "$match_pattern_regex" > /dev/null; then
+		  valid_a_lib=yes
+		fi
+		;;
+	      pass_all)
+		valid_a_lib=yes
+		;;
+            esac
+	    if test "$valid_a_lib" != yes; then
+	      $echo
+	      $echo "*** Warning: Trying to link with static lib archive $deplib."
+	      $echo "*** I have the capability to make that library automatically link in when"
+	      $echo "*** you link to this library.  But I can only do this if you have a"
+	      $echo "*** shared version of the library, which you do not appear to have"
+	      $echo "*** because the file extensions .$libext of this argument makes me believe"
+	      $echo "*** that it is just a static archive that I should not used here."
+	    else
+	      $echo
+	      $echo "*** Warning: Linking the shared library $output against the"
+	      $echo "*** static library $deplib is not portable!"
+	      deplibs="$deplib $deplibs"
+	    fi
+	    continue
+	    ;;
+	  prog)
+	    if test "$pass" != link; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    continue
+	    ;;
+	  esac # linkmode
+	  ;; # *.$libext
+	*.lo | *.$objext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	  elif test "$linkmode" = prog; then
+	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	      # If there is no dlopen support or we're linking statically,
+	      # we need to preload.
+	      newdlprefiles="$newdlprefiles $deplib"
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      newdlfiles="$newdlfiles $deplib"
+	    fi
+	  fi
+	  continue
+	  ;;
+	%DEPLIBS%)
+	  alldeplibs=yes
+	  continue
+	  ;;
+	esac # case $deplib
+	if test "$found" = yes || test -f "$lib"; then :
+	else
+	  $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	# Check to see that this really is a libtool archive.
+	if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$ladir" = "X$lib" && ladir="."
+
+	dlname=
+	dlopen=
+	dlpreopen=
+	libdir=
+	library_names=
+	old_library=
+	# If the library was installed with an old release of libtool,
+	# it will not redefine variables installed, or shouldnotlink
+	installed=yes
+	shouldnotlink=no
+	avoidtemprpath=
+
+
+	# Read the .la file
+	case $lib in
+	*/* | *\\*) . $lib ;;
+	*) . ./$lib ;;
+	esac
+
+	if test "$linkmode,$pass" = "lib,link" ||
+	   test "$linkmode,$pass" = "prog,scan" ||
+	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+	fi
+
+	if test "$pass" = conv; then
+	  # Only check for convenience libraries
+	  deplibs="$lib $deplibs"
+	  if test -z "$libdir"; then
+	    if test -z "$old_library"; then
+	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+	      exit $EXIT_FAILURE
+	    fi
+	    # It is a libtool convenience library, so add in its objects.
+	    convenience="$convenience $ladir/$objdir/$old_library"
+	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
+	    tmp_libs=
+	    for deplib in $dependency_libs; do
+	      deplibs="$deplib $deplibs"
+              if test "X$duplicate_deps" = "Xyes" ; then
+	        case "$tmp_libs " in
+	        *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	        esac
+              fi
+	      tmp_libs="$tmp_libs $deplib"
+	    done
+	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
+	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	  continue
+	fi # $pass = conv
+
+
+	# Get the name of the library we link against.
+	linklib=
+	for l in $old_library $library_names; do
+	  linklib="$l"
+	done
+	if test -z "$linklib"; then
+	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	# This library was specified with -dlopen.
+	if test "$pass" = dlopen; then
+	  if test -z "$libdir"; then
+	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	  if test -z "$dlname" ||
+	     test "$dlopen_support" != yes ||
+	     test "$build_libtool_libs" = no; then
+	    # If there is no dlname, no dlopen support or we're linking
+	    # statically, we need to preload.  We also need to preload any
+	    # dependent libraries so libltdl's deplib preloader doesn't
+	    # bomb out in the load deplibs phase.
+	    dlprefiles="$dlprefiles $lib $dependency_libs"
+	  else
+	    newdlfiles="$newdlfiles $lib"
+	  fi
+	  continue
+	fi # $pass = dlopen
+
+	# We need an absolute path.
+	case $ladir in
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+	*)
+	  abs_ladir=`cd "$ladir" && pwd`
+	  if test -z "$abs_ladir"; then
+	    $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
+	    $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+	    abs_ladir="$ladir"
+	  fi
+	  ;;
+	esac
+	laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+
+	# Find the relevant object directory and library name.
+	if test "X$installed" = Xyes; then
+	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    $echo "$modename: warning: library \`$lib' was moved." 1>&2
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    libdir="$abs_ladir"
+	  else
+	    dir="$libdir"
+	    absdir="$libdir"
+	  fi
+	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+	else
+	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    # Remove this search path later
+	    notinst_path="$notinst_path $abs_ladir"
+	  else
+	    dir="$ladir/$objdir"
+	    absdir="$abs_ladir/$objdir"
+	    # Remove this search path later
+	    notinst_path="$notinst_path $abs_ladir"
+	  fi
+	fi # $installed = yes
+	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+
+	# This library was specified with -dlpreopen.
+	if test "$pass" = dlpreopen; then
+	  if test -z "$libdir"; then
+	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	  # Prefer using a static library (so that no silly _DYNAMIC symbols
+	  # are required to link).
+	  if test -n "$old_library"; then
+	    newdlprefiles="$newdlprefiles $dir/$old_library"
+	  # Otherwise, use the dlname, so that lt_dlopen finds it.
+	  elif test -n "$dlname"; then
+	    newdlprefiles="$newdlprefiles $dir/$dlname"
+	  else
+	    newdlprefiles="$newdlprefiles $dir/$linklib"
+	  fi
+	fi # $pass = dlpreopen
+
+	if test -z "$libdir"; then
+	  # Link the convenience library
+	  if test "$linkmode" = lib; then
+	    deplibs="$dir/$old_library $deplibs"
+	  elif test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$dir/$old_library $compile_deplibs"
+	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
+	  else
+	    deplibs="$lib $deplibs" # used for prog,scan pass
+	  fi
+	  continue
+	fi
+
+
+	if test "$linkmode" = prog && test "$pass" != link; then
+	  newlib_search_path="$newlib_search_path $ladir"
+	  deplibs="$lib $deplibs"
+
+	  linkalldeplibs=no
+	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
+	     test "$build_libtool_libs" = no; then
+	    linkalldeplibs=yes
+	  fi
+
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    case $deplib in
+	    -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
+	    esac
+	    # Need to link against all dependency_libs?
+	    if test "$linkalldeplibs" = yes; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      # Need to hardcode shared library paths
+	      # or/and link against static libraries
+	      newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    if test "X$duplicate_deps" = "Xyes" ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done # for deplib
+	  continue
+	fi # $linkmode = prog...
+
+	if test "$linkmode,$pass" = "prog,link"; then
+	  if test -n "$library_names" &&
+         { { test "$prefer_static_libs" = no ||
+             test "$prefer_static_libs,$installed" = "built,yes"; } ||
+           test -z "$old_library"; }; then
+	    # We need to hardcode the library path
+	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+	      # Make sure the rpath contains only unique directories.
+	      case "$temp_rpath " in
+	      *" $dir "*) ;;
+	      *" $absdir "*) ;;
+	      *) temp_rpath="$temp_rpath $absdir" ;;
+	      esac
+	    fi
+
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) compile_rpath="$compile_rpath $absdir"
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) finalize_rpath="$finalize_rpath $libdir"
+	      esac
+	      ;;
+	    esac
+	  fi # $linkmode,$pass = prog,link...
+
+	  if test "$alldeplibs" = yes &&
+	     { test "$deplibs_check_method" = pass_all ||
+	       { test "$build_libtool_libs" = yes &&
+		 test -n "$library_names"; }; }; then
+	    # We only need to search for static libraries
+	    continue
+	  fi
+	fi
+
+	link_static=no # Whether the deplib will be linked statically
+	use_static_libs=$prefer_static_libs
+	if test "$use_static_libs" = built && test "$installed" = yes ; then
+	  use_static_libs=no
+	fi
+	if test -n "$library_names" &&
+	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
+	  if test "$installed" = no; then
+	    notinst_deplibs="$notinst_deplibs $lib"
+	    need_relink=yes
+	  fi
+	  # This is a shared library
+
+	  # Warn about portability, can't link against -module's on
+	  # some systems (darwin)
+	  if test "$shouldnotlink" = yes && test "$pass" = link ; then
+	    $echo
+	    if test "$linkmode" = prog; then
+	      $echo "*** Warning: Linking the executable $output against the loadable module"
+	    else
+	      $echo "*** Warning: Linking the shared library $output against the loadable module"
+	    fi
+	    $echo "*** $linklib is not portable!"
+	  fi
+	  if test "$linkmode" = lib &&
+	     test "$hardcode_into_libs" = yes; then
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) compile_rpath="$compile_rpath $absdir"
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) finalize_rpath="$finalize_rpath $libdir"
+	      esac
+	      ;;
+	    esac
+	  fi
+
+	  if test -n "$old_archive_from_expsyms_cmds"; then
+	    # figure out the soname
+	    set dummy $library_names
+	    realname="$2"
+	    shift; shift
+	    libname=`eval \\$echo \"$libname_spec\"`
+	    # use dlname if we got it. it's perfectly good, no?
+	    if test -n "$dlname"; then
+	      soname="$dlname"
+	    elif test -n "$soname_spec"; then
+	      # bleh windows
+	      case $host in
+	      *cygwin* | mingw*)
+		major=`expr $current - $age`
+		versuffix="-$major"
+		;;
+	      esac
+	      eval soname=\"$soname_spec\"
+	    else
+	      soname="$realname"
+	    fi
+
+	    # Make a new name for the extract_expsyms_cmds to use
+	    soroot="$soname"
+	    soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
+	    newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
+
+	    # If the library has no export list, then create one now
+	    if test -f "$output_objdir/$soname-def"; then :
+	    else
+	      $show "extracting exported symbol list from \`$soname'"
+	      save_ifs="$IFS"; IFS='~'
+	      cmds=$extract_expsyms_cmds
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		eval cmd=\"$cmd\"
+		$show "$cmd"
+		$run eval "$cmd" || exit $?
+	      done
+	      IFS="$save_ifs"
+	    fi
+
+	    # Create $newlib
+	    if test -f "$output_objdir/$newlib"; then :; else
+	      $show "generating import library for \`$soname'"
+	      save_ifs="$IFS"; IFS='~'
+	      cmds=$old_archive_from_expsyms_cmds
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		eval cmd=\"$cmd\"
+		$show "$cmd"
+		$run eval "$cmd" || exit $?
+	      done
+	      IFS="$save_ifs"
+	    fi
+	    # make sure the library variables are pointing to the new library
+	    dir=$output_objdir
+	    linklib=$newlib
+	  fi # test -n "$old_archive_from_expsyms_cmds"
+
+	  if test "$linkmode" = prog || test "$mode" != relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    lib_linked=yes
+	    case $hardcode_action in
+	    immediate | unsupported)
+	      if test "$hardcode_direct" = no; then
+		add="$dir/$linklib"
+		case $host in
+		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+		    *-*-unixware7*) add_dir="-L$dir" ;;
+		  *-*-darwin* )
+		    # if the lib is a module then we can not link against
+		    # it, someone is ignoring the new warnings I added
+		    if /usr/bin/file -L $add 2> /dev/null |
+                      $EGREP ": [^:]* bundle" >/dev/null ; then
+		      $echo "** Warning, lib $linklib is a module, not a shared library"
+		      if test -z "$old_library" ; then
+		        $echo
+		        $echo "** And there doesn't seem to be a static archive available"
+		        $echo "** The link will probably fail, sorry"
+		      else
+		        add="$dir/$old_library"
+		      fi
+		    fi
+		esac
+	      elif test "$hardcode_minus_L" = no; then
+		case $host in
+		*-*-sunos*) add_shlibpath="$dir" ;;
+		esac
+		add_dir="-L$dir"
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = no; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    relink)
+	      if test "$hardcode_direct" = yes; then
+		add="$dir/$linklib"
+	      elif test "$hardcode_minus_L" = yes; then
+		add_dir="-L$dir"
+		# Try looking first in the location we're being installed to.
+		if test -n "$inst_prefix_dir"; then
+		  case $libdir in
+		    [\\/]*)
+		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
+		      ;;
+		  esac
+		fi
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = yes; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    *) lib_linked=no ;;
+	    esac
+
+	    if test "$lib_linked" != yes; then
+	      $echo "$modename: configuration error: unsupported hardcode properties"
+	      exit $EXIT_FAILURE
+	    fi
+
+	    if test -n "$add_shlibpath"; then
+	      case :$compile_shlibpath: in
+	      *":$add_shlibpath:"*) ;;
+	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+	      esac
+	    fi
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	      if test "$hardcode_direct" != yes && \
+		 test "$hardcode_minus_L" != yes && \
+		 test "$hardcode_shlibpath_var" = yes; then
+		case :$finalize_shlibpath: in
+		*":$libdir:"*) ;;
+		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+		esac
+	      fi
+	    fi
+	  fi
+
+	  if test "$linkmode" = prog || test "$mode" = relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    # Finalize command for both is simple: just hardcode it.
+	    if test "$hardcode_direct" = yes; then
+	      add="$libdir/$linklib"
+	    elif test "$hardcode_minus_L" = yes; then
+	      add_dir="-L$libdir"
+	      add="-l$name"
+	    elif test "$hardcode_shlibpath_var" = yes; then
+	      case :$finalize_shlibpath: in
+	      *":$libdir:"*) ;;
+	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+	      esac
+	      add="-l$name"
+	    elif test "$hardcode_automatic" = yes; then
+	      if test -n "$inst_prefix_dir" &&
+		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
+	        add="$inst_prefix_dir$libdir/$linklib"
+	      else
+	        add="$libdir/$linklib"
+	      fi
+	    else
+	      # We cannot seem to hardcode it, guess we'll fake it.
+	      add_dir="-L$libdir"
+	      # Try looking first in the location we're being installed to.
+	      if test -n "$inst_prefix_dir"; then
+		case $libdir in
+		  [\\/]*)
+		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
+		    ;;
+		esac
+	      fi
+	      add="-l$name"
+	    fi
+
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	    fi
+	  fi
+	elif test "$linkmode" = prog; then
+	  # Here we assume that one of hardcode_direct or hardcode_minus_L
+	  # is not unsupported.  This is valid on all known static and
+	  # shared platforms.
+	  if test "$hardcode_direct" != unsupported; then
+	    test -n "$old_library" && linklib="$old_library"
+	    compile_deplibs="$dir/$linklib $compile_deplibs"
+	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
+	  else
+	    compile_deplibs="-l$name -L$dir $compile_deplibs"
+	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+	  fi
+	elif test "$build_libtool_libs" = yes; then
+	  # Not a shared library
+	  if test "$deplibs_check_method" != pass_all; then
+	    # We're trying link a shared library against a static one
+	    # but the system doesn't support it.
+
+	    # Just print a warning and add the library to dependency_libs so
+	    # that the program can be linked against the static library.
+	    $echo
+	    $echo "*** Warning: This system can not link to static lib archive $lib."
+	    $echo "*** I have the capability to make that library automatically link in when"
+	    $echo "*** you link to this library.  But I can only do this if you have a"
+	    $echo "*** shared version of the library, which you do not appear to have."
+	    if test "$module" = yes; then
+	      $echo "*** But as you try to build a module library, libtool will still create "
+	      $echo "*** a static module, that should work as long as the dlopening application"
+	      $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+	      if test -z "$global_symbol_pipe"; then
+		$echo
+		$echo "*** However, this would only work if libtool was able to extract symbol"
+		$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		$echo "*** not find such a program.  So, this module is probably useless."
+		$echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	      fi
+	      if test "$build_old_libs" = no; then
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  else
+	    deplibs="$dir/$old_library $deplibs"
+	    link_static=yes
+	  fi
+	fi # link shared/static library?
+
+	if test "$linkmode" = lib; then
+	  if test -n "$dependency_libs" &&
+	     { test "$hardcode_into_libs" != yes ||
+	       test "$build_old_libs" = yes ||
+	       test "$link_static" = yes; }; then
+	    # Extract -R from dependency_libs
+	    temp_deplibs=
+	    for libdir in $dependency_libs; do
+	      case $libdir in
+	      -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
+		   case " $xrpath " in
+		   *" $temp_xrpath "*) ;;
+		   *) xrpath="$xrpath $temp_xrpath";;
+		   esac;;
+	      *) temp_deplibs="$temp_deplibs $libdir";;
+	      esac
+	    done
+	    dependency_libs="$temp_deplibs"
+	  fi
+
+	  newlib_search_path="$newlib_search_path $absdir"
+	  # Link against this library
+	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  # ... and its dependency_libs
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    newdependency_libs="$deplib $newdependency_libs"
+	    if test "X$duplicate_deps" = "Xyes" ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done
+
+	  if test "$link_all_deplibs" != no; then
+	    # Add the search paths of all dependency libraries
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      -L*) path="$deplib" ;;
+	      *.la)
+		dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
+		test "X$dir" = "X$deplib" && dir="."
+		# We need an absolute path.
+		case $dir in
+		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+		*)
+		  absdir=`cd "$dir" && pwd`
+		  if test -z "$absdir"; then
+		    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+		    absdir="$dir"
+		  fi
+		  ;;
+		esac
+		if grep "^installed=no" $deplib > /dev/null; then
+		  path="$absdir/$objdir"
+		else
+		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  if test -z "$libdir"; then
+		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+		    exit $EXIT_FAILURE
+		  fi
+		  if test "$absdir" != "$libdir"; then
+		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
+		  fi
+		  path="$absdir"
+		fi
+		depdepl=
+		case $host in
+		*-*-darwin*)
+		  # we do not want to link against static libs,
+		  # but need to link against shared
+		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  if test -n "$deplibrary_names" ; then
+		    for tmp in $deplibrary_names ; do
+		      depdepl=$tmp
+		    done
+		    if test -f "$path/$depdepl" ; then
+		      depdepl="$path/$depdepl"
+		    fi
+		    # do not add paths which are already there
+		    case " $newlib_search_path " in
+		    *" $path "*) ;;
+		    *) newlib_search_path="$newlib_search_path $path";;
+		    esac
+		  fi
+		  path=""
+		  ;;
+		*)
+		  path="-L$path"
+		  ;;
+		esac
+		;;
+	      -l*)
+		case $host in
+		*-*-darwin*)
+		  # Again, we only want to link against shared libraries
+		  eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
+		  for tmp in $newlib_search_path ; do
+		    if test -f "$tmp/lib$tmp_libs.dylib" ; then
+		      eval depdepl="$tmp/lib$tmp_libs.dylib"
+		      break
+		    fi
+		  done
+		  path=""
+		  ;;
+		*) continue ;;
+		esac
+		;;
+	      *) continue ;;
+	      esac
+	      case " $deplibs " in
+	      *" $path "*) ;;
+	      *) deplibs="$path $deplibs" ;;
+	      esac
+	      case " $deplibs " in
+	      *" $depdepl "*) ;;
+	      *) deplibs="$depdepl $deplibs" ;;
+	      esac
+	    done
+	  fi # link_all_deplibs != no
+	fi # linkmode = lib
+      done # for deplib in $libs
+      dependency_libs="$newdependency_libs"
+      if test "$pass" = dlpreopen; then
+	# Link the dlpreopened libraries before other libraries
+	for deplib in $save_deplibs; do
+	  deplibs="$deplib $deplibs"
+	done
+      fi
+      if test "$pass" != dlopen; then
+	if test "$pass" != conv; then
+	  # Make sure lib_search_path contains only unique directories.
+	  lib_search_path=
+	  for dir in $newlib_search_path; do
+	    case "$lib_search_path " in
+	    *" $dir "*) ;;
+	    *) lib_search_path="$lib_search_path $dir" ;;
+	    esac
+	  done
+	  newlib_search_path=
+	fi
+
+	if test "$linkmode,$pass" != "prog,link"; then
+	  vars="deplibs"
+	else
+	  vars="compile_deplibs finalize_deplibs"
+	fi
+	for var in $vars dependency_libs; do
+	  # Add libraries to $var in reverse order
+	  eval tmp_libs=\"\$$var\"
+	  new_libs=
+	  for deplib in $tmp_libs; do
+	    # FIXME: Pedantically, this is the right thing to do, so
+	    #        that some nasty dependency loop isn't accidentally
+	    #        broken:
+	    #new_libs="$deplib $new_libs"
+	    # Pragmatically, this seems to cause very few problems in
+	    # practice:
+	    case $deplib in
+	    -L*) new_libs="$deplib $new_libs" ;;
+	    -R*) ;;
+	    *)
+	      # And here is the reason: when a library appears more
+	      # than once as an explicit dependence of a library, or
+	      # is implicitly linked in more than once by the
+	      # compiler, it is considered special, and multiple
+	      # occurrences thereof are not removed.  Compare this
+	      # with having the same library being listed as a
+	      # dependency of multiple other libraries: in this case,
+	      # we know (pedantically, we assume) the library does not
+	      # need to be listed more than once, so we keep only the
+	      # last copy.  This is not always right, but it is rare
+	      # enough that we require users that really mean to play
+	      # such unportable linking tricks to link the library
+	      # using -Wl,-lname, so that libtool does not consider it
+	      # for duplicate removal.
+	      case " $specialdeplibs " in
+	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
+	      *)
+		case " $new_libs " in
+		*" $deplib "*) ;;
+		*) new_libs="$deplib $new_libs" ;;
+		esac
+		;;
+	      esac
+	      ;;
+	    esac
+	  done
+	  tmp_libs=
+	  for deplib in $new_libs; do
+	    case $deplib in
+	    -L*)
+	      case " $tmp_libs " in
+	      *" $deplib "*) ;;
+	      *) tmp_libs="$tmp_libs $deplib" ;;
+	      esac
+	      ;;
+	    *) tmp_libs="$tmp_libs $deplib" ;;
+	    esac
+	  done
+	  eval $var=\"$tmp_libs\"
+	done # for var
+      fi
+      # Last step: remove runtime libs from dependency_libs
+      # (they stay in deplibs)
+      tmp_libs=
+      for i in $dependency_libs ; do
+	case " $predeps $postdeps $compiler_lib_search_path " in
+	*" $i "*)
+	  i=""
+	  ;;
+	esac
+	if test -n "$i" ; then
+	  tmp_libs="$tmp_libs $i"
+	fi
+      done
+      dependency_libs=$tmp_libs
+    done # for pass
+    if test "$linkmode" = prog; then
+      dlfiles="$newdlfiles"
+      dlprefiles="$newdlprefiles"
+    fi
+
+    case $linkmode in
+    oldlib)
+      if test -n "$deplibs"; then
+	$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
+      fi
+
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$rpath"; then
+	$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$xrpath"; then
+	$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
+      fi
+
+      # Now set the variables for building old libraries.
+      build_libtool_libs=no
+      oldlibs="$output"
+      objs="$objs$old_deplibs"
+      ;;
+
+    lib)
+      # Make sure we only generate libraries of the form `libNAME.la'.
+      case $outputname in
+      lib*)
+	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+	eval shared_ext=\"$shrext_cmds\"
+	eval libname=\"$libname_spec\"
+	;;
+      *)
+	if test "$module" = no; then
+	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+	if test "$need_lib_prefix" != no; then
+	  # Add the "lib" prefix for modules if required
+	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+	  eval shared_ext=\"$shrext_cmds\"
+	  eval libname=\"$libname_spec\"
+	else
+	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+	fi
+	;;
+      esac
+
+      if test -n "$objs"; then
+	if test "$deplibs_check_method" != pass_all; then
+	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
+	  exit $EXIT_FAILURE
+	else
+	  $echo
+	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
+	  $echo "*** objects $objs is not portable!"
+	  libobjs="$libobjs $objs"
+	fi
+      fi
+
+      if test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
+      fi
+
+      set dummy $rpath
+      if test "$#" -gt 2; then
+	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+      fi
+      install_libdir="$2"
+
+      oldlibs=
+      if test -z "$rpath"; then
+	if test "$build_libtool_libs" = yes; then
+	  # Building a libtool convenience library.
+	  # Some compilers have problems with a `.al' extension so
+	  # convenience libraries should have the same extension an
+	  # archive normally would.
+	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
+	  build_libtool_libs=convenience
+	  build_old_libs=yes
+	fi
+
+	if test -n "$vinfo"; then
+	  $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
+	fi
+
+	if test -n "$release"; then
+	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
+	fi
+      else
+
+	# Parse the version information argument.
+	save_ifs="$IFS"; IFS=':'
+	set dummy $vinfo 0 0 0
+	IFS="$save_ifs"
+
+	if test -n "$8"; then
+	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	# convert absolute version numbers to libtool ages
+	# this retains compatibility with .la files and attempts
+	# to make the code below a bit more comprehensible
+
+	case $vinfo_number in
+	yes)
+	  number_major="$2"
+	  number_minor="$3"
+	  number_revision="$4"
+	  #
+	  # There are really only two kinds -- those that
+	  # use the current revision as the major version
+	  # and those that subtract age and use age as
+	  # a minor version.  But, then there is irix
+	  # which has an extra 1 added just for fun
+	  #
+	  case $version_type in
+	  darwin|linux|osf|windows|none)
+	    current=`expr $number_major + $number_minor`
+	    age="$number_minor"
+	    revision="$number_revision"
+	    ;;
+	  freebsd-aout|freebsd-elf|sunos)
+	    current="$number_major"
+	    revision="$number_minor"
+	    age="0"
+	    ;;
+	  irix|nonstopux)
+	    current=`expr $number_major + $number_minor - 1`
+	    age="$number_minor"
+	    revision="$number_minor"
+	    ;;
+	  esac
+	  ;;
+	no)
+	  current="$2"
+	  revision="$3"
+	  age="$4"
+	  ;;
+	esac
+
+	# Check that each of the things are valid numbers.
+	case $current in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+
+	case $revision in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+
+	case $age in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+
+	if test "$age" -gt "$current"; then
+	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	# Calculate the version variables.
+	major=
+	versuffix=
+	verstring=
+	case $version_type in
+	none) ;;
+
+	darwin)
+	  # Like Linux, but with the current version available in
+	  # verstring for coding it into the library header
+	  major=.`expr $current - $age`
+	  versuffix="$major.$age.$revision"
+	  # Darwin ld doesn't like 0 for these options...
+	  minor_current=`expr $current + 1`
+	  verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+	  ;;
+
+	freebsd-aout)
+	  major=".$current"
+	  versuffix=".$current.$revision";
+	  ;;
+
+	freebsd-elf)
+	  major=".$current"
+	  versuffix=".$current";
+	  ;;
+
+	irix | nonstopux)
+	  major=`expr $current - $age + 1`
+
+	  case $version_type in
+	    nonstopux) verstring_prefix=nonstopux ;;
+	    *)         verstring_prefix=sgi ;;
+	  esac
+	  verstring="$verstring_prefix$major.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$revision
+	  while test "$loop" -ne 0; do
+	    iface=`expr $revision - $loop`
+	    loop=`expr $loop - 1`
+	    verstring="$verstring_prefix$major.$iface:$verstring"
+	  done
+
+	  # Before this point, $major must not contain `.'.
+	  major=.$major
+	  versuffix="$major.$revision"
+	  ;;
+
+	linux)
+	  major=.`expr $current - $age`
+	  versuffix="$major.$age.$revision"
+	  ;;
+
+	osf)
+	  major=.`expr $current - $age`
+	  versuffix=".$current.$age.$revision"
+	  verstring="$current.$age.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$age
+	  while test "$loop" -ne 0; do
+	    iface=`expr $current - $loop`
+	    loop=`expr $loop - 1`
+	    verstring="$verstring:${iface}.0"
+	  done
+
+	  # Make executables depend on our current version.
+	  verstring="$verstring:${current}.0"
+	  ;;
+
+	sunos)
+	  major=".$current"
+	  versuffix=".$current.$revision"
+	  ;;
+
+	windows)
+	  # Use '-' rather than '.', since we only want one
+	  # extension on DOS 8.3 filesystems.
+	  major=`expr $current - $age`
+	  versuffix="-$major"
+	  ;;
+
+	*)
+	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
+	  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+
+	# Clear the version info if we defaulted, and they specified a release.
+	if test -z "$vinfo" && test -n "$release"; then
+	  major=
+	  case $version_type in
+	  darwin)
+	    # we can't check for "0.0" in archive_cmds due to quoting
+	    # problems, so we reset it completely
+	    verstring=
+	    ;;
+	  *)
+	    verstring="0.0"
+	    ;;
+	  esac
+	  if test "$need_version" = no; then
+	    versuffix=
+	  else
+	    versuffix=".0.0"
+	  fi
+	fi
+
+	# Remove version info from name if versioning should be avoided
+	if test "$avoid_version" = yes && test "$need_version" = no; then
+	  major=
+	  versuffix=
+	  verstring=""
+	fi
+
+	# Check to see if the archive will have undefined symbols.
+	if test "$allow_undefined" = yes; then
+	  if test "$allow_undefined_flag" = unsupported; then
+	    $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+	    build_libtool_libs=no
+	    build_old_libs=yes
+	  fi
+	else
+	  # Don't allow undefined symbols.
+	  allow_undefined_flag="$no_undefined_flag"
+	fi
+      fi
+
+      if test "$mode" != relink; then
+	# Remove our outputs, but don't remove object files since they
+	# may have been created when compiling PIC objects.
+	removelist=
+	tempremovelist=`$echo "$output_objdir/*"`
+	for p in $tempremovelist; do
+	  case $p in
+	    *.$objext)
+	       ;;
+	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+	       if test "X$precious_files_regex" != "X"; then
+	         if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+	         then
+		   continue
+		 fi
+	       fi
+	       removelist="$removelist $p"
+	       ;;
+	    *) ;;
+	  esac
+	done
+	if test -n "$removelist"; then
+	  $show "${rm}r $removelist"
+	  $run ${rm}r $removelist
+	fi
+      fi
+
+      # Now set the variables for building old libraries.
+      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+	oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+	# Transform .lo files to .o files.
+	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+      fi
+
+      # Eliminate all temporary directories.
+#      for path in $notinst_path; do
+#	lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
+#	deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
+#	dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
+#      done
+
+      if test -n "$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	temp_xrpath=
+	for libdir in $xrpath; do
+	  temp_xrpath="$temp_xrpath -R$libdir"
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  esac
+	done
+	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+	  dependency_libs="$temp_xrpath $dependency_libs"
+	fi
+      fi
+
+      # Make sure dlfiles contains only unique files that won't be dlpreopened
+      old_dlfiles="$dlfiles"
+      dlfiles=
+      for lib in $old_dlfiles; do
+	case " $dlprefiles $dlfiles " in
+	*" $lib "*) ;;
+	*) dlfiles="$dlfiles $lib" ;;
+	esac
+      done
+
+      # Make sure dlprefiles contains only unique files
+      old_dlprefiles="$dlprefiles"
+      dlprefiles=
+      for lib in $old_dlprefiles; do
+	case "$dlprefiles " in
+	*" $lib "*) ;;
+	*) dlprefiles="$dlprefiles $lib" ;;
+	esac
+      done
+
+      if test "$build_libtool_libs" = yes; then
+	if test -n "$rpath"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
+	    # these systems don't actually have a c library (as such)!
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C library is in the System framework
+	    deplibs="$deplibs -framework System"
+	    ;;
+	  *-*-netbsd*)
+	    # Don't link with libc until the a.out ld.so is fixed.
+	    ;;
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	    # Do not include libc due to us having libc/libc_r.
+	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
+	    ;;
+ 	  *)
+	    # Add libc to deplibs on all other systems if necessary.
+	    if test "$build_libtool_need_lc" = "yes"; then
+	      deplibs="$deplibs -lc"
+	    fi
+	    ;;
+	  esac
+	fi
+
+	# Transform deplibs into only deplibs that can be linked in shared.
+	name_save=$name
+	libname_save=$libname
+	release_save=$release
+	versuffix_save=$versuffix
+	major_save=$major
+	# I'm not sure if I'm treating the release correctly.  I think
+	# release should show up in the -l (ie -lgmp5) so we don't want to
+	# add it in twice.  Is that correct?
+	release=""
+	versuffix=""
+	major=""
+	newdeplibs=
+	droppeddeps=no
+	case $deplibs_check_method in
+	pass_all)
+	  # Don't check for shared/static.  Everything works.
+	  # This might be a little naive.  We might want to check
+	  # whether the library exists or not.  But this is on
+	  # osf3 & osf4 and I'm not really sure... Just
+	  # implementing what was already the behavior.
+	  newdeplibs=$deplibs
+	  ;;
+	test_compile)
+	  # This code stresses the "libraries are programs" paradigm to its
+	  # limits. Maybe even breaks it.  We compile a program, linking it
+	  # against the deplibs as a proxy for the library.  Then we can check
+	  # whether they linked in statically or dynamically with ldd.
+	  $rm conftest.c
+	  cat > conftest.c <<EOF
+	  int main() { return 0; }
+EOF
+	  $rm conftest
+      if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+	    ldd_output=`ldd conftest`
+	    for i in $deplibs; do
+	      name=`expr $i : '-l\(.*\)'`
+	      # If $name is empty we are operating on a -L argument.
+              if test "$name" != "" && test "$name" != "0"; then
+		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		  case " $predeps $postdeps " in
+		  *" $i "*)
+		    newdeplibs="$newdeplibs $i"
+		    i=""
+		    ;;
+		  esac
+	        fi
+		if test -n "$i" ; then
+		  libname=`eval \\$echo \"$libname_spec\"`
+		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
+		  set dummy $deplib_matches
+		  deplib_match=$2
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		    newdeplibs="$newdeplibs $i"
+		  else
+		    droppeddeps=yes
+		    $echo
+		    $echo "*** Warning: dynamic linker does not accept needed library $i."
+		    $echo "*** I have the capability to make that library automatically link in when"
+		    $echo "*** you link to this library.  But I can only do this if you have a"
+		    $echo "*** shared version of the library, which I believe you do not have"
+		    $echo "*** because a test_compile did reveal that the linker did not use it for"
+		    $echo "*** its dynamic dependency list that programs get resolved with at runtime."
+		  fi
+		fi
+	      else
+		newdeplibs="$newdeplibs $i"
+	      fi
+	    done
+	  else
+	    # Error occurred in the first compile.  Let's try to salvage
+	    # the situation: Compile a separate program for each library.
+	    for i in $deplibs; do
+	      name=`expr $i : '-l\(.*\)'`
+	      # If $name is empty we are operating on a -L argument.
+              if test "$name" != "" && test "$name" != "0"; then
+		$rm conftest
+		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+		  ldd_output=`ldd conftest`
+		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		    case " $predeps $postdeps " in
+		    *" $i "*)
+		      newdeplibs="$newdeplibs $i"
+		      i=""
+		      ;;
+		    esac
+		  fi
+		  if test -n "$i" ; then
+		    libname=`eval \\$echo \"$libname_spec\"`
+		    deplib_matches=`eval \\$echo \"$library_names_spec\"`
+		    set dummy $deplib_matches
+		    deplib_match=$2
+		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		      newdeplibs="$newdeplibs $i"
+		    else
+		      droppeddeps=yes
+		      $echo
+		      $echo "*** Warning: dynamic linker does not accept needed library $i."
+		      $echo "*** I have the capability to make that library automatically link in when"
+		      $echo "*** you link to this library.  But I can only do this if you have a"
+		      $echo "*** shared version of the library, which you do not appear to have"
+		      $echo "*** because a test_compile did reveal that the linker did not use this one"
+		      $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+		    fi
+		  fi
+		else
+		  droppeddeps=yes
+		  $echo
+		  $echo "*** Warning!  Library $i is needed by this library but I was not able to"
+		  $echo "*** make it link in!  You will probably need to install it or some"
+		  $echo "*** library that it depends on before this library will be fully"
+		  $echo "*** functional.  Installing it before continuing would be even better."
+		fi
+	      else
+		newdeplibs="$newdeplibs $i"
+	      fi
+	    done
+	  fi
+	  ;;
+	file_magic*)
+	  set dummy $deplibs_check_method
+	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    name=`expr $a_deplib : '-l\(.*\)'`
+	    # If $name is empty we are operating on a -L argument.
+            if test "$name" != "" && test  "$name" != "0"; then
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  newdeplibs="$newdeplibs $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval \\$echo \"$libname_spec\"`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		      # Follow soft links.
+		      if ls -lLd "$potent_lib" 2>/dev/null \
+			 | grep " -> " >/dev/null; then
+			continue
+		      fi
+		      # The statement above tries to avoid entering an
+		      # endless loop below, in case of cyclic links.
+		      # We might still enter an endless loop, since a link
+		      # loop can be closed while we follow links,
+		      # but so what?
+		      potlib="$potent_lib"
+		      while test -h "$potlib" 2>/dev/null; do
+			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+			case $potliblink in
+			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+			esac
+		      done
+		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+			 | ${SED} 10q \
+			 | $EGREP "$file_magic_regex" > /dev/null; then
+			newdeplibs="$newdeplibs $a_deplib"
+			a_deplib=""
+			break 2
+		      fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		$echo
+		$echo "*** Warning: linker path does not have real file for library $a_deplib."
+		$echo "*** I have the capability to make that library automatically link in when"
+		$echo "*** you link to this library.  But I can only do this if you have a"
+		$echo "*** shared version of the library, which you do not appear to have"
+		$echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $echo "*** with $libname but no candidates were found. (...for file magic test)"
+		else
+		  $echo "*** with $libname and none of the candidates passed a file format test"
+		  $echo "*** using a file magic. Last file checked: $potlib"
+		fi
+	      fi
+	    else
+	      # Add a -L argument.
+	      newdeplibs="$newdeplibs $a_deplib"
+	    fi
+	  done # Gone through all deplibs.
+	  ;;
+	match_pattern*)
+	  set dummy $deplibs_check_method
+	  match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    name=`expr $a_deplib : '-l\(.*\)'`
+	    # If $name is empty we are operating on a -L argument.
+	    if test -n "$name" && test "$name" != "0"; then
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  newdeplibs="$newdeplibs $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval \\$echo \"$libname_spec\"`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		    potlib="$potent_lib" # see symlink-check above in file_magic test
+		    if eval $echo \"$potent_lib\" 2>/dev/null \
+		        | ${SED} 10q \
+		        | $EGREP "$match_pattern_regex" > /dev/null; then
+		      newdeplibs="$newdeplibs $a_deplib"
+		      a_deplib=""
+		      break 2
+		    fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		$echo
+		$echo "*** Warning: linker path does not have real file for library $a_deplib."
+		$echo "*** I have the capability to make that library automatically link in when"
+		$echo "*** you link to this library.  But I can only do this if you have a"
+		$echo "*** shared version of the library, which you do not appear to have"
+		$echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
+		else
+		  $echo "*** with $libname and none of the candidates passed a file format test"
+		  $echo "*** using a regex pattern. Last file checked: $potlib"
+		fi
+	      fi
+	    else
+	      # Add a -L argument.
+	      newdeplibs="$newdeplibs $a_deplib"
+	    fi
+	  done # Gone through all deplibs.
+	  ;;
+	none | unknown | *)
+	  newdeplibs=""
+	  tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
+	    -e 's/ -[LR][^ ]*//g'`
+	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	    for i in $predeps $postdeps ; do
+	      # can't use Xsed below, because $i might contain '/'
+	      tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
+	    done
+	  fi
+	  if $echo "X $tmp_deplibs" | $Xsed -e 's/[ 	]//g' \
+	    | grep . >/dev/null; then
+	    $echo
+	    if test "X$deplibs_check_method" = "Xnone"; then
+	      $echo "*** Warning: inter-library dependencies are not supported in this platform."
+	    else
+	      $echo "*** Warning: inter-library dependencies are not known to be supported."
+	    fi
+	    $echo "*** All declared inter-library dependencies are being dropped."
+	    droppeddeps=yes
+	  fi
+	  ;;
+	esac
+	versuffix=$versuffix_save
+	major=$major_save
+	release=$release_save
+	libname=$libname_save
+	name=$name_save
+
+	case $host in
+	*-*-rhapsody* | *-*-darwin1.[012])
+	  # On Rhapsody replace the C library is the System framework
+	  newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
+	  ;;
+	esac
+
+	if test "$droppeddeps" = yes; then
+	  if test "$module" = yes; then
+	    $echo
+	    $echo "*** Warning: libtool could not satisfy all declared inter-library"
+	    $echo "*** dependencies of module $libname.  Therefore, libtool will create"
+	    $echo "*** a static module, that should work as long as the dlopening"
+	    $echo "*** application is linked with the -dlopen flag."
+	    if test -z "$global_symbol_pipe"; then
+	      $echo
+	      $echo "*** However, this would only work if libtool was able to extract symbol"
+	      $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      $echo "*** not find such a program.  So, this module is probably useless."
+	      $echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	    fi
+	    if test "$build_old_libs" = no; then
+	      oldlibs="$output_objdir/$libname.$libext"
+	      build_libtool_libs=module
+	      build_old_libs=yes
+	    else
+	      build_libtool_libs=no
+	    fi
+	  else
+	    $echo "*** The inter-library dependencies that have been dropped here will be"
+	    $echo "*** automatically added whenever a program is linked with this library"
+	    $echo "*** or is declared to -dlopen it."
+
+	    if test "$allow_undefined" = no; then
+	      $echo
+	      $echo "*** Since this library must not contain undefined symbols,"
+	      $echo "*** because either the platform does not support them or"
+	      $echo "*** it was explicitly requested with -no-undefined,"
+	      $echo "*** libtool will only create a static version of it."
+	      if test "$build_old_libs" = no; then
+		oldlibs="$output_objdir/$libname.$libext"
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  fi
+	fi
+	# Done checking deplibs!
+	deplibs=$newdeplibs
+      fi
+
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $deplibs " in
+	  *" -L$path/$objdir "*)
+	    new_libs="$new_libs -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) new_libs="$new_libs $deplib" ;;
+	  esac
+	  ;;
+	*) new_libs="$new_libs $deplib" ;;
+	esac
+      done
+      deplibs="$new_libs"
+
+
+      # All the library-specific variables (install_libdir is set above).
+      library_names=
+      old_library=
+      dlname=
+
+      # Test again, we may have decided not to build it any more
+      if test "$build_libtool_libs" = yes; then
+	if test "$hardcode_into_libs" = yes; then
+	  # Hardcode the library paths
+	  hardcode_libdirs=
+	  dep_rpath=
+	  rpath="$finalize_rpath"
+	  test "$mode" != relink && rpath="$compile_rpath$rpath"
+	  for libdir in $rpath; do
+	    if test -n "$hardcode_libdir_flag_spec"; then
+	      if test -n "$hardcode_libdir_separator"; then
+		if test -z "$hardcode_libdirs"; then
+		  hardcode_libdirs="$libdir"
+		else
+		  # Just accumulate the unique libdirs.
+		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		    ;;
+		  *)
+		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		    ;;
+		  esac
+		fi
+	      else
+		eval flag=\"$hardcode_libdir_flag_spec\"
+		dep_rpath="$dep_rpath $flag"
+	      fi
+	    elif test -n "$runpath_var"; then
+	      case "$perm_rpath " in
+	      *" $libdir "*) ;;
+	      *) perm_rpath="$perm_rpath $libdir" ;;
+	      esac
+	    fi
+	  done
+	  # Substitute the hardcoded libdirs into the rpath.
+	  if test -n "$hardcode_libdir_separator" &&
+	     test -n "$hardcode_libdirs"; then
+	    libdir="$hardcode_libdirs"
+	    if test -n "$hardcode_libdir_flag_spec_ld"; then
+	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+	    else
+	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+	    fi
+	  fi
+	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
+	    # We should set the runpath_var.
+	    rpath=
+	    for dir in $perm_rpath; do
+	      rpath="$rpath$dir:"
+	    done
+	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+	  fi
+	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+	fi
+
+	shlibpath="$finalize_shlibpath"
+	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+	if test -n "$shlibpath"; then
+	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+	fi
+
+	# Get the real and link names of the library.
+	eval shared_ext=\"$shrext_cmds\"
+	eval library_names=\"$library_names_spec\"
+	set dummy $library_names
+	realname="$2"
+	shift; shift
+
+	if test -n "$soname_spec"; then
+	  eval soname=\"$soname_spec\"
+	else
+	  soname="$realname"
+	fi
+	if test -z "$dlname"; then
+	  dlname=$soname
+	fi
+
+	lib="$output_objdir/$realname"
+	linknames=
+	for link
+	do
+	  linknames="$linknames $link"
+	done
+
+	# Use standard objects if they are pic
+	test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+
+	# Prepare the list of exported symbols
+	if test -z "$export_symbols"; then
+	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+	    $show "generating symbol list for \`$libname.la'"
+	    export_symbols="$output_objdir/$libname.exp"
+	    $run $rm $export_symbols
+	    cmds=$export_symbols_cmds
+	    save_ifs="$IFS"; IFS='~'
+	    for cmd in $cmds; do
+	      IFS="$save_ifs"
+	      eval cmd=\"$cmd\"
+	      if len=`expr "X$cmd" : ".*"` &&
+	       test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	        $show "$cmd"
+	        $run eval "$cmd" || exit $?
+	        skipped_export=false
+	      else
+	        # The command line is too long to execute in one step.
+	        $show "using reloadable object file for export list..."
+	        skipped_export=:
+		# Break out early, otherwise skipped_export may be
+		# set to false by a later but shorter cmd.
+		break
+	      fi
+	    done
+	    IFS="$save_ifs"
+	    if test -n "$export_symbols_regex"; then
+	      $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
+	      $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      $show "$mv \"${export_symbols}T\" \"$export_symbols\""
+	      $run eval '$mv "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+	fi
+
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
+	fi
+
+	tmp_deplibs=
+	for test_deplib in $deplibs; do
+		case " $convenience " in
+		*" $test_deplib "*) ;;
+		*)
+			tmp_deplibs="$tmp_deplibs $test_deplib"
+			;;
+		esac
+	done
+	deplibs="$tmp_deplibs"
+
+	if test -n "$convenience"; then
+	  if test -n "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	  else
+	    gentop="$output_objdir/${outputname}x"
+	    generated="$generated $gentop"
+
+	    func_extract_archives $gentop $convenience
+	    libobjs="$libobjs $func_extract_archives_result"
+	  fi
+	fi
+	
+	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+	  eval flag=\"$thread_safe_flag_spec\"
+	  linker_flags="$linker_flags $flag"
+	fi
+
+	# Make a backup of the uninstalled library when relinking
+	if test "$mode" = relink; then
+	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
+	fi
+
+	# Do each of the archive commands.
+	if test "$module" = yes && test -n "$module_cmds" ; then
+	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	    eval test_cmds=\"$module_expsym_cmds\"
+	    cmds=$module_expsym_cmds
+	  else
+	    eval test_cmds=\"$module_cmds\"
+	    cmds=$module_cmds
+	  fi
+	else
+	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	  eval test_cmds=\"$archive_expsym_cmds\"
+	  cmds=$archive_expsym_cmds
+	else
+	  eval test_cmds=\"$archive_cmds\"
+	  cmds=$archive_cmds
+	  fi
+	fi
+
+	if test "X$skipped_export" != "X:" &&
+	   len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  :
+	else
+	  # The command line is too long to link in one step, link piecewise.
+	  $echo "creating reloadable object files..."
+
+	  # Save the value of $output and $libobjs because we want to
+	  # use them later.  If we have whole_archive_flag_spec, we
+	  # want to use save_libobjs as it was before
+	  # whole_archive_flag_spec was expanded, because we can't
+	  # assume the linker understands whole_archive_flag_spec.
+	  # This may have to be revisited, in case too many
+	  # convenience libraries get linked in and end up exceeding
+	  # the spec.
+	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	  fi
+	  save_output=$output
+	  output_la=`$echo "X$output" | $Xsed -e "$basename"`
+
+	  # Clear the reloadable object creation command queue and
+	  # initialize k to one.
+	  test_cmds=
+	  concat_cmds=
+	  objlist=
+	  delfiles=
+	  last_robj=
+	  k=1
+	  output=$output_objdir/$output_la-${k}.$objext
+	  # Loop over the list of objects to be linked.
+	  for obj in $save_libobjs
+	  do
+	    eval test_cmds=\"$reload_cmds $objlist $last_robj\"
+	    if test "X$objlist" = X ||
+	       { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+		 test "$len" -le "$max_cmd_len"; }; then
+	      objlist="$objlist $obj"
+	    else
+	      # The command $test_cmds is almost too long, add a
+	      # command to the queue.
+	      if test "$k" -eq 1 ; then
+		# The first file doesn't have a previous command to add.
+		eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+	      else
+		# All subsequent reloadable object files will link in
+		# the last one created.
+		eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
+	      fi
+	      last_robj=$output_objdir/$output_la-${k}.$objext
+	      k=`expr $k + 1`
+	      output=$output_objdir/$output_la-${k}.$objext
+	      objlist=$obj
+	      len=1
+	    fi
+	  done
+	  # Handle the remaining objects by creating one last
+	  # reloadable object file.  All subsequent reloadable object
+	  # files will link in the last one created.
+	  test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	  eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+
+	  if ${skipped_export-false}; then
+	    $show "generating symbol list for \`$libname.la'"
+	    export_symbols="$output_objdir/$libname.exp"
+	    $run $rm $export_symbols
+	    libobjs=$output
+	    # Append the command to create the export file.
+	    eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
+          fi
+
+	  # Set up a command to remove the reloadable object files
+	  # after they are used.
+	  i=0
+	  while test "$i" -lt "$k"
+	  do
+	    i=`expr $i + 1`
+	    delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
+	  done
+
+	  $echo "creating a temporary reloadable object file: $output"
+
+	  # Loop through the commands generated above and execute them.
+	  save_ifs="$IFS"; IFS='~'
+	  for cmd in $concat_cmds; do
+	    IFS="$save_ifs"
+	    $show "$cmd"
+	    $run eval "$cmd" || exit $?
+	  done
+	  IFS="$save_ifs"
+
+	  libobjs=$output
+	  # Restore the value of output.
+	  output=$save_output
+
+	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	  fi
+	  # Expand the library linking commands again to reset the
+	  # value of $libobjs for piecewise linking.
+
+	  # Do each of the archive commands.
+	  if test "$module" = yes && test -n "$module_cmds" ; then
+	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	      cmds=$module_expsym_cmds
+	    else
+	      cmds=$module_cmds
+	    fi
+	  else
+	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	    cmds=$archive_expsym_cmds
+	  else
+	    cmds=$archive_cmds
+	    fi
+	  fi
+
+	  # Append the command to remove the reloadable object files
+	  # to the just-reset $cmds.
+	  eval cmds=\"\$cmds~\$rm $delfiles\"
+	fi
+	save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  eval cmd=\"$cmd\"
+	  $show "$cmd"
+	  $run eval "$cmd" || {
+	    lt_exit=$?
+
+	    # Restore the uninstalled library and exit
+	    if test "$mode" = relink; then
+	      $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+	    fi
+
+	    exit $lt_exit
+	  }
+	done
+	IFS="$save_ifs"
+
+	# Restore the uninstalled library and exit
+	if test "$mode" = relink; then
+	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
+
+	  if test -n "$convenience"; then
+	    if test -z "$whole_archive_flag_spec"; then
+	      $show "${rm}r $gentop"
+	      $run ${rm}r "$gentop"
+	    fi
+	  fi
+
+	  exit $EXIT_SUCCESS
+	fi
+
+	# Create links to the real library.
+	for linkname in $linknames; do
+	  if test "$realname" != "$linkname"; then
+	    $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
+	    $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
+	  fi
+	done
+
+	# If -module or -export-dynamic was specified, set the dlname.
+	if test "$module" = yes || test "$export_dynamic" = yes; then
+	  # On all known operating systems, these are identical.
+	  dlname="$soname"
+	fi
+      fi
+      ;;
+
+    obj)
+      if test -n "$deplibs"; then
+	$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
+      fi
+
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$rpath"; then
+	$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$xrpath"; then
+	$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
+      fi
+
+      case $output in
+      *.lo)
+	if test -n "$objs$old_deplibs"; then
+	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+	libobj="$output"
+	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
+	;;
+      *)
+	libobj=
+	obj="$output"
+	;;
+      esac
+
+      # Delete the old objects.
+      $run $rm $obj $libobj
+
+      # Objects from convenience libraries.  This assumes
+      # single-version convenience libraries.  Whenever we create
+      # different ones for PIC/non-PIC, this we'll have to duplicate
+      # the extraction.
+      reload_conv_objs=
+      gentop=
+      # reload_cmds runs $LD directly, so let us get rid of
+      # -Wl from whole_archive_flag_spec and hope we can get by with
+      # turning comma into space..
+      wl=
+
+      if test -n "$convenience"; then
+	if test -n "$whole_archive_flag_spec"; then
+	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+      reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
+	else
+	  gentop="$output_objdir/${obj}x"
+	  generated="$generated $gentop"
+
+	  func_extract_archives $gentop $convenience
+	  reload_conv_objs="$reload_objs $func_extract_archives_result"
+	fi
+      fi
+
+      # Create the old-style object.
+      reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+      output="$obj"
+      cmds=$reload_cmds
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+	IFS="$save_ifs"
+	eval cmd=\"$cmd\"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+
+      # Exit if we aren't doing a library object file.
+      if test -z "$libobj"; then
+	if test -n "$gentop"; then
+	  $show "${rm}r $gentop"
+	  $run ${rm}r $gentop
+	fi
+
+	exit $EXIT_SUCCESS
+      fi
+
+      if test "$build_libtool_libs" != yes; then
+	if test -n "$gentop"; then
+	  $show "${rm}r $gentop"
+	  $run ${rm}r $gentop
+	fi
+
+	# Create an invalid libtool object if no PIC, so that we don't
+	# accidentally link it into a program.
+	# $show "echo timestamp > $libobj"
+	# $run eval "echo timestamp > $libobj" || exit $?
+	exit $EXIT_SUCCESS
+      fi
+
+      if test -n "$pic_flag" || test "$pic_mode" != default; then
+	# Only do commands if we really have different PIC objects.
+	reload_objs="$libobjs $reload_conv_objs"
+	output="$libobj"
+	cmds=$reload_cmds
+	save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  eval cmd=\"$cmd\"
+	  $show "$cmd"
+	  $run eval "$cmd" || exit $?
+	done
+	IFS="$save_ifs"
+      fi
+
+      if test -n "$gentop"; then
+	$show "${rm}r $gentop"
+	$run ${rm}r $gentop
+      fi
+
+      exit $EXIT_SUCCESS
+      ;;
+
+    prog)
+      case $host in
+	*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
+      esac
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
+      fi
+
+      if test "$preload" = yes; then
+	if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
+	   test "$dlopen_self_static" = unknown; then
+	  $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
+	fi
+      fi
+
+      case $host in
+      *-*-rhapsody* | *-*-darwin1.[012])
+	# On Rhapsody replace the C library is the System framework
+	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+	;;
+      esac
+
+      case $host in
+      *darwin*)
+        # Don't allow lazy linking, it breaks C++ global constructors
+        if test "$tagname" = CXX ; then
+        compile_command="$compile_command ${wl}-bind_at_load"
+        finalize_command="$finalize_command ${wl}-bind_at_load"
+        fi
+        ;;
+      esac
+
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $compile_deplibs " in
+	  *" -L$path/$objdir "*)
+	    new_libs="$new_libs -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $compile_deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) new_libs="$new_libs $deplib" ;;
+	  esac
+	  ;;
+	*) new_libs="$new_libs $deplib" ;;
+	esac
+      done
+      compile_deplibs="$new_libs"
+
+
+      compile_command="$compile_command $compile_deplibs"
+      finalize_command="$finalize_command $finalize_deplibs"
+
+      if test -n "$rpath$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	for libdir in $rpath $xrpath; do
+	  # This is the magic to use -rpath.
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  esac
+	done
+      fi
+
+      # Now hardcode the library paths
+      rpath=
+      hardcode_libdirs=
+      for libdir in $compile_rpath $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    rpath="$rpath $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) perm_rpath="$perm_rpath $libdir" ;;
+	  esac
+	fi
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
+	  case :$dllsearchpath: in
+	  *":$libdir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$libdir";;
+	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$testbindir";;
+	  esac
+	  ;;
+	esac
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      compile_rpath="$rpath"
+
+      rpath=
+      hardcode_libdirs=
+      for libdir in $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    rpath="$rpath $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$finalize_perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+	  esac
+	fi
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      finalize_rpath="$rpath"
+
+      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+	# Transform all the library objects into standard objects.
+	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+      fi
+
+      dlsyms=
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	if test -n "$NM" && test -n "$global_symbol_pipe"; then
+	  dlsyms="${outputname}S.c"
+	else
+	  $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
+	fi
+      fi
+
+      if test -n "$dlsyms"; then
+	case $dlsyms in
+	"") ;;
+	*.c)
+	  # Discover the nlist of each of the dlfiles.
+	  nlist="$output_objdir/${outputname}.nm"
+
+	  $show "$rm $nlist ${nlist}S ${nlist}T"
+	  $run $rm "$nlist" "${nlist}S" "${nlist}T"
+
+	  # Parse the name list into a source file.
+	  $show "creating $output_objdir/$dlsyms"
+
+	  test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
+/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
+/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* Prevent the only kind of declaration conflicts we can make. */
+#define lt_preloaded_symbols some_other_symbol
+
+/* External symbol declarations for the compiler. */\
+"
+
+	  if test "$dlself" = yes; then
+	    $show "generating symbol list for \`$output'"
+
+	    test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
+
+	    # Add our own program objects to the symbol list.
+	    progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	    for arg in $progfiles; do
+	      $show "extracting global C symbols from \`$arg'"
+	      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+	    done
+
+	    if test -n "$exclude_expsyms"; then
+	      $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+	      $run eval '$mv "$nlist"T "$nlist"'
+	    fi
+
+	    if test -n "$export_symbols_regex"; then
+	      $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+	      $run eval '$mv "$nlist"T "$nlist"'
+	    fi
+
+	    # Prepare the list of exported symbols
+	    if test -z "$export_symbols"; then
+	      export_symbols="$output_objdir/$outputname.exp"
+	      $run $rm $export_symbols
+	      $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+              case $host in
+              *cygwin* | *mingw* )
+	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+		$run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+                ;;
+              esac
+	    else
+	      $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+	      $run eval 'mv "$nlist"T "$nlist"'
+              case $host in
+              *cygwin* | *mingw* )
+	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+		$run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+                ;;
+              esac
+	    fi
+	  fi
+
+	  for arg in $dlprefiles; do
+	    $show "extracting global C symbols from \`$arg'"
+	    name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
+	    $run eval '$echo ": $name " >> "$nlist"'
+	    $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+	  done
+
+	  if test -z "$run"; then
+	    # Make sure we have at least an empty file.
+	    test -f "$nlist" || : > "$nlist"
+
+	    if test -n "$exclude_expsyms"; then
+	      $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+	      $mv "$nlist"T "$nlist"
+	    fi
+
+	    # Try sorting and uniquifying the output.
+	    if grep -v "^: " < "$nlist" |
+		if sort -k 3 </dev/null >/dev/null 2>&1; then
+		  sort -k 3
+		else
+		  sort +2
+		fi |
+		uniq > "$nlist"S; then
+	      :
+	    else
+	      grep -v "^: " < "$nlist" > "$nlist"S
+	    fi
+
+	    if test -f "$nlist"S; then
+	      eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
+	    else
+	      $echo '/* NONE */' >> "$output_objdir/$dlsyms"
+	    fi
+
+	    $echo >> "$output_objdir/$dlsyms" "\
+
+#undef lt_preloaded_symbols
+
+#if defined (__STDC__) && __STDC__
+# define lt_ptr void *
+#else
+# define lt_ptr char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+"
+
+	    case $host in
+	    *cygwin* | *mingw* )
+	  $echo >> "$output_objdir/$dlsyms" "\
+/* DATA imports from DLLs on WIN32 can't be const, because
+   runtime relocations are performed -- see ld's documentation
+   on pseudo-relocs */
+struct {
+"
+	      ;;
+	    * )
+	  $echo >> "$output_objdir/$dlsyms" "\
+const struct {
+"
+	      ;;
+	    esac
+
+
+	  $echo >> "$output_objdir/$dlsyms" "\
+  const char *name;
+  lt_ptr address;
+}
+lt_preloaded_symbols[] =
+{\
+"
+
+	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
+
+	    $echo >> "$output_objdir/$dlsyms" "\
+  {0, (lt_ptr) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+	  fi
+
+	  pic_flag_for_symtable=
+	  case $host in
+	  # compiling the symbol table file with pic_flag works around
+	  # a FreeBSD bug that causes programs to crash when -lm is
+	  # linked before any other PIC object.  But we must not use
+	  # pic_flag when linking with -static.  The problem exists in
+	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+	    case "$compile_command " in
+	    *" -static "*) ;;
+	    *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
+	    esac;;
+	  *-*-hpux*)
+	    case "$compile_command " in
+	    *" -static "*) ;;
+	    *) pic_flag_for_symtable=" $pic_flag";;
+	    esac
+	  esac
+
+	  # Now compile the dynamic symbol file.
+	  $show "(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+	  $run eval '(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+
+	  # Clean up the generated files.
+	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
+	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
+
+	  # Transform the symbol file into the correct name.
+          case $host in
+          *cygwin* | *mingw* )
+            if test -f "$output_objdir/${outputname}.def" ; then
+              compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
+              finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
+            else
+              compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+              finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+             fi
+            ;;
+          * )
+            compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+            finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+            ;;
+          esac
+	  ;;
+	*)
+	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+      else
+	# We keep going just in case the user didn't refer to
+	# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+	# really was required.
+
+	# Nullify the symbol file.
+	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
+	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
+      fi
+
+      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+	# Replace the output file specification.
+	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
+	link_command="$compile_command$compile_rpath"
+
+	# We have no uninstalled library dependencies, so finalize right now.
+	$show "$link_command"
+	$run eval "$link_command"
+	exit_status=$?
+
+	# Delete the generated files.
+	if test -n "$dlsyms"; then
+	  $show "$rm $output_objdir/${outputname}S.${objext}"
+	  $run $rm "$output_objdir/${outputname}S.${objext}"
+	fi
+
+	exit $exit_status
+      fi
+
+      if test -n "$shlibpath_var"; then
+	# We should set the shlibpath_var
+	rpath=
+	for dir in $temp_rpath; do
+	  case $dir in
+	  [\\/]* | [A-Za-z]:[\\/]*)
+	    # Absolute path.
+	    rpath="$rpath$dir:"
+	    ;;
+	  *)
+	    # Relative path: add a thisdir entry.
+	    rpath="$rpath\$thisdir/$dir:"
+	    ;;
+	  esac
+	done
+	temp_rpath="$rpath"
+      fi
+
+      if test -n "$compile_shlibpath$finalize_shlibpath"; then
+	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+      fi
+      if test -n "$finalize_shlibpath"; then
+	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+      fi
+
+      compile_var=
+      finalize_var=
+      if test -n "$runpath_var"; then
+	if test -n "$perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+	if test -n "$finalize_perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $finalize_perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+      fi
+
+      if test "$no_install" = yes; then
+	# We don't need to create a wrapper script.
+	link_command="$compile_var$compile_command$compile_rpath"
+	# Replace the output file specification.
+	link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	# Delete the old output file.
+	$run $rm $output
+	# Link the executable and exit
+	$show "$link_command"
+	$run eval "$link_command" || exit $?
+	exit $EXIT_SUCCESS
+      fi
+
+      if test "$hardcode_action" = relink; then
+	# Fast installation is not supported
+	link_command="$compile_var$compile_command$compile_rpath"
+	relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+	$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
+	$echo "$modename: \`$output' will be relinked during installation" 1>&2
+      else
+	if test "$fast_install" != no; then
+	  link_command="$finalize_var$compile_command$finalize_rpath"
+	  if test "$fast_install" = yes; then
+	    relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
+	  else
+	    # fast_install is set to needless
+	    relink_command=
+	  fi
+	else
+	  link_command="$compile_var$compile_command$compile_rpath"
+	  relink_command="$finalize_var$finalize_command$finalize_rpath"
+	fi
+      fi
+
+      # Replace the output file specification.
+      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+      # Delete the old output files.
+      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+      $show "$link_command"
+      $run eval "$link_command" || exit $?
+
+      # Now create the wrapper script.
+      $show "creating $output"
+
+      # Quote the relink command for shipping.
+      if test -n "$relink_command"; then
+	# Preserve any variables that may affect compiler behavior
+	for var in $variables_saved_for_relink; do
+	  if eval test -z \"\${$var+set}\"; then
+	    relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+	  elif eval var_value=\$$var; test -z "$var_value"; then
+	    relink_command="$var=; export $var; $relink_command"
+	  else
+	    var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+	    relink_command="$var=\"$var_value\"; export $var; $relink_command"
+	  fi
+	done
+	relink_command="(cd `pwd`; $relink_command)"
+	relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
+      fi
+
+      # Quote $echo for shipping.
+      if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
+	case $progpath in
+	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
+	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
+	esac
+	qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
+      else
+	qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
+      fi
+
+      # Only actually do things if our run command is non-null.
+      if test -z "$run"; then
+	# win32 will think the script is a binary if it has
+	# a .exe suffix, so we strip it off here.
+	case $output in
+	  *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
+	esac
+	# test for cygwin because mv fails w/o .exe extensions
+	case $host in
+	  *cygwin*)
+	    exeext=.exe
+	    outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
+	  *) exeext= ;;
+	esac
+	case $host in
+	  *cygwin* | *mingw* )
+            output_name=`basename $output`
+            output_path=`dirname $output`
+            cwrappersource="$output_path/$objdir/lt-$output_name.c"
+            cwrapper="$output_path/$output_name.exe"
+            $rm $cwrappersource $cwrapper
+            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+	    cat > $cwrappersource <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+   Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+
+   The $output program cannot be directly executed until all the libtool
+   libraries that it depends on are installed.
+
+   This wrapper executable should never be moved out of the build directory.
+   If it is, it will not operate correctly.
+
+   Currently, it simply execs the wrapper *script* "/bin/sh $output",
+   but could eventually absorb all of the scripts functionality and
+   exec $objdir/$outputname directly.
+*/
+EOF
+	    cat >> $cwrappersource<<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/stat.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+  defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# ifndef DIR_SEPARATOR_2
+#  define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+#  define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+  if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+/* -DDEBUG is fairly common in CFLAGS.  */
+#undef DEBUG
+#if defined DEBUGWRAPPER
+# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
+#else
+# define DEBUG(format, ...)
+#endif
+
+const char *program_name = NULL;
+
+void * xmalloc (size_t num);
+char * xstrdup (const char *string);
+const char * base_name (const char *name);
+char * find_executable(const char *wrapper);
+int    check_executable(const char *path);
+char * strendzap(char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+
+int
+main (int argc, char *argv[])
+{
+  char **newargz;
+  int i;
+
+  program_name = (char *) xstrdup (base_name (argv[0]));
+  DEBUG("(main) argv[0]      : %s\n",argv[0]);
+  DEBUG("(main) program_name : %s\n",program_name);
+  newargz = XMALLOC(char *, argc+2);
+EOF
+
+            cat >> $cwrappersource <<EOF
+  newargz[0] = (char *) xstrdup("$SHELL");
+EOF
+
+            cat >> $cwrappersource <<"EOF"
+  newargz[1] = find_executable(argv[0]);
+  if (newargz[1] == NULL)
+    lt_fatal("Couldn't find %s", argv[0]);
+  DEBUG("(main) found exe at : %s\n",newargz[1]);
+  /* we know the script has the same name, without the .exe */
+  /* so make sure newargz[1] doesn't end in .exe */
+  strendzap(newargz[1],".exe");
+  for (i = 1; i < argc; i++)
+    newargz[i+1] = xstrdup(argv[i]);
+  newargz[argc+1] = NULL;
+
+  for (i=0; i<argc+1; i++)
+  {
+    DEBUG("(main) newargz[%d]   : %s\n",i,newargz[i]);
+    ;
+  }
+
+EOF
+
+            case $host_os in
+              mingw*)
+                cat >> $cwrappersource <<EOF
+  execv("$SHELL",(char const **)newargz);
+EOF
+              ;;
+              *)
+                cat >> $cwrappersource <<EOF
+  execv("$SHELL",newargz);
+EOF
+              ;;
+            esac
+
+            cat >> $cwrappersource <<"EOF"
+  return 127;
+}
+
+void *
+xmalloc (size_t num)
+{
+  void * p = (void *) malloc (num);
+  if (!p)
+    lt_fatal ("Memory exhausted");
+
+  return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
+;
+}
+
+const char *
+base_name (const char *name)
+{
+  const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  /* Skip over the disk name in MSDOS pathnames. */
+  if (isalpha ((unsigned char)name[0]) && name[1] == ':')
+    name += 2;
+#endif
+
+  for (base = name; *name; name++)
+    if (IS_DIR_SEPARATOR (*name))
+      base = name + 1;
+  return base;
+}
+
+int
+check_executable(const char * path)
+{
+  struct stat st;
+
+  DEBUG("(check_executable)  : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
+  if ((!path) || (!*path))
+    return 0;
+
+  if ((stat (path, &st) >= 0) &&
+      (
+        /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
+#if defined (S_IXOTH)
+       ((st.st_mode & S_IXOTH) == S_IXOTH) ||
+#endif
+#if defined (S_IXGRP)
+       ((st.st_mode & S_IXGRP) == S_IXGRP) ||
+#endif
+       ((st.st_mode & S_IXUSR) == S_IXUSR))
+      )
+    return 1;
+  else
+    return 0;
+}
+
+/* Searches for the full path of the wrapper.  Returns
+   newly allocated full path name if found, NULL otherwise */
+char *
+find_executable (const char* wrapper)
+{
+  int has_slash = 0;
+  const char* p;
+  const char* p_next;
+  /* static buffer for getcwd */
+  char tmp[LT_PATHMAX + 1];
+  int tmp_len;
+  char* concat_name;
+
+  DEBUG("(find_executable)  : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
+
+  if ((wrapper == NULL) || (*wrapper == '\0'))
+    return NULL;
+
+  /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
+  {
+    concat_name = xstrdup (wrapper);
+    if (check_executable(concat_name))
+      return concat_name;
+    XFREE(concat_name);
+  }
+  else
+  {
+#endif
+    if (IS_DIR_SEPARATOR (wrapper[0]))
+    {
+      concat_name = xstrdup (wrapper);
+      if (check_executable(concat_name))
+        return concat_name;
+      XFREE(concat_name);
+    }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  }
+#endif
+
+  for (p = wrapper; *p; p++)
+    if (*p == '/')
+    {
+      has_slash = 1;
+      break;
+    }
+  if (!has_slash)
+  {
+    /* no slashes; search PATH */
+    const char* path = getenv ("PATH");
+    if (path != NULL)
+    {
+      for (p = path; *p; p = p_next)
+      {
+        const char* q;
+        size_t p_len;
+        for (q = p; *q; q++)
+          if (IS_PATH_SEPARATOR(*q))
+            break;
+        p_len = q - p;
+        p_next = (*q == '\0' ? q : q + 1);
+        if (p_len == 0)
+        {
+          /* empty path: current directory */
+          if (getcwd (tmp, LT_PATHMAX) == NULL)
+            lt_fatal ("getcwd failed");
+          tmp_len = strlen(tmp);
+          concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
+          memcpy (concat_name, tmp, tmp_len);
+          concat_name[tmp_len] = '/';
+          strcpy (concat_name + tmp_len + 1, wrapper);
+        }
+        else
+        {
+          concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
+          memcpy (concat_name, p, p_len);
+          concat_name[p_len] = '/';
+          strcpy (concat_name + p_len + 1, wrapper);
+        }
+        if (check_executable(concat_name))
+          return concat_name;
+        XFREE(concat_name);
+      }
+    }
+    /* not found in PATH; assume curdir */
+  }
+  /* Relative path | not found in path: prepend cwd */
+  if (getcwd (tmp, LT_PATHMAX) == NULL)
+    lt_fatal ("getcwd failed");
+  tmp_len = strlen(tmp);
+  concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
+  memcpy (concat_name, tmp, tmp_len);
+  concat_name[tmp_len] = '/';
+  strcpy (concat_name + tmp_len + 1, wrapper);
+
+  if (check_executable(concat_name))
+    return concat_name;
+  XFREE(concat_name);
+  return NULL;
+}
+
+char *
+strendzap(char *str, const char *pat)
+{
+  size_t len, patlen;
+
+  assert(str != NULL);
+  assert(pat != NULL);
+
+  len = strlen(str);
+  patlen = strlen(pat);
+
+  if (patlen <= len)
+  {
+    str += len - patlen;
+    if (strcmp(str, pat) == 0)
+      *str = '\0';
+  }
+  return str;
+}
+
+static void
+lt_error_core (int exit_status, const char * mode,
+          const char * message, va_list ap)
+{
+  fprintf (stderr, "%s: %s: ", program_name, mode);
+  vfprintf (stderr, message, ap);
+  fprintf (stderr, ".\n");
+
+  if (exit_status >= 0)
+    exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+  va_end (ap);
+}
+EOF
+          # we should really use a build-platform specific compiler
+          # here, but OTOH, the wrappers (shell script and this C one)
+          # are only useful if you want to execute the "real" binary.
+          # Since the "real" binary is built for $host, then this
+          # wrapper might as well be built for $host, too.
+          $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
+          ;;
+        esac
+        $rm $output
+        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
+
+	$echo > $output "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variable:
+  notinst_deplibs='$notinst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$echo are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    echo=\"$qecho\"
+    file=\"\$0\"
+    # Make sure echo works.
+    if test \"X\$1\" = X--no-reexec; then
+      # Discard the --no-reexec flag, and continue.
+      shift
+    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
+      # Yippee, \$echo works!
+      :
+    else
+      # Restart under the correct shell, and then maybe \$echo will work.
+      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+    fi
+  fi\
+"
+	$echo >> $output "\
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+  done
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+	if test "$fast_install" = yes; then
+	  $echo >> $output "\
+  program=lt-'$outputname'$exeext
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" || \\
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $mkdir \"\$progdir\"
+    else
+      $rm \"\$progdir/\$file\"
+    fi"
+
+	  $echo >> $output "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+      else
+	$echo \"\$relink_command_output\" >&2
+	$rm \"\$progdir/\$file\"
+	exit $EXIT_FAILURE
+      fi
+    fi
+
+    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+    { $rm \"\$progdir/\$program\";
+      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+    $rm \"\$progdir/\$file\"
+  fi"
+	else
+	  $echo >> $output "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+	fi
+
+	$echo >> $output "\
+
+  if test -f \"\$progdir/\$program\"; then"
+
+	# Export our shlibpath_var if we have one.
+	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	  $echo >> $output "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+    export $shlibpath_var
+"
+	fi
+
+	# fixup the dll searchpath if we need to.
+	if test -n "$dllsearchpath"; then
+	  $echo >> $output "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+	fi
+
+	$echo >> $output "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+"
+	case $host in
+	# Backslashes separate directories on plain windows
+	*-*-mingw | *-*-os2*)
+	  $echo >> $output "\
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+	  ;;
+
+	*)
+	  $echo >> $output "\
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+	  ;;
+	esac
+	$echo >> $output "\
+      \$echo \"\$0: cannot exec \$program \$*\"
+      exit $EXIT_FAILURE
+    fi
+  else
+    # The program doesn't exist.
+    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+    \$echo \"This script is just a wrapper for \$program.\" 1>&2
+    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit $EXIT_FAILURE
+  fi
+fi\
+"
+	chmod +x $output
+      fi
+      exit $EXIT_SUCCESS
+      ;;
+    esac
+
+    # See if we need to build an old-fashioned archive.
+    for oldlib in $oldlibs; do
+
+      if test "$build_libtool_libs" = convenience; then
+	oldobjs="$libobjs_save"
+	addlibs="$convenience"
+	build_libtool_libs=no
+      else
+	if test "$build_libtool_libs" = module; then
+	  oldobjs="$libobjs_save"
+	  build_libtool_libs=no
+	else
+	  oldobjs="$old_deplibs $non_pic_objects"
+	fi
+	addlibs="$old_convenience"
+      fi
+
+      if test -n "$addlibs"; then
+	gentop="$output_objdir/${outputname}x"
+	generated="$generated $gentop"
+
+	func_extract_archives $gentop $addlibs
+	oldobjs="$oldobjs $func_extract_archives_result"
+      fi
+
+      # Do each command in the archive commands.
+      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+       cmds=$old_archive_from_new_cmds
+      else
+	# POSIX demands no paths to be encoded in archives.  We have
+	# to avoid creating archives with duplicate basenames if we
+	# might have to extract them afterwards, e.g., when creating a
+	# static archive out of a convenience library, or when linking
+	# the entirety of a libtool archive into another (currently
+	# not supported by libtool).
+	if (for obj in $oldobjs
+	    do
+	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
+	    done | sort | sort -uc >/dev/null 2>&1); then
+	  :
+	else
+	  $echo "copying selected object files to avoid basename conflicts..."
+
+	  if test -z "$gentop"; then
+	    gentop="$output_objdir/${outputname}x"
+	    generated="$generated $gentop"
+
+	    $show "${rm}r $gentop"
+	    $run ${rm}r "$gentop"
+	    $show "$mkdir $gentop"
+	    $run $mkdir "$gentop"
+	    exit_status=$?
+	    if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
+	      exit $exit_status
+	    fi
+	  fi
+
+	  save_oldobjs=$oldobjs
+	  oldobjs=
+	  counter=1
+	  for obj in $save_oldobjs
+	  do
+	    objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+	    case " $oldobjs " in
+	    " ") oldobjs=$obj ;;
+	    *[\ /]"$objbase "*)
+	      while :; do
+		# Make sure we don't pick an alternate name that also
+		# overlaps.
+		newobj=lt$counter-$objbase
+		counter=`expr $counter + 1`
+		case " $oldobjs " in
+		*[\ /]"$newobj "*) ;;
+		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
+		esac
+	      done
+	      $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+	      $run ln "$obj" "$gentop/$newobj" ||
+	      $run cp "$obj" "$gentop/$newobj"
+	      oldobjs="$oldobjs $gentop/$newobj"
+	      ;;
+	    *) oldobjs="$oldobjs $obj" ;;
+	    esac
+	  done
+	fi
+
+	eval cmds=\"$old_archive_cmds\"
+
+	if len=`expr "X$cmds" : ".*"` &&
+	     test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  cmds=$old_archive_cmds
+	else
+	  # the command line is too long to link in one step, link in parts
+	  $echo "using piecewise archive linking..."
+	  save_RANLIB=$RANLIB
+	  RANLIB=:
+	  objlist=
+	  concat_cmds=
+	  save_oldobjs=$oldobjs
+
+	  # Is there a better way of finding the last object in the list?
+	  for obj in $save_oldobjs
+	  do
+	    last_oldobj=$obj
+	  done
+	  for obj in $save_oldobjs
+	  do
+	    oldobjs="$objlist $obj"
+	    objlist="$objlist $obj"
+	    eval test_cmds=\"$old_archive_cmds\"
+	    if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+	       test "$len" -le "$max_cmd_len"; then
+	      :
+	    else
+	      # the above command should be used before it gets too long
+	      oldobjs=$objlist
+	      if test "$obj" = "$last_oldobj" ; then
+	        RANLIB=$save_RANLIB
+	      fi
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+	      objlist=
+	    fi
+	  done
+	  RANLIB=$save_RANLIB
+	  oldobjs=$objlist
+	  if test "X$oldobjs" = "X" ; then
+	    eval cmds=\"\$concat_cmds\"
+	  else
+	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+	  fi
+	fi
+      fi
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+        eval cmd=\"$cmd\"
+	IFS="$save_ifs"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+    done
+
+    if test -n "$generated"; then
+      $show "${rm}r$generated"
+      $run ${rm}r$generated
+    fi
+
+    # Now create the libtool archive.
+    case $output in
+    *.la)
+      old_library=
+      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      $show "creating $output"
+
+      # Preserve any variables that may affect compiler behavior
+      for var in $variables_saved_for_relink; do
+	if eval test -z \"\${$var+set}\"; then
+	  relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+	elif eval var_value=\$$var; test -z "$var_value"; then
+	  relink_command="$var=; export $var; $relink_command"
+	else
+	  var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+	  relink_command="$var=\"$var_value\"; export $var; $relink_command"
+	fi
+      done
+      # Quote the link command for shipping.
+      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
+      if test "$hardcode_automatic" = yes ; then
+	relink_command=
+      fi
+
+
+      # Only create the output if not a dry run.
+      if test -z "$run"; then
+	for installed in no yes; do
+	  if test "$installed" = yes; then
+	    if test -z "$install_libdir"; then
+	      break
+	    fi
+	    output="$output_objdir/$outputname"i
+	    # Replace all uninstalled libtool libraries with the installed ones
+	    newdependency_libs=
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      *.la)
+		name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		if test -z "$libdir"; then
+		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+		  exit $EXIT_FAILURE
+		fi
+		newdependency_libs="$newdependency_libs $libdir/$name"
+		;;
+	      *) newdependency_libs="$newdependency_libs $deplib" ;;
+	      esac
+	    done
+	    dependency_libs="$newdependency_libs"
+	    newdlfiles=
+	    for lib in $dlfiles; do
+	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+	      if test -z "$libdir"; then
+		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+		exit $EXIT_FAILURE
+	      fi
+	      newdlfiles="$newdlfiles $libdir/$name"
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+	      if test -z "$libdir"; then
+		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+		exit $EXIT_FAILURE
+	      fi
+	      newdlprefiles="$newdlprefiles $libdir/$name"
+	    done
+	    dlprefiles="$newdlprefiles"
+	  else
+	    newdlfiles=
+	    for lib in $dlfiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      newdlfiles="$newdlfiles $abs"
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      newdlprefiles="$newdlprefiles $abs"
+	    done
+	    dlprefiles="$newdlprefiles"
+	  fi
+	  $rm $output
+	  # place dlname in correct position for cygwin
+	  tdlname=$dlname
+	  case $host,$output,$installed,$module,$dlname in
+	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+	  esac
+	  $echo > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+	  if test "$installed" = no && test "$need_relink" = yes; then
+	    $echo >> $output "\
+relink_command=\"$relink_command\""
+	  fi
+	done
+      fi
+
+      # Do a symbolic link so that the libtool archive can be found in
+      # LD_LIBRARY_PATH before the program is installed.
+      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
+      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
+      ;;
+    esac
+    exit $EXIT_SUCCESS
+    ;;
+
+  # libtool install mode
+  install)
+    modename="$modename: install"
+
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+       # Allow the use of GNU shtool's install command.
+       $echo "X$nonopt" | grep shtool > /dev/null; then
+      # Aesthetically quote it.
+      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	arg="\"$arg\""
+	;;
+      esac
+      install_prog="$arg "
+      arg="$1"
+      shift
+    else
+      install_prog=
+      arg=$nonopt
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+    case $arg in
+    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+      arg="\"$arg\""
+      ;;
+    esac
+    install_prog="$install_prog$arg"
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=no
+    stripme=
+    for arg
+    do
+      if test -n "$dest"; then
+	files="$files $dest"
+	dest=$arg
+	continue
+      fi
+
+      case $arg in
+      -d) isdir=yes ;;
+      -f) 
+      	case " $install_prog " in
+	*[\\\ /]cp\ *) ;;
+	*) prev=$arg ;;
+	esac
+	;;
+      -g | -m | -o) prev=$arg ;;
+      -s)
+	stripme=" -s"
+	continue
+	;;
+      -*)
+	;;
+      *)
+	# If the previous option needed an argument, then skip it.
+	if test -n "$prev"; then
+	  prev=
+	else
+	  dest=$arg
+	  continue
+	fi
+	;;
+      esac
+
+      # Aesthetically quote the argument.
+      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+      case $arg in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	arg="\"$arg\""
+	;;
+      esac
+      install_prog="$install_prog $arg"
+    done
+
+    if test -z "$install_prog"; then
+      $echo "$modename: you must specify an install program" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    if test -n "$prev"; then
+      $echo "$modename: the \`$prev' option requires an argument" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+	$echo "$modename: no file or destination specified" 1>&2
+      else
+	$echo "$modename: you must specify a destination" 1>&2
+      fi
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    # Strip any trailing slash from the destination.
+    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=yes
+    if test "$isdir" = yes; then
+      destdir="$dest"
+      destname=
+    else
+      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
+      test "X$destdir" = "X$dest" && destdir=.
+      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files
+      if test "$#" -gt 2; then
+	$echo "$modename: \`$dest' is not a directory" 1>&2
+	$echo "$help" 1>&2
+	exit $EXIT_FAILURE
+      fi
+    fi
+    case $destdir in
+    [\\/]* | [A-Za-z]:[\\/]*) ;;
+    *)
+      for file in $files; do
+	case $file in
+	*.lo) ;;
+	*)
+	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case $file in
+      *.$libext)
+	# Do the static libraries later.
+	staticlibs="$staticlibs $file"
+	;;
+
+      *.la)
+	# Check to see that this really is a libtool archive.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	library_names=
+	old_library=
+	relink_command=
+	# If there is no directory component, then add one.
+	case $file in
+	*/* | *\\*) . $file ;;
+	*) . ./$file ;;
+	esac
+
+	# Add the libdir to current_libdirs if it is the destination.
+	if test "X$destdir" = "X$libdir"; then
+	  case "$current_libdirs " in
+	  *" $libdir "*) ;;
+	  *) current_libdirs="$current_libdirs $libdir" ;;
+	  esac
+	else
+	  # Note the libdir as a future libdir.
+	  case "$future_libdirs " in
+	  *" $libdir "*) ;;
+	  *) future_libdirs="$future_libdirs $libdir" ;;
+	  esac
+	fi
+
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
+	test "X$dir" = "X$file/" && dir=
+	dir="$dir$objdir"
+
+	if test -n "$relink_command"; then
+	  # Determine the prefix the user has applied to our future dir.
+	  inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
+
+	  # Don't allow the user to place us outside of our expected
+	  # location b/c this prevents finding dependent libraries that
+	  # are installed to the same prefix.
+	  # At present, this check doesn't affect windows .dll's that
+	  # are installed into $libdir/../bin (currently, that works fine)
+	  # but it's something to keep an eye on.
+	  if test "$inst_prefix_dir" = "$destdir"; then
+	    $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+
+	  if test -n "$inst_prefix_dir"; then
+	    # Stick the inst_prefix_dir data into the link command.
+	    relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
+	  else
+	    relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
+	  fi
+
+	  $echo "$modename: warning: relinking \`$file'" 1>&2
+	  $show "$relink_command"
+	  if $run eval "$relink_command"; then :
+	  else
+	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+	fi
+
+	# See the names of the shared library.
+	set dummy $library_names
+	if test -n "$2"; then
+	  realname="$2"
+	  shift
+	  shift
+
+	  srcname="$realname"
+	  test -n "$relink_command" && srcname="$realname"T
+
+	  # Install the shared library and build the symlinks.
+	  $show "$install_prog $dir/$srcname $destdir/$realname"
+	  $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
+	  if test -n "$stripme" && test -n "$striplib"; then
+	    $show "$striplib $destdir/$realname"
+	    $run eval "$striplib $destdir/$realname" || exit $?
+	  fi
+
+	  if test "$#" -gt 0; then
+	    # Delete the old symlinks, and create new ones.
+	    # Try `ln -sf' first, because the `ln' binary might depend on
+	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
+	    # so we also need to try rm && ln -s.
+	    for linkname
+	    do
+	      if test "$linkname" != "$realname"; then
+                $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
+                $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
+	      fi
+	    done
+	  fi
+
+	  # Do each command in the postinstall commands.
+	  lib="$destdir/$realname"
+	  cmds=$postinstall_cmds
+	  save_ifs="$IFS"; IFS='~'
+	  for cmd in $cmds; do
+	    IFS="$save_ifs"
+	    eval cmd=\"$cmd\"
+	    $show "$cmd"
+	    $run eval "$cmd" || {
+	      lt_exit=$?
+
+	      # Restore the uninstalled library and exit
+	      if test "$mode" = relink; then
+		$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+	      fi
+
+	      exit $lt_exit
+	    }
+	  done
+	  IFS="$save_ifs"
+	fi
+
+	# Install the pseudo-library for information purposes.
+	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	instname="$dir/$name"i
+	$show "$install_prog $instname $destdir/$name"
+	$run eval "$install_prog $instname $destdir/$name" || exit $?
+
+	# Maybe install the static library, too.
+	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+	;;
+
+      *.lo)
+	# Install (i.e. copy) a libtool object.
+
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	  destfile="$destdir/$destfile"
+	fi
+
+	# Deduce the name of the destination old-style object file.
+	case $destfile in
+	*.lo)
+	  staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
+	  ;;
+	*.$objext)
+	  staticdest="$destfile"
+	  destfile=
+	  ;;
+	*)
+	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	  ;;
+	esac
+
+	# Install the libtool object if requested.
+	if test -n "$destfile"; then
+	  $show "$install_prog $file $destfile"
+	  $run eval "$install_prog $file $destfile" || exit $?
+	fi
+
+	# Install the old object if enabled.
+	if test "$build_old_libs" = yes; then
+	  # Deduce the name of the old-style object file.
+	  staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
+
+	  $show "$install_prog $staticobj $staticdest"
+	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
+	fi
+	exit $EXIT_SUCCESS
+	;;
+
+      *)
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	  destfile="$destdir/$destfile"
+	fi
+
+	# If the file is missing, and there is a .exe on the end, strip it
+	# because it is most likely a libtool script we actually want to
+	# install
+	stripped_ext=""
+	case $file in
+	  *.exe)
+	    if test ! -f "$file"; then
+	      file=`$echo $file|${SED} 's,.exe$,,'`
+	      stripped_ext=".exe"
+	    fi
+	    ;;
+	esac
+
+	# Do a test to see if this is really a libtool program.
+	case $host in
+	*cygwin*|*mingw*)
+	    wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
+	    ;;
+	*)
+	    wrapper=$file
+	    ;;
+	esac
+	if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
+	  notinst_deplibs=
+	  relink_command=
+
+	  # Note that it is not necessary on cygwin/mingw to append a dot to
+	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
+	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
+	  # `FILE.' does not work on cygwin managed mounts.
+	  #
+	  # If there is no directory component, then add one.
+	  case $wrapper in
+	  */* | *\\*) . ${wrapper} ;;
+	  *) . ./${wrapper} ;;
+	  esac
+
+	  # Check the variables that should have been set.
+	  if test -z "$notinst_deplibs"; then
+	    $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
+	    exit $EXIT_FAILURE
+	  fi
+
+	  finalize=yes
+	  for lib in $notinst_deplibs; do
+	    # Check to see that each library is installed.
+	    libdir=
+	    if test -f "$lib"; then
+	      # If there is no directory component, then add one.
+	      case $lib in
+	      */* | *\\*) . $lib ;;
+	      *) . ./$lib ;;
+	      esac
+	    fi
+	    libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    if test -n "$libdir" && test ! -f "$libfile"; then
+	      $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+	      finalize=no
+	    fi
+	  done
+
+	  relink_command=
+	  # Note that it is not necessary on cygwin/mingw to append a dot to
+	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
+	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
+	  # `FILE.' does not work on cygwin managed mounts.
+	  #
+	  # If there is no directory component, then add one.
+	  case $wrapper in
+	  */* | *\\*) . ${wrapper} ;;
+	  *) . ./${wrapper} ;;
+	  esac
+
+	  outputname=
+	  if test "$fast_install" = no && test -n "$relink_command"; then
+	    if test "$finalize" = yes && test -z "$run"; then
+	      tmpdir=`func_mktempdir`
+	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
+	      outputname="$tmpdir/$file"
+	      # Replace the output file specification.
+	      relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
+
+	      $show "$relink_command"
+	      if $run eval "$relink_command"; then :
+	      else
+		$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+		${rm}r "$tmpdir"
+		continue
+	      fi
+	      file="$outputname"
+	    else
+	      $echo "$modename: warning: cannot relink \`$file'" 1>&2
+	    fi
+	  else
+	    # Install the binary that we compiled earlier.
+	    file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+	  fi
+	fi
+
+	# remove .exe since cygwin /usr/bin/install will append another
+	# one anyway 
+	case $install_prog,$host in
+	*/usr/bin/install*,*cygwin*)
+	  case $file:$destfile in
+	  *.exe:*.exe)
+	    # this is ok
+	    ;;
+	  *.exe:*)
+	    destfile=$destfile.exe
+	    ;;
+	  *:*.exe)
+	    destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
+	    ;;
+	  esac
+	  ;;
+	esac
+	$show "$install_prog$stripme $file $destfile"
+	$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
+	test -n "$outputname" && ${rm}r "$tmpdir"
+	;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+      # Set up the ranlib parameters.
+      oldlib="$destdir/$name"
+
+      $show "$install_prog $file $oldlib"
+      $run eval "$install_prog \$file \$oldlib" || exit $?
+
+      if test -n "$stripme" && test -n "$old_striplib"; then
+	$show "$old_striplib $oldlib"
+	$run eval "$old_striplib $oldlib" || exit $?
+      fi
+
+      # Do each command in the postinstall commands.
+      cmds=$old_postinstall_cmds
+      save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+	IFS="$save_ifs"
+	eval cmd=\"$cmd\"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+    done
+
+    if test -n "$future_libdirs"; then
+      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
+    fi
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      test -n "$run" && current_libdirs=" -n$current_libdirs"
+      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+    else
+      exit $EXIT_SUCCESS
+    fi
+    ;;
+
+  # libtool finish mode
+  finish)
+    modename="$modename: finish"
+    libdirs="$nonopt"
+    admincmds=
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for dir
+      do
+	libdirs="$libdirs $dir"
+      done
+
+      for libdir in $libdirs; do
+	if test -n "$finish_cmds"; then
+	  # Do each command in the finish commands.
+	  cmds=$finish_cmds
+	  save_ifs="$IFS"; IFS='~'
+	  for cmd in $cmds; do
+	    IFS="$save_ifs"
+	    eval cmd=\"$cmd\"
+	    $show "$cmd"
+	    $run eval "$cmd" || admincmds="$admincmds
+       $cmd"
+	  done
+	  IFS="$save_ifs"
+	fi
+	if test -n "$finish_eval"; then
+	  # Do the single finish_eval.
+	  eval cmds=\"$finish_eval\"
+	  $run eval "$cmds" || admincmds="$admincmds
+       $cmds"
+	fi
+      done
+    fi
+
+    # Exit here if they wanted silent mode.
+    test "$show" = : && exit $EXIT_SUCCESS
+
+    $echo "X----------------------------------------------------------------------" | $Xsed
+    $echo "Libraries have been installed in:"
+    for libdir in $libdirs; do
+      $echo "   $libdir"
+    done
+    $echo
+    $echo "If you ever happen to want to link against installed libraries"
+    $echo "in a given directory, LIBDIR, you must either use libtool, and"
+    $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+    $echo "flag during linking and do at least one of the following:"
+    if test -n "$shlibpath_var"; then
+      $echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+      $echo "     during execution"
+    fi
+    if test -n "$runpath_var"; then
+      $echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+      $echo "     during linking"
+    fi
+    if test -n "$hardcode_libdir_flag_spec"; then
+      libdir=LIBDIR
+      eval flag=\"$hardcode_libdir_flag_spec\"
+
+      $echo "   - use the \`$flag' linker flag"
+    fi
+    if test -n "$admincmds"; then
+      $echo "   - have your system administrator run these commands:$admincmds"
+    fi
+    if test -f /etc/ld.so.conf; then
+      $echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+    fi
+    $echo
+    $echo "See any operating system documentation about shared libraries for"
+    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
+    $echo "X----------------------------------------------------------------------" | $Xsed
+    exit $EXIT_SUCCESS
+    ;;
+
+  # libtool execute mode
+  execute)
+    modename="$modename: execute"
+
+    # The first argument is the command name.
+    cmd="$nonopt"
+    if test -z "$cmd"; then
+      $echo "$modename: you must specify a COMMAND" 1>&2
+      $echo "$help"
+      exit $EXIT_FAILURE
+    fi
+
+    # Handle -dlopen flags immediately.
+    for file in $execute_dlfiles; do
+      if test ! -f "$file"; then
+	$echo "$modename: \`$file' is not a file" 1>&2
+	$echo "$help" 1>&2
+	exit $EXIT_FAILURE
+      fi
+
+      dir=
+      case $file in
+      *.la)
+	# Check to see that this really is a libtool archive.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+	  $echo "$help" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+
+	# Read the libtool library.
+	dlname=
+	library_names=
+
+	# If there is no directory component, then add one.
+	case $file in
+	*/* | *\\*) . $file ;;
+	*) . ./$file ;;
+	esac
+
+	# Skip this library if it cannot be dlopened.
+	if test -z "$dlname"; then
+	  # Warn if it was a shared library.
+	  test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
+	  continue
+	fi
+
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$dir" = "X$file" && dir=.
+
+	if test -f "$dir/$objdir/$dlname"; then
+	  dir="$dir/$objdir"
+	else
+	  $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+	  exit $EXIT_FAILURE
+	fi
+	;;
+
+      *.lo)
+	# Just add the directory containing the .lo file.
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$dir" = "X$file" && dir=.
+	;;
+
+      *)
+	$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
+	continue
+	;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir="$absdir"
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+	eval "$shlibpath_var=\"\$dir\""
+      else
+	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+      fi
+    done
+
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic="$magic"
+
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case $file in
+      -*) ;;
+      *)
+	# Do a test to see if this is really a libtool program.
+	if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  # If there is no directory component, then add one.
+	  case $file in
+	  */* | *\\*) . $file ;;
+	  *) . ./$file ;;
+	  esac
+
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	fi
+	;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
+      args="$args \"$file\""
+    done
+
+    if test -z "$run"; then
+      if test -n "$shlibpath_var"; then
+	# Export the shlibpath_var.
+	eval "export $shlibpath_var"
+      fi
+
+      # Restore saved environment variables
+      for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+      do
+       eval "if test \"\${save_$lt_var+set}\" = set; then
+               $lt_var=\$save_$lt_var; export $lt_var
+             else
+               $lt_unset $lt_var
+             fi"
+      done
+
+
+      # Now prepare to actually exec the command.
+      exec_cmd="\$cmd$args"
+    else
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+	$echo "export $shlibpath_var"
+      fi
+      $echo "$cmd$args"
+      exit $EXIT_SUCCESS
+    fi
+    ;;
+
+  # libtool clean and uninstall mode
+  clean | uninstall)
+    modename="$modename: $mode"
+    rm="$nonopt"
+    files=
+    rmforce=
+    exit_status=0
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    for arg
+    do
+      case $arg in
+      -f) rm="$rm $arg"; rmforce=yes ;;
+      -*) rm="$rm $arg" ;;
+      *) files="$files $arg" ;;
+      esac
+    done
+
+    if test -z "$rm"; then
+      $echo "$modename: you must specify an RM program" 1>&2
+      $echo "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    rmdirs=
+
+    origobjdir="$objdir"
+    for file in $files; do
+      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+      if test "X$dir" = "X$file"; then
+	dir=.
+	objdir="$origobjdir"
+      else
+	objdir="$dir/$origobjdir"
+      fi
+      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+      test "$mode" = uninstall && objdir="$dir"
+
+      # Remember objdir for removal later, being careful to avoid duplicates
+      if test "$mode" = clean; then
+	case " $rmdirs " in
+	  *" $objdir "*) ;;
+	  *) rmdirs="$rmdirs $objdir" ;;
+	esac
+      fi
+
+      # Don't error if the file doesn't exist and rm -f was used.
+      if (test -L "$file") >/dev/null 2>&1 \
+	|| (test -h "$file") >/dev/null 2>&1 \
+	|| test -f "$file"; then
+	:
+      elif test -d "$file"; then
+	exit_status=1
+	continue
+      elif test "$rmforce" = yes; then
+	continue
+      fi
+
+      rmfiles="$file"
+
+      case $name in
+      *.la)
+	# Possibly a libtool archive, so verify it.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  . $dir/$name
+
+	  # Delete the libtool libraries and symlinks.
+	  for n in $library_names; do
+	    rmfiles="$rmfiles $objdir/$n"
+	  done
+	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+
+	  case "$mode" in
+	  clean)
+	    case "  $library_names " in
+	    # "  " in the beginning catches empty $dlname
+	    *" $dlname "*) ;;
+	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
+	    esac
+	     test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+	    ;;
+	  uninstall)
+	    if test -n "$library_names"; then
+	      # Do each command in the postuninstall commands.
+	      cmds=$postuninstall_cmds
+	      save_ifs="$IFS"; IFS='~'
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		eval cmd=\"$cmd\"
+		$show "$cmd"
+		$run eval "$cmd"
+		if test "$?" -ne 0 && test "$rmforce" != yes; then
+		  exit_status=1
+		fi
+	      done
+	      IFS="$save_ifs"
+	    fi
+
+	    if test -n "$old_library"; then
+	      # Do each command in the old_postuninstall commands.
+	      cmds=$old_postuninstall_cmds
+	      save_ifs="$IFS"; IFS='~'
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		eval cmd=\"$cmd\"
+		$show "$cmd"
+		$run eval "$cmd"
+		if test "$?" -ne 0 && test "$rmforce" != yes; then
+		  exit_status=1
+		fi
+	      done
+	      IFS="$save_ifs"
+	    fi
+	    # FIXME: should reinstall the best remaining shared library.
+	    ;;
+	  esac
+	fi
+	;;
+
+      *.lo)
+	# Possibly a libtool object, so verify it.
+	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+
+	  # Read the .lo file
+	  . $dir/$name
+
+	  # Add PIC object to the list of files to remove.
+	  if test -n "$pic_object" \
+	     && test "$pic_object" != none; then
+	    rmfiles="$rmfiles $dir/$pic_object"
+	  fi
+
+	  # Add non-PIC object to the list of files to remove.
+	  if test -n "$non_pic_object" \
+	     && test "$non_pic_object" != none; then
+	    rmfiles="$rmfiles $dir/$non_pic_object"
+	  fi
+	fi
+	;;
+
+      *)
+	if test "$mode" = clean ; then
+	  noexename=$name
+	  case $file in
+	  *.exe)
+	    file=`$echo $file|${SED} 's,.exe$,,'`
+	    noexename=`$echo $name|${SED} 's,.exe$,,'`
+	    # $file with .exe has already been added to rmfiles,
+	    # add $file without .exe
+	    rmfiles="$rmfiles $file"
+	    ;;
+	  esac
+	  # Do a test to see if this is a libtool program.
+	  if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	    relink_command=
+	    . $dir/$noexename
+
+	    # note $name still contains .exe if it was in $file originally
+	    # as does the version of $file that was added into $rmfiles
+	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+	    if test "$fast_install" = yes && test -n "$relink_command"; then
+	      rmfiles="$rmfiles $objdir/lt-$name"
+	    fi
+	    if test "X$noexename" != "X$name" ; then
+	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+	    fi
+	  fi
+	fi
+	;;
+      esac
+      $show "$rm $rmfiles"
+      $run $rm $rmfiles || exit_status=1
+    done
+    objdir="$origobjdir"
+
+    # Try to remove the ${objdir}s in the directories where we deleted files
+    for dir in $rmdirs; do
+      if test -d "$dir"; then
+	$show "rmdir $dir"
+	$run rmdir $dir >/dev/null 2>&1
+      fi
+    done
+
+    exit $exit_status
+    ;;
+
+  "")
+    $echo "$modename: you must specify a MODE" 1>&2
+    $echo "$generic_help" 1>&2
+    exit $EXIT_FAILURE
+    ;;
+  esac
+
+  if test -z "$exec_cmd"; then
+    $echo "$modename: invalid operation mode \`$mode'" 1>&2
+    $echo "$generic_help" 1>&2
+    exit $EXIT_FAILURE
+  fi
+fi # test -z "$show_help"
+
+if test -n "$exec_cmd"; then
+  eval exec $exec_cmd
+  exit $EXIT_FAILURE
+fi
+
+# We need to display help for each of the modes.
+case $mode in
+"") $echo \
+"Usage: $modename [OPTION]... [MODE-ARG]...
+
+Provide generalized library-building support services.
+
+    --config          show all configuration variables
+    --debug           enable verbose shell tracing
+-n, --dry-run         display commands without modifying any files
+    --features        display basic configuration information and exit
+    --finish          same as \`--mode=finish'
+    --help            display this help message and exit
+    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
+    --quiet           same as \`--silent'
+    --silent          don't print informational messages
+    --tag=TAG         use configuration variables from tag TAG
+    --version         print version information
+
+MODE must be one of the following:
+
+      clean           remove files from the build directory
+      compile         compile a source file into a libtool object
+      execute         automatically set library path, then run a program
+      finish          complete the installation of libtool libraries
+      install         install libraries or executables
+      link            create a library or an executable
+      uninstall       remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
+a more detailed description of MODE.
+
+Report bugs to <bug-libtool at gnu.org>."
+  exit $EXIT_SUCCESS
+  ;;
+
+clean)
+  $echo \
+"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+  ;;
+
+compile)
+  $echo \
+"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+  -prefer-pic       try to building PIC objects only
+  -prefer-non-pic   try to building non-PIC objects only
+  -static           always build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+  ;;
+
+execute)
+  $echo \
+"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+  -dlopen FILE      add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+  ;;
+
+finish)
+  $echo \
+"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges.  Use
+the \`--dry-run' option if you just want to see what would be executed."
+  ;;
+
+install)
+  $echo \
+"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command.  The first component should be
+either the \`install' or \`cp' program.
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+  ;;
+
+link)
+  $echo \
+"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -avoid-version    do not add a version suffix if possible
+  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -export-symbols SYMFILE
+                    try to export only the symbols listed in SYMFILE
+  -export-symbols-regex REGEX
+                    try to export only the symbols matching REGEX
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -module           build a library that can dlopened
+  -no-fast-install  disable the fast-install mode
+  -no-install       link a not-installable executable
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -precious-files-regex REGEX
+                    don't remove output files matching REGEX
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -static           do not do any dynamic linking of uninstalled libtool libraries
+  -static-libtool-libs
+                    do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+                    specify library version info [each variable defaults to 0]
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+  ;;
+
+uninstall)
+  $echo \
+"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+  ;;
+
+*)
+  $echo "$modename: invalid operation mode \`$mode'" 1>&2
+  $echo "$help" 1>&2
+  exit $EXIT_FAILURE
+  ;;
+esac
+
+$echo
+$echo "Try \`$modename --help' for more information about other modes."
+
+exit $?
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries.  Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them.  This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration.  But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+disable_libs=shared
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+disable_libs=static
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
diff --git a/config/missing b/config/missing
new file mode 100755
index 0000000..64b5f90
--- /dev/null
+++ b/config/missing
@@ -0,0 +1,353 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2004-09-07.08
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004
+#   Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try \`$0 --help' for more information"
+  exit 1
+fi
+
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+  configure_ac=configure.ac
+else
+  configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case "$1" in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  "$@" && exit 0
+  # Exit code 63 means version mismatch.  This often happens
+  # when the user try to use an ancient version of a tool on
+  # a file that requires a minimum version.  In this case we
+  # we should proceed has if the program had been absent, or
+  # if --run hadn't been passed.
+  if test $? = 63; then
+    run=:
+    msg="probably too old"
+  fi
+  ;;
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+  --run           try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+  aclocal      touch file \`aclocal.m4'
+  autoconf     touch file \`configure'
+  autoheader   touch file \`config.h.in'
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  help2man     touch the output file
+  lex          create \`lex.yy.c', if possible, from existing .c
+  makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake at gnu.org>."
+    exit 0
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit 0
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# Now exit if we have it, but it failed.  Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case "$1" in
+  lex|yacc)
+    # Not GNU programs, they don't have --version.
+    ;;
+
+  tar)
+    if test -n "$run"; then
+       echo 1>&2 "ERROR: \`tar' requires --run"
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       exit 1
+    fi
+    ;;
+
+  *)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       # Could not run --version or --help.  This is probably someone
+       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # $TOOL exists and not knowing $TOOL uses missing.
+       exit 1
+    fi
+    ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+  aclocal*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
+         to install the \`Automake' and \`Perl' packages.  Grab them from
+         any GNU archive site."
+    touch aclocal.m4
+    ;;
+
+  autoconf)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`${configure_ac}'.  You might want to install the
+         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+         archive site."
+    touch configure
+    ;;
+
+  autoheader)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
+         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+         from any GNU archive site."
+    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    test -z "$files" && files="config.h"
+    touch_files=
+    for f in $files; do
+      case "$f" in
+      *:*) touch_files="$touch_files "`echo "$f" |
+				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+      *) touch_files="$touch_files $f.in";;
+      esac
+    done
+    touch $touch_files
+    ;;
+
+  automake*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+         You might want to install the \`Automake' and \`Perl' packages.
+         Grab them from any GNU archive site."
+    find . -type f -name Makefile.am -print |
+	   sed 's/\.am$/.in/' |
+	   while read f; do touch "$f"; done
+    ;;
+
+  autom4te)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1' as part of \`Autoconf' from any GNU
+         archive site."
+
+    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+    if test -f "$file"; then
+	touch $file
+    else
+	test -z "$file" || exec >$file
+	echo "#! /bin/sh"
+	echo "# Created by GNU Automake missing as a replacement of"
+	echo "#  $ $@"
+	echo "exit 0"
+	chmod +x $file
+	exit 1
+    fi
+    ;;
+
+  bison|yacc)
+    echo 1>&2 "\
+WARNING: \`$1' $msg.  You should only need it if
+         you modified a \`.y' file.  You may need the \`Bison' package
+         in order for those modifications to take effect.  You can get
+         \`Bison' from any GNU archive site."
+    rm -f y.tab.c y.tab.h
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+	case "$LASTARG" in
+	*.y)
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+	    if [ -f "$SRCFILE" ]; then
+	         cp "$SRCFILE" y.tab.c
+	    fi
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+	    if [ -f "$SRCFILE" ]; then
+	         cp "$SRCFILE" y.tab.h
+	    fi
+	  ;;
+	esac
+    fi
+    if [ ! -f y.tab.h ]; then
+	echo >y.tab.h
+    fi
+    if [ ! -f y.tab.c ]; then
+	echo 'main() { return 0; }' >y.tab.c
+    fi
+    ;;
+
+  lex|flex)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.l' file.  You may need the \`Flex' package
+         in order for those modifications to take effect.  You can get
+         \`Flex' from any GNU archive site."
+    rm -f lex.yy.c
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+	case "$LASTARG" in
+	*.l)
+	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+	    if [ -f "$SRCFILE" ]; then
+	         cp "$SRCFILE" lex.yy.c
+	    fi
+	  ;;
+	esac
+    fi
+    if [ ! -f lex.yy.c ]; then
+	echo 'main() { return 0; }' >lex.yy.c
+    fi
+    ;;
+
+  help2man)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+	 you modified a dependency of a manual page.  You may need the
+	 \`Help2man' package in order for those modifications to take
+	 effect.  You can get \`Help2man' from any GNU archive site."
+
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+	file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+    fi
+    if [ -f "$file" ]; then
+	touch $file
+    else
+	test -z "$file" || exec >$file
+	echo ".ab help2man is required to generate this page"
+	exit 1
+    fi
+    ;;
+
+  makeinfo)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.texi' or \`.texinfo' file, or any other file
+         indirectly affecting the aspect of the manual.  The spurious
+         call might also be the consequence of using a buggy \`make' (AIX,
+         DU, IRIX).  You might want to install the \`Texinfo' package or
+         the \`GNU make' package.  Grab either from any GNU archive site."
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+      file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
+    fi
+    touch $file
+    ;;
+
+  tar)
+    shift
+
+    # We have already tried tar in the generic part.
+    # Look for gnutar/gtar before invocation to avoid ugly error
+    # messages.
+    if (gnutar --version > /dev/null 2>&1); then
+       gnutar "$@" && exit 0
+    fi
+    if (gtar --version > /dev/null 2>&1); then
+       gtar "$@" && exit 0
+    fi
+    firstarg="$1"
+    if shift; then
+	case "$firstarg" in
+	*o*)
+	    firstarg=`echo "$firstarg" | sed s/o//`
+	    tar "$firstarg" "$@" && exit 0
+	    ;;
+	esac
+	case "$firstarg" in
+	*h*)
+	    firstarg=`echo "$firstarg" | sed s/h//`
+	    tar "$firstarg" "$@" && exit 0
+	    ;;
+	esac
+    fi
+
+    echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+         You may want to install GNU tar or Free paxutils, or check the
+         command line arguments."
+    exit 1
+    ;;
+
+  *)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.  Check the \`README' file,
+         it often tells you about the needed prerequisites for installing
+         this package.  You may also peek at any GNU archive site, in case
+         some other package would contain this missing \`$1' program."
+    exit 1
+    ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/configure b/configure
new file mode 100755
index 0000000..62d29ed
--- /dev/null
+++ b/configure
@@ -0,0 +1,33332 @@
+#! /bin/sh
+# From configure.ac Revision.
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.59.
+#
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+  ;;
+esac
+
+echo=${ECHO-echo}
+if test "X$1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X$1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+  # Yippee, $echo works!
+  :
+else
+  # Restart under the correct shell.
+  exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+$*
+EOF
+  exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+  for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
+    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
+       echo_test_string=`eval $cmd` &&
+       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+    then
+      break
+    fi
+  done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+   test "X$echo_testing_string" = "X$echo_test_string"; then
+  :
+else
+  # The Solaris, AIX, and Digital Unix default echo programs unquote
+  # backslashes.  This makes it impossible to quote backslashes using
+  #   echo "$something" | sed 's/\\/\\\\/g'
+  #
+  # So, first we look for a working echo in the user's PATH.
+
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for dir in $PATH /usr/ucb; do
+    IFS="$lt_save_ifs"
+    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      echo="$dir/echo"
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  if test "X$echo" = Xecho; then
+    # We didn't find a better echo, so look for alternatives.
+    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      # This shell has a builtin print -r that does the trick.
+      echo='print -r'
+    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+	 test "X$CONFIG_SHELL" != X/bin/ksh; then
+      # If we have ksh, try running configure again with it.
+      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+      export ORIGINAL_CONFIG_SHELL
+      CONFIG_SHELL=/bin/ksh
+      export CONFIG_SHELL
+      exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
+    else
+      # Try using printf.
+      echo='printf %s\n'
+      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+	 test "X$echo_testing_string" = "X$echo_test_string"; then
+	# Cool, printf works
+	:
+      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+	   test "X$echo_testing_string" = 'X\t' &&
+	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+	export CONFIG_SHELL
+	SHELL="$CONFIG_SHELL"
+	export SHELL
+	echo="$CONFIG_SHELL $0 --fallback-echo"
+      elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+	   test "X$echo_testing_string" = 'X\t' &&
+	   echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	echo="$CONFIG_SHELL $0 --fallback-echo"
+      else
+	# maybe with a smaller string...
+	prev=:
+
+	for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
+	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+	  then
+	    break
+	  fi
+	  prev="$cmd"
+	done
+
+	if test "$prev" != 'sed 50q "$0"'; then
+	  echo_test_string=`eval $prev`
+	  export echo_test_string
+	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
+	else
+	  # Oops.  We lost completely, so just stick with echo.
+	  echo=echo
+	fi
+      fi
+    fi
+  fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+
+
+tagnames=${tagnames+${tagnames},}CXX
+
+tagnames=${tagnames+${tagnames},}F77
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete.  It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="configure.ac"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+#  include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INS [...]
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_option in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_$ac_feature='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_$ac_package='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+	      localstatedir libdir includedir oldincludedir infodir mandir
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$0" : 'X\(//\)[^/]' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+   { (exit 1); exit 1; }; }
+  else
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+  fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+   { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+ac_env_CXX_set=${CXX+set}
+ac_env_CXX_value=$CXX
+ac_cv_env_CXX_set=${CXX+set}
+ac_cv_env_CXX_value=$CXX
+ac_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_env_CXXFLAGS_value=$CXXFLAGS
+ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_cv_env_CXXFLAGS_value=$CXXFLAGS
+ac_env_MPICC_set=${MPICC+set}
+ac_env_MPICC_value=$MPICC
+ac_cv_env_MPICC_set=${MPICC+set}
+ac_cv_env_MPICC_value=$MPICC
+ac_env_MPICXX_set=${MPICXX+set}
+ac_env_MPICXX_value=$MPICXX
+ac_cv_env_MPICXX_set=${MPICXX+set}
+ac_cv_env_MPICXX_value=$MPICXX
+ac_env_FC_set=${FC+set}
+ac_env_FC_value=$FC
+ac_cv_env_FC_set=${FC+set}
+ac_cv_env_FC_value=$FC
+ac_env_FCFLAGS_set=${FCFLAGS+set}
+ac_env_FCFLAGS_value=$FCFLAGS
+ac_cv_env_FCFLAGS_set=${FCFLAGS+set}
+ac_cv_env_FCFLAGS_value=$FCFLAGS
+ac_env_MPIFC_set=${MPIFC+set}
+ac_env_MPIFC_value=$MPIFC
+ac_cv_env_MPIFC_set=${MPIFC+set}
+ac_cv_env_MPIFC_value=$MPIFC
+ac_env_CXXCPP_set=${CXXCPP+set}
+ac_env_CXXCPP_value=$CXXCPP
+ac_cv_env_CXXCPP_set=${CXXCPP+set}
+ac_cv_env_CXXCPP_value=$CXXCPP
+ac_env_F77_set=${F77+set}
+ac_env_F77_value=$F77
+ac_cv_env_F77_set=${F77+set}
+ac_cv_env_F77_value=$F77
+ac_env_FFLAGS_set=${FFLAGS+set}
+ac_env_FFLAGS_value=$FFLAGS
+ac_cv_env_FFLAGS_set=${FFLAGS+set}
+ac_cv_env_FFLAGS_value=$FFLAGS
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+  cat <<_ACEOF
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+			  [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+			  [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --infodir=DIR          info documentation [PREFIX/info]
+  --mandir=DIR           man documentation [PREFIX/man]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --disable-fortran       disable Fortran test programs in ADIOS.
+  --enable-shared[=PKGS]
+                          build shared libraries [default=yes]
+  --enable-static[=PKGS]
+                          build static libraries [default=yes]
+  --enable-fast-install[=PKGS]
+                          optimize for fast installation [default=yes]
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+  --enable-research-transports
+                          Enable building the various research transports.
+                          Default is not to build these as they are not part
+                          of the base distribution.
+  --disable-write         disable building the write methods in ADIOS. Must be
+                          used on MacOSX
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-mpi=<location of MPI installation>
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+  --with-pic              try to use only PIC/non-PIC objects [default=use
+                          both]
+  --with-tags[=TAGS]
+                          include additional configurations [automatic]
+  --with-mxml=DIR      Location of Mini-XML library
+  --with-infiniband=DIR      Location of Infiniband
+  --with-portals=DIR      Location of Portals (yes/no/path_to_portals)
+  --with-hdf5=<location of HDF5 installation>
+  --with-hdf5-incdir=<location of HDF5 includes>
+  --with-hdf5-libdir=<location of HDF5 library>
+  --with-hdf5-libs=<linker flags besides -L<hdf5_libdir>, e.g. -lhdf5 -lhdf5_hl -lz>
+  --with-phdf5=<location of PHDF5 installation>
+  --with-phdf5-incdir=<location of PHDF5 includes>
+  --with-phdf5-libdir=<location of PHDF5 library>
+  --with-phdf5-libs=<linker flags besides -L<phdf5_libdir>, e.g. -lhdf5 -lhdf5_hl -lz>
+  --with-netcdf=<location of NetCDF installation>
+  --with-netcdf-incdir=<location of NetCDF includes>
+  --with-netcdf-libdir=<location of NetCDF library>
+  --with-netcdf-libs=<linker flags besides -L<netcdf_libdir>, e.g. -lnetcdf>
+  --with-nc4par=<location of NetCDF 4 Parallel installation>
+  --with-nc4par-incdir=<location of NetCDF 4 Parallel includes>
+  --with-nc4par-libdir=<location of NetCDF 4 Parallel library>
+  --with-nc4par-libs=<linker flags besides -L<nc4par_libdir>, e.g. -lnetcdf>
+  --with-pablo=DIR      Location of Pablo library
+  --with-nssi=DIR      Location of NSSI
+  --with-dart=DIR         Build the DART transport method. Point to the DART
+                          installation.
+  --with-dart-incdir=<location of dart includes>
+  --with-dart-libdir=<location of dart library>
+  --with-dimes=DIR        Build the DIMES transport method. Point to the DIMES
+                          installation.
+  --with-dimes-incdir=<location of dimes includes>
+  --with-dimes-libdir=<location of dimes library>
+  --with-dmalloc=DIR      Location of dmalloc library
+  --with-datatap=DIR 	Location of DataTap
+  --with-installed        Don't use local copies of CERCS packages
+  --with-local            Use only local copies of CERCS packages
+  --with-ibpbio=DIR	Where to find ibpbio package
+  --with-ffs=DIR	Where to find ffs package
+  --with-gen_thread=DIR	Where to find gen_thread package
+  --with-ptlpbio=DIR	Where to find ptlpbio package
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
+              headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  MPICC       MPI C compiler command
+  MPICXX      MPI C++ compiler command
+  FC          Fortran compiler command
+  FCFLAGS     Fortran compiler flags
+  MPIFC       MPI Fortran compiler command
+  CXXCPP      C++ preprocessor
+  F77         Fortran 77 compiler command
+  FFLAGS      Fortran 77 compiler flags
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d $ac_dir || continue
+    ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+    cd $ac_dir
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_srcdir/configure; then
+      echo
+      $SHELL $ac_srcdir/configure  --help=recursive
+    elif test -f $ac_srcdir/configure.ac ||
+	   test -f $ac_srcdir/configure.in; then
+      echo
+      $ac_configure --help
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi
+    cd $ac_popdir
+  done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+  cat <<\_ACEOF
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+      # Get rid of the leading space.
+      ac_sep=" "
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+{
+  (set) 2>&1 |
+    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      sed -n \
+	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+      ;;
+    *)
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+}
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=$`echo $ac_var`
+      echo "$ac_var='"'"'$ac_val'"'"'"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=$`echo $ac_var`
+	echo "$ac_var='"'"'$ac_val'"'"'"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      sed "/^$/d" confdefs.h | sort
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core &&
+  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+     ' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . $cache_file;;
+      *)                      . ./$cache_file;;
+    esac
+  fi
+else
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+  eval ac_new_val="\$ac_env_${ac_var}_value"
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+	ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_aux_dir=
+for ac_dir in config $srcdir/config; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f $ac_dir/shtool; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config $srcdir/config" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in config $srcdir/config" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+
+
+          ac_config_headers="$ac_config_headers config.h"
+
+am__api_version="1.9"
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+done
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=$ac_install_sh
+  fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+test "$program_prefix" != NONE &&
+  program_transform_name="s,^,$program_prefix,;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $.  echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+  # We used to keeping the `.' as first argument, in order to
+  # allow $(mkdir_p) to be used without argument.  As in
+  #   $(mkdir_p) $(somedir)
+  # where $(somedir) is conditionally defined.  However this is wrong
+  # for two reasons:
+  #  1. if the package is installed by a user who cannot write `.'
+  #     make install will fail,
+  #  2. the above comment should most certainly read
+  #     $(mkdir_p) $(DESTDIR)$(somedir)
+  #     so it does not work when $(somedir) is undefined and
+  #     $(DESTDIR) is not.
+  #  To support the latter case, we have to write
+  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+  #  so the `.' trick is pointless.
+  mkdir_p='mkdir -p --'
+else
+  # On NextStep and OpenStep, the `mkdir' command does not
+  # recognize any option.  It will interpret all options as
+  # directories to create, and then abort because `.' already
+  # exists.
+  for d in ./-p ./--version;
+  do
+    test -d $d && rmdir $d
+  done
+  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+  if test -f "$ac_aux_dir/mkinstalldirs"; then
+    mkdir_p='$(mkinstalldirs)'
+  else
+    mkdir_p='$(install_sh) -d'
+  fi
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AWK="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$AWK" && break
+done
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\_ACEOF
+all:
+	@echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+  SET_MAKE=
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE=adios
+ VERSION=1.2.1
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  STRIP=$ac_ct_STRIP
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+DEPDIR="${am__leading_dot}deps"
+
+          ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+
+
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval="$enable_dependency_tracking"
+
+fi;
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+
+
+if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CC" && break
+done
+
+  CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+     "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+  (eval $ac_link_default) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Find the output, starting from the most likely.  This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+	;;
+    conftest.$ac_ext )
+	# This is the source file.
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	# FIXME: I believe we export ac_cv_exeext for Libtool,
+	# but it would be cool to find out if it's true.  Does anybody
+	# maintain Libtool? --akim.
+	export ac_cv_exeext
+	break;;
+    * )
+	break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  export ac_cv_exeext
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std1 is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std1.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX 10.20 and later	-Ae
+# HP-UX older versions	-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+  choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  for ac_declaration in \
+   '' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC"   am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+echo "$as_me:$LINENO: checking for preprocessor stringizing operator" >&5
+echo $ECHO_N "checking for preprocessor stringizing operator... $ECHO_C" >&6
+if test "${ac_cv_c_stringize+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#define x(y) #y
+
+char *s = x(teststring);
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "#teststring" >/dev/null 2>&1; then
+  ac_cv_c_stringize=no
+else
+  ac_cv_c_stringize=yes
+fi
+rm -f conftest*
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_stringize" >&5
+echo "${ECHO_T}$ac_cv_c_stringize" >&6
+if test $ac_cv_c_stringize = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_STRINGIZE 1
+_ACEOF
+
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CC" && break
+done
+
+  CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+     "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std1 is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std1.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX 10.20 and later	-Ae
+# HP-UX older versions	-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+  choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  for ac_declaration in \
+   '' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC"   am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+if test "x$CC" != xcc; then
+  echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
+echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6
+else
+  echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
+echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6
+fi
+set dummy $CC; ac_cc=`echo $2 |
+		      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest.$ac_objext >&5'
+if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+   test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+then
+  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  if test "x$CC" != xcc; then
+    # Test first that cc exists at all.
+    if { ac_try='cc -c conftest.$ac_ext >&5'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+      ac_try='cc -c conftest.$ac_ext -o conftest.$ac_objext >&5'
+      if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+      then
+	# cc works too.
+	:
+      else
+	# cc exists but doesn't like -o.
+	eval ac_cv_prog_cc_${ac_cc}_c_o=no
+      fi
+    fi
+  fi
+else
+  eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f conftest*
+
+fi
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_MINUS_C_MINUS_O 1
+_ACEOF
+
+fi
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CXX" && break
+done
+test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
+
+  CXX=$ac_ct_CXX
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+     "checking for C++ compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
+GXX=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cxx_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+for ac_declaration in \
+   '' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CXX"  am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+
+
+if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+if true; then
+  HAVE_MPI_TRUE=
+  HAVE_MPI_FALSE='#'
+else
+  HAVE_MPI_TRUE='#'
+  HAVE_MPI_FALSE=
+fi
+
+
+
+# Check whether --with-mpi or --without-mpi was given.
+if test "${with_mpi+set}" = set; then
+  withval="$with_mpi"
+  MPI_DIR=$withval
+fi;
+
+
+
+
+	for ac_prog in mpicc hcc mpxlc_r mpxlc mpcc cmpicc
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_MPICC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$MPICC"; then
+  ac_cv_prog_MPICC="$MPICC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_MPICC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+MPICC=$ac_cv_prog_MPICC
+if test -n "$MPICC"; then
+  echo "$as_me:$LINENO: result: $MPICC" >&5
+echo "${ECHO_T}$MPICC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$MPICC" && break
+done
+test -n "$MPICC" || MPICC="$CC"
+
+	acx_mpi_save_CC="$CC"
+	CC="$MPICC"
+
+
+
+if test x = x"$MPILIBS"; then
+	echo "$as_me:$LINENO: checking for MPI_Init" >&5
+echo $ECHO_N "checking for MPI_Init... $ECHO_C" >&6
+if test "${ac_cv_func_MPI_Init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define MPI_Init to an innocuous variant, in case <limits.h> declares MPI_Init.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define MPI_Init innocuous_MPI_Init
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char MPI_Init (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef MPI_Init
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char MPI_Init ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_MPI_Init) || defined (__stub___MPI_Init)
+choke me
+#else
+char (*f) () = MPI_Init;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != MPI_Init;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_MPI_Init=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_MPI_Init=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_MPI_Init" >&5
+echo "${ECHO_T}$ac_cv_func_MPI_Init" >&6
+if test $ac_cv_func_MPI_Init = yes; then
+  MPILIBS=" "
+fi
+
+fi
+
+if test x = x"$MPILIBS"; then
+	echo "$as_me:$LINENO: checking for MPI_Init in -lmpi" >&5
+echo $ECHO_N "checking for MPI_Init in -lmpi... $ECHO_C" >&6
+if test "${ac_cv_lib_mpi_MPI_Init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmpi  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char MPI_Init ();
+int
+main ()
+{
+MPI_Init ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_mpi_MPI_Init=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_mpi_MPI_Init=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_mpi_MPI_Init" >&5
+echo "${ECHO_T}$ac_cv_lib_mpi_MPI_Init" >&6
+if test $ac_cv_lib_mpi_MPI_Init = yes; then
+  MPILIBS="-lmpi"
+fi
+
+fi
+if test x = x"$MPILIBS"; then
+	echo "$as_me:$LINENO: checking for MPI_Init in -lmpich" >&5
+echo $ECHO_N "checking for MPI_Init in -lmpich... $ECHO_C" >&6
+if test "${ac_cv_lib_mpich_MPI_Init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmpich  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char MPI_Init ();
+int
+main ()
+{
+MPI_Init ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_mpich_MPI_Init=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_mpich_MPI_Init=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_mpich_MPI_Init" >&5
+echo "${ECHO_T}$ac_cv_lib_mpich_MPI_Init" >&6
+if test $ac_cv_lib_mpich_MPI_Init = yes; then
+  MPILIBS="-lmpich"
+fi
+
+fi
+
+if test x != x"$MPILIBS"; then
+	echo "$as_me:$LINENO: checking for mpi.h" >&5
+echo $ECHO_N "checking for mpi.h... $ECHO_C" >&6
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <mpi.h>
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+MPILIBS=""
+		echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+CC="$acx_mpi_save_CC"
+
+
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x = x"$MPILIBS"; then
+        { { echo "$as_me:$LINENO: error: couldn't find mpi library for C" >&5
+echo "$as_me: error: couldn't find mpi library for C" >&2;}
+   { (exit 1); exit 1; }; }
+        :
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MPI 1
+_ACEOF
+
+        :
+fi
+
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+
+
+if true; then
+  HAVE_MPI_TRUE=
+  HAVE_MPI_FALSE='#'
+else
+  HAVE_MPI_TRUE='#'
+  HAVE_MPI_FALSE=
+fi
+
+
+
+# Check whether --with-mpi or --without-mpi was given.
+if test "${with_mpi+set}" = set; then
+  withval="$with_mpi"
+  MPI_DIR=$withval
+fi;
+
+
+
+
+	for ac_prog in mpic++ mpicxx mpiCC hcp mpxlC_r mpxlC mpCC cmpic++
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_MPICXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$MPICXX"; then
+  ac_cv_prog_MPICXX="$MPICXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_MPICXX="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+MPICXX=$ac_cv_prog_MPICXX
+if test -n "$MPICXX"; then
+  echo "$as_me:$LINENO: result: $MPICXX" >&5
+echo "${ECHO_T}$MPICXX" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$MPICXX" && break
+done
+test -n "$MPICXX" || MPICXX="$CXX"
+
+	acx_mpi_save_CXX="$CXX"
+	CXX="$MPICXX"
+
+
+
+if test x = x"$MPILIBS"; then
+	echo "$as_me:$LINENO: checking for MPI_Init" >&5
+echo $ECHO_N "checking for MPI_Init... $ECHO_C" >&6
+if test "${ac_cv_func_MPI_Init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define MPI_Init to an innocuous variant, in case <limits.h> declares MPI_Init.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define MPI_Init innocuous_MPI_Init
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char MPI_Init (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef MPI_Init
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char MPI_Init ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_MPI_Init) || defined (__stub___MPI_Init)
+choke me
+#else
+char (*f) () = MPI_Init;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != MPI_Init;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_MPI_Init=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_MPI_Init=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_MPI_Init" >&5
+echo "${ECHO_T}$ac_cv_func_MPI_Init" >&6
+if test $ac_cv_func_MPI_Init = yes; then
+  MPILIBS=" "
+fi
+
+fi
+
+if test x = x"$MPILIBS"; then
+	echo "$as_me:$LINENO: checking for MPI_Init in -lmpi" >&5
+echo $ECHO_N "checking for MPI_Init in -lmpi... $ECHO_C" >&6
+if test "${ac_cv_lib_mpi_MPI_Init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmpi  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char MPI_Init ();
+int
+main ()
+{
+MPI_Init ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_mpi_MPI_Init=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_mpi_MPI_Init=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_mpi_MPI_Init" >&5
+echo "${ECHO_T}$ac_cv_lib_mpi_MPI_Init" >&6
+if test $ac_cv_lib_mpi_MPI_Init = yes; then
+  MPILIBS="-lmpi"
+fi
+
+fi
+if test x = x"$MPILIBS"; then
+	echo "$as_me:$LINENO: checking for MPI_Init in -lmpich" >&5
+echo $ECHO_N "checking for MPI_Init in -lmpich... $ECHO_C" >&6
+if test "${ac_cv_lib_mpich_MPI_Init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmpich  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char MPI_Init ();
+int
+main ()
+{
+MPI_Init ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_mpich_MPI_Init=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_mpich_MPI_Init=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_mpich_MPI_Init" >&5
+echo "${ECHO_T}$ac_cv_lib_mpich_MPI_Init" >&6
+if test $ac_cv_lib_mpich_MPI_Init = yes; then
+  MPILIBS="-lmpich"
+fi
+
+fi
+
+if test x != x"$MPILIBS"; then
+	echo "$as_me:$LINENO: checking for mpi.h" >&5
+echo $ECHO_N "checking for mpi.h... $ECHO_C" >&6
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <mpi.h>
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+MPILIBS=""
+		echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+CXX="$acx_mpi_save_CXX"
+
+
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x = x"$MPILIBS"; then
+        { { echo "$as_me:$LINENO: error: couldn't find mpi library for C++" >&5
+echo "$as_me: error: couldn't find mpi library for C++" >&2;}
+   { (exit 1); exit 1; }; }
+        :
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MPI 1
+_ACEOF
+
+        :
+fi
+
+
+# Check whether --enable-fortran or --disable-fortran was given.
+if test "${enable_fortran+set}" = set; then
+  enableval="$enable_fortran"
+
+fi;
+
+
+if test "x$enable_fortran" != "xno"; then
+  BUILD_FORTRAN_TRUE=
+  BUILD_FORTRAN_FALSE='#'
+else
+  BUILD_FORTRAN_TRUE='#'
+  BUILD_FORTRAN_FALSE=
+fi
+
+
+if test "x$enable_fortran" != "xno"; then
+    ac_ext=${FC_SRCEXT-f}
+ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in f95 fort xlf95 ifc efc pgf95 lf95 gfortran f90 xlf90 pgf90 epcf90 g77 f77 xlf frt pgf77 fort77 fl32 af77
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_FC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$FC"; then
+  ac_cv_prog_FC="$FC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_FC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+FC=$ac_cv_prog_FC
+if test -n "$FC"; then
+  echo "$as_me:$LINENO: result: $FC" >&5
+echo "${ECHO_T}$FC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$FC" && break
+  done
+fi
+if test -z "$FC"; then
+  ac_ct_FC=$FC
+  for ac_prog in f95 fort xlf95 ifc efc pgf95 lf95 gfortran f90 xlf90 pgf90 epcf90 g77 f77 xlf frt pgf77 fort77 fl32 af77
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_FC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_FC"; then
+  ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_FC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_FC=$ac_cv_prog_ac_ct_FC
+if test -n "$ac_ct_FC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_FC" >&5
+echo "${ECHO_T}$ac_ct_FC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_FC" && break
+done
+
+  FC=$ac_ct_FC
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:5694:" \
+     "checking for Fortran compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+echo "$as_me:$LINENO: checking whether we are using the GNU Fortran compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU Fortran compiler... $ECHO_C" >&6
+if test "${ac_cv_fc_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_fc_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_fc_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_fc_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_fc_compiler_gnu" >&6
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FCFLAGS+set}
+ac_save_FFLAGS=$FCFLAGS
+FCFLAGS=
+echo "$as_me:$LINENO: checking whether $FC accepts -g" >&5
+echo $ECHO_N "checking whether $FC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_fc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  FCFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_fc_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_fc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_fc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_fc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_fc_g" >&6
+if test "$ac_test_FFLAGS" = set; then
+  FCFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_fc_g = yes; then
+  if test "x$ac_cv_fc_compiler_gnu" = xyes; then
+    FCFLAGS="-g -O2"
+  else
+    FCFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_fc_compiler_gnu" = xyes; then
+    FCFLAGS="-O2"
+  else
+    FCFLAGS=
+  fi
+fi
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+    ac_ext=${FC_SRCEXT-f}
+ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+echo "$as_me:$LINENO: checking whether $FC understands -c and -o together" >&5
+echo $ECHO_N "checking whether $FC understands -c and -o together... $ECHO_C" >&6
+if test "${ac_cv_prog_fc_c_o+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+# We test twice because some compilers refuse to overwrite an existing
+# `.o' file with `-o', although they will create one.
+ac_try='$FC $FCFLAGS -c conftest.$ac_ext -o conftest.$ac_objext >&5'
+if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+     test -f conftest.$ac_objext &&
+     { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  ac_cv_prog_fc_c_o=yes
+else
+  ac_cv_prog_fc_c_o=no
+fi
+rm -f conftest*
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_fc_c_o" >&5
+echo "${ECHO_T}$ac_cv_prog_fc_c_o" >&6
+if test $ac_cv_prog_fc_c_o = no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define FC_NO_MINUS_C_MINUS_O 1
+_ACEOF
+
+fi
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+ac_ext=${FC_SRCEXT-f}
+ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+echo "$as_me:$LINENO: checking how to get verbose linking output from $FC" >&5
+echo $ECHO_N "checking how to get verbose linking output from $FC... $ECHO_C" >&6
+if test "${ac_cv_prog_fc_v+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_fc_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_fc_v=
+# Try some options frequently used verbose output
+for ac_verb in -v -verbose --verbose -V -\#\#\#; do
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+ac_save_FFLAGS=$FCFLAGS
+FCFLAGS="$FCFLAGS $ac_verb"
+(eval echo $as_me:5939: \"$ac_link\") >&5
+ac_fc_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
+echo "$ac_fc_v_output" >&5
+FCFLAGS=$ac_save_FFLAGS
+
+rm -f conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+ac_fc_v_output="`echo $ac_fc_v_output |
+	grep 'LPATH is:' |
+	sed 's,.*LPATH is\(: *[^ ]*\).*,\1,;s,: */, -L/,g'` $ac_fc_v_output"
+
+case $ac_fc_v_output in
+  # If we are using xlf then replace all the commas with spaces.
+  *xlfentry*)
+    ac_fc_v_output=`echo $ac_fc_v_output | sed 's/,/ /g'` ;;
+
+  # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+  # $LIBS confuse us, and the libraries appear later in the output anyway).
+  *mGLOB_options_string*)
+    ac_fc_v_output=`echo $ac_fc_v_output | sed 's/\"-mGLOB[^\"]*\"/ /g'` ;;
+
+  # If we are using Cray Fortran then delete quotes.
+  # Use "\"" instead of '"' for font-lock-mode.
+  # FIXME: a more general fix for quoted arguments with spaces?
+  *cft90*)
+    ac_fc_v_output=`echo $ac_fc_v_output | sed "s/\"//g"` ;;
+esac
+
+
+  # look for -l* and *.a constructs in the output
+  for ac_arg in $ac_fc_v_output; do
+     case $ac_arg in
+        [\\/]*.a | ?:[\\/]*.a | -[lLRu]*)
+          ac_cv_prog_fc_v=$ac_verb
+          break 2 ;;
+     esac
+  done
+done
+if test -z "$ac_cv_prog_fc_v"; then
+   { echo "$as_me:$LINENO: WARNING: cannot determine how to obtain linking information from $FC" >&5
+echo "$as_me: WARNING: cannot determine how to obtain linking information from $FC" >&2;}
+fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ echo "$as_me:$LINENO: WARNING: compilation failed" >&5
+echo "$as_me: WARNING: compilation failed" >&2;}
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_fc_v" >&5
+echo "${ECHO_T}$ac_cv_prog_fc_v" >&6
+echo "$as_me:$LINENO: checking for Fortran libraries of $FC" >&5
+echo $ECHO_N "checking for Fortran libraries of $FC... $ECHO_C" >&6
+if test "${ac_cv_fc_libs+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "x$FCLIBS" != "x"; then
+  ac_cv_fc_libs="$FCLIBS" # Let the user override the test.
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+
+# Compile and link our simple test program by passing a flag (argument
+# 1 to this macro) to the Fortran compiler in order to get
+# "verbose" output that we can then parse for the Fortran linker
+# flags.
+ac_save_FFLAGS=$FCFLAGS
+FCFLAGS="$FCFLAGS $ac_cv_prog_fc_v"
+(eval echo $as_me:6017: \"$ac_link\") >&5
+ac_fc_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
+echo "$ac_fc_v_output" >&5
+FCFLAGS=$ac_save_FFLAGS
+
+rm -f conftest*
+
+# On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where
+# /foo, /bar, and /baz are search directories for the Fortran linker.
+# Here, we change these into -L/foo -L/bar -L/baz (and put it first):
+ac_fc_v_output="`echo $ac_fc_v_output |
+	grep 'LPATH is:' |
+	sed 's,.*LPATH is\(: *[^ ]*\).*,\1,;s,: */, -L/,g'` $ac_fc_v_output"
+
+case $ac_fc_v_output in
+  # If we are using xlf then replace all the commas with spaces.
+  *xlfentry*)
+    ac_fc_v_output=`echo $ac_fc_v_output | sed 's/,/ /g'` ;;
+
+  # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
+  # $LIBS confuse us, and the libraries appear later in the output anyway).
+  *mGLOB_options_string*)
+    ac_fc_v_output=`echo $ac_fc_v_output | sed 's/\"-mGLOB[^\"]*\"/ /g'` ;;
+
+  # If we are using Cray Fortran then delete quotes.
+  # Use "\"" instead of '"' for font-lock-mode.
+  # FIXME: a more general fix for quoted arguments with spaces?
+  *cft90*)
+    ac_fc_v_output=`echo $ac_fc_v_output | sed "s/\"//g"` ;;
+esac
+
+
+
+ac_cv_fc_libs=
+
+# Save positional arguments (if any)
+ac_save_positional="$@"
+
+set X $ac_fc_v_output
+while test $# != 1; do
+  shift
+  ac_arg=$1
+  case $ac_arg in
+        [\\/]*.a | ?:[\\/]*.a)
+            ac_exists=false
+  for ac_i in $ac_cv_fc_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg"
+fi
+
+          ;;
+        -bI:*)
+            ac_exists=false
+  for ac_i in $ac_cv_fc_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  if test "$ac_compiler_gnu" = yes; then
+  for ac_link_opt in $ac_arg; do
+    ac_cv_fc_libs="$ac_cv_fc_libs -Xlinker $ac_link_opt"
+  done
+else
+  ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg"
+fi
+fi
+
+          ;;
+          # Ignore these flags.
+        -lang* | -lcrt[01].o | -lcrtbegin.o | -lc | -lgcc | -libmil | -LANG:=*)
+          ;;
+        -lkernel32)
+          test x"$CYGWIN" != xyes && ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg"
+          ;;
+        -[LRuY])
+          # These flags, when seen by themselves, take an argument.
+          # We remove the space between option and argument and re-iterate
+          # unless we find an empty arg or a new option (starting with -)
+	  case $2 in
+	     "" | -*);;
+	     *)
+		ac_arg="$ac_arg$2"
+		shift; shift
+		set X $ac_arg "$@"
+		;;
+	  esac
+          ;;
+        -YP,*)
+          for ac_j in `echo $ac_arg | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do
+              ac_exists=false
+  for ac_i in $ac_cv_fc_libs; do
+    if test x"$ac_j" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  ac_arg="$ac_arg $ac_j"
+                               ac_cv_fc_libs="$ac_cv_fc_libs $ac_j"
+fi
+
+          done
+          ;;
+        -[lLR]*)
+            ac_exists=false
+  for ac_i in $ac_cv_fc_libs; do
+    if test x"$ac_arg" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
+  done
+
+  if test x"$ac_exists" = xtrue; then
+  :
+else
+  ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg"
+fi
+
+          ;;
+          # Ignore everything else.
+  esac
+done
+# restore positional arguments
+set X $ac_save_positional; shift
+
+# We only consider "LD_RUN_PATH" on Solaris systems.  If this is seen,
+# then we insist that the "run path" must be an absolute path (i.e. it
+# must begin with a "/").
+case `(uname -sr) 2>/dev/null` in
+   "SunOS 5"*)
+      ac_ld_run_path=`echo $ac_fc_v_output |
+                        sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'`
+      test "x$ac_ld_run_path" != x &&
+        if test "$ac_compiler_gnu" = yes; then
+  for ac_link_opt in $ac_ld_run_path; do
+    ac_cv_fc_libs="$ac_cv_fc_libs -Xlinker $ac_link_opt"
+  done
+else
+  ac_cv_fc_libs="$ac_cv_fc_libs $ac_ld_run_path"
+fi
+      ;;
+esac
+fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x"
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_fc_libs" >&5
+echo "${ECHO_T}$ac_cv_fc_libs" >&6
+FCLIBS="$ac_cv_fc_libs"
+
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_ext=${FC_SRCEXT-f}
+ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+echo "$as_me:$LINENO: checking for dummy main to link with Fortran libraries" >&5
+echo $ECHO_N "checking for dummy main to link with Fortran libraries... $ECHO_C" >&6
+if test "${ac_cv_fc_dummy_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_fc_dm_save_LIBS=$LIBS
+ LIBS="$LIBS $FCLIBS"
+ ac_fortran_dm_var=FC_DUMMY_MAIN
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ # First, try linking without a dummy main:
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_fortran_dummy_main=none
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_fortran_dummy_main=unknown
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+
+ if test $ac_cv_fortran_dummy_main = unknown; then
+   for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do
+     cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#define $ac_fortran_dm_var $ac_func
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_fortran_dummy_main=$ac_func; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+   done
+ fi
+ ac_ext=${FC_SRCEXT-f}
+ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+ ac_cv_fc_dummy_main=$ac_cv_fortran_dummy_main
+ rm -f conftest*
+ LIBS=$ac_fc_dm_save_LIBS
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_fc_dummy_main" >&5
+echo "${ECHO_T}$ac_cv_fc_dummy_main" >&6
+FC_DUMMY_MAIN=$ac_cv_fc_dummy_main
+if test "$FC_DUMMY_MAIN" != unknown; then
+  if test $FC_DUMMY_MAIN != none; then
+
+cat >>confdefs.h <<_ACEOF
+#define FC_DUMMY_MAIN $FC_DUMMY_MAIN
+_ACEOF
+
+  if test "x$ac_cv_fc_dummy_main" = "x$ac_cv_f77_dummy_main"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define FC_DUMMY_MAIN_EQ_F77 1
+_ACEOF
+
+  fi
+fi
+else
+  { { echo "$as_me:$LINENO: error: linking to Fortran libraries from C fails
+See \`config.log' for more details." >&5
+echo "$as_me: error: linking to Fortran libraries from C fails
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_ext=${FC_SRCEXT-f}
+ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+echo "$as_me:$LINENO: checking for Fortran name-mangling scheme" >&5
+echo $ECHO_N "checking for Fortran name-mangling scheme... $ECHO_C" >&6
+if test "${ac_cv_fc_mangling+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      subroutine foobar()
+      return
+      end
+      subroutine foo_bar()
+      return
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_fc_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  mv conftest.$ac_objext cfortran_test.$ac_objext
+
+  ac_save_LIBS=$LIBS
+  LIBS="cfortran_test.$ac_objext $LIBS $FCLIBS"
+
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+  ac_success=no
+  for ac_foobar in foobar FOOBAR; do
+    for ac_underscore in "" "_"; do
+      ac_func="$ac_foobar$ac_underscore"
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+$ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_success=yes; break 2
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+    done
+  done
+  ac_ext=${FC_SRCEXT-f}
+ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+  if test "$ac_success" = "yes"; then
+     case $ac_foobar in
+	foobar)
+	   ac_case=lower
+	   ac_foo_bar=foo_bar
+	   ;;
+	FOOBAR)
+	   ac_case=upper
+	   ac_foo_bar=FOO_BAR
+	   ;;
+     esac
+
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+     ac_success_extra=no
+     for ac_extra in "" "_"; do
+	ac_func="$ac_foo_bar$ac_underscore$ac_extra"
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+$ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_success_extra=yes; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+     done
+     ac_ext=${FC_SRCEXT-f}
+ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+     if test "$ac_success_extra" = "yes"; then
+	ac_cv_fc_mangling="$ac_case case"
+        if test -z "$ac_underscore"; then
+           ac_cv_fc_mangling="$ac_cv_fc_mangling, no underscore"
+	else
+           ac_cv_fc_mangling="$ac_cv_fc_mangling, underscore"
+        fi
+        if test -z "$ac_extra"; then
+           ac_cv_fc_mangling="$ac_cv_fc_mangling, no extra underscore"
+	else
+           ac_cv_fc_mangling="$ac_cv_fc_mangling, extra underscore"
+        fi
+      else
+	ac_cv_fc_mangling="unknown"
+      fi
+  else
+     ac_cv_fc_mangling="unknown"
+  fi
+
+  LIBS=$ac_save_LIBS
+  rm -f cfortran_test* conftest*
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compile a simple Fortran program
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compile a simple Fortran program
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_fc_mangling" >&5
+echo "${ECHO_T}$ac_cv_fc_mangling" >&6
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ac_ext=${FC_SRCEXT-f}
+ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+
+case $ac_cv_fc_mangling in
+  "lower case, no underscore, no extra underscore")
+          cat >>confdefs.h <<\_ACEOF
+#define FC_FUNC(name,NAME) name
+_ACEOF
+
+          cat >>confdefs.h <<\_ACEOF
+#define FC_FUNC_(name,NAME) name
+_ACEOF
+ ;;
+  "lower case, no underscore, extra underscore")
+          cat >>confdefs.h <<\_ACEOF
+#define FC_FUNC(name,NAME) name
+_ACEOF
+
+          cat >>confdefs.h <<\_ACEOF
+#define FC_FUNC_(name,NAME) name ## _
+_ACEOF
+ ;;
+  "lower case, underscore, no extra underscore")
+          cat >>confdefs.h <<\_ACEOF
+#define FC_FUNC(name,NAME) name ## _
+_ACEOF
+
+          cat >>confdefs.h <<\_ACEOF
+#define FC_FUNC_(name,NAME) name ## _
+_ACEOF
+ ;;
+  "lower case, underscore, extra underscore")
+          cat >>confdefs.h <<\_ACEOF
+#define FC_FUNC(name,NAME) name ## _
+_ACEOF
+
+          cat >>confdefs.h <<\_ACEOF
+#define FC_FUNC_(name,NAME) name ## __
+_ACEOF
+ ;;
+  "upper case, no underscore, no extra underscore")
+          cat >>confdefs.h <<\_ACEOF
+#define FC_FUNC(name,NAME) NAME
+_ACEOF
+
+          cat >>confdefs.h <<\_ACEOF
+#define FC_FUNC_(name,NAME) NAME
+_ACEOF
+ ;;
+  "upper case, no underscore, extra underscore")
+          cat >>confdefs.h <<\_ACEOF
+#define FC_FUNC(name,NAME) NAME
+_ACEOF
+
+          cat >>confdefs.h <<\_ACEOF
+#define FC_FUNC_(name,NAME) NAME ## _
+_ACEOF
+ ;;
+  "upper case, underscore, no extra underscore")
+          cat >>confdefs.h <<\_ACEOF
+#define FC_FUNC(name,NAME) NAME ## _
+_ACEOF
+
+          cat >>confdefs.h <<\_ACEOF
+#define FC_FUNC_(name,NAME) NAME ## _
+_ACEOF
+ ;;
+  "upper case, underscore, extra underscore")
+          cat >>confdefs.h <<\_ACEOF
+#define FC_FUNC(name,NAME) NAME ## _
+_ACEOF
+
+          cat >>confdefs.h <<\_ACEOF
+#define FC_FUNC_(name,NAME) NAME ## __
+_ACEOF
+ ;;
+  *)
+          { echo "$as_me:$LINENO: WARNING: unknown Fortran name-mangling scheme" >&5
+echo "$as_me: WARNING: unknown Fortran name-mangling scheme" >&2;}
+          ;;
+esac
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+    F77=$FC
+            ac_ext=${FC_SRCEXT-f}
+ac_compile='$FC -c $FCFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $FCFLAGS_SRCEXT conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+
+
+
+
+if true; then
+  HAVE_MPI_TRUE=
+  HAVE_MPI_FALSE='#'
+else
+  HAVE_MPI_TRUE='#'
+  HAVE_MPI_FALSE=
+fi
+
+
+
+# Check whether --with-mpi or --without-mpi was given.
+if test "${with_mpi+set}" = set; then
+  withval="$with_mpi"
+  MPI_DIR=$withval
+fi;
+
+
+
+
+	for ac_prog in mpif90 mpxlf95_r mpxlf90_r mpxlf95 mpxlf90 mpf90 cmpif90c
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_MPIFC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$MPIFC"; then
+  ac_cv_prog_MPIFC="$MPIFC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_MPIFC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+MPIFC=$ac_cv_prog_MPIFC
+if test -n "$MPIFC"; then
+  echo "$as_me:$LINENO: result: $MPIFC" >&5
+echo "${ECHO_T}$MPIFC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$MPIFC" && break
+done
+test -n "$MPIFC" || MPIFC="$FC"
+
+	acx_mpi_save_FC="$FC"
+	FC="$MPIFC"
+
+
+
+if test x = x"$MPILIBS"; then
+	echo "$as_me:$LINENO: checking for MPI_Init" >&5
+echo $ECHO_N "checking for MPI_Init... $ECHO_C" >&6
+			cat >conftest.$ac_ext <<_ACEOF
+      program main
+      call MPI_Init
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_fc_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  MPILIBS=" "
+				echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+
+	if test x = x"$MPILIBS"; then
+		echo "$as_me:$LINENO: checking for MPI_Init in -lfmpi" >&5
+echo $ECHO_N "checking for MPI_Init in -lfmpi... $ECHO_C" >&6
+if test "${ac_cv_lib_fmpi_MPI_Init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lfmpi  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+      call MPI_Init
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_fc_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_fmpi_MPI_Init=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_fmpi_MPI_Init=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_fmpi_MPI_Init" >&5
+echo "${ECHO_T}$ac_cv_lib_fmpi_MPI_Init" >&6
+if test $ac_cv_lib_fmpi_MPI_Init = yes; then
+  MPILIBS="-lfmpi"
+fi
+
+	fi
+	if test x = x"$MPILIBS"; then
+		echo "$as_me:$LINENO: checking for MPI_Init in -lmpichf90" >&5
+echo $ECHO_N "checking for MPI_Init in -lmpichf90... $ECHO_C" >&6
+if test "${ac_cv_lib_mpichf90_MPI_Init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmpichf90  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+      call MPI_Init
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_fc_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_mpichf90_MPI_Init=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_mpichf90_MPI_Init=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_mpichf90_MPI_Init" >&5
+echo "${ECHO_T}$ac_cv_lib_mpichf90_MPI_Init" >&6
+if test $ac_cv_lib_mpichf90_MPI_Init = yes; then
+  MPILIBS="-lmpichf90"
+fi
+
+	fi
+
+if test x = x"$MPILIBS"; then
+	echo "$as_me:$LINENO: checking for MPI_Init in -lmpi" >&5
+echo $ECHO_N "checking for MPI_Init in -lmpi... $ECHO_C" >&6
+if test "${ac_cv_lib_mpi_MPI_Init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmpi  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+      call MPI_Init
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_fc_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_mpi_MPI_Init=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_mpi_MPI_Init=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_mpi_MPI_Init" >&5
+echo "${ECHO_T}$ac_cv_lib_mpi_MPI_Init" >&6
+if test $ac_cv_lib_mpi_MPI_Init = yes; then
+  MPILIBS="-lmpi"
+fi
+
+fi
+if test x = x"$MPILIBS"; then
+	echo "$as_me:$LINENO: checking for MPI_Init in -lmpich" >&5
+echo $ECHO_N "checking for MPI_Init in -lmpich... $ECHO_C" >&6
+if test "${ac_cv_lib_mpich_MPI_Init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmpich  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+      call MPI_Init
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_fc_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_mpich_MPI_Init=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_mpich_MPI_Init=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_mpich_MPI_Init" >&5
+echo "${ECHO_T}$ac_cv_lib_mpich_MPI_Init" >&6
+if test $ac_cv_lib_mpich_MPI_Init = yes; then
+  MPILIBS="-lmpich"
+fi
+
+fi
+
+if test x != x"$MPILIBS"; then
+	echo "$as_me:$LINENO: checking for mpif.h" >&5
+echo $ECHO_N "checking for mpif.h... $ECHO_C" >&6
+	cat >conftest.$ac_ext <<_ACEOF
+      program main
+      include 'mpif.h'
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_fc_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+MPILIBS=""
+		echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+FC="$acx_mpi_save_FC"
+
+
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x = x"$MPILIBS"; then
+        { { echo "$as_me:$LINENO: error: couldn't find mpi library for Fortran" >&5
+echo "$as_me: error: couldn't find mpi library for Fortran" >&2;}
+   { (exit 1); exit 1; }; }
+        :
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MPI 1
+_ACEOF
+
+        :
+fi
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+  enableval="$enable_shared"
+  p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_shared=yes
+fi;
+
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+  enableval="$enable_static"
+  p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_static=yes
+fi;
+
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+  enableval="$enable_fast_install"
+  p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_fast_install=yes
+fi;
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+  ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+  ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
+if test "${lt_cv_path_SED+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f $lt_ac_sed && continue
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test $lt_ac_count -gt 10 && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test $lt_ac_count -gt $lt_ac_max; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+
+fi
+
+SED=$lt_cv_path_SED
+
+echo "$as_me:$LINENO: result: $SED" >&5
+echo "${ECHO_T}$SED" >&6
+
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval="$with_gnu_ld"
+  test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi;
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+
+echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
+if test "${lt_cv_path_NM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+	# Check to see if the nm accepts a BSD-compat flag.
+	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	#   nm: unknown option "B" ignored
+	# Tru64's nm complains that /dev/null is an invalid object file
+	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+	*/dev/null* | *'Invalid file or object type'*)
+	  lt_cv_path_NM="$tmp_nm -B"
+	  break
+	  ;;
+	*)
+	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	  */dev/null*)
+	    lt_cv_path_NM="$tmp_nm -p"
+	    break
+	    ;;
+	  *)
+	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	    continue # so that we can try to find one that supports BSD flags
+	    ;;
+	  esac
+	  ;;
+	esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi
+fi
+echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+echo "${ECHO_T}$lt_cv_path_NM" >&6
+NM="$lt_cv_path_NM"
+
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
+fi
+
+echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
+echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[45]*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | kfreebsd*-gnu | dragonfly*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix3*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+nto-qnx*)
+  lt_cv_deplibs_check_method=unknown
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval="$enable_libtool_lock"
+
+fi;
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *ELF-32*)
+      HPUX_IA64_MODE="32"
+      ;;
+    *ELF-64*)
+      HPUX_IA64_MODE="64"
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '#line 7713 "configure"' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+   if test "$lt_cv_prog_gnu_ld" = yes; then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -melf32bsmip"
+      ;;
+    *N32*)
+      LD="${LD-ld} -melf32bmipn32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -melf64bmip"
+      ;;
+    esac
+   else
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -32"
+      ;;
+    *N32*)
+      LD="${LD-ld} -n32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -64"
+      ;;
+    esac
+   fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.o` in
+    *32-bit*)
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_i386"
+          ;;
+        ppc64-*linux*|powerpc64-*linux*)
+          LD="${LD-ld} -m elf32ppclinux"
+          ;;
+        s390x-*linux*)
+          LD="${LD-ld} -m elf_s390"
+          ;;
+        sparc64-*linux*)
+          LD="${LD-ld} -m elf32_sparc"
+          ;;
+      esac
+      ;;
+    *64-bit*)
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          LD="${LD-ld} -m elf64_s390"
+          ;;
+        sparc*-*linux*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  lt_cv_cc_needs_belf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+lt_cv_cc_needs_belf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)    LD="${LD-ld} -64" ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in dlfcn.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
+if test -z "$CXXCPP"; then
+  if test "${ac_cv_prog_CXXCPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+echo "$as_me:$LINENO: result: $CXXCPP" >&5
+echo "${ECHO_T}$CXXCPP" >&6
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+fi
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$F77"; then
+  ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+  echo "$as_me:$LINENO: result: $F77" >&5
+echo "${ECHO_T}$F77" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$F77" && break
+  done
+fi
+if test -z "$F77"; then
+  ac_ct_F77=$F77
+  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_F77"; then
+  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_F77="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+  echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+echo "${ECHO_T}$ac_ct_F77" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_F77" && break
+done
+
+  F77=$ac_ct_F77
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:8628:" \
+     "checking for Fortran 77 compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_f77_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_f77_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_f77_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_f77_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_f77_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+echo "${ECHO_T}$ac_cv_prog_f77_g" >&6
+if test "$ac_test_FFLAGS" = set; then
+  FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-g -O2"
+  else
+    FFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-O2"
+  else
+    FFLAGS=
+  fi
+fi
+
+G77=`test $ac_compiler_gnu = yes && echo yes`
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+
+# find the maximum length of command line arguments
+echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ 	]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    # If test is not a shell built-in, we'll probably end up computing a
+    # maximum length that is only half of the actual maximum length, but
+    # we can't tell.
+    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+    while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+	       = "XX$teststring") >/dev/null 2>&1 &&
+	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
+	    lt_cv_sys_max_cmd_len=$new_result &&
+	    test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      teststring=$teststring$teststring
+    done
+    teststring=
+    # Add a significant safety factor because C++ compilers can tack on massive
+    # amounts of additional arguments before passing them to the linker.
+    # It appears as though 1/2 is a usable value.
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    ;;
+  esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+  echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
+else
+  echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6
+fi
+
+
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*) # Its linker distinguishes data from code symbols
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  ;;
+linux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDGIRSTW]'
+    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris*)
+  symcode='[BDRT]'
+  ;;
+sco3.2v5*)
+  symcode='[DT]'
+  ;;
+sysv4.2uw2*)
+  symcode='[DT]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[ABDT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
+  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+	mv -f "$nlist"T "$nlist"
+      else
+	rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if grep ' nm_test_var$' "$nlist" >/dev/null; then
+	if grep ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+	  cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+	  cat <<\EOF >> conftest.$ac_ext
+  {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftstm.$ac_objext
+	  lt_save_LIBS="$LIBS"
+	  lt_save_CFLAGS="$CFLAGS"
+	  LIBS="conftstm.$ac_objext"
+	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+	  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext}; then
+	    pipe_works=yes
+	  fi
+	  LIBS="$lt_save_LIBS"
+	  CFLAGS="$lt_save_CFLAGS"
+	else
+	  echo "cannot find nm_test_func in $nlist" >&5
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -f conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+else
+  echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6
+fi
+
+echo "$as_me:$LINENO: checking for objdir" >&5
+echo $ECHO_N "checking for objdir... $ECHO_C" >&6
+if test "${lt_cv_objdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+echo "${ECHO_T}$lt_cv_objdir" >&6
+objdir=$lt_cv_objdir
+
+
+
+
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e 1s/^X//'
+sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="ar"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false"
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  AR=$ac_ct_AR
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  RANLIB=$ac_ct_RANLIB
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  STRIP=$ac_ct_STRIP
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+enable_dlopen=no
+enable_win32_dll=no
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval="$enable_libtool_lock"
+
+fi;
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+  withval="$with_pic"
+  pic_mode="$withval"
+else
+  pic_mode=default
+fi;
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:9691: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:9695: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
+
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      else
+	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic='-qnocommon'
+         lt_prog_compiler_wl='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-KPIC'
+	lt_prog_compiler_static='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fpic'
+	lt_prog_compiler_static='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic='-Kconform_pic'
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:9959: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:9963: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6
+
+if test x"$lt_prog_compiler_pic_works" = xyes; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
+else
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works=yes
+       fi
+     else
+       lt_prog_compiler_static_works=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works" >&6
+
+if test x"$lt_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:10063: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:10067: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $rm conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+   $rm out/* && rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  runpath_var=
+  allow_undefined_flag=
+  enable_shared_with_static_runtimes=no
+  archive_cmds=
+  archive_expsym_cmds=
+  old_archive_From_new_cmds=
+  old_archive_from_expsyms_cmds=
+  export_dynamic_flag_spec=
+  whole_archive_flag_spec=
+  thread_safe_flag_spec=
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_flag_spec_ld=
+  hardcode_libdir_separator=
+  hardcode_direct=no
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  link_all_deplibs=unknown
+  hardcode_automatic=no
+  module_cmds=
+  module_expsym_cmds=
+  always_export_symbols=no
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs=no
+	cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+
+      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    interix3*)
+      hardcode_direct=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	esac
+	archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs=no
+	cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+	ld_shlibs=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	    hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+	  else
+	    ld_shlibs=no
+	  fi
+	;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec=
+      export_dynamic_flag_spec=
+      whole_archive_flag_spec=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
+
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# need to do runtime linking.
+	case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+	  for ld_flag in $LDFLAGS; do
+  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+  	    aix_use_runtimelinking=yes
+  	    break
+  	  fi
+	  done
+	  ;;
+	esac
+
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+
+      if test "$GCC" = yes; then
+	case $host_os in aix4.[012]|aix4.[012].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" && \
+  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
+	  then
+  	  # We have reworked collect2
+  	  hardcode_direct=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct=unsupported
+  	  # It fails to find uninstalled libraries when the uninstalled
+  	  # path is not listed in the libpath.  Setting hardcode_minus_L
+  	  # to unsupported forces relinking
+  	  hardcode_minus_L=yes
+  	  hardcode_libdir_flag_spec='-L$libdir'
+  	  hardcode_libdir_separator=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+  	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='${wl}-G'
+	  else
+	    shared_flag='${wl}-bM:SRE'
+	  fi
+	fi
+      fi
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=yes
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	allow_undefined_flag='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag="-z nodefs"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  no_undefined_flag=' ${wl}-bernotok'
+	  allow_undefined_flag=' ${wl}-berok'
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec='$convenience'
+	  archive_cmds_need_lc=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs=no
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec=' '
+      allow_undefined_flag=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc=no
+      hardcode_direct=no
+      hardcode_automatic=yes
+      hardcode_shlibpath_var=unsupported
+      whole_archive_flag_spec=''
+      link_all_deplibs=yes
+    if test "$GCC" = yes ; then
+    	output_verbose_link_cmd='echo'
+        archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator=:
+
+	hardcode_direct=yes
+	export_dynamic_flag_spec='${wl}-E'
+
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	hardcode_minus_L=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      else
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  hardcode_libdir_flag_spec_ld='+b $libdir'
+	  hardcode_direct=no
+	  hardcode_shlibpath_var=no
+	  ;;
+	*)
+	  hardcode_direct=yes
+	  export_dynamic_flag_spec='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      link_all_deplibs=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
+
+    openbsd*)
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      hardcode_libdir_separator=:
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z text'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	wlarc=''
+	archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
+      esac
+      link_all_deplibs=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds='$CC -r -o $output$reload_objs'
+	  hardcode_direct=no
+        ;;
+	motorola)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+      no_undefined_flag='${wl}-z,text'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag='${wl}-z,text'
+      allow_undefined_flag='${wl}-z,nodefs'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+echo "${ECHO_T}$ld_shlibs" >&6
+test "$ld_shlibs" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl
+	pic_flag=$lt_prog_compiler_pic
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag
+        allow_undefined_flag=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc=no
+        else
+	  archive_cmds_need_lc=yes
+        fi
+        allow_undefined_flag=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+echo "${ECHO_T}$archive_cmds_need_lc" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+  else
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  freebsd*) # from 4.6 on
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext_cmds='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+interix3*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # find out which ABI we are using
+  libsuff=
+  case "$host_cpu" in
+  x86_64*|s390x*|powerpc64*)
+    echo '#line 11548 "configure"' > conftest.$ac_ext
+    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+      case `/usr/bin/file conftest.$ac_objext` in
+      *64-bit*)
+        libsuff=64
+        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+        ;;
+      esac
+    fi
+    rm -rf conftest*
+    ;;
+  esac
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+knetbsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+    shlibpath_overrides_runpath=no
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    shlibpath_overrides_runpath=yes
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+   test -n "$runpath_var" || \
+   test "X$hardcode_automatic" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action" >&5
+echo "${ECHO_T}$hardcode_action" >&6
+
+if test "$hardcode_action" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+   darwin*)
+       if test -n "$STRIP" ; then
+         striplib="$STRIP -x"
+         echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+       ;;
+   *)
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+    ;;
+  esac
+fi
+
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+   ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+   ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+   ;;
+
+  *)
+    echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shl_load (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+return f != shl_load;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+  lt_cv_dlopen="shl_load"
+else
+  echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+  echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+return f != dlopen;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+  lt_cv_dlopen="dlopen"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dld_link ();
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 12501 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+#line 12601 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+    exit (status);
+}
+EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+
+
+# Report which library types will actually be built
+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case $host_os in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+    ;;
+esac
+echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler \
+    CC \
+    LD \
+    lt_prog_compiler_wl \
+    lt_prog_compiler_pic \
+    lt_prog_compiler_static \
+    lt_prog_compiler_no_builtin_flag \
+    export_dynamic_flag_spec \
+    thread_safe_flag_spec \
+    whole_archive_flag_spec \
+    enable_shared_with_static_runtimes \
+    old_archive_cmds \
+    old_archive_from_new_cmds \
+    predep_objects \
+    postdep_objects \
+    predeps \
+    postdeps \
+    compiler_lib_search_path \
+    archive_cmds \
+    archive_expsym_cmds \
+    postinstall_cmds \
+    postuninstall_cmds \
+    old_archive_from_expsyms_cmds \
+    allow_undefined_flag \
+    no_undefined_flag \
+    export_symbols_cmds \
+    hardcode_libdir_flag_spec \
+    hardcode_libdir_flag_spec_ld \
+    hardcode_libdir_separator \
+    hardcode_automatic \
+    module_cmds \
+    module_expsym_cmds \
+    lt_cv_prog_compiler_c_o \
+    exclude_expsyms \
+    include_expsyms; do
+
+    case $var in
+    old_archive_cmds | \
+    old_archive_from_new_cmds | \
+    archive_cmds | \
+    archive_expsym_cmds | \
+    module_cmds | \
+    module_expsym_cmds | \
+    old_archive_from_expsyms_cmds | \
+    export_symbols_cmds | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  { echo "$as_me:$LINENO: creating $ofile" >&5
+echo "$as_me: creating $ofile" >&6;}
+
+  cat <<__EOF__ >> "$cfgfile"
+#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e 1s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC
+
+gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
+gcc_ver=\`gcc -dumpversion\`
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=\`echo $lt_predep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=\`echo $lt_postdep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=\`echo $lt_compiler_lib_search_path | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# ### END LIBTOOL CONFIG
+
+__EOF__
+
+
+  case $host_os in
+  aix3*)
+    cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+EOF
+    ;;
+  esac
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" || \
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+# Check whether --with-tags or --without-tags was given.
+if test "${with_tags+set}" = set; then
+  withval="$with_tags"
+  tagnames="$withval"
+fi;
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
+  fi
+
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
+    else
+      { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
+echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
+    fi
+  fi
+  if test -z "$LTCFLAGS"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
+  fi
+
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
+    "") ;;
+    *)  { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
+echo "$as_me: error: invalid tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+	;;
+    esac
+
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
+echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
+
+      case $tagname in
+      CXX)
+	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+	    (test "X$CXX" != "Xg++"))) ; then
+	  ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
+hardcode_automatic_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+  $as_unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+  lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+  $as_unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+compiler_CXX=$CC
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+else
+  lt_prog_compiler_no_builtin_flag_CXX=
+fi
+
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
+
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval="$with_gnu_ld"
+  test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi;
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+  # Check if GNU C++ uses GNU ld as the underlying linker, since the
+  # archiving commands below assume that GNU ld is being used.
+  if test "$with_gnu_ld" = yes; then
+    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+    #     investigate it a little bit more. (MM)
+    wlarc='${wl}'
+
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+	grep 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec_CXX=
+    fi
+  else
+    with_gnu_ld=no
+    wlarc=
+
+    # A generic and very simple default shared library creation
+    # command for GNU C++ for the case where it uses the native
+    # linker, instead of GNU ld.  If possible, this setting should
+    # overridden to take advantage of the native linker features on
+    # the platform it is being used on.
+    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+  fi
+
+  # Commands to make compiler produce verbose output that lists
+  # what "hidden" libraries, object files and flags are used when
+  # linking a shared library.
+  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+else
+  GXX=no
+  with_gnu_ld=no
+  wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+ld_shlibs_CXX=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  aix4* | aix5*)
+    if test "$host_cpu" = ia64; then
+      # On IA64, the linker does run time linking by default, so we don't
+      # have to do anything special.
+      aix_use_runtimelinking=no
+      exp_sym_flag='-Bexport'
+      no_entry_flag=""
+    else
+      aix_use_runtimelinking=no
+
+      # Test if we are trying to use run time linking or normal
+      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+      # need to do runtime linking.
+      case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+	for ld_flag in $LDFLAGS; do
+	  case $ld_flag in
+	  *-brtl*)
+	    aix_use_runtimelinking=yes
+	    break
+	    ;;
+	  esac
+	done
+	;;
+      esac
+
+      exp_sym_flag='-bexport'
+      no_entry_flag='-bnoentry'
+    fi
+
+    # When large executables or shared objects are built, AIX ld can
+    # have problems creating the table of contents.  If linking a library
+    # or program results in "error TOC overflow" add -mminimal-toc to
+    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+    archive_cmds_CXX=''
+    hardcode_direct_CXX=yes
+    hardcode_libdir_separator_CXX=':'
+    link_all_deplibs_CXX=yes
+
+    if test "$GXX" = yes; then
+      case $host_os in aix4.[012]|aix4.[012].*)
+      # We only want to do this on AIX 4.2 and lower, the check
+      # below for broken collect2 doesn't work under 4.3+
+	collect2name=`${CC} -print-prog-name=collect2`
+	if test -f "$collect2name" && \
+	   strings "$collect2name" | grep resolve_lib_name >/dev/null
+	then
+	  # We have reworked collect2
+	  hardcode_direct_CXX=yes
+	else
+	  # We have old collect2
+	  hardcode_direct_CXX=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  hardcode_minus_L_CXX=yes
+	  hardcode_libdir_flag_spec_CXX='-L$libdir'
+	  hardcode_libdir_separator_CXX=
+	fi
+	;;
+      esac
+      shared_flag='-shared'
+      if test "$aix_use_runtimelinking" = yes; then
+	shared_flag="$shared_flag "'${wl}-G'
+      fi
+    else
+      # not using gcc
+      if test "$host_cpu" = ia64; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	shared_flag='-G'
+      else
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag='${wl}-G'
+	else
+	  shared_flag='${wl}-bM:SRE'
+	fi
+      fi
+    fi
+
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    always_export_symbols_CXX=yes
+    if test "$aix_use_runtimelinking" = yes; then
+      # Warning - without using the other runtime loading flags (-brtl),
+      # -berok will link without error, but may produce a broken library.
+      allow_undefined_flag_CXX='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+      hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+	hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+	allow_undefined_flag_CXX="-z nodefs"
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+      else
+	# Determine the default libpath from the value encoded in an empty executable.
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+	# Warning - without using the other run time loading flags,
+	# -berok will link without error, but may produce a broken library.
+	no_undefined_flag_CXX=' ${wl}-bernotok'
+	allow_undefined_flag_CXX=' ${wl}-berok'
+	# Exported symbols can be pulled into shared objects from archives
+	whole_archive_flag_spec_CXX='$convenience'
+	archive_cmds_need_lc_CXX=yes
+	# This is similar to how AIX traditionally builds its shared libraries.
+	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+
+  beos*)
+    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+      allow_undefined_flag_CXX=unsupported
+      # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+      # support --undefined.  This deserves some investigation.  FIXME
+      archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    else
+      ld_shlibs_CXX=no
+    fi
+    ;;
+
+  chorus*)
+    case $cc_basename in
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+    # as there is no search path for DLLs.
+    hardcode_libdir_flag_spec_CXX='-L$libdir'
+    allow_undefined_flag_CXX=unsupported
+    always_export_symbols_CXX=no
+    enable_shared_with_static_runtimes_CXX=yes
+
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	cp $export_symbols $output_objdir/$soname.def;
+      else
+	echo EXPORTS > $output_objdir/$soname.def;
+	cat $export_symbols >> $output_objdir/$soname.def;
+      fi~
+      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+    else
+      ld_shlibs_CXX=no
+    fi
+  ;;
+      darwin* | rhapsody*)
+        case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      archive_cmds_need_lc_CXX=no
+      hardcode_direct_CXX=no
+      hardcode_automatic_CXX=yes
+      hardcode_shlibpath_var_CXX=unsupported
+      whole_archive_flag_spec_CXX=''
+      link_all_deplibs_CXX=yes
+
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      else
+          archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+        fi
+        module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_CXX=no
+          ;;
+      esac
+      fi
+        ;;
+
+  dgux*)
+    case $cc_basename in
+      ec++*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      ghcx*)
+	# Green Hills C++ Compiler
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  freebsd[12]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    ld_shlibs_CXX=no
+    ;;
+  freebsd-elf*)
+    archive_cmds_need_lc_CXX=no
+    ;;
+  freebsd* | kfreebsd*-gnu | dragonfly*)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    ld_shlibs_CXX=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    export_dynamic_flag_spec_CXX='${wl}-E'
+    hardcode_direct_CXX=yes
+    hardcode_minus_L_CXX=yes # Not in the search PATH,
+				# but as the default
+				# location of the library.
+
+    case $cc_basename in
+    CC*)
+      # FIXME: insert proper C++ library support
+      ld_shlibs_CXX=no
+      ;;
+    aCC*)
+      archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      #
+      # There doesn't appear to be a way to prevent this compiler from
+      # explicitly linking system object files so we need to strip them
+      # from the output so that they don't get included in the library
+      # dependencies.
+      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_CXX=:
+
+      case $host_cpu in
+      hppa*64*|ia64*)
+	hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
+        ;;
+      *)
+	export_dynamic_flag_spec_CXX='${wl}-E'
+        ;;
+      esac
+    fi
+    case $host_cpu in
+    hppa*64*|ia64*)
+      hardcode_direct_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      ;;
+    *)
+      hardcode_direct_CXX=yes
+      hardcode_minus_L_CXX=yes # Not in the search PATH,
+					      # but as the default
+					      # location of the library.
+      ;;
+    esac
+
+    case $cc_basename in
+      CC*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      aCC*)
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	  ;;
+	esac
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test $with_gnu_ld = no; then
+	    case $host_cpu in
+	    hppa*64*)
+	      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      ;;
+	    ia64*)
+	      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      ;;
+	    *)
+	      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      ;;
+	    esac
+	  fi
+	else
+	  # FIXME: insert proper C++ library support
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  interix3*)
+    hardcode_direct_CXX=no
+    hardcode_shlibpath_var_CXX=no
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+    export_dynamic_flag_spec_CXX='${wl}-E'
+    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+    # Instead, shared libraries are loaded at an image base (0x10000000 by
+    # default) and relocated if they conflict, which is a slow very memory
+    # consuming and fragmenting process.  To avoid this, we pick a random,
+    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+    archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+    archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC*)
+	# SGI C++
+	archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	# Archives containing C++ object files must be created using
+	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+	# necessary to make sure instantiated templates are included
+	# in the archive.
+	old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	;;
+      *)
+	if test "$GXX" = yes; then
+	  if test "$with_gnu_ld" = no; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	  else
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+	  fi
+	fi
+	link_all_deplibs_CXX=yes
+	;;
+    esac
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+    hardcode_libdir_separator_CXX=:
+    ;;
+  linux*)
+    case $cc_basename in
+      KCC*)
+	# Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	# KCC will only create a shared library if the output file
+	# ends with ".so" (or ".sl" for HP-UX), so rename the library
+	# to its proper name (with version) after linking.
+	archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+	hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+	;;
+      icpc*)
+	# Intel C++
+	with_gnu_ld=yes
+	# version 8.0 and above of icpc choke on multiply defined symbols
+	# if we add $predep_objects and $postdep_objects, however 7.1 and
+	# earlier do not add the objects themselves.
+	case `$CC -V 2>&1` in
+	*"Version 7."*)
+  	  archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+  	  archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  ;;
+	*)  # Version 8.0 or newer
+	  tmp_idyn=
+	  case $host_cpu in
+	    ia64*) tmp_idyn=' -i_dynamic';;
+	  esac
+  	  archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	  archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  ;;
+	esac
+	archive_cmds_need_lc_CXX=no
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	;;
+      pgCC*)
+        # Portland Group C++ compiler
+	archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+  	archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+
+	hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+        ;;
+      cxx*)
+	# Compaq C++
+	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+	runpath_var=LD_RUN_PATH
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx*)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      hardcode_libdir_flag_spec_CXX='-R$libdir'
+      hardcode_direct_CXX=yes
+      hardcode_shlibpath_var_CXX=no
+    fi
+    # Workaround some broken pre-1.5 toolchains
+    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+    ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    ld_shlibs_CXX=no
+    ;;
+  openbsd*)
+    hardcode_direct_CXX=yes
+    hardcode_shlibpath_var_CXX=no
+    archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+      export_dynamic_flag_spec_CXX='${wl}-E'
+      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
+  osf3*)
+    case $cc_basename in
+      KCC*)
+	# Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	# KCC will only create a shared library if the output file
+	# ends with ".so" (or ".sl" for HP-UX), so rename the library
+	# to its proper name (with version) after linking.
+	archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+
+	;;
+      RCC*)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx*)
+	allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # Commands to make compiler produce verbose output that lists
+	  # what "hidden" libraries, object files and flags are used when
+	  # linking a shared library.
+	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+	else
+	  # FIXME: insert proper C++ library support
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  osf4* | osf5*)
+    case $cc_basename in
+      KCC*)
+	# Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	# KCC will only create a shared library if the output file
+	# ends with ".so" (or ".sl" for HP-UX), so rename the library
+	# to its proper name (with version) after linking.
+	archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Archives containing C++ object files must be created using
+	# the KAI C++ compiler.
+	old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
+	;;
+      RCC*)
+	# Rational C++ 2.4.1
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      cxx*)
+	allow_undefined_flag_CXX=' -expect_unresolved \*'
+	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+	  echo "-hidden">> $lib.exp~
+	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
+	  $rm $lib.exp'
+
+	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	hardcode_libdir_separator_CXX=:
+
+	# Commands to make compiler produce verbose output that lists
+	# what "hidden" libraries, object files and flags are used when
+	# linking a shared library.
+	#
+	# There doesn't appear to be a way to prevent this compiler from
+	# explicitly linking system object files so we need to strip them
+	# from the output so that they don't get included in the library
+	# dependencies.
+	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+	;;
+      *)
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	 archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+	  # Commands to make compiler produce verbose output that lists
+	  # what "hidden" libraries, object files and flags are used when
+	  # linking a shared library.
+	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+	else
+	  # FIXME: insert proper C++ library support
+	  ld_shlibs_CXX=no
+	fi
+	;;
+    esac
+    ;;
+  psos*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC*)
+	# Sun C++ 4.x
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      lcc*)
+	# Lucid
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC*)
+	# Sun C++ 4.2, 5.x and Centerline C++
+        archive_cmds_need_lc_CXX=yes
+	no_undefined_flag_CXX=' -zdefs'
+	archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	$CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+	hardcode_libdir_flag_spec_CXX='-R$libdir'
+	hardcode_shlibpath_var_CXX=no
+	case $host_os in
+	  solaris2.[0-5] | solaris2.[0-5].*) ;;
+	  *)
+	    # The C++ compiler is used as linker so we must use $wl
+	    # flag to pass the commands to the underlying system
+	    # linker. We must also pass each convience library through
+	    # to the system linker between allextract/defaultextract.
+	    # The C++ compiler will combine linker options so we
+	    # cannot just pass the convience library names through
+	    # without $wl.
+	    # Supported since Solaris 2.6 (maybe 2.5.1?)
+	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+	    ;;
+	esac
+	link_all_deplibs_CXX=yes
+
+	output_verbose_link_cmd='echo'
+
+	# Archives containing C++ object files must be created using
+	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	# necessary to make sure instantiated templates are included
+	# in the archive.
+	old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	;;
+      gcx*)
+	# Green Hills C++ Compiler
+	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+	# The C++ compiler must be used to create the archive.
+	old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	;;
+      *)
+	# GNU C++ compiler with Solaris linker
+	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	  no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+	  if $CC --version | grep -v '^2\.7' > /dev/null; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+	  else
+	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	    # platform.
+	    archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+	  fi
+
+	  hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+	fi
+	;;
+    esac
+    ;;
+  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+    no_undefined_flag_CXX='${wl}-z,text'
+    archive_cmds_need_lc_CXX=no
+    hardcode_shlibpath_var_CXX=no
+    runpath_var='LD_RUN_PATH'
+
+    case $cc_basename in
+      CC*)
+	archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      *)
+	archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+    esac
+    ;;
+  sysv5* | sco3.2v5* | sco5v6*)
+    # Note: We can NOT use -z defs as we might desire, because we do not
+    # link with -lc, and that would cause any symbols used from libc to
+    # always be unresolved, which means just about no library would
+    # ever link correctly.  If we're not using GNU ld we use -z text
+    # though, which does catch some bad symbols but isn't as heavy-handed
+    # as -z defs.
+    # For security reasons, it is highly recommended that you always
+    # use absolute paths for naming shared libraries, and exclude the
+    # DT_RUNPATH tag from executables and libraries.  But doing so
+    # requires that you compile everything twice, which is a pain.
+    # So that behaviour is only enabled if SCOABSPATH is set to a
+    # non-empty value in the environment.  Most likely only useful for
+    # creating official distributions of packages.
+    # This is a hack until libtool officially supports absolute path
+    # names for shared libraries.
+    no_undefined_flag_CXX='${wl}-z,text'
+    allow_undefined_flag_CXX='${wl}-z,nodefs'
+    archive_cmds_need_lc_CXX=no
+    hardcode_shlibpath_var_CXX=no
+    hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+    hardcode_libdir_separator_CXX=':'
+    link_all_deplibs_CXX=yes
+    export_dynamic_flag_spec_CXX='${wl}-Bexport'
+    runpath_var='LD_RUN_PATH'
+
+    case $cc_basename in
+      CC*)
+	archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      *)
+	archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+    esac
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC*)
+	# NonStop-UX NCC 3.20
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+      *)
+	# FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    ld_shlibs_CXX=no
+    ;;
+esac
+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+GCC_CXX="$GXX"
+LD_CXX="$LD"
+
+
+cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
+
+  for p in `eval $output_verbose_link_cmd`; do
+    case $p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" \
+	  || test $p = "-R"; then
+	 prev=$p
+	 continue
+       else
+	 prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 case $p in
+	 -L* | -R*)
+	   # Internal compiler library paths should come after those
+	   # provided the user.  The postdeps already come after the
+	   # user supplied libs so there is no need to process them.
+	   if test -z "$compiler_lib_search_path_CXX"; then
+	     compiler_lib_search_path_CXX="${prev}${p}"
+	   else
+	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
+	   fi
+	   ;;
+	 # The "-l" case would never come before the object being
+	 # linked, so don't bother handling this case.
+	 esac
+       else
+	 if test -z "$postdeps_CXX"; then
+	   postdeps_CXX="${prev}${p}"
+	 else
+	   postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+	 fi
+       fi
+       ;;
+
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+	 pre_test_object_deps_done=yes
+	 continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 if test -z "$predep_objects_CXX"; then
+	   predep_objects_CXX="$p"
+	 else
+	   predep_objects_CXX="$predep_objects_CXX $p"
+	 fi
+       else
+	 if test -z "$postdep_objects_CXX"; then
+	   postdep_objects_CXX="$p"
+	 else
+	   postdep_objects_CXX="$postdep_objects_CXX $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$rm -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+interix3*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  predep_objects_CXX=
+  postdep_objects_CXX=
+  postdeps_CXX=
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC*)
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    postdeps_CXX='-lCstd -lCrun'
+    ;;
+  esac
+  ;;
+esac
+
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+
+lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    lt_prog_compiler_wl_CXX='-Wl,'
+    lt_prog_compiler_static_CXX='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_CXX='-Bstatic'
+      fi
+      ;;
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+      ;;
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | os2* | pw32*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_CXX='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      lt_prog_compiler_pic_CXX=
+      ;;
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_CXX=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	;;
+      *)
+	lt_prog_compiler_pic_CXX='-fPIC'
+	;;
+      esac
+      ;;
+    *)
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix4* | aix5*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  lt_prog_compiler_static_CXX='-Bstatic'
+	else
+	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+	  ;;
+	esac
+	;;
+       darwin*)
+         # PIC is the default on this platform
+         # Common symbols not allowed in MH_DYLIB files
+         case $cc_basename in
+           xlc*)
+           lt_prog_compiler_pic_CXX='-qnocommon'
+           lt_prog_compiler_wl_CXX='-Wl,'
+           ;;
+         esac
+       ;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | kfreebsd*-gnu | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+	    if test "$host_cpu" != ia64; then
+	      lt_prog_compiler_pic_CXX='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      lt_prog_compiler_pic_CXX='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      interix*)
+	# This is c89, which is MS Visual C++ (no shared libs)
+	# Anyone wants to do a port?
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux*)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  icpc* | ecpc*)
+	    # Intel C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  pgCC*)
+	    # Portland Group C++ compiler.
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-fpic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  cxx*)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    lt_prog_compiler_pic_CXX='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    lt_prog_compiler_wl_CXX='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    lt_prog_compiler_pic_CXX='-pic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	esac
+	;;
+      vxworks*)
+	;;
+      *)
+	lt_prog_compiler_can_build_shared_CXX=no
+	;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_CXX=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:14960: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:14964: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_CXX=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6
+
+if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+    case $lt_prog_compiler_pic_CXX in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+     esac
+else
+    lt_prog_compiler_pic_CXX=
+     lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
+    ;;
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+    ;;
+esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works_CXX=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works_CXX=yes
+       fi
+     else
+       lt_prog_compiler_static_works_CXX=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6
+
+if test x"$lt_prog_compiler_static_works_CXX" = xyes; then
+    :
+else
+    lt_prog_compiler_static_CXX=
+fi
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:15064: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:15068: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $rm conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+   $rm out/* && rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    else
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    export_symbols_cmds_CXX="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  *)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+
+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_CXX=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_CXX in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_CXX
+	pic_flag=$lt_prog_compiler_pic_CXX
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+        allow_undefined_flag_CXX=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_CXX=no
+        else
+	  archive_cmds_need_lc_CXX=yes
+        fi
+        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+  else
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  freebsd*) # from 4.6 on
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext_cmds='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+interix3*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # find out which ABI we are using
+  libsuff=
+  case "$host_cpu" in
+  x86_64*|s390x*|powerpc64*)
+    echo '#line 15600 "configure"' > conftest.$ac_ext
+    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+      case `/usr/bin/file conftest.$ac_objext` in
+      *64-bit*)
+        libsuff=64
+        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+        ;;
+      esac
+    fi
+    rm -rf conftest*
+    ;;
+  esac
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+knetbsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+    shlibpath_overrides_runpath=no
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    shlibpath_overrides_runpath=yes
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" || \
+   test -n "$runpath_var_CXX" || \
+   test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_CXX" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+echo "${ECHO_T}$hardcode_action_CXX" >&6
+
+if test "$hardcode_action_CXX" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_CXX \
+    CC_CXX \
+    LD_CXX \
+    lt_prog_compiler_wl_CXX \
+    lt_prog_compiler_pic_CXX \
+    lt_prog_compiler_static_CXX \
+    lt_prog_compiler_no_builtin_flag_CXX \
+    export_dynamic_flag_spec_CXX \
+    thread_safe_flag_spec_CXX \
+    whole_archive_flag_spec_CXX \
+    enable_shared_with_static_runtimes_CXX \
+    old_archive_cmds_CXX \
+    old_archive_from_new_cmds_CXX \
+    predep_objects_CXX \
+    postdep_objects_CXX \
+    predeps_CXX \
+    postdeps_CXX \
+    compiler_lib_search_path_CXX \
+    archive_cmds_CXX \
+    archive_expsym_cmds_CXX \
+    postinstall_cmds_CXX \
+    postuninstall_cmds_CXX \
+    old_archive_from_expsyms_cmds_CXX \
+    allow_undefined_flag_CXX \
+    no_undefined_flag_CXX \
+    export_symbols_cmds_CXX \
+    hardcode_libdir_flag_spec_CXX \
+    hardcode_libdir_flag_spec_ld_CXX \
+    hardcode_libdir_separator_CXX \
+    hardcode_automatic_CXX \
+    module_cmds_CXX \
+    module_expsym_cmds_CXX \
+    lt_cv_prog_compiler_c_o_CXX \
+    exclude_expsyms_CXX \
+    include_expsyms_CXX; do
+
+    case $var in
+    old_archive_cmds_CXX | \
+    old_archive_from_new_cmds_CXX | \
+    archive_cmds_CXX | \
+    archive_expsym_cmds_CXX | \
+    module_cmds_CXX | \
+    module_expsym_cmds_CXX | \
+    old_archive_from_expsyms_cmds_CXX | \
+    export_symbols_cmds_CXX | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_CXX
+
+gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
+gcc_ver=\`gcc -dumpversion\`
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_CXX
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=\`echo $lt_predep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=\`echo $lt_postdep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_CXX"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      F77)
+	if test -n "$F77" && test "X$F77" != "Xno"; then
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+
+archive_cmds_need_lc_F77=no
+allow_undefined_flag_F77=
+always_export_symbols_F77=no
+archive_expsym_cmds_F77=
+export_dynamic_flag_spec_F77=
+hardcode_direct_F77=no
+hardcode_libdir_flag_spec_F77=
+hardcode_libdir_flag_spec_ld_F77=
+hardcode_libdir_separator_F77=
+hardcode_minus_L_F77=no
+hardcode_automatic_F77=no
+module_cmds_F77=
+module_expsym_cmds_F77=
+link_all_deplibs_F77=unknown
+old_archive_cmds_F77=$old_archive_cmds
+no_undefined_flag_F77=
+whole_archive_flag_spec_F77=
+enable_shared_with_static_runtimes_F77=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+objext_F77=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+compiler_F77=$CC
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case $host_os in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+  ;;
+esac
+echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6
+
+GCC_F77="$G77"
+LD_F77="$LD"
+
+lt_prog_compiler_wl_F77=
+lt_prog_compiler_pic_F77=
+lt_prog_compiler_static_F77=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_F77='-Wl,'
+    lt_prog_compiler_static_F77='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_F77='-fno-common'
+      ;;
+
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_F77=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_F77=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic_F77='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic_F77='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      else
+	lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic_F77='-qnocommon'
+         lt_prog_compiler_wl_F77='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic_F77='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-KPIC'
+	lt_prog_compiler_static_F77='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-fpic'
+	lt_prog_compiler_static_F77='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_F77='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_F77='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	lt_prog_compiler_wl_F77='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl_F77='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_F77='-Qoption ld '
+      lt_prog_compiler_pic_F77='-PIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic_F77='-Kconform_pic'
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_F77='-pic'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_F77"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_F77=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_F77"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:16658: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:16662: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_F77=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6
+
+if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
+    case $lt_prog_compiler_pic_F77 in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+     esac
+else
+    lt_prog_compiler_pic_F77=
+     lt_prog_compiler_can_build_shared_F77=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_F77=
+    ;;
+  *)
+    lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+    ;;
+esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works_F77=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works_F77=yes
+       fi
+     else
+       lt_prog_compiler_static_works_F77=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6
+
+if test x"$lt_prog_compiler_static_works_F77" = xyes; then
+    :
+else
+    lt_prog_compiler_static_F77=
+fi
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_F77=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:16762: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:16766: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_F77=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $rm conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+   $rm out/* && rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  runpath_var=
+  allow_undefined_flag_F77=
+  enable_shared_with_static_runtimes_F77=no
+  archive_cmds_F77=
+  archive_expsym_cmds_F77=
+  old_archive_From_new_cmds_F77=
+  old_archive_from_expsyms_cmds_F77=
+  export_dynamic_flag_spec_F77=
+  whole_archive_flag_spec_F77=
+  thread_safe_flag_spec_F77=
+  hardcode_libdir_flag_spec_F77=
+  hardcode_libdir_flag_spec_ld_F77=
+  hardcode_libdir_separator_F77=
+  hardcode_direct_F77=no
+  hardcode_minus_L_F77=no
+  hardcode_shlibpath_var_F77=unsupported
+  link_all_deplibs_F77=unknown
+  hardcode_automatic_F77=no
+  module_cmds_F77=
+  module_expsym_cmds_F77=
+  always_export_symbols_F77=no
+  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_F77=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_F77=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_F77='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+	whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_F77=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs_F77=no
+	cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+
+      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_F77=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_F77=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=no
+      enable_shared_with_static_runtimes_F77=yes
+      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    interix3*)
+      hardcode_direct_F77=no
+      hardcode_shlibpath_var_F77=no
+      hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec_F77='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	esac
+	archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_F77=no
+	cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+	ld_shlibs_F77=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	    hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+	    archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+	    archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+	  else
+	    ld_shlibs_F77=no
+	  fi
+	;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_F77" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_F77=
+      export_dynamic_flag_spec_F77=
+      whole_archive_flag_spec_F77=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=yes
+      archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L_F77=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_F77=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+	  export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
+
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# need to do runtime linking.
+	case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+	  for ld_flag in $LDFLAGS; do
+  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+  	    aix_use_runtimelinking=yes
+  	    break
+  	  fi
+	  done
+	  ;;
+	esac
+
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds_F77=''
+      hardcode_direct_F77=yes
+      hardcode_libdir_separator_F77=':'
+      link_all_deplibs_F77=yes
+
+      if test "$GCC" = yes; then
+	case $host_os in aix4.[012]|aix4.[012].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" && \
+  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
+	  then
+  	  # We have reworked collect2
+  	  hardcode_direct_F77=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct_F77=unsupported
+  	  # It fails to find uninstalled libraries when the uninstalled
+  	  # path is not listed in the libpath.  Setting hardcode_minus_L
+  	  # to unsupported forces relinking
+  	  hardcode_minus_L_F77=yes
+  	  hardcode_libdir_flag_spec_F77='-L$libdir'
+  	  hardcode_libdir_separator_F77=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+  	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='${wl}-G'
+	  else
+	    shared_flag='${wl}-bM:SRE'
+	  fi
+	fi
+      fi
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_F77=yes
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	allow_undefined_flag_F77='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_f77_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_F77="-z nodefs"
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_f77_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  no_undefined_flag_F77=' ${wl}-bernotok'
+	  allow_undefined_flag_F77=' ${wl}-berok'
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec_F77='$convenience'
+	  archive_cmds_need_lc_F77=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_F77=no
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec_F77=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec_F77=' '
+      allow_undefined_flag_F77=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_F77='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_F77=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc_F77=no
+      hardcode_direct_F77=no
+      hardcode_automatic_F77=yes
+      hardcode_shlibpath_var_F77=unsupported
+      whole_archive_flag_spec_F77=''
+      link_all_deplibs_F77=yes
+    if test "$GCC" = yes ; then
+    	output_verbose_link_cmd='echo'
+        archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_F77=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_F77=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_direct_F77=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_F77=yes
+      export_dynamic_flag_spec_F77='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_F77=:
+
+	hardcode_direct_F77=yes
+	export_dynamic_flag_spec_F77='${wl}-E'
+
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	hardcode_minus_L_F77=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      else
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_F77=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  hardcode_libdir_flag_spec_ld_F77='+b $libdir'
+	  hardcode_direct_F77=no
+	  hardcode_shlibpath_var_F77=no
+	  ;;
+	*)
+	  hardcode_direct_F77=yes
+	  export_dynamic_flag_spec_F77='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_F77=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      link_all_deplibs_F77=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    newsos6)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_F77='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec_F77='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      allow_undefined_flag_F77=unsupported
+      archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_F77='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    solaris*)
+      no_undefined_flag_F77=' -z text'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	wlarc=''
+	archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_shlibpath_var_F77=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
+      esac
+      link_all_deplibs_F77=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_F77='$CC -r -o $output$reload_objs'
+	  hardcode_direct_F77=no
+        ;;
+	motorola)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_F77=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_F77=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+      no_undefined_flag_F77='${wl}-z,text'
+      archive_cmds_need_lc_F77=no
+      hardcode_shlibpath_var_F77=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag_F77='${wl}-z,text'
+      allow_undefined_flag_F77='${wl}-z,nodefs'
+      archive_cmds_need_lc_F77=no
+      hardcode_shlibpath_var_F77=no
+      hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      hardcode_libdir_separator_F77=':'
+      link_all_deplibs_F77=yes
+      export_dynamic_flag_spec_F77='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      ld_shlibs_F77=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
+echo "${ECHO_T}$ld_shlibs_F77" >&6
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_F77" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_F77=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_F77 in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_F77
+	pic_flag=$lt_prog_compiler_pic_F77
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_F77
+        allow_undefined_flag_F77=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_F77=no
+        else
+	  archive_cmds_need_lc_F77=yes
+        fi
+        allow_undefined_flag_F77=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+  else
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  freebsd*) # from 4.6 on
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext_cmds='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+interix3*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # find out which ABI we are using
+  libsuff=
+  case "$host_cpu" in
+  x86_64*|s390x*|powerpc64*)
+    echo '#line 18211 "configure"' > conftest.$ac_ext
+    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+      case `/usr/bin/file conftest.$ac_objext` in
+      *64-bit*)
+        libsuff=64
+        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+        ;;
+      esac
+    fi
+    rm -rf conftest*
+    ;;
+  esac
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+knetbsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+    shlibpath_overrides_runpath=no
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    shlibpath_overrides_runpath=yes
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_F77=
+if test -n "$hardcode_libdir_flag_spec_F77" || \
+   test -n "$runpath_var_F77" || \
+   test "X$hardcode_automatic_F77" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_F77" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
+     test "$hardcode_minus_L_F77" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_F77=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_F77=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_F77=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
+echo "${ECHO_T}$hardcode_action_F77" >&6
+
+if test "$hardcode_action_F77" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_F77 \
+    CC_F77 \
+    LD_F77 \
+    lt_prog_compiler_wl_F77 \
+    lt_prog_compiler_pic_F77 \
+    lt_prog_compiler_static_F77 \
+    lt_prog_compiler_no_builtin_flag_F77 \
+    export_dynamic_flag_spec_F77 \
+    thread_safe_flag_spec_F77 \
+    whole_archive_flag_spec_F77 \
+    enable_shared_with_static_runtimes_F77 \
+    old_archive_cmds_F77 \
+    old_archive_from_new_cmds_F77 \
+    predep_objects_F77 \
+    postdep_objects_F77 \
+    predeps_F77 \
+    postdeps_F77 \
+    compiler_lib_search_path_F77 \
+    archive_cmds_F77 \
+    archive_expsym_cmds_F77 \
+    postinstall_cmds_F77 \
+    postuninstall_cmds_F77 \
+    old_archive_from_expsyms_cmds_F77 \
+    allow_undefined_flag_F77 \
+    no_undefined_flag_F77 \
+    export_symbols_cmds_F77 \
+    hardcode_libdir_flag_spec_F77 \
+    hardcode_libdir_flag_spec_ld_F77 \
+    hardcode_libdir_separator_F77 \
+    hardcode_automatic_F77 \
+    module_cmds_F77 \
+    module_expsym_cmds_F77 \
+    lt_cv_prog_compiler_c_o_F77 \
+    exclude_expsyms_F77 \
+    include_expsyms_F77; do
+
+    case $var in
+    old_archive_cmds_F77 | \
+    old_archive_from_new_cmds_F77 | \
+    archive_cmds_F77 | \
+    archive_expsym_cmds_F77 | \
+    module_cmds_F77 | \
+    module_expsym_cmds_F77 | \
+    old_archive_from_expsyms_cmds_F77 | \
+    export_symbols_cmds_F77 | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_F77
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_compiler_F77
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_F77
+
+gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
+gcc_ver=\`gcc -dumpversion\`
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_F77
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_F77
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_F77
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_F77
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_F77
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_F77
+archive_expsym_cmds=$lt_archive_expsym_cmds_F77
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_F77
+module_expsym_cmds=$lt_module_expsym_cmds_F77
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=\`echo $lt_predep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=\`echo $lt_postdep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_F77
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_F77
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_F77
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_F77
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_F77
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_F77
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_F77
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_F77"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_F77
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_F77
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_F77
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_F77
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      GCJ)
+	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+
+
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+objext_GCJ=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+compiler_GCJ=$CC
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+archive_cmds_need_lc_GCJ=no
+
+old_archive_cmds_GCJ=$old_archive_cmds
+
+
+lt_prog_compiler_no_builtin_flag_GCJ=
+
+if test "$GCC" = yes; then
+  lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:18989: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:18993: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+lt_prog_compiler_wl_GCJ=
+lt_prog_compiler_pic_GCJ=
+lt_prog_compiler_static_GCJ=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_GCJ='-Wl,'
+    lt_prog_compiler_static_GCJ='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_GCJ='-fno-common'
+      ;;
+
+    interix3*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_GCJ=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_GCJ=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic_GCJ='-fPIC'
+	;;
+      esac
+      ;;
+
+    *)
+      lt_prog_compiler_pic_GCJ='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      else
+	lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         lt_prog_compiler_pic_GCJ='-qnocommon'
+         lt_prog_compiler_wl_GCJ='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic_GCJ='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+	lt_prog_compiler_wl_GCJ='-Wl,'
+	lt_prog_compiler_pic_GCJ='-KPIC'
+	lt_prog_compiler_static_GCJ='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl_GCJ='-Wl,'
+	lt_prog_compiler_pic_GCJ='-fpic'
+	lt_prog_compiler_static_GCJ='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_GCJ='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_GCJ='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_GCJ='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	lt_prog_compiler_wl_GCJ='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl_GCJ='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_GCJ='-Qoption ld '
+      lt_prog_compiler_pic_GCJ='-PIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic_GCJ='-Kconform_pic'
+	lt_prog_compiler_static_GCJ='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_pic_GCJ='-KPIC'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_GCJ='-Wl,'
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_GCJ='-pic'
+      lt_prog_compiler_static_GCJ='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_GCJ=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_GCJ"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_pic_works_GCJ=no
+  ac_outfile=conftest.$ac_objext
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:19257: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:19261: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_prog_compiler_pic_works_GCJ=yes
+     fi
+   fi
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6
+
+if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
+    case $lt_prog_compiler_pic_GCJ in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
+     esac
+else
+    lt_prog_compiler_pic_GCJ=
+     lt_prog_compiler_can_build_shared_GCJ=no
+fi
+
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_GCJ=
+    ;;
+  *)
+    lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
+    ;;
+esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_prog_compiler_static_works_GCJ=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_prog_compiler_static_works_GCJ=yes
+       fi
+     else
+       lt_prog_compiler_static_works_GCJ=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6
+
+if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then
+    :
+else
+    lt_prog_compiler_static_GCJ=
+fi
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  lt_cv_prog_compiler_c_o_GCJ=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:19361: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:19365: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_GCJ=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $rm conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+   $rm out/* && rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+  if test "$hard_links" = no; then
+    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+  runpath_var=
+  allow_undefined_flag_GCJ=
+  enable_shared_with_static_runtimes_GCJ=no
+  archive_cmds_GCJ=
+  archive_expsym_cmds_GCJ=
+  old_archive_From_new_cmds_GCJ=
+  old_archive_from_expsyms_cmds_GCJ=
+  export_dynamic_flag_spec_GCJ=
+  whole_archive_flag_spec_GCJ=
+  thread_safe_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_GCJ=
+  hardcode_libdir_flag_spec_ld_GCJ=
+  hardcode_libdir_separator_GCJ=
+  hardcode_direct_GCJ=no
+  hardcode_minus_L_GCJ=no
+  hardcode_shlibpath_var_GCJ=unsupported
+  link_all_deplibs_GCJ=unknown
+  hardcode_automatic_GCJ=no
+  module_cmds_GCJ=
+  module_expsym_cmds_GCJ=
+  always_export_symbols_GCJ=no
+  export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_GCJ=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_GCJ=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
+    export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+	whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+  	whole_archive_flag_spec_GCJ=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs_GCJ=no
+	cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+
+      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      ld_shlibs_GCJ=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_GCJ=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=no
+      enable_shared_with_static_runtimes_GCJ=yes
+      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    interix3*)
+      hardcode_direct_GCJ=no
+      hardcode_shlibpath_var_GCJ=no
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec_GCJ='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	tmp_addflag=
+	case $cc_basename,$host_cpu in
+	pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	esac
+	archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+	if test $supports_anon_versioning = yes; then
+	  archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	fi
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_GCJ=no
+	cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+	ld_shlibs_GCJ=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	    hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+	    archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+	    archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+	  else
+	    ld_shlibs_GCJ=no
+	  fi
+	;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_GCJ=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_GCJ" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_GCJ=
+      export_dynamic_flag_spec_GCJ=
+      whole_archive_flag_spec_GCJ=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_GCJ=unsupported
+      always_export_symbols_GCJ=yes
+      archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L_GCJ=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_GCJ=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+	  export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
+
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# need to do runtime linking.
+	case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+	  for ld_flag in $LDFLAGS; do
+  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+  	    aix_use_runtimelinking=yes
+  	    break
+  	  fi
+	  done
+	  ;;
+	esac
+
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds_GCJ=''
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_separator_GCJ=':'
+      link_all_deplibs_GCJ=yes
+
+      if test "$GCC" = yes; then
+	case $host_os in aix4.[012]|aix4.[012].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" && \
+  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
+	  then
+  	  # We have reworked collect2
+  	  hardcode_direct_GCJ=yes
+	  else
+  	  # We have old collect2
+  	  hardcode_direct_GCJ=unsupported
+  	  # It fails to find uninstalled libraries when the uninstalled
+  	  # path is not listed in the libpath.  Setting hardcode_minus_L
+  	  # to unsupported forces relinking
+  	  hardcode_minus_L_GCJ=yes
+  	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
+  	  hardcode_libdir_separator_GCJ=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+  	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='${wl}-G'
+	  else
+	    shared_flag='${wl}-bM:SRE'
+	  fi
+	fi
+      fi
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_GCJ=yes
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	allow_undefined_flag_GCJ='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+       hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+	archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_GCJ="-z nodefs"
+	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an empty executable.
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  no_undefined_flag_GCJ=' ${wl}-bernotok'
+	  allow_undefined_flag_GCJ=' ${wl}-berok'
+	  # Exported symbols can be pulled into shared objects from archives
+	  whole_archive_flag_spec_GCJ='$convenience'
+	  archive_cmds_need_lc_GCJ=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs_GCJ=no
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec_GCJ=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec_GCJ=' '
+      allow_undefined_flag_GCJ=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_From_new_cmds_GCJ='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes_GCJ=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[012])
+         allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[012])
+               allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      archive_cmds_need_lc_GCJ=no
+      hardcode_direct_GCJ=no
+      hardcode_automatic_GCJ=yes
+      hardcode_shlibpath_var_GCJ=unsupported
+      whole_archive_flag_spec_GCJ=''
+      link_all_deplibs_GCJ=yes
+    if test "$GCC" = yes ; then
+    	output_verbose_link_cmd='echo'
+        archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         ld_shlibs_GCJ=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_GCJ=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_direct_GCJ=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_GCJ=yes
+      export_dynamic_flag_spec_GCJ='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_GCJ=:
+
+	hardcode_direct_GCJ=yes
+	export_dynamic_flag_spec_GCJ='${wl}-E'
+
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	hardcode_minus_L_GCJ=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      else
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_GCJ=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
+	  hardcode_direct_GCJ=no
+	  hardcode_shlibpath_var_GCJ=no
+	  ;;
+	*)
+	  hardcode_direct_GCJ=yes
+	  export_dynamic_flag_spec_GCJ='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_GCJ=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      link_all_deplibs_GCJ=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+	archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    newsos6)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_GCJ=yes
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    openbsd*)
+      hardcode_direct_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_GCJ='${wl}-E'
+      else
+       case $host_os in
+	 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	   archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	   hardcode_libdir_flag_spec_GCJ='-R$libdir'
+	   ;;
+	 *)
+	   archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	   hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+	   ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_minus_L_GCJ=yes
+      allow_undefined_flag_GCJ=unsupported
+      archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag_GCJ=' -expect_unresolved \*'
+	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_GCJ=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag_GCJ=' -expect_unresolved \*'
+	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
+      fi
+      hardcode_libdir_separator_GCJ=:
+      ;;
+
+    solaris*)
+      no_undefined_flag_GCJ=' -z text'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+	wlarc=''
+	archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-R$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+ 	# The compiler driver will combine linker options so we
+ 	# cannot just pass the convience library names through
+ 	# without $wl, iff we do not link with $LD.
+ 	# Luckily, gcc supports the same syntax we need for Sun Studio.
+ 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+ 	case $wlarc in
+ 	'')
+ 	  whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
+ 	*)
+ 	  whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ 	esac ;;
+      esac
+      link_all_deplibs_GCJ=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_direct_GCJ=yes
+      hardcode_minus_L_GCJ=yes
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_GCJ=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_GCJ='$CC -r -o $output$reload_objs'
+	  hardcode_direct_GCJ=no
+        ;;
+	motorola)
+	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_GCJ=no
+      export_dynamic_flag_spec_GCJ='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_GCJ=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_GCJ=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+      no_undefined_flag_GCJ='${wl}-z,text'
+      archive_cmds_need_lc_GCJ=no
+      hardcode_shlibpath_var_GCJ=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag_GCJ='${wl}-z,text'
+      allow_undefined_flag_GCJ='${wl}-z,nodefs'
+      archive_cmds_need_lc_GCJ=no
+      hardcode_shlibpath_var_GCJ=no
+      hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      hardcode_libdir_separator_GCJ=':'
+      link_all_deplibs_GCJ=yes
+      export_dynamic_flag_spec_GCJ='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_GCJ='-L$libdir'
+      hardcode_shlibpath_var_GCJ=no
+      ;;
+
+    *)
+      ld_shlibs_GCJ=no
+      ;;
+    esac
+  fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
+echo "${ECHO_T}$ld_shlibs_GCJ" >&6
+test "$ld_shlibs_GCJ" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_GCJ" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_GCJ=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_GCJ in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$lt_prog_compiler_wl_GCJ
+	pic_flag=$lt_prog_compiler_pic_GCJ
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
+        allow_undefined_flag_GCJ=
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+        then
+	  archive_cmds_need_lc_GCJ=no
+        else
+	  archive_cmds_need_lc_GCJ=yes
+        fi
+        allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+  else
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+  fi
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+kfreebsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  freebsd*) # from 4.6 on
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+   hppa*64*)
+     shrext_cmds='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+interix3*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # find out which ABI we are using
+  libsuff=
+  case "$host_cpu" in
+  x86_64*|s390x*|powerpc64*)
+    echo '#line 20846 "configure"' > conftest.$ac_ext
+    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+      case `/usr/bin/file conftest.$ac_objext` in
+      *64-bit*)
+        libsuff=64
+        sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+        ;;
+      esac
+    fi
+    rm -rf conftest*
+    ;;
+  esac
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+knetbsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+    shlibpath_overrides_runpath=no
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    shlibpath_overrides_runpath=yes
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_GCJ=
+if test -n "$hardcode_libdir_flag_spec_GCJ" || \
+   test -n "$runpath_var_GCJ" || \
+   test "X$hardcode_automatic_GCJ" = "Xyes" ; then
+
+  # We can hardcode non-existant directories.
+  if test "$hardcode_direct_GCJ" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
+     test "$hardcode_minus_L_GCJ" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_GCJ=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_GCJ=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_GCJ=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
+echo "${ECHO_T}$hardcode_action_GCJ" >&6
+
+if test "$hardcode_action_GCJ" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_GCJ \
+    CC_GCJ \
+    LD_GCJ \
+    lt_prog_compiler_wl_GCJ \
+    lt_prog_compiler_pic_GCJ \
+    lt_prog_compiler_static_GCJ \
+    lt_prog_compiler_no_builtin_flag_GCJ \
+    export_dynamic_flag_spec_GCJ \
+    thread_safe_flag_spec_GCJ \
+    whole_archive_flag_spec_GCJ \
+    enable_shared_with_static_runtimes_GCJ \
+    old_archive_cmds_GCJ \
+    old_archive_from_new_cmds_GCJ \
+    predep_objects_GCJ \
+    postdep_objects_GCJ \
+    predeps_GCJ \
+    postdeps_GCJ \
+    compiler_lib_search_path_GCJ \
+    archive_cmds_GCJ \
+    archive_expsym_cmds_GCJ \
+    postinstall_cmds_GCJ \
+    postuninstall_cmds_GCJ \
+    old_archive_from_expsyms_cmds_GCJ \
+    allow_undefined_flag_GCJ \
+    no_undefined_flag_GCJ \
+    export_symbols_cmds_GCJ \
+    hardcode_libdir_flag_spec_GCJ \
+    hardcode_libdir_flag_spec_ld_GCJ \
+    hardcode_libdir_separator_GCJ \
+    hardcode_automatic_GCJ \
+    module_cmds_GCJ \
+    module_expsym_cmds_GCJ \
+    lt_cv_prog_compiler_c_o_GCJ \
+    exclude_expsyms_GCJ \
+    include_expsyms_GCJ; do
+
+    case $var in
+    old_archive_cmds_GCJ | \
+    old_archive_from_new_cmds_GCJ | \
+    archive_cmds_GCJ | \
+    archive_expsym_cmds_GCJ | \
+    module_cmds_GCJ | \
+    module_expsym_cmds_GCJ | \
+    old_archive_from_expsyms_cmds_GCJ | \
+    export_symbols_cmds_GCJ | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_GCJ
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_compiler_GCJ
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_GCJ
+
+gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
+gcc_ver=\`gcc -dumpversion\`
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_GCJ
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_GCJ
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_GCJ
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_GCJ
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_GCJ
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_GCJ
+archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_GCJ
+module_expsym_cmds=$lt_module_expsym_cmds_GCJ
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=\`echo $lt_predep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=\`echo $lt_postdep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_GCJ
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_GCJ
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_GCJ
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_GCJ
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_GCJ
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_GCJ
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_GCJ
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_GCJ
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_GCJ"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_GCJ
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_GCJ
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_GCJ
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_GCJ
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	else
+	  tagname=""
+	fi
+	;;
+
+      RC)
+
+
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+objext_RC=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+compiler_RC=$CC
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+lt_cv_prog_compiler_c_o_RC=yes
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    compiler_RC \
+    CC_RC \
+    LD_RC \
+    lt_prog_compiler_wl_RC \
+    lt_prog_compiler_pic_RC \
+    lt_prog_compiler_static_RC \
+    lt_prog_compiler_no_builtin_flag_RC \
+    export_dynamic_flag_spec_RC \
+    thread_safe_flag_spec_RC \
+    whole_archive_flag_spec_RC \
+    enable_shared_with_static_runtimes_RC \
+    old_archive_cmds_RC \
+    old_archive_from_new_cmds_RC \
+    predep_objects_RC \
+    postdep_objects_RC \
+    predeps_RC \
+    postdeps_RC \
+    compiler_lib_search_path_RC \
+    archive_cmds_RC \
+    archive_expsym_cmds_RC \
+    postinstall_cmds_RC \
+    postuninstall_cmds_RC \
+    old_archive_from_expsyms_cmds_RC \
+    allow_undefined_flag_RC \
+    no_undefined_flag_RC \
+    export_symbols_cmds_RC \
+    hardcode_libdir_flag_spec_RC \
+    hardcode_libdir_flag_spec_ld_RC \
+    hardcode_libdir_separator_RC \
+    hardcode_automatic_RC \
+    module_cmds_RC \
+    module_expsym_cmds_RC \
+    lt_cv_prog_compiler_c_o_RC \
+    exclude_expsyms_RC \
+    include_expsyms_RC; do
+
+    case $var in
+    old_archive_cmds_RC | \
+    old_archive_from_new_cmds_RC | \
+    archive_cmds_RC | \
+    archive_expsym_cmds_RC | \
+    module_cmds_RC | \
+    module_expsym_cmds_RC | \
+    old_archive_from_expsyms_cmds_RC | \
+    export_symbols_cmds_RC | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
+    esac
+  done
+
+  case $lt_echo in
+  *'\$0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    ;;
+  esac
+
+cfgfile="$ofile"
+
+  cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_RC
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_compiler_RC
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_RC
+
+gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
+gcc_ver=\`gcc -dumpversion\`
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_RC
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_RC
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_RC
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_RC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_RC
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_RC
+archive_expsym_cmds=$lt_archive_expsym_cmds_RC
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_RC
+module_expsym_cmds=$lt_module_expsym_cmds_RC
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=\`echo $lt_predep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=\`echo $lt_postdep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_RC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_RC
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_RC
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_RC
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_RC
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_RC
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_RC
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_RC
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_RC"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_RC
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_RC
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_RC
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_RC
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+  # If there is no Makefile yet, we rely on a make rule to execute
+  # `config.status --recheck' to rerun these tests and create the
+  # libtool script then.
+  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+  if test -f "$ltmain_in"; then
+    test -f Makefile && make "$ltmain"
+  fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+	;;
+
+      *)
+	{ { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
+echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
+   { (exit 1); exit 1; }; }
+	;;
+      esac
+
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
+  else
+    rm -f "${ofile}T"
+    { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
+echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Prevent multiple expansion
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#LT_INIT([disable-shared])
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+acx_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        echo "$as_me:$LINENO: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5
+echo $ECHO_N "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... $ECHO_C" >&6
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char pthread_join ();
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+pthread_join ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  acx_pthread_ok=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+        echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5
+echo "${ECHO_T}$acx_pthread_ok" >&6
+        if test x"$acx_pthread_ok" = xno; then
+                PTHREAD_LIBS=""
+                PTHREAD_CFLAGS=""
+        fi
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try.  Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all.
+
+#acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt"
+acx_pthread_flags="pthreads none -Kthread -kthread lthread pthread -pthread -pthreads -mthreads pthread --thread-safe -mt"
+
+# The ordering *is* (sometimes) important.  Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+#       other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+#      doesn't hurt to check since this sometimes defines pthreads too;
+#      also defines -D_REENTRANT)
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+
+case "${host_cpu}-${host_os}" in
+        *solaris*)
+
+        # On Solaris (at least, for some versions), libc contains stubbed
+        # (non-functional) versions of the pthreads routines, so link-based
+        # tests will erroneously succeed.  (We need to link with -pthread or
+        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
+        # a function called by this macro, so we could check for that, but
+        # who knows whether they'll stub that too in a future libc.)  So,
+        # we'll just look for -pthreads and -lpthread first:
+
+        acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
+        ;;
+esac
+
+if test x"$acx_pthread_ok" = xno; then
+for flag in $acx_pthread_flags; do
+
+        case $flag in
+                none)
+                echo "$as_me:$LINENO: checking whether pthreads work without any flags" >&5
+echo $ECHO_N "checking whether pthreads work without any flags... $ECHO_C" >&6
+                ;;
+
+                -*)
+                echo "$as_me:$LINENO: checking whether pthreads work with $flag" >&5
+echo $ECHO_N "checking whether pthreads work with $flag... $ECHO_C" >&6
+                PTHREAD_CFLAGS="$flag"
+                ;;
+
+                *)
+                echo "$as_me:$LINENO: checking for the pthreads library -l$flag" >&5
+echo $ECHO_N "checking for the pthreads library -l$flag... $ECHO_C" >&6
+                PTHREAD_LIBS="-l$flag"
+                ;;
+        esac
+
+        save_LIBS="$LIBS"
+        save_CFLAGS="$CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Check for various functions.  We must include pthread.h,
+        # since some functions may be macros.  (On the Sequent, we
+        # need a special flag -Kthread to make this header compile.)
+        # We check for pthread_join because it is in -lpthread on IRIX
+        # while pthread_create is in libc.  We check for pthread_attr_init
+        # due to DEC craziness with -lpthreads.  We check for
+        # pthread_cleanup_push because it is one of the few pthread
+        # functions on Solaris that doesn't have a non-functional libc stub.
+        # We try pthread_create on general principles.
+	                                	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <pthread.h>
+		     void *start(void *arg){return NULL;}
+
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+pthread_attr_t attr;
+		     pthread_t th;
+		     pthread_join(th, 0);
+		     pthread_attr_init(&attr);
+		     pthread_cleanup_push(NULL, NULL);
+		     pthread_create(&th,&attr,start,0);
+		     pthread_cleanup_pop(0);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  acx_pthread_ok=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5
+echo "${ECHO_T}$acx_pthread_ok" >&6
+        if test "x$acx_pthread_ok" = xyes; then
+                break;
+        fi
+
+        PTHREAD_LIBS=""
+        PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$acx_pthread_ok" = xyes; then
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Detect AIX lossage: threads are created detached by default
+        # and the JOINABLE attribute has a nonstandard name (UNDETACHED).
+        echo "$as_me:$LINENO: checking for joinable pthread attribute" >&5
+echo $ECHO_N "checking for joinable pthread attribute... $ECHO_C" >&6
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <pthread.h>
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+int attr; attr=PTHREAD_CREATE_JOINABLE;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ok=PTHREAD_CREATE_JOINABLE
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ok=unknown
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+        if test x"$ok" = xunknown; then
+                cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <pthread.h>
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+int attr; attr=PTHREAD_CREATE_UNDETACHED;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ok=PTHREAD_CREATE_UNDETACHED
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ok=unknown
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+        fi
+        if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then
+
+cat >>confdefs.h <<\_ACEOF
+#define PTHREAD_CREATE_JOINABLE $ok
+_ACEOF
+
+        fi
+        echo "$as_me:$LINENO: result: ${ok}" >&5
+echo "${ECHO_T}${ok}" >&6
+        if test x"$ok" = xunknown; then
+                { echo "$as_me:$LINENO: WARNING: we do not know how to create joinable pthreads" >&5
+echo "$as_me: WARNING: we do not know how to create joinable pthreads" >&2;}
+        fi
+
+        echo "$as_me:$LINENO: checking if more special flags are required for pthreads" >&5
+echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6
+        flag=no
+        case "${host_cpu}-${host_os}" in
+                *-aix* | *-freebsd*)     flag="-D_THREAD_SAFE";;
+                *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+        esac
+        echo "$as_me:$LINENO: result: ${flag}" >&5
+echo "${ECHO_T}${flag}" >&6
+        if test "x$flag" != xno; then
+                PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+        fi
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        # More AIX lossage: must compile with cc_r
+        # Extract the first word of "cc_r", so it can be a program name with args.
+set dummy cc_r; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_PTHREAD_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$PTHREAD_CC"; then
+  ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_PTHREAD_CC="cc_r"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_PTHREAD_CC" && ac_cv_prog_PTHREAD_CC="${CC}"
+fi
+fi
+PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
+if test -n "$PTHREAD_CC"; then
+  echo "$as_me:$LINENO: result: $PTHREAD_CC" >&5
+echo "${ECHO_T}$PTHREAD_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+else
+        PTHREAD_CC="$CC"
+fi
+
+
+
+
+
+if test x"$acx_pthread_ok" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PTHREAD 1
+_ACEOF
+
+fi
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$acx_pthread_ok" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PTHREAD 1
+_ACEOF
+
+        :
+else
+        acx_pthread_ok=no
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+if true; then
+  HAVE_MXML_TRUE=
+  HAVE_MXML_FALSE='#'
+else
+  HAVE_MXML_TRUE='#'
+  HAVE_MXML_FALSE=
+fi
+
+
+
+# Check whether --with-mxml or --without-mxml was given.
+if test "${with_mxml+set}" = set; then
+  withval="$with_mxml"
+  MXML_LDFLAGS="-L$withval/lib";
+         MXML_CPPFLAGS="-I$withval/include";
+fi;
+
+save_CPPFLAGS="$CPPFLAGS"
+save_LIBS="$LIBS"
+save_LDFLAGS="$LDFLAGS"
+LIBS="$LIBS -lmxml"
+if test -n "$MXML_LDFLAGS"; then
+    LDFLAGS="$LDFLAGS $MXML_LDFLAGS"
+elif test -n "$MXML_LIB"; then
+    LDFLAGS="$LDFLAGS $MXML_LIB"
+    MXML_LDFLAGS="$MXML_LIB"
+fi
+if test -n "$MXML_CPPFLAGS"; then
+    CPPFLAGS="$CPPFLAGS $MXML_CPPFLAGS"
+elif test -n "$MXML_INC"; then
+    CPPFLAGS="$CPPFLAGS $MXML_INC"
+    MXML_CPPFLAGS="$MXML_INC"
+fi
+
+if test -z "${HAVE_MXML_TRUE}"; then
+
+for ac_header in mxml.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+
+
+if false; then
+  HAVE_MXML_TRUE=
+  HAVE_MXML_FALSE='#'
+else
+  HAVE_MXML_TRUE='#'
+  HAVE_MXML_FALSE=
+fi
+
+fi
+
+done
+
+fi
+
+if test -z "${HAVE_MXML_TRUE}"; then
+    # Check for the Mini-XML library and headers
+    echo "$as_me:$LINENO: checking if mxml code can be linked" >&5
+echo $ECHO_N "checking if mxml code can be linked... $ECHO_C" >&6
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include "mxml.h"
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+mxml_node_t * n;
+         char *buffer;
+         char *value;
+         n = mxmlLoadString (0, buffer, MXML_TEXT_CALLBACK);
+         mxmlWalkNext (n, n, MXML_DESCEND);
+         value = mxmlElementGetAttr (n, "value");
+         mxmlRelease (n);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  MXML_LIBS="-lmxml"
+         echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+if false; then
+  HAVE_MXML_TRUE=
+  HAVE_MXML_FALSE='#'
+else
+  HAVE_MXML_TRUE='#'
+  HAVE_MXML_FALSE=
+fi
+
+         echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+
+            if test -z "${HAVE_MXML_FALSE}"; then
+        # Check for the Mini-XML library and headers
+
+        LDFLAGS="$LDFLAGS $PTHREAD_LDFLAGS $PTHREAD_LIBS"
+        echo "$as_me:$LINENO: checking if mxml code can be linked using pthreads" >&5
+echo $ECHO_N "checking if mxml code can be linked using pthreads... $ECHO_C" >&6
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include "mxml.h"
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+mxml_node_t * n;
+             char *buffer;
+             char *value;
+             n = mxmlLoadString (0, buffer, MXML_TEXT_CALLBACK);
+             mxmlWalkNext (n, n, MXML_DESCEND);
+             value = mxmlElementGetAttr (n, "value");
+             mxmlRelease (n);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  MXML_LDFLAGS="$MXML_LDFLAGS $PTHREAD_LDFLAGS"
+             MXML_LIBS="-lmxml $PTHREAD_LIBS"
+
+
+if true; then
+  HAVE_MXML_TRUE=
+  HAVE_MXML_FALSE='#'
+else
+  HAVE_MXML_TRUE='#'
+  HAVE_MXML_FALSE=
+fi
+
+             echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+if false; then
+  HAVE_MXML_TRUE=
+  HAVE_MXML_FALSE='#'
+else
+  HAVE_MXML_TRUE='#'
+  HAVE_MXML_FALSE=
+fi
+
+             echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+    fi
+fi
+
+
+LIBS="$save_LIBS"
+LDFLAGS="$save_LDFLAGS"
+CPPFLAGS="$save_CPPFLAGS"
+
+
+
+
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test -z "${HAVE_MXML_TRUE}"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MXML 1
+_ACEOF
+
+        :
+else
+
+        :
+fi
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_infiniband_hdr_ok=no
+ac_infiniband_lib_ok=no
+ac_with_infiniband=no
+
+
+INFINIBAND_CFLAGS=""
+INFINIBAND_CPPFLAGS=""
+INFINIBAND_LDFLAGS=""
+INFINIBAND_LIBS=""
+
+
+# Check whether --with-infiniband or --without-infiniband was given.
+if test "${with_infiniband+set}" = set; then
+  withval="$with_infiniband"
+   ac_with_infiniband=yes;
+fi;
+
+
+
+if test x"$withval" = xno; then
+
+        ac_with_infiniband=no;
+
+elif test x"$withval" = xyes -o x"$withval" = x; then
+
+        INFINIBAND_CPPFLAGS="";
+        INFINIBAND_LDFLAGS="";
+        ac_with_infiniband=yes;
+
+else
+
+        INFINIBAND_CPPFLAGS="-I$withval/include";
+        INFINIBAND_LDFLAGS="-L$withval/lib64 -L$withval/lib";
+        ac_with_infiniband=yes;
+
+fi
+
+
+
+if test x$ac_with_infiniband = xyes; then
+  HAVE_INFINIBAND_TRUE=
+  HAVE_INFINIBAND_FALSE='#'
+else
+  HAVE_INFINIBAND_TRUE='#'
+  HAVE_INFINIBAND_FALSE=
+fi
+
+
+
+if test x"$ac_with_infiniband" = xyes; then
+
+                save_CPPFLAGS=$CPPFLAGS;
+        CPPFLAGS="$CPPFLAGS $INFINIBAND_CPPFLAGS"
+        LDFLAGS="$LDFLAGS $INFINIBAND_LDFLAGS"
+
+
+        if test x"$ac_infiniband_hdr_ok" = xno; then
+                if test "${ac_cv_header_infiniband_verbs_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for infiniband/verbs.h" >&5
+echo $ECHO_N "checking for infiniband/verbs.h... $ECHO_C" >&6
+if test "${ac_cv_header_infiniband_verbs_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_infiniband_verbs_h" >&5
+echo "${ECHO_T}$ac_cv_header_infiniband_verbs_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking infiniband/verbs.h usability" >&5
+echo $ECHO_N "checking infiniband/verbs.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <infiniband/verbs.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking infiniband/verbs.h presence" >&5
+echo $ECHO_N "checking infiniband/verbs.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <infiniband/verbs.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: infiniband/verbs.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: infiniband/verbs.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: infiniband/verbs.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: infiniband/verbs.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: infiniband/verbs.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: infiniband/verbs.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: infiniband/verbs.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: infiniband/verbs.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: infiniband/verbs.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: infiniband/verbs.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: infiniband/verbs.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: infiniband/verbs.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: infiniband/verbs.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: infiniband/verbs.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: infiniband/verbs.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: infiniband/verbs.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for infiniband/verbs.h" >&5
+echo $ECHO_N "checking for infiniband/verbs.h... $ECHO_C" >&6
+if test "${ac_cv_header_infiniband_verbs_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_infiniband_verbs_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_infiniband_verbs_h" >&5
+echo "${ECHO_T}$ac_cv_header_infiniband_verbs_h" >&6
+
+fi
+if test $ac_cv_header_infiniband_verbs_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_IBVERBS_H 1
+_ACEOF
+
+                         ac_infiniband_hdr_ok=yes;
+                         INFINIBAND_CFLAGS="$INFINIBAND_CFLAGS $EXTRA_CFLAGS";
+                         INFINIBAND_CPPFLAGS="$INFINIBAND_CPPFLAGS $EXTRA_CFLAGS"
+else
+  ac_infiniband_hdr_ok=no
+fi
+
+
+        fi
+
+        if test x"$ac_infiniband_hdr_ok" = xno; then
+                CPPFLAGS=$save_CPPFLAGS
+        fi
+
+                if test x"$ac_infiniband_lib_ok" = xno -a x$ac_infiniband_hdr_ok = xyes; then
+            save_LIBS=$LIBS;
+            LIBS=""
+            echo "$as_me:$LINENO: checking for library containing ibv_alloc_pd" >&5
+echo $ECHO_N "checking for library containing ibv_alloc_pd... $ECHO_C" >&6
+if test "${ac_cv_search_ibv_alloc_pd+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+ac_cv_search_ibv_alloc_pd=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char ibv_alloc_pd ();
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+ibv_alloc_pd ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_search_ibv_alloc_pd="none required"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_ibv_alloc_pd" = no; then
+  for ac_lib in ibverbs; do
+    LIBS="-l$ac_lib $save_LIBS $PTHREAD_LDFLAGS $PTHREAD_LIBS $ac_func_search_save_LIBS"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char ibv_alloc_pd ();
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+ibv_alloc_pd ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_search_ibv_alloc_pd="-l$ac_lib"
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+  done
+fi
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_ibv_alloc_pd" >&5
+echo "${ECHO_T}$ac_cv_search_ibv_alloc_pd" >&6
+if test "$ac_cv_search_ibv_alloc_pd" != no; then
+  test "$ac_cv_search_ibv_alloc_pd" = "none required" || LIBS="$ac_cv_search_ibv_alloc_pd $LIBS"
+  ac_infiniband_lib_ok=yes
+else
+  ac_infiniband_lib_ok=no
+fi
+
+            if test -n $LIBS; then
+                INFINIBAND_LIBS="$INFINIBAND_LIBS $LIBS";
+            fi
+            LIBS=$save_LIBS;
+        fi
+
+        if test x"$ac_infiniband_hdr_ok" = xno -o x$ac_infiniband_lib_ok = xno; then
+
+
+if false; then
+  HAVE_INFINIBAND_TRUE=
+  HAVE_INFINIBAND_FALSE='#'
+else
+  HAVE_INFINIBAND_TRUE='#'
+  HAVE_INFINIBAND_FALSE=
+fi
+
+            INFINIBAND_CFLAGS=""
+            INFINIBAND_CPPFLAGS=""
+            INFINIBAND_LDFLAGS=""
+            INFINIBAND_LIBS=""
+            ac_with_infiniband=no
+        else
+
+
+if true; then
+  HAVE_INFINIBAND_TRUE=
+  HAVE_INFINIBAND_FALSE='#'
+else
+  HAVE_INFINIBAND_TRUE='#'
+  HAVE_INFINIBAND_FALSE=
+fi
+
+        fi
+
+
+
+
+
+
+
+
+
+        # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+        if test x"$ac_infiniband_lib_ok" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_INFINIBAND 1
+_ACEOF
+
+                :
+        else
+
+                :
+        fi
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_portals_hdr_ok=no
+ac_portals_lib_ok=no
+ac_with_portals=no
+
+
+
+if true; then
+  HAVE_PORTALS_TRUE=
+  HAVE_PORTALS_FALSE='#'
+else
+  HAVE_PORTALS_TRUE='#'
+  HAVE_PORTALS_FALSE=
+fi
+
+
+
+if false; then
+  NEED_DARWIN_SINGLE_MODULE_TRUE=
+  NEED_DARWIN_SINGLE_MODULE_FALSE='#'
+else
+  NEED_DARWIN_SINGLE_MODULE_TRUE='#'
+  NEED_DARWIN_SINGLE_MODULE_FALSE=
+fi
+
+
+PORTALS_CFLAGS=""
+PORTALS_CPPFLAGS=""
+PORTALS_LDFLAGS=""
+PORTALS_LIBS=""
+
+
+
+# Check whether --with-portals or --without-portals was given.
+if test "${with_portals+set}" = set; then
+  withval="$with_portals"
+   ac_with_portals=yes;
+fi;
+
+if test x"$withval" = xno; then
+
+
+
+if false; then
+  HAVE_PORTALS_TRUE=
+  HAVE_PORTALS_FALSE='#'
+else
+  HAVE_PORTALS_TRUE='#'
+  HAVE_PORTALS_FALSE=
+fi
+
+        ac_with_portals=no;
+
+elif test x"$withval" = xyes -o x"$withval" = x; then
+
+        PORTALS_LDFLAGS="";
+        PORTALS_CPPFLAGS="";
+        ac_with_portals=yes;
+
+else
+
+        PORTALS_LDFLAGS="-L$withval/lib";
+        PORTALS_CPPFLAGS="-I$withval/include";
+        ac_with_portals=yes;
+
+fi
+
+if test x"$ac_with_portals" = xyes; then
+
+                save_CPPFLAGS=$CPPFLAGS;
+        CPPFLAGS="$CPPFLAGS $PORTALS_CPPFLAGS"
+        LDFLAGS="$LDFLAGS $PORTALS_LDFLAGS"
+
+
+
+        if test x"$ac_portals_hdr_ok" = xno; then
+                if test "${ac_cv_header_portals3_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for portals3.h" >&5
+echo $ECHO_N "checking for portals3.h... $ECHO_C" >&6
+if test "${ac_cv_header_portals3_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_portals3_h" >&5
+echo "${ECHO_T}$ac_cv_header_portals3_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking portals3.h usability" >&5
+echo $ECHO_N "checking portals3.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <portals3.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking portals3.h presence" >&5
+echo $ECHO_N "checking portals3.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <portals3.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: portals3.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: portals3.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: portals3.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: portals3.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: portals3.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: portals3.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: portals3.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: portals3.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: portals3.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: portals3.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: portals3.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: portals3.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: portals3.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: portals3.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: portals3.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: portals3.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for portals3.h" >&5
+echo $ECHO_N "checking for portals3.h... $ECHO_C" >&6
+if test "${ac_cv_header_portals3_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_portals3_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_portals3_h" >&5
+echo "${ECHO_T}$ac_cv_header_portals3_h" >&6
+
+fi
+if test $ac_cv_header_portals3_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PORTALS3_H 1
+_ACEOF
+
+                         ac_portals_hdr_ok=yes;
+                         PORTALS_CFLAGS="$PORTALS_CFLAGS $EXTRA_CFLAGS";
+                         PORTALS_CPPFLAGS="$PORTALS_CPPFLAGS $EXTRA_CFLAGS"
+else
+  ac_portals_hdr_ok=no
+fi
+
+
+        fi
+
+        if test x"$ac_portals_hdr_ok" = xno; then
+                if test "${ac_cv_header_portals_portals3_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for portals/portals3.h" >&5
+echo $ECHO_N "checking for portals/portals3.h... $ECHO_C" >&6
+if test "${ac_cv_header_portals_portals3_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_portals_portals3_h" >&5
+echo "${ECHO_T}$ac_cv_header_portals_portals3_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking portals/portals3.h usability" >&5
+echo $ECHO_N "checking portals/portals3.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <portals/portals3.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking portals/portals3.h presence" >&5
+echo $ECHO_N "checking portals/portals3.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <portals/portals3.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: portals/portals3.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: portals/portals3.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: portals/portals3.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: portals/portals3.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: portals/portals3.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: portals/portals3.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: portals/portals3.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: portals/portals3.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: portals/portals3.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: portals/portals3.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: portals/portals3.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: portals/portals3.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: portals/portals3.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: portals/portals3.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: portals/portals3.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: portals/portals3.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for portals/portals3.h" >&5
+echo $ECHO_N "checking for portals/portals3.h... $ECHO_C" >&6
+if test "${ac_cv_header_portals_portals3_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_portals_portals3_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_portals_portals3_h" >&5
+echo "${ECHO_T}$ac_cv_header_portals_portals3_h" >&6
+
+fi
+if test $ac_cv_header_portals_portals3_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PORTALS_PORTALS3_H 1
+_ACEOF
+
+                          ac_portals_hdr_ok=yes;
+                         PORTALS_CFLAGS="$PORTALS_CFLAGS $EXTRA_CFLAGS";
+                         PORTALS_CPPFLAGS="$PORTALS_CPPFLAGS $EXTRA_CFLAGS"
+else
+  ac_portals_hdr_ok=no
+fi
+
+
+        fi
+
+
+
+for ac_header in p3nal_utcp.h p3rt/p3rt.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+                        #if defined(HAVE_PORTALS3_H)
+                         #include <portals3.h>
+                         #elif defined(HAVE_PORTALS_PORTALS3_H)
+                         #include <portals/portals3.h>
+                         #endif
+
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+        if test x"$ac_portals_hdr_ok" = xno; then
+                CPPFLAGS=$save_CPPFLAGS
+        fi
+
+
+                if test x"$ac_portals_lib_ok" = xno -a x$ac_portals_hdr_ok = xyes; then
+            save_LIBS=$LIBS;
+            LIBS=""
+            echo "$as_me:$LINENO: checking for library containing PtlInit" >&5
+echo $ECHO_N "checking for library containing PtlInit... $ECHO_C" >&6
+if test "${ac_cv_search_PtlInit+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+ac_cv_search_PtlInit=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char PtlInit ();
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+PtlInit ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_search_PtlInit="none required"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_PtlInit" = no; then
+  for ac_lib in portals; do
+    LIBS="-l$ac_lib $save_LIBS $PTHREAD_LDFLAGS $PTHREAD_LIBS $ac_func_search_save_LIBS"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char PtlInit ();
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+PtlInit ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_search_PtlInit="-l$ac_lib"
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+  done
+fi
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_PtlInit" >&5
+echo "${ECHO_T}$ac_cv_search_PtlInit" >&6
+if test "$ac_cv_search_PtlInit" != no; then
+  test "$ac_cv_search_PtlInit" = "none required" || LIBS="$ac_cv_search_PtlInit $LIBS"
+  ac_portals_lib_ok=yes
+else
+  ac_portals_lib_ok=no
+fi
+
+            if test -n $LIBS; then
+                PORTALS_LIBS=$LIBS;
+            fi
+            LIBS=$save_LIBS;
+        fi
+
+                        if test x"$ac_portals_lib_ok" = xno -a x$ac_portals_hdr_ok = xyes; then
+            save_LIBS=$LIBS;
+            save_LDFLAGS=$LDFLAGS;
+            save_CFLAGS=$CFLAGS;
+
+            extra_LIBS="-lp3api -lp3lib -lp3rt -lp3utcp"
+
+
+            LDFLAGS="$LDFLAGS $PORTALS_LDFLAGS"
+            LIBS="$LIBS $extra_LIBS $PTHREAD_LIBS"
+            CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+            echo "$as_me:$LINENO: checking if portals links with $LDFLAGS $LIBS" >&5
+echo $ECHO_N "checking if portals links with $LDFLAGS $LIBS... $ECHO_C" >&6
+
+            cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char PtlInit ();
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+PtlInit ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  PORTALS_LIBS=$extra_LIBS;
+                        ac_portals_lib_ok=yes;
+                        echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_portals_lib_ok=no;
+                         echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+
+            LIBS=$save_LIBS;
+            LDFLAGS=$save_LDFLAGS;
+            CDFLAGS=$save_CFLAGS;
+        fi
+
+                if test x"$ac_portals_lib_ok" = xyes; then
+
+            ac_portals_flags="none ${PTHREAD_CFLAGS} ${PTHREAD_LIBS}"
+            ac_portals_lib_ok=no
+
+            for flag in $ac_portals_flags; do
+
+                case $flag in
+                    none)
+                        echo "$as_me:$LINENO: checking whether portals works without any additional flags" >&5
+echo $ECHO_N "checking whether portals works without any additional flags... $ECHO_C" >&6
+                    ;;
+
+                    -l*)
+                        echo "$as_me:$LINENO: checking whether portals works with library $flag" >&5
+echo $ECHO_N "checking whether portals works with library $flag... $ECHO_C" >&6
+                        EXTRA_LIBS="$flag"
+                        ;;
+
+                    -*)
+                        echo "$as_me:$LINENO: checking whether portals works with library -l$flag" >&5
+echo $ECHO_N "checking whether portals works with library -l$flag... $ECHO_C" >&6
+                        EXTRA_LIBS="$flag"
+                        ;;
+                esac
+
+                save_LIBS="$LIBS"
+                save_CFLAGS="$CFLAGS"
+                save_CPPFLAGS="$CPPFLAGS"
+                save_LDFLAGS="$LDFLAGS"
+
+                LIBS="$LIBS $PORTALS_LIBS $EXTRA_LIBS"
+                CFLAGS="$CFLAGS $PORTALS_CFLAGS $EXTRA_CFLAGS"
+                CPPFLAGS="$CPPFLAGS $PORTALS_CPPFLAGS"
+                LDFLAGS="$LDFLAGS $PORTALS_LDFLAGS"
+
+                                cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char PtlInit ();
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+PtlInit ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  PORTALS_CFLAGS="$PORTALS_CFLAGS $EXTRA_CFLAGS";
+                        PORTALS_CPPFLAGS="$PORTALS_CPPFLAGS $EXTRA_CPPFLAGS";
+                        PORTALS_LIBS="$PORTALS_LIBS $EXTRA_LIBS";
+                        ac_portals_lib_ok=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_portals_lib_ok=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+                echo "$as_me:$LINENO: result: $ac_portals_lib_ok" >&5
+echo "${ECHO_T}$ac_portals_lib_ok" >&6
+
+                if test "x$ac_portals_lib_ok" = xyes; then
+                        PORTALS_LIBS="$PORTALS_LIBS $EXTRA_LIBS";
+                        PORTALS_CFLAGS="$PORTALS_CFLAGS $EXTRA_CFLAGS";
+                        PORTALS_CPPFLAGS="$PORTALS_CPPFLAGS $EXTRA_CFLAGS";
+                        if test `uname -s` = "Darwin"; then
+
+
+if true; then
+  NEED_DARWIN_SINGLE_MODULE_TRUE=
+  NEED_DARWIN_SINGLE_MODULE_FALSE='#'
+else
+  NEED_DARWIN_SINGLE_MODULE_TRUE='#'
+  NEED_DARWIN_SINGLE_MODULE_FALSE=
+fi
+
+                        fi
+                fi
+
+
+                                LIBS="$save_LIBS"
+                CFLAGS="$save_CFLAGS"
+                CPPFLAGS="$save_CPPFLAGS"
+                LDFLAGS="$save_LDFLAGS"
+
+            done
+        fi
+
+
+        if test x"$ac_portals_hdr_ok" = xno -o x$ac_portals_lib_ok = xno; then
+
+
+if false; then
+  HAVE_PORTALS_TRUE=
+  HAVE_PORTALS_FALSE='#'
+else
+  HAVE_PORTALS_TRUE='#'
+  HAVE_PORTALS_FALSE=
+fi
+
+            PORTALS_CFLAGS=""
+            PORTALS_CPPFLAGS=""
+            PORTALS_LDFLAGS=""
+            PORTALS_LIBS=""
+        else
+            ac_portals_lib_ok=yes;
+
+
+if true; then
+  HAVE_PORTALS_TRUE=
+  HAVE_PORTALS_FALSE='#'
+else
+  HAVE_PORTALS_TRUE='#'
+  HAVE_PORTALS_FALSE=
+fi
+
+        fi
+
+
+
+                if test x"$ac_portals_lib_ok" = xyes; then
+
+                save_CFLAGS=$CFLAGS
+                save_CPPFLAGS=$CPPFLAGS
+                save_LDFLAGS=$LDFLAGS
+                save_LIBS=$LIBS
+
+                CFLAGS="$CFLAGS $PORTALS_CFLAGS"
+                CPPFLAGS="$CPPFLAGS $PORTALS_CPPFLAGS"
+                LDFLAGS="$LDFLAGS $PORTALS_LDFLAGS"
+                LIBS="$LIBS $PORTALS_LIBS"
+
+                                echo "$as_me:$LINENO: checking whether portals uses PTL_NO_ACK_REQ" >&5
+echo $ECHO_N "checking whether portals uses PTL_NO_ACK_REQ... $ECHO_C" >&6
+                cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#if defined(HAVE_PORTALS3_H)
+                         #include <portals3.h>
+                         #elif defined(HAVE_PORTALS_PORTALS3_H)
+                         #include <portals/portals3.h>
+                         #else
+                         #error Cound not find include file
+                         #endif
+
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+int a = PTL_NO_ACK_REQ;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  # Success
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PTL_NO_ACK_REQ 1
+_ACEOF
+
+                  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+                  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+                  echo "$as_me:$LINENO: checking whether portals uses PTL_NOACK_REQ" >&5
+echo $ECHO_N "checking whether portals uses PTL_NOACK_REQ... $ECHO_C" >&6
+                  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#if defined(HAVE_PORTALS3_H)
+                               #include <portals3.h>
+                               #elif defined(HAVE_PORTALS_PORTALS3_H)
+                               #include <portals/portals3.h>
+                               #else
+                               #error Cound not find include file
+                               #endif
+
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+int a = PTL_NOACK_REQ;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  # Success
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PTL_NOACK_REQ 1
+_ACEOF
+
+                        echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+                        echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+
+                echo "$as_me:$LINENO: checking for ptl_time_t" >&5
+echo $ECHO_N "checking for ptl_time_t... $ECHO_C" >&6
+if test "${ac_cv_type_ptl_time_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#if defined(HAVE_PORTALS3_H)
+                         #include <portals3.h>
+                         #elif defined(HAVE_PORTALS_PORTALS3_H)
+                         #include <portals/portals3.h>
+                         #endif
+
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+if ((ptl_time_t *) 0)
+  return 0;
+if (sizeof (ptl_time_t))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_ptl_time_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_ptl_time_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_ptl_time_t" >&5
+echo "${ECHO_T}$ac_cv_type_ptl_time_t" >&6
+if test $ac_cv_type_ptl_time_t = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_PTL_TIME_T 1
+_ACEOF
+
+
+fi
+echo "$as_me:$LINENO: checking for ptl_eq_handler_t" >&5
+echo $ECHO_N "checking for ptl_eq_handler_t... $ECHO_C" >&6
+if test "${ac_cv_type_ptl_eq_handler_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#if defined(HAVE_PORTALS3_H)
+                         #include <portals3.h>
+                         #elif defined(HAVE_PORTALS_PORTALS3_H)
+                         #include <portals/portals3.h>
+                         #endif
+
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+if ((ptl_eq_handler_t *) 0)
+  return 0;
+if (sizeof (ptl_eq_handler_t))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_ptl_eq_handler_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_ptl_eq_handler_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_ptl_eq_handler_t" >&5
+echo "${ECHO_T}$ac_cv_type_ptl_eq_handler_t" >&6
+if test $ac_cv_type_ptl_eq_handler_t = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_PTL_EQ_HANDLER_T 1
+_ACEOF
+
+
+fi
+
+
+
+
+
+
+
+for ac_func in PtlErrorStr \
+                        PtlNIFailStr \
+                        PtlEventKindStr \
+                        PtlGetJid \
+                        PtlACEntry
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+                CFLAGS=$save_CFLAGS
+                CPPFLAGS=$save_CPPFLAGS
+                LDFLAGS=$save_LDFLAGS
+                LIBS=$save_LIBS
+        fi
+
+
+        # This is a big hack.  This is fragile.  Try to determine if we are
+        # using Cray Portals.  Cray Portals generates more data movement
+        # events than Schutt (standard) Portals.  This requires a memory
+        # descriptor threshold adjustment.  Cannot be determined at runtime.
+        #
+        # This test relies on a priori knowledge of specific types and
+        # functions that are (un)defined.  If this list changes, this
+        # test will quickly crumble.
+        #
+        if test x"$ac_cv_func_PtlErrorStr" = xno -a \
+                x"$ac_cv_type_ptl_eq_handler_t" = xyes -a \
+                x"$ac_cv_func_PtlNIFailStr" = xno -a \
+                x"$ac_cv_func_PtlEventKindStr" = xno -a \
+                x"$ac_cv_func_PtlGetJid" = xyes -a \
+                x"$ac_cv_func_PtlACEntry" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_CRAY_PORTALS 1
+_ACEOF
+
+        fi
+
+
+
+
+
+
+
+
+
+
+        # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+        if test x"$ac_portals_lib_ok" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PORTALS 1
+_ACEOF
+
+                :
+        else
+
+                :
+        fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+{ echo "$as_me:$LINENO: === checking for HDF5 ===" >&5
+echo "$as_me: === checking for HDF5 ===" >&6;}
+
+
+
+if true; then
+  HAVE_HDF5_TRUE=
+  HAVE_HDF5_FALSE='#'
+else
+  HAVE_HDF5_TRUE='#'
+  HAVE_HDF5_FALSE=
+fi
+
+
+
+# Check whether --with-hdf5 or --without-hdf5 was given.
+if test "${with_hdf5+set}" = set; then
+  withval="$with_hdf5"
+  HDF5_DIR=$withval
+else
+  with_hdf5=no
+fi;
+
+
+# Check whether --with-hdf5-incdir or --without-hdf5-incdir was given.
+if test "${with_hdf5_incdir+set}" = set; then
+  withval="$with_hdf5_incdir"
+  HDF5_INCDIR=$withval
+             with_hdf5=detailed
+fi;
+
+
+# Check whether --with-hdf5-libdir or --without-hdf5-libdir was given.
+if test "${with_hdf5_libdir+set}" = set; then
+  withval="$with_hdf5_libdir"
+  HDF5_LIBDIR=$withval
+              with_hdf5=detailed
+fi;
+
+
+# Check whether --with-hdf5-libs or --without-hdf5-libs was given.
+if test "${with_hdf5_libs+set}" = set; then
+  withval="$with_hdf5_libs"
+  HDF5_LIBS=$withval
+              with_hdf5=detailed
+fi;
+
+
+if test "x$with_hdf5" == "xno"; then
+
+
+
+if false; then
+  HAVE_HDF5_TRUE=
+  HAVE_HDF5_FALSE='#'
+else
+  HAVE_HDF5_TRUE='#'
+  HAVE_HDF5_FALSE=
+fi
+
+
+else
+
+            if test -z "${HDF5_INCDIR}"; then
+        if test -n "${HDF5_DIR}"; then
+            HDF5_INCDIR="${HDF5_DIR}/include";
+        fi
+    fi
+
+            if test -z "${HDF5_LIBDIR}"; then
+        if test -n "${HDF5_DIR}"; then
+            HDF5_LIBDIR="${HDF5_DIR}/lib";
+        fi
+    fi
+
+        HDF5_CPPFLAGS="-I${HDF5_INCDIR}"
+
+        HDF5_LDFLAGS="-L${HDF5_LIBDIR}"
+
+        if test -z "${HDF5_LIBS}"; then
+                HDF5_LIBS="-lhdf5 -lz"
+    fi
+
+    save_CC="$CC"
+    save_CPPFLAGS="$CPPFLAGS"
+    save_LIBS="$LIBS"
+    save_LDFLAGS="$LDFLAGS"
+    LIBS="$LIBS $HDF5_LIBS"
+    LDFLAGS="$LDFLAGS $HDF5_LDFLAGS"
+    CPPFLAGS="$CPPFLAGS $HDF5_CPPFLAGS"
+    CC="$MPICC"
+
+    if test -z "${HAVE_HDF5_TRUE}"; then
+                                                        echo "$as_me:$LINENO: checking for hdf5.h" >&5
+echo $ECHO_N "checking for hdf5.h... $ECHO_C" >&6
+        if test -f ${HDF5_INCDIR}/hdf5.h; then
+            echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+        else
+
+
+if false; then
+  HAVE_HDF5_TRUE=
+  HAVE_HDF5_FALSE='#'
+else
+  HAVE_HDF5_TRUE='#'
+  HAVE_HDF5_FALSE=
+fi
+
+            echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+            { { echo "$as_me:$LINENO: error: --with-hdf5 was given, but test for ${HDF5_INCDIR}/hdf5.h failed
+See \`config.log' for more details." >&5
+echo "$as_me: error: --with-hdf5 was given, but test for ${HDF5_INCDIR}/hdf5.h failed
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+        fi
+    fi
+
+    if test -z "${HAVE_HDF5_TRUE}"; then
+        echo "$as_me:$LINENO: checking if hdf5 code can be compiled" >&5
+echo $ECHO_N "checking if hdf5 code can be compiled... $ECHO_C" >&6
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include "hdf5.h"
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+hid_t file_id;
+             herr_t status;
+             file_id = H5Fcreate("a.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+             status = H5Fclose(file_id);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+             if test "x$with_hdf5" != xcheck; then
+                { { echo "$as_me:$LINENO: error: --with-hdf5 was given, but compile test failed
+See \`config.log' for more details." >&5
+echo "$as_me: error: --with-hdf5 was given, but compile test failed
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+             fi
+
+
+if false; then
+  HAVE_HDF5_TRUE=
+  HAVE_HDF5_FALSE='#'
+else
+  HAVE_HDF5_TRUE='#'
+  HAVE_HDF5_FALSE=
+fi
+
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+
+
+    fi
+
+    LIBS="$save_LIBS"
+    LDFLAGS="$save_LDFLAGS"
+    CPPFLAGS="$save_CPPFLAGS"
+    CC="$save_CC"
+
+    # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+    if test -z "${HAVE_HDF5_TRUE}"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_HDF5 1
+_ACEOF
+
+            :
+    else
+
+            :
+    fi
+
+fi
+
+
+
+{ echo "$as_me:$LINENO: === checking for Parallel HDF5 ===" >&5
+echo "$as_me: === checking for Parallel HDF5 ===" >&6;}
+
+
+
+if true; then
+  HAVE_PHDF5_TRUE=
+  HAVE_PHDF5_FALSE='#'
+else
+  HAVE_PHDF5_TRUE='#'
+  HAVE_PHDF5_FALSE=
+fi
+
+
+
+# Check whether --with-phdf5 or --without-phdf5 was given.
+if test "${with_phdf5+set}" = set; then
+  withval="$with_phdf5"
+  PHDF5_DIR=$withval
+else
+  with_phdf5=check
+fi;
+
+
+
+# Check whether --with-phdf5-incdir or --without-phdf5-incdir was given.
+if test "${with_phdf5_incdir+set}" = set; then
+  withval="$with_phdf5_incdir"
+  PHDF5_INCDIR=$withval
+    with_phdf5=detailed
+fi;
+
+
+# Check whether --with-phdf5-libdir or --without-phdf5-libdir was given.
+if test "${with_phdf5_libdir+set}" = set; then
+  withval="$with_phdf5_libdir"
+  PHDF5_LIBDIR=$withval
+    with_phdf5=detailed
+fi;
+
+
+# Check whether --with-phdf5-libs or --without-phdf5-libs was given.
+if test "${with_phdf5_libs+set}" = set; then
+  withval="$with_phdf5_libs"
+  PHDF5_LIBS=$withval
+    with_phdf5=detailed
+fi;
+
+if test "x$with_phdf5" == "xno"; then
+
+
+
+if false; then
+  HAVE_PHDF5_TRUE=
+  HAVE_PHDF5_FALSE='#'
+else
+  HAVE_PHDF5_TRUE='#'
+  HAVE_PHDF5_FALSE=
+fi
+
+
+else
+
+    ac_use_cray_hdf5=no
+                if test -z "${PHDF5_INCDIR}"; then
+        if test -n "${CRAY_HDF5_DIR}"; then
+            PHDF5_INCDIR="";
+            ac_use_cray_hdf5=yes
+        elif test -n "${PHDF5_DIR}"; then
+            PHDF5_INCDIR="${PHDF5_DIR}/include";
+                    else
+            ac_phdf5_ok=no
+        fi
+    fi
+
+                if test -z "${PHDF5_LIBDIR}"; then
+        if test -n "${CRAY_HDF5_DIR}"; then
+            PHDF5_LIBDIR="";
+            ac_use_cray_hdf5=yes
+        elif test -n "${PHDF5_DIR}"; then
+            PHDF5_LIBDIR="${PHDF5_DIR}/lib";
+                    else
+            ac_phdf5_ok=no
+        fi
+    fi
+
+    if test -n "${PHDF5_INCDIR}"; then
+                PHDF5_CPPFLAGS="-I${PHDF5_INCDIR}"
+    else
+        ac_use_cray_hdf5=no
+    fi
+
+    if test -n "${PHDF5_LIBDIR}"; then
+                PHDF5_LDFLAGS="-L${PHDF5_LIBDIR}"
+    else
+        ac_use_cray_hdf5=no
+    fi
+
+
+        if test -z "${PHDF5_LIBS}"; then
+        if test "${ac_use_cray_hdf5}" != "yes"; then
+                        PHDF5_LIBS="-lhdf5_hl -lhdf5 -lz"
+        else
+            { echo "$as_me:$LINENO: Environment CRAY_HDF5_DIR defined, so we use Cray's settings" >&5
+echo "$as_me: Environment CRAY_HDF5_DIR defined, so we use Cray's settings" >&6;}
+        fi
+    fi
+
+    save_CC="$CC"
+    save_CPPFLAGS="$CPPFLAGS"
+    save_LIBS="$LIBS"
+    save_LDFLAGS="$LDFLAGS"
+    LIBS="$LIBS $PHDF5_LIBS"
+    LDFLAGS="$LDFLAGS $PHDF5_LDFLAGS"
+    CPPFLAGS="$CPPFLAGS $PHDF5_CPPFLAGS"
+    CC="$MPICC"
+
+
+    if test -z "${HAVE_PHDF5_TRUE}"; then
+
+for ac_header in hdf5.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+
+
+if false; then
+  HAVE_PHDF5_TRUE=
+  HAVE_PHDF5_FALSE='#'
+else
+  HAVE_PHDF5_TRUE='#'
+  HAVE_PHDF5_FALSE=
+fi
+
+fi
+
+done
+
+    fi
+
+    if test -z "${HAVE_PHDF5_TRUE}"; then
+        echo "$as_me:$LINENO: checking if phdf5 code can be compiled" >&5
+echo $ECHO_N "checking if phdf5 code can be compiled... $ECHO_C" >&6
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include "hdf5.h"
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+hid_t file_id;
+             herr_t status;
+#ifdef H5_HAVE_PARALLEL
+             file_id = H5Fcreate("a.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+             status = H5Fclose(file_id);
+#else
+             /* This must deliberately fail */
+             file_id = THE_HDF5_INSTALLATION_FOUND_IS_NOT_PARALLEL_HDF5
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+
+if false; then
+  HAVE_PHDF5_TRUE=
+  HAVE_PHDF5_FALSE='#'
+else
+  HAVE_PHDF5_TRUE='#'
+  HAVE_PHDF5_FALSE=
+fi
+
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+
+
+    fi
+
+    LIBS="$save_LIBS"
+    LDFLAGS="$save_LDFLAGS"
+    CPPFLAGS="$save_CPPFLAGS"
+    CC="$save_CC"
+
+    # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+    if test -z "${HAVE_PHDF5_TRUE}"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PHDF5 1
+_ACEOF
+
+            :
+    else
+
+            :
+    fi
+
+fi
+
+
+
+{ echo "$as_me:$LINENO: === checking for NetCDF ===" >&5
+echo "$as_me: === checking for NetCDF ===" >&6;}
+
+
+
+if true; then
+  HAVE_NETCDF_TRUE=
+  HAVE_NETCDF_FALSE='#'
+else
+  HAVE_NETCDF_TRUE='#'
+  HAVE_NETCDF_FALSE=
+fi
+
+
+
+# Check whether --with-netcdf or --without-netcdf was given.
+if test "${with_netcdf+set}" = set; then
+  withval="$with_netcdf"
+  NETCDF_DIR=$withval
+else
+  with_netcdf=check
+fi;
+
+if test "x$with_netcdf" == "xno"; then
+
+
+
+if false; then
+  HAVE_NETCDF_TRUE=
+  HAVE_NETCDF_FALSE='#'
+else
+  HAVE_NETCDF_TRUE='#'
+  HAVE_NETCDF_FALSE=
+fi
+
+
+else
+
+    ac_use_cray_netcdf=no
+
+
+# Check whether --with-netcdf-incdir or --without-netcdf-incdir was given.
+if test "${with_netcdf_incdir+set}" = set; then
+  withval="$with_netcdf_incdir"
+  NETCDF_INCDIR=$withval
+                 with_netcdf=detailed
+fi;
+
+
+# Check whether --with-netcdf-libdir or --without-netcdf-libdir was given.
+if test "${with_netcdf_libdir+set}" = set; then
+  withval="$with_netcdf_libdir"
+  NETCDF_LIBDIR=$withval
+                 with_netcdf=detailed
+fi;
+
+
+# Check whether --with-netcdf-libs or --without-netcdf-libs was given.
+if test "${with_netcdf_libs+set}" = set; then
+  withval="$with_netcdf_libs"
+  NETCDF_LIBS=$withval
+                 with_netcdf=detailed
+fi;
+
+                    if test -z "${NETCDF_INCDIR}"; then
+        if test -n "${NETCDF_DIR}"; then
+            NETCDF_INCDIR="${NETCDF_DIR}/include";
+        elif test -n "${CRAY_NETCDF_DIR}"; then
+            NETCDF_INCDIR="";
+            ac_use_cray_netcdf=yes
+        elif test -n "${NETCDF}" -a -d "${NETCDF}"; then
+            NETCDF_INCDIR="${NETCDF}/include"
+        fi
+    fi
+
+                    if test -z "${NETCDF_LIBDIR}"; then
+        if test -n "${NETCDF_DIR}"; then
+            NETCDF_LIBDIR="${NETCDF_DIR}/lib";
+        elif test -n "${CRAY_NETCDF_DIR}"; then
+            NETCDF_LIBDIR="";
+            ac_use_cray_netcdf=yes
+        elif test -n "${NETCDF}" -a -d "${NETCDF}"; then
+            NETCDF_LIBDIR="${NETCDF}/lib"
+        fi
+    fi
+
+        if test -n "${NETCDF_INCDIR}"; then
+            NETCDF_CPPFLAGS="-I${NETCDF_INCDIR}"
+    else
+            ac_netcdf_ok=no
+    fi
+
+        if test -n "${NETCDF_LIBDIR}"; then
+            NETCDF_LDFLAGS="-L${NETCDF_LIBDIR}"
+    else
+            ac_netcdf_ok=no
+    fi
+
+        if test -z "${NETCDF_LIBS}"; then
+        if test "${ac_use_cray_netcdf}" != "yes"; then
+            NETCDF_LIBS="-lnetcdf"
+        fi
+    fi
+
+    save_CPPFLAGS="$CPPFLAGS"
+    save_LIBS="$LIBS"
+    save_LDFLAGS="$LDFLAGS"
+    LIBS="$LIBS $NETCDF_LDFLAGS"
+    LDFLAGS="$LDFLAGS $NETCDF_LDFLAGS"
+    CPPFLAGS="$CPPFLAGS $NETCDF_CPPFLAGS"
+
+    if test -z "${HAVE_NETCDF_TRUE}"; then
+
+for ac_header in netcdf.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  if test "x$with_netcdf" != xcheck; then
+              { { echo "$as_me:$LINENO: error: --with-netcdf was given, but test for netcdf.h failed
+See \`config.log' for more details." >&5
+echo "$as_me: error: --with-netcdf was given, but test for netcdf.h failed
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+            fi
+
+
+if false; then
+  HAVE_NETCDF_TRUE=
+  HAVE_NETCDF_FALSE='#'
+else
+  HAVE_NETCDF_TRUE='#'
+  HAVE_NETCDF_FALSE=
+fi
+
+fi
+
+done
+
+    fi
+
+    if test -z "${HAVE_NETCDF_TRUE}"; then
+        echo "$as_me:$LINENO: checking if netcdf code can be compiled" >&5
+echo $ECHO_N "checking if netcdf code can be compiled... $ECHO_C" >&6
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include "netcdf.h"
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+int ncid;
+             nc_create("a.nc", NC_CLOBBER, &ncid);
+             nc_close(ncid);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+             if test "x$with_netcdf" != xcheck; then
+                 { { echo "$as_me:$LINENO: error: --with-netcdf was given, but compile test failed
+See \`config.log' for more details." >&5
+echo "$as_me: error: --with-netcdf was given, but compile test failed
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+             fi
+
+
+if false; then
+  HAVE_NETCDF_TRUE=
+  HAVE_NETCDF_FALSE='#'
+else
+  HAVE_NETCDF_TRUE='#'
+  HAVE_NETCDF_FALSE=
+fi
+
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+
+
+    fi
+
+    LIBS="$save_LIBS"
+    LDFLAGS="$save_LDFLAGS"
+    CPPFLAGS="$save_CPPFLAGS"
+
+    # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+    if test -z "${HAVE_NETCDF_TRUE}"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_NETCDF 1
+_ACEOF
+
+            :
+    else
+
+            :
+    fi
+
+fi
+
+
+
+{ echo "$as_me:$LINENO: === checking NetCDF 4 Parallel ===" >&5
+echo "$as_me: === checking NetCDF 4 Parallel ===" >&6;}
+
+
+
+if true; then
+  HAVE_NC4PAR_TRUE=
+  HAVE_NC4PAR_FALSE='#'
+else
+  HAVE_NC4PAR_TRUE='#'
+  HAVE_NC4PAR_FALSE=
+fi
+
+
+
+# Check whether --with-nc4par or --without-nc4par was given.
+if test "${with_nc4par+set}" = set; then
+  withval="$with_nc4par"
+  NC4PAR_DIR=$withval
+else
+  with_nc4par=check
+fi;
+
+if test "x$with_nc4par" == "xno"; then
+
+
+
+if false; then
+  HAVE_NC4PAR_TRUE=
+  HAVE_NC4PAR_FALSE='#'
+else
+  HAVE_NC4PAR_TRUE='#'
+  HAVE_NC4PAR_FALSE=
+fi
+
+
+else
+
+    ac_use_cray_netcdf=no
+
+
+# Check whether --with-nc4par-incdir or --without-nc4par-incdir was given.
+if test "${with_nc4par_incdir+set}" = set; then
+  withval="$with_nc4par_incdir"
+  NC4PAR_INCDIR=$withval
+                 with_nc4par=detailed
+fi;
+
+
+# Check whether --with-nc4par-libdir or --without-nc4par-libdir was given.
+if test "${with_nc4par_libdir+set}" = set; then
+  withval="$with_nc4par_libdir"
+  NC4PAR_LIBDIR=$withval
+                 with_nc4par=detailed
+fi;
+
+
+# Check whether --with-nc4par-libs or --without-nc4par-libs was given.
+if test "${with_nc4par_libs+set}" = set; then
+  withval="$with_nc4par_libs"
+  NC4PAR_LIBS=$withval
+                 with_nc4par=detailed
+fi;
+
+
+                    if test -z "${NC4PAR_INCDIR}"; then
+        if test -n "${NC4PAR_DIR}"; then
+            NC4PAR_INCDIR="${NC4PAR_DIR}/include";
+        elif test -n "${CRAY_NETCDF_DIR}"; then
+            NC4PAR_INCDIR="";
+            ac_use_cray_netcdf=yes
+        elif test -n "${NETCDF_DIR}"; then
+            NC4PAR_INCDIR="${NETCDF_DIR}/include";
+        fi
+    fi
+
+                    if test -z "${NC4PAR_LIBDIR}"; then
+        if test -n "${NC4PAR_DIR}"; then
+            NC4PAR_LIBDIR="${NC4PAR_DIR}/lib";
+        elif test -n "${CRAY_NETCDF_DIR}"; then
+            NC4PAR_LIBDIR="";
+            ac_use_cray_netcdf=yes
+        elif test -n "${NETCDF_DIR}"; then
+            NC4PAR_LIBDIR="${NETCDF_DIR}/lib"
+        fi
+    fi
+
+        if test -n "${NC4PAR_INCDIR}"; then
+            NC4PAR_CPPFLAGS="-I${NC4PAR_INCDIR}"
+    else
+            ac_nc4par=no
+    fi
+
+        if test -n "${NC4PAR_LIBDIR}"; then
+            NC4PAR_LDFLAGS="-L${NC4PAR_LIBDIR}"
+    else
+            ac_nc4par=no
+    fi
+
+        if test -z "${NC4PAR_LIBS}"; then
+        if test "${ac_use_cray_netcdf}" != "yes"; then
+            NC4PAR_LIBS="-lnetcdf"
+        fi
+    fi
+
+    save_CPPFLAGS="$CPPFLAGS"
+    save_LIBS="$LIBS"
+    save_LDFLAGS="$LDFLAGS"
+    LIBS="$LIBS $NC4PAR_LIBS"
+    LDFLAGS="$LDFLAGS $NC4PAR_LDFLAGS"
+    CPPFLAGS="$CPPFLAGS $NC4PAR_CPPFLAGS"
+
+    if test -z "${HAVE_NC4PAR_TRUE}"; then
+
+for ac_header in netcdf.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  if test "x$with_nc4par" != xcheck; then
+              { { echo "$as_me:$LINENO: error: --with-nc4par was given, but test for netcdf.h failed
+See \`config.log' for more details." >&5
+echo "$as_me: error: --with-nc4par was given, but test for netcdf.h failed
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+            fi
+
+
+if false; then
+  HAVE_NC4PAR_TRUE=
+  HAVE_NC4PAR_FALSE='#'
+else
+  HAVE_NC4PAR_TRUE='#'
+  HAVE_NC4PAR_FALSE=
+fi
+
+fi
+
+done
+
+    fi
+
+    if test -z "${HAVE_NC4PAR_TRUE}"; then
+        echo "$as_me:$LINENO: checking if nc4 parallel code can be compiled" >&5
+echo $ECHO_N "checking if nc4 parallel code can be compiled... $ECHO_C" >&6
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include "netcdf.h"
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+int ncid;
+             MPI_Info info;
+             MPI_Comm comm;
+             nc_create_par("a.nc", NC_NOCLOBBER|NC_MPIIO|NC_NETCDF4, comm, info, ncid);
+             nc_close(ncid);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+             if test "x$with_nc4par" != xcheck; then
+                 { { echo "$as_me:$LINENO: error: --with-nc4par was given, but compile test failed
+See \`config.log' for more details." >&5
+echo "$as_me: error: --with-nc4par was given, but compile test failed
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+             fi
+
+
+if false; then
+  HAVE_NC4PAR_TRUE=
+  HAVE_NC4PAR_FALSE='#'
+else
+  HAVE_NC4PAR_TRUE='#'
+  HAVE_NC4PAR_FALSE=
+fi
+
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+
+
+    fi
+
+    LIBS="$save_LIBS"
+    LDFLAGS="$save_LDFLAGS"
+    CPPFLAGS="$save_CPPFLAGS"
+
+    # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+    if test -z "${HAVE_NC4PAR_TRUE}"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_NC4PAR 1
+_ACEOF
+
+            :
+    else
+
+            :
+    fi
+
+fi
+
+
+
+
+
+
+if true; then
+  HAVE_PABLO_TRUE=
+  HAVE_PABLO_FALSE='#'
+else
+  HAVE_PABLO_TRUE='#'
+  HAVE_PABLO_FALSE=
+fi
+
+
+
+# Check whether --with-pablo or --without-pablo was given.
+if test "${with_pablo+set}" = set; then
+  withval="$with_pablo"
+  PABLO_LDFLAGS="-L$withval/lib";
+	 PABLO_CPPFLAGS="-I$withval/include";
+fi;
+
+
+save_CPPFLAGS="$CPPFLAGS"
+save_LIBS="$LIBS"
+save_LDFLAGS="$LDFLAGS"
+LIBS="$LIBS -lPablo"
+LDFLAGS="$LDFLAGS $PABLO_LDFLAGS"
+CPPFLAGS="$CPPFLAGS $PABLO_CPPFLAGS"
+
+if test -z "${HAVE_PABLO_TRUE}"; then
+
+for ac_header in Attributes.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+
+
+if false; then
+  HAVE_PABLO_TRUE=
+  HAVE_PABLO_FALSE='#'
+else
+  HAVE_PABLO_TRUE='#'
+  HAVE_PABLO_FALSE=
+fi
+
+fi
+
+done
+
+fi
+
+# Check for the Pablo library and headers for SDDF
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <Attributes.h>
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+Attributes attr;attr.clearEntries();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  PABLO_LIBS="-lPablo"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+if false; then
+  HAVE_PABLO_TRUE=
+  HAVE_PABLO_FALSE='#'
+else
+  HAVE_PABLO_TRUE='#'
+  HAVE_PABLO_FALSE=
+fi
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+LIBS="$save_LIBS"
+LDFLAGS="$save_LDFLAGS"
+CPPFLAGS="$save_CPPFLAGS"
+
+
+
+
+
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test -z "${HAVE_PABLO_TRUE}"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PABLO 1
+_ACEOF
+
+        :
+else
+
+        :
+fi
+
+
+
+
+
+
+
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+ac_nssi_ok=yes
+ac_nssi_path="."
+
+
+
+
+if false; then
+  HAVE_NSSI_TRUE=
+  HAVE_NSSI_FALSE='#'
+else
+  HAVE_NSSI_TRUE='#'
+  HAVE_NSSI_FALSE=
+fi
+
+
+NSSI_SRCDIR=""
+NSSI_BUILDDIR=""
+NSSI_CPPFLAGS=""
+NSSI_LDFLAGS=""
+NSSI_LIBS="-lnssi_client -lnssi_support"
+NSSI_SERVER_LIBS="-lnssi_server -lnssi_support"
+
+
+# Check whether --with-nssi or --without-nssi was given.
+if test "${with_nssi+set}" = set; then
+  withval="$with_nssi"
+  NSSI_LDFLAGS="-L$withval/lib";
+         NSSI_CPPFLAGS="-I$withval/include";
+         ac_nssi_path=$withval
+fi;
+
+if test x"$ac_nssi_ok" = xyes; then
+        save_CPPFLAGS="$CPPFLAGS"
+        CPPFLAGS="${CPPFLAGS} ${NSSI_CPPFLAGS}"
+        if test "${ac_cv_header_nssi_client_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for nssi_client.h" >&5
+echo $ECHO_N "checking for nssi_client.h... $ECHO_C" >&6
+if test "${ac_cv_header_nssi_client_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_nssi_client_h" >&5
+echo "${ECHO_T}$ac_cv_header_nssi_client_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking nssi_client.h usability" >&5
+echo $ECHO_N "checking nssi_client.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <nssi_client.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking nssi_client.h presence" >&5
+echo $ECHO_N "checking nssi_client.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <nssi_client.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_cxx_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: nssi_client.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: nssi_client.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: nssi_client.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: nssi_client.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: nssi_client.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: nssi_client.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: nssi_client.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: nssi_client.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: nssi_client.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: nssi_client.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: nssi_client.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: nssi_client.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: nssi_client.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: nssi_client.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: nssi_client.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: nssi_client.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for nssi_client.h" >&5
+echo $ECHO_N "checking for nssi_client.h... $ECHO_C" >&6
+if test "${ac_cv_header_nssi_client_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_nssi_client_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_nssi_client_h" >&5
+echo "${ECHO_T}$ac_cv_header_nssi_client_h" >&6
+
+fi
+if test $ac_cv_header_nssi_client_h = yes; then
+  :
+else
+  ac_nssi_ok=no
+fi
+
+
+        CPPFLAGS="$save_CPPFLAGS"
+fi
+
+if test x"$ac_nssi_ok" = xyes; then
+
+
+echo "$as_me:$LINENO: checking for clock_gettime in -lrt" >&5
+echo $ECHO_N "checking for clock_gettime in -lrt... $ECHO_C" >&6
+if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char clock_gettime ();
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+clock_gettime ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_rt_clock_gettime=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_rt_clock_gettime=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_rt_clock_gettime" >&5
+echo "${ECHO_T}$ac_cv_lib_rt_clock_gettime" >&6
+if test $ac_cv_lib_rt_clock_gettime = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBRT 1
+_ACEOF
+
+  LIBS="-lrt $LIBS"
+
+fi
+
+
+
+
+
+
+
+for ac_func in clock_gettime gettimeofday fdatasync pthread_yield sched_yield
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+        ac_nssi_ok=no
+
+                ac_nssi_flags="none"
+        if test x"$ac_with_portals" = xyes; then
+                ac_nssi_flags="$ac_nssi_flags all_portals portals_plus_libcpp portals_plus_pablo"
+        fi
+        if test x"$ac_with_infiniband" = xyes; then
+                ac_nssi_flags="$ac_nssi_flags infiniband"
+        fi
+
+        for flag in $ac_nssi_flags; do
+
+                case $flag in
+                        none)
+                        echo "$as_me:$LINENO: checking whether nssi works without any additional flags" >&5
+echo $ECHO_N "checking whether nssi works without any additional flags... $ECHO_C" >&6
+                        ;;
+
+                        -l*)
+                        echo "$as_me:$LINENO: checking whether nssi works with library $flag" >&5
+echo $ECHO_N "checking whether nssi works with library $flag... $ECHO_C" >&6
+                        EXTRA_LIBS="$flag"
+                        ;;
+
+                        -*)
+                        echo "$as_me:$LINENO: checking whether nssi works with $flag" >&5
+echo $ECHO_N "checking whether nssi works with $flag... $ECHO_C" >&6
+                        EXTRA_LIBS="$flag"
+                        ;;
+
+                        all_portals)
+                        echo "$as_me:$LINENO: checking whether nssi works with ${PORTALS_LIBS}" >&5
+echo $ECHO_N "checking whether nssi works with ${PORTALS_LIBS}... $ECHO_C" >&6
+                        EXTRA_LIBS="${PORTALS_LIBS}"
+                        ;;
+
+                        portals_plus_libcpp)
+                        echo "$as_me:$LINENO: checking whether nssi works with ${PORTALS_LIBS}" >&5
+echo $ECHO_N "checking whether nssi works with ${PORTALS_LIBS}... $ECHO_C" >&6
+                        EXTRA_LIBS="${PORTALS_LIBS}"
+                        ;;
+
+                        portals_plus_pablo)
+                        echo "$as_me:$LINENO: checking whether nssi works with ${PORTALS_LIBS} ${PABLO_LIBS}" >&5
+echo $ECHO_N "checking whether nssi works with ${PORTALS_LIBS} ${PABLO_LIBS}... $ECHO_C" >&6
+                        EXTRA_LIBS="${PORTALS_LIBS} ${PABLO_LIBS}"
+                        ;;
+
+                        infiniband)
+                        echo "$as_me:$LINENO: checking whether nssi works with ${INFINIBAND_LIBS}" >&5
+echo $ECHO_N "checking whether nssi works with ${INFINIBAND_LIBS}... $ECHO_C" >&6
+                        EXTRA_LIBS="${INFINIBAND_LIBS}"
+                        ;;
+                esac
+
+
+                save_LDFLAGS="$LDFLAGS"
+                save_LIBS="$LIBS"
+                save_CPPFLAGS="$CPPFLAGS"
+                save_CFLAGS="$CFLAGS"
+                LDFLAGS="$LDFLAGS $NSSI_LDFLAGS"
+                LIBS="$LIBS $NSSI_LIBS $EXTRA_LIBS"
+                CPPFLAGS="$CPPFLAGS $NSSI_CPPFLAGS"
+                CFLAGS="$CFLAGS $NSSI_CFLAGS $EXTRA_FLAGS"
+
+
+                                cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include "nssi_client.h"
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+nssi_remote_pid server_id;
+                             uint64_t timeout;
+                             nssi_service svc;
+                             nssi_get_service(server_id, timeout, &svc);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_nssi_ok=yes;
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_nssi_ok=no;
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+
+
+                LDFLAGS="$save_LDFLAGS"
+                LIBS="$save_LIBS"
+                CFLAGS="$save_CFLAGS"
+                CPPFLAGS="$save_CPPFLAGS"
+
+                echo "$as_me:$LINENO: result: $ac_nssi_ok" >&5
+echo "${ECHO_T}$ac_nssi_ok" >&6
+                if test "x$ac_nssi_ok" = xyes; then
+                        NSSI_LIBS="$NSSI_LIBS $EXTRA_LIBS";
+                        NSSI_SERVER_LIBS="$NSSI_SERVER_LIBS $EXTRA_LIBS"
+                        NSSI_CFLAGS="$NSSI_CFLAGS $EXTRA_CFLAGS";
+                        break;
+                fi
+
+                EXTRA_LIBS=""
+                EXTRA_CFLAGS=""
+        done
+fi
+
+
+
+if test x$ac_nssi_ok = xyes; then
+  HAVE_NSSI_TRUE=
+  HAVE_NSSI_FALSE='#'
+else
+  HAVE_NSSI_TRUE='#'
+  HAVE_NSSI_FALSE=
+fi
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$ac_nssi_ok" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_NSSI 1
+_ACEOF
+
+        :
+else
+
+        :
+fi
+
+
+
+
+
+
+
+if true; then
+  HAVE_DART_TRUE=
+  HAVE_DART_FALSE='#'
+else
+  HAVE_DART_TRUE='#'
+  HAVE_DART_FALSE=
+fi
+
+
+
+# Check whether --with-dart or --without-dart was given.
+if test "${with_dart+set}" = set; then
+  withval="$with_dart"
+  DART_LDFLAGS="-L$withval/lib";
+         DART_CPPFLAGS="-I$withval/include";
+else
+  with_dart=check
+fi;
+
+if test "x$with_dart" == "xno"; then
+
+
+
+if false; then
+  HAVE_DART_TRUE=
+  HAVE_DART_FALSE='#'
+else
+  HAVE_DART_TRUE='#'
+  HAVE_DART_FALSE=
+fi
+
+
+else
+
+
+# Check whether --with-dart-incdir or --without-dart-incdir was given.
+if test "${with_dart_incdir+set}" = set; then
+  withval="$with_dart_incdir"
+  DART_INCDIR=$withval
+                 with_dart=detailed
+fi;
+
+
+# Check whether --with-dart-libdir or --without-dart-libdir was given.
+if test "${with_dart_libdir+set}" = set; then
+  withval="$with_dart_libdir"
+  DART_LIBDIR=$withval
+                 with_dart=detailed
+fi;
+
+
+            if test -n "${DART_DIR}" -a -z "${DART_INCDIR}"; then
+            DART_INCDIR="${DART_DIR}/include";
+        elif test -n "${DART}" -a -d "${DART}"; then
+            DART_INCDIR="${DART}/include"
+    fi
+
+            if test -n "${DART_DIR}" -a -z "${DART_LIBDIR}"; then
+            DART_LIBDIR="${DART_DIR}/lib";
+        elif test -n "${DART}" -a -d "${DART}"; then
+            DART_LIBDIR="${DART}/lib"
+    fi
+
+        if test -n "${DART_INCDIR}"; then
+            DART_CPPFLAGS="-I${DART_INCDIR}"
+    else
+            ac_dart_ok=no
+    fi
+
+        if test -n "${DART_LIBDIR}"; then
+            DART_LDFLAGS="-L${DART_LIBDIR}"
+    else
+            ac_dart_ok=no
+    fi
+
+    save_CPPFLAGS="$CPPFLAGS"
+    save_LIBS="$LIBS"
+    save_LDFLAGS="$LDFLAGS"
+    LIBS="$LIBS -ldart2 -lspaces"
+    LDFLAGS="$LDFLAGS $DART_LDFLAGS"
+    CPPFLAGS="$CPPFLAGS $DART_CPPFLAGS"
+
+    if test -z "${HAVE_DART_TRUE}"; then
+
+for ac_header in dart.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+
+
+if false; then
+  HAVE_DART_TRUE=
+  HAVE_DART_FALSE='#'
+else
+  HAVE_DART_TRUE='#'
+  HAVE_DART_FALSE=
+fi
+
+fi
+
+done
+
+    fi
+
+    # Check for the Mini-XML library and headers
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include "dart.h"
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+int err; err = dart_init(1,1);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  DART_LIBS="-ldart2 -lspaces"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+if false; then
+  HAVE_DART_TRUE=
+  HAVE_DART_FALSE='#'
+else
+  HAVE_DART_TRUE='#'
+  HAVE_DART_FALSE=
+fi
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+    LIBS="$save_LIBS"
+    LDFLAGS="$save_LDFLAGS"
+    CPPFLAGS="$save_CPPFLAGS"
+
+
+
+
+
+    # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+    if test -z "${HAVE_DART_TRUE}"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DART 1
+_ACEOF
+
+            :
+    else
+
+            :
+    fi
+
+fi
+
+
+
+
+
+if true; then
+  HAVE_DIMES_TRUE=
+  HAVE_DIMES_FALSE='#'
+else
+  HAVE_DIMES_TRUE='#'
+  HAVE_DIMES_FALSE=
+fi
+
+
+
+# Check whether --with-dimes or --without-dimes was given.
+if test "${with_dimes+set}" = set; then
+  withval="$with_dimes"
+  DIMES_LDFLAGS="-L$withval/lib";
+         DIMES_CPPFLAGS="-I$withval/include";
+else
+  with_dimes=check
+fi;
+
+if test "x$with_dimes" == "xno"; then
+
+
+
+if false; then
+  HAVE_DIMES_TRUE=
+  HAVE_DIMES_FALSE='#'
+else
+  HAVE_DIMES_TRUE='#'
+  HAVE_DIMES_FALSE=
+fi
+
+
+else
+
+
+# Check whether --with-dimes-incdir or --without-dimes-incdir was given.
+if test "${with_dimes_incdir+set}" = set; then
+  withval="$with_dimes_incdir"
+  DIMES_INCDIR=$withval
+                 with_dimes=detailed
+fi;
+
+
+# Check whether --with-dimes-libdir or --without-dimes-libdir was given.
+if test "${with_dimes_libdir+set}" = set; then
+  withval="$with_dimes_libdir"
+  DIMES_LIBDIR=$withval
+                 with_dimes=detailed
+fi;
+
+
+            if test -n "${DIMES_DIR}" -a -z "${DIMES_INCDIR}"; then
+            DIMES_INCDIR="${DIMES_DIR}/include";
+        elif test -n "${DIMES}" -a -d "${DIMES}"; then
+            DIMES_INCDIR="${DIMES}/include"
+    fi
+
+            if test -n "${DIMES_DIR}" -a -z "${DIMES_LIBDIR}"; then
+            DIMES_LIBDIR="${DIMES_DIR}/lib";
+        elif test -n "${DIMES}" -a -d "${DIMES}"; then
+            DIMES_LIBDIR="${DIMES}/lib"
+    fi
+
+        if test -n "${DIMES_INCDIR}"; then
+            DIMES_CPPFLAGS="-I${DIMES_INCDIR}"
+    else
+            ac_dimes_ok=no
+    fi
+
+        if test -n "${DIMES_LIBDIR}"; then
+            DIMES_LDFLAGS="-L${DIMES_LIBDIR}"
+    else
+            ac_dimes_ok=no
+    fi
+
+    save_CPPFLAGS="$CPPFLAGS"
+    save_LIBS="$LIBS"
+    save_LDFLAGS="$LDFLAGS"
+    LIBS="$LIBS -ldimes_portals -lspaces"
+    LDFLAGS="$LDFLAGS $DIMES_LDFLAGS"
+    CPPFLAGS="$CPPFLAGS $DIMES_CPPFLAGS"
+
+    if test -z "${HAVE_DIMES_TRUE}"; then
+
+for ac_header in dimes.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+
+
+if false; then
+  HAVE_DIMES_TRUE=
+  HAVE_DIMES_FALSE='#'
+else
+  HAVE_DIMES_TRUE='#'
+  HAVE_DIMES_FALSE=
+fi
+
+fi
+
+done
+
+    fi
+
+    # Check for the Mini-XML library and headers
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include "dimes.h"
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+int err; err = dimes_init(1,1,1);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  DIMES_LIBS="-ldimes_portals -lspaces"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+if false; then
+  HAVE_DIMES_TRUE=
+  HAVE_DIMES_FALSE='#'
+else
+  HAVE_DIMES_TRUE='#'
+  HAVE_DIMES_FALSE=
+fi
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+    LIBS="$save_LIBS"
+    LDFLAGS="$save_LDFLAGS"
+    CPPFLAGS="$save_CPPFLAGS"
+
+
+
+
+
+    # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+    if test -z "${HAVE_DIMES_TRUE}"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DIMES 1
+_ACEOF
+
+            :
+    else
+
+            :
+    fi
+
+fi
+
+
+
+
+
+if true; then
+  HAVE_DMALLOC_TRUE=
+  HAVE_DMALLOC_FALSE='#'
+else
+  HAVE_DMALLOC_TRUE='#'
+  HAVE_DMALLOC_FALSE=
+fi
+
+
+
+# Check whether --with-dmalloc or --without-dmalloc was given.
+if test "${with_dmalloc+set}" = set; then
+  withval="$with_dmalloc"
+  DMALLOC_LDFLAGS="-L$withval/lib";
+         DMALLOC_CPPFLAGS="-I$withval/include";
+fi;
+
+save_CPPFLAGS="$CPPFLAGS"
+save_LIBS="$LIBS"
+save_LDFLAGS="$LDFLAGS"
+LIBS="$LIBS -ldmalloc"
+LDFLAGS="$LDFLAGS $DMALLOC_LDFLAGS"
+CPPFLAGS="$CPPFLAGS $DMALLOC_CPPFLAGS"
+
+if test -z "${HAVE_DMALLOC_TRUE}"; then
+
+for ac_header in dmalloc.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+
+
+if false; then
+  HAVE_DMALLOC_TRUE=
+  HAVE_DMALLOC_FALSE='#'
+else
+  HAVE_DMALLOC_TRUE='#'
+  HAVE_DMALLOC_FALSE=
+fi
+
+fi
+
+done
+
+fi
+
+# Check for the dmalloc library and headers
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include "dmalloc.h"
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int FC_DUMMY_MAIN() { return 1; }
+#endif
+#endif
+int
+main ()
+{
+char * s; s=malloc(sizeof(char)*10); free(s);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  DMALLOC_LIBS="-ldmalloc"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+if false; then
+  HAVE_DMALLOC_TRUE=
+  HAVE_DMALLOC_FALSE='#'
+else
+  HAVE_DMALLOC_TRUE='#'
+  HAVE_DMALLOC_FALSE=
+fi
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+LIBS="$save_LIBS"
+LDFLAGS="$save_LDFLAGS"
+CPPFLAGS="$save_CPPFLAGS"
+
+
+
+
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test -z "${HAVE_DMALLOC_TRUE}"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DMALLOC 1
+_ACEOF
+
+        :
+else
+
+        :
+fi
+
+
+# Check whether --with-installed or --without-installed was given.
+if test "${with_installed+set}" = set; then
+  withval="$with_installed"
+  with_installed_specified=1
+fi;
+
+# Check whether --with-local or --without-local was given.
+if test "${with_local+set}" = set; then
+  withval="$with_local"
+  with_local_specified=1
+fi;
+# Extract the first word of "csh", so it can be a program name with args.
+set dummy csh; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_CSH+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $CSH in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CSH="$CSH" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_CSH="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+CSH=$ac_cv_path_CSH
+
+if test -n "$CSH"; then
+  echo "$as_me:$LINENO: result: $CSH" >&5
+echo "${ECHO_T}$CSH" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+
+
+
+CHAOS_HOMEDIR=""
+if test -n "$CSH"; then
+CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf  2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR=""
+fi
+if test "$cross_compiling" = yes ; then
+  cpu=$host_cpu
+  vendor=$host_vendot
+  os=$host_os
+else
+  cpu=
+  vendor=
+  os=
+fi
+if test -x $CHAOS_HOMEDIR/bin/cercs_arch; then
+cercs_cv_archive=`$CHAOS_HOMEDIR/bin/cercs_arch "$cpu" "$vendor" "$os"`
+else
+cercs_cv_archive=${cercs_cv_archive-`cercs_arch 2>/dev/null`} || cercs_cv_archive=""
+fi
+
+# Extract the first word of "cygpath", so it can be a program name with args.
+set dummy cygpath; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_PATHPROG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$PATHPROG"; then
+  ac_cv_prog_PATHPROG="$PATHPROG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_PATHPROG="cygpath -w"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_PATHPROG" && ac_cv_prog_PATHPROG="echo"
+fi
+fi
+PATHPROG=$ac_cv_prog_PATHPROG
+if test -n "$PATHPROG"; then
+  echo "$as_me:$LINENO: result: $PATHPROG" >&5
+echo "${ECHO_T}$PATHPROG" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+
+
+
+
+
+DT_SRCDIR=""
+DT_CPPFLAGS=""
+DT_LDFLAGS=""
+DT_LIBS=""
+
+datatap=disable
+
+temptest=enable
+
+datatap_dir=""
+
+
+
+# Check whether --with-datatap or --without-datatap was given.
+if test "${with_datatap+set}" = set; then
+  withval="$with_datatap"
+   ac_with_datatap=$withval
+else
+  with_datatap=no
+fi;
+
+if test "x$with_datatap" = "xno"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_DATATAP 1
+_ACEOF
+
+	datatap=disable
+	temptest=disable
+
+elif test x"$with_datatap" = xyes -o x"$with_datatap" = xcheck; then
+
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_DATATAP 0
+_ACEOF
+
+
+	if test x"$ac_with_infiniband" = xyes; then
+
+
+
+if test -z "$with_local_specified"; then
+
+
+
+
+# Check whether --with-ibpbio or --without-ibpbio was given.
+if test "${with_ibpbio+set}" = set; then
+  withval="$with_ibpbio"
+
+fi;
+
+if test -n "$with_ibpbio"; then
+unset cercs_cv_ibpbio_include_arg
+unset cercs_cv_ibpbio_link_arg
+if test `echo $with_ibpbio | sed 's/\(.\).*/\1/g'` != "/"; then
+with_ibpbio=`pwd`/$with_ibpbio
+fi
+fi
+echo "$as_me:$LINENO: checking needed include args for ibpbio package" >&5
+echo $ECHO_N "checking needed include args for ibpbio package... $ECHO_C" >&6
+if test "${cercs_cv_ibpbio_include_arg+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+
+
+cercs_tmp=""
+search_list="./thin_ib.h"
+CHAOS_HOMEDIR=""
+if test -n "$CSH"; then
+CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf  2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR=""
+fi
+if test -n "$with_ibpbio"; then
+if test `echo $with_ibpbio | cut -c1` = "~"; then
+EXPANDED=`echo "echo $with_ibpbio" | csh -sf 2>/dev/null` || EXPANDED=""
+else
+EXPANDED=$with_ibpbio
+fi
+
+echo "Datatap = $datatap_dir"
+
+search_list="$datatap_dir/thin_ib.h $datatap_dir/lib/thin_ib.h $datatap_dir/include/thin_ib.h $search_list $EXPANDED/thin_ib.h $EXPANDED/include/thin_ib.h $EXPANDED/share/thin_ib.h $EXPANDED/$cercs_cv_archive/thin_ib.h $EXPANDED/$cercs_cv_archive/include/thin_ib.h $EXPANDED/ibpbio/thin_ib.h $EXPANDED/ibpbio/$cercs_cv_archive/thin_ib.h $EXPANDED/ibpbio/include/thin_ib.h $EXPANDED/ibpbio/include/$cercs_cv_archive/thin_ib.h"
+fi
+if test -z "$with_installed_specified"; then
+search_list="$search_list `pwd`/../ibpbio/thin_ib.h `pwd`/../include/thin_ib.h `pwd`/../share/thin_ib.h"
+if test "$CHAOS_HOMEDIR" != "$HOME"; then
+search_list="$search_list $HOME/ibpbio/thin_ib.h $HOME/$cercs_cv_archive/include/thin_ib.h $HOME/include/thin_ib.h"
+fi
+fi
+if test -n "$CHAOS_HOMEDIR" -a -n "$cercs_cv_archive"; then
+search_list="$search_list $CHAOS_HOMEDIR/$cercs_cv_archive/ibpbio/include/thin_ib.h $CHAOS_HOMEDIR/$cercs_cv_archive/include/thin_ib.h $CHAOS_HOMEDIR/ibpbio/$cercs_cv_archive/include/thin_ib.h $CHAOS_HOMEDIR/ibpbio/include/thin_ib.h $CHAOS_HOMEDIR/include/thin_ib.h"
+fi
+if test "$libdir" != '${exec_prefix}/lib'; then
+tmpdir=`echo ${libdir} |  sed 's%/$%%'`
+search_list="$tmpdir/thin_ib.h $search_list"
+fi
+if test "$exec_prefix" != "NONE"; then
+tmpdir=`echo ${exec_prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/thin_ib.h $search_list"
+fi
+if test "$includedir" != '${prefix}/include'; then
+tmpdir=`echo ${includedir} |  sed 's%/$%%'`
+search_list="$tmpdir/thin_ib.h $search_list"
+fi
+if test "$prefix" != "NONE"; then
+tmpdir=`echo ${prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/include/thin_ib.h $search_list"
+fi
+if test "include" == "lib"; then
+  for tmp_lib_value in $sys_lib_search_path_spec; do
+     search_list="$search_list $tmp_lib_value/thin_ib.h"
+  done
+fi
+
+search_list="$datatap_dir/thin_ib.h $datatap_dir/lib/thin_ib.h $datatap_dir/include/thin_ib.h $search_list /usr/include/thin_ib.h /usr/local/include/thin_ib.h /opt/ibpbio/include/thin_ib.h /opt/misc/include/thin_ib.h /opt/misc/include/$cercs_cv_archive/thin_ib.h"
+tmp_search_results=""
+echo "configure:28192: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:28196: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "/usr/include/thin_ib.h"; then
+cercs_cv_ibpbio_include_arg=-I`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s#.thin_ib.h##g"`
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ibpbio_include_arg" >&5
+echo "${ECHO_T}$cercs_cv_ibpbio_include_arg" >&6
+if test -n "$cercs_cv_ibpbio_include_arg"; then
+arg="$cercs_cv_ibpbio_include_arg"
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $DT_CPPFLAGS | grep -c "$no_dash_arg"` -eq 0; then
+if test `echo $arg | grep -c "ibpbio"` -eq 0; then
+DT_CPPFLAGS="$DT_CPPFLAGS $arg";
+else
+DT_CPPFLAGS="$arg $DT_CPPFLAGS"
+fi
+fi
+fi
+
+echo "$as_me:$LINENO: checking needed link args for ibpbio package" >&5
+echo $ECHO_N "checking needed link args for ibpbio package... $ECHO_C" >&6
+if test "${cercs_cv_ibpbio_link_dir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+
+
+cercs_tmp=""
+search_list="./libibclient.la"
+CHAOS_HOMEDIR=""
+if test -n "$CSH"; then
+CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf  2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR=""
+fi
+if test -n "$with_ibpbio"; then
+if test `echo $with_ibpbio | cut -c1` = "~"; then
+EXPANDED=`echo "echo $with_ibpbio" | csh -sf 2>/dev/null` || EXPANDED=""
+else
+EXPANDED=$with_ibpbio
+fi
+
+echo "Datatap = $datatap_dir"
+
+search_list="$datatap_dir/libibclient.la $datatap_dir/lib/libibclient.la $datatap_dir/include/libibclient.la $search_list $EXPANDED/libibclient.la $EXPANDED/lib/libibclient.la $EXPANDED/share/libibclient.la $EXPANDED/$cercs_cv_archive/libibclient.la $EXPANDED/$cercs_cv_archive/lib/libibclient.la $EXPANDED/ibpbio/libibclient.la $EXPANDED/ibpbio/$cercs_cv_archive/libibclient.la $EXPANDED/ibpbio/lib/libibclient.la $EXPANDED/ibpbio/lib/$cercs_cv_archive/libibclient.la"
+fi
+if test -z "$with_installed_specified"; then
+search_list="$search_list `pwd`/../ibpbio/libibclient.la `pwd`/../lib/libibclient.la `pwd`/../share/libibclient.la"
+if test "$CHAOS_HOMEDIR" != "$HOME"; then
+search_list="$search_list $HOME/ibpbio/libibclient.la $HOME/$cercs_cv_archive/lib/libibclient.la $HOME/lib/libibclient.la"
+fi
+fi
+if test -n "$CHAOS_HOMEDIR" -a -n "$cercs_cv_archive"; then
+search_list="$search_list $CHAOS_HOMEDIR/$cercs_cv_archive/ibpbio/lib/libibclient.la $CHAOS_HOMEDIR/$cercs_cv_archive/lib/libibclient.la $CHAOS_HOMEDIR/ibpbio/$cercs_cv_archive/lib/libibclient.la $CHAOS_HOMEDIR/ibpbio/lib/libibclient.la $CHAOS_HOMEDIR/lib/libibclient.la"
+fi
+if test "$libdir" != '${exec_prefix}/lib'; then
+tmpdir=`echo ${libdir} |  sed 's%/$%%'`
+search_list="$tmpdir/libibclient.la $search_list"
+fi
+if test "$exec_prefix" != "NONE"; then
+tmpdir=`echo ${exec_prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/libibclient.la $search_list"
+fi
+if test "$includedir" != '${prefix}/include'; then
+tmpdir=`echo ${includedir} |  sed 's%/$%%'`
+search_list="$tmpdir/libibclient.la $search_list"
+fi
+if test "$prefix" != "NONE"; then
+tmpdir=`echo ${prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/libibclient.la $search_list"
+fi
+if test "lib" == "lib"; then
+  for tmp_lib_value in $sys_lib_search_path_spec; do
+     search_list="$search_list $tmp_lib_value/libibclient.la"
+  done
+fi
+
+search_list="$datatap_dir/libibclient.la $datatap_dir/lib/libibclient.la $datatap_dir/include/libibclient.la $search_list /usr/lib/libibclient.la /usr/local/lib/libibclient.la /opt/ibpbio/lib/libibclient.la /opt/misc/lib/libibclient.la /opt/misc/lib/$cercs_cv_archive/libibclient.la"
+tmp_search_results=""
+echo "configure:28284: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:28288: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "libibclient.la"; then
+cercs_cv_ibpbio_link_dir=`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s/.libibclient.la//g"`
+else
+cercs_cv_ibpbio_link_dir=""
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ibpbio_link_dir" >&5
+echo "${ECHO_T}$cercs_cv_ibpbio_link_dir" >&6
+ld_arg="-L"
+new_flags=$LDFLAGS
+cercs_cv_ibpbio_link_arg=`echo $cercs_cv_ibpbio_link_dir | sed "/./ s/^/$ld_arg/1"`
+if test -n "$cercs_cv_ibpbio_link_arg"; then
+arg=$cercs_cv_ibpbio_link_arg
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $new_flags | grep -c "$no_dash_arg"` -eq 0; then
+root=`echo libibclient.la | sed 's/\..*//'`
+if test ! -r $cercs_cv_ibpbio_link_dir/$root.la; then
+if eval "test \"\${LIBTOOL+set}\" = set"; then
+arg="$cercs_cv_ibpbio_link_arg "`echo $cercs_cv_ibpbio_link_dir | sed "/./ s/^/-R/1"`
+fi
+fi
+if test `echo $arg | grep -c "ibpbio"` -eq 0; then
+new_flags="$new_flags $arg"
+else
+new_flags="$arg $new_flags"
+fi
+fi
+DT_LDFLAGS=$new_flags
+fi
+
+
+else
+
+
+
+
+# Check whether --with-ibpbio or --without-ibpbio was given.
+if test "${with_ibpbio+set}" = set; then
+  withval="$with_ibpbio"
+
+fi;
+
+if test -n "$with_ibpbio"; then
+unset cercs_cv_ibpbio_include_arg
+unset cercs_cv_ibpbio_link_arg
+if test `echo $with_ibpbio | sed 's/\(.\).*/\1/g'` != "/"; then
+with_ibpbio=`pwd`/$with_ibpbio
+fi
+fi
+echo "$as_me:$LINENO: checking needed include args for ibpbio package" >&5
+echo $ECHO_N "checking needed include args for ibpbio package... $ECHO_C" >&6
+if test "${cercs_cv_ibpbio_include_arg+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+search_list="$PWD/../ibpbio $PWD/../../ibpbio $PWD/../../../ibpbio"
+tmp_search_results=""
+echo "configure:28357: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:28361: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "/usr/include/thin_ib.h"; then
+cercs_cv_ibpbio_include_arg=-I`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s#.thin_ib.h##g"`
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ibpbio_include_arg" >&5
+echo "${ECHO_T}$cercs_cv_ibpbio_include_arg" >&6
+if test -n "$cercs_cv_ibpbio_include_arg"; then
+arg="$cercs_cv_ibpbio_include_arg"
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $DT_CPPFLAGS | grep -c "$no_dash_arg"` -eq 0; then
+if test `echo $arg | grep -c "ibpbio"` -eq 0; then
+DT_CPPFLAGS="$DT_CPPFLAGS $arg";
+else
+DT_CPPFLAGS="$arg $DT_CPPFLAGS"
+fi
+fi
+fi
+
+echo "$as_me:$LINENO: checking needed link args for ibpbio package" >&5
+echo $ECHO_N "checking needed link args for ibpbio package... $ECHO_C" >&6
+if test "${cercs_cv_ibpbio_link_dir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+search_list="$PWD/../ibpbio $PWD/../../ibpbio $PWD/../../../ibpbio"
+tmp_search_results=""
+echo "configure:28399: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:28403: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "libibclient.la"; then
+cercs_cv_ibpbio_link_dir=`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s/.libibclient.la//g"`
+else
+cercs_cv_ibpbio_link_dir=""
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ibpbio_link_dir" >&5
+echo "${ECHO_T}$cercs_cv_ibpbio_link_dir" >&6
+ld_arg="-L"
+new_flags=$LDFLAGS
+cercs_cv_ibpbio_link_arg=`echo $cercs_cv_ibpbio_link_dir | sed "/./ s/^/$ld_arg/1"`
+if test -n "$cercs_cv_ibpbio_link_arg"; then
+arg=$cercs_cv_ibpbio_link_arg
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $new_flags | grep -c "$no_dash_arg"` -eq 0; then
+root=`echo libibclient.la | sed 's/\..*//'`
+if test ! -r $cercs_cv_ibpbio_link_dir/$root.la; then
+if eval "test \"\${LIBTOOL+set}\" = set"; then
+arg="$cercs_cv_ibpbio_link_arg "`echo $cercs_cv_ibpbio_link_dir | sed "/./ s/^/-R/1"`
+fi
+fi
+if test `echo $arg | grep -c "ibpbio"` -eq 0; then
+new_flags="$new_flags $arg"
+else
+new_flags="$arg $new_flags"
+fi
+fi
+DT_LDFLAGS=$new_flags
+fi
+
+
+fi
+
+
+
+
+if test -z "$with_local_specified"; then
+
+
+
+
+# Check whether --with-ffs or --without-ffs was given.
+if test "${with_ffs+set}" = set; then
+  withval="$with_ffs"
+
+fi;
+
+if test -n "$with_ffs"; then
+unset cercs_cv_ffs_include_arg
+unset cercs_cv_ffs_link_arg
+if test `echo $with_ffs | sed 's/\(.\).*/\1/g'` != "/"; then
+with_ffs=`pwd`/$with_ffs
+fi
+fi
+echo "$as_me:$LINENO: checking needed include args for ffs package" >&5
+echo $ECHO_N "checking needed include args for ffs package... $ECHO_C" >&6
+if test "${cercs_cv_ffs_include_arg+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+
+
+cercs_tmp=""
+search_list="./ffs.h"
+CHAOS_HOMEDIR=""
+if test -n "$CSH"; then
+CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf  2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR=""
+fi
+if test -n "$with_ffs"; then
+if test `echo $with_ffs | cut -c1` = "~"; then
+EXPANDED=`echo "echo $with_ffs" | csh -sf 2>/dev/null` || EXPANDED=""
+else
+EXPANDED=$with_ffs
+fi
+
+echo "Datatap = $datatap_dir"
+
+search_list="$datatap_dir/ffs.h $datatap_dir/lib/ffs.h $datatap_dir/include/ffs.h $search_list $EXPANDED/ffs.h $EXPANDED/include/ffs.h $EXPANDED/share/ffs.h $EXPANDED/$cercs_cv_archive/ffs.h $EXPANDED/$cercs_cv_archive/include/ffs.h $EXPANDED/ffs/ffs.h $EXPANDED/ffs/$cercs_cv_archive/ffs.h $EXPANDED/ffs/include/ffs.h $EXPANDED/ffs/include/$cercs_cv_archive/ffs.h"
+fi
+if test -z "$with_installed_specified"; then
+search_list="$search_list `pwd`/../ffs/ffs.h `pwd`/../include/ffs.h `pwd`/../share/ffs.h"
+if test "$CHAOS_HOMEDIR" != "$HOME"; then
+search_list="$search_list $HOME/ffs/ffs.h $HOME/$cercs_cv_archive/include/ffs.h $HOME/include/ffs.h"
+fi
+fi
+if test -n "$CHAOS_HOMEDIR" -a -n "$cercs_cv_archive"; then
+search_list="$search_list $CHAOS_HOMEDIR/$cercs_cv_archive/ffs/include/ffs.h $CHAOS_HOMEDIR/$cercs_cv_archive/include/ffs.h $CHAOS_HOMEDIR/ffs/$cercs_cv_archive/include/ffs.h $CHAOS_HOMEDIR/ffs/include/ffs.h $CHAOS_HOMEDIR/include/ffs.h"
+fi
+if test "$libdir" != '${exec_prefix}/lib'; then
+tmpdir=`echo ${libdir} |  sed 's%/$%%'`
+search_list="$tmpdir/ffs.h $search_list"
+fi
+if test "$exec_prefix" != "NONE"; then
+tmpdir=`echo ${exec_prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/ffs.h $search_list"
+fi
+if test "$includedir" != '${prefix}/include'; then
+tmpdir=`echo ${includedir} |  sed 's%/$%%'`
+search_list="$tmpdir/ffs.h $search_list"
+fi
+if test "$prefix" != "NONE"; then
+tmpdir=`echo ${prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/include/ffs.h $search_list"
+fi
+if test "include" == "lib"; then
+  for tmp_lib_value in $sys_lib_search_path_spec; do
+     search_list="$search_list $tmp_lib_value/ffs.h"
+  done
+fi
+
+search_list="$datatap_dir/ffs.h $datatap_dir/lib/ffs.h $datatap_dir/include/ffs.h $search_list /usr/include/ffs.h /usr/local/include/ffs.h /opt/ffs/include/ffs.h /opt/misc/include/ffs.h /opt/misc/include/$cercs_cv_archive/ffs.h"
+tmp_search_results=""
+echo "configure:28527: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:28531: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "/usr/include/ffs.h"; then
+cercs_cv_ffs_include_arg=-I`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s#.ffs.h##g"`
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ffs_include_arg" >&5
+echo "${ECHO_T}$cercs_cv_ffs_include_arg" >&6
+if test -n "$cercs_cv_ffs_include_arg"; then
+arg="$cercs_cv_ffs_include_arg"
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $DT_CPPFLAGS | grep -c "$no_dash_arg"` -eq 0; then
+if test `echo $arg | grep -c "ffs"` -eq 0; then
+DT_CPPFLAGS="$DT_CPPFLAGS $arg";
+else
+DT_CPPFLAGS="$arg $DT_CPPFLAGS"
+fi
+fi
+fi
+
+echo "$as_me:$LINENO: checking needed link args for ffs package" >&5
+echo $ECHO_N "checking needed link args for ffs package... $ECHO_C" >&6
+if test "${cercs_cv_ffs_link_dir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+
+
+cercs_tmp=""
+search_list="./libffs.la"
+CHAOS_HOMEDIR=""
+if test -n "$CSH"; then
+CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf  2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR=""
+fi
+if test -n "$with_ffs"; then
+if test `echo $with_ffs | cut -c1` = "~"; then
+EXPANDED=`echo "echo $with_ffs" | csh -sf 2>/dev/null` || EXPANDED=""
+else
+EXPANDED=$with_ffs
+fi
+
+echo "Datatap = $datatap_dir"
+
+search_list="$datatap_dir/libffs.la $datatap_dir/lib/libffs.la $datatap_dir/include/libffs.la $search_list $EXPANDED/libffs.la $EXPANDED/lib/libffs.la $EXPANDED/share/libffs.la $EXPANDED/$cercs_cv_archive/libffs.la $EXPANDED/$cercs_cv_archive/lib/libffs.la $EXPANDED/ffs/libffs.la $EXPANDED/ffs/$cercs_cv_archive/libffs.la $EXPANDED/ffs/lib/libffs.la $EXPANDED/ffs/lib/$cercs_cv_archive/libffs.la"
+fi
+if test -z "$with_installed_specified"; then
+search_list="$search_list `pwd`/../ffs/libffs.la `pwd`/../lib/libffs.la `pwd`/../share/libffs.la"
+if test "$CHAOS_HOMEDIR" != "$HOME"; then
+search_list="$search_list $HOME/ffs/libffs.la $HOME/$cercs_cv_archive/lib/libffs.la $HOME/lib/libffs.la"
+fi
+fi
+if test -n "$CHAOS_HOMEDIR" -a -n "$cercs_cv_archive"; then
+search_list="$search_list $CHAOS_HOMEDIR/$cercs_cv_archive/ffs/lib/libffs.la $CHAOS_HOMEDIR/$cercs_cv_archive/lib/libffs.la $CHAOS_HOMEDIR/ffs/$cercs_cv_archive/lib/libffs.la $CHAOS_HOMEDIR/ffs/lib/libffs.la $CHAOS_HOMEDIR/lib/libffs.la"
+fi
+if test "$libdir" != '${exec_prefix}/lib'; then
+tmpdir=`echo ${libdir} |  sed 's%/$%%'`
+search_list="$tmpdir/libffs.la $search_list"
+fi
+if test "$exec_prefix" != "NONE"; then
+tmpdir=`echo ${exec_prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/libffs.la $search_list"
+fi
+if test "$includedir" != '${prefix}/include'; then
+tmpdir=`echo ${includedir} |  sed 's%/$%%'`
+search_list="$tmpdir/libffs.la $search_list"
+fi
+if test "$prefix" != "NONE"; then
+tmpdir=`echo ${prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/libffs.la $search_list"
+fi
+if test "lib" == "lib"; then
+  for tmp_lib_value in $sys_lib_search_path_spec; do
+     search_list="$search_list $tmp_lib_value/libffs.la"
+  done
+fi
+
+search_list="$datatap_dir/libffs.la $datatap_dir/lib/libffs.la $datatap_dir/include/libffs.la $search_list /usr/lib/libffs.la /usr/local/lib/libffs.la /opt/ffs/lib/libffs.la /opt/misc/lib/libffs.la /opt/misc/lib/$cercs_cv_archive/libffs.la"
+tmp_search_results=""
+echo "configure:28619: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:28623: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "libffs.la"; then
+cercs_cv_ffs_link_dir=`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s/.libffs.la//g"`
+else
+cercs_cv_ffs_link_dir=""
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ffs_link_dir" >&5
+echo "${ECHO_T}$cercs_cv_ffs_link_dir" >&6
+ld_arg="-L"
+new_flags=$LDFLAGS
+cercs_cv_ffs_link_arg=`echo $cercs_cv_ffs_link_dir | sed "/./ s/^/$ld_arg/1"`
+if test -n "$cercs_cv_ffs_link_arg"; then
+arg=$cercs_cv_ffs_link_arg
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $new_flags | grep -c "$no_dash_arg"` -eq 0; then
+root=`echo libffs.la | sed 's/\..*//'`
+if test ! -r $cercs_cv_ffs_link_dir/$root.la; then
+if eval "test \"\${LIBTOOL+set}\" = set"; then
+arg="$cercs_cv_ffs_link_arg "`echo $cercs_cv_ffs_link_dir | sed "/./ s/^/-R/1"`
+fi
+fi
+if test `echo $arg | grep -c "ffs"` -eq 0; then
+new_flags="$new_flags $arg"
+else
+new_flags="$arg $new_flags"
+fi
+fi
+DT_LDFLAGS=$new_flags
+fi
+
+
+else
+
+
+
+
+# Check whether --with-ffs or --without-ffs was given.
+if test "${with_ffs+set}" = set; then
+  withval="$with_ffs"
+
+fi;
+
+if test -n "$with_ffs"; then
+unset cercs_cv_ffs_include_arg
+unset cercs_cv_ffs_link_arg
+if test `echo $with_ffs | sed 's/\(.\).*/\1/g'` != "/"; then
+with_ffs=`pwd`/$with_ffs
+fi
+fi
+echo "$as_me:$LINENO: checking needed include args for ffs package" >&5
+echo $ECHO_N "checking needed include args for ffs package... $ECHO_C" >&6
+if test "${cercs_cv_ffs_include_arg+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+search_list="$PWD/../ffs $PWD/../../ffs $PWD/../../../ffs"
+tmp_search_results=""
+echo "configure:28692: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:28696: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "/usr/include/ffs.h"; then
+cercs_cv_ffs_include_arg=-I`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s#.ffs.h##g"`
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ffs_include_arg" >&5
+echo "${ECHO_T}$cercs_cv_ffs_include_arg" >&6
+if test -n "$cercs_cv_ffs_include_arg"; then
+arg="$cercs_cv_ffs_include_arg"
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $DT_CPPFLAGS | grep -c "$no_dash_arg"` -eq 0; then
+if test `echo $arg | grep -c "ffs"` -eq 0; then
+DT_CPPFLAGS="$DT_CPPFLAGS $arg";
+else
+DT_CPPFLAGS="$arg $DT_CPPFLAGS"
+fi
+fi
+fi
+
+echo "$as_me:$LINENO: checking needed link args for ffs package" >&5
+echo $ECHO_N "checking needed link args for ffs package... $ECHO_C" >&6
+if test "${cercs_cv_ffs_link_dir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+search_list="$PWD/../ffs $PWD/../../ffs $PWD/../../../ffs"
+tmp_search_results=""
+echo "configure:28734: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:28738: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "libffs.la"; then
+cercs_cv_ffs_link_dir=`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s/.libffs.la//g"`
+else
+cercs_cv_ffs_link_dir=""
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ffs_link_dir" >&5
+echo "${ECHO_T}$cercs_cv_ffs_link_dir" >&6
+ld_arg="-L"
+new_flags=$LDFLAGS
+cercs_cv_ffs_link_arg=`echo $cercs_cv_ffs_link_dir | sed "/./ s/^/$ld_arg/1"`
+if test -n "$cercs_cv_ffs_link_arg"; then
+arg=$cercs_cv_ffs_link_arg
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $new_flags | grep -c "$no_dash_arg"` -eq 0; then
+root=`echo libffs.la | sed 's/\..*//'`
+if test ! -r $cercs_cv_ffs_link_dir/$root.la; then
+if eval "test \"\${LIBTOOL+set}\" = set"; then
+arg="$cercs_cv_ffs_link_arg "`echo $cercs_cv_ffs_link_dir | sed "/./ s/^/-R/1"`
+fi
+fi
+if test `echo $arg | grep -c "ffs"` -eq 0; then
+new_flags="$new_flags $arg"
+else
+new_flags="$arg $new_flags"
+fi
+fi
+DT_LDFLAGS=$new_flags
+fi
+
+
+fi
+
+
+
+
+if test -z "$with_local_specified"; then
+
+
+
+
+# Check whether --with-gen_thread or --without-gen_thread was given.
+if test "${with_gen_thread+set}" = set; then
+  withval="$with_gen_thread"
+
+fi;
+
+if test -n "$with_gen_thread"; then
+unset cercs_cv_gen_thread_include_arg
+unset cercs_cv_gen_thread_link_arg
+if test `echo $with_gen_thread | sed 's/\(.\).*/\1/g'` != "/"; then
+with_gen_thread=`pwd`/$with_gen_thread
+fi
+fi
+echo "$as_me:$LINENO: checking needed include args for gen_thread package" >&5
+echo $ECHO_N "checking needed include args for gen_thread package... $ECHO_C" >&6
+if test "${cercs_cv_gen_thread_include_arg+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+
+
+cercs_tmp=""
+search_list="./gen_thread.h"
+CHAOS_HOMEDIR=""
+if test -n "$CSH"; then
+CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf  2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR=""
+fi
+if test -n "$with_gen_thread"; then
+if test `echo $with_gen_thread | cut -c1` = "~"; then
+EXPANDED=`echo "echo $with_gen_thread" | csh -sf 2>/dev/null` || EXPANDED=""
+else
+EXPANDED=$with_gen_thread
+fi
+
+echo "Datatap = $datatap_dir"
+
+search_list="$datatap_dir/gen_thread.h $datatap_dir/lib/gen_thread.h $datatap_dir/include/gen_thread.h $search_list $EXPANDED/gen_thread.h $EXPANDED/include/gen_thread.h $EXPANDED/share/gen_thread.h $EXPANDED/$cercs_cv_archive/gen_thread.h $EXPANDED/$cercs_cv_archive/include/gen_thread.h $EXPANDED/gen_thread/gen_thread.h $EXPANDED/gen_thread/$cercs_cv_archive/gen_thread.h $EXPANDED/gen_thread/include/gen_thread.h $EXPANDED/gen_thread/include/$cercs_cv_archive/gen_thread.h"
+fi
+if test -z "$with_installed_specified"; then
+search_list="$search_list `pwd`/../gen_thread/gen_thread.h `pwd`/../include/gen_thread.h `pwd`/../share/gen_thread.h"
+if test "$CHAOS_HOMEDIR" != "$HOME"; then
+search_list="$search_list $HOME/gen_thread/gen_thread.h $HOME/$cercs_cv_archive/include/gen_thread.h $HOME/include/gen_thread.h"
+fi
+fi
+if test -n "$CHAOS_HOMEDIR" -a -n "$cercs_cv_archive"; then
+search_list="$search_list $CHAOS_HOMEDIR/$cercs_cv_archive/gen_thread/include/gen_thread.h $CHAOS_HOMEDIR/$cercs_cv_archive/include/gen_thread.h $CHAOS_HOMEDIR/gen_thread/$cercs_cv_archive/include/gen_thread.h $CHAOS_HOMEDIR/gen_thread/include/gen_thread.h $CHAOS_HOMEDIR/include/gen_thread.h"
+fi
+if test "$libdir" != '${exec_prefix}/lib'; then
+tmpdir=`echo ${libdir} |  sed 's%/$%%'`
+search_list="$tmpdir/gen_thread.h $search_list"
+fi
+if test "$exec_prefix" != "NONE"; then
+tmpdir=`echo ${exec_prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/gen_thread.h $search_list"
+fi
+if test "$includedir" != '${prefix}/include'; then
+tmpdir=`echo ${includedir} |  sed 's%/$%%'`
+search_list="$tmpdir/gen_thread.h $search_list"
+fi
+if test "$prefix" != "NONE"; then
+tmpdir=`echo ${prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/include/gen_thread.h $search_list"
+fi
+if test "include" == "lib"; then
+  for tmp_lib_value in $sys_lib_search_path_spec; do
+     search_list="$search_list $tmp_lib_value/gen_thread.h"
+  done
+fi
+
+search_list="$datatap_dir/gen_thread.h $datatap_dir/lib/gen_thread.h $datatap_dir/include/gen_thread.h $search_list /usr/include/gen_thread.h /usr/local/include/gen_thread.h /opt/gen_thread/include/gen_thread.h /opt/misc/include/gen_thread.h /opt/misc/include/$cercs_cv_archive/gen_thread.h"
+tmp_search_results=""
+echo "configure:28862: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:28866: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "/usr/include/gen_thread.h"; then
+cercs_cv_gen_thread_include_arg=-I`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s#.gen_thread.h##g"`
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_gen_thread_include_arg" >&5
+echo "${ECHO_T}$cercs_cv_gen_thread_include_arg" >&6
+if test -n "$cercs_cv_gen_thread_include_arg"; then
+arg="$cercs_cv_gen_thread_include_arg"
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $DT_CPPFLAGS | grep -c "$no_dash_arg"` -eq 0; then
+if test `echo $arg | grep -c "gen_thread"` -eq 0; then
+DT_CPPFLAGS="$DT_CPPFLAGS $arg";
+else
+DT_CPPFLAGS="$arg $DT_CPPFLAGS"
+fi
+fi
+fi
+
+echo "$as_me:$LINENO: checking needed link args for gen_thread package" >&5
+echo $ECHO_N "checking needed link args for gen_thread package... $ECHO_C" >&6
+if test "${cercs_cv_gen_thread_link_dir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+
+
+cercs_tmp=""
+search_list="./libgen_thread.la"
+CHAOS_HOMEDIR=""
+if test -n "$CSH"; then
+CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf  2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR=""
+fi
+if test -n "$with_gen_thread"; then
+if test `echo $with_gen_thread | cut -c1` = "~"; then
+EXPANDED=`echo "echo $with_gen_thread" | csh -sf 2>/dev/null` || EXPANDED=""
+else
+EXPANDED=$with_gen_thread
+fi
+
+echo "Datatap = $datatap_dir"
+
+search_list="$datatap_dir/libgen_thread.la $datatap_dir/lib/libgen_thread.la $datatap_dir/include/libgen_thread.la $search_list $EXPANDED/libgen_thread.la $EXPANDED/lib/libgen_thread.la $EXPANDED/share/libgen_thread.la $EXPANDED/$cercs_cv_archive/libgen_thread.la $EXPANDED/$cercs_cv_archive/lib/libgen_thread.la $EXPANDED/gen_thread/libgen_thread.la $EXPANDED/gen_thread/$cercs_cv_archive/libgen_thread.la $EXPANDED/gen_thread/lib/libgen_thread.la $EXPANDED/gen_thread/lib/$cercs_cv_archive/ [...]
+fi
+if test -z "$with_installed_specified"; then
+search_list="$search_list `pwd`/../gen_thread/libgen_thread.la `pwd`/../lib/libgen_thread.la `pwd`/../share/libgen_thread.la"
+if test "$CHAOS_HOMEDIR" != "$HOME"; then
+search_list="$search_list $HOME/gen_thread/libgen_thread.la $HOME/$cercs_cv_archive/lib/libgen_thread.la $HOME/lib/libgen_thread.la"
+fi
+fi
+if test -n "$CHAOS_HOMEDIR" -a -n "$cercs_cv_archive"; then
+search_list="$search_list $CHAOS_HOMEDIR/$cercs_cv_archive/gen_thread/lib/libgen_thread.la $CHAOS_HOMEDIR/$cercs_cv_archive/lib/libgen_thread.la $CHAOS_HOMEDIR/gen_thread/$cercs_cv_archive/lib/libgen_thread.la $CHAOS_HOMEDIR/gen_thread/lib/libgen_thread.la $CHAOS_HOMEDIR/lib/libgen_thread.la"
+fi
+if test "$libdir" != '${exec_prefix}/lib'; then
+tmpdir=`echo ${libdir} |  sed 's%/$%%'`
+search_list="$tmpdir/libgen_thread.la $search_list"
+fi
+if test "$exec_prefix" != "NONE"; then
+tmpdir=`echo ${exec_prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/libgen_thread.la $search_list"
+fi
+if test "$includedir" != '${prefix}/include'; then
+tmpdir=`echo ${includedir} |  sed 's%/$%%'`
+search_list="$tmpdir/libgen_thread.la $search_list"
+fi
+if test "$prefix" != "NONE"; then
+tmpdir=`echo ${prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/libgen_thread.la $search_list"
+fi
+if test "lib" == "lib"; then
+  for tmp_lib_value in $sys_lib_search_path_spec; do
+     search_list="$search_list $tmp_lib_value/libgen_thread.la"
+  done
+fi
+
+search_list="$datatap_dir/libgen_thread.la $datatap_dir/lib/libgen_thread.la $datatap_dir/include/libgen_thread.la $search_list /usr/lib/libgen_thread.la /usr/local/lib/libgen_thread.la /opt/gen_thread/lib/libgen_thread.la /opt/misc/lib/libgen_thread.la /opt/misc/lib/$cercs_cv_archive/libgen_thread.la"
+tmp_search_results=""
+echo "configure:28954: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:28958: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "libgen_thread.la"; then
+cercs_cv_gen_thread_link_dir=`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s/.libgen_thread.la//g"`
+else
+cercs_cv_gen_thread_link_dir=""
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_gen_thread_link_dir" >&5
+echo "${ECHO_T}$cercs_cv_gen_thread_link_dir" >&6
+ld_arg="-L"
+new_flags=$LDFLAGS
+cercs_cv_gen_thread_link_arg=`echo $cercs_cv_gen_thread_link_dir | sed "/./ s/^/$ld_arg/1"`
+if test -n "$cercs_cv_gen_thread_link_arg"; then
+arg=$cercs_cv_gen_thread_link_arg
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $new_flags | grep -c "$no_dash_arg"` -eq 0; then
+root=`echo libgen_thread.la | sed 's/\..*//'`
+if test ! -r $cercs_cv_gen_thread_link_dir/$root.la; then
+if eval "test \"\${LIBTOOL+set}\" = set"; then
+arg="$cercs_cv_gen_thread_link_arg "`echo $cercs_cv_gen_thread_link_dir | sed "/./ s/^/-R/1"`
+fi
+fi
+if test `echo $arg | grep -c "gen_thread"` -eq 0; then
+new_flags="$new_flags $arg"
+else
+new_flags="$arg $new_flags"
+fi
+fi
+DT_LDFLAGS=$new_flags
+fi
+
+
+else
+
+
+
+
+# Check whether --with-gen_thread or --without-gen_thread was given.
+if test "${with_gen_thread+set}" = set; then
+  withval="$with_gen_thread"
+
+fi;
+
+if test -n "$with_gen_thread"; then
+unset cercs_cv_gen_thread_include_arg
+unset cercs_cv_gen_thread_link_arg
+if test `echo $with_gen_thread | sed 's/\(.\).*/\1/g'` != "/"; then
+with_gen_thread=`pwd`/$with_gen_thread
+fi
+fi
+echo "$as_me:$LINENO: checking needed include args for gen_thread package" >&5
+echo $ECHO_N "checking needed include args for gen_thread package... $ECHO_C" >&6
+if test "${cercs_cv_gen_thread_include_arg+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+search_list="$PWD/../gen_thread $PWD/../../gen_thread $PWD/../../../gen_thread"
+tmp_search_results=""
+echo "configure:29027: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:29031: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "/usr/include/gen_thread.h"; then
+cercs_cv_gen_thread_include_arg=-I`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s#.gen_thread.h##g"`
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_gen_thread_include_arg" >&5
+echo "${ECHO_T}$cercs_cv_gen_thread_include_arg" >&6
+if test -n "$cercs_cv_gen_thread_include_arg"; then
+arg="$cercs_cv_gen_thread_include_arg"
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $DT_CPPFLAGS | grep -c "$no_dash_arg"` -eq 0; then
+if test `echo $arg | grep -c "gen_thread"` -eq 0; then
+DT_CPPFLAGS="$DT_CPPFLAGS $arg";
+else
+DT_CPPFLAGS="$arg $DT_CPPFLAGS"
+fi
+fi
+fi
+
+echo "$as_me:$LINENO: checking needed link args for gen_thread package" >&5
+echo $ECHO_N "checking needed link args for gen_thread package... $ECHO_C" >&6
+if test "${cercs_cv_gen_thread_link_dir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+search_list="$PWD/../gen_thread $PWD/../../gen_thread $PWD/../../../gen_thread"
+tmp_search_results=""
+echo "configure:29069: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:29073: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "libgen_thread.la"; then
+cercs_cv_gen_thread_link_dir=`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s/.libgen_thread.la//g"`
+else
+cercs_cv_gen_thread_link_dir=""
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_gen_thread_link_dir" >&5
+echo "${ECHO_T}$cercs_cv_gen_thread_link_dir" >&6
+ld_arg="-L"
+new_flags=$LDFLAGS
+cercs_cv_gen_thread_link_arg=`echo $cercs_cv_gen_thread_link_dir | sed "/./ s/^/$ld_arg/1"`
+if test -n "$cercs_cv_gen_thread_link_arg"; then
+arg=$cercs_cv_gen_thread_link_arg
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $new_flags | grep -c "$no_dash_arg"` -eq 0; then
+root=`echo libgen_thread.la | sed 's/\..*//'`
+if test ! -r $cercs_cv_gen_thread_link_dir/$root.la; then
+if eval "test \"\${LIBTOOL+set}\" = set"; then
+arg="$cercs_cv_gen_thread_link_arg "`echo $cercs_cv_gen_thread_link_dir | sed "/./ s/^/-R/1"`
+fi
+fi
+if test `echo $arg | grep -c "gen_thread"` -eq 0; then
+new_flags="$new_flags $arg"
+else
+new_flags="$arg $new_flags"
+fi
+fi
+DT_LDFLAGS=$new_flags
+fi
+
+
+fi
+
+		if test -n "$cercs_cv_ibpbio_link_dir";then
+			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ibpbio_link_dir"
+			DT_LIBS="$DT_LIBS -libclient"
+			datatap=ibverbs
+		else
+			temptest=disable
+		fi
+		if test -n "$cercs_cv_ffs_link_dir";then
+                   	DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ffs_link_dir"
+			DT_LIBS="$DT_LIBS -lgen_thread"
+			datatap=ibverbs
+		else
+			temptest=disable
+		fi
+		if test -n "$cercs_cv_gen_thread_link_dir";then
+			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_gen_thread_link_dir"
+			DT_LIBS="$DT_LIBS -lgen_thread"
+			datatap=ibverbs
+		else
+			temptest=disable
+		fi
+
+        elif test x"$ac_with_portals" = xyes; then
+
+
+
+if test -z "$with_local_specified"; then
+
+
+
+
+# Check whether --with-ptlpbio or --without-ptlpbio was given.
+if test "${with_ptlpbio+set}" = set; then
+  withval="$with_ptlpbio"
+
+fi;
+
+if test -n "$with_ptlpbio"; then
+unset cercs_cv_ptlpbio_include_arg
+unset cercs_cv_ptlpbio_link_arg
+if test `echo $with_ptlpbio | sed 's/\(.\).*/\1/g'` != "/"; then
+with_ptlpbio=`pwd`/$with_ptlpbio
+fi
+fi
+echo "$as_me:$LINENO: checking needed include args for ptlpbio package" >&5
+echo $ECHO_N "checking needed include args for ptlpbio package... $ECHO_C" >&6
+if test "${cercs_cv_ptlpbio_include_arg+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+
+
+cercs_tmp=""
+search_list="./thin_portal.h"
+CHAOS_HOMEDIR=""
+if test -n "$CSH"; then
+CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf  2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR=""
+fi
+if test -n "$with_ptlpbio"; then
+if test `echo $with_ptlpbio | cut -c1` = "~"; then
+EXPANDED=`echo "echo $with_ptlpbio" | csh -sf 2>/dev/null` || EXPANDED=""
+else
+EXPANDED=$with_ptlpbio
+fi
+
+echo "Datatap = $datatap_dir"
+
+search_list="$datatap_dir/thin_portal.h $datatap_dir/lib/thin_portal.h $datatap_dir/include/thin_portal.h $search_list $EXPANDED/thin_portal.h $EXPANDED/include/thin_portal.h $EXPANDED/share/thin_portal.h $EXPANDED/$cercs_cv_archive/thin_portal.h $EXPANDED/$cercs_cv_archive/include/thin_portal.h $EXPANDED/ptlpbio/thin_portal.h $EXPANDED/ptlpbio/$cercs_cv_archive/thin_portal.h $EXPANDED/ptlpbio/include/thin_portal.h $EXPANDED/ptlpbio/include/$cercs_cv_archive/thin_portal.h"
+fi
+if test -z "$with_installed_specified"; then
+search_list="$search_list `pwd`/../ptlpbio/thin_portal.h `pwd`/../include/thin_portal.h `pwd`/../share/thin_portal.h"
+if test "$CHAOS_HOMEDIR" != "$HOME"; then
+search_list="$search_list $HOME/ptlpbio/thin_portal.h $HOME/$cercs_cv_archive/include/thin_portal.h $HOME/include/thin_portal.h"
+fi
+fi
+if test -n "$CHAOS_HOMEDIR" -a -n "$cercs_cv_archive"; then
+search_list="$search_list $CHAOS_HOMEDIR/$cercs_cv_archive/ptlpbio/include/thin_portal.h $CHAOS_HOMEDIR/$cercs_cv_archive/include/thin_portal.h $CHAOS_HOMEDIR/ptlpbio/$cercs_cv_archive/include/thin_portal.h $CHAOS_HOMEDIR/ptlpbio/include/thin_portal.h $CHAOS_HOMEDIR/include/thin_portal.h"
+fi
+if test "$libdir" != '${exec_prefix}/lib'; then
+tmpdir=`echo ${libdir} |  sed 's%/$%%'`
+search_list="$tmpdir/thin_portal.h $search_list"
+fi
+if test "$exec_prefix" != "NONE"; then
+tmpdir=`echo ${exec_prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/thin_portal.h $search_list"
+fi
+if test "$includedir" != '${prefix}/include'; then
+tmpdir=`echo ${includedir} |  sed 's%/$%%'`
+search_list="$tmpdir/thin_portal.h $search_list"
+fi
+if test "$prefix" != "NONE"; then
+tmpdir=`echo ${prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/include/thin_portal.h $search_list"
+fi
+if test "include" == "lib"; then
+  for tmp_lib_value in $sys_lib_search_path_spec; do
+     search_list="$search_list $tmp_lib_value/thin_portal.h"
+  done
+fi
+
+search_list="$datatap_dir/thin_portal.h $datatap_dir/lib/thin_portal.h $datatap_dir/include/thin_portal.h $search_list /usr/include/thin_portal.h /usr/local/include/thin_portal.h /opt/ptlpbio/include/thin_portal.h /opt/misc/include/thin_portal.h /opt/misc/include/$cercs_cv_archive/thin_portal.h"
+tmp_search_results=""
+echo "configure:29220: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:29224: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "/usr/include/thin_portal.h"; then
+cercs_cv_ptlpbio_include_arg=-I`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s#.thin_portal.h##g"`
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ptlpbio_include_arg" >&5
+echo "${ECHO_T}$cercs_cv_ptlpbio_include_arg" >&6
+if test -n "$cercs_cv_ptlpbio_include_arg"; then
+arg="$cercs_cv_ptlpbio_include_arg"
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $DT_CPPFLAGS | grep -c "$no_dash_arg"` -eq 0; then
+if test `echo $arg | grep -c "ptlpbio"` -eq 0; then
+DT_CPPFLAGS="$DT_CPPFLAGS $arg";
+else
+DT_CPPFLAGS="$arg $DT_CPPFLAGS"
+fi
+fi
+fi
+
+echo "$as_me:$LINENO: checking needed link args for ptlpbio package" >&5
+echo $ECHO_N "checking needed link args for ptlpbio package... $ECHO_C" >&6
+if test "${cercs_cv_ptlpbio_link_dir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+
+
+cercs_tmp=""
+search_list="./libptlclient.a"
+CHAOS_HOMEDIR=""
+if test -n "$CSH"; then
+CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf  2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR=""
+fi
+if test -n "$with_ptlpbio"; then
+if test `echo $with_ptlpbio | cut -c1` = "~"; then
+EXPANDED=`echo "echo $with_ptlpbio" | csh -sf 2>/dev/null` || EXPANDED=""
+else
+EXPANDED=$with_ptlpbio
+fi
+
+echo "Datatap = $datatap_dir"
+
+search_list="$datatap_dir/libptlclient.a $datatap_dir/lib/libptlclient.a $datatap_dir/include/libptlclient.a $search_list $EXPANDED/libptlclient.a $EXPANDED/lib/libptlclient.a $EXPANDED/share/libptlclient.a $EXPANDED/$cercs_cv_archive/libptlclient.a $EXPANDED/$cercs_cv_archive/lib/libptlclient.a $EXPANDED/ptlpbio/libptlclient.a $EXPANDED/ptlpbio/$cercs_cv_archive/libptlclient.a $EXPANDED/ptlpbio/lib/libptlclient.a $EXPANDED/ptlpbio/lib/$cercs_cv_archive/libptlclient.a"
+fi
+if test -z "$with_installed_specified"; then
+search_list="$search_list `pwd`/../ptlpbio/libptlclient.a `pwd`/../lib/libptlclient.a `pwd`/../share/libptlclient.a"
+if test "$CHAOS_HOMEDIR" != "$HOME"; then
+search_list="$search_list $HOME/ptlpbio/libptlclient.a $HOME/$cercs_cv_archive/lib/libptlclient.a $HOME/lib/libptlclient.a"
+fi
+fi
+if test -n "$CHAOS_HOMEDIR" -a -n "$cercs_cv_archive"; then
+search_list="$search_list $CHAOS_HOMEDIR/$cercs_cv_archive/ptlpbio/lib/libptlclient.a $CHAOS_HOMEDIR/$cercs_cv_archive/lib/libptlclient.a $CHAOS_HOMEDIR/ptlpbio/$cercs_cv_archive/lib/libptlclient.a $CHAOS_HOMEDIR/ptlpbio/lib/libptlclient.a $CHAOS_HOMEDIR/lib/libptlclient.a"
+fi
+if test "$libdir" != '${exec_prefix}/lib'; then
+tmpdir=`echo ${libdir} |  sed 's%/$%%'`
+search_list="$tmpdir/libptlclient.a $search_list"
+fi
+if test "$exec_prefix" != "NONE"; then
+tmpdir=`echo ${exec_prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/libptlclient.a $search_list"
+fi
+if test "$includedir" != '${prefix}/include'; then
+tmpdir=`echo ${includedir} |  sed 's%/$%%'`
+search_list="$tmpdir/libptlclient.a $search_list"
+fi
+if test "$prefix" != "NONE"; then
+tmpdir=`echo ${prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/libptlclient.a $search_list"
+fi
+if test "lib" == "lib"; then
+  for tmp_lib_value in $sys_lib_search_path_spec; do
+     search_list="$search_list $tmp_lib_value/libptlclient.a"
+  done
+fi
+
+search_list="$datatap_dir/libptlclient.a $datatap_dir/lib/libptlclient.a $datatap_dir/include/libptlclient.a $search_list /usr/lib/libptlclient.a /usr/local/lib/libptlclient.a /opt/ptlpbio/lib/libptlclient.a /opt/misc/lib/libptlclient.a /opt/misc/lib/$cercs_cv_archive/libptlclient.a"
+tmp_search_results=""
+echo "configure:29312: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:29316: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "libptlclient.a"; then
+cercs_cv_ptlpbio_link_dir=`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s/.libptlclient.a//g"`
+else
+cercs_cv_ptlpbio_link_dir=""
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ptlpbio_link_dir" >&5
+echo "${ECHO_T}$cercs_cv_ptlpbio_link_dir" >&6
+ld_arg="-L"
+new_flags=$LDFLAGS
+cercs_cv_ptlpbio_link_arg=`echo $cercs_cv_ptlpbio_link_dir | sed "/./ s/^/$ld_arg/1"`
+if test -n "$cercs_cv_ptlpbio_link_arg"; then
+arg=$cercs_cv_ptlpbio_link_arg
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $new_flags | grep -c "$no_dash_arg"` -eq 0; then
+root=`echo libptlclient.a | sed 's/\..*//'`
+if test ! -r $cercs_cv_ptlpbio_link_dir/$root.la; then
+if eval "test \"\${LIBTOOL+set}\" = set"; then
+arg="$cercs_cv_ptlpbio_link_arg "`echo $cercs_cv_ptlpbio_link_dir | sed "/./ s/^/-R/1"`
+fi
+fi
+if test `echo $arg | grep -c "ptlpbio"` -eq 0; then
+new_flags="$new_flags $arg"
+else
+new_flags="$arg $new_flags"
+fi
+fi
+DT_LDFLAGS=$new_flags
+fi
+
+
+else
+
+
+
+
+# Check whether --with-ptlpbio or --without-ptlpbio was given.
+if test "${with_ptlpbio+set}" = set; then
+  withval="$with_ptlpbio"
+
+fi;
+
+if test -n "$with_ptlpbio"; then
+unset cercs_cv_ptlpbio_include_arg
+unset cercs_cv_ptlpbio_link_arg
+if test `echo $with_ptlpbio | sed 's/\(.\).*/\1/g'` != "/"; then
+with_ptlpbio=`pwd`/$with_ptlpbio
+fi
+fi
+echo "$as_me:$LINENO: checking needed include args for ptlpbio package" >&5
+echo $ECHO_N "checking needed include args for ptlpbio package... $ECHO_C" >&6
+if test "${cercs_cv_ptlpbio_include_arg+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+search_list="$PWD/../ptlpbio $PWD/../../ptlpbio $PWD/../../../ptlpbio"
+tmp_search_results=""
+echo "configure:29385: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:29389: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "/usr/include/thin_portal.h"; then
+cercs_cv_ptlpbio_include_arg=-I`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s#.thin_portal.h##g"`
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ptlpbio_include_arg" >&5
+echo "${ECHO_T}$cercs_cv_ptlpbio_include_arg" >&6
+if test -n "$cercs_cv_ptlpbio_include_arg"; then
+arg="$cercs_cv_ptlpbio_include_arg"
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $DT_CPPFLAGS | grep -c "$no_dash_arg"` -eq 0; then
+if test `echo $arg | grep -c "ptlpbio"` -eq 0; then
+DT_CPPFLAGS="$DT_CPPFLAGS $arg";
+else
+DT_CPPFLAGS="$arg $DT_CPPFLAGS"
+fi
+fi
+fi
+
+echo "$as_me:$LINENO: checking needed link args for ptlpbio package" >&5
+echo $ECHO_N "checking needed link args for ptlpbio package... $ECHO_C" >&6
+if test "${cercs_cv_ptlpbio_link_dir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+search_list="$PWD/../ptlpbio $PWD/../../ptlpbio $PWD/../../../ptlpbio"
+tmp_search_results=""
+echo "configure:29427: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:29431: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "libptlclient.a"; then
+cercs_cv_ptlpbio_link_dir=`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s/.libptlclient.a//g"`
+else
+cercs_cv_ptlpbio_link_dir=""
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ptlpbio_link_dir" >&5
+echo "${ECHO_T}$cercs_cv_ptlpbio_link_dir" >&6
+ld_arg="-L"
+new_flags=$LDFLAGS
+cercs_cv_ptlpbio_link_arg=`echo $cercs_cv_ptlpbio_link_dir | sed "/./ s/^/$ld_arg/1"`
+if test -n "$cercs_cv_ptlpbio_link_arg"; then
+arg=$cercs_cv_ptlpbio_link_arg
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $new_flags | grep -c "$no_dash_arg"` -eq 0; then
+root=`echo libptlclient.a | sed 's/\..*//'`
+if test ! -r $cercs_cv_ptlpbio_link_dir/$root.la; then
+if eval "test \"\${LIBTOOL+set}\" = set"; then
+arg="$cercs_cv_ptlpbio_link_arg "`echo $cercs_cv_ptlpbio_link_dir | sed "/./ s/^/-R/1"`
+fi
+fi
+if test `echo $arg | grep -c "ptlpbio"` -eq 0; then
+new_flags="$new_flags $arg"
+else
+new_flags="$arg $new_flags"
+fi
+fi
+DT_LDFLAGS=$new_flags
+fi
+
+
+fi
+
+
+		if test -n "$cercs_cv_ptlpbio_link_dir";then
+			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ptlpbio_link_dir"
+			DT_LIBS="$DT_LIBS -lptlclient"
+			datatap=portals
+		else
+			temptest=disable
+		fi
+
+	else
+		echo "Neither portals nor infiniband found. Disabling datatap"
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_DATATAP 1
+_ACEOF
+
+		datatap=disable
+		temptest=disable
+	fi
+else
+	{ echo "$as_me:$LINENO: Datatap with custom library path: $withval" >&5
+echo "$as_me: Datatap with custom library path: $withval" >&6;}
+
+	datatap_dir=$withval
+
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_DATATAP 0
+_ACEOF
+
+
+	if test x"$ac_with_infiniband" = xyes; then
+
+
+
+if test -z "$with_local_specified"; then
+
+
+
+
+# Check whether --with-ibpbio or --without-ibpbio was given.
+if test "${with_ibpbio+set}" = set; then
+  withval="$with_ibpbio"
+
+fi;
+
+if test -n "$with_ibpbio"; then
+unset cercs_cv_ibpbio_include_arg
+unset cercs_cv_ibpbio_link_arg
+if test `echo $with_ibpbio | sed 's/\(.\).*/\1/g'` != "/"; then
+with_ibpbio=`pwd`/$with_ibpbio
+fi
+fi
+echo "$as_me:$LINENO: checking needed include args for ibpbio package" >&5
+echo $ECHO_N "checking needed include args for ibpbio package... $ECHO_C" >&6
+if test "${cercs_cv_ibpbio_include_arg+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+
+
+cercs_tmp=""
+search_list="./thin_ib.h"
+CHAOS_HOMEDIR=""
+if test -n "$CSH"; then
+CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf  2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR=""
+fi
+if test -n "$with_ibpbio"; then
+if test `echo $with_ibpbio | cut -c1` = "~"; then
+EXPANDED=`echo "echo $with_ibpbio" | csh -sf 2>/dev/null` || EXPANDED=""
+else
+EXPANDED=$with_ibpbio
+fi
+
+echo "Datatap = $datatap_dir"
+
+search_list="$datatap_dir/thin_ib.h $datatap_dir/lib/thin_ib.h $datatap_dir/include/thin_ib.h $search_list $EXPANDED/thin_ib.h $EXPANDED/include/thin_ib.h $EXPANDED/share/thin_ib.h $EXPANDED/$cercs_cv_archive/thin_ib.h $EXPANDED/$cercs_cv_archive/include/thin_ib.h $EXPANDED/ibpbio/thin_ib.h $EXPANDED/ibpbio/$cercs_cv_archive/thin_ib.h $EXPANDED/ibpbio/include/thin_ib.h $EXPANDED/ibpbio/include/$cercs_cv_archive/thin_ib.h"
+fi
+if test -z "$with_installed_specified"; then
+search_list="$search_list `pwd`/../ibpbio/thin_ib.h `pwd`/../include/thin_ib.h `pwd`/../share/thin_ib.h"
+if test "$CHAOS_HOMEDIR" != "$HOME"; then
+search_list="$search_list $HOME/ibpbio/thin_ib.h $HOME/$cercs_cv_archive/include/thin_ib.h $HOME/include/thin_ib.h"
+fi
+fi
+if test -n "$CHAOS_HOMEDIR" -a -n "$cercs_cv_archive"; then
+search_list="$search_list $CHAOS_HOMEDIR/$cercs_cv_archive/ibpbio/include/thin_ib.h $CHAOS_HOMEDIR/$cercs_cv_archive/include/thin_ib.h $CHAOS_HOMEDIR/ibpbio/$cercs_cv_archive/include/thin_ib.h $CHAOS_HOMEDIR/ibpbio/include/thin_ib.h $CHAOS_HOMEDIR/include/thin_ib.h"
+fi
+if test "$libdir" != '${exec_prefix}/lib'; then
+tmpdir=`echo ${libdir} |  sed 's%/$%%'`
+search_list="$tmpdir/thin_ib.h $search_list"
+fi
+if test "$exec_prefix" != "NONE"; then
+tmpdir=`echo ${exec_prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/thin_ib.h $search_list"
+fi
+if test "$includedir" != '${prefix}/include'; then
+tmpdir=`echo ${includedir} |  sed 's%/$%%'`
+search_list="$tmpdir/thin_ib.h $search_list"
+fi
+if test "$prefix" != "NONE"; then
+tmpdir=`echo ${prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/include/thin_ib.h $search_list"
+fi
+if test "include" == "lib"; then
+  for tmp_lib_value in $sys_lib_search_path_spec; do
+     search_list="$search_list $tmp_lib_value/thin_ib.h"
+  done
+fi
+
+search_list="$datatap_dir/thin_ib.h $datatap_dir/lib/thin_ib.h $datatap_dir/include/thin_ib.h $search_list /usr/include/thin_ib.h /usr/local/include/thin_ib.h /opt/ibpbio/include/thin_ib.h /opt/misc/include/thin_ib.h /opt/misc/include/$cercs_cv_archive/thin_ib.h"
+tmp_search_results=""
+echo "configure:29587: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:29591: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "/usr/include/thin_ib.h"; then
+cercs_cv_ibpbio_include_arg=-I`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s#.thin_ib.h##g"`
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ibpbio_include_arg" >&5
+echo "${ECHO_T}$cercs_cv_ibpbio_include_arg" >&6
+if test -n "$cercs_cv_ibpbio_include_arg"; then
+arg="$cercs_cv_ibpbio_include_arg"
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $DT_CPPFLAGS | grep -c "$no_dash_arg"` -eq 0; then
+if test `echo $arg | grep -c "ibpbio"` -eq 0; then
+DT_CPPFLAGS="$DT_CPPFLAGS $arg";
+else
+DT_CPPFLAGS="$arg $DT_CPPFLAGS"
+fi
+fi
+fi
+
+echo "$as_me:$LINENO: checking needed link args for ibpbio package" >&5
+echo $ECHO_N "checking needed link args for ibpbio package... $ECHO_C" >&6
+if test "${cercs_cv_ibpbio_link_dir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+
+
+cercs_tmp=""
+search_list="./libibclient.la"
+CHAOS_HOMEDIR=""
+if test -n "$CSH"; then
+CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf  2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR=""
+fi
+if test -n "$with_ibpbio"; then
+if test `echo $with_ibpbio | cut -c1` = "~"; then
+EXPANDED=`echo "echo $with_ibpbio" | csh -sf 2>/dev/null` || EXPANDED=""
+else
+EXPANDED=$with_ibpbio
+fi
+
+echo "Datatap = $datatap_dir"
+
+search_list="$datatap_dir/libibclient.la $datatap_dir/lib/libibclient.la $datatap_dir/include/libibclient.la $search_list $EXPANDED/libibclient.la $EXPANDED/lib/libibclient.la $EXPANDED/share/libibclient.la $EXPANDED/$cercs_cv_archive/libibclient.la $EXPANDED/$cercs_cv_archive/lib/libibclient.la $EXPANDED/ibpbio/libibclient.la $EXPANDED/ibpbio/$cercs_cv_archive/libibclient.la $EXPANDED/ibpbio/lib/libibclient.la $EXPANDED/ibpbio/lib/$cercs_cv_archive/libibclient.la"
+fi
+if test -z "$with_installed_specified"; then
+search_list="$search_list `pwd`/../ibpbio/libibclient.la `pwd`/../lib/libibclient.la `pwd`/../share/libibclient.la"
+if test "$CHAOS_HOMEDIR" != "$HOME"; then
+search_list="$search_list $HOME/ibpbio/libibclient.la $HOME/$cercs_cv_archive/lib/libibclient.la $HOME/lib/libibclient.la"
+fi
+fi
+if test -n "$CHAOS_HOMEDIR" -a -n "$cercs_cv_archive"; then
+search_list="$search_list $CHAOS_HOMEDIR/$cercs_cv_archive/ibpbio/lib/libibclient.la $CHAOS_HOMEDIR/$cercs_cv_archive/lib/libibclient.la $CHAOS_HOMEDIR/ibpbio/$cercs_cv_archive/lib/libibclient.la $CHAOS_HOMEDIR/ibpbio/lib/libibclient.la $CHAOS_HOMEDIR/lib/libibclient.la"
+fi
+if test "$libdir" != '${exec_prefix}/lib'; then
+tmpdir=`echo ${libdir} |  sed 's%/$%%'`
+search_list="$tmpdir/libibclient.la $search_list"
+fi
+if test "$exec_prefix" != "NONE"; then
+tmpdir=`echo ${exec_prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/libibclient.la $search_list"
+fi
+if test "$includedir" != '${prefix}/include'; then
+tmpdir=`echo ${includedir} |  sed 's%/$%%'`
+search_list="$tmpdir/libibclient.la $search_list"
+fi
+if test "$prefix" != "NONE"; then
+tmpdir=`echo ${prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/libibclient.la $search_list"
+fi
+if test "lib" == "lib"; then
+  for tmp_lib_value in $sys_lib_search_path_spec; do
+     search_list="$search_list $tmp_lib_value/libibclient.la"
+  done
+fi
+
+search_list="$datatap_dir/libibclient.la $datatap_dir/lib/libibclient.la $datatap_dir/include/libibclient.la $search_list /usr/lib/libibclient.la /usr/local/lib/libibclient.la /opt/ibpbio/lib/libibclient.la /opt/misc/lib/libibclient.la /opt/misc/lib/$cercs_cv_archive/libibclient.la"
+tmp_search_results=""
+echo "configure:29679: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:29683: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "libibclient.la"; then
+cercs_cv_ibpbio_link_dir=`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s/.libibclient.la//g"`
+else
+cercs_cv_ibpbio_link_dir=""
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ibpbio_link_dir" >&5
+echo "${ECHO_T}$cercs_cv_ibpbio_link_dir" >&6
+ld_arg="-L"
+new_flags=$LDFLAGS
+cercs_cv_ibpbio_link_arg=`echo $cercs_cv_ibpbio_link_dir | sed "/./ s/^/$ld_arg/1"`
+if test -n "$cercs_cv_ibpbio_link_arg"; then
+arg=$cercs_cv_ibpbio_link_arg
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $new_flags | grep -c "$no_dash_arg"` -eq 0; then
+root=`echo libibclient.la | sed 's/\..*//'`
+if test ! -r $cercs_cv_ibpbio_link_dir/$root.la; then
+if eval "test \"\${LIBTOOL+set}\" = set"; then
+arg="$cercs_cv_ibpbio_link_arg "`echo $cercs_cv_ibpbio_link_dir | sed "/./ s/^/-R/1"`
+fi
+fi
+if test `echo $arg | grep -c "ibpbio"` -eq 0; then
+new_flags="$new_flags $arg"
+else
+new_flags="$arg $new_flags"
+fi
+fi
+DT_LDFLAGS=$new_flags
+fi
+
+
+else
+
+
+
+
+# Check whether --with-ibpbio or --without-ibpbio was given.
+if test "${with_ibpbio+set}" = set; then
+  withval="$with_ibpbio"
+
+fi;
+
+if test -n "$with_ibpbio"; then
+unset cercs_cv_ibpbio_include_arg
+unset cercs_cv_ibpbio_link_arg
+if test `echo $with_ibpbio | sed 's/\(.\).*/\1/g'` != "/"; then
+with_ibpbio=`pwd`/$with_ibpbio
+fi
+fi
+echo "$as_me:$LINENO: checking needed include args for ibpbio package" >&5
+echo $ECHO_N "checking needed include args for ibpbio package... $ECHO_C" >&6
+if test "${cercs_cv_ibpbio_include_arg+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+search_list="$PWD/../ibpbio $PWD/../../ibpbio $PWD/../../../ibpbio"
+tmp_search_results=""
+echo "configure:29752: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:29756: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "/usr/include/thin_ib.h"; then
+cercs_cv_ibpbio_include_arg=-I`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s#.thin_ib.h##g"`
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ibpbio_include_arg" >&5
+echo "${ECHO_T}$cercs_cv_ibpbio_include_arg" >&6
+if test -n "$cercs_cv_ibpbio_include_arg"; then
+arg="$cercs_cv_ibpbio_include_arg"
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $DT_CPPFLAGS | grep -c "$no_dash_arg"` -eq 0; then
+if test `echo $arg | grep -c "ibpbio"` -eq 0; then
+DT_CPPFLAGS="$DT_CPPFLAGS $arg";
+else
+DT_CPPFLAGS="$arg $DT_CPPFLAGS"
+fi
+fi
+fi
+
+echo "$as_me:$LINENO: checking needed link args for ibpbio package" >&5
+echo $ECHO_N "checking needed link args for ibpbio package... $ECHO_C" >&6
+if test "${cercs_cv_ibpbio_link_dir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+search_list="$PWD/../ibpbio $PWD/../../ibpbio $PWD/../../../ibpbio"
+tmp_search_results=""
+echo "configure:29794: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:29798: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "libibclient.la"; then
+cercs_cv_ibpbio_link_dir=`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s/.libibclient.la//g"`
+else
+cercs_cv_ibpbio_link_dir=""
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ibpbio_link_dir" >&5
+echo "${ECHO_T}$cercs_cv_ibpbio_link_dir" >&6
+ld_arg="-L"
+new_flags=$LDFLAGS
+cercs_cv_ibpbio_link_arg=`echo $cercs_cv_ibpbio_link_dir | sed "/./ s/^/$ld_arg/1"`
+if test -n "$cercs_cv_ibpbio_link_arg"; then
+arg=$cercs_cv_ibpbio_link_arg
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $new_flags | grep -c "$no_dash_arg"` -eq 0; then
+root=`echo libibclient.la | sed 's/\..*//'`
+if test ! -r $cercs_cv_ibpbio_link_dir/$root.la; then
+if eval "test \"\${LIBTOOL+set}\" = set"; then
+arg="$cercs_cv_ibpbio_link_arg "`echo $cercs_cv_ibpbio_link_dir | sed "/./ s/^/-R/1"`
+fi
+fi
+if test `echo $arg | grep -c "ibpbio"` -eq 0; then
+new_flags="$new_flags $arg"
+else
+new_flags="$arg $new_flags"
+fi
+fi
+DT_LDFLAGS=$new_flags
+fi
+
+
+fi
+
+
+
+
+if test -z "$with_local_specified"; then
+
+
+
+
+# Check whether --with-ffs or --without-ffs was given.
+if test "${with_ffs+set}" = set; then
+  withval="$with_ffs"
+
+fi;
+
+if test -n "$with_ffs"; then
+unset cercs_cv_ffs_include_arg
+unset cercs_cv_ffs_link_arg
+if test `echo $with_ffs | sed 's/\(.\).*/\1/g'` != "/"; then
+with_ffs=`pwd`/$with_ffs
+fi
+fi
+echo "$as_me:$LINENO: checking needed include args for ffs package" >&5
+echo $ECHO_N "checking needed include args for ffs package... $ECHO_C" >&6
+if test "${cercs_cv_ffs_include_arg+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+
+
+cercs_tmp=""
+search_list="./ffs.h"
+CHAOS_HOMEDIR=""
+if test -n "$CSH"; then
+CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf  2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR=""
+fi
+if test -n "$with_ffs"; then
+if test `echo $with_ffs | cut -c1` = "~"; then
+EXPANDED=`echo "echo $with_ffs" | csh -sf 2>/dev/null` || EXPANDED=""
+else
+EXPANDED=$with_ffs
+fi
+
+echo "Datatap = $datatap_dir"
+
+search_list="$datatap_dir/ffs.h $datatap_dir/lib/ffs.h $datatap_dir/include/ffs.h $search_list $EXPANDED/ffs.h $EXPANDED/include/ffs.h $EXPANDED/share/ffs.h $EXPANDED/$cercs_cv_archive/ffs.h $EXPANDED/$cercs_cv_archive/include/ffs.h $EXPANDED/ffs/ffs.h $EXPANDED/ffs/$cercs_cv_archive/ffs.h $EXPANDED/ffs/include/ffs.h $EXPANDED/ffs/include/$cercs_cv_archive/ffs.h"
+fi
+if test -z "$with_installed_specified"; then
+search_list="$search_list `pwd`/../ffs/ffs.h `pwd`/../include/ffs.h `pwd`/../share/ffs.h"
+if test "$CHAOS_HOMEDIR" != "$HOME"; then
+search_list="$search_list $HOME/ffs/ffs.h $HOME/$cercs_cv_archive/include/ffs.h $HOME/include/ffs.h"
+fi
+fi
+if test -n "$CHAOS_HOMEDIR" -a -n "$cercs_cv_archive"; then
+search_list="$search_list $CHAOS_HOMEDIR/$cercs_cv_archive/ffs/include/ffs.h $CHAOS_HOMEDIR/$cercs_cv_archive/include/ffs.h $CHAOS_HOMEDIR/ffs/$cercs_cv_archive/include/ffs.h $CHAOS_HOMEDIR/ffs/include/ffs.h $CHAOS_HOMEDIR/include/ffs.h"
+fi
+if test "$libdir" != '${exec_prefix}/lib'; then
+tmpdir=`echo ${libdir} |  sed 's%/$%%'`
+search_list="$tmpdir/ffs.h $search_list"
+fi
+if test "$exec_prefix" != "NONE"; then
+tmpdir=`echo ${exec_prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/ffs.h $search_list"
+fi
+if test "$includedir" != '${prefix}/include'; then
+tmpdir=`echo ${includedir} |  sed 's%/$%%'`
+search_list="$tmpdir/ffs.h $search_list"
+fi
+if test "$prefix" != "NONE"; then
+tmpdir=`echo ${prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/include/ffs.h $search_list"
+fi
+if test "include" == "lib"; then
+  for tmp_lib_value in $sys_lib_search_path_spec; do
+     search_list="$search_list $tmp_lib_value/ffs.h"
+  done
+fi
+
+search_list="$datatap_dir/ffs.h $datatap_dir/lib/ffs.h $datatap_dir/include/ffs.h $search_list /usr/include/ffs.h /usr/local/include/ffs.h /opt/ffs/include/ffs.h /opt/misc/include/ffs.h /opt/misc/include/$cercs_cv_archive/ffs.h"
+tmp_search_results=""
+echo "configure:29922: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:29926: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "/usr/include/ffs.h"; then
+cercs_cv_ffs_include_arg=-I`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s#.ffs.h##g"`
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ffs_include_arg" >&5
+echo "${ECHO_T}$cercs_cv_ffs_include_arg" >&6
+if test -n "$cercs_cv_ffs_include_arg"; then
+arg="$cercs_cv_ffs_include_arg"
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $DT_CPPFLAGS | grep -c "$no_dash_arg"` -eq 0; then
+if test `echo $arg | grep -c "ffs"` -eq 0; then
+DT_CPPFLAGS="$DT_CPPFLAGS $arg";
+else
+DT_CPPFLAGS="$arg $DT_CPPFLAGS"
+fi
+fi
+fi
+
+echo "$as_me:$LINENO: checking needed link args for ffs package" >&5
+echo $ECHO_N "checking needed link args for ffs package... $ECHO_C" >&6
+if test "${cercs_cv_ffs_link_dir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+
+
+cercs_tmp=""
+search_list="./libffs.la"
+CHAOS_HOMEDIR=""
+if test -n "$CSH"; then
+CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf  2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR=""
+fi
+if test -n "$with_ffs"; then
+if test `echo $with_ffs | cut -c1` = "~"; then
+EXPANDED=`echo "echo $with_ffs" | csh -sf 2>/dev/null` || EXPANDED=""
+else
+EXPANDED=$with_ffs
+fi
+
+echo "Datatap = $datatap_dir"
+
+search_list="$datatap_dir/libffs.la $datatap_dir/lib/libffs.la $datatap_dir/include/libffs.la $search_list $EXPANDED/libffs.la $EXPANDED/lib/libffs.la $EXPANDED/share/libffs.la $EXPANDED/$cercs_cv_archive/libffs.la $EXPANDED/$cercs_cv_archive/lib/libffs.la $EXPANDED/ffs/libffs.la $EXPANDED/ffs/$cercs_cv_archive/libffs.la $EXPANDED/ffs/lib/libffs.la $EXPANDED/ffs/lib/$cercs_cv_archive/libffs.la"
+fi
+if test -z "$with_installed_specified"; then
+search_list="$search_list `pwd`/../ffs/libffs.la `pwd`/../lib/libffs.la `pwd`/../share/libffs.la"
+if test "$CHAOS_HOMEDIR" != "$HOME"; then
+search_list="$search_list $HOME/ffs/libffs.la $HOME/$cercs_cv_archive/lib/libffs.la $HOME/lib/libffs.la"
+fi
+fi
+if test -n "$CHAOS_HOMEDIR" -a -n "$cercs_cv_archive"; then
+search_list="$search_list $CHAOS_HOMEDIR/$cercs_cv_archive/ffs/lib/libffs.la $CHAOS_HOMEDIR/$cercs_cv_archive/lib/libffs.la $CHAOS_HOMEDIR/ffs/$cercs_cv_archive/lib/libffs.la $CHAOS_HOMEDIR/ffs/lib/libffs.la $CHAOS_HOMEDIR/lib/libffs.la"
+fi
+if test "$libdir" != '${exec_prefix}/lib'; then
+tmpdir=`echo ${libdir} |  sed 's%/$%%'`
+search_list="$tmpdir/libffs.la $search_list"
+fi
+if test "$exec_prefix" != "NONE"; then
+tmpdir=`echo ${exec_prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/libffs.la $search_list"
+fi
+if test "$includedir" != '${prefix}/include'; then
+tmpdir=`echo ${includedir} |  sed 's%/$%%'`
+search_list="$tmpdir/libffs.la $search_list"
+fi
+if test "$prefix" != "NONE"; then
+tmpdir=`echo ${prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/libffs.la $search_list"
+fi
+if test "lib" == "lib"; then
+  for tmp_lib_value in $sys_lib_search_path_spec; do
+     search_list="$search_list $tmp_lib_value/libffs.la"
+  done
+fi
+
+search_list="$datatap_dir/libffs.la $datatap_dir/lib/libffs.la $datatap_dir/include/libffs.la $search_list /usr/lib/libffs.la /usr/local/lib/libffs.la /opt/ffs/lib/libffs.la /opt/misc/lib/libffs.la /opt/misc/lib/$cercs_cv_archive/libffs.la"
+tmp_search_results=""
+echo "configure:30014: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:30018: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "libffs.la"; then
+cercs_cv_ffs_link_dir=`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s/.libffs.la//g"`
+else
+cercs_cv_ffs_link_dir=""
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ffs_link_dir" >&5
+echo "${ECHO_T}$cercs_cv_ffs_link_dir" >&6
+ld_arg="-L"
+new_flags=$LDFLAGS
+cercs_cv_ffs_link_arg=`echo $cercs_cv_ffs_link_dir | sed "/./ s/^/$ld_arg/1"`
+if test -n "$cercs_cv_ffs_link_arg"; then
+arg=$cercs_cv_ffs_link_arg
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $new_flags | grep -c "$no_dash_arg"` -eq 0; then
+root=`echo libffs.la | sed 's/\..*//'`
+if test ! -r $cercs_cv_ffs_link_dir/$root.la; then
+if eval "test \"\${LIBTOOL+set}\" = set"; then
+arg="$cercs_cv_ffs_link_arg "`echo $cercs_cv_ffs_link_dir | sed "/./ s/^/-R/1"`
+fi
+fi
+if test `echo $arg | grep -c "ffs"` -eq 0; then
+new_flags="$new_flags $arg"
+else
+new_flags="$arg $new_flags"
+fi
+fi
+DT_LDFLAGS=$new_flags
+fi
+
+
+else
+
+
+
+
+# Check whether --with-ffs or --without-ffs was given.
+if test "${with_ffs+set}" = set; then
+  withval="$with_ffs"
+
+fi;
+
+if test -n "$with_ffs"; then
+unset cercs_cv_ffs_include_arg
+unset cercs_cv_ffs_link_arg
+if test `echo $with_ffs | sed 's/\(.\).*/\1/g'` != "/"; then
+with_ffs=`pwd`/$with_ffs
+fi
+fi
+echo "$as_me:$LINENO: checking needed include args for ffs package" >&5
+echo $ECHO_N "checking needed include args for ffs package... $ECHO_C" >&6
+if test "${cercs_cv_ffs_include_arg+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+search_list="$PWD/../ffs $PWD/../../ffs $PWD/../../../ffs"
+tmp_search_results=""
+echo "configure:30087: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:30091: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "/usr/include/ffs.h"; then
+cercs_cv_ffs_include_arg=-I`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s#.ffs.h##g"`
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ffs_include_arg" >&5
+echo "${ECHO_T}$cercs_cv_ffs_include_arg" >&6
+if test -n "$cercs_cv_ffs_include_arg"; then
+arg="$cercs_cv_ffs_include_arg"
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $DT_CPPFLAGS | grep -c "$no_dash_arg"` -eq 0; then
+if test `echo $arg | grep -c "ffs"` -eq 0; then
+DT_CPPFLAGS="$DT_CPPFLAGS $arg";
+else
+DT_CPPFLAGS="$arg $DT_CPPFLAGS"
+fi
+fi
+fi
+
+echo "$as_me:$LINENO: checking needed link args for ffs package" >&5
+echo $ECHO_N "checking needed link args for ffs package... $ECHO_C" >&6
+if test "${cercs_cv_ffs_link_dir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+search_list="$PWD/../ffs $PWD/../../ffs $PWD/../../../ffs"
+tmp_search_results=""
+echo "configure:30129: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:30133: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "libffs.la"; then
+cercs_cv_ffs_link_dir=`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s/.libffs.la//g"`
+else
+cercs_cv_ffs_link_dir=""
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ffs_link_dir" >&5
+echo "${ECHO_T}$cercs_cv_ffs_link_dir" >&6
+ld_arg="-L"
+new_flags=$LDFLAGS
+cercs_cv_ffs_link_arg=`echo $cercs_cv_ffs_link_dir | sed "/./ s/^/$ld_arg/1"`
+if test -n "$cercs_cv_ffs_link_arg"; then
+arg=$cercs_cv_ffs_link_arg
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $new_flags | grep -c "$no_dash_arg"` -eq 0; then
+root=`echo libffs.la | sed 's/\..*//'`
+if test ! -r $cercs_cv_ffs_link_dir/$root.la; then
+if eval "test \"\${LIBTOOL+set}\" = set"; then
+arg="$cercs_cv_ffs_link_arg "`echo $cercs_cv_ffs_link_dir | sed "/./ s/^/-R/1"`
+fi
+fi
+if test `echo $arg | grep -c "ffs"` -eq 0; then
+new_flags="$new_flags $arg"
+else
+new_flags="$arg $new_flags"
+fi
+fi
+DT_LDFLAGS=$new_flags
+fi
+
+
+fi
+
+
+
+
+if test -z "$with_local_specified"; then
+
+
+
+
+# Check whether --with-gen_thread or --without-gen_thread was given.
+if test "${with_gen_thread+set}" = set; then
+  withval="$with_gen_thread"
+
+fi;
+
+if test -n "$with_gen_thread"; then
+unset cercs_cv_gen_thread_include_arg
+unset cercs_cv_gen_thread_link_arg
+if test `echo $with_gen_thread | sed 's/\(.\).*/\1/g'` != "/"; then
+with_gen_thread=`pwd`/$with_gen_thread
+fi
+fi
+echo "$as_me:$LINENO: checking needed include args for gen_thread package" >&5
+echo $ECHO_N "checking needed include args for gen_thread package... $ECHO_C" >&6
+if test "${cercs_cv_gen_thread_include_arg+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+
+
+cercs_tmp=""
+search_list="./gen_thread.h"
+CHAOS_HOMEDIR=""
+if test -n "$CSH"; then
+CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf  2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR=""
+fi
+if test -n "$with_gen_thread"; then
+if test `echo $with_gen_thread | cut -c1` = "~"; then
+EXPANDED=`echo "echo $with_gen_thread" | csh -sf 2>/dev/null` || EXPANDED=""
+else
+EXPANDED=$with_gen_thread
+fi
+
+echo "Datatap = $datatap_dir"
+
+search_list="$datatap_dir/gen_thread.h $datatap_dir/lib/gen_thread.h $datatap_dir/include/gen_thread.h $search_list $EXPANDED/gen_thread.h $EXPANDED/include/gen_thread.h $EXPANDED/share/gen_thread.h $EXPANDED/$cercs_cv_archive/gen_thread.h $EXPANDED/$cercs_cv_archive/include/gen_thread.h $EXPANDED/gen_thread/gen_thread.h $EXPANDED/gen_thread/$cercs_cv_archive/gen_thread.h $EXPANDED/gen_thread/include/gen_thread.h $EXPANDED/gen_thread/include/$cercs_cv_archive/gen_thread.h"
+fi
+if test -z "$with_installed_specified"; then
+search_list="$search_list `pwd`/../gen_thread/gen_thread.h `pwd`/../include/gen_thread.h `pwd`/../share/gen_thread.h"
+if test "$CHAOS_HOMEDIR" != "$HOME"; then
+search_list="$search_list $HOME/gen_thread/gen_thread.h $HOME/$cercs_cv_archive/include/gen_thread.h $HOME/include/gen_thread.h"
+fi
+fi
+if test -n "$CHAOS_HOMEDIR" -a -n "$cercs_cv_archive"; then
+search_list="$search_list $CHAOS_HOMEDIR/$cercs_cv_archive/gen_thread/include/gen_thread.h $CHAOS_HOMEDIR/$cercs_cv_archive/include/gen_thread.h $CHAOS_HOMEDIR/gen_thread/$cercs_cv_archive/include/gen_thread.h $CHAOS_HOMEDIR/gen_thread/include/gen_thread.h $CHAOS_HOMEDIR/include/gen_thread.h"
+fi
+if test "$libdir" != '${exec_prefix}/lib'; then
+tmpdir=`echo ${libdir} |  sed 's%/$%%'`
+search_list="$tmpdir/gen_thread.h $search_list"
+fi
+if test "$exec_prefix" != "NONE"; then
+tmpdir=`echo ${exec_prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/gen_thread.h $search_list"
+fi
+if test "$includedir" != '${prefix}/include'; then
+tmpdir=`echo ${includedir} |  sed 's%/$%%'`
+search_list="$tmpdir/gen_thread.h $search_list"
+fi
+if test "$prefix" != "NONE"; then
+tmpdir=`echo ${prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/include/gen_thread.h $search_list"
+fi
+if test "include" == "lib"; then
+  for tmp_lib_value in $sys_lib_search_path_spec; do
+     search_list="$search_list $tmp_lib_value/gen_thread.h"
+  done
+fi
+
+search_list="$datatap_dir/gen_thread.h $datatap_dir/lib/gen_thread.h $datatap_dir/include/gen_thread.h $search_list /usr/include/gen_thread.h /usr/local/include/gen_thread.h /opt/gen_thread/include/gen_thread.h /opt/misc/include/gen_thread.h /opt/misc/include/$cercs_cv_archive/gen_thread.h"
+tmp_search_results=""
+echo "configure:30257: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:30261: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "/usr/include/gen_thread.h"; then
+cercs_cv_gen_thread_include_arg=-I`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s#.gen_thread.h##g"`
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_gen_thread_include_arg" >&5
+echo "${ECHO_T}$cercs_cv_gen_thread_include_arg" >&6
+if test -n "$cercs_cv_gen_thread_include_arg"; then
+arg="$cercs_cv_gen_thread_include_arg"
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $DT_CPPFLAGS | grep -c "$no_dash_arg"` -eq 0; then
+if test `echo $arg | grep -c "gen_thread"` -eq 0; then
+DT_CPPFLAGS="$DT_CPPFLAGS $arg";
+else
+DT_CPPFLAGS="$arg $DT_CPPFLAGS"
+fi
+fi
+fi
+
+echo "$as_me:$LINENO: checking needed link args for gen_thread package" >&5
+echo $ECHO_N "checking needed link args for gen_thread package... $ECHO_C" >&6
+if test "${cercs_cv_gen_thread_link_dir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+
+
+cercs_tmp=""
+search_list="./libgen_thread.la"
+CHAOS_HOMEDIR=""
+if test -n "$CSH"; then
+CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf  2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR=""
+fi
+if test -n "$with_gen_thread"; then
+if test `echo $with_gen_thread | cut -c1` = "~"; then
+EXPANDED=`echo "echo $with_gen_thread" | csh -sf 2>/dev/null` || EXPANDED=""
+else
+EXPANDED=$with_gen_thread
+fi
+
+echo "Datatap = $datatap_dir"
+
+search_list="$datatap_dir/libgen_thread.la $datatap_dir/lib/libgen_thread.la $datatap_dir/include/libgen_thread.la $search_list $EXPANDED/libgen_thread.la $EXPANDED/lib/libgen_thread.la $EXPANDED/share/libgen_thread.la $EXPANDED/$cercs_cv_archive/libgen_thread.la $EXPANDED/$cercs_cv_archive/lib/libgen_thread.la $EXPANDED/gen_thread/libgen_thread.la $EXPANDED/gen_thread/$cercs_cv_archive/libgen_thread.la $EXPANDED/gen_thread/lib/libgen_thread.la $EXPANDED/gen_thread/lib/$cercs_cv_archive/ [...]
+fi
+if test -z "$with_installed_specified"; then
+search_list="$search_list `pwd`/../gen_thread/libgen_thread.la `pwd`/../lib/libgen_thread.la `pwd`/../share/libgen_thread.la"
+if test "$CHAOS_HOMEDIR" != "$HOME"; then
+search_list="$search_list $HOME/gen_thread/libgen_thread.la $HOME/$cercs_cv_archive/lib/libgen_thread.la $HOME/lib/libgen_thread.la"
+fi
+fi
+if test -n "$CHAOS_HOMEDIR" -a -n "$cercs_cv_archive"; then
+search_list="$search_list $CHAOS_HOMEDIR/$cercs_cv_archive/gen_thread/lib/libgen_thread.la $CHAOS_HOMEDIR/$cercs_cv_archive/lib/libgen_thread.la $CHAOS_HOMEDIR/gen_thread/$cercs_cv_archive/lib/libgen_thread.la $CHAOS_HOMEDIR/gen_thread/lib/libgen_thread.la $CHAOS_HOMEDIR/lib/libgen_thread.la"
+fi
+if test "$libdir" != '${exec_prefix}/lib'; then
+tmpdir=`echo ${libdir} |  sed 's%/$%%'`
+search_list="$tmpdir/libgen_thread.la $search_list"
+fi
+if test "$exec_prefix" != "NONE"; then
+tmpdir=`echo ${exec_prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/libgen_thread.la $search_list"
+fi
+if test "$includedir" != '${prefix}/include'; then
+tmpdir=`echo ${includedir} |  sed 's%/$%%'`
+search_list="$tmpdir/libgen_thread.la $search_list"
+fi
+if test "$prefix" != "NONE"; then
+tmpdir=`echo ${prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/libgen_thread.la $search_list"
+fi
+if test "lib" == "lib"; then
+  for tmp_lib_value in $sys_lib_search_path_spec; do
+     search_list="$search_list $tmp_lib_value/libgen_thread.la"
+  done
+fi
+
+search_list="$datatap_dir/libgen_thread.la $datatap_dir/lib/libgen_thread.la $datatap_dir/include/libgen_thread.la $search_list /usr/lib/libgen_thread.la /usr/local/lib/libgen_thread.la /opt/gen_thread/lib/libgen_thread.la /opt/misc/lib/libgen_thread.la /opt/misc/lib/$cercs_cv_archive/libgen_thread.la"
+tmp_search_results=""
+echo "configure:30349: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:30353: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "libgen_thread.la"; then
+cercs_cv_gen_thread_link_dir=`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s/.libgen_thread.la//g"`
+else
+cercs_cv_gen_thread_link_dir=""
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_gen_thread_link_dir" >&5
+echo "${ECHO_T}$cercs_cv_gen_thread_link_dir" >&6
+ld_arg="-L"
+new_flags=$LDFLAGS
+cercs_cv_gen_thread_link_arg=`echo $cercs_cv_gen_thread_link_dir | sed "/./ s/^/$ld_arg/1"`
+if test -n "$cercs_cv_gen_thread_link_arg"; then
+arg=$cercs_cv_gen_thread_link_arg
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $new_flags | grep -c "$no_dash_arg"` -eq 0; then
+root=`echo libgen_thread.la | sed 's/\..*//'`
+if test ! -r $cercs_cv_gen_thread_link_dir/$root.la; then
+if eval "test \"\${LIBTOOL+set}\" = set"; then
+arg="$cercs_cv_gen_thread_link_arg "`echo $cercs_cv_gen_thread_link_dir | sed "/./ s/^/-R/1"`
+fi
+fi
+if test `echo $arg | grep -c "gen_thread"` -eq 0; then
+new_flags="$new_flags $arg"
+else
+new_flags="$arg $new_flags"
+fi
+fi
+DT_LDFLAGS=$new_flags
+fi
+
+
+else
+
+
+
+
+# Check whether --with-gen_thread or --without-gen_thread was given.
+if test "${with_gen_thread+set}" = set; then
+  withval="$with_gen_thread"
+
+fi;
+
+if test -n "$with_gen_thread"; then
+unset cercs_cv_gen_thread_include_arg
+unset cercs_cv_gen_thread_link_arg
+if test `echo $with_gen_thread | sed 's/\(.\).*/\1/g'` != "/"; then
+with_gen_thread=`pwd`/$with_gen_thread
+fi
+fi
+echo "$as_me:$LINENO: checking needed include args for gen_thread package" >&5
+echo $ECHO_N "checking needed include args for gen_thread package... $ECHO_C" >&6
+if test "${cercs_cv_gen_thread_include_arg+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+search_list="$PWD/../gen_thread $PWD/../../gen_thread $PWD/../../../gen_thread"
+tmp_search_results=""
+echo "configure:30422: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:30426: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "/usr/include/gen_thread.h"; then
+cercs_cv_gen_thread_include_arg=-I`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s#.gen_thread.h##g"`
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_gen_thread_include_arg" >&5
+echo "${ECHO_T}$cercs_cv_gen_thread_include_arg" >&6
+if test -n "$cercs_cv_gen_thread_include_arg"; then
+arg="$cercs_cv_gen_thread_include_arg"
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $DT_CPPFLAGS | grep -c "$no_dash_arg"` -eq 0; then
+if test `echo $arg | grep -c "gen_thread"` -eq 0; then
+DT_CPPFLAGS="$DT_CPPFLAGS $arg";
+else
+DT_CPPFLAGS="$arg $DT_CPPFLAGS"
+fi
+fi
+fi
+
+echo "$as_me:$LINENO: checking needed link args for gen_thread package" >&5
+echo $ECHO_N "checking needed link args for gen_thread package... $ECHO_C" >&6
+if test "${cercs_cv_gen_thread_link_dir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+search_list="$PWD/../gen_thread $PWD/../../gen_thread $PWD/../../../gen_thread"
+tmp_search_results=""
+echo "configure:30464: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:30468: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "libgen_thread.la"; then
+cercs_cv_gen_thread_link_dir=`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s/.libgen_thread.la//g"`
+else
+cercs_cv_gen_thread_link_dir=""
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_gen_thread_link_dir" >&5
+echo "${ECHO_T}$cercs_cv_gen_thread_link_dir" >&6
+ld_arg="-L"
+new_flags=$LDFLAGS
+cercs_cv_gen_thread_link_arg=`echo $cercs_cv_gen_thread_link_dir | sed "/./ s/^/$ld_arg/1"`
+if test -n "$cercs_cv_gen_thread_link_arg"; then
+arg=$cercs_cv_gen_thread_link_arg
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $new_flags | grep -c "$no_dash_arg"` -eq 0; then
+root=`echo libgen_thread.la | sed 's/\..*//'`
+if test ! -r $cercs_cv_gen_thread_link_dir/$root.la; then
+if eval "test \"\${LIBTOOL+set}\" = set"; then
+arg="$cercs_cv_gen_thread_link_arg "`echo $cercs_cv_gen_thread_link_dir | sed "/./ s/^/-R/1"`
+fi
+fi
+if test `echo $arg | grep -c "gen_thread"` -eq 0; then
+new_flags="$new_flags $arg"
+else
+new_flags="$arg $new_flags"
+fi
+fi
+DT_LDFLAGS=$new_flags
+fi
+
+
+fi
+
+		if test -n "$cercs_cv_ibpbio_link_dir";then
+			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ibpbio_link_dir"
+			DT_LIBS="$DT_LIBS -libclient"
+			datatap=ibverbs
+		else
+			temptest=disable
+		fi
+		if test -n "$cercs_cv_ffs_link_dir";then
+			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ffs_link_dir"
+			DT_LIBS="$DT_LIBS -lgen_thread"
+			datatap=ibverbs
+		else
+			temptest=disable
+		fi
+		if test -n "$cercs_cv_gen_thread_link_dir";then
+			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_gen_thread_link_dir"
+			DT_LIBS="$DT_LIBS -lgen_thread"
+			datatap=ibverbs
+		else
+			temptest=disable
+		fi
+
+        elif test x"$ac_with_portals" = xyes; then
+
+
+
+if test -z "$with_local_specified"; then
+
+
+
+
+# Check whether --with-ptlpbio or --without-ptlpbio was given.
+if test "${with_ptlpbio+set}" = set; then
+  withval="$with_ptlpbio"
+
+fi;
+
+if test -n "$with_ptlpbio"; then
+unset cercs_cv_ptlpbio_include_arg
+unset cercs_cv_ptlpbio_link_arg
+if test `echo $with_ptlpbio | sed 's/\(.\).*/\1/g'` != "/"; then
+with_ptlpbio=`pwd`/$with_ptlpbio
+fi
+fi
+echo "$as_me:$LINENO: checking needed include args for ptlpbio package" >&5
+echo $ECHO_N "checking needed include args for ptlpbio package... $ECHO_C" >&6
+if test "${cercs_cv_ptlpbio_include_arg+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+
+
+cercs_tmp=""
+search_list="./thin_portal.h"
+CHAOS_HOMEDIR=""
+if test -n "$CSH"; then
+CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf  2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR=""
+fi
+if test -n "$with_ptlpbio"; then
+if test `echo $with_ptlpbio | cut -c1` = "~"; then
+EXPANDED=`echo "echo $with_ptlpbio" | csh -sf 2>/dev/null` || EXPANDED=""
+else
+EXPANDED=$with_ptlpbio
+fi
+
+echo "Datatap = $datatap_dir"
+
+search_list="$datatap_dir/thin_portal.h $datatap_dir/lib/thin_portal.h $datatap_dir/include/thin_portal.h $search_list $EXPANDED/thin_portal.h $EXPANDED/include/thin_portal.h $EXPANDED/share/thin_portal.h $EXPANDED/$cercs_cv_archive/thin_portal.h $EXPANDED/$cercs_cv_archive/include/thin_portal.h $EXPANDED/ptlpbio/thin_portal.h $EXPANDED/ptlpbio/$cercs_cv_archive/thin_portal.h $EXPANDED/ptlpbio/include/thin_portal.h $EXPANDED/ptlpbio/include/$cercs_cv_archive/thin_portal.h"
+fi
+if test -z "$with_installed_specified"; then
+search_list="$search_list `pwd`/../ptlpbio/thin_portal.h `pwd`/../include/thin_portal.h `pwd`/../share/thin_portal.h"
+if test "$CHAOS_HOMEDIR" != "$HOME"; then
+search_list="$search_list $HOME/ptlpbio/thin_portal.h $HOME/$cercs_cv_archive/include/thin_portal.h $HOME/include/thin_portal.h"
+fi
+fi
+if test -n "$CHAOS_HOMEDIR" -a -n "$cercs_cv_archive"; then
+search_list="$search_list $CHAOS_HOMEDIR/$cercs_cv_archive/ptlpbio/include/thin_portal.h $CHAOS_HOMEDIR/$cercs_cv_archive/include/thin_portal.h $CHAOS_HOMEDIR/ptlpbio/$cercs_cv_archive/include/thin_portal.h $CHAOS_HOMEDIR/ptlpbio/include/thin_portal.h $CHAOS_HOMEDIR/include/thin_portal.h"
+fi
+if test "$libdir" != '${exec_prefix}/lib'; then
+tmpdir=`echo ${libdir} |  sed 's%/$%%'`
+search_list="$tmpdir/thin_portal.h $search_list"
+fi
+if test "$exec_prefix" != "NONE"; then
+tmpdir=`echo ${exec_prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/thin_portal.h $search_list"
+fi
+if test "$includedir" != '${prefix}/include'; then
+tmpdir=`echo ${includedir} |  sed 's%/$%%'`
+search_list="$tmpdir/thin_portal.h $search_list"
+fi
+if test "$prefix" != "NONE"; then
+tmpdir=`echo ${prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/include/thin_portal.h $search_list"
+fi
+if test "include" == "lib"; then
+  for tmp_lib_value in $sys_lib_search_path_spec; do
+     search_list="$search_list $tmp_lib_value/thin_portal.h"
+  done
+fi
+
+search_list="$datatap_dir/thin_portal.h $datatap_dir/lib/thin_portal.h $datatap_dir/include/thin_portal.h $search_list /usr/include/thin_portal.h /usr/local/include/thin_portal.h /opt/ptlpbio/include/thin_portal.h /opt/misc/include/thin_portal.h /opt/misc/include/$cercs_cv_archive/thin_portal.h"
+tmp_search_results=""
+echo "configure:30615: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:30619: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "/usr/include/thin_portal.h"; then
+cercs_cv_ptlpbio_include_arg=-I`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s#.thin_portal.h##g"`
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ptlpbio_include_arg" >&5
+echo "${ECHO_T}$cercs_cv_ptlpbio_include_arg" >&6
+if test -n "$cercs_cv_ptlpbio_include_arg"; then
+arg="$cercs_cv_ptlpbio_include_arg"
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $DT_CPPFLAGS | grep -c "$no_dash_arg"` -eq 0; then
+if test `echo $arg | grep -c "ptlpbio"` -eq 0; then
+DT_CPPFLAGS="$DT_CPPFLAGS $arg";
+else
+DT_CPPFLAGS="$arg $DT_CPPFLAGS"
+fi
+fi
+fi
+
+echo "$as_me:$LINENO: checking needed link args for ptlpbio package" >&5
+echo $ECHO_N "checking needed link args for ptlpbio package... $ECHO_C" >&6
+if test "${cercs_cv_ptlpbio_link_dir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+
+
+cercs_tmp=""
+search_list="./libptlclient.a"
+CHAOS_HOMEDIR=""
+if test -n "$CSH"; then
+CHAOS_HOMEDIR=`echo "echo ~chaos" | csh -sf  2>/dev/null | sed 's%/$%%'` || CHAOS_HOMEDIR=""
+fi
+if test -n "$with_ptlpbio"; then
+if test `echo $with_ptlpbio | cut -c1` = "~"; then
+EXPANDED=`echo "echo $with_ptlpbio" | csh -sf 2>/dev/null` || EXPANDED=""
+else
+EXPANDED=$with_ptlpbio
+fi
+
+echo "Datatap = $datatap_dir"
+
+search_list="$datatap_dir/libptlclient.a $datatap_dir/lib/libptlclient.a $datatap_dir/include/libptlclient.a $search_list $EXPANDED/libptlclient.a $EXPANDED/lib/libptlclient.a $EXPANDED/share/libptlclient.a $EXPANDED/$cercs_cv_archive/libptlclient.a $EXPANDED/$cercs_cv_archive/lib/libptlclient.a $EXPANDED/ptlpbio/libptlclient.a $EXPANDED/ptlpbio/$cercs_cv_archive/libptlclient.a $EXPANDED/ptlpbio/lib/libptlclient.a $EXPANDED/ptlpbio/lib/$cercs_cv_archive/libptlclient.a"
+fi
+if test -z "$with_installed_specified"; then
+search_list="$search_list `pwd`/../ptlpbio/libptlclient.a `pwd`/../lib/libptlclient.a `pwd`/../share/libptlclient.a"
+if test "$CHAOS_HOMEDIR" != "$HOME"; then
+search_list="$search_list $HOME/ptlpbio/libptlclient.a $HOME/$cercs_cv_archive/lib/libptlclient.a $HOME/lib/libptlclient.a"
+fi
+fi
+if test -n "$CHAOS_HOMEDIR" -a -n "$cercs_cv_archive"; then
+search_list="$search_list $CHAOS_HOMEDIR/$cercs_cv_archive/ptlpbio/lib/libptlclient.a $CHAOS_HOMEDIR/$cercs_cv_archive/lib/libptlclient.a $CHAOS_HOMEDIR/ptlpbio/$cercs_cv_archive/lib/libptlclient.a $CHAOS_HOMEDIR/ptlpbio/lib/libptlclient.a $CHAOS_HOMEDIR/lib/libptlclient.a"
+fi
+if test "$libdir" != '${exec_prefix}/lib'; then
+tmpdir=`echo ${libdir} |  sed 's%/$%%'`
+search_list="$tmpdir/libptlclient.a $search_list"
+fi
+if test "$exec_prefix" != "NONE"; then
+tmpdir=`echo ${exec_prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/libptlclient.a $search_list"
+fi
+if test "$includedir" != '${prefix}/include'; then
+tmpdir=`echo ${includedir} |  sed 's%/$%%'`
+search_list="$tmpdir/libptlclient.a $search_list"
+fi
+if test "$prefix" != "NONE"; then
+tmpdir=`echo ${prefix} |  sed 's%/$%%'`
+search_list="$tmpdir/lib/libptlclient.a $search_list"
+fi
+if test "lib" == "lib"; then
+  for tmp_lib_value in $sys_lib_search_path_spec; do
+     search_list="$search_list $tmp_lib_value/libptlclient.a"
+  done
+fi
+
+search_list="$datatap_dir/libptlclient.a $datatap_dir/lib/libptlclient.a $datatap_dir/include/libptlclient.a $search_list /usr/lib/libptlclient.a /usr/local/lib/libptlclient.a /opt/ptlpbio/lib/libptlclient.a /opt/misc/lib/libptlclient.a /opt/misc/lib/$cercs_cv_archive/libptlclient.a"
+tmp_search_results=""
+echo "configure:30707: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:30711: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "libptlclient.a"; then
+cercs_cv_ptlpbio_link_dir=`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s/.libptlclient.a//g"`
+else
+cercs_cv_ptlpbio_link_dir=""
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ptlpbio_link_dir" >&5
+echo "${ECHO_T}$cercs_cv_ptlpbio_link_dir" >&6
+ld_arg="-L"
+new_flags=$LDFLAGS
+cercs_cv_ptlpbio_link_arg=`echo $cercs_cv_ptlpbio_link_dir | sed "/./ s/^/$ld_arg/1"`
+if test -n "$cercs_cv_ptlpbio_link_arg"; then
+arg=$cercs_cv_ptlpbio_link_arg
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $new_flags | grep -c "$no_dash_arg"` -eq 0; then
+root=`echo libptlclient.a | sed 's/\..*//'`
+if test ! -r $cercs_cv_ptlpbio_link_dir/$root.la; then
+if eval "test \"\${LIBTOOL+set}\" = set"; then
+arg="$cercs_cv_ptlpbio_link_arg "`echo $cercs_cv_ptlpbio_link_dir | sed "/./ s/^/-R/1"`
+fi
+fi
+if test `echo $arg | grep -c "ptlpbio"` -eq 0; then
+new_flags="$new_flags $arg"
+else
+new_flags="$arg $new_flags"
+fi
+fi
+DT_LDFLAGS=$new_flags
+fi
+
+
+else
+
+
+
+
+# Check whether --with-ptlpbio or --without-ptlpbio was given.
+if test "${with_ptlpbio+set}" = set; then
+  withval="$with_ptlpbio"
+
+fi;
+
+if test -n "$with_ptlpbio"; then
+unset cercs_cv_ptlpbio_include_arg
+unset cercs_cv_ptlpbio_link_arg
+if test `echo $with_ptlpbio | sed 's/\(.\).*/\1/g'` != "/"; then
+with_ptlpbio=`pwd`/$with_ptlpbio
+fi
+fi
+echo "$as_me:$LINENO: checking needed include args for ptlpbio package" >&5
+echo $ECHO_N "checking needed include args for ptlpbio package... $ECHO_C" >&6
+if test "${cercs_cv_ptlpbio_include_arg+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+search_list="$PWD/../ptlpbio $PWD/../../ptlpbio $PWD/../../../ptlpbio"
+tmp_search_results=""
+echo "configure:30780: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:30784: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "/usr/include/thin_portal.h"; then
+cercs_cv_ptlpbio_include_arg=-I`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s#.thin_portal.h##g"`
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ptlpbio_include_arg" >&5
+echo "${ECHO_T}$cercs_cv_ptlpbio_include_arg" >&6
+if test -n "$cercs_cv_ptlpbio_include_arg"; then
+arg="$cercs_cv_ptlpbio_include_arg"
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $DT_CPPFLAGS | grep -c "$no_dash_arg"` -eq 0; then
+if test `echo $arg | grep -c "ptlpbio"` -eq 0; then
+DT_CPPFLAGS="$DT_CPPFLAGS $arg";
+else
+DT_CPPFLAGS="$arg $DT_CPPFLAGS"
+fi
+fi
+fi
+
+echo "$as_me:$LINENO: checking needed link args for ptlpbio package" >&5
+echo $ECHO_N "checking needed link args for ptlpbio package... $ECHO_C" >&6
+if test "${cercs_cv_ptlpbio_link_dir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+search_list="$PWD/../ptlpbio $PWD/../../ptlpbio $PWD/../../../ptlpbio"
+tmp_search_results=""
+echo "configure:30822: searching for $search_list " >&5
+for tmp_search_value in $search_list; do
+   if test -r $tmp_search_value; then
+	tmp_search_results=$tmp_search_value
+	echo "configure:30826: first found $tmp_search_results " >&5
+	break
+   fi
+done
+
+if test -n "$tmp_search_results"; then
+cercs_tmp=$tmp_search_results
+fi
+
+if test -n "$cercs_tmp" -a "$cercs_tmp" != "libptlclient.a"; then
+cercs_cv_ptlpbio_link_dir=`$PATHPROG $cercs_tmp | sed 's#\\\\#/#g' | sed "s/.libptlclient.a//g"`
+else
+cercs_cv_ptlpbio_link_dir=""
+fi
+
+fi
+
+echo "$as_me:$LINENO: result: $cercs_cv_ptlpbio_link_dir" >&5
+echo "${ECHO_T}$cercs_cv_ptlpbio_link_dir" >&6
+ld_arg="-L"
+new_flags=$LDFLAGS
+cercs_cv_ptlpbio_link_arg=`echo $cercs_cv_ptlpbio_link_dir | sed "/./ s/^/$ld_arg/1"`
+if test -n "$cercs_cv_ptlpbio_link_arg"; then
+arg=$cercs_cv_ptlpbio_link_arg
+no_dash_arg=`echo $arg | sed 's/^-//g'`
+if test `echo $new_flags | grep -c "$no_dash_arg"` -eq 0; then
+root=`echo libptlclient.a | sed 's/\..*//'`
+if test ! -r $cercs_cv_ptlpbio_link_dir/$root.la; then
+if eval "test \"\${LIBTOOL+set}\" = set"; then
+arg="$cercs_cv_ptlpbio_link_arg "`echo $cercs_cv_ptlpbio_link_dir | sed "/./ s/^/-R/1"`
+fi
+fi
+if test `echo $arg | grep -c "ptlpbio"` -eq 0; then
+new_flags="$new_flags $arg"
+else
+new_flags="$arg $new_flags"
+fi
+fi
+DT_LDFLAGS=$new_flags
+fi
+
+
+fi
+
+
+		if test -n "$cercs_cv_ptlpbio_link_dir";then
+			DT_LDFLAGS="$DT_LDFLAGS -L$cercs_cv_ptlpbio_link_dir"
+			DT_LIBS="$DT_LIBS -lptlclient"
+			datatap=portals
+		else
+			temptest=disable
+		fi
+
+	else
+		echo "Neither portals nor infiniband found. Disabling datatap"
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_DATATAP 1
+_ACEOF
+
+		datatap=disable
+		temptest=disable
+	fi
+fi
+
+if test x"$temptest" = xdisable; then
+	datatap=disable
+	echo "Datatap dependency check failed"
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_DATATAP 1
+_ACEOF
+
+fi
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# Check whether --enable-research-transports or --disable-research-transports was given.
+if test "${enable_research_transports+set}" = set; then
+  enableval="$enable_research_transports"
+
+fi;
+
+
+if test "x$enable_research_transports" == "xyes"; then
+  RESEARCH_TRANSPORTS_TRUE=
+  RESEARCH_TRANSPORTS_FALSE='#'
+else
+  RESEARCH_TRANSPORTS_TRUE='#'
+  RESEARCH_TRANSPORTS_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+if test x$datatap != xdisable; then
+  HAVE_DATATAP_TRUE=
+  HAVE_DATATAP_FALSE='#'
+else
+  HAVE_DATATAP_TRUE='#'
+  HAVE_DATATAP_FALSE=
+fi
+
+
+# Check whether --enable-write or --disable-write was given.
+if test "${enable_write+set}" = set; then
+  enableval="$enable_write"
+
+fi;
+
+
+if test "x$enable_write" != "xno"; then
+  BUILD_WRITE_TRUE=
+  BUILD_WRITE_FALSE='#'
+else
+  BUILD_WRITE_TRUE='#'
+  BUILD_WRITE_FALSE=
+fi
+
+
+
+LIBS="$MPILIBS"
+
+
+
+if false; then
+  USE_PARALLEL_COMPILER_TRUE=
+  USE_PARALLEL_COMPILER_FALSE='#'
+else
+  USE_PARALLEL_COMPILER_TRUE='#'
+  USE_PARALLEL_COMPILER_FALSE=
+fi
+
+
+if test -z "${HAVE_PHDF5_TRUE}" -a -z "${HAVE_HDF5_FALSE}"; then
+    HDF5_CPPFLAGS="${PHDF5_CPPFLAGS}"
+    HDF5_CFLAGS="${PHDF5_CFLAGS}"
+    HDF5_LDFLAGS="${PHDF5_LDFLAGS}"
+    HDF5_LIBS="${PHDF5_LIBS}"
+
+
+if true; then
+  HAVE_HDF5_TRUE=
+  HAVE_HDF5_FALSE='#'
+else
+  HAVE_HDF5_TRUE='#'
+  HAVE_HDF5_FALSE=
+fi
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_HDF5 1
+_ACEOF
+
+
+
+if true; then
+  USE_PARALLEL_COMPILER_TRUE=
+  USE_PARALLEL_COMPILER_FALSE='#'
+else
+  USE_PARALLEL_COMPILER_TRUE='#'
+  USE_PARALLEL_COMPILER_FALSE=
+fi
+
+    { echo "$as_me:$LINENO: Use PHDF5 for sequential HDF5 tools" >&5
+echo "$as_me: Use PHDF5 for sequential HDF5 tools" >&6;}
+fi
+
+if test -z "${HAVE_NC4PAR_TRUE}" -a -z "${HAVE_NETCDF_FALSE}"; then
+    NETCDF_CPPFLAGS="${NC4PAR_CPPFLAGS}"
+    NETCDF_CFLAGS="${NC4PAR_CFLAGS}"
+    NETCDF_LDFLAGS="${NC4PAR_LDFLAGS}"
+    NETCDF_LIBS="${NC4PAR_LIBS}"
+
+
+if true; then
+  HAVE_NETCDF_TRUE=
+  HAVE_NETCDF_FALSE='#'
+else
+  HAVE_NETCDF_TRUE='#'
+  HAVE_NETCDF_FALSE=
+fi
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_NETCDF 1
+_ACEOF
+
+
+
+if true; then
+  USE_PARALLEL_COMPILER_TRUE=
+  USE_PARALLEL_COMPILER_FALSE='#'
+else
+  USE_PARALLEL_COMPILER_TRUE='#'
+  USE_PARALLEL_COMPILER_FALSE=
+fi
+
+    { echo "$as_me:$LINENO: Use NC4PAR for sequential NETCDF tools" >&5
+echo "$as_me: Use NC4PAR for sequential NETCDF tools" >&6;}
+fi
+
+
+ADIOSLIB_EXTRA_CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE"
+ADIOSLIB_CPPFLAGS="${MXML_CPPFLAGS}"
+ADIOSLIB_CFLAGS=
+ADIOSLIB_LDFLAGS="${MXML_LDFLAGS}"
+ADIOSLIB_LDADD="-lm ${MXML_LIBS}"
+ADIOSLIB_SEQ_CPPFLAGS="-D_NOMPI ${MXML_CPPFLAGS}"
+ADIOSLIB_SEQ_CFLAGS=
+ADIOSLIB_SEQ_LDFLAGS="${MXML_LDFLAGS}"
+ADIOSLIB_SEQ_LDADD="-lm ${MXML_LIBS}"
+ADIOSREADLIB_CPPFLAGS=""
+ADIOSREADLIB_CFLAGS=
+ADIOSREADLIB_LDFLAGS=
+ADIOSREADLIB_LDADD="-lm"
+ADIOSREADLIB_SEQ_CPPFLAGS="-D_NOMPI"
+ADIOSREADLIB_SEQ_CFLAGS=
+ADIOSREADLIB_SEQ_LDFLAGS=
+ADIOSREADLIB_SEQ_LDADD="-lm"
+if test "x${datatap}" != "xdisable"; then
+    ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${DT_CPPFLAGS}"
+    ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${DT_CFLAGS}"
+    ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${DT_LDFLAGS}"
+    ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${DT_LIBS}"
+fi
+if test -z "${HAVE_DART_TRUE}"; then
+    ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${DART_CPPFLAGS}"
+    ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS}"
+    ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${DART_LDFLAGS}"
+    ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${DART_LIBS}"
+    ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} ${DART_CPPFLAGS}"
+    ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${DART_CFLAGS}"
+    ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${DART_LDFLAGS}"
+    ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${DART_LIBS}"
+    ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} ${DART_CPPFLAGS}"
+    ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${DART_CFLAGS}"
+    ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${DART_LDFLAGS}"
+    ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${DART_LIBS}"
+fi
+if test -z "${HAVE_DIMES_TRUE}"; then
+    ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${DIMES_CPPFLAGS}"
+    ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS}"
+    ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${DIMES_LDFLAGS}"
+    ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${DIMES_LIBS}"
+    ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} ${DIMES_CPPFLAGS}"
+    ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${DIMES_CFLAGS}"
+    ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${DIMES_LDFLAGS}"
+    ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${DIMES_LIBS}"
+    ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} ${DIMES_CPPFLAGS}"
+    ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${DIMES_CFLAGS}"
+    ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${DIMES_LDFLAGS}"
+    ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${DIMES_LIBS}"
+fi
+if test -z "${HAVE_NSSI_TRUE}"; then
+    ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${NSSI_CPPFLAGS}"
+    ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${NSSI_CFLAGS}"
+    ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${NSSI_LDFLAGS}"
+    ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${NSSI_LIBS}"
+fi
+if test -z "${HAVE_NC4PAR_TRUE}"; then
+    ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${NC4PAR_CPPFLAGS}"
+    ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${NC4PAR_CFLAGS}"
+    ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${NC4PAR_LDFLAGS}"
+    ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${NC4PAR_LIBS}"
+fi
+if test -z "${HAVE_PHDF5_TRUE}"; then
+    ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${PHDF5_CPPFLAGS}"
+    ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${PHDF5_CFLAGS}"
+    ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${PHDF5_LDFLAGS}"
+    ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${PHDF5_LIBS}"
+fi
+if test -z "${HAVE_PORTALS_TRUE}"; then
+    ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${PORTALS_CPPFLAGS}"
+    ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${PORTALS_CFLAGS}"
+    ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${PORTALS_LDFLAGS}"
+    ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${PORTALS_LIBS}"
+fi
+if test -z "${HAVE_INFINIBAND_TRUE}"; then
+    ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${INFINIBAND_CPPFLAGS}"
+    ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${INFINIBAND_CFLAGS}"
+    ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${INFINIBAND_LDFLAGS}"
+    ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${INFINIBAND_LIBS}"
+fi
+if test -z "${HAVE_NETCDF_TRUE}"; then
+    ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} ${NETCDF_CPPFLAGS}"
+    ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${NETCDF_CFLAGS}"
+    ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${NETCDF_LDFLAGS}"
+    ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${NETCDF_LIBS}"
+fi
+if test -z "${HAVE_HDF5_TRUE}"; then
+    ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} ${HDF5_CPPFLAGS}"
+    ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${HDF5_CFLAGS}"
+    ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${HDF5_LDFLAGS}"
+    ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${HDF5_LIBS}"
+fi
+if test -z "${HAVE_DMALLOC_TRUE}"; then
+    ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} -DDMALLOC ${DMALLOC_CPPFLAGS}"
+    ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${DMALLOC_CFLAGS}"
+    ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${DMALLOC_LDFLAGS}"
+    ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${DMALLOC_LIBS}"
+    ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} ${DMALLOC_CPPFLAGS}"
+    ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${DMALLOC_CFLAGS}"
+    ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${DMALLOC_LDFLAGS}"
+    ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${DMALLOC_LIBS}"
+    ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} ${DMALLOC_CPPFLAGS}"
+    ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${DMALLOC_CFLAGS}"
+    ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${DMALLOC_LDFLAGS}"
+    ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${DMALLOC_LIBS}"
+    ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} ${DMALLOC_CPPFLAGS}"
+    ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${DMALLOC_CFLAGS}"
+    ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${DMALLOC_LDFLAGS}"
+    ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${DMALLOC_LIBS}"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -z "${USE_PARALLEL_COMPILER_TRUE}"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_PARALLEL_COMPILER 1
+_ACEOF
+
+        echo "#### Defined USE_PARALLEL_COMPILER to = [${USE_PARALLEL_COMPILER}]"
+fi
+
+                                                                                                                                                                                                                                                                                                                                                    ac_config_files="$ac_config_files Makefile src/Makefile tests/Makefile tests/C/Makefile tests/Fortran/Makefile tests/genarray/Makefile tests/bp_read/Mak [...]
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+  (set) 2>&1 |
+    case `(ac_space=' '; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;;
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+} |
+  sed '
+     t clear
+     : clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+  if test -w $cache_file; then
+    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+    cat confcache >$cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[	 ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[	 ]*$//;
+}'
+fi
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_i=`echo "$ac_i" |
+	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+  # 2. Add them.
+  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_MPI_TRUE}" && test -z "${HAVE_MPI_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_MPI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_MPI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_MPI_TRUE}" && test -z "${HAVE_MPI_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_MPI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_MPI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_FORTRAN_TRUE}" && test -z "${BUILD_FORTRAN_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_FORTRAN\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_FORTRAN\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_MPI_TRUE}" && test -z "${HAVE_MPI_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_MPI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_MPI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_MXML_TRUE}" && test -z "${HAVE_MXML_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_MXML\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_MXML\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_MXML_TRUE}" && test -z "${HAVE_MXML_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_MXML\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_MXML\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_MXML_TRUE}" && test -z "${HAVE_MXML_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_MXML\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_MXML\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_MXML_TRUE}" && test -z "${HAVE_MXML_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_MXML\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_MXML\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_MXML_TRUE}" && test -z "${HAVE_MXML_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_MXML\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_MXML\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_INFINIBAND_TRUE}" && test -z "${HAVE_INFINIBAND_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_INFINIBAND\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_INFINIBAND\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_INFINIBAND_TRUE}" && test -z "${HAVE_INFINIBAND_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_INFINIBAND\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_INFINIBAND\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_INFINIBAND_TRUE}" && test -z "${HAVE_INFINIBAND_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_INFINIBAND\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_INFINIBAND\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_PORTALS_TRUE}" && test -z "${HAVE_PORTALS_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_PORTALS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_PORTALS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${NEED_DARWIN_SINGLE_MODULE_TRUE}" && test -z "${NEED_DARWIN_SINGLE_MODULE_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"NEED_DARWIN_SINGLE_MODULE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"NEED_DARWIN_SINGLE_MODULE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_PORTALS_TRUE}" && test -z "${HAVE_PORTALS_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_PORTALS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_PORTALS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${NEED_DARWIN_SINGLE_MODULE_TRUE}" && test -z "${NEED_DARWIN_SINGLE_MODULE_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"NEED_DARWIN_SINGLE_MODULE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"NEED_DARWIN_SINGLE_MODULE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_PORTALS_TRUE}" && test -z "${HAVE_PORTALS_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_PORTALS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_PORTALS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_PORTALS_TRUE}" && test -z "${HAVE_PORTALS_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_PORTALS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_PORTALS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_HDF5_TRUE}" && test -z "${HAVE_HDF5_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_HDF5\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_HDF5\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_HDF5_TRUE}" && test -z "${HAVE_HDF5_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_HDF5\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_HDF5\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_HDF5_TRUE}" && test -z "${HAVE_HDF5_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_HDF5\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_HDF5\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_HDF5_TRUE}" && test -z "${HAVE_HDF5_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_HDF5\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_HDF5\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_PHDF5_TRUE}" && test -z "${HAVE_PHDF5_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_PHDF5\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_PHDF5\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_PHDF5_TRUE}" && test -z "${HAVE_PHDF5_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_PHDF5\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_PHDF5\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_PHDF5_TRUE}" && test -z "${HAVE_PHDF5_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_PHDF5\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_PHDF5\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_PHDF5_TRUE}" && test -z "${HAVE_PHDF5_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_PHDF5\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_PHDF5\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_NETCDF_TRUE}" && test -z "${HAVE_NETCDF_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_NETCDF\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_NETCDF\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_NETCDF_TRUE}" && test -z "${HAVE_NETCDF_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_NETCDF\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_NETCDF\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_NETCDF_TRUE}" && test -z "${HAVE_NETCDF_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_NETCDF\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_NETCDF\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_NETCDF_TRUE}" && test -z "${HAVE_NETCDF_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_NETCDF\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_NETCDF\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_NC4PAR_TRUE}" && test -z "${HAVE_NC4PAR_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_NC4PAR\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_NC4PAR\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_NC4PAR_TRUE}" && test -z "${HAVE_NC4PAR_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_NC4PAR\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_NC4PAR\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_NC4PAR_TRUE}" && test -z "${HAVE_NC4PAR_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_NC4PAR\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_NC4PAR\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_NC4PAR_TRUE}" && test -z "${HAVE_NC4PAR_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_NC4PAR\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_NC4PAR\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_PABLO_TRUE}" && test -z "${HAVE_PABLO_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_PABLO\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_PABLO\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_PABLO_TRUE}" && test -z "${HAVE_PABLO_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_PABLO\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_PABLO\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_PABLO_TRUE}" && test -z "${HAVE_PABLO_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_PABLO\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_PABLO\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_NSSI_TRUE}" && test -z "${HAVE_NSSI_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_NSSI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_NSSI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_NSSI_TRUE}" && test -z "${HAVE_NSSI_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_NSSI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_NSSI\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_DART_TRUE}" && test -z "${HAVE_DART_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_DART\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_DART\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_DART_TRUE}" && test -z "${HAVE_DART_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_DART\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_DART\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_DART_TRUE}" && test -z "${HAVE_DART_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_DART\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_DART\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_DART_TRUE}" && test -z "${HAVE_DART_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_DART\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_DART\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_DIMES_TRUE}" && test -z "${HAVE_DIMES_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_DIMES\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_DIMES\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_DIMES_TRUE}" && test -z "${HAVE_DIMES_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_DIMES\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_DIMES\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_DIMES_TRUE}" && test -z "${HAVE_DIMES_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_DIMES\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_DIMES\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_DIMES_TRUE}" && test -z "${HAVE_DIMES_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_DIMES\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_DIMES\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_DMALLOC_TRUE}" && test -z "${HAVE_DMALLOC_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_DMALLOC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_DMALLOC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_DMALLOC_TRUE}" && test -z "${HAVE_DMALLOC_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_DMALLOC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_DMALLOC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_DMALLOC_TRUE}" && test -z "${HAVE_DMALLOC_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_DMALLOC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_DMALLOC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${RESEARCH_TRANSPORTS_TRUE}" && test -z "${RESEARCH_TRANSPORTS_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"RESEARCH_TRANSPORTS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"RESEARCH_TRANSPORTS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_DATATAP_TRUE}" && test -z "${HAVE_DATATAP_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_DATATAP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_DATATAP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_WRITE_TRUE}" && test -z "${BUILD_WRITE_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_WRITE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_WRITE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${USE_PARALLEL_COMPILER_TRUE}" && test -z "${USE_PARALLEL_COMPILER_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"USE_PARALLEL_COMPILER\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"USE_PARALLEL_COMPILER\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_HDF5_TRUE}" && test -z "${HAVE_HDF5_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_HDF5\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_HDF5\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${USE_PARALLEL_COMPILER_TRUE}" && test -z "${USE_PARALLEL_COMPILER_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"USE_PARALLEL_COMPILER\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"USE_PARALLEL_COMPILER\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_NETCDF_TRUE}" && test -z "${HAVE_NETCDF_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"HAVE_NETCDF\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_NETCDF\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${USE_PARALLEL_COMPILER_TRUE}" && test -z "${USE_PARALLEL_COMPILER_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"USE_PARALLEL_COMPILER\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"USE_PARALLEL_COMPILER\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.  Logging --version etc. is OK.
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number, then exit
+  -q, --quiet      do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+		   instantiate the configuration file FILE
+  --header=FILE[:TEMPLATE]
+		   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf at gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.59,
+  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "x$1" : 'x\([^=]*\)='`
+    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  -*)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_option=$1
+     ac_need_defaults=false;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --vers* | -V )
+    echo "$ac_cs_version"; exit 0 ;;
+  --he | --h)
+    # Conflict between --help and --header
+    { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit 0 ;;
+  --debug | --d* | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    ac_need_defaults=false;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1" ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+  case "$ac_config_target" in
+  # Handling of arguments.
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+  "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
+  "tests/C/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/C/Makefile" ;;
+  "tests/Fortran/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Fortran/Makefile" ;;
+  "tests/genarray/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/genarray/Makefile" ;;
+  "tests/bp_read/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/bp_read/Makefile" ;;
+  "tests/suite/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/suite/Makefile" ;;
+  "tests/suite/programs/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/suite/programs/Makefile" ;;
+  "utils/Makefile" ) CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;;
+  "utils/adios_lint/Makefile" ) CONFIG_FILES="$CONFIG_FILES utils/adios_lint/Makefile" ;;
+  "utils/gpp/Makefile" ) CONFIG_FILES="$CONFIG_FILES utils/gpp/Makefile" ;;
+  "utils/bpdump/Makefile" ) CONFIG_FILES="$CONFIG_FILES utils/bpdump/Makefile" ;;
+  "utils/bp2h5/Makefile" ) CONFIG_FILES="$CONFIG_FILES utils/bp2h5/Makefile" ;;
+  "utils/bp2ncd/Makefile" ) CONFIG_FILES="$CONFIG_FILES utils/bp2ncd/Makefile" ;;
+  "utils/bp2ascii/Makefile" ) CONFIG_FILES="$CONFIG_FILES utils/bp2ascii/Makefile" ;;
+  "utils/bpsplit/Makefile" ) CONFIG_FILES="$CONFIG_FILES utils/bpsplit/Makefile" ;;
+  "utils/bpls/Makefile" ) CONFIG_FILES="$CONFIG_FILES utils/bpls/Makefile" ;;
+  "examples/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
+  "examples/C/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/C/Makefile" ;;
+  "examples/C/scalars/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/C/scalars/Makefile" ;;
+  "examples/C/arrays/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/C/arrays/Makefile" ;;
+  "examples/C/attributes/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/C/attributes/Makefile" ;;
+  "examples/C/manual/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/C/manual/Makefile" ;;
+  "examples/C/global-array/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/C/global-array/Makefile" ;;
+  "examples/C/global-array-time/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/C/global-array-time/Makefile" ;;
+  "examples/C/stat/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/C/stat/Makefile" ;;
+  "examples/C/read_all/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/C/read_all/Makefile" ;;
+  "examples/Fortran/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/Fortran/Makefile" ;;
+  "examples/Fortran/scalars/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/Fortran/scalars/Makefile" ;;
+  "examples/Fortran/arrays/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/Fortran/arrays/Makefile" ;;
+  "examples/Fortran/global-array/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/Fortran/global-array/Makefile" ;;
+  "examples/Fortran/global-array-time/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/Fortran/global-array-time/Makefile" ;;
+  "adios_config.flags" ) CONFIG_FILES="$CONFIG_FILES adios_config.flags" ;;
+  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+  "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./confstat$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+  # Protect against being on the right side of a sed subst in config.status.
+  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s, at SHELL@,$SHELL,;t t
+s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s, at exec_prefix@,$exec_prefix,;t t
+s, at prefix@,$prefix,;t t
+s, at program_transform_name@,$program_transform_name,;t t
+s, at bindir@,$bindir,;t t
+s, at sbindir@,$sbindir,;t t
+s, at libexecdir@,$libexecdir,;t t
+s, at datadir@,$datadir,;t t
+s, at sysconfdir@,$sysconfdir,;t t
+s, at sharedstatedir@,$sharedstatedir,;t t
+s, at localstatedir@,$localstatedir,;t t
+s, at libdir@,$libdir,;t t
+s, at includedir@,$includedir,;t t
+s, at oldincludedir@,$oldincludedir,;t t
+s, at infodir@,$infodir,;t t
+s, at mandir@,$mandir,;t t
+s, at build_alias@,$build_alias,;t t
+s, at host_alias@,$host_alias,;t t
+s, at target_alias@,$target_alias,;t t
+s, at DEFS@,$DEFS,;t t
+s, at ECHO_C@,$ECHO_C,;t t
+s, at ECHO_N@,$ECHO_N,;t t
+s, at ECHO_T@,$ECHO_T,;t t
+s, at LIBS@,$LIBS,;t t
+s, at INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s, at INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s, at INSTALL_DATA@,$INSTALL_DATA,;t t
+s, at CYGPATH_W@,$CYGPATH_W,;t t
+s, at PACKAGE@,$PACKAGE,;t t
+s, at VERSION@,$VERSION,;t t
+s, at ACLOCAL@,$ACLOCAL,;t t
+s, at AUTOCONF@,$AUTOCONF,;t t
+s, at AUTOMAKE@,$AUTOMAKE,;t t
+s, at AUTOHEADER@,$AUTOHEADER,;t t
+s, at MAKEINFO@,$MAKEINFO,;t t
+s, at install_sh@,$install_sh,;t t
+s, at STRIP@,$STRIP,;t t
+s, at ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s, at INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s, at mkdir_p@,$mkdir_p,;t t
+s, at AWK@,$AWK,;t t
+s, at SET_MAKE@,$SET_MAKE,;t t
+s, at am__leading_dot@,$am__leading_dot,;t t
+s, at AMTAR@,$AMTAR,;t t
+s, at am__tar@,$am__tar,;t t
+s, at am__untar@,$am__untar,;t t
+s, at CC@,$CC,;t t
+s, at CFLAGS@,$CFLAGS,;t t
+s, at LDFLAGS@,$LDFLAGS,;t t
+s, at CPPFLAGS@,$CPPFLAGS,;t t
+s, at ac_ct_CC@,$ac_ct_CC,;t t
+s, at EXEEXT@,$EXEEXT,;t t
+s, at OBJEXT@,$OBJEXT,;t t
+s, at DEPDIR@,$DEPDIR,;t t
+s, at am__include@,$am__include,;t t
+s, at am__quote@,$am__quote,;t t
+s, at AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s, at AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s, at AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s, at CCDEPMODE@,$CCDEPMODE,;t t
+s, at am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
+s, at am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s, at CPP@,$CPP,;t t
+s, at EGREP@,$EGREP,;t t
+s, at CXX@,$CXX,;t t
+s, at CXXFLAGS@,$CXXFLAGS,;t t
+s, at ac_ct_CXX@,$ac_ct_CXX,;t t
+s, at CXXDEPMODE@,$CXXDEPMODE,;t t
+s, at am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t
+s, at am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t
+s, at HAVE_MPI_TRUE@,$HAVE_MPI_TRUE,;t t
+s, at HAVE_MPI_FALSE@,$HAVE_MPI_FALSE,;t t
+s, at MPICC@,$MPICC,;t t
+s, at MPILIBS@,$MPILIBS,;t t
+s, at MPICXX@,$MPICXX,;t t
+s, at BUILD_FORTRAN_TRUE@,$BUILD_FORTRAN_TRUE,;t t
+s, at BUILD_FORTRAN_FALSE@,$BUILD_FORTRAN_FALSE,;t t
+s, at FC@,$FC,;t t
+s, at FCFLAGS@,$FCFLAGS,;t t
+s, at ac_ct_FC@,$ac_ct_FC,;t t
+s, at FCLIBS@,$FCLIBS,;t t
+s, at MPIFC@,$MPIFC,;t t
+s, at build@,$build,;t t
+s, at build_cpu@,$build_cpu,;t t
+s, at build_vendor@,$build_vendor,;t t
+s, at build_os@,$build_os,;t t
+s, at host@,$host,;t t
+s, at host_cpu@,$host_cpu,;t t
+s, at host_vendor@,$host_vendor,;t t
+s, at host_os@,$host_os,;t t
+s, at SED@,$SED,;t t
+s, at LN_S@,$LN_S,;t t
+s, at ECHO@,$ECHO,;t t
+s, at AR@,$AR,;t t
+s, at ac_ct_AR@,$ac_ct_AR,;t t
+s, at RANLIB@,$RANLIB,;t t
+s, at ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s, at CXXCPP@,$CXXCPP,;t t
+s, at F77@,$F77,;t t
+s, at FFLAGS@,$FFLAGS,;t t
+s, at ac_ct_F77@,$ac_ct_F77,;t t
+s, at LIBTOOL@,$LIBTOOL,;t t
+s, at HAVE_MXML_TRUE@,$HAVE_MXML_TRUE,;t t
+s, at HAVE_MXML_FALSE@,$HAVE_MXML_FALSE,;t t
+s, at PTHREAD_CC@,$PTHREAD_CC,;t t
+s, at PTHREAD_LIBS@,$PTHREAD_LIBS,;t t
+s, at PTHREAD_CFLAGS@,$PTHREAD_CFLAGS,;t t
+s, at MXML_LIBS@,$MXML_LIBS,;t t
+s, at MXML_LDFLAGS@,$MXML_LDFLAGS,;t t
+s, at MXML_CPPFLAGS@,$MXML_CPPFLAGS,;t t
+s, at HAVE_INFINIBAND_TRUE@,$HAVE_INFINIBAND_TRUE,;t t
+s, at HAVE_INFINIBAND_FALSE@,$HAVE_INFINIBAND_FALSE,;t t
+s, at INFINIBAND_CPPFLAGS@,$INFINIBAND_CPPFLAGS,;t t
+s, at INFINIBAND_CFLAGS@,$INFINIBAND_CFLAGS,;t t
+s, at INFINIBAND_LDFLAGS@,$INFINIBAND_LDFLAGS,;t t
+s, at INFINIBAND_LIBS@,$INFINIBAND_LIBS,;t t
+s, at INFINIBAND_HEADER@,$INFINIBAND_HEADER,;t t
+s, at HAVE_PORTALS_TRUE@,$HAVE_PORTALS_TRUE,;t t
+s, at HAVE_PORTALS_FALSE@,$HAVE_PORTALS_FALSE,;t t
+s, at NEED_DARWIN_SINGLE_MODULE_TRUE@,$NEED_DARWIN_SINGLE_MODULE_TRUE,;t t
+s, at NEED_DARWIN_SINGLE_MODULE_FALSE@,$NEED_DARWIN_SINGLE_MODULE_FALSE,;t t
+s, at PORTALS_CPPFLAGS@,$PORTALS_CPPFLAGS,;t t
+s, at PORTALS_CFLAGS@,$PORTALS_CFLAGS,;t t
+s, at PORTALS_LDFLAGS@,$PORTALS_LDFLAGS,;t t
+s, at PORTALS_LIBS@,$PORTALS_LIBS,;t t
+s, at PORTALS_HEADER@,$PORTALS_HEADER,;t t
+s, at PORTALS_NAL_HEADER@,$PORTALS_NAL_HEADER,;t t
+s, at PORTALS_RT_HEADER@,$PORTALS_RT_HEADER,;t t
+s, at HAVE_HDF5_TRUE@,$HAVE_HDF5_TRUE,;t t
+s, at HAVE_HDF5_FALSE@,$HAVE_HDF5_FALSE,;t t
+s, at HDF5_LIBS@,$HDF5_LIBS,;t t
+s, at HDF5_LDFLAGS@,$HDF5_LDFLAGS,;t t
+s, at HDF5_CPPFLAGS@,$HDF5_CPPFLAGS,;t t
+s, at HAVE_PHDF5_TRUE@,$HAVE_PHDF5_TRUE,;t t
+s, at HAVE_PHDF5_FALSE@,$HAVE_PHDF5_FALSE,;t t
+s, at PHDF5_LIBS@,$PHDF5_LIBS,;t t
+s, at PHDF5_LDFLAGS@,$PHDF5_LDFLAGS,;t t
+s, at PHDF5_CPPFLAGS@,$PHDF5_CPPFLAGS,;t t
+s, at HAVE_NETCDF_TRUE@,$HAVE_NETCDF_TRUE,;t t
+s, at HAVE_NETCDF_FALSE@,$HAVE_NETCDF_FALSE,;t t
+s, at NETCDF_LIBS@,$NETCDF_LIBS,;t t
+s, at NETCDF_LDFLAGS@,$NETCDF_LDFLAGS,;t t
+s, at NETCDF_CPPFLAGS@,$NETCDF_CPPFLAGS,;t t
+s, at HAVE_NC4PAR_TRUE@,$HAVE_NC4PAR_TRUE,;t t
+s, at HAVE_NC4PAR_FALSE@,$HAVE_NC4PAR_FALSE,;t t
+s, at NC4PAR_LIBS@,$NC4PAR_LIBS,;t t
+s, at NC4PAR_LDFLAGS@,$NC4PAR_LDFLAGS,;t t
+s, at NC4PAR_CPPFLAGS@,$NC4PAR_CPPFLAGS,;t t
+s, at HAVE_PABLO_TRUE@,$HAVE_PABLO_TRUE,;t t
+s, at HAVE_PABLO_FALSE@,$HAVE_PABLO_FALSE,;t t
+s, at PABLO_LIBS@,$PABLO_LIBS,;t t
+s, at PABLO_LDFLAGS@,$PABLO_LDFLAGS,;t t
+s, at PABLO_CPPFLAGS@,$PABLO_CPPFLAGS,;t t
+s, at HAVE_NSSI_TRUE@,$HAVE_NSSI_TRUE,;t t
+s, at HAVE_NSSI_FALSE@,$HAVE_NSSI_FALSE,;t t
+s, at NSSI_LIBS@,$NSSI_LIBS,;t t
+s, at NSSI_SERVER_LIBS@,$NSSI_SERVER_LIBS,;t t
+s, at NSSI_CFLAGS@,$NSSI_CFLAGS,;t t
+s, at NSSI_CPPFLAGS@,$NSSI_CPPFLAGS,;t t
+s, at NSSI_LDFLAGS@,$NSSI_LDFLAGS,;t t
+s, at NSSI_SRCDIR@,$NSSI_SRCDIR,;t t
+s, at NSSI_BUILDDIR@,$NSSI_BUILDDIR,;t t
+s, at HAVE_DART_TRUE@,$HAVE_DART_TRUE,;t t
+s, at HAVE_DART_FALSE@,$HAVE_DART_FALSE,;t t
+s, at DART_LIBS@,$DART_LIBS,;t t
+s, at DART_LDFLAGS@,$DART_LDFLAGS,;t t
+s, at DART_CPPFLAGS@,$DART_CPPFLAGS,;t t
+s, at HAVE_DIMES_TRUE@,$HAVE_DIMES_TRUE,;t t
+s, at HAVE_DIMES_FALSE@,$HAVE_DIMES_FALSE,;t t
+s, at DIMES_LIBS@,$DIMES_LIBS,;t t
+s, at DIMES_LDFLAGS@,$DIMES_LDFLAGS,;t t
+s, at DIMES_CPPFLAGS@,$DIMES_CPPFLAGS,;t t
+s, at HAVE_DMALLOC_TRUE@,$HAVE_DMALLOC_TRUE,;t t
+s, at HAVE_DMALLOC_FALSE@,$HAVE_DMALLOC_FALSE,;t t
+s, at DMALLOC_LIBS@,$DMALLOC_LIBS,;t t
+s, at DMALLOC_LDFLAGS@,$DMALLOC_LDFLAGS,;t t
+s, at DMALLOC_CPPFLAGS@,$DMALLOC_CPPFLAGS,;t t
+s, at CSH@,$CSH,;t t
+s, at PATHPROG@,$PATHPROG,;t t
+s, at DT_LIBS@,$DT_LIBS,;t t
+s, at DT_CPPFLAGS@,$DT_CPPFLAGS,;t t
+s, at DT_LDFLAGS@,$DT_LDFLAGS,;t t
+s, at RESEARCH_TRANSPORTS_TRUE@,$RESEARCH_TRANSPORTS_TRUE,;t t
+s, at RESEARCH_TRANSPORTS_FALSE@,$RESEARCH_TRANSPORTS_FALSE,;t t
+s, at HAVE_DATATAP_TRUE@,$HAVE_DATATAP_TRUE,;t t
+s, at HAVE_DATATAP_FALSE@,$HAVE_DATATAP_FALSE,;t t
+s, at BUILD_WRITE_TRUE@,$BUILD_WRITE_TRUE,;t t
+s, at BUILD_WRITE_FALSE@,$BUILD_WRITE_FALSE,;t t
+s, at USE_PARALLEL_COMPILER_TRUE@,$USE_PARALLEL_COMPILER_TRUE,;t t
+s, at USE_PARALLEL_COMPILER_FALSE@,$USE_PARALLEL_COMPILER_FALSE,;t t
+s, at ADIOSLIB_CPPFLAGS@,$ADIOSLIB_CPPFLAGS,;t t
+s, at ADIOSLIB_CFLAGS@,$ADIOSLIB_CFLAGS,;t t
+s, at ADIOSLIB_LDFLAGS@,$ADIOSLIB_LDFLAGS,;t t
+s, at ADIOSLIB_LDADD@,$ADIOSLIB_LDADD,;t t
+s, at ADIOSLIB_SEQ_CPPFLAGS@,$ADIOSLIB_SEQ_CPPFLAGS,;t t
+s, at ADIOSLIB_SEQ_CFLAGS@,$ADIOSLIB_SEQ_CFLAGS,;t t
+s, at ADIOSLIB_SEQ_LDFLAGS@,$ADIOSLIB_SEQ_LDFLAGS,;t t
+s, at ADIOSLIB_SEQ_LDADD@,$ADIOSLIB_SEQ_LDADD,;t t
+s, at ADIOSREADLIB_CPPFLAGS@,$ADIOSREADLIB_CPPFLAGS,;t t
+s, at ADIOSREADLIB_CFLAGS@,$ADIOSREADLIB_CFLAGS,;t t
+s, at ADIOSREADLIB_LDFLAGS@,$ADIOSREADLIB_LDFLAGS,;t t
+s, at ADIOSREADLIB_LDADD@,$ADIOSREADLIB_LDADD,;t t
+s, at ADIOSREADLIB_SEQ_CPPFLAGS@,$ADIOSREADLIB_SEQ_CPPFLAGS,;t t
+s, at ADIOSREADLIB_SEQ_CFLAGS@,$ADIOSREADLIB_SEQ_CFLAGS,;t t
+s, at ADIOSREADLIB_SEQ_LDFLAGS@,$ADIOSREADLIB_SEQ_LDFLAGS,;t t
+s, at ADIOSREADLIB_SEQ_LDADD@,$ADIOSREADLIB_SEQ_LDADD,;t t
+s, at ADIOSLIB_EXTRA_CPPFLAGS@,$ADIOSLIB_EXTRA_CPPFLAGS,;t t
+s, at LIBOBJS@,$LIBOBJS,;t t
+s, at LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+  cat >>$CONFIG_STATUS <<\_ACEOF
+  # Split the substitutions into bite-sized pieces for seds with
+  # small command number limits, like on Digital OSF/1 and HP-UX.
+  ac_max_sed_lines=48
+  ac_sed_frag=1 # Number of current file.
+  ac_beg=1 # First line for current file.
+  ac_end=$ac_max_sed_lines # Line after last line for current file.
+  ac_more_lines=:
+  ac_sed_cmds=
+  while $ac_more_lines; do
+    if test $ac_beg -gt 1; then
+      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    else
+      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    fi
+    if test ! -s $tmp/subs.frag; then
+      ac_more_lines=false
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+      if test -z "$ac_sed_cmds"; then
+	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+      else
+	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+      fi
+      ac_sed_frag=`expr $ac_sed_frag + 1`
+      ac_beg=$ac_end
+      ac_end=`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=cat
+  fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+  esac
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    configure_input=
+  else
+    configure_input="$ac_file.  "
+  fi
+  configure_input=$configure_input"Generated from `echo $ac_file_in |
+				     sed 's,.*/,,'` by configure."
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 echo "$f";;
+      *) # Relative
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s, at configure_input@,$configure_input,;t t
+s, at srcdir@,$ac_srcdir,;t t
+s, at abs_srcdir@,$ac_abs_srcdir,;t t
+s, at top_srcdir@,$ac_top_srcdir,;t t
+s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s, at builddir@,$ac_builddir,;t t
+s, at abs_builddir@,$ac_abs_builddir,;t t
+s, at top_builddir@,$ac_top_builddir,;t t
+s, at abs_top_builddir@,$ac_abs_top_builddir,;t t
+s, at INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+  rm -f $tmp/stdin
+  if test x"$ac_file" != x-; then
+    mv $tmp/out $ac_file
+  else
+    cat $tmp/out
+    rm -f $tmp/out
+  fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
+ac_dB='[	 ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 # Do quote $f, to prevent DOS paths from being IFS'd.
+	 echo "$f";;
+      *) # Relative
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+  # Remove the trailing spaces.
+  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h.  The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status.  Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless.  Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
+
+# This sed command replaces #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >>conftest.undefs <<\_ACEOF
+s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo '  :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+  # Write a limited-size here document to $tmp/defines.sed.
+  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#define' lines.
+  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/defines.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo '  fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.undefs >/dev/null
+do
+  # Write a limited-size here document to $tmp/undefs.sed.
+  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#undef'
+  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+  rm -f conftest.undefs
+  mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated by config.status.  */
+  if test x"$ac_file" = x-; then
+    echo "/* Generated by configure.  */" >$tmp/config.h
+  else
+    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
+  fi
+  cat $tmp/in >>$tmp/config.h
+  rm -f $tmp/in
+  if test x"$ac_file" != x-; then
+    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+      { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+      rm -f $ac_file
+      mv $tmp/config.h $ac_file
+    fi
+  else
+    cat $tmp/config.h
+    rm -f $tmp/config.h
+  fi
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $ac_file | $ac_file:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X$ac_file : 'X\(//\)[^/]' \| \
+	 X$ac_file : 'X\(//\)$' \| \
+	 X$ac_file : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X$ac_file |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`/stamp-h$_am_stamp_count
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_dest" : 'X\(//\)[^/]' \| \
+	 X"$ac_dest" : 'X\(//\)$' \| \
+	 X"$ac_dest" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+
+  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+  case $ac_dest in
+    depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # So let's grep whole file.
+  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+    dirpart=`(dirname "$mf") 2>/dev/null ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`(dirname "$file") 2>/dev/null ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    { if $as_mkdir_p; then
+    mkdir -p $dirpart/$fdir
+  else
+    as_dir=$dirpart/$fdir
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+  esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+
+
+echo
+echo "*********************************"
+echo $PACKAGE configured as follows:
+echo "*********************************"
+echo
+
+echo
+echo "  - General Compile FLAGS";
+echo "      - CC  = $CC";
+echo "      - CXX = $CXX";
+echo "      - FC  = $FC";
+echo "      - CPPFLAGS = $CPPFLAGS";
+echo "      - CFLAGS   = $CFLAGS";
+echo "      - CXXFLAGS = $CXXFLAGS";
+echo "      - FCFLAGS  = $FCFLAGS";
+echo "      - LDLAGS   = $LDFLAGS";
+echo "      - LIBS     = $LIBS";
+echo
+echo "      - MPICC   = $MPICC";
+echo "      - MPICXX  = $MPICXX";
+echo "      - MPIFC   = $MPIFC";
+echo "      - MPILIBS = $MPILIBS";
+echo
+
+if test "x$enable_research_transports" == "xyes"; then
+        echo "  - Research Transports Included";
+
+else
+        echo "  - No research transport methods";
+fi
+
+if test -z "${HAVE_MXML_TRUE}"; then
+        echo "  - MXML";
+        echo "      - MXML_CFLAGS = $MXML_CFLAGS";
+        echo "      - MXML_CPPFLAGS = $MXML_CPPFLAGS";
+        echo "      - MXML_LDFLAGS = $MXML_LDFLAGS";
+        echo "      - MXML_LIBS = $MXML_LIBS";
+        echo
+else
+        echo "  - No MXML"
+fi
+
+if test -z "${HAVE_PORTALS_TRUE}"; then
+        echo "  - PORTALS";
+        echo "      - PORTALS_CFLAGS = $PORTALS_CFLAGS";
+        echo "      - PORTALS_CPPFLAGS = $PORTALS_CPPFLAGS";
+        echo "      - PORTALS_LDFLAGS = $PORTALS_LDFLAGS";
+        echo "      - PORTALS_LIBS = $PORTALS_LIBS";
+        echo
+else
+	echo "  - No Portals"
+fi
+
+if test -z "${HAVE_INFINIBAND_TRUE}"; then
+        echo "  - INFINIBAND";
+        echo "      - INFINIBAND_CFLAGS = $INFINIBAND_CFLAGS";
+        echo "      - INFINIBAND_CPPFLAGS = $INFINIBAND_CPPFLAGS";
+        echo "      - INFINIBAND_LDFLAGS = $INFINIBAND_LDFLAGS";
+        echo "      - INFINIBAND_LIBS = $INFINIBAND_LIBS";
+        echo
+else
+	echo "  - No InfiniBand"
+fi
+
+
+if test "x${datatap}" != "xdisable"; then
+        echo "  - DataTap with interconnect: $datatap";
+	echo "	   - DT_CFLAGS     = $DT_CFLAGS";
+	echo "	   - DT_CPPFLAGS   = $DT_CPPFLAGS";
+	echo "	   - DT_LDFLAGS    = $DT_LDFLAGS";
+	echo "	   - DT_LIBS       = $DT_LIBS";
+        echo
+else
+        echo "  - No DataTap transport";
+fi
+
+if test -z "${HAVE_DART_TRUE}"; then
+        echo "  - DART transport method";
+        echo "      - DART_CFLAGS = $DART_CFLAGS";
+        echo "      - DART_CPPFLAGS = $DART_CPPFLAGS";
+        echo "      - DART_LDFLAGS = $DART_LDFLAGS";
+        echo "      - DART_LIBS = $DART_LIBS";
+        echo
+else
+	echo "  - No DART to build DART transport method"
+fi
+
+if test -z "${HAVE_DIMES_TRUE}"; then
+        echo "  - DIMES transport method";
+        echo "      - DIMES_CFLAGS = $DIMES_CFLAGS";
+        echo "      - DIMES_CPPFLAGS = $DIMES_CPPFLAGS";
+        echo "      - DIMES_LDFLAGS = $DIMES_LDFLAGS";
+        echo "      - DIMES_LIBS = $DIMES_LIBS";
+        echo
+else
+        echo "  - No DIMES to build DIMES transport method"
+fi
+
+if test -z "${HAVE_PHDF5_TRUE}"; then
+        echo "  - PHDF5";
+        echo "      - PHDF5_CFLAGS = $PHDF5_CFLAGS";
+        echo "      - PHDF5_CPPFLAGS = $PHDF5_CPPFLAGS";
+        echo "      - PHDF5_LDFLAGS = $PHDF5_LDFLAGS";
+        echo "      - PHDF5_LIBS = $PHDF5_LIBS";
+        echo
+else
+	echo "  - No PHDF5"
+fi
+
+if test -z "${HAVE_HDF5_TRUE}"; then
+        echo "  - HDF5";
+        echo "      - HDF5_CFLAGS = $HDF5_CFLAGS";
+        echo "      - HDF5_CPPFLAGS = $HDF5_CPPFLAGS";
+        echo "      - HDF5_LDFLAGS = $HDF5_LDFLAGS";
+        echo "      - HDF5_LIBS = $HDF5_LIBS";
+        echo
+else
+	echo "  - No HDF5"
+fi
+
+if test -z "${HAVE_NC4PAR_TRUE}"; then
+        echo "  - NetCDF 4 Parallel";
+        echo "      - NC4PAR_CFLAGS = $NC4PAR_CFLAGS";
+        echo "      - NC4PAR_CPPFLAGS = $NC4PAR_CPPFLAGS";
+        echo "      - NC4PAR_LDFLAGS = $NC4PAR_LDFLAGS";
+        echo "      - NC4PAR_LIBS = $NC4PAR_LIBS";
+        echo
+else
+	echo "  - No NETCDF 4 Parallel"
+fi
+
+if test -z "${HAVE_NETCDF_TRUE}"; then
+        echo "  - NetCDF";
+        echo "      - NETCDF_CFLAGS = $NETCDF_CFLAGS";
+        echo "      - NETCDF_CPPFLAGS = $NETCDF_CPPFLAGS";
+        echo "      - NETCDF_LDFLAGS = $NETCDF_LDFLAGS";
+        echo "      - NETCDF_LIBS = $NETCDF_LIBS";
+        echo
+else
+	echo "  - No NETCDF"
+fi
+
+if test -z "${HAVE_NSSI_TRUE}"; then
+        echo "  - NSSI";
+        echo "      - NSSI_CFLAGS = $NSSI_CFLAGS";
+        echo "      - NSSI_CPPFLAGS = $NSSI_CPPFLAGS";
+        echo "      - NSSI_LDFLAGS = $NSSI_LDFLAGS";
+        echo "      - NSSI_LIBS = $NSSI_LIBS";
+        echo
+else
+	echo "  - No NSSI"
+fi
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..0023a4d
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,459 @@
+
+AC_INIT(configure.ac)
+AC_CONFIG_AUX_DIR(config)
+AC_REVISION($Revision$)
+
+AC_CONFIG_HEADERS(config.h)
+AM_INIT_AUTOMAKE(adios,1.2.1)
+
+AC_LANG(C)
+AC_C_STRINGIZE
+dnl generates HAVE_STRINGIZE
+
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_CXX
+
+AC_LANG(C)
+ACX_MPI([], [AC_MSG_ERROR([couldn't find mpi library for C])])
+
+AC_LANG(C++)
+ACX_MPI([], [AC_MSG_ERROR([couldn't find mpi library for C++])])
+
+AC_ARG_ENABLE(fortran, 
+    [AS_HELP_STRING([--disable-fortran],[disable Fortran test programs in ADIOS.])])
+AM_CONDITIONAL([BUILD_FORTRAN], [test "x$enable_fortran" != "xno"])
+
+if test "x$enable_fortran" != "xno"; then
+    AC_PROG_FC
+    AC_PROG_FC_C_O
+    AC_FC_WRAPPERS
+    F77=$FC
+    dnl AC_PROG_F77
+    dnl AC_PROG_F77_C_O
+    AC_LANG(Fortran)
+    ACX_MPI([], [AC_MSG_ERROR([couldn't find mpi library for Fortran])])
+fi
+
+AC_LANG(C)
+
+dnl Generate libtool script and then do a nasty thing.
+dnl PGI compiler (behind MPICC) does not like --rpath.
+dnl The only way I found to avoid the problem is to remove the chance of using it
+dnl inside the libtool script. Similar to what HDF5 configure does.
+dnl see: http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/configure.in
+dnl look the snippet after LT_INIT there.
+AC_PROG_LIBTOOL
+#LT_INIT([disable-shared])
+dnl echo 'fixing hardcode_libdir_flag_spec in' $ofile
+dnl ed - $ofile <<EOF 2> /dev/null
+dnl g/^wl=".*"/s//wl="-Wl,"/
+dnl w
+dnl q
+dnl EOF
+dnl g/^hardcode_libdir_flag_spec=".*"/s//hardcode_libdir_flag_spec=""/
+dnl g/^hardcode_libdir_flag_spec_ld=".*"/s//hardcode_libdir_flag_spec_ld=""/
+
+AC_PROG_MXML
+dnl AC_PROG_GENGETOPT
+AC_INFINIBAND
+AC_PORTALS
+AC_HDF5
+AC_PHDF5
+AC_NETCDF
+AC_NC4PAR
+AC_NSSI
+AC_PROG_DART
+AC_PROG_DIMES
+AC_DMALLOC
+AC_DATATAP
+
+AC_LANG(C)
+
+
+AC_ARG_ENABLE(research-transports, 
+    [AS_HELP_STRING([--enable-research-transports], 
+        [Enable building the various research transports. Default is not to build these as they are not part of the base distribution.])])
+AM_CONDITIONAL([RESEARCH_TRANSPORTS], [test "x$enable_research_transports" == "xyes"])
+
+AC_LANG(C)
+
+AM_CONDITIONAL([HAVE_DATATAP], [test x$datatap != xdisable])
+
+AC_ARG_ENABLE(write, 
+    [AS_HELP_STRING([--disable-write],[disable building the write methods in ADIOS. Must be used on MacOSX])])
+AM_CONDITIONAL([BUILD_WRITE], [test "x$enable_write" != "xno"])
+
+dnl CC="$MPICC"
+dnl CXX="$MPICXX"
+dnl FC="$MPIFC"
+
+LIBS="$MPILIBS"
+
+AM_CONDITIONAL(USE_PARALLEL_COMPILER,false)
+
+dnl Use PHDF5 for bp2h5 if no sequential HDF5 was found
+if test -z "${HAVE_PHDF5_TRUE}" -a -z "${HAVE_HDF5_FALSE}"; then
+    HDF5_CPPFLAGS="${PHDF5_CPPFLAGS}"
+    HDF5_CFLAGS="${PHDF5_CFLAGS}"
+    HDF5_LDFLAGS="${PHDF5_LDFLAGS}"
+    HDF5_LIBS="${PHDF5_LIBS}"
+    AM_CONDITIONAL(HAVE_HDF5,true)
+    AC_DEFINE(HAVE_HDF5,1,[Define if you have HDF5.])
+    AM_CONDITIONAL(USE_PARALLEL_COMPILER,true)
+    AC_MSG_NOTICE([Use PHDF5 for sequential HDF5 tools])
+fi
+
+dnl Use NC4PAR for bp2ncd if no sequential NETCDF was found
+if test -z "${HAVE_NC4PAR_TRUE}" -a -z "${HAVE_NETCDF_FALSE}"; then
+    NETCDF_CPPFLAGS="${NC4PAR_CPPFLAGS}"
+    NETCDF_CFLAGS="${NC4PAR_CFLAGS}"
+    NETCDF_LDFLAGS="${NC4PAR_LDFLAGS}"
+    NETCDF_LIBS="${NC4PAR_LIBS}"
+    AM_CONDITIONAL(HAVE_NETCDF,true)
+    AC_DEFINE(HAVE_NETCDF,1,[Define if you have NETCDF.])
+    AM_CONDITIONAL(USE_PARALLEL_COMPILER,true)
+    AC_MSG_NOTICE([Use NC4PAR for sequential NETCDF tools])
+fi
+
+
+dnl Generate flags for adios lib creation which depends on the packages we found
+dnl ADIOSLIB_* for compiling libadios.a and libadiosf.a, and linking codes with those
+dnl ADIOSLIB_SEQ_* for codes using libadios_internal_nompi.a (like bp2ncd, bp2h5, bpdump etc)
+dnl ADIOSREADLIB_* for codes using libadiosread.a, libadiosreadf.a, libadiosread_nompi.a 
+dnl adios_config will contain flags for users' code linking based on these flags
+dnl EXTRA flags are used for compiling adios stuff, which need not go into adios_config for user codes
+ADIOSLIB_EXTRA_CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE"
+ADIOSLIB_CPPFLAGS="${MXML_CPPFLAGS}"
+ADIOSLIB_CFLAGS=
+ADIOSLIB_LDFLAGS="${MXML_LDFLAGS}"
+ADIOSLIB_LDADD="-lm ${MXML_LIBS}"
+ADIOSLIB_SEQ_CPPFLAGS="-D_NOMPI ${MXML_CPPFLAGS}"
+ADIOSLIB_SEQ_CFLAGS=
+ADIOSLIB_SEQ_LDFLAGS="${MXML_LDFLAGS}"
+ADIOSLIB_SEQ_LDADD="-lm ${MXML_LIBS}"
+ADIOSREADLIB_CPPFLAGS=""
+ADIOSREADLIB_CFLAGS=
+ADIOSREADLIB_LDFLAGS=
+ADIOSREADLIB_LDADD="-lm"
+ADIOSREADLIB_SEQ_CPPFLAGS="-D_NOMPI"
+ADIOSREADLIB_SEQ_CFLAGS=
+ADIOSREADLIB_SEQ_LDFLAGS=
+ADIOSREADLIB_SEQ_LDADD="-lm"
+if test "x${datatap}" != "xdisable"; then
+    ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${DT_CPPFLAGS}"
+    ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${DT_CFLAGS}"
+    ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${DT_LDFLAGS}"
+    ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${DT_LIBS}"
+fi
+if test -z "${HAVE_DART_TRUE}"; then
+    ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${DART_CPPFLAGS}"
+    ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS}"
+    ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${DART_LDFLAGS}"
+    ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${DART_LIBS}"
+    ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} ${DART_CPPFLAGS}"
+    ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${DART_CFLAGS}"
+    ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${DART_LDFLAGS}"
+    ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${DART_LIBS}"
+    ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} ${DART_CPPFLAGS}"
+    ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${DART_CFLAGS}"
+    ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${DART_LDFLAGS}"
+    ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${DART_LIBS}"
+fi
+if test -z "${HAVE_DIMES_TRUE}"; then
+    ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${DIMES_CPPFLAGS}"
+    ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS}"
+    ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${DIMES_LDFLAGS}"
+    ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${DIMES_LIBS}"
+    ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} ${DIMES_CPPFLAGS}"
+    ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${DIMES_CFLAGS}"
+    ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${DIMES_LDFLAGS}"
+    ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${DIMES_LIBS}"
+    ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} ${DIMES_CPPFLAGS}"
+    ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${DIMES_CFLAGS}"
+    ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${DIMES_LDFLAGS}"
+    ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${DIMES_LIBS}"
+fi
+if test -z "${HAVE_NSSI_TRUE}"; then
+    ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${NSSI_CPPFLAGS}"
+    ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${NSSI_CFLAGS}"
+    ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${NSSI_LDFLAGS}"
+    ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${NSSI_LIBS}"
+fi
+if test -z "${HAVE_NC4PAR_TRUE}"; then
+    ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${NC4PAR_CPPFLAGS}"
+    ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${NC4PAR_CFLAGS}"
+    ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${NC4PAR_LDFLAGS}"
+    ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${NC4PAR_LIBS}"
+fi
+if test -z "${HAVE_PHDF5_TRUE}"; then
+    ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${PHDF5_CPPFLAGS}"
+    ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${PHDF5_CFLAGS}"
+    ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${PHDF5_LDFLAGS}"
+    ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${PHDF5_LIBS}"
+fi
+if test -z "${HAVE_PORTALS_TRUE}"; then
+    ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${PORTALS_CPPFLAGS}"
+    ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${PORTALS_CFLAGS}"
+    ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${PORTALS_LDFLAGS}"
+    ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${PORTALS_LIBS}"
+fi
+if test -z "${HAVE_INFINIBAND_TRUE}"; then
+    ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} ${INFINIBAND_CPPFLAGS}"
+    ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${INFINIBAND_CFLAGS}"
+    ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${INFINIBAND_LDFLAGS}"
+    ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${INFINIBAND_LIBS}"
+fi
+if test -z "${HAVE_NETCDF_TRUE}"; then
+    ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} ${NETCDF_CPPFLAGS}"
+    ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${NETCDF_CFLAGS}"
+    ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${NETCDF_LDFLAGS}"
+    ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${NETCDF_LIBS}"
+fi
+if test -z "${HAVE_HDF5_TRUE}"; then
+    ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} ${HDF5_CPPFLAGS}"
+    ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${HDF5_CFLAGS}"
+    ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${HDF5_LDFLAGS}"
+    ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${HDF5_LIBS}"
+fi
+if test -z "${HAVE_DMALLOC_TRUE}"; then
+    ADIOSLIB_CPPFLAGS="${ADIOSLIB_CPPFLAGS} -DDMALLOC ${DMALLOC_CPPFLAGS}"
+    ADIOSLIB_CFLAGS="${ADIOSLIB_CFLAGS} ${DMALLOC_CFLAGS}"
+    ADIOSLIB_LDFLAGS="${ADIOSLIB_LDFLAGS} ${DMALLOC_LDFLAGS}"
+    ADIOSLIB_LDADD="${ADIOSLIB_LDADD} ${DMALLOC_LIBS}"
+    ADIOSLIB_SEQ_CPPFLAGS="${ADIOSLIB_SEQ_CPPFLAGS} ${DMALLOC_CPPFLAGS}"
+    ADIOSLIB_SEQ_CFLAGS="${ADIOSLIB_SEQ_CFLAGS} ${DMALLOC_CFLAGS}"
+    ADIOSLIB_SEQ_LDFLAGS="${ADIOSLIB_SEQ_LDFLAGS} ${DMALLOC_LDFLAGS}"
+    ADIOSLIB_SEQ_LDADD="${ADIOSLIB_SEQ_LDADD} ${DMALLOC_LIBS}"
+    ADIOSREADLIB_CPPFLAGS="${ADIOSREADLIB_CPPFLAGS} ${DMALLOC_CPPFLAGS}"
+    ADIOSREADLIB_CFLAGS="${ADIOSREADLIB_CFLAGS} ${DMALLOC_CFLAGS}"
+    ADIOSREADLIB_LDFLAGS="${ADIOSREADLIB_LDFLAGS} ${DMALLOC_LDFLAGS}"
+    ADIOSREADLIB_LDADD="${ADIOSREADLIB_LDADD} ${DMALLOC_LIBS}"
+    ADIOSREADLIB_SEQ_CPPFLAGS="${ADIOSREADLIB_SEQ_CPPFLAGS} ${DMALLOC_CPPFLAGS}"
+    ADIOSREADLIB_SEQ_CFLAGS="${ADIOSREADLIB_SEQ_CFLAGS} ${DMALLOC_CFLAGS}"
+    ADIOSREADLIB_SEQ_LDFLAGS="${ADIOSREADLIB_SEQ_LDFLAGS} ${DMALLOC_LDFLAGS}"
+    ADIOSREADLIB_SEQ_LDADD="${ADIOSREADLIB_SEQ_LDADD} ${DMALLOC_LIBS}"
+fi
+AC_SUBST(ADIOSLIB_CPPFLAGS)
+AC_SUBST(ADIOSLIB_CFLAGS)
+AC_SUBST(ADIOSLIB_LDFLAGS)
+AC_SUBST(ADIOSLIB_LDADD)
+AC_SUBST(ADIOSLIB_SEQ_CPPFLAGS)
+AC_SUBST(ADIOSLIB_SEQ_CFLAGS)
+AC_SUBST(ADIOSLIB_SEQ_LDFLAGS)
+AC_SUBST(ADIOSLIB_SEQ_LDADD)
+AC_SUBST(ADIOSREADLIB_CPPFLAGS)
+AC_SUBST(ADIOSREADLIB_CFLAGS)
+AC_SUBST(ADIOSREADLIB_LDFLAGS)
+AC_SUBST(ADIOSREADLIB_LDADD)
+AC_SUBST(ADIOSREADLIB_SEQ_CPPFLAGS)
+AC_SUBST(ADIOSREADLIB_SEQ_CFLAGS)
+AC_SUBST(ADIOSREADLIB_SEQ_LDFLAGS)
+AC_SUBST(ADIOSREADLIB_SEQ_LDADD)
+AC_SUBST(ADIOSLIB_EXTRA_CPPFLAGS)
+
+if test -z "${USE_PARALLEL_COMPILER_TRUE}"; then
+        AC_DEFINE(USE_PARALLEL_COMPILER, 1, [Need to use MPI compiler for sequential utils])
+        echo "#### Defined USE_PARALLEL_COMPILER to = [${USE_PARALLEL_COMPILER}]"
+fi
+
+AC_CONFIG_FILES([Makefile
+                 src/Makefile
+                 tests/Makefile
+                 tests/C/Makefile
+                 tests/Fortran/Makefile
+                 tests/genarray/Makefile
+                 tests/bp_read/Makefile
+                 tests/suite/Makefile
+                 tests/suite/programs/Makefile
+                 utils/Makefile
+                 utils/adios_lint/Makefile
+                 utils/gpp/Makefile
+                 utils/bpdump/Makefile
+                 utils/bp2h5/Makefile
+                 utils/bp2ncd/Makefile
+                 utils/bp2ascii/Makefile
+                 utils/bpsplit/Makefile
+                 utils/bpls/Makefile
+                 examples/Makefile
+                 examples/C/Makefile
+                 examples/C/scalars/Makefile
+                 examples/C/arrays/Makefile
+                 examples/C/attributes/Makefile
+                 examples/C/manual/Makefile
+                 examples/C/global-array/Makefile
+                 examples/C/global-array-time/Makefile
+                 examples/C/stat/Makefile
+                 examples/C/read_all/Makefile
+                 examples/Fortran/Makefile
+                 examples/Fortran/scalars/Makefile
+                 examples/Fortran/arrays/Makefile
+                 examples/Fortran/global-array/Makefile
+                 examples/Fortran/global-array-time/Makefile
+                 adios_config.flags
+                ])
+
+AC_OUTPUT
+
+echo
+echo "*********************************"
+echo $PACKAGE configured as follows:
+echo "*********************************"
+echo
+
+echo
+echo "  - General Compile FLAGS";
+echo "      - CC  = $CC";
+echo "      - CXX = $CXX";
+echo "      - FC  = $FC";
+echo "      - CPPFLAGS = $CPPFLAGS";
+echo "      - CFLAGS   = $CFLAGS";
+echo "      - CXXFLAGS = $CXXFLAGS";
+echo "      - FCFLAGS  = $FCFLAGS";
+echo "      - LDLAGS   = $LDFLAGS";
+echo "      - LIBS     = $LIBS";
+echo
+echo "      - MPICC   = $MPICC";
+echo "      - MPICXX  = $MPICXX";
+echo "      - MPIFC   = $MPIFC";
+echo "      - MPILIBS = $MPILIBS";
+echo
+
+if test "x$enable_research_transports" == "xyes"; then 
+        echo "  - Research Transports Included";
+
+else
+        echo "  - No research transport methods";
+fi
+
+if test -z "${HAVE_MXML_TRUE}"; then
+        echo "  - MXML";
+        echo "      - MXML_CFLAGS = $MXML_CFLAGS";
+        echo "      - MXML_CPPFLAGS = $MXML_CPPFLAGS";
+        echo "      - MXML_LDFLAGS = $MXML_LDFLAGS";
+        echo "      - MXML_LIBS = $MXML_LIBS";
+        echo
+else
+        echo "  - No MXML"
+fi
+
+if test -z "${HAVE_PORTALS_TRUE}"; then
+        echo "  - PORTALS";
+        echo "      - PORTALS_CFLAGS = $PORTALS_CFLAGS";
+        echo "      - PORTALS_CPPFLAGS = $PORTALS_CPPFLAGS";
+        echo "      - PORTALS_LDFLAGS = $PORTALS_LDFLAGS";
+        echo "      - PORTALS_LIBS = $PORTALS_LIBS";
+        echo
+else
+	echo "  - No Portals"
+fi
+
+if test -z "${HAVE_INFINIBAND_TRUE}"; then
+        echo "  - INFINIBAND";
+        echo "      - INFINIBAND_CFLAGS = $INFINIBAND_CFLAGS";
+        echo "      - INFINIBAND_CPPFLAGS = $INFINIBAND_CPPFLAGS";
+        echo "      - INFINIBAND_LDFLAGS = $INFINIBAND_LDFLAGS";
+        echo "      - INFINIBAND_LIBS = $INFINIBAND_LIBS";
+        echo
+else
+	echo "  - No InfiniBand"
+fi
+
+dnl if test -z "${HAVE_GENGETOPT_TRUE}"; then
+dnl         echo "  - GENGETOPT";
+dnl         echo "      - GENGETOPT_CFLAGS = $GENGETOPT_CFLAGS";
+dnl         echo "      - GENGETOPT_CPPFLAGS = $GENGETOPT_CPPFLAGS";
+dnl         echo "      - GENGETOPT_LDFLAGS = $GENGETOPT_LDFLAGS";
+dnl         echo "      - GENGETOPT_LIBS = $GENGETOPT_LIBS";
+dnl         echo
+dnl else
+dnl         echo "  - No Gengetopt"
+dnl fi
+
+if test "x${datatap}" != "xdisable"; then
+        echo "  - DataTap with interconnect: $datatap";
+	echo "	   - DT_CFLAGS     = $DT_CFLAGS";
+	echo "	   - DT_CPPFLAGS   = $DT_CPPFLAGS";
+	echo "	   - DT_LDFLAGS    = $DT_LDFLAGS";
+	echo "	   - DT_LIBS       = $DT_LIBS";
+        echo
+else	
+        echo "  - No DataTap transport";
+fi
+
+if test -z "${HAVE_DART_TRUE}"; then
+        echo "  - DART transport method";
+        echo "      - DART_CFLAGS = $DART_CFLAGS";
+        echo "      - DART_CPPFLAGS = $DART_CPPFLAGS";
+        echo "      - DART_LDFLAGS = $DART_LDFLAGS";
+        echo "      - DART_LIBS = $DART_LIBS";
+        echo
+else
+	echo "  - No DART to build DART transport method"
+fi
+
+if test -z "${HAVE_DIMES_TRUE}"; then
+        echo "  - DIMES transport method";
+        echo "      - DIMES_CFLAGS = $DIMES_CFLAGS";
+        echo "      - DIMES_CPPFLAGS = $DIMES_CPPFLAGS";
+        echo "      - DIMES_LDFLAGS = $DIMES_LDFLAGS";
+        echo "      - DIMES_LIBS = $DIMES_LIBS";
+        echo
+else
+        echo "  - No DIMES to build DIMES transport method"
+fi  
+
+if test -z "${HAVE_PHDF5_TRUE}"; then
+        echo "  - PHDF5";
+        echo "      - PHDF5_CFLAGS = $PHDF5_CFLAGS";
+        echo "      - PHDF5_CPPFLAGS = $PHDF5_CPPFLAGS";
+        echo "      - PHDF5_LDFLAGS = $PHDF5_LDFLAGS";
+        echo "      - PHDF5_LIBS = $PHDF5_LIBS";
+        echo
+else
+	echo "  - No PHDF5"
+fi
+
+if test -z "${HAVE_HDF5_TRUE}"; then
+        echo "  - HDF5";
+        echo "      - HDF5_CFLAGS = $HDF5_CFLAGS";
+        echo "      - HDF5_CPPFLAGS = $HDF5_CPPFLAGS";
+        echo "      - HDF5_LDFLAGS = $HDF5_LDFLAGS";
+        echo "      - HDF5_LIBS = $HDF5_LIBS";
+        echo
+else
+	echo "  - No HDF5"
+fi
+
+if test -z "${HAVE_NC4PAR_TRUE}"; then
+        echo "  - NetCDF 4 Parallel";
+        echo "      - NC4PAR_CFLAGS = $NC4PAR_CFLAGS";
+        echo "      - NC4PAR_CPPFLAGS = $NC4PAR_CPPFLAGS";
+        echo "      - NC4PAR_LDFLAGS = $NC4PAR_LDFLAGS";
+        echo "      - NC4PAR_LIBS = $NC4PAR_LIBS";
+        echo
+else
+	echo "  - No NETCDF 4 Parallel"
+fi
+
+if test -z "${HAVE_NETCDF_TRUE}"; then
+        echo "  - NetCDF";
+        echo "      - NETCDF_CFLAGS = $NETCDF_CFLAGS";
+        echo "      - NETCDF_CPPFLAGS = $NETCDF_CPPFLAGS";
+        echo "      - NETCDF_LDFLAGS = $NETCDF_LDFLAGS";
+        echo "      - NETCDF_LIBS = $NETCDF_LIBS";
+        echo
+else
+	echo "  - No NETCDF"
+fi
+
+if test -z "${HAVE_NSSI_TRUE}"; then
+        echo "  - NSSI";
+        echo "      - NSSI_CFLAGS = $NSSI_CFLAGS";
+        echo "      - NSSI_CPPFLAGS = $NSSI_CPPFLAGS";
+        echo "      - NSSI_LDFLAGS = $NSSI_LDFLAGS";
+        echo "      - NSSI_LIBS = $NSSI_LIBS";
+        echo
+else
+	echo "  - No NSSI"
+fi
diff --git a/examples/C/Makefile.am b/examples/C/Makefile.am
new file mode 100644
index 0000000..89bd656
--- /dev/null
+++ b/examples/C/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS=scalars arrays attributes manual global-array global-array-time read_all stat
diff --git a/examples/C/Makefile.in b/examples/C/Makefile.in
new file mode 100644
index 0000000..a98adee
--- /dev/null
+++ b/examples/C/Makefile.in
@@ -0,0 +1,599 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = examples/C
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+SUBDIRS = scalars arrays attributes manual global-array global-array-time read_all stat
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  examples/C/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  examples/C/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/examples/C/arrays/Makefile.am b/examples/C/arrays/Makefile.am
new file mode 100644
index 0000000..dd25984
--- /dev/null
+++ b/examples/C/arrays/Makefile.am
@@ -0,0 +1,17 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+noinst_PROGRAMS = arrays_write arrays_read
+
+arrays_write_SOURCES = arrays_write.c
+arrays_write_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD)
+arrays_write_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+arrays_read_SOURCES = arrays_read.c
+arrays_read_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD)
+arrays_read_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+
+CLEANFILES = *.bp
+CC=$(MPICC)
+EXTRA_DIST = arrays.xml gwrite_arrays.ch gread_arrays.ch job.pbs
diff --git a/examples/C/arrays/Makefile.in b/examples/C/arrays/Makefile.in
new file mode 100644
index 0000000..3135f42
--- /dev/null
+++ b/examples/C/arrays/Makefile.in
@@ -0,0 +1,553 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = arrays_write$(EXEEXT) arrays_read$(EXEEXT)
+subdir = examples/C/arrays
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_arrays_read_OBJECTS = arrays_read.$(OBJEXT)
+arrays_read_OBJECTS = $(am_arrays_read_OBJECTS)
+am__DEPENDENCIES_1 =
+arrays_read_DEPENDENCIES = $(top_builddir)/src/libadios.a \
+	$(am__DEPENDENCIES_1)
+am_arrays_write_OBJECTS = arrays_write.$(OBJEXT)
+arrays_write_OBJECTS = $(am_arrays_write_OBJECTS)
+arrays_write_DEPENDENCIES = $(top_builddir)/src/libadios.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(arrays_read_SOURCES) $(arrays_write_SOURCES)
+DIST_SOURCES = $(arrays_read_SOURCES) $(arrays_write_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+arrays_write_SOURCES = arrays_write.c
+arrays_write_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD)
+arrays_write_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+arrays_read_SOURCES = arrays_read.c
+arrays_read_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD)
+arrays_read_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+CLEANFILES = *.bp
+EXTRA_DIST = arrays.xml gwrite_arrays.ch gread_arrays.ch job.pbs
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  examples/C/arrays/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  examples/C/arrays/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+arrays_read$(EXEEXT): $(arrays_read_OBJECTS) $(arrays_read_DEPENDENCIES) 
+	@rm -f arrays_read$(EXEEXT)
+	$(LINK) $(arrays_read_LDFLAGS) $(arrays_read_OBJECTS) $(arrays_read_LDADD) $(LIBS)
+arrays_write$(EXEEXT): $(arrays_write_OBJECTS) $(arrays_write_DEPENDENCIES) 
+	@rm -f arrays_write$(EXEEXT)
+	$(LINK) $(arrays_write_LDFLAGS) $(arrays_write_OBJECTS) $(arrays_write_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.c.o:
+	$(COMPILE) -c $<
+
+.c.obj:
+	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+	$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/examples/C/arrays/arrays.xml b/examples/C/arrays/arrays.xml
new file mode 100644
index 0000000..fa16af7
--- /dev/null
+++ b/examples/C/arrays/arrays.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<adios-config host-language="C">
+
+    <adios-group name="arrays" coordination-communicator="comm">
+        <var name="NX" type="integer"/>
+        <var name="NY" type="integer"/>
+        <var name="var_double_2Darray"  gwrite="t"  type="double"  dimensions="NX,NY"/>
+        <var name="var_int_1Darray"     gwrite="p"  type="integer" dimensions="NX"/>
+    </adios-group>
+
+<method group="arrays"  method="MPI"/>
+
+<buffer size-MB="20" allocate-time="now"/>
+
+</adios-config>
+
diff --git a/examples/C/arrays/arrays_read.c b/examples/C/arrays/arrays_read.c
new file mode 100644
index 0000000..46c212f
--- /dev/null
+++ b/examples/C/arrays/arrays_read.c
@@ -0,0 +1,83 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/*************************************************************/
+/*          Example of reading arrays in ADIOS               */
+/*    which were written from the same number of processors  */
+/*                                                           */
+/*        Similar example is manual/2_adios_read.c           */
+/*************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include "mpi.h"
+#include "adios.h"
+
+int main (int argc, char ** argv) 
+{
+    char        filename [256];
+    int         rank, size, i, j;
+    int         NX, NY; 
+    double      *t;
+    int         *p;
+    MPI_Comm    comm = MPI_COMM_WORLD;
+
+    int         adios_err;
+    uint64_t    adios_groupsize, adios_totalsize;
+    int64_t     adios_handle, adios_buf_size;
+
+    MPI_Init (&argc, &argv);
+    MPI_Comm_rank (comm, &rank);
+
+
+    strcpy (filename, "arrays.bp");
+    adios_init ("arrays.xml");
+
+    /* First read in the scalars to calculate the size of the arrays */
+    adios_open (&adios_handle, "arrays", filename, "r", &comm);
+    adios_groupsize = 0;
+    adios_group_size (adios_handle, adios_groupsize, &adios_totalsize);
+    adios_buf_size = 4;
+    adios_read (adios_handle, "NX", &NX, adios_buf_size);
+    adios_read (adios_handle, "NY", &NY, adios_buf_size);
+    adios_close (adios_handle);
+    /* Note that we have to close to perform the reading of the variables above */
+
+    printf("rank=%d: NX=%d NY=%d\n", rank, NX, NY);
+
+    /* Allocate space for the arrays */
+    t = (double *) malloc (NX*NY*sizeof(double));
+    p = (int *) malloc (NX*sizeof(int));
+
+    /* Read the arrays */
+    adios_open (&adios_handle, "arrays", filename, "r", &comm);
+    adios_group_size (adios_handle, adios_groupsize, &adios_totalsize);
+    adios_buf_size = 8 * (NX) * (NY);
+    adios_read (adios_handle, "var_double_2Darray", t, adios_buf_size);
+    adios_buf_size = 4 * (NX);
+    adios_read (adios_handle, "var_int_1Darray", p, adios_buf_size);
+    adios_close (adios_handle);
+
+    printf("rank=%d: p = [%d", rank, p[0]);
+    for (i = 1; i < NX; i++)
+        printf(", %d", p[i]);
+    printf("]\n");
+    
+    printf("rank=%d: t[5,*] = [%6.2f", rank, t[5*NY]);
+    for (j = 1; j < NY; j++)
+        printf(", %6.2f", t[5*NY+j]);
+    printf("]\n");
+
+    MPI_Barrier (comm);
+
+    adios_finalize (rank);
+
+    MPI_Finalize ();
+
+    return 0;
+}
diff --git a/examples/C/arrays/arrays_write.c b/examples/C/arrays/arrays_write.c
new file mode 100644
index 0000000..0b7681c
--- /dev/null
+++ b/examples/C/arrays/arrays_write.c
@@ -0,0 +1,53 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include "mpi.h"
+#include "adios.h"
+
+/*************************************************************/
+/*          Example of writing arrays in ADIOS               */
+/*                                                           */
+/*        Similar example is manual/2_adios_write.c          */
+/*************************************************************/
+int main (int argc, char ** argv) 
+{
+    char        filename [256];
+    int         rank, size, i, j;
+    int         NX = 10, NY = 100; 
+    double      t[NX][NY];
+    int         p[NX];
+    MPI_Comm    comm = MPI_COMM_WORLD;
+
+    int         adios_err;
+    uint64_t    adios_groupsize, adios_totalsize;
+    int64_t     adios_handle;
+
+    MPI_Init (&argc, &argv);
+    MPI_Comm_rank (comm, &rank);
+
+    for (i = 0; i < NX; i++)
+        for (j = 0; j< NY; j++)
+            t[i][j] = rank * NX + i + j*(1.0/NY);
+
+    for (i = 0; i < NX; i++)
+        p[i] = rank * NX + i;
+
+    strcpy (filename, "arrays.bp");
+    adios_init ("arrays.xml");
+    adios_open (&adios_handle, "arrays", filename, "w", &comm);
+#include "gwrite_arrays.ch"
+    adios_close (adios_handle);
+
+    MPI_Barrier (comm);
+
+    adios_finalize (rank);
+
+    MPI_Finalize ();
+    return 0;
+}
diff --git a/examples/C/arrays/gread_arrays.ch b/examples/C/arrays/gread_arrays.ch
new file mode 100644
index 0000000..9ec8208
--- /dev/null
+++ b/examples/C/arrays/gread_arrays.ch
@@ -0,0 +1,11 @@
+adios_groupsize = 0;
+adios_totalsize = 0;
+adios_group_size (adios_handle, adios_groupsize, &adios_totalsize);
+adios_buf_size = 4;
+adios_read (adios_handle, "NX", &NX, adios_buf_size);
+adios_buf_size = 4;
+adios_read (adios_handle, "NY", &NY, adios_buf_size);
+adios_buf_size = 8 * (NX) * (NY);
+adios_read (adios_handle, "var_double_2Darray", var_double_2Darray, adios_buf_size);
+adios_buf_size = 4 * (NX);
+adios_read (adios_handle, "var_int_1Darray", var_int_1Darray, adios_buf_size);
diff --git a/examples/C/arrays/gwrite_arrays.ch b/examples/C/arrays/gwrite_arrays.ch
new file mode 100644
index 0000000..f4f0067
--- /dev/null
+++ b/examples/C/arrays/gwrite_arrays.ch
@@ -0,0 +1,9 @@
+adios_groupsize = 4 \
+                + 4 \
+                + 8 * (NX) * (NY) \
+                + 4 * (NX);
+adios_group_size (adios_handle, adios_groupsize, &adios_totalsize);
+adios_write (adios_handle, "NX", &NX);
+adios_write (adios_handle, "NY", &NY);
+adios_write (adios_handle, "var_double_2Darray", t);
+adios_write (adios_handle, "var_int_1Darray", p);
diff --git a/examples/C/arrays/job.pbs b/examples/C/arrays/job.pbs
new file mode 100644
index 0000000..869d703
--- /dev/null
+++ b/examples/C/arrays/job.pbs
@@ -0,0 +1,7 @@
+#!/bin/sh
+#PBS -N test
+#PBS -j oe
+#PBS -l walltime=00:05:00,nodes=3:ppn=2
+
+cd $PBS_O_WORKDIR
+mpirun -np 6 ./adios_types >& result.dat
diff --git a/examples/C/attributes/Makefile.am b/examples/C/attributes/Makefile.am
new file mode 100644
index 0000000..38c22e0
--- /dev/null
+++ b/examples/C/attributes/Makefile.am
@@ -0,0 +1,20 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+noinst_PROGRAMS = attributes_write attributes_read
+
+attributes_write_SOURCES = attributes_write.c
+attributes_write_LDADD = $(top_builddir)/src/libadios.a 
+attributes_write_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+attributes_write_LDADD += $(ADIOSLIB_LDADD)
+attributes_read_SOURCES = attributes_read.c
+attributes_read_LDADD = $(top_builddir)/src/libadiosread.a
+attributes_read_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+attributes_read_LDADD += $(ADIOSLIB_LDADD)
+
+CLEANFILES = *.bp
+CC=$(MPICC)
+EXTRA_DIST = attributes.xml gwrite_temperature.ch gread_temperature.ch
+
diff --git a/examples/C/attributes/Makefile.in b/examples/C/attributes/Makefile.in
new file mode 100644
index 0000000..6285bc2
--- /dev/null
+++ b/examples/C/attributes/Makefile.in
@@ -0,0 +1,555 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = attributes_write$(EXEEXT) attributes_read$(EXEEXT)
+subdir = examples/C/attributes
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_attributes_read_OBJECTS = attributes_read.$(OBJEXT)
+attributes_read_OBJECTS = $(am_attributes_read_OBJECTS)
+am__DEPENDENCIES_1 =
+attributes_read_DEPENDENCIES = $(top_builddir)/src/libadiosread.a \
+	$(am__DEPENDENCIES_1)
+am_attributes_write_OBJECTS = attributes_write.$(OBJEXT)
+attributes_write_OBJECTS = $(am_attributes_write_OBJECTS)
+attributes_write_DEPENDENCIES = $(top_builddir)/src/libadios.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(attributes_read_SOURCES) $(attributes_write_SOURCES)
+DIST_SOURCES = $(attributes_read_SOURCES) $(attributes_write_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+attributes_write_SOURCES = attributes_write.c
+attributes_write_LDADD = $(top_builddir)/src/libadios.a \
+	$(ADIOSLIB_LDADD)
+attributes_write_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+attributes_read_SOURCES = attributes_read.c
+attributes_read_LDADD = $(top_builddir)/src/libadiosread.a \
+	$(ADIOSLIB_LDADD)
+attributes_read_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+CLEANFILES = *.bp
+EXTRA_DIST = attributes.xml gwrite_temperature.ch gread_temperature.ch
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  examples/C/attributes/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  examples/C/attributes/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+attributes_read$(EXEEXT): $(attributes_read_OBJECTS) $(attributes_read_DEPENDENCIES) 
+	@rm -f attributes_read$(EXEEXT)
+	$(LINK) $(attributes_read_LDFLAGS) $(attributes_read_OBJECTS) $(attributes_read_LDADD) $(LIBS)
+attributes_write$(EXEEXT): $(attributes_write_OBJECTS) $(attributes_write_DEPENDENCIES) 
+	@rm -f attributes_write$(EXEEXT)
+	$(LINK) $(attributes_write_LDFLAGS) $(attributes_write_OBJECTS) $(attributes_write_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.c.o:
+	$(COMPILE) -c $<
+
+.c.obj:
+	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+	$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/examples/C/attributes/attributes.xml b/examples/C/attributes/attributes.xml
new file mode 100644
index 0000000..e88e368
--- /dev/null
+++ b/examples/C/attributes/attributes.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<adios-config host-language="C">
+    <adios-group name="temperature" coordination-communicator="comm">
+        <var name="NX"   type="integer"/>
+        <var name="size" type="integer"/>
+        <var name="rank" type="integer"/>
+        <var name="mean" type="double"/>
+        <var name="date" type="string" gwrite="str"/>
+
+        <global-bounds dimensions="size,NX" offsets="rank,0">
+           <var name="temperature" gwrite="t" gread="t" type="double" dimensions="1,NX"/>
+        </global-bounds>
+
+        <!-- an integer attribute set to 1 -->
+        <attribute name="number of levels" path="/temperature" 
+                   type="integer" value="1"/>
+
+        <!-- a string attribute -->
+        <attribute name="description" path="/temperature" 
+                   value="Global array written from 'size' processes" type="string"/>
+
+        <!-- attributes inheriting the type and value of the scalar variables -->
+        <attribute name="mean value"     path="/temperature" var="mean"/>
+        <attribute name="date of coding" path="/temperature" var="date"/>
+    </adios-group>
+
+<method group="temperature" method="MPI"/>
+
+<buffer size-MB="2" allocate-time="now"/>
+
+</adios-config>
+
diff --git a/examples/C/attributes/attributes_read.c b/examples/C/attributes/attributes_read.c
new file mode 100644
index 0000000..38e0ebe
--- /dev/null
+++ b/examples/C/attributes/attributes_read.c
@@ -0,0 +1,79 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/* ADIOS C Example: read attributes from a BP file
+ *
+ * This is possible only with the generic read API.
+ * so the GREAD stuff and the xml file is not used here.
+ *
+*/
+#include <stdio.h>
+#include <string.h>
+#include "mpi.h"
+#include "adios_read.h"
+
+int main (int argc, char ** argv) 
+{
+    char        filename [256];
+    int         rank, size, i;
+    int         NX = 10, level = 1; 
+    double      t[NX], mean = 0;
+    MPI_Comm    comm = MPI_COMM_WORLD;
+    enum ADIOS_DATATYPES attr_type;
+    int attr_size;
+    void * data = NULL;
+
+    MPI_Init (&argc, &argv);
+    MPI_Comm_rank (comm, &rank);
+    MPI_Comm_size (comm, &size);
+
+    ADIOS_FILE * f = adios_fopen ("attributes.bp", comm);
+    if (f == NULL)
+    {
+        printf ("%s\n", adios_errmsg());
+        return -1;
+    }
+
+    ADIOS_GROUP * g = adios_gopen (f, "temperature");
+    if (g == NULL)
+    {
+        printf ("%s\n", adios_errmsg());
+        return -1;
+    }
+
+    for (i = 0; i < g->attrs_count; i++)
+    {
+
+        adios_get_attr (g, g->attr_namelist[i], &attr_type, &attr_size, &data);
+
+        printf ("rank %d: attr: %s %s = ", rank, adios_type_to_string(attr_type), g->attr_namelist[i]);
+        switch (attr_type)  
+        {
+            case adios_integer:
+                printf ("%d\n", *(int *)data);
+                break;
+            case adios_double:
+                printf ("%e\n", *(double *)data);
+                break;
+            case adios_string:
+                printf ("%s\n", (char *)data);
+                break;
+            default:
+                printf ("??????\n");
+        }
+        free (data);
+        data = 0;
+    }
+
+    adios_gclose (g);
+    adios_fclose (f);
+
+    MPI_Barrier (comm);
+
+    MPI_Finalize ();
+    return 0;
+}
diff --git a/examples/C/attributes/attributes_write.c b/examples/C/attributes/attributes_write.c
new file mode 100644
index 0000000..3cd69d3
--- /dev/null
+++ b/examples/C/attributes/attributes_write.c
@@ -0,0 +1,54 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/* ADIOS C Example: write some attributes along with variables
+*/
+#include <stdio.h>
+#include <string.h>
+#include "mpi.h"
+#include "adios.h"
+int main (int argc, char ** argv) 
+{
+    char        filename [256];
+    int         rank, size, i;
+    int         NX = 10, level = 1; 
+    double      t[NX], mean = 0;
+    MPI_Comm    comm = MPI_COMM_WORLD;
+    const char * str = "Nov, 2009";
+
+    /* ADIOS variables declarations for matching gwrite_temperature.ch */
+    int         adios_err;
+    uint64_t    adios_groupsize, adios_totalsize;
+    int64_t     adios_handle;
+
+    MPI_Init (&argc, &argv);
+    MPI_Comm_rank (comm, &rank);
+    MPI_Comm_size (comm, &size);
+
+    for (i = 0; i < NX; i++)
+    {
+        t[i] = rank * NX + i;
+        mean += t[i];
+    }
+
+    mean /= NX;
+
+    strcpy (filename, "attributes.bp");
+
+    adios_init ("attributes.xml");
+
+    adios_open (&adios_handle, "temperature", filename, "w", &comm);
+#include "gwrite_temperature.ch"
+    adios_close (adios_handle);
+
+    MPI_Barrier (comm);
+
+    adios_finalize (rank);
+
+    MPI_Finalize ();
+    return 0;
+}
diff --git a/examples/C/attributes/gread_temperature.ch b/examples/C/attributes/gread_temperature.ch
new file mode 100644
index 0000000..b486cd4
--- /dev/null
+++ b/examples/C/attributes/gread_temperature.ch
@@ -0,0 +1,15 @@
+adios_groupsize = 0;
+adios_totalsize = 0;
+adios_group_size (adios_handle, adios_groupsize, &adios_totalsize);
+adios_buf_size = 4;
+adios_read (adios_handle, "NX", &NX, adios_buf_size);
+adios_buf_size = 4;
+adios_read (adios_handle, "size", &size, adios_buf_size);
+adios_buf_size = 4;
+adios_read (adios_handle, "rank", &rank, adios_buf_size);
+adios_buf_size = 8;
+adios_read (adios_handle, "mean", &mean, adios_buf_size);
+adios_buf_size = 2147483648;
+adios_read (adios_handle, "date", date, adios_buf_size);
+adios_buf_size = 8 * (1) * (NX);
+adios_read (adios_handle, "temperature", t, adios_buf_size);
diff --git a/examples/C/attributes/gwrite_temperature.ch b/examples/C/attributes/gwrite_temperature.ch
new file mode 100644
index 0000000..f317dfc
--- /dev/null
+++ b/examples/C/attributes/gwrite_temperature.ch
@@ -0,0 +1,13 @@
+adios_groupsize = 4 \
+                + 4 \
+                + 4 \
+                + 8 \
+                + strlen(str) \
+                + 8 * (1) * (NX);
+adios_group_size (adios_handle, adios_groupsize, &adios_totalsize);
+adios_write (adios_handle, "NX", &NX);
+adios_write (adios_handle, "size", &size);
+adios_write (adios_handle, "rank", &rank);
+adios_write (adios_handle, "mean", &mean);
+adios_write (adios_handle, "date", str);
+adios_write (adios_handle, "temperature", t);
diff --git a/examples/C/global-array-time/Makefile.am b/examples/C/global-array-time/Makefile.am
new file mode 100644
index 0000000..6ea0929
--- /dev/null
+++ b/examples/C/global-array-time/Makefile.am
@@ -0,0 +1,23 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+noinst_PROGRAMS = adios_globaltime adios_globaltime_no_xml adios_read_globaltime
+
+adios_globaltime_SOURCES = adios_globaltime.c
+adios_globaltime_LDADD = $(top_builddir)/src/libadios.a
+adios_globaltime_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+adios_globaltime_LDADD += $(ADIOSLIB_LDADD)
+adios_globaltime_no_xml_SOURCES = adios_globaltime_no_xml.c
+adios_globaltime_no_xml_LDADD = $(top_builddir)/src/libadios.a
+adios_globaltime_no_xml_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+adios_globaltime_no_xml_LDADD += $(ADIOSLIB_LDADD)
+adios_read_globaltime_SOURCES = adios_read_globaltime.c
+adios_read_globaltime_LDADD = $(top_builddir)/src/libadiosread.a
+adios_read_globaltime_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+adios_read_globaltime_LDADD += $(ADIOSLIB_LDADD)
+                
+CLEANFILES = *.bp
+CC=$(MPICC)
+EXTRA_DIST = adios_globaltime.xml gread_temperature.ch gwrite_temperature.ch job.pbs
diff --git a/examples/C/global-array-time/Makefile.in b/examples/C/global-array-time/Makefile.in
new file mode 100644
index 0000000..dd7f07d
--- /dev/null
+++ b/examples/C/global-array-time/Makefile.in
@@ -0,0 +1,574 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = adios_globaltime$(EXEEXT) \
+	adios_globaltime_no_xml$(EXEEXT) \
+	adios_read_globaltime$(EXEEXT)
+subdir = examples/C/global-array-time
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_adios_globaltime_OBJECTS = adios_globaltime.$(OBJEXT)
+adios_globaltime_OBJECTS = $(am_adios_globaltime_OBJECTS)
+am__DEPENDENCIES_1 =
+adios_globaltime_DEPENDENCIES = $(top_builddir)/src/libadios.a \
+	$(am__DEPENDENCIES_1)
+am_adios_globaltime_no_xml_OBJECTS =  \
+	adios_globaltime_no_xml.$(OBJEXT)
+adios_globaltime_no_xml_OBJECTS =  \
+	$(am_adios_globaltime_no_xml_OBJECTS)
+adios_globaltime_no_xml_DEPENDENCIES = $(top_builddir)/src/libadios.a \
+	$(am__DEPENDENCIES_1)
+am_adios_read_globaltime_OBJECTS = adios_read_globaltime.$(OBJEXT)
+adios_read_globaltime_OBJECTS = $(am_adios_read_globaltime_OBJECTS)
+adios_read_globaltime_DEPENDENCIES =  \
+	$(top_builddir)/src/libadiosread.a $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(adios_globaltime_SOURCES) \
+	$(adios_globaltime_no_xml_SOURCES) \
+	$(adios_read_globaltime_SOURCES)
+DIST_SOURCES = $(adios_globaltime_SOURCES) \
+	$(adios_globaltime_no_xml_SOURCES) \
+	$(adios_read_globaltime_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+adios_globaltime_SOURCES = adios_globaltime.c
+adios_globaltime_LDADD = $(top_builddir)/src/libadios.a \
+	$(ADIOSLIB_LDADD)
+adios_globaltime_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+adios_globaltime_no_xml_SOURCES = adios_globaltime_no_xml.c
+adios_globaltime_no_xml_LDADD = $(top_builddir)/src/libadios.a \
+	$(ADIOSLIB_LDADD)
+adios_globaltime_no_xml_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+adios_read_globaltime_SOURCES = adios_read_globaltime.c
+adios_read_globaltime_LDADD = $(top_builddir)/src/libadiosread.a \
+	$(ADIOSLIB_LDADD)
+adios_read_globaltime_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+CLEANFILES = *.bp
+EXTRA_DIST = adios_globaltime.xml gread_temperature.ch gwrite_temperature.ch job.pbs
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  examples/C/global-array-time/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  examples/C/global-array-time/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+adios_globaltime$(EXEEXT): $(adios_globaltime_OBJECTS) $(adios_globaltime_DEPENDENCIES) 
+	@rm -f adios_globaltime$(EXEEXT)
+	$(LINK) $(adios_globaltime_LDFLAGS) $(adios_globaltime_OBJECTS) $(adios_globaltime_LDADD) $(LIBS)
+adios_globaltime_no_xml$(EXEEXT): $(adios_globaltime_no_xml_OBJECTS) $(adios_globaltime_no_xml_DEPENDENCIES) 
+	@rm -f adios_globaltime_no_xml$(EXEEXT)
+	$(LINK) $(adios_globaltime_no_xml_LDFLAGS) $(adios_globaltime_no_xml_OBJECTS) $(adios_globaltime_no_xml_LDADD) $(LIBS)
+adios_read_globaltime$(EXEEXT): $(adios_read_globaltime_OBJECTS) $(adios_read_globaltime_DEPENDENCIES) 
+	@rm -f adios_read_globaltime$(EXEEXT)
+	$(LINK) $(adios_read_globaltime_LDFLAGS) $(adios_read_globaltime_OBJECTS) $(adios_read_globaltime_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.c.o:
+	$(COMPILE) -c $<
+
+.c.obj:
+	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+	$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/examples/C/global-array-time/adios_globaltime.c b/examples/C/global-array-time/adios_globaltime.c
new file mode 100644
index 0000000..cbd759f
--- /dev/null
+++ b/examples/C/global-array-time/adios_globaltime.c
@@ -0,0 +1,53 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include "mpi.h"
+#include "adios.h"
+int main (int argc, char ** argv) 
+{
+	char        filename [256];
+	int         rank, size, i, it;
+	int         NX = 10; 
+	double      t[NX];
+
+	/* ADIOS variables declarations for matching gwrite_temperature.ch */
+	int         adios_err;
+	uint64_t    adios_groupsize, adios_totalsize;
+	int64_t     adios_handle;
+	MPI_Comm    comm=MPI_COMM_WORLD;
+ 
+	MPI_Init (&argc, &argv);
+	MPI_Comm_rank (MPI_COMM_WORLD, &rank);
+	MPI_Comm_size (comm, &size);
+
+	adios_init ("adios_globaltime.xml");
+    	strcpy (filename, "adios_globaltime.bp");
+    	for (it =1; it <= 13; it++) {
+
+        	for (i = 0; i < NX; i++)
+            		t[i] = it*100.0 + rank*NX + i;
+		
+                if (it==1)
+		    adios_open (&adios_handle, "temperature", filename, "w", &comm);
+                else
+		    adios_open (&adios_handle, "temperature", filename, "a", &comm);
+
+        	#include "gwrite_temperature.ch"
+        	adios_close (adios_handle);
+		MPI_Barrier (comm);
+                //if (rank==0) printf("Timestep %d written\n", it+1);
+ 	}
+	MPI_Barrier (comm);
+        //if (rank==0) printf("Finalize adios\n");
+    	adios_finalize (rank);
+
+        //if (rank==0) printf("Finalize MPI\n");
+    	MPI_Finalize ();
+	return 0;
+}
diff --git a/examples/C/global-array-time/adios_globaltime.xml b/examples/C/global-array-time/adios_globaltime.xml
new file mode 100644
index 0000000..fb8ef82
--- /dev/null
+++ b/examples/C/global-array-time/adios_globaltime.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<adios-config host-language="C">
+    <adios-group name="temperature" coordination-communicator="comm" time-index="iter">
+    <var name="NX" type="integer"/>
+    <var name="size" type="integer"/>
+    <var name="rank" type="integer"/>
+    <global-bounds dimensions="size,NX" offsets="rank,0">
+       <var name="temperature" gwrite="t" type="double" dimensions="iter,1,NX"/>
+    </global-bounds>
+    <attribute name="description" path="/temperature" 
+        value="Global array written from 'size' processes over several timesteps" 
+        type="string"/>
+</adios-group>
+
+<method group="temperature" method="MPI"/>
+
+<buffer size-MB="5" allocate-time="now"/>
+
+</adios-config>
+
diff --git a/examples/C/global-array-time/adios_globaltime_no_xml.c b/examples/C/global-array-time/adios_globaltime_no_xml.c
new file mode 100644
index 0000000..ca95a79
--- /dev/null
+++ b/examples/C/global-array-time/adios_globaltime_no_xml.c
@@ -0,0 +1,103 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/* ADIOS C Example: write a global array from N processors with gwrite
+ *
+ * How to run: mpirun -np <N> adios_global
+ * Output: adios_global.bp
+ * ADIOS config file: adios_global.xml
+ *
+*/
+#include <stdio.h>
+#include <string.h>
+#include "mpi.h"
+#include "adios.h"
+
+#ifdef DMALLOC
+#include "dmalloc.h"
+#endif
+
+int main (int argc, char ** argv) 
+{
+	char        filename [256];
+	int         rank, size, i;
+	int         NX = 10, G, O; 
+	double      t[NX];
+	MPI_Comm    comm = MPI_COMM_WORLD;
+
+	/* ADIOS variables declarations for matching gwrite_temperature.ch */
+	int         adios_err, it;
+	uint64_t    adios_groupsize, adios_totalsize;
+	int64_t     adios_handle;
+
+	MPI_Init (&argc, &argv);
+	MPI_Comm_rank (comm, &rank);
+	MPI_Comm_size (comm, &size);
+
+        G = 2 * NX * size;
+
+	for (i = 0; i < NX; i++)
+	    t[i] = rank * NX + i;
+
+	strcpy (filename, "adios_globaltime.bp");
+
+	adios_init_noxml ();
+        adios_allocate_buffer (ADIOS_BUFFER_ALLOC_NOW, 10);
+
+        int64_t       m_adios_group;
+        int64_t       m_adios_file;
+
+        adios_declare_group (&m_adios_group, "restart", "iter");
+        adios_select_method (m_adios_group, "MPI", "", "");
+
+        adios_define_var (m_adios_group, "NX"
+                     ,"", adios_integer
+                     ,0, 0, 0);
+  
+        adios_define_var (m_adios_group, "G"
+                     ,"", adios_integer
+                     ,0, 0, 0);
+
+        adios_define_var (m_adios_group, "O"
+                     ,"", adios_integer
+                     ,0, 0, 0);
+
+        adios_define_var (m_adios_group, "temperature"
+                     ,"", adios_double
+                     ,"iter,NX", "G", "O");
+
+        for (it =0; it < 5; it++) {
+
+        	adios_open (&m_adios_file, "restart", filename, "a", &comm);
+        	adios_groupsize = 4 + 4 + 4 + NX * 8
+                        	+ 4 + 4 + 4 + NX * 8;
+        	adios_group_size (m_adios_file, adios_groupsize, &adios_totalsize);
+
+        	adios_write(m_adios_file, "NX", (void *) &NX);
+        	adios_write(m_adios_file, "G", (void *) &G);
+        	O = rank * 2 * NX;
+        	adios_write(m_adios_file, "O", (void *) &O);
+        	adios_write(m_adios_file, "temperature", t);
+
+        	for (i = 0; i < NX; i++)
+            		t[i]++;
+
+        	adios_write(m_adios_file, "NX", (void *) &NX);
+        	adios_write(m_adios_file, "G", (void *) &G);
+        	O = rank * 2 * NX + NX;
+        	adios_write(m_adios_file, "O", (void *) &O);
+        	adios_write(m_adios_file, "temperature", t);
+
+        	adios_close (m_adios_file);
+                MPI_Barrier (comm);
+        }
+
+	adios_finalize (rank);
+
+	MPI_Finalize ();
+	return 0;
+}
diff --git a/examples/C/global-array-time/adios_read_globaltime.c b/examples/C/global-array-time/adios_read_globaltime.c
new file mode 100644
index 0000000..1e48638
--- /dev/null
+++ b/examples/C/global-array-time/adios_read_globaltime.c
@@ -0,0 +1,91 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/* ADIOS C Example: read global arrays from a BP file
+ *
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpi.h"
+#include "adios_read.h"
+
+int main (int argc, char ** argv) 
+{
+    char        filename [256];
+    int         rank, size, i, j, k;
+    MPI_Comm    comm = MPI_COMM_WORLD;
+    void * data = NULL;
+    uint64_t start[3], count[3], bytes_read = 0;
+
+    MPI_Init (&argc, &argv);
+    MPI_Comm_rank (comm, &rank);
+    MPI_Comm_size (comm, &size);
+
+    ADIOS_FILE * f = adios_fopen ("adios_globaltime.bp", comm);
+    if (f == NULL)
+    {
+        printf ("%s\n", adios_errmsg());
+        return -1;
+    }
+
+    ADIOS_GROUP * g = adios_gopen (f, "temperature");
+    if (g == NULL)
+    {
+        printf ("%s\n", adios_errmsg());
+        return -1;
+    }
+
+    ADIOS_VARINFO * v = adios_inq_var (g, "temperature");
+
+    // read in two timesteps
+    data = malloc (2 * v->dims[1] * v->dims[2] * sizeof (double));
+    if (data == NULL)
+    {
+        fprintf (stderr, "malloc failed.\n");
+        return -1;
+    }
+
+    // read in timestep 'rank'
+    start[0] = rank % 13;
+    count[0] = 1;
+
+    start[1] = 0;
+    count[1] = v->dims[1];
+
+    start[2] = 0;
+    count[2] = v->dims[2];
+       
+    bytes_read = adios_read_var (g, "temperature", start, count, data);
+
+    printf("rank=%d: ", rank);
+    for (i = 0; i < 1; i++) {
+        printf ("[%lld,0:%lld,0:%lld] = [", start[0]+i, v->dims[1], v->dims[2]);   
+        for (j = 0; j < v->dims[1]; j++) {
+            printf (" [");
+            for (k = 0; k < v->dims[2]; k++) {
+                printf ("%g ", ((double *)data) [ i * v->dims[1] * v->dims[2] + j * v->dims[2] + k]);
+            }
+            printf ("]");
+        }
+        printf (" ]\t");
+    }
+    printf ("\n");
+
+    free (data);
+    adios_free_varinfo (v);
+
+    adios_gclose (g);
+    adios_fclose (f);
+
+    MPI_Barrier (comm);
+
+    MPI_Finalize ();
+    return 0;
+}
+
+
diff --git a/examples/C/global-array-time/gread_temperature.ch b/examples/C/global-array-time/gread_temperature.ch
new file mode 100644
index 0000000..c7178d5
--- /dev/null
+++ b/examples/C/global-array-time/gread_temperature.ch
@@ -0,0 +1,11 @@
+adios_groupsize = 0;
+adios_totalsize = 0;
+adios_group_size (adios_handle, adios_groupsize, &adios_totalsize);
+adios_buf_size = 4;
+adios_read (adios_handle, "NX", &NX, adios_buf_size);
+adios_buf_size = 4;
+adios_read (adios_handle, "size", &size, adios_buf_size);
+adios_buf_size = 4;
+adios_read (adios_handle, "rank", &rank, adios_buf_size);
+adios_buf_size = 8 * (1) * (NX);
+adios_read (adios_handle, "temperature", temperature, adios_buf_size);
diff --git a/examples/C/global-array-time/gwrite_temperature.ch b/examples/C/global-array-time/gwrite_temperature.ch
new file mode 100644
index 0000000..1c8b279
--- /dev/null
+++ b/examples/C/global-array-time/gwrite_temperature.ch
@@ -0,0 +1,9 @@
+adios_groupsize = 4 \
+                + 4 \
+                + 4 \
+                + 8 * (1) * (NX);
+adios_group_size (adios_handle, adios_groupsize, &adios_totalsize);
+adios_write (adios_handle, "NX", &NX);
+adios_write (adios_handle, "size", &size);
+adios_write (adios_handle, "rank", &rank);
+adios_write (adios_handle, "temperature", t);
diff --git a/examples/C/global-array-time/job.pbs b/examples/C/global-array-time/job.pbs
new file mode 100644
index 0000000..0a3fd60
--- /dev/null
+++ b/examples/C/global-array-time/job.pbs
@@ -0,0 +1,7 @@
+#!/bin/sh
+#PBS -N test 
+#PBS -j oe
+#PBS -l walltime=00:05:00,nodes=3:ppn=2
+
+cd $PBS_O_WORKDIR
+mpirun -np 6 ./adios_globaltime >& result.dat
diff --git a/examples/C/global-array/Makefile.am b/examples/C/global-array/Makefile.am
new file mode 100644
index 0000000..6fa6c52
--- /dev/null
+++ b/examples/C/global-array/Makefile.am
@@ -0,0 +1,32 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+noinst_PROGRAMS = adios_global adios_global_2files adios_read_global adios_global_no_xml adios_read_global_no_xml
+
+adios_global_SOURCES = adios_global.c
+adios_global_LDADD = $(top_builddir)/src/libadios.a 
+adios_global_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+adios_global_LDADD += $(ADIOSLIB_LDADD)
+adios_global_2files_SOURCES = adios_global_2files.c
+adios_global_2files_LDADD = $(top_builddir)/src/libadios.a 
+adios_global_2files_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+adios_global_2files_LDADD += $(ADIOSLIB_LDADD)
+adios_read_global_SOURCES = adios_read_global.c
+adios_read_global_LDADD = $(top_builddir)/src/libadiosread.a 
+adios_read_global_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+adios_read_global_LDADD += $(ADIOSLIB_LDADD)
+adios_global_no_xml_SOURCES = adios_global_no_xml.c
+adios_global_no_xml_LDADD = $(top_builddir)/src/libadios.a 
+adios_global_no_xml_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+adios_global_no_xml_LDADD += $(ADIOSLIB_LDADD)
+adios_read_global_no_xml_SOURCES = adios_read_global_no_xml.c
+adios_read_global_no_xml_LDADD = $(top_builddir)/src/libadiosread.a
+adios_read_global_no_xml_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+adios_read_global_no_xml_LDADD += $(ADIOSLIB_LDADD)
+
+CLEANFILES = *.bp
+CC=$(MPICC)
+EXTRA_DIST = adios_global.xml gread_temperature.ch gwrite_temperature.ch job.pbs
+
diff --git a/examples/C/global-array/Makefile.in b/examples/C/global-array/Makefile.in
new file mode 100644
index 0000000..7f81f4c
--- /dev/null
+++ b/examples/C/global-array/Makefile.in
@@ -0,0 +1,595 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = adios_global$(EXEEXT) adios_global_2files$(EXEEXT) \
+	adios_read_global$(EXEEXT) adios_global_no_xml$(EXEEXT) \
+	adios_read_global_no_xml$(EXEEXT)
+subdir = examples/C/global-array
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_adios_global_OBJECTS = adios_global.$(OBJEXT)
+adios_global_OBJECTS = $(am_adios_global_OBJECTS)
+am__DEPENDENCIES_1 =
+adios_global_DEPENDENCIES = $(top_builddir)/src/libadios.a \
+	$(am__DEPENDENCIES_1)
+am_adios_global_2files_OBJECTS = adios_global_2files.$(OBJEXT)
+adios_global_2files_OBJECTS = $(am_adios_global_2files_OBJECTS)
+adios_global_2files_DEPENDENCIES = $(top_builddir)/src/libadios.a \
+	$(am__DEPENDENCIES_1)
+am_adios_global_no_xml_OBJECTS = adios_global_no_xml.$(OBJEXT)
+adios_global_no_xml_OBJECTS = $(am_adios_global_no_xml_OBJECTS)
+adios_global_no_xml_DEPENDENCIES = $(top_builddir)/src/libadios.a \
+	$(am__DEPENDENCIES_1)
+am_adios_read_global_OBJECTS = adios_read_global.$(OBJEXT)
+adios_read_global_OBJECTS = $(am_adios_read_global_OBJECTS)
+adios_read_global_DEPENDENCIES = $(top_builddir)/src/libadiosread.a \
+	$(am__DEPENDENCIES_1)
+am_adios_read_global_no_xml_OBJECTS =  \
+	adios_read_global_no_xml.$(OBJEXT)
+adios_read_global_no_xml_OBJECTS =  \
+	$(am_adios_read_global_no_xml_OBJECTS)
+adios_read_global_no_xml_DEPENDENCIES =  \
+	$(top_builddir)/src/libadiosread.a $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(adios_global_SOURCES) $(adios_global_2files_SOURCES) \
+	$(adios_global_no_xml_SOURCES) $(adios_read_global_SOURCES) \
+	$(adios_read_global_no_xml_SOURCES)
+DIST_SOURCES = $(adios_global_SOURCES) $(adios_global_2files_SOURCES) \
+	$(adios_global_no_xml_SOURCES) $(adios_read_global_SOURCES) \
+	$(adios_read_global_no_xml_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+adios_global_SOURCES = adios_global.c
+adios_global_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD)
+adios_global_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+adios_global_2files_SOURCES = adios_global_2files.c
+adios_global_2files_LDADD = $(top_builddir)/src/libadios.a \
+	$(ADIOSLIB_LDADD)
+adios_global_2files_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+adios_read_global_SOURCES = adios_read_global.c
+adios_read_global_LDADD = $(top_builddir)/src/libadiosread.a \
+	$(ADIOSLIB_LDADD)
+adios_read_global_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+adios_global_no_xml_SOURCES = adios_global_no_xml.c
+adios_global_no_xml_LDADD = $(top_builddir)/src/libadios.a \
+	$(ADIOSLIB_LDADD)
+adios_global_no_xml_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+adios_read_global_no_xml_SOURCES = adios_read_global_no_xml.c
+adios_read_global_no_xml_LDADD = $(top_builddir)/src/libadiosread.a \
+	$(ADIOSLIB_LDADD)
+adios_read_global_no_xml_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+CLEANFILES = *.bp
+EXTRA_DIST = adios_global.xml gread_temperature.ch gwrite_temperature.ch job.pbs
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  examples/C/global-array/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  examples/C/global-array/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+adios_global$(EXEEXT): $(adios_global_OBJECTS) $(adios_global_DEPENDENCIES) 
+	@rm -f adios_global$(EXEEXT)
+	$(LINK) $(adios_global_LDFLAGS) $(adios_global_OBJECTS) $(adios_global_LDADD) $(LIBS)
+adios_global_2files$(EXEEXT): $(adios_global_2files_OBJECTS) $(adios_global_2files_DEPENDENCIES) 
+	@rm -f adios_global_2files$(EXEEXT)
+	$(LINK) $(adios_global_2files_LDFLAGS) $(adios_global_2files_OBJECTS) $(adios_global_2files_LDADD) $(LIBS)
+adios_global_no_xml$(EXEEXT): $(adios_global_no_xml_OBJECTS) $(adios_global_no_xml_DEPENDENCIES) 
+	@rm -f adios_global_no_xml$(EXEEXT)
+	$(LINK) $(adios_global_no_xml_LDFLAGS) $(adios_global_no_xml_OBJECTS) $(adios_global_no_xml_LDADD) $(LIBS)
+adios_read_global$(EXEEXT): $(adios_read_global_OBJECTS) $(adios_read_global_DEPENDENCIES) 
+	@rm -f adios_read_global$(EXEEXT)
+	$(LINK) $(adios_read_global_LDFLAGS) $(adios_read_global_OBJECTS) $(adios_read_global_LDADD) $(LIBS)
+adios_read_global_no_xml$(EXEEXT): $(adios_read_global_no_xml_OBJECTS) $(adios_read_global_no_xml_DEPENDENCIES) 
+	@rm -f adios_read_global_no_xml$(EXEEXT)
+	$(LINK) $(adios_read_global_no_xml_LDFLAGS) $(adios_read_global_no_xml_OBJECTS) $(adios_read_global_no_xml_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.c.o:
+	$(COMPILE) -c $<
+
+.c.obj:
+	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+	$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/examples/C/global-array/adios_global.c b/examples/C/global-array/adios_global.c
new file mode 100644
index 0000000..5ba61f1
--- /dev/null
+++ b/examples/C/global-array/adios_global.c
@@ -0,0 +1,53 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/* ADIOS C Example: write a global array from N processors with gwrite
+ *
+ * How to run: mpirun -np <N> adios_global
+ * Output: adios_global.bp
+ * ADIOS config file: adios_global.xml
+ *
+*/
+#include <stdio.h>
+#include <string.h>
+#include "mpi.h"
+#include "adios.h"
+int main (int argc, char ** argv) 
+{
+	char        filename [256];
+	int         rank, size, i;
+	int         NX = 10; 
+	double      t[NX];
+	MPI_Comm    comm = MPI_COMM_WORLD;
+
+	/* ADIOS variables declarations for matching gwrite_temperature.ch */
+	int         adios_err;
+	uint64_t    adios_groupsize, adios_totalsize;
+	int64_t     adios_handle;
+
+	MPI_Init (&argc, &argv);
+	MPI_Comm_rank (comm, &rank);
+	MPI_Comm_size (comm, &size);
+
+	for (i = 0; i < NX; i++)
+		t[i] = rank*NX + i;
+
+	strcpy (filename, "adios_global.bp");
+
+	adios_init ("adios_global.xml");
+
+	adios_open (&adios_handle, "temperature", filename, "w", &comm);
+	#include "gwrite_temperature.ch"
+	adios_close (adios_handle);
+
+        MPI_Barrier (comm);
+
+	adios_finalize (rank);
+
+	MPI_Finalize ();
+	return 0;
+}
diff --git a/examples/C/global-array/adios_global.xml b/examples/C/global-array/adios_global.xml
new file mode 100644
index 0000000..c5c66b4
--- /dev/null
+++ b/examples/C/global-array/adios_global.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<adios-config host-language="C">
+    <adios-group name="temperature" coordination-communicator="comm">
+    <var name="NX" type="integer"/>
+    <var name="size" type="integer"/>
+    <var name="rank" type="integer"/>
+    <global-bounds dimensions="size,NX" offsets="rank,0">
+       <var name="temperature" gwrite="t" type="double" dimensions="1,NX"/>
+    </global-bounds>
+    <attribute name="description" path="/temperature" value="Global array written from 'size' processes" type="string"/>
+</adios-group>
+
+<method group="temperature" method="MPI"/>
+
+<buffer size-MB="2" allocate-time="now"/>
+
+</adios-config>
+
diff --git a/examples/C/global-array/adios_global_2files.c b/examples/C/global-array/adios_global_2files.c
new file mode 100644
index 0000000..c7519c9
--- /dev/null
+++ b/examples/C/global-array/adios_global_2files.c
@@ -0,0 +1,52 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdio.h>
+#include "mpi.h"
+#include "adios.h"
+int main (int argc, char ** argv) 
+{
+	char        filename [256];
+	int         rank;
+	int         NX = 10; 
+	double      t[NX];
+
+	/* ADIOS variables declarations for matching gwrite_temperature.ch */
+	int         adios_err;
+	uint64_t    adios_groupsize, adios_totalsize;
+	int64_t     adios_handle;
+	MPI_Comm comm;
+
+	int         color, key;
+	int         size;
+	int         i;
+	MPI_Init (&argc, &argv);
+	MPI_Comm_rank (MPI_COMM_WORLD, &rank);
+
+	/* MPI_Comm_split paritions the world group into disjointed 2 subgroups, 
+	 * the processes are ranked in terms of the argument key  
+	 *  a new communicator comm is returned for this specific grid configuration
+	 */
+	color = rank % 2;
+	key = rank / 2;
+	MPI_Comm_split (MPI_COMM_WORLD, color, key, &comm);
+	MPI_Comm_rank (comm, &rank);
+	MPI_Comm_size (comm, &size);
+	for (i = 0; i < NX; i++)
+		t [i] = 10*(key*2+color)+i;
+	/* every P/2 processes write into the same file 
+	 * there are 2 files generated. 
+	 */
+	sprintf (filename, "adios_global_%5.5d.bp", color);
+	adios_init ("adios_global.xml");
+	adios_open (&adios_handle, "temperature", filename, "w", &comm);
+	#include "gwrite_temperature.ch"
+	adios_close (adios_handle);
+	adios_finalize (rank);
+	MPI_Finalize ();
+	return 0;
+}
diff --git a/examples/C/global-array/adios_global_no_xml.c b/examples/C/global-array/adios_global_no_xml.c
new file mode 100644
index 0000000..67c7511
--- /dev/null
+++ b/examples/C/global-array/adios_global_no_xml.c
@@ -0,0 +1,127 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/* ADIOS C Example: write a global array from N processors with gwrite
+ *
+ * How to run: mpirun -np <N> adios_global_no_xml
+ * Output: adios_global_no_xml.bp
+ * ADIOS config file: None
+ *
+*/
+#include <stdio.h>
+#include <string.h>
+#include "mpi.h"
+#include "adios.h"
+
+#ifdef DMALLOC
+#include "dmalloc.h"
+#endif
+
+int main (int argc, char ** argv) 
+{
+	char        filename [256];
+	int         rank, size, i;
+	int         NX = 10, G, O; 
+	double      t[NX];
+	MPI_Comm    comm = MPI_COMM_WORLD;
+
+	/* ADIOS variables declarations for matching gwrite_temperature.ch */
+	int         adios_err;
+	uint64_t    adios_groupsize, adios_totalsize;
+	int64_t     adios_handle;
+
+	MPI_Init (&argc, &argv);
+	MPI_Comm_rank (comm, &rank);
+	MPI_Comm_size (comm, &size);
+
+        G = 2 * NX * size;
+
+	for (i = 0; i < NX; i++)
+	    t[i] = rank * NX + i;
+
+	strcpy (filename, "adios_global_no_xml.bp");
+
+	adios_init_noxml ();
+        adios_allocate_buffer (ADIOS_BUFFER_ALLOC_NOW, 10);
+
+        int64_t       m_adios_group;
+        int64_t       m_adios_file;
+
+        adios_declare_group (&m_adios_group, "restart", "iter");
+        adios_select_method (m_adios_group, "MPI", "", "");
+
+        adios_define_var (m_adios_group, "NX"
+                     ,"", 2
+                     ,0, 0, 0);
+
+        adios_define_var (m_adios_group, "G"
+                     ,"", 2
+                     ,0, 0, 0);
+
+        adios_define_var (m_adios_group, "O"
+                     ,"", 2
+                     ,0, 0, 0);
+
+        adios_define_var (m_adios_group, "temperature"
+                     ,"", 6
+                     ,"NX", "G", "O");
+
+        adios_define_var (m_adios_group, "NX"
+                     ,"", 2
+                     ,0, 0, 0);
+
+        adios_define_var (m_adios_group, "G"
+                     ,"", 2
+                     ,0, 0, 0);
+
+        adios_define_var (m_adios_group, "O"
+                     ,"", 2
+                     ,0, 0, 0);
+
+        adios_define_var (m_adios_group, "temperature"
+                     ,"", 6
+                     ,"NX", "G", "O");
+
+
+        adios_open (&m_adios_file, "restart", filename, "w", &comm);
+
+        adios_groupsize = 4 + 4 + 4 + NX * 8
+                        + 4 + 4 + 4 + NX * 8;
+
+        adios_group_size (m_adios_file, adios_groupsize, &adios_totalsize);
+
+        adios_write(m_adios_file, "NX", (void *) &NX);
+        adios_write(m_adios_file, "G", (void *) &G);
+
+        O = rank * 2 * NX;
+        adios_write(m_adios_file, "O", (void *) &O);
+
+        for (i = 0; i < NX; i++)
+            t[i] = O + i;
+
+        adios_write(m_adios_file, "temperature", t);
+
+        adios_write(m_adios_file, "NX", (void *) &NX);
+        adios_write(m_adios_file, "G", (void *) &G);
+
+        O = rank * 2 * NX + NX;
+        adios_write(m_adios_file, "O", (void *) &O);
+
+        for (i = 0; i < NX; i++)
+            t[i] = O + i;
+
+        adios_write(m_adios_file, "temperature", t);
+
+        adios_close (m_adios_file);
+
+        MPI_Barrier (comm);
+
+	adios_finalize (rank);
+
+	MPI_Finalize ();
+	return 0;
+}
diff --git a/examples/C/global-array/adios_read_global.c b/examples/C/global-array/adios_read_global.c
new file mode 100644
index 0000000..d226227
--- /dev/null
+++ b/examples/C/global-array/adios_read_global.c
@@ -0,0 +1,90 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/* ADIOS C Example: read global arrays from a BP file
+ *
+ * This code is using the generic read API, which can read in
+ * arbitrary slices of an array and thus we can read in an array
+ * on arbitrary number of processes (provided our code is smart 
+ * enough to do the domain decomposition).
+ *
+ * Run this example after adios_global, which generates 
+ * adios_global.bp. Run this example on equal or less 
+ * number of processes since we decompose only on one 
+ * dimension of the global array here. 
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpi.h"
+#include "adios_read.h"
+
+int main (int argc, char ** argv) 
+{
+    char        filename [256];
+    int         rank, size, i, j;
+    MPI_Comm    comm = MPI_COMM_WORLD;
+    void * data = NULL;
+    uint64_t start[2], count[2], bytes_read = 0;
+
+    MPI_Init (&argc, &argv);
+    MPI_Comm_rank (comm, &rank);
+    MPI_Comm_size (comm, &size);
+
+    ADIOS_FILE * f = adios_fopen ("adios_global.bp", comm);
+    if (f == NULL)
+    {
+        printf ("%s\n", adios_errmsg());
+        return -1;
+    }
+
+    ADIOS_GROUP * g = adios_gopen (f, "temperature");
+    if (g == NULL)
+    {
+        printf ("%s\n", adios_errmsg());
+        return -1;
+    }
+
+    ADIOS_VARINFO * v = adios_inq_var (g, "temperature");
+
+    /* Using less readers to read the global array back, i.e., non-uniform */
+    uint64_t slice_size = v->dims[0]/size;
+    start[0] = slice_size * rank;
+    if (rank == size-1) /* last rank may read more lines */
+        slice_size = slice_size + v->dims[0]%size;
+    count[0] = slice_size;
+
+    start[1] = 0;
+    count[1] = v->dims[1];
+       
+
+    data = malloc (slice_size * v->dims[1] * sizeof (double));
+    if (data == NULL)
+    {
+        fprintf (stderr, "malloc failed.\n");
+        return -1;
+    }
+
+    bytes_read = adios_read_var (g, "temperature", start, count, data);
+
+    for (i = 0; i < slice_size; i++) {
+        printf ("rank %d: [%lld,%d:%lld]", rank, start[0]+i, 0, slice_size);
+        for (j = 0; j < v->dims[1]; j++)
+            printf (" %6.2g", * (double *)data + i * v->dims[1] + j);
+        printf ("\n");
+    }
+
+    free (data);
+
+    adios_gclose (g);
+    adios_fclose (f);
+
+    MPI_Barrier (comm);
+
+    MPI_Finalize ();
+    return 0;
+}
diff --git a/examples/C/global-array/adios_read_global_no_xml.c b/examples/C/global-array/adios_read_global_no_xml.c
new file mode 100644
index 0000000..1556856
--- /dev/null
+++ b/examples/C/global-array/adios_read_global_no_xml.c
@@ -0,0 +1,84 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/* ADIOS C Example: read global arrays from a BP file
+ *
+ * This code is using the generic read API, which can read in
+ * arbitrary slices of an array and thus we can read in an array
+ * on arbitrary number of processes (provided our code is smart 
+ * enough to do the domain decomposition).
+ *
+ * Run this example after adios_global, which generates 
+ * adios_global.bp. Run this example on equal or less 
+ * number of processes since we decompose only on one 
+ * dimension of the global array here. 
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpi.h"
+#include "adios_read.h"
+
+int main (int argc, char ** argv) 
+{
+    char        filename [256];
+    int         rank, size, i, j;
+    MPI_Comm    comm = MPI_COMM_WORLD;
+    void * data = NULL;
+    uint64_t start[1], count[1], bytes_read = 0;
+
+    MPI_Init (&argc, &argv);
+    MPI_Comm_rank (comm, &rank);
+    MPI_Comm_size (comm, &size);
+
+    ADIOS_FILE * f = adios_fopen ("adios_global_no_xml.bp", comm);
+    if (f == NULL)
+    {
+        printf ("%s\n", adios_errmsg());
+        return -1;
+    }
+
+    ADIOS_GROUP * g = adios_gopen (f, "restart");
+    if (g == NULL)
+    {
+        printf ("%s\n", adios_errmsg());
+        return -1;
+    }
+
+    ADIOS_VARINFO * v = adios_inq_var (g, "temperature");
+
+    /* Using less readers to read the global array back, i.e., non-uniform */
+    uint64_t slice_size = v->dims[0]/size;
+    start[0] = slice_size * rank;
+    if (rank == size-1) /* last rank may read more lines */
+        slice_size = slice_size + v->dims[0]%size;
+    count[0] = slice_size;
+
+    data = malloc (slice_size * sizeof (double));
+    if (data == NULL)
+    {
+        fprintf (stderr, "malloc failed.\n");
+        return -1;
+    }
+
+    bytes_read = adios_read_var (g, "temperature", start, count, data);
+
+    for (i = 0; i < slice_size; i++) {
+        printf (" %6.3g", * (double *)data + i);
+    }
+    printf ("\n");
+
+    free (data);
+
+    adios_gclose (g);
+    adios_fclose (f);
+
+    MPI_Barrier (comm);
+
+    MPI_Finalize ();
+    return 0;
+}
diff --git a/examples/C/global-array/gread_temperature.ch b/examples/C/global-array/gread_temperature.ch
new file mode 100644
index 0000000..c7178d5
--- /dev/null
+++ b/examples/C/global-array/gread_temperature.ch
@@ -0,0 +1,11 @@
+adios_groupsize = 0;
+adios_totalsize = 0;
+adios_group_size (adios_handle, adios_groupsize, &adios_totalsize);
+adios_buf_size = 4;
+adios_read (adios_handle, "NX", &NX, adios_buf_size);
+adios_buf_size = 4;
+adios_read (adios_handle, "size", &size, adios_buf_size);
+adios_buf_size = 4;
+adios_read (adios_handle, "rank", &rank, adios_buf_size);
+adios_buf_size = 8 * (1) * (NX);
+adios_read (adios_handle, "temperature", temperature, adios_buf_size);
diff --git a/examples/C/global-array/gwrite_temperature.ch b/examples/C/global-array/gwrite_temperature.ch
new file mode 100644
index 0000000..1c8b279
--- /dev/null
+++ b/examples/C/global-array/gwrite_temperature.ch
@@ -0,0 +1,9 @@
+adios_groupsize = 4 \
+                + 4 \
+                + 4 \
+                + 8 * (1) * (NX);
+adios_group_size (adios_handle, adios_groupsize, &adios_totalsize);
+adios_write (adios_handle, "NX", &NX);
+adios_write (adios_handle, "size", &size);
+adios_write (adios_handle, "rank", &rank);
+adios_write (adios_handle, "temperature", t);
diff --git a/examples/C/global-array/job.pbs b/examples/C/global-array/job.pbs
new file mode 100644
index 0000000..d52ca09
--- /dev/null
+++ b/examples/C/global-array/job.pbs
@@ -0,0 +1,7 @@
+#!/bin/sh
+#PBS -N test 
+#PBS -j oe
+#PBS -l walltime=00:05:00,nodes=3:ppn=2
+
+cd $PBS_O_WORKDIR
+mpirun -np 6 ./adios_global >& result.dat
diff --git a/examples/C/manual/1_nonadios_example.c b/examples/C/manual/1_nonadios_example.c
new file mode 100644
index 0000000..bf29363
--- /dev/null
+++ b/examples/C/manual/1_nonadios_example.c
@@ -0,0 +1,40 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/*
+ * Starting example described in the User's manual
+ *
+ * The initial, non-ADIOS example
+ *
+ */
+#include <stdio.h>
+#include "mpi.h"
+int main (int argc, char ** argv) 
+{
+    char     filename [256];
+    int      rank;
+    int      NX = 10;
+    double   t[NX];
+    FILE   * fp;
+    int      i;
+
+    MPI_Init (&argc, &argv);
+    MPI_Comm_rank (MPI_COMM_WORLD, &rank);
+    sprintf (filename, "restart_%5.5d.dat", rank);
+    
+    for (i=0; i<NX; i++)
+        t[i] = rank*NX + i;
+
+    fp = fopen (filename, "w");
+    fwrite ( &NX, sizeof(int), 1, fp);
+    fwrite (t,  sizeof(double), NX, fp);
+    fclose (fp);
+
+    MPI_Finalize ();
+    return 0;
+}
+
diff --git a/examples/C/manual/2_adios_write.c b/examples/C/manual/2_adios_write.c
new file mode 100644
index 0000000..5ede52b
--- /dev/null
+++ b/examples/C/manual/2_adios_write.c
@@ -0,0 +1,63 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/*
+ * ADIOS example from the User's manual
+ *
+ * Write a separate file from each process by using the POSIX method or
+ * write into a large single file from all processes using the MPI method.
+ * You need to change only the method in the config.xml and rerun the 
+ * program (no recompile is needed)
+ *
+ * In case of POSIX method, the output files will have the process rank 
+ * appended to the file name (e.g. restart.bp.15).
+ *
+ * 4_posix_read.c example can read the output data from the same number 
+ * of processors and using the same method. 
+ * 
+ * Application of the example: 
+ *    Checkpoint/restart files 
+ *
+ * Note: bpls utility and the generic read API can see only the array
+ * written from one of the processors. You need to use global arrays to
+ * make the data available for the utilities or for reading data from 
+ * arbitrary number of processors. 
+ *
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "adios.h"
+int main (int argc, char ** argv) 
+{
+    char        filename [256];
+    int         rank;
+    int         NX = 10;
+    double      t[NX];
+    int         i;
+    
+    /* ADIOS variables declarations for matching gwrite_temperature.ch */
+    int         adios_err;
+    uint64_t    adios_groupsize, adios_totalsize;
+    int64_t     adios_handle;
+    MPI_Comm    comm =  MPI_COMM_WORLD;
+    
+    MPI_Init (&argc, &argv);
+    MPI_Comm_rank (MPI_COMM_WORLD, &rank);
+
+    for (i=0; i<NX; i++)
+        t[i] = rank*NX + i;
+
+    sprintf (filename, "restart.bp");
+    adios_init ("config.xml");
+    adios_open (&adios_handle, "temperature", filename, "w", &comm);
+    #include "gwrite_temperature.ch"
+    adios_close (adios_handle);
+    adios_finalize (rank);
+    MPI_Finalize ();
+    return 0;
+}
+
diff --git a/examples/C/manual/3_adios_read.c b/examples/C/manual/3_adios_read.c
new file mode 100644
index 0000000..436bc7c
--- /dev/null
+++ b/examples/C/manual/3_adios_read.c
@@ -0,0 +1,53 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/*
+ * ADIOS example from the User's manual
+ *
+ * Read back data written by 2_adios_posix.
+ * Use the same method and the same number of processes that were used
+ * for writing the data with 2_adios_posix.
+ *
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "adios.h"
+int main (int argc, char ** argv) 
+{
+    char        filename [256];
+    int         rank;
+    int         NX = 10;
+    double      t[NX];
+    char        result[1024], s[32];
+    int         i;
+    
+    /* ADIOS variables declarations for matching gread_temperature.ch */
+    int         adios_err;
+    uint64_t    adios_groupsize, adios_totalsize, adios_buf_size;
+    int64_t     adios_handle;
+    MPI_Comm    comm =  MPI_COMM_WORLD;
+    
+    MPI_Init (&argc, &argv);
+    MPI_Comm_rank (MPI_COMM_WORLD, &rank);
+    sprintf (filename, "restart.bp");
+    adios_init ("config.xml");
+    adios_open (&adios_handle, "temperature", filename, "r", &comm);
+    #include "gread_temperature.ch"
+    adios_close (adios_handle);
+    adios_finalize (rank);
+    MPI_Finalize ();
+
+    sprintf(result, "rank=%d t=[%g", rank, t[0]);
+    for (i=1; i<NX; i++) {
+        sprintf (s, ",%g", t[i]);
+        strcat (result, s);
+    }
+    printf("%s]\n", result);
+
+    return 0;
+}    
+
diff --git a/examples/C/manual/4_adios_nfiles.c b/examples/C/manual/4_adios_nfiles.c
new file mode 100644
index 0000000..a6057be
--- /dev/null
+++ b/examples/C/manual/4_adios_nfiles.c
@@ -0,0 +1,61 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/*
+ * ADIOS example from the User's manual
+ *
+ * Write N files from P processes by using the ADIOS MPI method and 
+ * by grouping the processes into N groups.
+ *
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "adios.h"
+int main (int argc, char ** argv) 
+{
+    char        filename [256];
+    int         rank, size;
+    int         NX = 10; 
+    int         N = 3; /* number of files to write */
+    double      t[NX];
+    int         i;
+
+    /* ADIOS variables declarations for matching gwrite_temperature.ch */
+    int         adios_err;
+    uint64_t    adios_groupsize, adios_totalsize;
+    int64_t     adios_handle;
+    int         color, key;
+    MPI_Comm    comm;
+ 
+    MPI_Init (&argc, &argv);
+    MPI_Comm_rank (MPI_COMM_WORLD, &rank);
+    MPI_Comm_size (MPI_COMM_WORLD, &size);
+
+    /* MPI_Comm_split partitions the world group into N disjoint subgroups, 
+     * the processes are ranked in terms of the argument key. 
+     * A new communicator comm is returned for this specific grid configuration
+     */
+    color = rank % N;
+    key = rank / N;
+    MPI_Comm_split (MPI_COMM_WORLD, color, key, &comm);
+
+    for (i=0; i<NX; i++)
+        t[i] = rank*NX + i;
+            
+    /* every P/N processes write into the same file 
+     * there are N files generated. 
+     */
+    sprintf (filename, "restart_%5.5d.bp", color);
+    adios_init ("config.xml");
+    adios_open (&adios_handle, "temperature", filename, "w", &comm);
+    #include "gwrite_temperature.ch"
+    adios_close (adios_handle);
+    adios_finalize (rank);
+    MPI_Finalize ();
+    return 0;
+}
+
diff --git a/examples/C/manual/Makefile.am b/examples/C/manual/Makefile.am
new file mode 100644
index 0000000..144c04d
--- /dev/null
+++ b/examples/C/manual/Makefile.am
@@ -0,0 +1,27 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+noinst_PROGRAMS = 1_nonadios_example 2_adios_write 3_adios_read 4_adios_nfiles
+
+1_nonadios_example_SOURCES = 1_nonadios_example.c
+1_nonadios_example_LDADD = $(top_builddir)/src/libadios.a 
+1_nonadios_example_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+1_nonadios_example_LDADD += $(ADIOSLIB_LDADD)
+2_adios_write_SOURCES = 2_adios_write.c
+2_adios_write_LDADD = $(top_builddir)/src/libadios.a 
+2_adios_write_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+2_adios_write_LDADD += $(ADIOSLIB_LDADD)
+3_adios_read_SOURCES = 3_adios_read.c
+3_adios_read_LDADD = $(top_builddir)/src/libadios.a 
+3_adios_read_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+3_adios_read_LDADD += $(ADIOSLIB_LDADD)
+4_adios_nfiles_SOURCES = 4_adios_nfiles.c
+4_adios_nfiles_LDADD = $(top_builddir)/src/libadios.a 
+4_adios_nfiles_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+4_adios_nfiles_LDADD += $(ADIOSLIB_LDADD)
+
+CLEANFILES = *.bp
+CC=$(MPICC)
+EXTRA_DIST = config.xml gread_temperature.ch gwrite_temperature.ch
diff --git a/examples/C/manual/Makefile.in b/examples/C/manual/Makefile.in
new file mode 100644
index 0000000..94b95fb
--- /dev/null
+++ b/examples/C/manual/Makefile.in
@@ -0,0 +1,578 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = 1_nonadios_example$(EXEEXT) 2_adios_write$(EXEEXT) \
+	3_adios_read$(EXEEXT) 4_adios_nfiles$(EXEEXT)
+subdir = examples/C/manual
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_1_nonadios_example_OBJECTS = 1_nonadios_example.$(OBJEXT)
+1_nonadios_example_OBJECTS = $(am_1_nonadios_example_OBJECTS)
+am__DEPENDENCIES_1 =
+1_nonadios_example_DEPENDENCIES = $(top_builddir)/src/libadios.a \
+	$(am__DEPENDENCIES_1)
+am_2_adios_write_OBJECTS = 2_adios_write.$(OBJEXT)
+2_adios_write_OBJECTS = $(am_2_adios_write_OBJECTS)
+2_adios_write_DEPENDENCIES = $(top_builddir)/src/libadios.a \
+	$(am__DEPENDENCIES_1)
+am_3_adios_read_OBJECTS = 3_adios_read.$(OBJEXT)
+3_adios_read_OBJECTS = $(am_3_adios_read_OBJECTS)
+3_adios_read_DEPENDENCIES = $(top_builddir)/src/libadios.a \
+	$(am__DEPENDENCIES_1)
+am_4_adios_nfiles_OBJECTS = 4_adios_nfiles.$(OBJEXT)
+4_adios_nfiles_OBJECTS = $(am_4_adios_nfiles_OBJECTS)
+4_adios_nfiles_DEPENDENCIES = $(top_builddir)/src/libadios.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(1_nonadios_example_SOURCES) $(2_adios_write_SOURCES) \
+	$(3_adios_read_SOURCES) $(4_adios_nfiles_SOURCES)
+DIST_SOURCES = $(1_nonadios_example_SOURCES) $(2_adios_write_SOURCES) \
+	$(3_adios_read_SOURCES) $(4_adios_nfiles_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+1_nonadios_example_SOURCES = 1_nonadios_example.c
+1_nonadios_example_LDADD = $(top_builddir)/src/libadios.a \
+	$(ADIOSLIB_LDADD)
+1_nonadios_example_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+2_adios_write_SOURCES = 2_adios_write.c
+2_adios_write_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD)
+2_adios_write_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+3_adios_read_SOURCES = 3_adios_read.c
+3_adios_read_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD)
+3_adios_read_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+4_adios_nfiles_SOURCES = 4_adios_nfiles.c
+4_adios_nfiles_LDADD = $(top_builddir)/src/libadios.a \
+	$(ADIOSLIB_LDADD)
+4_adios_nfiles_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+CLEANFILES = *.bp
+EXTRA_DIST = config.xml gread_temperature.ch gwrite_temperature.ch
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  examples/C/manual/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  examples/C/manual/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+1_nonadios_example$(EXEEXT): $(1_nonadios_example_OBJECTS) $(1_nonadios_example_DEPENDENCIES) 
+	@rm -f 1_nonadios_example$(EXEEXT)
+	$(LINK) $(1_nonadios_example_LDFLAGS) $(1_nonadios_example_OBJECTS) $(1_nonadios_example_LDADD) $(LIBS)
+2_adios_write$(EXEEXT): $(2_adios_write_OBJECTS) $(2_adios_write_DEPENDENCIES) 
+	@rm -f 2_adios_write$(EXEEXT)
+	$(LINK) $(2_adios_write_LDFLAGS) $(2_adios_write_OBJECTS) $(2_adios_write_LDADD) $(LIBS)
+3_adios_read$(EXEEXT): $(3_adios_read_OBJECTS) $(3_adios_read_DEPENDENCIES) 
+	@rm -f 3_adios_read$(EXEEXT)
+	$(LINK) $(3_adios_read_LDFLAGS) $(3_adios_read_OBJECTS) $(3_adios_read_LDADD) $(LIBS)
+4_adios_nfiles$(EXEEXT): $(4_adios_nfiles_OBJECTS) $(4_adios_nfiles_DEPENDENCIES) 
+	@rm -f 4_adios_nfiles$(EXEEXT)
+	$(LINK) $(4_adios_nfiles_LDFLAGS) $(4_adios_nfiles_OBJECTS) $(4_adios_nfiles_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.c.o:
+	$(COMPILE) -c $<
+
+.c.obj:
+	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+	$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/examples/C/manual/config.xml b/examples/C/manual/config.xml
new file mode 100644
index 0000000..a2b77c6
--- /dev/null
+++ b/examples/C/manual/config.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<adios-config host-language="C">
+    <adios-group name="temperature" coordination-communicator="comm">
+        <var name="NX" type="integer"/>
+        <var name="temperature" gwrite="t" gread="t" path="/" type="double" dimensions="NX"/>
+        <attribute name="description" path="/temperature" 
+                   value="Temperature array" 
+                   type="string"/>
+</adios-group>
+
+<!-- Use the POSIX method for 2_adios_write and 3_adios_read examples first. 
+     Then change the method for MPI only and rerun those examples.
+     Use only the MPI method for the 4_adios_nfiles example.
+  -->
+<method group="temperature" method="MPI"/>
+<!--method group="temperature" method="MPI"/-->
+
+<buffer size-MB="1" allocate-time="now"/>
+
+</adios-config>
+
diff --git a/examples/C/manual/gread_temperature.ch b/examples/C/manual/gread_temperature.ch
new file mode 100644
index 0000000..5ecc4ad
--- /dev/null
+++ b/examples/C/manual/gread_temperature.ch
@@ -0,0 +1,7 @@
+adios_groupsize = 0;
+adios_totalsize = 0;
+adios_group_size (adios_handle, adios_groupsize, &adios_totalsize);
+adios_buf_size = 4;
+adios_read (adios_handle, "NX", &NX, adios_buf_size);
+adios_buf_size = 8 * (NX);
+adios_read (adios_handle, "temperature", t, adios_buf_size);
diff --git a/examples/C/manual/gwrite_temperature.ch b/examples/C/manual/gwrite_temperature.ch
new file mode 100644
index 0000000..d47b677
--- /dev/null
+++ b/examples/C/manual/gwrite_temperature.ch
@@ -0,0 +1,5 @@
+adios_groupsize = 4 \
+                + 8 * (NX);
+adios_group_size (adios_handle, adios_groupsize, &adios_totalsize);
+adios_write (adios_handle, "NX", &NX);
+adios_write (adios_handle, "temperature", t);
diff --git a/examples/C/read_all/Makefile.am b/examples/C/read_all/Makefile.am
new file mode 100644
index 0000000..8c6c496
--- /dev/null
+++ b/examples/C/read_all/Makefile.am
@@ -0,0 +1,14 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+noinst_PROGRAMS = read_all
+
+read_all_SOURCES = read_all.c
+read_all_CPPFLAGS = -D_NOMPI
+read_all_LDADD = $(top_builddir)/src/libadiosread_nompi.a 
+read_all_LDFLAGS = $(ADIOSREADLIB_LDFLAGS)
+read_all_LDADD += $(ADIOSREADLIB_LDADD)
+
+CC=$(MPICC)
diff --git a/examples/C/read_all/Makefile.in b/examples/C/read_all/Makefile.in
new file mode 100644
index 0000000..3e59b37
--- /dev/null
+++ b/examples/C/read_all/Makefile.in
@@ -0,0 +1,548 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = read_all$(EXEEXT)
+subdir = examples/C/read_all
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_read_all_OBJECTS = read_all-read_all.$(OBJEXT)
+read_all_OBJECTS = $(am_read_all_OBJECTS)
+am__DEPENDENCIES_1 =
+read_all_DEPENDENCIES = $(top_builddir)/src/libadiosread_nompi.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(read_all_SOURCES)
+DIST_SOURCES = $(read_all_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+read_all_SOURCES = read_all.c
+read_all_CPPFLAGS = -D_NOMPI
+read_all_LDADD = $(top_builddir)/src/libadiosread_nompi.a \
+	$(ADIOSREADLIB_LDADD)
+read_all_LDFLAGS = $(ADIOSREADLIB_LDFLAGS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  examples/C/read_all/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  examples/C/read_all/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+read_all$(EXEEXT): $(read_all_OBJECTS) $(read_all_DEPENDENCIES) 
+	@rm -f read_all$(EXEEXT)
+	$(LINK) $(read_all_LDFLAGS) $(read_all_OBJECTS) $(read_all_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.c.o:
+	$(COMPILE) -c $<
+
+.c.obj:
+	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+	$(LTCOMPILE) -c -o $@ $<
+
+read_all-read_all.o: read_all.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(read_all_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o read_all-read_all.o `test -f 'read_all.c' || echo '$(srcdir)/'`read_all.c
+
+read_all-read_all.obj: read_all.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(read_all_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o read_all-read_all.obj `if test -f 'read_all.c'; then $(CYGPATH_W) 'read_all.c'; else $(CYGPATH_W) '$(srcdir)/read_all.c'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/examples/C/read_all/README b/examples/C/read_all/README
new file mode 100644
index 0000000..ae600ac
--- /dev/null
+++ b/examples/C/read_all/README
@@ -0,0 +1,12 @@
+C program to traverse a BP file and list all variables and attributes in all groups.
+Arrays less then 1KB are read in and their values printed (scalars, 1D and 2D arrays only).
+
+This code demonstrates the generic read API in a sequential program. 
+
+utils/bpls/bpls.c is basically the same, except for 
+- printing the min/max of variables
+- sorting the listing, 
+- dumping any slice of any variables 
+
+
+
diff --git a/examples/C/read_all/read_all.c b/examples/C/read_all/read_all.c
new file mode 100644
index 0000000..b708dca
--- /dev/null
+++ b/examples/C/read_all/read_all.c
@@ -0,0 +1,211 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/* ADIOS C Example: 
+ *  read all variables and attributes from 
+ *    all groups in a BP file
+ *
+ * This is a sequential program.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "adios_read.h"
+
+const char * value_to_string (enum ADIOS_DATATYPES type, void * data, int idx);
+
+int main (int argc, char ** argv) 
+{
+    char        filename [256];
+    int         rank, size, gidx, i, j, k,l;
+    MPI_Comm    comm_dummy = 0;  /* MPI_Comm is defined through adios_read.h */
+    enum ADIOS_DATATYPES attr_type;
+    void      * data = NULL;
+    uint64_t    start[] = {0,0,0,0,0,0,0,0,0,0};
+    uint64_t    count[10], bytes_read = 0;
+
+    if (argc < 2) {
+        printf("Usage: %s <BP-file>\n", argv[0]);
+        return 1;
+    }
+
+    ADIOS_FILE * f = adios_fopen (argv[1], comm_dummy);
+    if (f == NULL) {
+        printf ("%s\n", adios_errmsg());
+        return -1;
+    }
+
+    /* For all groups */
+    for (gidx = 0; gidx < f->groups_count; gidx++) {
+        printf("Group %s:\n", f->group_namelist[gidx]);
+        ADIOS_GROUP * g = adios_gopen (f, f->group_namelist[gidx]);
+        if (g == NULL) {
+            printf ("%s\n", adios_errmsg());
+            return -1;
+        }
+
+        /* For all variables */
+        printf("  Variables=%d:\n", g->vars_count);
+        for (i = 0; i < g->vars_count; i++) {
+            ADIOS_VARINFO * v = adios_inq_var_byid (g, i);
+
+            uint64_t total_size = adios_type_size (v->type, v->value);
+            for (j = 0; j < v->ndim; j++)
+                total_size *= v->dims[j];
+
+            printf("    %-9s  %s", adios_type_to_string(v->type), g->var_namelist[i]);
+            if (v->ndim == 0) {
+                /* Scalars do not need to be read in, we get it from the metadata
+                   when using adios_inq_var */
+                printf(" = %s\n", value_to_string(v->type, v->value, 0));
+            } else {
+                /* Arrays have to be read in from the file */
+                printf("[%d",v->dims[0]);
+                for (j = 1; j < v->ndim; j++)
+                    printf(", %d",v->dims[j]);
+                printf("] = \n");
+
+                if (total_size > 1024*1024) {
+                    printf("        // too big, do not read in\n");
+                } else {
+                    data = malloc (total_size);
+                    if (data == NULL) {
+                        fprintf (stderr, "malloc failed.\n");
+                        return -1;
+                    }
+
+                    for (j = 0; j < v->ndim; j++) 
+                        count[j] = v->dims[j];   
+                    
+                    bytes_read = adios_read_var_byid (g, i, start, count, data);
+
+                    if (bytes_read < 0) {
+                        printf ("%s\n", adios_errmsg());
+                    } else if (v->ndim == 1) {
+                        printf ("        [");
+                        for (j = 0; j < v->dims[0]; j++) 
+                            printf("%s ", value_to_string(v->type, data, j));
+                        printf ("]\n");
+                    } else if (v->ndim == 2) {
+                        for (j = 0; j < v->dims[0]; j++) {
+                            printf ("        row %d: [", j);
+                            for (k = 0; k < v->dims[1]; k++) 
+                               printf("%s ", value_to_string(v->type, data, j*v->dims[1] + k));
+                            printf ("]\n");
+                        }
+                    } else if (v->ndim == 3) {
+                        for (j = 0; j < v->dims[0]; j++) {
+                            printf ("      block %d: \n", j);
+                            for (k = 0; k < v->dims[1]; k++) {
+                                printf ("        row %d: [", k);
+                                for (l = 0; l < v->dims[2]; l++) {
+                                    printf("%s ", value_to_string(v->type, data, j*v->dims[1]*v->dims[2] + k*v->dims[1] + l));
+                                }
+                                printf ("]\n");
+                            }
+                            printf ("\n");
+                        }
+                    } else {
+                        printf ("    cannot print arrays with >2 dimensions\n");
+                    }
+                    free (data);
+                }
+            }
+
+            adios_free_varinfo (v);
+        } /* variables */
+
+        /* For all attributes */
+        printf("  Attributes=%d:\n", g->attrs_count);
+        for (i = 0; i < g->attrs_count; i++) {
+            enum ADIOS_DATATYPES atype;
+            int  asize;
+            void *adata;
+            adios_get_attr_byid (g, i, &atype, &asize, &adata);
+            printf("    %-9s  %s = %s\n", adios_type_to_string(atype), 
+                    g->attr_namelist[i], value_to_string(atype, adata, 0));
+            free(adata);
+        } /* attributes */
+
+        adios_gclose (g);
+    } /* groups */
+
+    adios_fclose (f);
+
+    return 0;
+}
+
+
+const char * value_to_string (enum ADIOS_DATATYPES type, void * data, int idx)
+{
+    static char s [100];
+    s [0] = 0;
+
+
+    switch (type)
+    {
+        case adios_unsigned_byte:
+            sprintf (s, "%u", ((uint8_t *) data)[idx]);
+            break;
+
+        case adios_byte:
+            sprintf (s, "%d", ((int8_t *) data)[idx]);
+            break;
+
+        case adios_short:
+            sprintf (s, "%hd", ((int16_t *) data)[idx]);
+            break;
+
+        case adios_unsigned_short:
+            sprintf (s, "%hu", ((uint16_t *) data)[idx]);
+            break;
+
+        case adios_integer:
+            sprintf (s, "%d", ((int32_t *) data)[idx]);
+            break;
+
+        case adios_unsigned_integer:
+            sprintf (s, "%u", ((uint32_t *) data)[idx]);
+            break;
+
+        case adios_long:
+            sprintf (s, "%lld", ((int64_t *) data)[idx]);
+            break;
+
+        case adios_unsigned_long:
+            sprintf (s, "%llu", ((uint64_t *) data)[idx]);
+            break;
+
+        case adios_real:
+            sprintf (s, "%g", ((float *) data)[idx]);
+            break;
+
+        case adios_double:
+            sprintf (s, "%lg", ((double *) data)[idx]);
+            break;
+
+        case adios_long_double:
+            sprintf (s, "%Lg", ((long double *) data)[idx]);
+            break;
+
+        case adios_string:
+            return (char*) ((char *)data+idx);
+            break;
+
+        case adios_complex:
+            sprintf (s, "(%g, %g)", 
+                    ((float *) data)[2*idx], ((float *) data)[2*idx+1]);
+            break;
+
+        case adios_double_complex:
+            sprintf (s, "(%lg, %lg)", 
+                    ((double *) data)[2*idx], ((double *) data)[2*idx+1]);
+            break;
+    }
+
+    return s;
+}
diff --git a/examples/C/scalars/Makefile.am b/examples/C/scalars/Makefile.am
new file mode 100644
index 0000000..f0da494
--- /dev/null
+++ b/examples/C/scalars/Makefile.am
@@ -0,0 +1,19 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+noinst_PROGRAMS = scalars_write scalars_read
+
+scalars_write_SOURCES = scalars_write.c
+scalars_write_LDADD = $(top_builddir)/src/libadios.a 
+scalars_write_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+scalars_write_LDADD += $(ADIOSLIB_LDADD)
+scalars_read_SOURCES = scalars_read.c
+scalars_read_LDADD = $(top_builddir)/src/libadios.a 
+scalars_read_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+scalars_read_LDADD += $(ADIOSLIB_LDADD)
+
+CLEANFILES = *.bp
+CC=$(MPICC)
+EXTRA_DIST = scalars.xml gwrite_scalars.ch gread_scalars.ch job.pbs
diff --git a/examples/C/scalars/Makefile.in b/examples/C/scalars/Makefile.in
new file mode 100644
index 0000000..f313929
--- /dev/null
+++ b/examples/C/scalars/Makefile.in
@@ -0,0 +1,553 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = scalars_write$(EXEEXT) scalars_read$(EXEEXT)
+subdir = examples/C/scalars
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_scalars_read_OBJECTS = scalars_read.$(OBJEXT)
+scalars_read_OBJECTS = $(am_scalars_read_OBJECTS)
+am__DEPENDENCIES_1 =
+scalars_read_DEPENDENCIES = $(top_builddir)/src/libadios.a \
+	$(am__DEPENDENCIES_1)
+am_scalars_write_OBJECTS = scalars_write.$(OBJEXT)
+scalars_write_OBJECTS = $(am_scalars_write_OBJECTS)
+scalars_write_DEPENDENCIES = $(top_builddir)/src/libadios.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(scalars_read_SOURCES) $(scalars_write_SOURCES)
+DIST_SOURCES = $(scalars_read_SOURCES) $(scalars_write_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+scalars_write_SOURCES = scalars_write.c
+scalars_write_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD)
+scalars_write_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+scalars_read_SOURCES = scalars_read.c
+scalars_read_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD)
+scalars_read_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+CLEANFILES = *.bp
+EXTRA_DIST = scalars.xml gwrite_scalars.ch gread_scalars.ch job.pbs
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  examples/C/scalars/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  examples/C/scalars/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+scalars_read$(EXEEXT): $(scalars_read_OBJECTS) $(scalars_read_DEPENDENCIES) 
+	@rm -f scalars_read$(EXEEXT)
+	$(LINK) $(scalars_read_LDFLAGS) $(scalars_read_OBJECTS) $(scalars_read_LDADD) $(LIBS)
+scalars_write$(EXEEXT): $(scalars_write_OBJECTS) $(scalars_write_DEPENDENCIES) 
+	@rm -f scalars_write$(EXEEXT)
+	$(LINK) $(scalars_write_LDFLAGS) $(scalars_write_OBJECTS) $(scalars_write_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.c.o:
+	$(COMPILE) -c $<
+
+.c.obj:
+	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+	$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/examples/C/scalars/README b/examples/C/scalars/README
new file mode 100644
index 0000000..2677693
--- /dev/null
+++ b/examples/C/scalars/README
@@ -0,0 +1,33 @@
+The scalars_write.F90 example shows how to write out scalar variables
+from a Fortran code. 
+
+Note that in ADIOS 1.0, a string is a scalar as seen in this example. 
+However, a character() array in Fortran can be written out as a byte
+array too.
+
+Note that each process writes an scalar with the same name into 
+the scalars.bp file if the MPI method is used. 
+Only one of them can be seen with the generic read API and tools based on 
+this API like bpls. 
+
+However, you can read each scalar from the separate processes with the 
+specific API on the same number of processors you write them out 
+(see scalars_read.F90)
+
+How to build the code on your own:
+
+1. Generate the gwrite/gread include files from the XML file
+    $ gpp.py scalars.xml
+    $ ls *.fh
+    gread_scalars.fh  gwrite_scalars.fh
+
+2. Compile and link the code, with environment variables ADIOS_DIR pointing
+   to the ADIOS installation directory and MXML_DIR pointing to the MXML
+   installation directory (substitute mpif90 with your F90 compiler):
+   $ mpif90 -o scalars_write scalars_write.F90 -I${ADIOS_DIR}/include \
+            -L${ADIOS_DIR}/lib -ladiosf -L${MXML_DIR}/lib -lmxml
+   $ mpif90 -o scalars_read scalars_read.F90 -I${ADIOS_DIR}/include \
+            -L${ADIOS_DIR}/lib -ladiosf -L${MXML_DIR}/lib -lmxml
+ 
+
+
diff --git a/examples/C/scalars/gread_scalars.ch b/examples/C/scalars/gread_scalars.ch
new file mode 100644
index 0000000..b78e239
--- /dev/null
+++ b/examples/C/scalars/gread_scalars.ch
@@ -0,0 +1,29 @@
+adios_groupsize = 0;
+adios_totalsize = 0;
+adios_group_size (adios_handle, adios_groupsize, &adios_totalsize);
+adios_buf_size = 1;
+adios_read (adios_handle, "var_byte", &v1, adios_buf_size);
+adios_buf_size = 2;
+adios_read (adios_handle, "var_short", &v2, adios_buf_size);
+adios_buf_size = 4;
+adios_read (adios_handle, "var_int", &v3, adios_buf_size);
+adios_buf_size = 8;
+adios_read (adios_handle, "var_long", &v4, adios_buf_size);
+adios_buf_size = 1;
+adios_read (adios_handle, "var_ubyte", &v5, adios_buf_size);
+adios_buf_size = 2;
+adios_read (adios_handle, "var_ushort", &v6, adios_buf_size);
+adios_buf_size = 4;
+adios_read (adios_handle, "var_uint", &v7, adios_buf_size);
+adios_buf_size = 8;
+adios_read (adios_handle, "var_ulong", &v8, adios_buf_size);
+adios_buf_size = 4;
+adios_read (adios_handle, "var_real", &v9, adios_buf_size);
+adios_buf_size = 8;
+adios_read (adios_handle, "var_double", &v10, adios_buf_size);
+adios_buf_size = 2147483648;
+adios_read (adios_handle, "var_string", v11, adios_buf_size);
+adios_buf_size = 8;
+adios_read (adios_handle, "var_complex", &v12, adios_buf_size);
+adios_buf_size = 16;
+adios_read (adios_handle, "var_double_complex", &v13, adios_buf_size);
diff --git a/examples/C/scalars/gwrite_scalars.ch b/examples/C/scalars/gwrite_scalars.ch
new file mode 100644
index 0000000..8262a50
--- /dev/null
+++ b/examples/C/scalars/gwrite_scalars.ch
@@ -0,0 +1,27 @@
+adios_groupsize = 1 \
+                + 2 \
+                + 4 \
+                + 8 \
+                + 1 \
+                + 2 \
+                + 4 \
+                + 8 \
+                + 4 \
+                + 8 \
+                + strlen(v11) \
+                + 8 \
+                + 16;
+adios_group_size (adios_handle, adios_groupsize, &adios_totalsize);
+adios_write (adios_handle, "var_byte", &v1);
+adios_write (adios_handle, "var_short", &v2);
+adios_write (adios_handle, "var_int", &v3);
+adios_write (adios_handle, "var_long", &v4);
+adios_write (adios_handle, "var_ubyte", &v5);
+adios_write (adios_handle, "var_ushort", &v6);
+adios_write (adios_handle, "var_uint", &v7);
+adios_write (adios_handle, "var_ulong", &v8);
+adios_write (adios_handle, "var_real", &v9);
+adios_write (adios_handle, "var_double", &v10);
+adios_write (adios_handle, "var_string", v11);
+adios_write (adios_handle, "var_complex", &v12);
+adios_write (adios_handle, "var_double_complex", &v13);
diff --git a/examples/C/scalars/job.pbs b/examples/C/scalars/job.pbs
new file mode 100644
index 0000000..869d703
--- /dev/null
+++ b/examples/C/scalars/job.pbs
@@ -0,0 +1,7 @@
+#!/bin/sh
+#PBS -N test
+#PBS -j oe
+#PBS -l walltime=00:05:00,nodes=3:ppn=2
+
+cd $PBS_O_WORKDIR
+mpirun -np 6 ./adios_types >& result.dat
diff --git a/examples/C/scalars/scalars.xml b/examples/C/scalars/scalars.xml
new file mode 100644
index 0000000..d39dd23
--- /dev/null
+++ b/examples/C/scalars/scalars.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<adios-config host-language="C">
+
+    <adios-group name="scalars" coordination-communicator="comm">
+        <!-- name    defines the variable name in the output file
+             gwrite  defines the variable name in the code to write out
+             gread   defines the variable name in the code to read the value into
+             gwrite and gread are optional
+        -->
+        <var name="var_byte"            gwrite="v1"  gread="v1"  type="byte"/>
+        <var name="var_short"           gwrite="v2"  gread="v2"  type="short"/>
+        <var name="var_int"             gwrite="v3"  gread="v3"  type="integer"/>
+        <var name="var_long"            gwrite="v4"  gread="v4"  type="long"/>
+        <var name="var_ubyte"           gwrite="v5"  gread="v5"  type="unsigned byte"/>
+        <var name="var_ushort"          gwrite="v6"  gread="v6"  type="unsigned short"/>
+        <var name="var_uint"            gwrite="v7"  gread="v7"  type="unsigned integer"/>
+        <var name="var_ulong"           gwrite="v8"  gread="v8"  type="unsigned long"/>
+        <var name="var_real"            gwrite="v9"  gread="v9"  type="real"/>
+        <var name="var_double"          gwrite="v10" gread="v10" type="double"/>
+        <var name="var_string"          gwrite="v11" gread="v11" type="string"/>
+        <var name="var_complex"         gwrite="v12" gread="v12" type="complex"/>
+        <var name="var_double_complex"  gwrite="v13" gread="v13" type="double complex"/>
+    </adios-group>
+
+<method group="scalars" method="MPI"/>
+
+<buffer size-MB="20" allocate-time="now"/>
+
+</adios-config>
+
diff --git a/examples/C/scalars/scalars_read.c b/examples/C/scalars/scalars_read.c
new file mode 100644
index 0000000..7555c75
--- /dev/null
+++ b/examples/C/scalars/scalars_read.c
@@ -0,0 +1,101 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/*********************************************************************/
+/*   Example of reading various types of scalar variables in ADIOS   */
+/*********************************************************************/
+#include <stdio.h>
+#include <string.h>
+#include "mpi.h"
+#include "adios.h"
+
+typedef struct complex
+{
+   float r;
+   float i; 
+} complex;
+
+typedef struct double_complex
+{
+   double r;
+   double i; 
+} double_complex;
+
+
+int main (int argc, char ** argv) 
+{
+    char        filename [256];
+    int         rank, size, i;
+    int         NX = 10; 
+    double      t[NX];
+    MPI_Comm    comm = MPI_COMM_WORLD;
+
+    int         adios_err;
+    uint64_t    adios_groupsize, adios_totalsize;
+    int64_t     adios_handle, adios_buf_size;
+
+    int8_t  v1 = 0;
+    int16_t v2 = 0;
+    int32_t v3 = 0;
+    int64_t v4 = 0;
+
+    uint8_t  v5 = 0;
+    uint16_t v6 = 0;
+    uint32_t v7 = 0;
+    uint64_t v8 = 0;
+
+    float v9 = 0.0;
+    double v10 = 0.0;
+
+    char v11[20];
+
+    complex v12;
+    v12.r = 0.0;
+    v12.i = 0.0;
+
+    double_complex v13;
+    v13.r = 0.0;
+    v13.i = 0.0;
+
+    MPI_Init (&argc, &argv);
+    MPI_Comm_rank (comm, &rank);
+
+    strcpy (filename, "scalars.bp");
+
+    adios_init ("scalars.xml");
+    adios_open (&adios_handle, "scalars", filename, "r", &comm);
+#include "gread_scalars.ch"
+    adios_close (adios_handle);
+
+    MPI_Barrier (comm);
+
+    adios_finalize (rank);
+
+    MPI_Finalize ();
+
+    if (rank == 0) {
+        printf("byte        v1  = %d\n", v1);
+        printf("short       v2  = %d\n", v2);
+        printf("integer     v3  = %d\n", v3);
+        printf("long        v4  = %lld\n", v4);
+
+        printf("uns.byte    v5  = %u\n", v5);
+        printf("uns.short   v6  = %u\n", v6);
+        printf("uns.int     v7  = %u\n", v7);
+        printf("uns.long    v8  = %llu\n", v8);
+
+        printf("float       v9  = %g\n", v9);
+        printf("double      v10 = %g\n", v10);
+
+        printf("string      v11 = %s\n", v11);
+
+        printf("complex     v12 = (%g, i%g)\n", v12.r, v12.i);
+        printf("dbl-complex v13 = (%g, i%g)\n", v13.r, v13.i);
+    }
+
+    return 0;
+}
diff --git a/examples/C/scalars/scalars_write.c b/examples/C/scalars/scalars_write.c
new file mode 100644
index 0000000..9f5bca1
--- /dev/null
+++ b/examples/C/scalars/scalars_write.c
@@ -0,0 +1,84 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/*************************************************************/
+/*   Example of writing various types of variable in ADIOS   */
+/*************************************************************/
+#include <stdio.h>
+#include <string.h>
+#include "mpi.h"
+#include "adios.h"
+
+typedef struct complex
+{
+   float r;
+   float i; 
+} complex;
+
+typedef struct double_complex
+{
+   double r;
+   double i; 
+} double_complex;
+
+
+int main (int argc, char ** argv) 
+{
+    char        filename [256];
+    int         rank, size, i;
+    int         NX = 10; 
+    double      t[NX];
+    MPI_Comm    comm = MPI_COMM_WORLD;
+
+    int         adios_err;
+    uint64_t    adios_groupsize, adios_totalsize;
+    int64_t     adios_handle;
+
+    int8_t v1 = -4;
+    int16_t v2 = -3;
+    int32_t v3 = -2;
+    int64_t v4 = -1;
+
+    uint8_t v5 = 1;
+    uint16_t v6 = 2;
+    uint32_t v7 = 3;
+    uint64_t v8 = 4;
+
+    float v9 = 5.0;
+    double v10 = 6.0;
+
+    char * v11 = "ADIOS example";
+
+    complex v12;
+    v12.r = 8.0;
+    v12.i = 9.0;
+
+    double_complex v13;
+    v13.r = 10.0;
+    v13.i = 11.0;
+
+    MPI_Init (&argc, &argv);
+
+    strcpy (filename, "scalars.bp");
+
+    /* adios_open() opens a "group in a file", here the "scalars" group.   
+       GWRITE is the convenient way to write all variables defined in the
+       xml file but of course one can write the individual adios_write() 
+       statements here too 
+    */
+    adios_init ("scalars.xml");
+    adios_open (&adios_handle, "scalars", filename, "w", &comm);
+#include "gwrite_scalars.ch"
+    adios_close (adios_handle);
+
+    MPI_Barrier (comm);
+
+    adios_finalize (rank);
+
+    MPI_Finalize ();
+    return 0;
+}
diff --git a/examples/C/stat/Makefile.am b/examples/C/stat/Makefile.am
new file mode 100644
index 0000000..50138e0
--- /dev/null
+++ b/examples/C/stat/Makefile.am
@@ -0,0 +1,19 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+noinst_PROGRAMS = stat_write stat_read
+
+stat_write_SOURCES = stat_write.c
+stat_write_LDADD = $(top_builddir)/src/libadios.a 
+stat_write_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+stat_write_LDADD += $(ADIOSLIB_LDADD)
+stat_read_SOURCES = stat_read.c
+stat_read_LDADD = $(top_builddir)/src/libadios.a 
+stat_read_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+stat_read_LDADD += $(ADIOSLIB_LDADD)
+
+CLEANFILES = *.bp
+CC=$(MPICC)
+EXTRA_DIST = stat.xml gwrite_stat.ch gread_stat.ch job.pbs
diff --git a/examples/C/stat/Makefile.in b/examples/C/stat/Makefile.in
new file mode 100644
index 0000000..766409d
--- /dev/null
+++ b/examples/C/stat/Makefile.in
@@ -0,0 +1,553 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = stat_write$(EXEEXT) stat_read$(EXEEXT)
+subdir = examples/C/stat
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_stat_read_OBJECTS = stat_read.$(OBJEXT)
+stat_read_OBJECTS = $(am_stat_read_OBJECTS)
+am__DEPENDENCIES_1 =
+stat_read_DEPENDENCIES = $(top_builddir)/src/libadios.a \
+	$(am__DEPENDENCIES_1)
+am_stat_write_OBJECTS = stat_write.$(OBJEXT)
+stat_write_OBJECTS = $(am_stat_write_OBJECTS)
+stat_write_DEPENDENCIES = $(top_builddir)/src/libadios.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(stat_read_SOURCES) $(stat_write_SOURCES)
+DIST_SOURCES = $(stat_read_SOURCES) $(stat_write_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+stat_write_SOURCES = stat_write.c
+stat_write_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD)
+stat_write_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+stat_read_SOURCES = stat_read.c
+stat_read_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD)
+stat_read_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+CLEANFILES = *.bp
+EXTRA_DIST = stat.xml gwrite_stat.ch gread_stat.ch job.pbs
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  examples/C/stat/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  examples/C/stat/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+stat_read$(EXEEXT): $(stat_read_OBJECTS) $(stat_read_DEPENDENCIES) 
+	@rm -f stat_read$(EXEEXT)
+	$(LINK) $(stat_read_LDFLAGS) $(stat_read_OBJECTS) $(stat_read_LDADD) $(LIBS)
+stat_write$(EXEEXT): $(stat_write_OBJECTS) $(stat_write_DEPENDENCIES) 
+	@rm -f stat_write$(EXEEXT)
+	$(LINK) $(stat_write_LDFLAGS) $(stat_write_OBJECTS) $(stat_write_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.c.o:
+	$(COMPILE) -c $<
+
+.c.obj:
+	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+	$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/examples/C/stat/gread_stat.ch b/examples/C/stat/gread_stat.ch
new file mode 100644
index 0000000..c7178d5
--- /dev/null
+++ b/examples/C/stat/gread_stat.ch
@@ -0,0 +1,11 @@
+adios_groupsize = 0;
+adios_totalsize = 0;
+adios_group_size (adios_handle, adios_groupsize, &adios_totalsize);
+adios_buf_size = 4;
+adios_read (adios_handle, "NX", &NX, adios_buf_size);
+adios_buf_size = 4;
+adios_read (adios_handle, "size", &size, adios_buf_size);
+adios_buf_size = 4;
+adios_read (adios_handle, "rank", &rank, adios_buf_size);
+adios_buf_size = 8 * (1) * (NX);
+adios_read (adios_handle, "temperature", temperature, adios_buf_size);
diff --git a/examples/C/stat/gwrite_stat.ch b/examples/C/stat/gwrite_stat.ch
new file mode 100644
index 0000000..810c524
--- /dev/null
+++ b/examples/C/stat/gwrite_stat.ch
@@ -0,0 +1,11 @@
+adios_groupsize = 4 \
+                + 4 \
+                + 4 \
+                + 8 * (2) * (NX) \
+                + 8 * (1) * (NX);
+adios_group_size (adios_handle, adios_groupsize, &adios_totalsize);
+adios_write (adios_handle, "NX", &NX);
+adios_write (adios_handle, "size", &size);
+adios_write (adios_handle, "rank", &rank);
+adios_write (adios_handle, "complex", &c);
+adios_write (adios_handle, "temperature", t);
diff --git a/examples/C/stat/job.pbs b/examples/C/stat/job.pbs
new file mode 100644
index 0000000..fab9819
--- /dev/null
+++ b/examples/C/stat/job.pbs
@@ -0,0 +1,7 @@
+#!/bin/sh
+#PBS -N test
+#PBS -j oe
+#PBS -l walltime=00:05:00,nodes=3:ppn=2
+
+cd $PBS_O_WORKDIR
+mpirun -np 6 ./stat_write >& result.dat
diff --git a/examples/C/stat/stat.xml b/examples/C/stat/stat.xml
new file mode 100644
index 0000000..8ced817
--- /dev/null
+++ b/examples/C/stat/stat.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<adios-config host-language="C">
+    <adios-group name="temperature" coordination-communicator="comm" time-index="iter">
+    <var name="NX" type="integer"/>
+    <var name="rank" type="integer"/>
+    <var name="size" type="integer"/>
+    <global-bounds dimensions="size,NX" offsets="rank,0">
+       <var name="temperature" gwrite="t" type="double" dimensions="iter,1,NX"/>
+       <var name="complex" gwrite="c" type="double complex" dimensions="iter,1,NX"/>
+    </global-bounds>
+</adios-group>
+
+<method group="temperature" method="MPI"/>
+<buffer size-MB="5" allocate-time="now"/>
+<analysis adios-group="temperature" var="temperature" break-points="0, 100, 1000, 10000" />
+</adios-config>
+
diff --git a/examples/C/stat/stat_read.c b/examples/C/stat/stat_read.c
new file mode 100644
index 0000000..f2ca8d0
--- /dev/null
+++ b/examples/C/stat/stat_read.c
@@ -0,0 +1,108 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/* ADIOS C Example: read global arrays from a BP file
+ *
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpi.h"
+#include "adios_read.h"
+
+int main (int argc, char ** argv) 
+{
+    char        filename [256];
+    int         rank, size, i, j, k;
+    MPI_Comm    comm = MPI_COMM_WORLD;
+    void * data = NULL;
+    uint64_t start[3], count[3], bytes_read = 0;
+
+    MPI_Init (&argc, &argv);
+    MPI_Comm_rank (comm, &rank);
+    MPI_Comm_size (comm, &size);
+
+    ADIOS_FILE * f = adios_fopen ("adios_stat.bp", comm);
+    if (f == NULL)
+    {
+        printf ("%s\n", adios_errmsg());
+        return -1;
+    }
+
+    ADIOS_GROUP * g = adios_gopen (f, "temperature");
+    if (g == NULL)
+    {
+        printf ("%s\n", adios_errmsg());
+        return -1;
+    }
+
+    ADIOS_VARINFO * v = adios_inq_var (g, "temperature");
+
+    printf("Global MIN of temperature: %lf\n", * (double *) v->gmin);
+    printf("Global MAX of temperature: %lf\n", * (double *) v->gmax);
+    printf("Global AVG of temperature: %lf\n", * (double *) v->gavg);
+    printf("Global STD DEV of temperature: %lf\n", * (double *) v->gstd_dev);
+
+	printf("\n");
+	printf("---------------------------------------------------------------------------\n");
+	printf("MIN\t\tMAX\t\tAVG\t\tSTD_DEV\t\tHISTOGRAM\n");
+	for(i = 0; v->ndim >= 0 && (i < v->dims[0]); i ++)
+	{
+		printf("%lf\t", * (double *) v->mins[i]);
+		printf("%lf\t", * (double *) v->maxs[i]);
+		printf("%lf\t", * (double *) v->avgs[i]);
+		printf("%lf\t", * (double *) v->std_devs[i]);
+		for(j = 0; j <= v->hist->num_breaks; j++)
+			printf("%d ", v->hist->frequenciess[i][j]);
+		printf("\n");
+		printf("\n");
+	}	
+	printf("---------------------------------------------------------------------------\n");
+	printf("\n");
+
+	printf("Break points:\t\t\t");
+	for(j = 0; j < v->hist->num_breaks; j++)
+		printf("%6.2lf\t", v->hist->breaks[j]);
+
+	printf("\n");
+
+	printf("Frequencies:\t\t\t");
+	for(j = 0; j <= v->hist->num_breaks; j++)
+		printf("%6d\t", v->hist->gfrequencies[j]);
+
+	printf("\n");
+	printf ("\nAuto covariance of MIN values of temperature over time: %lf\n", adios_stat_cov (v, v, "min", 0, 12, 0));
+	printf ("Auto correlationof MAX values of temperature over time, with lag 2 units: %lf\n", adios_stat_cor (v, v, "max", 0, 8, 2));
+
+	printf("\n\n");
+	v = adios_inq_var (g, "complex");
+    double *C = v->gmin;
+    printf("Global Minimum of variable complex - Magnitude: %lf\n", C[0]);
+    printf("Global Minimum of variable complex - Real part: %lf\n", C[1]);
+    printf("Global Minimum of variable complex - Imaginary part: %lfi\n", C[2]);
+
+	double ** Cmin;
+	Cmin = (double **) v->mins;
+
+	printf("\nMagnitude\t\tReal\t\t\tImaginary\n");
+	for (j = 0; v->ndim >= 0 &&  (j < v->dims[0]); j ++)
+	{
+		printf ("%lf\t\t%lf\t\t%lf\n", Cmin[j][0], Cmin[j][1], Cmin[j][2]);
+	}
+	printf("\n");
+
+    free (data);
+    adios_free_varinfo (v);
+
+    adios_gclose (g);
+    adios_fclose (f);
+
+    MPI_Barrier (comm);
+
+    MPI_Finalize ();
+    return 0;
+}
diff --git a/examples/C/stat/stat_write.c b/examples/C/stat/stat_write.c
new file mode 100644
index 0000000..1bfe4f6
--- /dev/null
+++ b/examples/C/stat/stat_write.c
@@ -0,0 +1,67 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include "mpi.h"
+#include "adios.h"
+
+struct double_complex
+{
+   double r;
+   double i;
+};
+
+int main (int argc, char ** argv) 
+{
+	char        filename [256];
+	int         rank, size, i, it;
+	int         NX = 10; 
+	double      t[NX];
+	struct double_complex c[NX];
+
+	/* ADIOS variables declarations for matching gwrite_temperature.ch */
+	int         adios_err;
+	uint64_t    adios_groupsize, adios_totalsize;
+	int64_t     adios_handle;
+	MPI_Comm    comm=MPI_COMM_WORLD;
+ 
+	MPI_Init (&argc, &argv);
+	MPI_Comm_rank (MPI_COMM_WORLD, &rank);
+	MPI_Comm_size (comm, &size);
+
+	adios_init ("stat.xml");
+   	strcpy (filename, "adios_stat.bp");
+
+   	for (it =0; it < 13; it++) {
+       	for (i = 0; i < NX; i++) {
+      		t[i] = it*100.0 + NX * rank + i;
+            c[i].r = it * 10 + i + 8;
+            c[i].i = it * 10 + i - 5;
+		}
+			// Introduce Inf value here	
+			t[0] = 1 / 0.0;	
+
+            if (it==0)
+		    	adios_open (&adios_handle, "temperature", filename, "w", &comm);
+            else
+		    	adios_open (&adios_handle, "temperature", filename, "a", &comm);
+
+        	#include "gwrite_stat.ch"
+        	adios_close (adios_handle);
+			MPI_Barrier (comm);
+ 	}
+
+	printf ("[%d]: adios_stat.bp written successfully\n", rank);
+	MPI_Barrier (comm);
+    //if (rank==0) printf("Finalize adios\n");
+    adios_finalize (rank);
+
+   //if (rank==0) printf("Finalize MPI\n");
+    MPI_Finalize ();
+	return 0;
+}
diff --git a/examples/Fortran/Makefile.am b/examples/Fortran/Makefile.am
new file mode 100644
index 0000000..6e2cfd3
--- /dev/null
+++ b/examples/Fortran/Makefile.am
@@ -0,0 +1,2 @@
+SUBDIRS=scalars arrays global-array global-array-time 
+#time-index
diff --git a/examples/Fortran/Makefile.in b/examples/Fortran/Makefile.in
new file mode 100644
index 0000000..5028fde
--- /dev/null
+++ b/examples/Fortran/Makefile.in
@@ -0,0 +1,600 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = examples/Fortran
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+SUBDIRS = scalars arrays global-array global-array-time 
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  examples/Fortran/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  examples/Fortran/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+#time-index
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/examples/Fortran/arrays/Makefile.am b/examples/Fortran/arrays/Makefile.am
new file mode 100644
index 0000000..84d04e1
--- /dev/null
+++ b/examples/Fortran/arrays/Makefile.am
@@ -0,0 +1,26 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+noinst_PROGRAMS = arrays_write arrays_read
+
+arrays_write_SOURCES = arrays_write.F90
+arrays_write_LDADD = $(top_builddir)/src/libadiosf.a 
+arrays_write_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+arrays_write_LDADD += $(ADIOSLIB_LDADD)
+
+arrays_read_SOURCES = arrays_read.F90
+arrays_read_LDADD = $(top_builddir)/src/libadiosf.a 
+arrays_read_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+arrays_read_LDADD += $(ADIOSLIB_LDADD)
+
+CLEANFILES = *.bp
+CC=$(MPICC)
+EXTRA_DIST = arrays.xml gwrite_arrays.fh gread_arrays.fh job.pbs
+
+FC=$(MPIFC)
+
+FCLINK = \
+        $(LIBTOOL) --mode=link --tag F77 $(FC) \
+        $(AM_FCFLAGS) $(FCFLAGS) $(LDFLAGS) -o $@
diff --git a/examples/Fortran/arrays/Makefile.in b/examples/Fortran/arrays/Makefile.in
new file mode 100644
index 0000000..616f581
--- /dev/null
+++ b/examples/Fortran/arrays/Makefile.in
@@ -0,0 +1,555 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = arrays_write$(EXEEXT) arrays_read$(EXEEXT)
+subdir = examples/Fortran/arrays
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_arrays_read_OBJECTS = arrays_read.$(OBJEXT)
+arrays_read_OBJECTS = $(am_arrays_read_OBJECTS)
+am__DEPENDENCIES_1 =
+arrays_read_DEPENDENCIES = $(top_builddir)/src/libadiosf.a \
+	$(am__DEPENDENCIES_1)
+am_arrays_write_OBJECTS = arrays_write.$(OBJEXT)
+arrays_write_OBJECTS = $(am_arrays_write_OBJECTS)
+arrays_write_DEPENDENCIES = $(top_builddir)/src/libadiosf.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+PPFCCOMPILE = $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)
+LTPPFCCOMPILE = $(LIBTOOL) --mode=compile $(FC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+SOURCES = $(arrays_read_SOURCES) $(arrays_write_SOURCES)
+DIST_SOURCES = $(arrays_read_SOURCES) $(arrays_write_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = $(MPIFC)
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+arrays_write_SOURCES = arrays_write.F90
+arrays_write_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD)
+arrays_write_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+arrays_read_SOURCES = arrays_read.F90
+arrays_read_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD)
+arrays_read_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+CLEANFILES = *.bp
+EXTRA_DIST = arrays.xml gwrite_arrays.fh gread_arrays.fh job.pbs
+FCLINK = \
+        $(LIBTOOL) --mode=link --tag F77 $(FC) \
+        $(AM_FCFLAGS) $(FCFLAGS) $(LDFLAGS) -o $@
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .F90 .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  examples/Fortran/arrays/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  examples/Fortran/arrays/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+arrays_read$(EXEEXT): $(arrays_read_OBJECTS) $(arrays_read_DEPENDENCIES) 
+	@rm -f arrays_read$(EXEEXT)
+	$(FCLINK) $(arrays_read_LDFLAGS) $(arrays_read_OBJECTS) $(arrays_read_LDADD) $(LIBS)
+arrays_write$(EXEEXT): $(arrays_write_OBJECTS) $(arrays_write_DEPENDENCIES) 
+	@rm -f arrays_write$(EXEEXT)
+	$(FCLINK) $(arrays_write_LDFLAGS) $(arrays_write_OBJECTS) $(arrays_write_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.F90.o:
+	$(PPFCCOMPILE) -c -o $@ $<
+
+.F90.obj:
+	$(PPFCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.F90.lo:
+	$(LTPPFCCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/examples/Fortran/arrays/README b/examples/Fortran/arrays/README
new file mode 100644
index 0000000..964d5b4
--- /dev/null
+++ b/examples/Fortran/arrays/README
@@ -0,0 +1,28 @@
+The arrays_write.F90 example shows how to write out an array the simplest way 
+from a Fortran code. 
+
+Note that each process writes an array with the same name and dimension
+into the arrays.bp file if the MPI method is used. 
+Only one of them can be seen with the generic read API and tools based on 
+this API like bpls. 
+
+However, you can read each array in with the specific API on the same number
+of processors you write them out (see arrays_read.F90)
+
+How to build the code on your own:
+
+1. Generate the gwrite/gread include files from the XML file
+    $ gpp.py arrays.xml
+    $ ls *.fh
+    gread_arrays.fh  gwrite_arrays.fh
+
+2. Compile and link the code, with environment variables ADIOS_DIR pointing
+   to the ADIOS installation directory and MXML_DIR pointing to the MXML
+   installation directory (substitute mpif90 with your F90 compiler):
+   $ mpif90 -o arrays_write arrays_write.F90 -I${ADIOS_DIR}/include \
+            -L${ADIOS_DIR}/lib -ladiosf -L${MXML_DIR}/lib -lmxml
+   $ mpif90 -o arrays_read arrays_read.F90 -I${ADIOS_DIR}/include \
+            -L${ADIOS_DIR}/lib -ladiosf -L${MXML_DIR}/lib -lmxml
+ 
+
+
diff --git a/examples/Fortran/arrays/arrays.xml b/examples/Fortran/arrays/arrays.xml
new file mode 100644
index 0000000..1b5c6b7
--- /dev/null
+++ b/examples/Fortran/arrays/arrays.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<adios-config host-language="Fortran">
+
+    <adios-group name="arrays" coordination-communicator="comm">
+        <var name="NX" type="integer"/>
+        <var name="NY" type="integer"/>
+        <var name="var_double_2Darray"  gwrite="t"  type="double"  dimensions="NX,NY"/>
+        <var name="var_int_1Darray"     gwrite="p"  type="integer" dimensions="NX"/>
+    </adios-group>
+
+<method group="arrays"  method="MPI"/>
+
+<buffer size-MB="20" allocate-time="now"/>
+
+</adios-config>
+
diff --git a/examples/Fortran/arrays/arrays_read.F90 b/examples/Fortran/arrays/arrays_read.F90
new file mode 100644
index 0000000..892d932
--- /dev/null
+++ b/examples/Fortran/arrays/arrays_read.F90
@@ -0,0 +1,90 @@
+!  
+!  ADIOS is freely available under the terms of the BSD license described
+!  in the COPYING file in the top level directory of this source distribution.
+!
+!  Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+!
+
+!/**************************************************************/
+!/*      Example of reading of simple arrays in ADIOS          */
+!/*      which were written from the same number of processors */
+!/*                                                            */
+!/*     Similar example is ../../C/manual/2_adios_read.c       */
+!/**************************************************************/
+program arrays
+    implicit none
+    include 'mpif.h'
+
+    character(len=25)   :: filename = "arrays.bp"
+    integer             :: rank, size, i, j, ierr
+    integer             :: comm
+
+    ! ADIOS variables declarations for matching gwrite_temperature.fh 
+    integer                 :: adios_err
+    integer*8               :: adios_groupsize, adios_totalsize
+    integer*8               :: adios_handle, adios_buf_size
+
+    ! variables to read in 
+    integer                 :: NX, NY
+    real*8, dimension(:,:), allocatable :: t
+    integer, dimension(:), allocatable  :: p
+
+    call MPI_Init (ierr)
+    call MPI_Comm_dup (MPI_COMM_WORLD, comm, ierr)
+    call MPI_Comm_rank (comm, rank, ierr)
+    call MPI_Comm_size (comm, size, ierr)
+
+    call adios_init ("arrays.xml", adios_err);
+    call adios_open (adios_handle, "arrays", filename, "r", comm, adios_err);
+
+    adios_groupsize = 0
+    adios_totalsize = 0
+    call adios_group_size (adios_handle, adios_groupsize, adios_totalsize, adios_err)
+
+    ! First read in the scalars to calculate the size of the arrays
+    adios_buf_size = 4
+    call adios_read (adios_handle, "NX", NX, adios_buf_size, adios_err)
+    adios_buf_size = 4
+    call adios_read (adios_handle, "NY", NY, adios_buf_size, adios_err)
+    
+    call adios_close (adios_handle, adios_err)
+    ! Note, we have to close to perform the reading of the variables above
+
+    write (*,'("rank=",i0," NX=",i0," NY=",i0)') rank, NX, NY
+
+    ! Allocate space for the arrays
+    allocate (t(NX,NY))
+    allocate (p(NX))
+
+    ! Read the arrays
+    call adios_open (adios_handle, "arrays", filename, "r", comm, adios_err);
+    call adios_group_size (adios_handle, adios_groupsize, adios_totalsize, adios_err)
+    adios_buf_size = 8 * (NX) * (NY)
+    call adios_read (adios_handle, "var_double_2Darray", t, adios_buf_size, adios_err)
+    adios_buf_size = 4 * (NX)
+    call adios_read (adios_handle, "var_int_1Darray", p, adios_buf_size, adios_err)
+    call adios_close (adios_handle, adios_err)
+
+
+    ! Print the results
+    write (*,'("rank=",i0," p = (",i0,$)') rank, p(1)
+    do i = 2,NX 
+        write (*,'(", ",i0,$)') p(i)
+    enddo
+    write (*,'(")")')
+
+    write (*,'("rank=",i0," t(:,5) = (",f6.2,$)') rank, t(1,5)
+    do i = 2,NX 
+        write (*,'(", ",f6.2,$)') t(i,5)
+    enddo
+    write (*,'(")")')
+
+
+    call MPI_Barrier (comm, ierr);
+
+    call adios_finalize (rank, adios_err);
+
+    call MPI_Finalize (ierr);
+
+end program
+
diff --git a/examples/Fortran/arrays/arrays_write.F90 b/examples/Fortran/arrays/arrays_write.F90
new file mode 100644
index 0000000..4026499
--- /dev/null
+++ b/examples/Fortran/arrays/arrays_write.F90
@@ -0,0 +1,58 @@
+!  
+!  ADIOS is freely available under the terms of the BSD license described
+!  in the COPYING file in the top level directory of this source distribution.
+!
+!  Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+!
+
+!/*************************************************************/
+!/*      Example of writing of simple arrays in ADIOS         */
+!/*                                                           */
+!/*     Similar example is ../../C/manual/2_adios_write.c     */
+!/*************************************************************/
+program arrays
+    implicit none
+    include 'mpif.h'
+
+    character(len=25)   :: filename = "arrays.bp"
+    integer             :: rank, size, i, j, ierr
+    integer             :: comm
+
+    ! ADIOS variables declarations for matching gwrite_temperature.fh 
+    integer                 :: adios_err
+    integer*8               :: adios_groupsize, adios_totalsize
+    integer*8               :: adios_handle
+
+    ! variables to write out 
+    integer, parameter      :: NX = 10, NY = 100
+    real*8                  :: t(NX,NY)
+    integer                 :: p(NX)
+
+    call MPI_Init (ierr)
+    call MPI_Comm_dup (MPI_COMM_WORLD, comm, ierr)
+    call MPI_Comm_rank (comm, rank, ierr)
+    call MPI_Comm_size (comm, size, ierr)
+
+    do j = 1,NY 
+        do i = 1,NX
+            t(i,j) = rank*NY + (j-1) + i*(1.0/NX)
+        enddo     
+    enddo
+
+    do i = 1,NX
+        p(i) = rank*NX + i
+    enddo
+
+    call adios_init ("arrays.xml", adios_err);
+    call adios_open (adios_handle, "arrays", filename, "w", comm, adios_err);
+#include "gwrite_arrays.fh"
+    call adios_close (adios_handle, adios_err)
+
+    call MPI_Barrier (comm, ierr);
+
+    call adios_finalize (rank, adios_err);
+
+    call MPI_Finalize (ierr);
+
+end program
+
diff --git a/examples/Fortran/arrays/gread_arrays.fh b/examples/Fortran/arrays/gread_arrays.fh
new file mode 100644
index 0000000..5d140ee
--- /dev/null
+++ b/examples/Fortran/arrays/gread_arrays.fh
@@ -0,0 +1,11 @@
+adios_groupsize = 0
+adios_totalsize = 0
+call adios_group_size (adios_handle, adios_groupsize, adios_totalsize, adios_err)
+adios_buf_size = 4
+call adios_read (adios_handle, "NX", NX, adios_buf_size, adios_err)
+adios_buf_size = 4
+call adios_read (adios_handle, "NY", NY, adios_buf_size, adios_err)
+adios_buf_size = 8 * (NX) * (NY)
+call adios_read (adios_handle, "var_double_2Darray", var_double_2Darray, adios_buf_size, adios_err)
+adios_buf_size = 4 * (NX)
+call adios_read (adios_handle, "var_int_1Darray", var_int_1Darray, adios_buf_size, adios_err)
diff --git a/examples/Fortran/arrays/gwrite_arrays.fh b/examples/Fortran/arrays/gwrite_arrays.fh
new file mode 100644
index 0000000..421790e
--- /dev/null
+++ b/examples/Fortran/arrays/gwrite_arrays.fh
@@ -0,0 +1,9 @@
+adios_groupsize = 4 &
+                + 4 &
+                + 8 * (NX) * (NY) &
+                + 4 * (NX)
+call adios_group_size (adios_handle, adios_groupsize, adios_totalsize, adios_err)
+call adios_write (adios_handle, "NX", NX, adios_err)
+call adios_write (adios_handle, "NY", NY, adios_err)
+call adios_write (adios_handle, "var_double_2Darray", t, adios_err)
+call adios_write (adios_handle, "var_int_1Darray", p, adios_err)
diff --git a/examples/Fortran/arrays/job.pbs b/examples/Fortran/arrays/job.pbs
new file mode 100644
index 0000000..869d703
--- /dev/null
+++ b/examples/Fortran/arrays/job.pbs
@@ -0,0 +1,7 @@
+#!/bin/sh
+#PBS -N test
+#PBS -j oe
+#PBS -l walltime=00:05:00,nodes=3:ppn=2
+
+cd $PBS_O_WORKDIR
+mpirun -np 6 ./adios_types >& result.dat
diff --git a/examples/Fortran/global-array-time/Makefile.am b/examples/Fortran/global-array-time/Makefile.am
new file mode 100644
index 0000000..3e97d43
--- /dev/null
+++ b/examples/Fortran/global-array-time/Makefile.am
@@ -0,0 +1,21 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+noinst_PROGRAMS = adios_globaltime
+
+adios_globaltime_SOURCES = adios_globaltime.F90
+adios_globaltime_LDADD = $(top_builddir)/src/libadiosf.a 
+adios_globaltime_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+adios_globaltime_LDADD += $(ADIOSLIB_LDADD)
+
+CLEANFILES = *.bp
+CC=$(MPICC)
+FC=$(MPIFC)
+
+FCLINK = \
+	$(LIBTOOL) --mode=link --tag F77 $(FC) \
+	$(AM_FCFLAGS) $(FCFLAGS) $(LDFLAGS) -o $@
+
+EXTRA_DIST = adios_globaltime.xml gread_temperature.fh gwrite_temperature.fh job.pbs
diff --git a/examples/Fortran/global-array-time/Makefile.in b/examples/Fortran/global-array-time/Makefile.in
new file mode 100644
index 0000000..aff3fc6
--- /dev/null
+++ b/examples/Fortran/global-array-time/Makefile.in
@@ -0,0 +1,546 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = adios_globaltime$(EXEEXT)
+subdir = examples/Fortran/global-array-time
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_adios_globaltime_OBJECTS = adios_globaltime.$(OBJEXT)
+adios_globaltime_OBJECTS = $(am_adios_globaltime_OBJECTS)
+am__DEPENDENCIES_1 =
+adios_globaltime_DEPENDENCIES = $(top_builddir)/src/libadiosf.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+PPFCCOMPILE = $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)
+LTPPFCCOMPILE = $(LIBTOOL) --mode=compile $(FC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+SOURCES = $(adios_globaltime_SOURCES)
+DIST_SOURCES = $(adios_globaltime_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = $(MPIFC)
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+adios_globaltime_SOURCES = adios_globaltime.F90
+adios_globaltime_LDADD = $(top_builddir)/src/libadiosf.a \
+	$(ADIOSLIB_LDADD)
+adios_globaltime_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+CLEANFILES = *.bp
+FCLINK = \
+	$(LIBTOOL) --mode=link --tag F77 $(FC) \
+	$(AM_FCFLAGS) $(FCFLAGS) $(LDFLAGS) -o $@
+
+EXTRA_DIST = adios_globaltime.xml gread_temperature.fh gwrite_temperature.fh job.pbs
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .F90 .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  examples/Fortran/global-array-time/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  examples/Fortran/global-array-time/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+adios_globaltime$(EXEEXT): $(adios_globaltime_OBJECTS) $(adios_globaltime_DEPENDENCIES) 
+	@rm -f adios_globaltime$(EXEEXT)
+	$(FCLINK) $(adios_globaltime_LDFLAGS) $(adios_globaltime_OBJECTS) $(adios_globaltime_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.F90.o:
+	$(PPFCCOMPILE) -c -o $@ $<
+
+.F90.obj:
+	$(PPFCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.F90.lo:
+	$(LTPPFCCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/examples/Fortran/global-array-time/adios_globaltime.F90 b/examples/Fortran/global-array-time/adios_globaltime.F90
new file mode 100644
index 0000000..4943148
--- /dev/null
+++ b/examples/Fortran/global-array-time/adios_globaltime.F90
@@ -0,0 +1,62 @@
+!
+!  ADIOS is freely available under the terms of the BSD license described
+!  in the COPYING file in the top level directory of this source distribution.
+!
+!  Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+!
+
+! ADIOS Fortran Example: write a global array from N processors with gwrite
+! and write several timesteps into one BP file
+!
+! How to run: mpirun -np <N> adios_globaltime
+! Output: adios_globaltime.bp
+! ADIOS config file: adios_globaltime.xml
+!
+
+program adios_global
+    implicit none
+    include 'mpif.h'
+    character(len=256)      :: filename = "adios_globaltime.bp"
+    integer                 :: rank, size, i, it, ierr
+    integer, parameter      :: NX = 10
+    real*8                  :: t(NX)
+    integer                 :: comm
+
+    ! ADIOS variables declarations for matching gwrite_temperature.fh
+    integer                 :: adios_err
+    integer*8               :: adios_groupsize, adios_totalsize
+    integer*8               :: adios_handle
+
+    call MPI_Init (ierr)
+    call MPI_Comm_dup (MPI_COMM_WORLD, comm, ierr)
+    call MPI_Comm_rank (comm, rank, ierr)
+    call MPI_Comm_size (comm, size, ierr)
+
+    call adios_init ("adios_globaltime.xml", adios_err)
+
+    do it = 1, 13
+        do i = 1, NX
+            t(i)  = 100.0*it + NX*rank + i-1
+        enddo
+
+        ! We need to create the file in the first round,
+        ! then we need to append to it
+        if (it == 1) then
+            call adios_open (adios_handle, "temperature", filename, "w", comm, adios_err)
+        else
+            call adios_open (adios_handle, "temperature", filename, "a", comm, adios_err)
+        endif
+
+#include "gwrite_temperature.fh"
+
+        call adios_close (adios_handle, adios_err)
+
+        call MPI_Barrier (comm, ierr)
+    enddo
+
+    call MPI_Barrier (comm, ierr)
+
+    call adios_finalize (rank, adios_err)
+
+    call MPI_Finalize (ierr)
+end program
diff --git a/examples/Fortran/global-array-time/adios_globaltime.xml b/examples/Fortran/global-array-time/adios_globaltime.xml
new file mode 100644
index 0000000..59b66a0
--- /dev/null
+++ b/examples/Fortran/global-array-time/adios_globaltime.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<adios-config host-language="Fortran">
+    <adios-group name="temperature" coordination-communicator="comm" time-index="iter">
+    <var name="NX" type="integer"/>
+    <var name="size" type="integer"/>
+    <var name="rank" type="integer"/>
+    <global-bounds dimensions="NX,size" offsets="0,rank">
+       <var name="temperature" gwrite="t" type="double" dimensions="NX,1,iter"/>
+    </global-bounds>
+    <attribute name="description" path="/temperature" 
+        value="Global array written from 'size' processes over several timesteps" 
+        type="string"/>
+</adios-group>
+
+<method group="temperature" method="MPI"/>
+
+<buffer size-MB="2" allocate-time="now"/>
+
+</adios-config>
+
diff --git a/examples/Fortran/global-array-time/gread_temperature.fh b/examples/Fortran/global-array-time/gread_temperature.fh
new file mode 100644
index 0000000..e44284e
--- /dev/null
+++ b/examples/Fortran/global-array-time/gread_temperature.fh
@@ -0,0 +1,11 @@
+adios_groupsize = 0
+adios_totalsize = 0
+call adios_group_size (adios_handle, adios_groupsize, adios_totalsize, adios_err)
+adios_buf_size = 4
+call adios_read (adios_handle, "NX", NX, adios_buf_size, adios_err)
+adios_buf_size = 4
+call adios_read (adios_handle, "size", size, adios_buf_size, adios_err)
+adios_buf_size = 4
+call adios_read (adios_handle, "rank", rank, adios_buf_size, adios_err)
+adios_buf_size = 8 * (NX) * (1)
+call adios_read (adios_handle, "temperature", temperature, adios_buf_size, adios_err)
diff --git a/examples/Fortran/global-array-time/gwrite_temperature.fh b/examples/Fortran/global-array-time/gwrite_temperature.fh
new file mode 100644
index 0000000..a1699a5
--- /dev/null
+++ b/examples/Fortran/global-array-time/gwrite_temperature.fh
@@ -0,0 +1,9 @@
+adios_groupsize = 4 &
+                + 4 &
+                + 4 &
+                + 8 * (NX) * (1)
+call adios_group_size (adios_handle, adios_groupsize, adios_totalsize, adios_err)
+call adios_write (adios_handle, "NX", NX, adios_err)
+call adios_write (adios_handle, "size", size, adios_err)
+call adios_write (adios_handle, "rank", rank, adios_err)
+call adios_write (adios_handle, "temperature", t, adios_err)
diff --git a/examples/Fortran/global-array-time/job.pbs b/examples/Fortran/global-array-time/job.pbs
new file mode 100644
index 0000000..0a3fd60
--- /dev/null
+++ b/examples/Fortran/global-array-time/job.pbs
@@ -0,0 +1,7 @@
+#!/bin/sh
+#PBS -N test 
+#PBS -j oe
+#PBS -l walltime=00:05:00,nodes=3:ppn=2
+
+cd $PBS_O_WORKDIR
+mpirun -np 6 ./adios_globaltime >& result.dat
diff --git a/examples/Fortran/global-array/Makefile.am b/examples/Fortran/global-array/Makefile.am
new file mode 100644
index 0000000..159a865
--- /dev/null
+++ b/examples/Fortran/global-array/Makefile.am
@@ -0,0 +1,26 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+noinst_PROGRAMS = adios_global adios_global_no_xml
+
+adios_global_SOURCES = adios_global.F90
+adios_global_LDADD = $(top_builddir)/src/libadiosf.a 
+adios_global_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+adios_global_LDADD += $(ADIOSLIB_LDADD)
+
+adios_global_no_xml_SOURCES = adios_global_no_xml.F90
+adios_global_no_xml_LDADD = $(top_builddir)/src/libadiosf.a 
+adios_global_no_xml_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+adios_global_no_xml_LDADD += $(ADIOSLIB_LDADD)
+
+CLEANFILES = *.bp
+CC=$(MPICC)
+FC=$(MPIFC)
+
+FCLINK = \
+	$(LIBTOOL) --mode=link --tag F77 $(FC) \
+	$(AM_FCFLAGS) $(FCFLAGS) $(LDFLAGS) -o $@
+
+EXTRA_DIST = adios_global.xml gread_temperature.fh gwrite_temperature.fh job.pbs
diff --git a/examples/Fortran/global-array/Makefile.in b/examples/Fortran/global-array/Makefile.in
new file mode 100644
index 0000000..100c643
--- /dev/null
+++ b/examples/Fortran/global-array/Makefile.in
@@ -0,0 +1,556 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = adios_global$(EXEEXT) adios_global_no_xml$(EXEEXT)
+subdir = examples/Fortran/global-array
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_adios_global_OBJECTS = adios_global.$(OBJEXT)
+adios_global_OBJECTS = $(am_adios_global_OBJECTS)
+am__DEPENDENCIES_1 =
+adios_global_DEPENDENCIES = $(top_builddir)/src/libadiosf.a \
+	$(am__DEPENDENCIES_1)
+am_adios_global_no_xml_OBJECTS = adios_global_no_xml.$(OBJEXT)
+adios_global_no_xml_OBJECTS = $(am_adios_global_no_xml_OBJECTS)
+adios_global_no_xml_DEPENDENCIES = $(top_builddir)/src/libadiosf.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+PPFCCOMPILE = $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)
+LTPPFCCOMPILE = $(LIBTOOL) --mode=compile $(FC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+SOURCES = $(adios_global_SOURCES) $(adios_global_no_xml_SOURCES)
+DIST_SOURCES = $(adios_global_SOURCES) $(adios_global_no_xml_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = $(MPIFC)
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+adios_global_SOURCES = adios_global.F90
+adios_global_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD)
+adios_global_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+adios_global_no_xml_SOURCES = adios_global_no_xml.F90
+adios_global_no_xml_LDADD = $(top_builddir)/src/libadiosf.a \
+	$(ADIOSLIB_LDADD)
+adios_global_no_xml_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+CLEANFILES = *.bp
+FCLINK = \
+	$(LIBTOOL) --mode=link --tag F77 $(FC) \
+	$(AM_FCFLAGS) $(FCFLAGS) $(LDFLAGS) -o $@
+
+EXTRA_DIST = adios_global.xml gread_temperature.fh gwrite_temperature.fh job.pbs
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .F90 .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  examples/Fortran/global-array/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  examples/Fortran/global-array/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+adios_global$(EXEEXT): $(adios_global_OBJECTS) $(adios_global_DEPENDENCIES) 
+	@rm -f adios_global$(EXEEXT)
+	$(FCLINK) $(adios_global_LDFLAGS) $(adios_global_OBJECTS) $(adios_global_LDADD) $(LIBS)
+adios_global_no_xml$(EXEEXT): $(adios_global_no_xml_OBJECTS) $(adios_global_no_xml_DEPENDENCIES) 
+	@rm -f adios_global_no_xml$(EXEEXT)
+	$(FCLINK) $(adios_global_no_xml_LDFLAGS) $(adios_global_no_xml_OBJECTS) $(adios_global_no_xml_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.F90.o:
+	$(PPFCCOMPILE) -c -o $@ $<
+
+.F90.obj:
+	$(PPFCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.F90.lo:
+	$(LTPPFCCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/examples/Fortran/global-array/adios_global.F90 b/examples/Fortran/global-array/adios_global.F90
new file mode 100644
index 0000000..3eecbdb
--- /dev/null
+++ b/examples/Fortran/global-array/adios_global.F90
@@ -0,0 +1,49 @@
+!  
+!  ADIOS is freely available under the terms of the BSD license described
+!  in the COPYING file in the top level directory of this source distribution.
+!
+!  Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+!
+
+! ADIOS Fortran Example: write a global array from N processors with gwrite
+!
+! How to run: mpirun -np <N> adios_global
+! Output: adios_global.bp
+! ADIOS config file: adios_global.xml
+!
+
+program adios_global 
+    implicit none
+    include 'mpif.h'
+    character(len=256)      :: filename = "adios_global.bp"
+    integer                 :: rank, size, i, ierr
+    integer, parameter      :: NX = 10
+    real*8, dimension(NX)   :: t
+    integer                 :: comm
+
+    ! ADIOS variables declarations for matching gwrite_temperature.fh 
+    integer                 :: adios_err
+    integer*8               :: adios_groupsize, adios_totalsize
+    integer*8               :: adios_handle
+
+    call MPI_Init (ierr)
+    call MPI_Comm_dup (MPI_COMM_WORLD, comm, ierr)
+    call MPI_Comm_rank (comm, rank, ierr)
+    call MPI_Comm_size (comm, size, ierr)
+
+    do i = 1, NX
+        t(i)  = 10.0*rank+i-1
+    enddo
+
+    call adios_init ("adios_global.xml", adios_err)
+
+    call adios_open (adios_handle, "temperature", filename, "w", comm, adios_err)
+#include "gwrite_temperature.fh"
+    call adios_close (adios_handle, adios_err)
+
+    call MPI_Barrier (comm, ierr)
+
+    call adios_finalize (rank, adios_err)
+
+    call MPI_Finalize (ierr)
+end program
diff --git a/examples/Fortran/global-array/adios_global.xml b/examples/Fortran/global-array/adios_global.xml
new file mode 100644
index 0000000..e8382ff
--- /dev/null
+++ b/examples/Fortran/global-array/adios_global.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<adios-config host-language="Fortran">
+    <adios-group name="temperature" coordination-communicator="comm">
+    <var name="NX" type="integer"/>
+    <var name="size" type="integer"/>
+    <var name="rank" type="integer"/>
+    <global-bounds dimensions="NX,size" offsets="0,rank">
+       <var name="temperature" gwrite="t" type="double" dimensions="NX,1"/>
+    </global-bounds>
+    <attribute name="description" path="/temperature" value="Global array written from 'size' processes" type="string"/>
+</adios-group>
+
+<method group="temperature" method="MPI"/>
+
+<buffer size-MB="2" allocate-time="now"/>
+
+</adios-config>
+
diff --git a/examples/Fortran/global-array/adios_global_no_xml.F90 b/examples/Fortran/global-array/adios_global_no_xml.F90
new file mode 100644
index 0000000..cddcd72
--- /dev/null
+++ b/examples/Fortran/global-array/adios_global_no_xml.F90
@@ -0,0 +1,110 @@
+!  
+!  ADIOS is freely available under the terms of the BSD license described
+!  in the COPYING file in the top level directory of this source distribution.
+!
+!  Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+!
+
+! ADIOS Fortran Example: write a global array from N processors using No-XML API. 
+! The example also shows how to do multi-writes in ADIOS.
+! How to run: mpirun -np <N> adios_global_no_xml
+! Output: adios_global_no_xml.bp
+! ADIOS config file: None
+!
+
+program adios_global 
+    implicit none
+    include 'mpif.h'
+    character(len=256)      :: filename = "adios_global_no_xml.bp"
+    integer                 :: rank, size, i, ierr
+    integer,parameter       :: NX=10
+    integer                 :: O, G
+    real*8, dimension(NX)   :: t
+    integer                 :: comm
+
+    integer                 :: adios_err
+    integer*8               :: adios_groupsize, adios_totalsize
+    integer*8               :: adios_handle
+    integer*8               :: m_adios_group
+
+    call MPI_Init (ierr)
+    call MPI_Comm_dup (MPI_COMM_WORLD, comm, ierr)
+    call MPI_Comm_rank (comm, rank, ierr)
+    call MPI_Comm_size (comm, size, ierr)
+
+    call adios_init_noxml (adios_err)
+    call adios_allocate_buffer (10, adios_err)
+
+    call adios_declare_group (m_adios_group, "restart", "iter", adios_err)
+    call adios_select_method (m_adios_group, "MPI", "", "", adios_err)
+
+    ! define a integer
+    call adios_define_var (m_adios_group, "NX" &
+                          ,"", 2 &
+                          ,"", "", "", adios_err)
+    ! define a integer
+    call adios_define_var (m_adios_group, "G" &
+                          ,"", 2 &
+                          ,"", "", "", adios_err)
+    ! define a integer
+    call adios_define_var (m_adios_group, "O" &
+                          ,"", 2 &
+                          ,"", "", "", adios_err)
+    ! define a global array
+    call adios_define_var (m_adios_group, "temperature" &
+                          ,"", 6 &
+                          ,"NX", "G", "O", adios_err)
+
+    ! define a integer
+    call adios_define_var (m_adios_group, "NX" &
+                          ,"", 2 &
+                          ,"", "", "", adios_err)
+    ! define a integer
+    call adios_define_var (m_adios_group, "G" &
+                          ,"", 2 &
+                          ,"", "", "", adios_err)
+    ! define a integer
+    call adios_define_var (m_adios_group, "O" &
+                          ,"", 2 &
+                          ,"", "", "", adios_err)
+    ! define a global array
+    call adios_define_var (m_adios_group, "temperature" &
+                          ,"", 6 &
+                          ,"NX", "G", "O", adios_err)
+
+    call adios_open (adios_handle, "restart", filename, "w", comm, adios_err)
+
+    adios_groupsize = 4 + 4 + 4 + NX * 8 &
+                    + 4 + 4 + 4 + NX * 8
+    call adios_group_size (adios_handle, adios_groupsize, adios_totalsize, adios_err)
+
+    G = 2 * NX * size
+    O = 2 * NX * rank
+    do i = 1, NX
+        t(i)  = O + i - 1
+    enddo
+
+    call adios_write (adios_handle, "NX", NX, adios_err)
+    call adios_write (adios_handle, "G", G, adios_err)
+    call adios_write (adios_handle, "O", O, adios_err)
+    call adios_write (adios_handle, "temperature", t, adios_err)
+
+
+    O = 2 * NX * rank + NX
+    do i = 1, NX
+        t(i)  = O + i - 1
+    enddo
+
+    call adios_write (adios_handle, "NX", NX, adios_err)
+    call adios_write (adios_handle, "G", G, adios_err)
+    call adios_write (adios_handle, "O", O, adios_err)
+    call adios_write (adios_handle, "temperature", t, adios_err)
+
+    call adios_close (adios_handle, adios_err)
+
+    call MPI_Barrier (comm, ierr)
+
+    call adios_finalize (rank, adios_err)
+
+    call MPI_Finalize (ierr)
+end program
diff --git a/examples/Fortran/global-array/gread_temperature.fh b/examples/Fortran/global-array/gread_temperature.fh
new file mode 100644
index 0000000..e44284e
--- /dev/null
+++ b/examples/Fortran/global-array/gread_temperature.fh
@@ -0,0 +1,11 @@
+adios_groupsize = 0
+adios_totalsize = 0
+call adios_group_size (adios_handle, adios_groupsize, adios_totalsize, adios_err)
+adios_buf_size = 4
+call adios_read (adios_handle, "NX", NX, adios_buf_size, adios_err)
+adios_buf_size = 4
+call adios_read (adios_handle, "size", size, adios_buf_size, adios_err)
+adios_buf_size = 4
+call adios_read (adios_handle, "rank", rank, adios_buf_size, adios_err)
+adios_buf_size = 8 * (NX) * (1)
+call adios_read (adios_handle, "temperature", temperature, adios_buf_size, adios_err)
diff --git a/examples/Fortran/global-array/gwrite_temperature.fh b/examples/Fortran/global-array/gwrite_temperature.fh
new file mode 100644
index 0000000..a1699a5
--- /dev/null
+++ b/examples/Fortran/global-array/gwrite_temperature.fh
@@ -0,0 +1,9 @@
+adios_groupsize = 4 &
+                + 4 &
+                + 4 &
+                + 8 * (NX) * (1)
+call adios_group_size (adios_handle, adios_groupsize, adios_totalsize, adios_err)
+call adios_write (adios_handle, "NX", NX, adios_err)
+call adios_write (adios_handle, "size", size, adios_err)
+call adios_write (adios_handle, "rank", rank, adios_err)
+call adios_write (adios_handle, "temperature", t, adios_err)
diff --git a/examples/Fortran/global-array/job.pbs b/examples/Fortran/global-array/job.pbs
new file mode 100644
index 0000000..d52ca09
--- /dev/null
+++ b/examples/Fortran/global-array/job.pbs
@@ -0,0 +1,7 @@
+#!/bin/sh
+#PBS -N test 
+#PBS -j oe
+#PBS -l walltime=00:05:00,nodes=3:ppn=2
+
+cd $PBS_O_WORKDIR
+mpirun -np 6 ./adios_global >& result.dat
diff --git a/examples/Fortran/scalars/Makefile.am b/examples/Fortran/scalars/Makefile.am
new file mode 100644
index 0000000..1569643
--- /dev/null
+++ b/examples/Fortran/scalars/Makefile.am
@@ -0,0 +1,26 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+noinst_PROGRAMS = scalars_write scalars_read
+
+scalars_write_SOURCES = scalars_write.F90
+scalars_write_LDADD = $(top_builddir)/src/libadiosf.a 
+scalars_write_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+scalars_write_LDADD += $(ADIOSLIB_LDADD)
+
+scalars_read_SOURCES = scalars_read.F90
+scalars_read_LDADD = $(top_builddir)/src/libadiosf.a 
+scalars_read_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+scalars_read_LDADD += $(ADIOSLIB_LDADD)
+
+CLEANFILES = *.bp
+CC=$(MPICC)
+EXTRA_DIST = scalars.xml gwrite_scalars.fh gread_scalars.fh job.pbs
+
+FC=$(MPIFC)
+
+FCLINK = \
+        $(LIBTOOL) --mode=link --tag F77 $(FC) \
+        $(AM_FCFLAGS) $(FCFLAGS) $(LDFLAGS) -o $@
diff --git a/examples/Fortran/scalars/Makefile.in b/examples/Fortran/scalars/Makefile.in
new file mode 100644
index 0000000..b8dbf75
--- /dev/null
+++ b/examples/Fortran/scalars/Makefile.in
@@ -0,0 +1,556 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = scalars_write$(EXEEXT) scalars_read$(EXEEXT)
+subdir = examples/Fortran/scalars
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_scalars_read_OBJECTS = scalars_read.$(OBJEXT)
+scalars_read_OBJECTS = $(am_scalars_read_OBJECTS)
+am__DEPENDENCIES_1 =
+scalars_read_DEPENDENCIES = $(top_builddir)/src/libadiosf.a \
+	$(am__DEPENDENCIES_1)
+am_scalars_write_OBJECTS = scalars_write.$(OBJEXT)
+scalars_write_OBJECTS = $(am_scalars_write_OBJECTS)
+scalars_write_DEPENDENCIES = $(top_builddir)/src/libadiosf.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+PPFCCOMPILE = $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)
+LTPPFCCOMPILE = $(LIBTOOL) --mode=compile $(FC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+SOURCES = $(scalars_read_SOURCES) $(scalars_write_SOURCES)
+DIST_SOURCES = $(scalars_read_SOURCES) $(scalars_write_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = $(MPIFC)
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+scalars_write_SOURCES = scalars_write.F90
+scalars_write_LDADD = $(top_builddir)/src/libadiosf.a \
+	$(ADIOSLIB_LDADD)
+scalars_write_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+scalars_read_SOURCES = scalars_read.F90
+scalars_read_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD)
+scalars_read_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+CLEANFILES = *.bp
+EXTRA_DIST = scalars.xml gwrite_scalars.fh gread_scalars.fh job.pbs
+FCLINK = \
+        $(LIBTOOL) --mode=link --tag F77 $(FC) \
+        $(AM_FCFLAGS) $(FCFLAGS) $(LDFLAGS) -o $@
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .F90 .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  examples/Fortran/scalars/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  examples/Fortran/scalars/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+scalars_read$(EXEEXT): $(scalars_read_OBJECTS) $(scalars_read_DEPENDENCIES) 
+	@rm -f scalars_read$(EXEEXT)
+	$(FCLINK) $(scalars_read_LDFLAGS) $(scalars_read_OBJECTS) $(scalars_read_LDADD) $(LIBS)
+scalars_write$(EXEEXT): $(scalars_write_OBJECTS) $(scalars_write_DEPENDENCIES) 
+	@rm -f scalars_write$(EXEEXT)
+	$(FCLINK) $(scalars_write_LDFLAGS) $(scalars_write_OBJECTS) $(scalars_write_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.F90.o:
+	$(PPFCCOMPILE) -c -o $@ $<
+
+.F90.obj:
+	$(PPFCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.F90.lo:
+	$(LTPPFCCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/examples/Fortran/scalars/README b/examples/Fortran/scalars/README
new file mode 100644
index 0000000..2677693
--- /dev/null
+++ b/examples/Fortran/scalars/README
@@ -0,0 +1,33 @@
+The scalars_write.F90 example shows how to write out scalar variables
+from a Fortran code. 
+
+Note that in ADIOS 1.0, a string is a scalar as seen in this example. 
+However, a character() array in Fortran can be written out as a byte
+array too.
+
+Note that each process writes an scalar with the same name into 
+the scalars.bp file if the MPI method is used. 
+Only one of them can be seen with the generic read API and tools based on 
+this API like bpls. 
+
+However, you can read each scalar from the separate processes with the 
+specific API on the same number of processors you write them out 
+(see scalars_read.F90)
+
+How to build the code on your own:
+
+1. Generate the gwrite/gread include files from the XML file
+    $ gpp.py scalars.xml
+    $ ls *.fh
+    gread_scalars.fh  gwrite_scalars.fh
+
+2. Compile and link the code, with environment variables ADIOS_DIR pointing
+   to the ADIOS installation directory and MXML_DIR pointing to the MXML
+   installation directory (substitute mpif90 with your F90 compiler):
+   $ mpif90 -o scalars_write scalars_write.F90 -I${ADIOS_DIR}/include \
+            -L${ADIOS_DIR}/lib -ladiosf -L${MXML_DIR}/lib -lmxml
+   $ mpif90 -o scalars_read scalars_read.F90 -I${ADIOS_DIR}/include \
+            -L${ADIOS_DIR}/lib -ladiosf -L${MXML_DIR}/lib -lmxml
+ 
+
+
diff --git a/examples/Fortran/scalars/gread_scalars.fh b/examples/Fortran/scalars/gread_scalars.fh
new file mode 100644
index 0000000..9860d11
--- /dev/null
+++ b/examples/Fortran/scalars/gread_scalars.fh
@@ -0,0 +1,29 @@
+adios_groupsize = 0
+adios_totalsize = 0
+call adios_group_size (adios_handle, adios_groupsize, adios_totalsize, adios_err)
+adios_buf_size = 1
+call adios_read (adios_handle, "var_byte", v1, adios_buf_size, adios_err)
+adios_buf_size = 2
+call adios_read (adios_handle, "var_short", v2, adios_buf_size, adios_err)
+adios_buf_size = 4
+call adios_read (adios_handle, "var_int", v3, adios_buf_size, adios_err)
+adios_buf_size = 8
+call adios_read (adios_handle, "var_long", v4, adios_buf_size, adios_err)
+adios_buf_size = 1
+call adios_read (adios_handle, "var_ubyte", v5, adios_buf_size, adios_err)
+adios_buf_size = 2
+call adios_read (adios_handle, "var_ushort", v6, adios_buf_size, adios_err)
+adios_buf_size = 4
+call adios_read (adios_handle, "var_uint", v7, adios_buf_size, adios_err)
+adios_buf_size = 8
+call adios_read (adios_handle, "var_ulong", v8, adios_buf_size, adios_err)
+adios_buf_size = 4
+call adios_read (adios_handle, "var_real", v9, adios_buf_size, adios_err)
+adios_buf_size = 8
+call adios_read (adios_handle, "var_double", v10, adios_buf_size, adios_err)
+adios_buf_size = len(v11)
+call adios_read (adios_handle, "var_string", v11, adios_buf_size, adios_err)
+adios_buf_size = 8
+call adios_read (adios_handle, "var_complex", v12, adios_buf_size, adios_err)
+adios_buf_size = 16
+call adios_read (adios_handle, "var_double_complex", v13, adios_buf_size, adios_err)
diff --git a/examples/Fortran/scalars/gwrite_scalars.fh b/examples/Fortran/scalars/gwrite_scalars.fh
new file mode 100644
index 0000000..00f1762
--- /dev/null
+++ b/examples/Fortran/scalars/gwrite_scalars.fh
@@ -0,0 +1,27 @@
+adios_groupsize = 1 &
+                + 2 &
+                + 4 &
+                + 8 &
+                + 1 &
+                + 2 &
+                + 4 &
+                + 8 &
+                + 4 &
+                + 8 &
+                + len_trim(v11) &
+                + 8 &
+                + 16
+call adios_group_size (adios_handle, adios_groupsize, adios_totalsize, adios_err)
+call adios_write (adios_handle, "var_byte", v1, adios_err)
+call adios_write (adios_handle, "var_short", v2, adios_err)
+call adios_write (adios_handle, "var_int", v3, adios_err)
+call adios_write (adios_handle, "var_long", v4, adios_err)
+call adios_write (adios_handle, "var_ubyte", v5, adios_err)
+call adios_write (adios_handle, "var_ushort", v6, adios_err)
+call adios_write (adios_handle, "var_uint", v7, adios_err)
+call adios_write (adios_handle, "var_ulong", v8, adios_err)
+call adios_write (adios_handle, "var_real", v9, adios_err)
+call adios_write (adios_handle, "var_double", v10, adios_err)
+call adios_write (adios_handle, "var_string", v11, adios_err)
+call adios_write (adios_handle, "var_complex", v12, adios_err)
+call adios_write (adios_handle, "var_double_complex", v13, adios_err)
diff --git a/examples/Fortran/scalars/job.pbs b/examples/Fortran/scalars/job.pbs
new file mode 100644
index 0000000..869d703
--- /dev/null
+++ b/examples/Fortran/scalars/job.pbs
@@ -0,0 +1,7 @@
+#!/bin/sh
+#PBS -N test
+#PBS -j oe
+#PBS -l walltime=00:05:00,nodes=3:ppn=2
+
+cd $PBS_O_WORKDIR
+mpirun -np 6 ./adios_types >& result.dat
diff --git a/examples/Fortran/scalars/scalars.xml b/examples/Fortran/scalars/scalars.xml
new file mode 100644
index 0000000..f7a70bf
--- /dev/null
+++ b/examples/Fortran/scalars/scalars.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<adios-config host-language="Fortran">
+
+    <adios-group name="scalars" coordination-communicator="comm">
+        <!-- name    defines the variable name in the output file
+             gwrite  defines the variable name in the code to write out
+             gread   defines the variable name in the code to read the value into
+             gwrite and gread are optional
+        -->
+        <var name="var_byte"            gwrite="v1"  gread="v1"  type="byte"/>
+        <var name="var_short"           gwrite="v2"  gread="v2"  type="short"/>
+        <var name="var_int"             gwrite="v3"  gread="v3"  type="integer"/>
+        <var name="var_long"            gwrite="v4"  gread="v4"  type="long"/>
+        <var name="var_ubyte"           gwrite="v5"  gread="v5"  type="unsigned byte"/>
+        <var name="var_ushort"          gwrite="v6"  gread="v6"  type="unsigned short"/>
+        <var name="var_uint"            gwrite="v7"  gread="v7"  type="unsigned integer"/>
+        <var name="var_ulong"           gwrite="v8"  gread="v8"  type="unsigned long"/>
+        <var name="var_real"            gwrite="v9"  gread="v9"  type="real"/>
+        <var name="var_double"          gwrite="v10" gread="v10" type="double"/>
+        <var name="var_string"          gwrite="v11" gread="v11" type="string"/>
+        <var name="var_complex"         gwrite="v12" gread="v12" type="complex"/>
+        <var name="var_double_complex"  gwrite="v13" gread="v13" type="double complex"/>
+    </adios-group>
+
+<method group="scalars" method="MPI"/>
+
+<buffer size-MB="20" allocate-time="now"/>
+
+</adios-config>
+
diff --git a/examples/Fortran/scalars/scalars_read.F90 b/examples/Fortran/scalars/scalars_read.F90
new file mode 100644
index 0000000..34474a8
--- /dev/null
+++ b/examples/Fortran/scalars/scalars_read.F90
@@ -0,0 +1,80 @@
+!  
+!  ADIOS is freely available under the terms of the BSD license described
+!  in the COPYING file in the top level directory of this source distribution.
+!
+!  Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+!
+
+!/*************************************************************/
+!/*   Example of reading various types of variable in ADIOS   */
+!/*************************************************************/
+program scalars_read
+    implicit none
+    include 'mpif.h'
+
+    character(len=25)   :: filename = "scalars.bp"
+    integer             :: rank, size, i, ierr
+    integer             :: comm
+
+    ! ADIOS variables declarations for matching gread_scalars.fh 
+    integer                 :: adios_err
+    integer*8               :: adios_groupsize, adios_totalsize
+    integer*8               :: adios_handle, adios_buf_size
+
+    ! scalar variables to write out (including a string)
+    integer*1           :: v1 = 0
+    integer*2           :: v2 = 0
+    integer*4           :: v3 = 0
+    integer*8           :: v4 = 0
+
+    integer*1           :: v5 = 0
+    integer*2           :: v6 = 0
+    integer*4           :: v7 = 0
+    integer*8           :: v8 = 0
+
+    real*4              :: v9 = 0.0
+    real*8              :: v10 = 0.0
+
+    character(len=20)   :: v11 = "undefined"
+
+    complex*8           :: v12 = (0.0, 0.0)
+    complex*16          :: v13 = (0.0, 0.0)
+
+    call MPI_Init (ierr)
+    call MPI_Comm_dup (MPI_COMM_WORLD, comm, ierr)
+    call MPI_Comm_rank (comm, rank, ierr)
+    call MPI_Comm_size (comm, size, ierr);
+
+    call adios_init ("scalars.xml", adios_err);
+    call adios_open (adios_handle, "scalars", filename, "r", comm, adios_err);
+#include "gread_scalars.fh"
+    call adios_close (adios_handle, adios_err)
+
+    call MPI_Barrier (comm, ierr);
+
+    call adios_finalize (rank, adios_err);
+
+    call MPI_Finalize (ierr);
+
+    if (rank == 0) then
+        write (*, '("int*1      v1  = ",i3)') v1
+        write (*, '("int*2      v2  = ",i3)') v2
+        write (*, '("int*4      v3  = ",i3)') v3
+        write (*, '("int*8      v4  = ",i3)') v4
+
+        write (*, '("int*1      v5  = ",i3)') v5
+        write (*, '("int*2      v6  = ",i3)') v6
+        write (*, '("int*4      v7  = ",i3)') v7
+        write (*, '("int*8      v8  = ",i3)') v8
+
+        write (*, '("real*4     v9  = ",f6.2)') v9
+        write (*, '("real*8     v10 = ",f6.2)') v10
+
+        write (*, '("string     v11 = ",a)') trim(v11)
+
+        write (*, '("complex*8  v12 = (",f6.2,", ", f6.2,")")') v12
+        write (*, '("complex*16 v13 = (",f6.2,", ", f6.2,")")') v13
+    endif
+
+end program
+
diff --git a/examples/Fortran/scalars/scalars_write.F90 b/examples/Fortran/scalars/scalars_write.F90
new file mode 100644
index 0000000..14165c6
--- /dev/null
+++ b/examples/Fortran/scalars/scalars_write.F90
@@ -0,0 +1,61 @@
+!  
+!  ADIOS is freely available under the terms of the BSD license described
+!  in the COPYING file in the top level directory of this source distribution.
+!
+!  Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+!
+
+!/*************************************************************/
+!/*   Example of writing various types of variable in ADIOS   */
+!/*************************************************************/
+program scalars
+    implicit none
+    include 'mpif.h'
+
+    character(len=25)   :: filename = "scalars.bp"
+    integer             :: rank, size, i, ierr
+    integer             :: comm
+
+    ! ADIOS variables declarations for matching gwrite_scalars.fh 
+    integer                 :: adios_err
+    integer*8               :: adios_groupsize, adios_totalsize
+    integer*8               :: adios_handle
+
+    ! scalar variables to write out (including a string)
+    integer*1           :: v1 = -4
+    integer*2           :: v2 = -3
+    integer*4           :: v3 = -2
+    integer*8           :: v4 = -1
+
+    integer*1           :: v5 = 1
+    integer*2           :: v6 = 2
+    integer*4           :: v7 = 3
+    integer*8           :: v8 = 4
+
+    real*4              :: v9 = 5.0
+    real*8              :: v10 = 6.0
+
+    character(len=20)   :: v11 = "ADIOS example"
+
+    complex*8           :: v12 = (8.0, 9.0)
+    complex*16          :: v13 = (10.0, 11.0)
+
+    call MPI_Init (ierr)
+    call MPI_Comm_dup (MPI_COMM_WORLD, comm, ierr)
+    call MPI_Comm_rank (comm, rank, ierr)
+    call MPI_Comm_size (comm, size, ierr);
+
+    call adios_init ("scalars.xml", adios_err);
+    ! adios_open() opens a 'group in a file', here the 'scalars' group
+    call adios_open (adios_handle, "scalars", filename, "w", comm, adios_err);
+#include "gwrite_scalars.fh"
+    call adios_close (adios_handle, adios_err)
+
+    call MPI_Barrier (comm, ierr);
+
+    call adios_finalize (rank, adios_err);
+
+    call MPI_Finalize (ierr);
+
+end program
+
diff --git a/examples/Makefile.am b/examples/Makefile.am
new file mode 100644
index 0000000..e2d5903
--- /dev/null
+++ b/examples/Makefile.am
@@ -0,0 +1,7 @@
+if BUILD_WRITE
+CSUBDIRS=C
+if BUILD_FORTRAN
+FSUBDIRS=Fortran
+endif
+endif
+SUBDIRS=$(CSUBDIRS) $(FSUBDIRS)
diff --git a/examples/Makefile.in b/examples/Makefile.in
new file mode 100644
index 0000000..ac06d3a
--- /dev/null
+++ b/examples/Makefile.in
@@ -0,0 +1,601 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = examples
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = C Fortran
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+ at BUILD_WRITE_TRUE@CSUBDIRS = C
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE at FSUBDIRS = Fortran
+SUBDIRS = $(CSUBDIRS) $(FSUBDIRS)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  examples/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  examples/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/runconf b/runconf
new file mode 100755
index 0000000..27520cd
--- /dev/null
+++ b/runconf
@@ -0,0 +1,300 @@
+#!/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
+#
+
+if [ `hostname | cut -c 1-4` == "ewok" ]; then
+
+    ########
+    # Ewok #
+    ########
+    echo "Configure on EWOK"
+    source /etc/profile.d/modules.sh
+    module unload hdf5
+    module unload netcdf
+    module unload PE-gnu
+    module unload PE-pgi
+    module unload PE-pathscale
+    module unload pgi
+    TARGET=pgi
+    module load PE-$TARGET
+    # Use both seq hdf5 (for utils) and 
+    #   parallel hdf5 (for PHDF5 method)
+    module load hdf5/1.8.2
+    SEQ_HDF5_DIR=$HDF5_DIR
+    SEQ_HDF5_CLIB=$HDF5_CLIB
+    module unload hdf5
+    module load hdf5/1.8.2_par
+    PAR_HDF5_DIR=$HDF5_DIR
+    PAR_HDF5_CLIB=$HDF5_CLIB
+    module unload hdf5
+    # Seq NetCDF 3 for bp2ncd
+    module load netcdf/3.6.2
+    export MPICC=mpicc
+    export MPICXX=mpiCC
+    export MPIFC=mpif90
+    if [ "$TARGET" == "pgi" ]; then
+        export CC=pgcc
+        export CXX=pgCC
+        export FC=pgf90
+        module swap pgi pgi/10.5
+    elif [ "$TARGET" == "gnu" ]; then
+        export CC=gcc
+        export CXX=g++
+        export FC=gfortran
+    else
+        echo "TARGET must be pgi or gnu"
+        exit 1
+    fi
+        
+    export CFLAGS="-g -fPIC" 
+    ./configure --prefix=/ccs/proj/e2e/pnorbert/ADIOS/ewok.$TARGET \
+        --enable-dependency-tracking \
+        --with-mxml=/ccs/proj/e2e/pnorbert/mxml \
+        --enable-research-transports  \
+        --without-datatap \
+        --with-hdf5=${SEQ_HDF5_DIR} \
+        --with-hdf5-libs="${SEQ_HDF5_CLIB}" \
+        --with-phdf5=${PAR_HDF5_DIR} \
+        --with-phdf5-libs="${PAR_HDF5_CLIB}"
+        #--with-dmalloc=/ccs/proj/e2e/pnorbert/dmalloc.$TARGET 
+        #--with-datatap=/ccs/home/habbasi/work/ewok/
+        #--enable-datatap=ib
+
+
+elif [ `hostname | cut -c 1-6` == "jaguar" -o `hostname | cut -c 1-7` == "chester" ]; then
+
+    BUILD_STAGING=true
+    if [ $BUILD_STAGING == "false" ]; then
+    
+        ##########
+        # Jaguar #
+        ##########
+        echo "Configure on JAGUAR"
+        export CC=cc
+        #export CFLAGS="-Wall -g" 
+        export FC=ftn
+        export CXX=CC
+        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 xt-papi
+        TARGET=pgi
+        module load PrgEnv-$TARGET
+        #module load szip
+        #module load xt-papi
+        module load mxml
+        # use the two lines below for openmpi
+        #export CC=mpicc
+        #export FC=mpif90
+        CFLAGS="-g -fPIC" ./configure --prefix=/ccs/proj/e2e/pnorbert/ADIOS/xt5.gnu \
+            --enable-dependency-tracking \
+            --with-mxml=/ccs/proj/e2e/pnorbert/mxml.xt5.$TARGET \
+            --without-portals 
+#            --enable-research-transports \
+#            --with-netcdf=/opt/cray/netcdf/3.6.2/netcdf-${TARGET} \
+#            --with-nc4par=/opt/cray/netcdf-hdf5parallel/4.0.1.3/netcdf-hdf5parallel-$TARGET \
+#            --with-phdf5=/opt/cray/hdf5-parallel/1.8.4.1/hdf5-parallel-$TARGET \
+#            --with-hdf5=/sw/xt5/hdf5/1.8.2/cnl2.1_gnu7.2.3 \
+#            --with-hdf5=/sw/xt5/hdf5/1.8.2/cnl2.1_gnu4.2.0 \
+            
+    else 
+    
+        ##########
+        # Jaguar #
+        ##########
+        echo "Configure on JAGUAR including staging methods"
+        export CC=cc
+        export FC=ftn
+        export CXX=CC
+        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 unload xt-papi
+        #module unload xtpe-quadcore
+        TARGET=pgi
+        module load PrgEnv-$TARGET
+        if [ "$TARGET" == "pgi" ]; then
+            module swap pgi pgi/10.4.0
+            # NSSI needs -pgcpplibs flag 
+            export LDFLAGS="-pgcpplibs" 
+        elif [ "$TARGET" == "gnu" ]; then
+            # NSSI needs libstdc++
+            export EXTRA_LIBS="/opt/gcc/4.4.4/snos/lib64/libstdc++.a"
+        fi
+     
+        # NOTE hdf5-parallel module does not work with C++ compiler
+        #module load hdf5-parallel
+        #module load netcdf-hdf5parallel
+        module load szip
+        module load xt-papi
+        module load mxml
+        # use the two lines below for openmpi
+        #export CC=mpicc
+        #export FC=mpif90
+        export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK" 
+        export CFLAGS="-fPIC" 
+        ./configure --prefix=/ccs/proj/e2e/pnorbert/ADIOS/xt5.$TARGET \
+        --enable-dependency-tracking \
+        --with-portals \
+        --with-netcdf=/opt/cray/netcdf/3.6.2/netcdf-${TARGET} \
+        --with-hdf5=/sw/xt5/hdf5/1.8.2/cnl2.1_gnu4.2.0 \
+        --with-nc4par=/opt/cray/netcdf-hdf5parallel/4.0.1.3/netcdf-hdf5parallel-$TARGET \
+        --with-phdf5=/opt/cray/hdf5-parallel/1.8.4.1/hdf5-parallel-$TARGET \
+        --with-datatap=/ccs/proj/e2e/pnorbert/datatap/xt5/$TARGET \
+        --with-nssi=/ccs/proj/e2e/pnorbert/nssi/xt5/$TARGET \
+        --with-dart=/ccs/proj/e2e/pnorbert/spaces/$TARGET \
+        --with-dimes=/ccs/proj/e2e/pnorbert/spaces/$TARGET
+    
+    fi
+    
+elif [ `hostname | cut -c 1-4` == "euge" ]; then
+    ###################
+    # Eugene BlueGene #
+    ###################
+    echo "Configure on Eugene (BlueGene)"
+    export MPICC=mpixlc_r
+    export MPIFC=mpixlf90
+    export CFLAGS="-g -O0"
+    export FC=xlf90
+    export CC=xlc_r
+
+    source /etc/profile.d/modules.sh
+    # NetCDF 3 for bp2ncd
+    module load netcdf/3.6.2-linux
+    # Seq HDF5 for bp2h5 
+    module load hdf5/1.8.1-linux
+    # HDF5_DIR is not defined by this hdf5 module so we do it here
+    HDF5_DIR=/sw/bgp/hdf5/1.8.1/sles10.1_xlc9.0xlf11.1
+
+    ./configure --prefix=/ccs/proj/e2e/pnorbert/ADIOS/eugene \
+            --enable-dependency-tracking \
+            --with-mxml=/ccs/proj/e2e/adios/bgp \
+            --with-hdf5=$HDF5_DIR \
+            --with-hdf5-libs="$HDF5_CLIB" \
+            --without-phdf5
+
+
+elif [ `hostname | cut -c 1-4` == "lens" ]; then
+
+    ########
+    # Lens #
+    ########
+    echo "Configure on LENS"
+    export CC=mpicc
+    export CXX=mpiCC
+    source /etc/profile.d/modules.sh
+    module load hdf5
+    #module load netcdf
+    CFLAGS="-fPIC" ./configure --prefix=/ccs/proj/e2e/pnorbert/adios/lens \
+        --enable-dependency-tracking \
+        --with-mxml=/ccs/proj/e2e/pnorbert/mxml \
+        --without-netcdf
+        #--with-hdf5=/sw/analysis-x64/hdf5/1.6.7/sl5.0_pgi7.1.5_ompi1.2.6 \
+        #--with-netcdf=/sw/analysis-x64/netcdf/3.6.2/sl5.0_pgi7.1.5
+    
+    
+elif [ `hostname | cut -c 1-4` == "nid0" ]; then
+    ############
+    # Franklin #
+    ############
+    echo "Configure on FRANKLIN"
+    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
+    if [ "${TARGET}" == "pgi" ]; then
+        module swap pgi pgi/10.5.0
+    fi
+    export LDFLAGS="-pgcpplibs"
+    export CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK"
+    export CFLAGS="-fPIC"
+    #./configure --prefix=/project/projectdirs/m499/adios \
+    ./configure --prefix=/global/homes/p/pnorbert/adios \
+        --enable-dependency-tracking \
+        --with-mxml=$HOME/mxml \
+        --with-hdf5=/opt/cray/hdf5/1.8.4.1/hdf5-${TARGET} \
+        --with-netcdf=/opt/cray/netcdf/3.6.2/netcdf-${TARGET} \
+        --with-phdf5=/opt/cray/hdf5-parallel/1.8.4.1/hdf5-parallel-${TARGET} \
+        --with-nc4par=/opt/cray/netcdf-hdf5parallel/4.0.1.3/netcdf-hdf5parallel-${TARGET} \
+        --with-dart=/global/homes/p/pnorbert/dataspaces
+    
+elif [ `hostname | cut -c 1-4` == "dyn9" -o `hostname | cut -c 1-3` == "pnb" ]; then
+
+    #######
+    # Mac #
+    #######
+    echo "Configure on Mac"
+    # Installed MacPorts and GCC4.4 and OpenMPI 1.4.2 ports 
+    # But should work with default openmpi and gcc, using --disable-fortran
+    export CC=/opt/local/bin/gcc-mp-4.4
+    export FC=/opt/local/bin/gfortran-mp-4.4
+    export CXX=/opt/local/bin/g++-mp-4.4
+    export MPICC=/opt/local/bin/openmpicc
+    export MPIFC=/opt/local/bin/openmpif90
+    export MPICXX=/opt/local/bin/openmpicxx
+    CFLAGS="-DO_LARGEFILE=0 -fno-common" ./configure --prefix=/opt/adios \
+        --with-mxml=/opt/mxml \
+        --with-netcdf=/opt/netcdf \
+        --with-phdf5=/opt/hdf5
+
+elif [ `hostname | cut -c 1-7` == "ubuntu" ]; then
+
+    #########################
+    # Scott's ubuntu laptop #
+    #########################
+    echo "Configure on UBUNTU"
+    export CC=mpicc
+    ./configure --prefix=/usr/local/adios \
+        --enable-dependency-tracking \
+        --with-mxml=/usr/local/adios 
+        #--with-hdf5=/usr/local/hdf5-serial\
+        #--with-phdf5=/usr/local \
+        #--with-netcdf=/usr 
+
+elif [ `hostname | cut -c 1-6` == "tomato" ]; then
+
+    #########################
+    # Todd's ubuntu laptop #
+    #########################
+    echo "Configure on UBUNTU"
+    export CC=mpicc
+    ./configure --prefix=/home/thkorde/local \
+        --enable-dependency-tracking \
+        --with-mxml=/home/thkorde/local \
+        --with-phdf5=/home/thkorde/local \
+        --with-hdf5=/home/thkorde/local \
+        --with-netcdf=/home/thkorde/local
+
+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
+    
+    
+    
diff --git a/scripts/create.nssi.config.sh b/scripts/create.nssi.config.sh
new file mode 100755
index 0000000..198d4a7
--- /dev/null
+++ b/scripts/create.nssi.config.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+CONFIG_FILE=$1 ; shift
+SERVER_CONTACT_INFO=$1 ; shift
+
+CONFIG_FRAG=/tmp/config.frag.$PBS_JOBID
+
+cat >$CONFIG_FRAG<<HERE
+<?xml version="1.0"?>
+<nssi-config>
+  <staging-group write-type="WRITE_DIRECT">
+HERE
+
+SVC_LIST=`cat ${SERVER_CONTACT_INFO} | awk '{ ML=$0" "ML } END { print ML }'`
+for SVC in $SVC_LIST; do
+SVC_NID=`echo $SVC | sed -e 's/\(.*\)@\(.*\)@\(.*\)@\(.*\)/\1/'`
+SVC_PID=`echo $SVC | sed -e 's/\(.*\)@\(.*\)@\(.*\)@\(.*\)/\2/'`
+SVC_ADDR=`echo $SVC | sed -e 's/\(.*\)@\(.*\)@\(.*\)@\(.*\)/\3/'`
+SVC_PORT=`echo $SVC | sed -e 's/\(.*\)@\(.*\)@\(.*\)@\(.*\)/\4/'`
+cat>>$CONFIG_FRAG<<HERE
+    <staging-service nid="$SVC_NID" pid="$SVC_PID" hostname="$SVC_ADDR" port="$SVC_PORT" />
+HERE
+done
+
+cat >>$CONFIG_FRAG<<HERE
+  </staging-group>
+</nssi-config>
+HERE
+
+mv $CONFIG_FRAG $CONFIG_FILE
diff --git a/scripts/kill.nssi.staging.sh b/scripts/kill.nssi.staging.sh
new file mode 100755
index 0000000..b7010d4
--- /dev/null
+++ b/scripts/kill.nssi.staging.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+SERVER_CONTACT_INFO=$1 ; shift
+
+SVC_LIST=`head ${SERVER_CONTACT_INFO} | awk '{ ML=$0" "ML } END { print ML }'`
+for SVC in $SVC_LIST; do
+  SVC_NID=`echo $SVC | sed -e 's/\(.*\)@\(.*\)@\(.*\)@\(.*\)/\1/'`
+  SVC_PID=`echo $SVC | sed -e 's/\(.*\)@\(.*\)@\(.*\)@\(.*\)/\2/'`
+  SVC_ADDR=`echo $SVC | sed -e 's/\(.*\)@\(.*\)@\(.*\)@\(.*\)/\3/'`
+  SVC_PORT=`echo $SVC | sed -e 's/\(.*\)@\(.*\)@\(.*\)@\(.*\)/\4/'`
+  $ADIOS_DIR/nssi/bin/nssi-kill --server-nid="$SVC_NID" --server-pid="$SVC_PID"
+done
diff --git a/scripts/start.nssi.staging.sh b/scripts/start.nssi.staging.sh
new file mode 100755
index 0000000..09b8e7b
--- /dev/null
+++ b/scripts/start.nssi.staging.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+SERVICE_COUNT=$1 ; shift
+SERVICE_CONFIG_FILE=$1 ; shift
+
+rm $ADIOS_NSSI_CONTACT_INFO
+
+aprun -n $SERVICE_COUNT -N 1 $ADIOS_DIR/bin/nssi-staging-server $SERVICE_CONFIG_FILE
+
+while [ ! -s $ADIOS_NSSI_CONTACT_INFO ]
+  do
+  sleep 1
+done
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..0ddfcf5
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,331 @@
+INCLUDES=-I$(top_srcdir) 
+
+AUTOMAKE_OPTIONS = no-dependencies
+METASOURCES=AUTO
+
+bin_PROGRAMS=
+if HAVE_NSSI
+bin_PROGRAMS+=nssi-staging-server
+
+nssi_staging_server_SOURCES = nssi_staging_server.cpp aggregation.cpp
+nssi_staging_server_CFLAGS=$(ADIOSLIB_CFLAGS)
+nssi_staging_server_CPPFLAGS=$(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_CPPFLAGS) -DPTL_IFACE_CLIENT=CRAY_USER_NAL -DPTL_IFACE_SERVER=CRAY_USER_NAL
+nssi_staging_server_LDFLAGS = $(ADIOSLIB_LDFLAGS) 
+nssi_staging_server_LDADD = $(top_builddir)/src/libadios.a
+nssi_staging_server_LDADD += $(ADIOSLIB_LDADD) $(NSSI_SERVER_LIBS)
+
+endif # HAVE_NSSI
+
+include_HEADERS=
+lib_LIBRARIES=
+
+if BUILD_WRITE
+lib_LIBRARIES += libadios.a
+libadios_a_SOURCES = adios.c \
+                     common_adios.c \
+                     adios_transport_hooks.c \
+                     adios_mpi.c \
+                     adios_mpi_lustre.c \
+                     adios_mpi_amr.c \
+                     adios_posix.c \
+                     adios_posix1.c \
+                     adios_internals.c \
+                     adios_internals_mxml.c \
+                     buffer.c \
+                     adios_socket.c \
+                     adios_bp_v1.c  \
+                     adios_endianness.c \
+                     bp_utils.c \
+                     futils.c \
+                     adios_error.c \
+                     adios_read.c \
+                     adios_read_hooks.c \
+                     common_read.c \
+                     read_bp.c \
+                     globals.c
+if BUILD_FORTRAN
+lib_LIBRARIES += libadiosf.a
+libadiosf_a_SOURCES = adiosf.c \
+                     common_adios.c \
+                     adios_transport_hooks.c \
+                     adios_mpi.c \
+                     adios_mpi_lustre.c \
+                     adios_mpi_amr.c \
+                     adios_posix.c \
+                     adios_posix1.c \
+                     adios_internals.c \
+                     adios_internals_mxml.c \
+                     buffer.c \
+                     adios_socket.c \
+                     adios_bp_v1.c  \
+                     adios_endianness.c\
+                     futils.c \
+                     adios_error.c \
+                     bp_utils.c \
+                     adiosf_read.c \
+                     adios_read_hooks.c \
+                     common_read.c \
+                     read_bp.c \
+                     globals.c
+endif # BUILD_FORTRAN
+
+libadios_a_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_CPPFLAGS) # -DUSE_TIMERS
+libadios_a_CFLAGS = $(ADIOSLIB_CFLAGS) 
+libadiosf_a_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_CPPFLAGS)
+libadiosf_a_CFLAGS = $(ADIOSLIB_CFLAGS) 
+
+if HAVE_DART
+libadios_a_SOURCES += adios_dart.c read_dart.c
+if BUILD_FORTRAN
+libadiosf_a_SOURCES += adios_dart.c read_dart.c
+endif
+endif
+
+if HAVE_DIMES
+libadios_a_SOURCES += adios_dimes.c read_dimes.c
+if BUILD_FORTRAN
+libadiosf_a_SOURCES += adios_dimes.c read_dimes.c
+endif
+endif
+
+if HAVE_DATATAP
+libadios_a_SOURCES += adios_datatap.c
+if BUILD_FORTRAN
+libadiosf_a_SOURCES += adios_datatap.c
+endif
+endif 
+
+
+if HAVE_PHDF5
+libadios_a_SOURCES += adios_phdf5.c 
+PHDF5_CPPFLAGS += -DPHDF5 -DH5_USE_16_API 
+libadios_a_CPPFLAGS += $(PHDF5_CPPFLAGS)
+if BUILD_FORTRAN
+libadiosf_a_SOURCES += adios_phdf5.c 
+libadiosf_a_CPPFLAGS += $(PHDF5_CPPFLAGS)
+endif
+endif
+
+if HAVE_NC4PAR
+libadios_a_SOURCES += adios_nc4.c 
+if BUILD_FORTRAN
+libadiosf_a_SOURCES += adios_nc4.c 
+endif
+endif
+
+if HAVE_NSSI
+dist_libadios_a_SOURCES = adios_nssi_args.x
+nodist_libadios_a_SOURCES = adios_nssi_args.c adios_nssi_args.h
+libadios_a_SOURCES += adios_nssi_config.c adios_nssi.c adios_nssi_filter.c
+libadios_a_CPPFLAGS += -DPTL_IFACE_CLIENT=CRAY_USER_NAL -DPTL_IFACE_SERVER=CRAY_USER_NAL
+if BUILD_FORTRAN
+nodist_libadiosf_a_SOURCES = adios_nssi_args.c adios_nssi_args.h
+dist_libadiosf_a_SOURCES = adios_nssi_args.x
+libadiosf_a_SOURCES += adios_nssi_config.c adios_nssi.c adios_nssi_filter.c
+libadiosf_a_CPPFLAGS += -DPTL_IFACE_CLIENT=CRAY_USER_NAL -DPTL_IFACE_SERVER=CRAY_USER_NAL
+endif
+
+# The next line forces automake to build adios_nssi_args.[ch] before compiling adios_nssi_config.c
+# Note, the order of dist_*SOURCES and nodist_*SOURCES above should but does not solve this alone.
+adios_nssi_config.c: adios_nssi_args.c
+
+adios_nssi_args.h:  $(srcdir)/adios_nssi_args.x Makefile.am
+	rm -f $@
+#	@echo "#include <lwfs/lwfs_config.h>" >> $@
+#	@echo "#ifndef LWFS_HAVE_STRUCT_SOCKADDR_IN" >> $@
+#	@echo "#define LWFS_HAVE_STRUCT_SOCKADDR_IN" >> $@
+#	@echo "struct sockaddr_in { " >> $@
+#	@echo '  int a;' >> $@
+#	@echo '};' >> $@
+#	@echo '#endif' >> $@;
+	rpcgen -h $(srcdir)/adios_nssi_args.x >> $@
+
+adios_nssi_args.c: adios_nssi_args.h 
+	rm -f adios_nssi_args.c
+	rpcgen -c $(srcdir)/adios_nssi_args.x \
+		| grep -v "include \"\.\." > adios_nssi_args.c
+
+CLEANFILES = adios_nssi_args.c adios_nssi_args.h
+
+endif # HAVE_NSSI
+
+
+if RESEARCH_TRANSPORTS
+libadios_a_SOURCES += adios_mpi_stagger.c \
+                      adios_mpi_aggregate.c \
+                      adios_provenance.c \
+                      adios_mpi_cio.c \
+                      adios_mpi_stripe.c \
+                      adios_mpi_amr1.c \
+                      adios_adaptive.c 
+if BUILD_FORTRAN
+libadiosf_a_SOURCES += adios_mpi_stagger.c \
+                       adios_mpi_aggregate.c \
+                       adios_provenance.c \
+                       adios_mpi_cio.c \
+                       adios_mpi_stripe.c \
+                       adios_mpi_amr1.c \
+                       adios_adaptive.c 
+endif
+else
+libadios_a_CPPFLAGS += -DNO_RESEARCH_TRANSPORTS
+libadiosf_a_CPPFLAGS += -DNO_RESEARCH_TRANSPORTS
+endif  # RESEARCH_TRANSPORTS
+
+endif   # BUILD_WRITE
+
+include_HEADERS += adios.h \
+                   adios_types.h \
+                   adios_read.h \
+                   adios_read_hooks.h \
+                   mpidummy.h \
+                   io_timer.h
+
+lib_LIBRARIES += libadiosread.a
+libadiosread_a_SOURCES = adios_bp_v1.c \
+                      adios_endianness.c \
+                      bp_utils.c \
+                      futils.c \
+                      adios_error.c \
+                      adios_read.c \
+                      adios_read_hooks.c \
+                      common_read.c \
+                      read_bp.c \
+                      globals.c
+if HAVE_DART
+libadiosread_a_SOURCES += read_dart.c
+endif
+if HAVE_DIMES
+libadiosread_a_SOURCES += read_dimes.c
+endif
+libadiosread_a_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSREADLIB_CPPFLAGS)
+
+if BUILD_FORTRAN
+lib_LIBRARIES += libadiosreadf.a
+libadiosreadf_a_SOURCES = adios_bp_v1.c \
+                      adios_endianness.c \
+                      bp_utils.c \
+                      futils.c \
+                      adios_error.c \
+                      adiosf_read.c \
+                      adios_read_hooks.c \
+                      common_read.c \
+                      read_bp.c \
+                      globals.c
+                      
+if HAVE_DART
+libadiosreadf_a_SOURCES += read_dart.c
+endif
+if HAVE_DIMES
+libadiosreadf_a_SOURCES += read_dimes.c
+endif
+
+libadiosreadf_a_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSREADLIB_CPPFLAGS)
+
+# adiosf_read.mod is not really usable, 
+# so it is not used and installed right now
+#libadiosread_a_SOURCES += adiosf_read_mod.F90
+#include_HEADERS += adiosf_read.mod 
+endif
+
+lib_LIBRARIES += libadiosread_nompi.a
+libadiosread_nompi_a_SOURCES = mpidummy.c\
+                      adios_bp_v1.c \
+                      adios_endianness.c \
+                      bp_utils.c \
+                      futils.c \
+                      adios_error.c \
+                      adios_read.c \
+                      adios_read_hooks.c \
+                      common_read.c \
+                      read_bp.c \
+                      adios_internals.c \
+                      buffer.c \
+                      adios_transport_hooks.c \
+                      globals.c
+
+if HAVE_DART
+libadiosread_nompi_a_SOURCES += read_dart.c
+endif
+if HAVE_DIMES
+libadiosread_nompi_a_SOURCES += read_dimes.c
+endif
+# Note: utils/adios_lint needs to link with adios_internals_mxml.o which depends
+#       on adios_internals.c, buffer.c and adios_transport_hooks.c. 
+#       We put these objects in libadiosread_nompi
+#       so we do not need to make another _nompi lib just for adios_lint
+if BUILD_FORTRAN
+lib_LIBRARIES += libadiosreadf_nompi.a
+libadiosreadf_nompi_a_SOURCES = mpidummy.c\
+                                adios_bp_v1.c \
+                                adios_endianness.c \
+                                bp_utils.c \
+                                futils.c \
+                                adios_error.c \
+                                adiosf_read.c \
+                                adios_read_hooks.c \
+                                common_read.c \
+                                read_bp.c 
+if HAVE_DART
+libadiosreadf_nompi_a_SOURCES += read_dart.c
+endif
+if HAVE_DIMES
+libadiosreadf_nompi_a_SOURCES += read_dimes.c
+endif
+endif
+
+noinst_LIBRARIES = libadios_internal_nompi.a
+libadios_internal_nompi_a_SOURCES = mpidummy.c \
+                                    adios_bp_v1.c \
+                                    adios_endianness.c \
+                                    bp_utils.c \
+                                    adios_internals.c \
+                                    buffer.c \
+                                    adios_transport_hooks.c \
+                                    adios_error.c \
+                                    adios_internals_mxml.c
+
+
+libadiosread_nompi_a_CPPFLAGS = -D_NOMPI $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSREADLIB_CPPFLAGS)
+libadiosreadf_nompi_a_CPPFLAGS = -D_NOMPI $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSREADLIB_CPPFLAGS)
+libadios_internal_nompi_a_CPPFLAGS = -D_NOMPI $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_SEQ_CPPFLAGS)
+#Note: -DNOMPI chokes IBM's bgxlf compiler but it can pass -D_NOMPI. 
+
+if HAVE_DMALLOC
+libadiosread_a_CPPFLAGS += -DDMALLOC 
+libadiosread_nompi_a_CPPFLAGS += -DDMALLOC 
+#if BUILD_FORTRAN
+#libadiosreadf_a_CPPFLAGS += -DDMALLOC $(DMALLOC_CPPFLAGS)
+#libadiosreadf_nompi_a_CPPFLAGS += -DDMALLOC $(DMALLOC_CPPFLAGS)
+#endif
+endif
+
+CC=$(MPICC)
+CXX=$(MPICXX)
+
+
+#bin_PROGRAMS+=adios_flags
+#nodist_adios_flags_SOURCES = adios_flags.h 
+#adios_flags_SOURCES = adios_flags.c 
+#adios_flags.h:  
+#	rm -f $@
+#	@echo "#define ADIOS_CFLAGS \"$(libadios_a_CPPFLAGS)\"" >> $@
+#	@echo "#define ADIOS_LDFLAGS \"$(libadios_a_LDFLAGS)\"" >> $@
+#	@echo "#define ADIOSF_CFLAGS \"$(libadiosf_a_CPPFLAGS)\"" >> $@
+#	@echo "#define ADIOSF_LDFLAGS \"$(libadiosf_a_LDFLAGS)\"" >> $@
+#	@echo "#define ADIOSREAD_CFLAGS \"$(libadiosread_a_CPPFLAGS)\"" >> $@
+#	@echo "#define ADIOSREAD_LDFLAGS \"$(libadiosread_a_LDFLAGS)\"" >> $@
+#	@echo "#define ADIOSREADF_CFLAGS \"$(libadiosreadf_a_CPPFLAGS)\"" >> $@
+#	@echo "#define ADIOSREADF_LDFLAGS \"$(libadiosreadf_a_LDFLAGS)\"" >> $@
+#	@echo "#define ADIOSREAD_NOMPI_CFLAGS \"$(libadiosread_nompi_a_CPPFLAGS)\"" >> $@
+#	@echo "#define ADIOSREAD_NOMPI_LDFLAGS \"$(libadiosread_nompi_a_LDFLAGS)\"" >> $@
+#	@echo "#define ADIOSREADF_NOMPI_CFLAGS \"$(libadiosreadf_nompi_a_CPPFLAGS)\"" >> $@
+#	@echo "#define ADIOSREADF_NOMPI_LDFLAGS \"$(libadiosreadf_nompi_a_LDFLAGS)\"" >> $@
+#adios_flags.c: adios_flags.h
+
+
+EXTRA_DIST = adios_bp_v1.h adios_endianness.h adios_error.h \
+             adios_internals.h adios_internals_mxml.h \
+             adios_nssi_config.h adios_socket.h adios_transport_hooks.h aggregation.h \
+             bp_types.h bp_utils.h buffer.h common_adios.h common_read.h futils.h globals.h 
+
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644
index 0000000..e1f225a
--- /dev/null
+++ b/src/Makefile.in
@@ -0,0 +1,1994 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = $(am__EXEEXT_1)
+ at HAVE_NSSI_TRUE@am__append_1 = nssi-staging-server
+ at BUILD_WRITE_TRUE@am__append_2 = libadios.a
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE at am__append_3 = libadiosf.a
+ at BUILD_WRITE_TRUE@@HAVE_DART_TRUE at am__append_4 = adios_dart.c read_dart.c
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_DART_TRUE at am__append_5 = adios_dart.c read_dart.c
+ at BUILD_WRITE_TRUE@@HAVE_DIMES_TRUE at am__append_6 = adios_dimes.c read_dimes.c
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_DIMES_TRUE at am__append_7 = adios_dimes.c read_dimes.c
+ at BUILD_WRITE_TRUE@@HAVE_DATATAP_TRUE at am__append_8 = adios_datatap.c
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_DATATAP_TRUE at am__append_9 = adios_datatap.c
+ at BUILD_WRITE_TRUE@@HAVE_PHDF5_TRUE at am__append_10 = adios_phdf5.c 
+ at BUILD_WRITE_TRUE@@HAVE_PHDF5_TRUE at am__append_11 = -DPHDF5 -DH5_USE_16_API 
+ at BUILD_WRITE_TRUE@@HAVE_PHDF5_TRUE at am__append_12 = $(PHDF5_CPPFLAGS)
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_PHDF5_TRUE at am__append_13 = adios_phdf5.c 
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_PHDF5_TRUE at am__append_14 = $(PHDF5_CPPFLAGS)
+ at BUILD_WRITE_TRUE@@HAVE_NC4PAR_TRUE at am__append_15 = adios_nc4.c 
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_NC4PAR_TRUE at am__append_16 = adios_nc4.c 
+ at BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE at am__append_17 = adios_nssi_config.c adios_nssi.c adios_nssi_filter.c
+ at BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE at am__append_18 = -DPTL_IFACE_CLIENT=CRAY_USER_NAL -DPTL_IFACE_SERVER=CRAY_USER_NAL
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE at am__append_19 = adios_nssi_config.c adios_nssi.c adios_nssi_filter.c
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE at am__append_20 = -DPTL_IFACE_CLIENT=CRAY_USER_NAL -DPTL_IFACE_SERVER=CRAY_USER_NAL
+ at BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE at am__append_21 = adios_mpi_stagger.c \
+ at BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@                      adios_mpi_aggregate.c \
+ at BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@                      adios_provenance.c \
+ at BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@                      adios_mpi_cio.c \
+ at BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@                      adios_mpi_stripe.c \
+ at BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@                      adios_mpi_amr1.c \
+ at BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@                      adios_adaptive.c 
+
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE at am__append_22 = adios_mpi_stagger.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@                       adios_mpi_aggregate.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@                       adios_provenance.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@                       adios_mpi_cio.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@                       adios_mpi_stripe.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@                       adios_mpi_amr1.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@                       adios_adaptive.c 
+
+ at BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_FALSE at am__append_23 = -DNO_RESEARCH_TRANSPORTS
+ at BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_FALSE at am__append_24 = -DNO_RESEARCH_TRANSPORTS
+ at HAVE_DART_TRUE@am__append_25 = read_dart.c
+ at HAVE_DIMES_TRUE@am__append_26 = read_dimes.c
+ at BUILD_FORTRAN_TRUE@am__append_27 = libadiosreadf.a
+ at BUILD_FORTRAN_TRUE@@HAVE_DART_TRUE at am__append_28 = read_dart.c
+ at BUILD_FORTRAN_TRUE@@HAVE_DIMES_TRUE at am__append_29 = read_dimes.c
+ at HAVE_DART_TRUE@am__append_30 = read_dart.c
+ at HAVE_DIMES_TRUE@am__append_31 = read_dimes.c
+# Note: utils/adios_lint needs to link with adios_internals_mxml.o which depends
+#       on adios_internals.c, buffer.c and adios_transport_hooks.c. 
+#       We put these objects in libadiosread_nompi
+#       so we do not need to make another _nompi lib just for adios_lint
+ at BUILD_FORTRAN_TRUE@am__append_32 = libadiosreadf_nompi.a
+ at BUILD_FORTRAN_TRUE@@HAVE_DART_TRUE at am__append_33 = read_dart.c
+ at BUILD_FORTRAN_TRUE@@HAVE_DIMES_TRUE at am__append_34 = read_dimes.c
+#Note: -DNOMPI chokes IBM's bgxlf compiler but it can pass -D_NOMPI. 
+ at HAVE_DMALLOC_TRUE@am__append_35 = -DDMALLOC 
+ at HAVE_DMALLOC_TRUE@am__append_36 = -DDMALLOC 
+subdir = src
+DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
+	"$(DESTDIR)$(includedir)"
+libLIBRARIES_INSTALL = $(INSTALL_DATA)
+LIBRARIES = $(lib_LIBRARIES) $(noinst_LIBRARIES)
+ARFLAGS = cru
+libadios_a_AR = $(AR) $(ARFLAGS)
+libadios_a_LIBADD =
+am__libadios_a_SOURCES_DIST = adios.c common_adios.c \
+	adios_transport_hooks.c adios_mpi.c adios_mpi_lustre.c \
+	adios_mpi_amr.c adios_posix.c adios_posix1.c adios_internals.c \
+	adios_internals_mxml.c buffer.c adios_socket.c adios_bp_v1.c \
+	adios_endianness.c bp_utils.c futils.c adios_error.c \
+	adios_read.c adios_read_hooks.c common_read.c read_bp.c \
+	globals.c adios_dart.c read_dart.c adios_dimes.c read_dimes.c \
+	adios_datatap.c adios_phdf5.c adios_nc4.c adios_nssi_config.c \
+	adios_nssi.c adios_nssi_filter.c adios_mpi_stagger.c \
+	adios_mpi_aggregate.c adios_provenance.c adios_mpi_cio.c \
+	adios_mpi_stripe.c adios_mpi_amr1.c adios_adaptive.c
+ at BUILD_WRITE_TRUE@@HAVE_DART_TRUE at am__objects_1 = libadios_a-adios_dart.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@@HAVE_DART_TRUE@	libadios_a-read_dart.$(OBJEXT)
+ at BUILD_WRITE_TRUE@@HAVE_DIMES_TRUE at am__objects_2 = libadios_a-adios_dimes.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@@HAVE_DIMES_TRUE@	libadios_a-read_dimes.$(OBJEXT)
+ at BUILD_WRITE_TRUE@@HAVE_DATATAP_TRUE at am__objects_3 = libadios_a-adios_datatap.$(OBJEXT)
+ at BUILD_WRITE_TRUE@@HAVE_PHDF5_TRUE at am__objects_4 = libadios_a-adios_phdf5.$(OBJEXT)
+ at BUILD_WRITE_TRUE@@HAVE_NC4PAR_TRUE at am__objects_5 = libadios_a-adios_nc4.$(OBJEXT)
+ at BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE at am__objects_6 = libadios_a-adios_nssi_config.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE@	libadios_a-adios_nssi.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE@	libadios_a-adios_nssi_filter.$(OBJEXT)
+ at BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE at am__objects_7 = libadios_a-adios_mpi_stagger.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@	libadios_a-adios_mpi_aggregate.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@	libadios_a-adios_provenance.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@	libadios_a-adios_mpi_cio.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@	libadios_a-adios_mpi_stripe.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@	libadios_a-adios_mpi_amr1.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@	libadios_a-adios_adaptive.$(OBJEXT)
+ at BUILD_WRITE_TRUE@am_libadios_a_OBJECTS = libadios_a-adios.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-common_adios.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-adios_transport_hooks.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-adios_mpi.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-adios_mpi_lustre.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-adios_mpi_amr.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-adios_posix.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-adios_posix1.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-adios_internals.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-adios_internals_mxml.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-buffer.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-adios_socket.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-adios_bp_v1.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-adios_endianness.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-bp_utils.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-futils.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-adios_error.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-adios_read.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-adios_read_hooks.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-common_read.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-read_bp.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	libadios_a-globals.$(OBJEXT) \
+ at BUILD_WRITE_TRUE@	$(am__objects_1) $(am__objects_2) \
+ at BUILD_WRITE_TRUE@	$(am__objects_3) $(am__objects_4) \
+ at BUILD_WRITE_TRUE@	$(am__objects_5) $(am__objects_6) \
+ at BUILD_WRITE_TRUE@	$(am__objects_7)
+am__dist_libadios_a_SOURCES_DIST = adios_nssi_args.x
+dist_libadios_a_OBJECTS =
+ at BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE at nodist_libadios_a_OBJECTS = libadios_a-adios_nssi_args.$(OBJEXT)
+libadios_a_OBJECTS = $(am_libadios_a_OBJECTS) \
+	$(dist_libadios_a_OBJECTS) $(nodist_libadios_a_OBJECTS)
+libadios_internal_nompi_a_AR = $(AR) $(ARFLAGS)
+libadios_internal_nompi_a_LIBADD =
+am_libadios_internal_nompi_a_OBJECTS =  \
+	libadios_internal_nompi_a-mpidummy.$(OBJEXT) \
+	libadios_internal_nompi_a-adios_bp_v1.$(OBJEXT) \
+	libadios_internal_nompi_a-adios_endianness.$(OBJEXT) \
+	libadios_internal_nompi_a-bp_utils.$(OBJEXT) \
+	libadios_internal_nompi_a-adios_internals.$(OBJEXT) \
+	libadios_internal_nompi_a-buffer.$(OBJEXT) \
+	libadios_internal_nompi_a-adios_transport_hooks.$(OBJEXT) \
+	libadios_internal_nompi_a-adios_error.$(OBJEXT) \
+	libadios_internal_nompi_a-adios_internals_mxml.$(OBJEXT)
+libadios_internal_nompi_a_OBJECTS =  \
+	$(am_libadios_internal_nompi_a_OBJECTS)
+libadiosf_a_AR = $(AR) $(ARFLAGS)
+libadiosf_a_LIBADD =
+am__libadiosf_a_SOURCES_DIST = adiosf.c common_adios.c \
+	adios_transport_hooks.c adios_mpi.c adios_mpi_lustre.c \
+	adios_mpi_amr.c adios_posix.c adios_posix1.c adios_internals.c \
+	adios_internals_mxml.c buffer.c adios_socket.c adios_bp_v1.c \
+	adios_endianness.c futils.c adios_error.c bp_utils.c \
+	adiosf_read.c adios_read_hooks.c common_read.c read_bp.c \
+	globals.c adios_dart.c read_dart.c adios_dimes.c read_dimes.c \
+	adios_datatap.c adios_phdf5.c adios_nc4.c adios_nssi_config.c \
+	adios_nssi.c adios_nssi_filter.c adios_mpi_stagger.c \
+	adios_mpi_aggregate.c adios_provenance.c adios_mpi_cio.c \
+	adios_mpi_stripe.c adios_mpi_amr1.c adios_adaptive.c
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_DART_TRUE at am__objects_8 = libadiosf_a-adios_dart.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_DART_TRUE@	libadiosf_a-read_dart.$(OBJEXT)
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_DIMES_TRUE at am__objects_9 = libadiosf_a-adios_dimes.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_DIMES_TRUE@	libadiosf_a-read_dimes.$(OBJEXT)
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_DATATAP_TRUE at am__objects_10 = libadiosf_a-adios_datatap.$(OBJEXT)
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_PHDF5_TRUE at am__objects_11 = libadiosf_a-adios_phdf5.$(OBJEXT)
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_NC4PAR_TRUE at am__objects_12 = libadiosf_a-adios_nc4.$(OBJEXT)
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE at am__objects_13 = libadiosf_a-adios_nssi_config.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE@	libadiosf_a-adios_nssi.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE@	libadiosf_a-adios_nssi_filter.$(OBJEXT)
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE at am__objects_14 = libadiosf_a-adios_mpi_stagger.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@	libadiosf_a-adios_mpi_aggregate.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@	libadiosf_a-adios_provenance.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@	libadiosf_a-adios_mpi_cio.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@	libadiosf_a-adios_mpi_stripe.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@	libadiosf_a-adios_mpi_amr1.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@RESEARCH_TRANSPORTS_TRUE@	libadiosf_a-adios_adaptive.$(OBJEXT)
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE at am_libadiosf_a_OBJECTS = libadiosf_a-adiosf.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-common_adios.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-adios_transport_hooks.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-adios_mpi.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-adios_mpi_lustre.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-adios_mpi_amr.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-adios_posix.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-adios_posix1.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-adios_internals.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-adios_internals_mxml.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-buffer.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-adios_socket.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-adios_bp_v1.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-adios_endianness.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-futils.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-adios_error.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-bp_utils.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-adiosf_read.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-adios_read_hooks.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-common_read.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-read_bp.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	libadiosf_a-globals.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	$(am__objects_8) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	$(am__objects_9) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	$(am__objects_10) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	$(am__objects_11) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	$(am__objects_12) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	$(am__objects_13) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	$(am__objects_14)
+am__dist_libadiosf_a_SOURCES_DIST = adios_nssi_args.x
+dist_libadiosf_a_OBJECTS =
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE at nodist_libadiosf_a_OBJECTS = libadiosf_a-adios_nssi_args.$(OBJEXT)
+libadiosf_a_OBJECTS = $(am_libadiosf_a_OBJECTS) \
+	$(dist_libadiosf_a_OBJECTS) $(nodist_libadiosf_a_OBJECTS)
+libadiosread_a_AR = $(AR) $(ARFLAGS)
+libadiosread_a_LIBADD =
+am__libadiosread_a_SOURCES_DIST = adios_bp_v1.c adios_endianness.c \
+	bp_utils.c futils.c adios_error.c adios_read.c \
+	adios_read_hooks.c common_read.c read_bp.c globals.c \
+	read_dart.c read_dimes.c
+ at HAVE_DART_TRUE@am__objects_15 = libadiosread_a-read_dart.$(OBJEXT)
+ at HAVE_DIMES_TRUE@am__objects_16 = libadiosread_a-read_dimes.$(OBJEXT)
+am_libadiosread_a_OBJECTS = libadiosread_a-adios_bp_v1.$(OBJEXT) \
+	libadiosread_a-adios_endianness.$(OBJEXT) \
+	libadiosread_a-bp_utils.$(OBJEXT) \
+	libadiosread_a-futils.$(OBJEXT) \
+	libadiosread_a-adios_error.$(OBJEXT) \
+	libadiosread_a-adios_read.$(OBJEXT) \
+	libadiosread_a-adios_read_hooks.$(OBJEXT) \
+	libadiosread_a-common_read.$(OBJEXT) \
+	libadiosread_a-read_bp.$(OBJEXT) \
+	libadiosread_a-globals.$(OBJEXT) $(am__objects_15) \
+	$(am__objects_16)
+libadiosread_a_OBJECTS = $(am_libadiosread_a_OBJECTS)
+libadiosread_nompi_a_AR = $(AR) $(ARFLAGS)
+libadiosread_nompi_a_LIBADD =
+am__libadiosread_nompi_a_SOURCES_DIST = mpidummy.c adios_bp_v1.c \
+	adios_endianness.c bp_utils.c futils.c adios_error.c \
+	adios_read.c adios_read_hooks.c common_read.c read_bp.c \
+	adios_internals.c buffer.c adios_transport_hooks.c globals.c \
+	read_dart.c read_dimes.c
+ at HAVE_DART_TRUE@am__objects_17 =  \
+ at HAVE_DART_TRUE@	libadiosread_nompi_a-read_dart.$(OBJEXT)
+ at HAVE_DIMES_TRUE@am__objects_18 =  \
+ at HAVE_DIMES_TRUE@	libadiosread_nompi_a-read_dimes.$(OBJEXT)
+am_libadiosread_nompi_a_OBJECTS =  \
+	libadiosread_nompi_a-mpidummy.$(OBJEXT) \
+	libadiosread_nompi_a-adios_bp_v1.$(OBJEXT) \
+	libadiosread_nompi_a-adios_endianness.$(OBJEXT) \
+	libadiosread_nompi_a-bp_utils.$(OBJEXT) \
+	libadiosread_nompi_a-futils.$(OBJEXT) \
+	libadiosread_nompi_a-adios_error.$(OBJEXT) \
+	libadiosread_nompi_a-adios_read.$(OBJEXT) \
+	libadiosread_nompi_a-adios_read_hooks.$(OBJEXT) \
+	libadiosread_nompi_a-common_read.$(OBJEXT) \
+	libadiosread_nompi_a-read_bp.$(OBJEXT) \
+	libadiosread_nompi_a-adios_internals.$(OBJEXT) \
+	libadiosread_nompi_a-buffer.$(OBJEXT) \
+	libadiosread_nompi_a-adios_transport_hooks.$(OBJEXT) \
+	libadiosread_nompi_a-globals.$(OBJEXT) $(am__objects_17) \
+	$(am__objects_18)
+libadiosread_nompi_a_OBJECTS = $(am_libadiosread_nompi_a_OBJECTS)
+libadiosreadf_a_AR = $(AR) $(ARFLAGS)
+libadiosreadf_a_LIBADD =
+am__libadiosreadf_a_SOURCES_DIST = adios_bp_v1.c adios_endianness.c \
+	bp_utils.c futils.c adios_error.c adiosf_read.c \
+	adios_read_hooks.c common_read.c read_bp.c globals.c \
+	read_dart.c read_dimes.c
+ at BUILD_FORTRAN_TRUE@@HAVE_DART_TRUE at am__objects_19 = libadiosreadf_a-read_dart.$(OBJEXT)
+ at BUILD_FORTRAN_TRUE@@HAVE_DIMES_TRUE at am__objects_20 = libadiosreadf_a-read_dimes.$(OBJEXT)
+ at BUILD_FORTRAN_TRUE@am_libadiosreadf_a_OBJECTS =  \
+ at BUILD_FORTRAN_TRUE@	libadiosreadf_a-adios_bp_v1.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@	libadiosreadf_a-adios_endianness.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@	libadiosreadf_a-bp_utils.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@	libadiosreadf_a-futils.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@	libadiosreadf_a-adios_error.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@	libadiosreadf_a-adiosf_read.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@	libadiosreadf_a-adios_read_hooks.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@	libadiosreadf_a-common_read.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@	libadiosreadf_a-read_bp.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@	libadiosreadf_a-globals.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@	$(am__objects_19) $(am__objects_20)
+libadiosreadf_a_OBJECTS = $(am_libadiosreadf_a_OBJECTS)
+libadiosreadf_nompi_a_AR = $(AR) $(ARFLAGS)
+libadiosreadf_nompi_a_LIBADD =
+am__libadiosreadf_nompi_a_SOURCES_DIST = mpidummy.c adios_bp_v1.c \
+	adios_endianness.c bp_utils.c futils.c adios_error.c \
+	adiosf_read.c adios_read_hooks.c common_read.c read_bp.c \
+	read_dart.c read_dimes.c
+ at BUILD_FORTRAN_TRUE@@HAVE_DART_TRUE at am__objects_21 = libadiosreadf_nompi_a-read_dart.$(OBJEXT)
+ at BUILD_FORTRAN_TRUE@@HAVE_DIMES_TRUE at am__objects_22 = libadiosreadf_nompi_a-read_dimes.$(OBJEXT)
+ at BUILD_FORTRAN_TRUE@am_libadiosreadf_nompi_a_OBJECTS =  \
+ at BUILD_FORTRAN_TRUE@	libadiosreadf_nompi_a-mpidummy.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@	libadiosreadf_nompi_a-adios_bp_v1.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@	libadiosreadf_nompi_a-adios_endianness.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@	libadiosreadf_nompi_a-bp_utils.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@	libadiosreadf_nompi_a-futils.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@	libadiosreadf_nompi_a-adios_error.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@	libadiosreadf_nompi_a-adiosf_read.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@	libadiosreadf_nompi_a-adios_read_hooks.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@	libadiosreadf_nompi_a-common_read.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@	libadiosreadf_nompi_a-read_bp.$(OBJEXT) \
+ at BUILD_FORTRAN_TRUE@	$(am__objects_21) $(am__objects_22)
+libadiosreadf_nompi_a_OBJECTS = $(am_libadiosreadf_nompi_a_OBJECTS)
+ at HAVE_NSSI_TRUE@am__EXEEXT_1 = nssi-staging-server$(EXEEXT)
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am__nssi_staging_server_SOURCES_DIST = nssi_staging_server.cpp \
+	aggregation.cpp
+ at HAVE_NSSI_TRUE@am_nssi_staging_server_OBJECTS = nssi_staging_server-nssi_staging_server.$(OBJEXT) \
+ at HAVE_NSSI_TRUE@	nssi_staging_server-aggregation.$(OBJEXT)
+nssi_staging_server_OBJECTS = $(am_nssi_staging_server_OBJECTS)
+am__DEPENDENCIES_1 =
+ at HAVE_NSSI_TRUE@nssi_staging_server_DEPENDENCIES =  \
+ at HAVE_NSSI_TRUE@	$(top_builddir)/src/libadios.a \
+ at HAVE_NSSI_TRUE@	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libadios_a_SOURCES) $(dist_libadios_a_SOURCES) \
+	$(nodist_libadios_a_SOURCES) \
+	$(libadios_internal_nompi_a_SOURCES) $(libadiosf_a_SOURCES) \
+	$(dist_libadiosf_a_SOURCES) $(nodist_libadiosf_a_SOURCES) \
+	$(libadiosread_a_SOURCES) $(libadiosread_nompi_a_SOURCES) \
+	$(libadiosreadf_a_SOURCES) $(libadiosreadf_nompi_a_SOURCES) \
+	$(nssi_staging_server_SOURCES)
+DIST_SOURCES = $(am__libadios_a_SOURCES_DIST) \
+	$(am__dist_libadios_a_SOURCES_DIST) \
+	$(libadios_internal_nompi_a_SOURCES) \
+	$(am__libadiosf_a_SOURCES_DIST) \
+	$(am__dist_libadiosf_a_SOURCES_DIST) \
+	$(am__libadiosread_a_SOURCES_DIST) \
+	$(am__libadiosread_nompi_a_SOURCES_DIST) \
+	$(am__libadiosreadf_a_SOURCES_DIST) \
+	$(am__libadiosreadf_nompi_a_SOURCES_DIST) \
+	$(am__nssi_staging_server_SOURCES_DIST)
+includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+#if BUILD_FORTRAN
+#libadiosreadf_a_CPPFLAGS += -DDMALLOC $(DMALLOC_CPPFLAGS)
+#libadiosreadf_nompi_a_CPPFLAGS += -DDMALLOC $(DMALLOC_CPPFLAGS)
+#endif
+CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = $(MPICXX)
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@ $(am__append_11)
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = -I$(top_srcdir) 
+AUTOMAKE_OPTIONS = no-dependencies
+METASOURCES = AUTO
+ at HAVE_NSSI_TRUE@nssi_staging_server_SOURCES = nssi_staging_server.cpp aggregation.cpp
+ at HAVE_NSSI_TRUE@nssi_staging_server_CFLAGS = $(ADIOSLIB_CFLAGS)
+ at HAVE_NSSI_TRUE@nssi_staging_server_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_CPPFLAGS) -DPTL_IFACE_CLIENT=CRAY_USER_NAL -DPTL_IFACE_SERVER=CRAY_USER_NAL
+ at HAVE_NSSI_TRUE@nssi_staging_server_LDFLAGS = $(ADIOSLIB_LDFLAGS) 
+ at HAVE_NSSI_TRUE@nssi_staging_server_LDADD =  \
+ at HAVE_NSSI_TRUE@	$(top_builddir)/src/libadios.a \
+ at HAVE_NSSI_TRUE@	$(ADIOSLIB_LDADD) $(NSSI_SERVER_LIBS)
+include_HEADERS = adios.h adios_types.h adios_read.h \
+	adios_read_hooks.h mpidummy.h io_timer.h
+
+# adiosf_read.mod is not really usable, 
+# so it is not used and installed right now
+#libadiosread_a_SOURCES += adiosf_read_mod.F90
+#include_HEADERS += adiosf_read.mod 
+lib_LIBRARIES = $(am__append_2) $(am__append_3) libadiosread.a \
+	$(am__append_27) libadiosread_nompi.a $(am__append_32)
+ at BUILD_WRITE_TRUE@libadios_a_SOURCES = adios.c common_adios.c \
+ at BUILD_WRITE_TRUE@	adios_transport_hooks.c adios_mpi.c \
+ at BUILD_WRITE_TRUE@	adios_mpi_lustre.c adios_mpi_amr.c \
+ at BUILD_WRITE_TRUE@	adios_posix.c adios_posix1.c \
+ at BUILD_WRITE_TRUE@	adios_internals.c adios_internals_mxml.c \
+ at BUILD_WRITE_TRUE@	buffer.c adios_socket.c adios_bp_v1.c \
+ at BUILD_WRITE_TRUE@	adios_endianness.c bp_utils.c futils.c \
+ at BUILD_WRITE_TRUE@	adios_error.c adios_read.c \
+ at BUILD_WRITE_TRUE@	adios_read_hooks.c common_read.c read_bp.c \
+ at BUILD_WRITE_TRUE@	globals.c $(am__append_4) $(am__append_6) \
+ at BUILD_WRITE_TRUE@	$(am__append_8) $(am__append_10) \
+ at BUILD_WRITE_TRUE@	$(am__append_15) $(am__append_17) \
+ at BUILD_WRITE_TRUE@	$(am__append_21)
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE at libadiosf_a_SOURCES = adiosf.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	common_adios.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	adios_transport_hooks.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	adios_mpi.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	adios_mpi_lustre.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	adios_mpi_amr.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	adios_posix.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	adios_posix1.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	adios_internals.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	adios_internals_mxml.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	buffer.c adios_socket.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	adios_bp_v1.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	adios_endianness.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	futils.c adios_error.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	bp_utils.c adiosf_read.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	adios_read_hooks.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	common_read.c read_bp.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	globals.c \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	$(am__append_5) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	$(am__append_7) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	$(am__append_9) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	$(am__append_13) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	$(am__append_16) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	$(am__append_19) \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	$(am__append_22)
+ at BUILD_WRITE_TRUE@libadios_a_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) \
+ at BUILD_WRITE_TRUE@	$(ADIOSLIB_CPPFLAGS) $(am__append_12) \
+ at BUILD_WRITE_TRUE@	$(am__append_18) $(am__append_23)
+ at BUILD_WRITE_TRUE@libadios_a_CFLAGS = $(ADIOSLIB_CFLAGS) 
+ at BUILD_WRITE_TRUE@libadiosf_a_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) \
+ at BUILD_WRITE_TRUE@	$(ADIOSLIB_CPPFLAGS) $(am__append_14) \
+ at BUILD_WRITE_TRUE@	$(am__append_20) $(am__append_24)
+ at BUILD_WRITE_TRUE@libadiosf_a_CFLAGS = $(ADIOSLIB_CFLAGS) 
+ at BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE at dist_libadios_a_SOURCES = adios_nssi_args.x
+ at BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE at nodist_libadios_a_SOURCES = adios_nssi_args.c adios_nssi_args.h
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE at nodist_libadiosf_a_SOURCES = adios_nssi_args.c adios_nssi_args.h
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE at dist_libadiosf_a_SOURCES = adios_nssi_args.x
+ at BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE at CLEANFILES = adios_nssi_args.c adios_nssi_args.h
+libadiosread_a_SOURCES = adios_bp_v1.c adios_endianness.c bp_utils.c \
+	futils.c adios_error.c adios_read.c adios_read_hooks.c \
+	common_read.c read_bp.c globals.c $(am__append_25) \
+	$(am__append_26)
+libadiosread_a_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) \
+	$(ADIOSREADLIB_CPPFLAGS) $(am__append_35)
+ at BUILD_FORTRAN_TRUE@libadiosreadf_a_SOURCES = adios_bp_v1.c \
+ at BUILD_FORTRAN_TRUE@	adios_endianness.c bp_utils.c futils.c \
+ at BUILD_FORTRAN_TRUE@	adios_error.c adiosf_read.c \
+ at BUILD_FORTRAN_TRUE@	adios_read_hooks.c common_read.c read_bp.c \
+ at BUILD_FORTRAN_TRUE@	globals.c $(am__append_28) \
+ at BUILD_FORTRAN_TRUE@	$(am__append_29)
+ at BUILD_FORTRAN_TRUE@libadiosreadf_a_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSREADLIB_CPPFLAGS)
+libadiosread_nompi_a_SOURCES = mpidummy.c adios_bp_v1.c \
+	adios_endianness.c bp_utils.c futils.c adios_error.c \
+	adios_read.c adios_read_hooks.c common_read.c read_bp.c \
+	adios_internals.c buffer.c adios_transport_hooks.c globals.c \
+	$(am__append_30) $(am__append_31)
+ at BUILD_FORTRAN_TRUE@libadiosreadf_nompi_a_SOURCES = mpidummy.c \
+ at BUILD_FORTRAN_TRUE@	adios_bp_v1.c adios_endianness.c \
+ at BUILD_FORTRAN_TRUE@	bp_utils.c futils.c adios_error.c \
+ at BUILD_FORTRAN_TRUE@	adiosf_read.c adios_read_hooks.c \
+ at BUILD_FORTRAN_TRUE@	common_read.c read_bp.c $(am__append_33) \
+ at BUILD_FORTRAN_TRUE@	$(am__append_34)
+noinst_LIBRARIES = libadios_internal_nompi.a
+libadios_internal_nompi_a_SOURCES = mpidummy.c \
+                                    adios_bp_v1.c \
+                                    adios_endianness.c \
+                                    bp_utils.c \
+                                    adios_internals.c \
+                                    buffer.c \
+                                    adios_transport_hooks.c \
+                                    adios_error.c \
+                                    adios_internals_mxml.c
+
+libadiosread_nompi_a_CPPFLAGS = -D_NOMPI $(ADIOSLIB_EXTRA_CPPFLAGS) \
+	$(ADIOSREADLIB_CPPFLAGS) $(am__append_36)
+libadiosreadf_nompi_a_CPPFLAGS = -D_NOMPI $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSREADLIB_CPPFLAGS)
+libadios_internal_nompi_a_CPPFLAGS = -D_NOMPI $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_SEQ_CPPFLAGS)
+
+#bin_PROGRAMS+=adios_flags
+#nodist_adios_flags_SOURCES = adios_flags.h 
+#adios_flags_SOURCES = adios_flags.c 
+#adios_flags.h:  
+#	rm -f $@
+#	@echo "#define ADIOS_CFLAGS \"$(libadios_a_CPPFLAGS)\"" >> $@
+#	@echo "#define ADIOS_LDFLAGS \"$(libadios_a_LDFLAGS)\"" >> $@
+#	@echo "#define ADIOSF_CFLAGS \"$(libadiosf_a_CPPFLAGS)\"" >> $@
+#	@echo "#define ADIOSF_LDFLAGS \"$(libadiosf_a_LDFLAGS)\"" >> $@
+#	@echo "#define ADIOSREAD_CFLAGS \"$(libadiosread_a_CPPFLAGS)\"" >> $@
+#	@echo "#define ADIOSREAD_LDFLAGS \"$(libadiosread_a_LDFLAGS)\"" >> $@
+#	@echo "#define ADIOSREADF_CFLAGS \"$(libadiosreadf_a_CPPFLAGS)\"" >> $@
+#	@echo "#define ADIOSREADF_LDFLAGS \"$(libadiosreadf_a_LDFLAGS)\"" >> $@
+#	@echo "#define ADIOSREAD_NOMPI_CFLAGS \"$(libadiosread_nompi_a_CPPFLAGS)\"" >> $@
+#	@echo "#define ADIOSREAD_NOMPI_LDFLAGS \"$(libadiosread_nompi_a_LDFLAGS)\"" >> $@
+#	@echo "#define ADIOSREADF_NOMPI_CFLAGS \"$(libadiosreadf_nompi_a_CPPFLAGS)\"" >> $@
+#	@echo "#define ADIOSREADF_NOMPI_LDFLAGS \"$(libadiosreadf_nompi_a_LDFLAGS)\"" >> $@
+#adios_flags.c: adios_flags.h
+EXTRA_DIST = adios_bp_v1.h adios_endianness.h adios_error.h \
+             adios_internals.h adios_internals_mxml.h \
+             adios_nssi_config.h adios_socket.h adios_transport_hooks.h aggregation.h \
+             bp_types.h bp_utils.h buffer.h common_adios.h common_read.h futils.h globals.h 
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-libLIBRARIES: $(lib_LIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
+	@list='$(lib_LIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    f=$(am__strip_dir) \
+	    echo " $(libLIBRARIES_INSTALL) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+	    $(libLIBRARIES_INSTALL) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+	  else :; fi; \
+	done
+	@$(POST_INSTALL)
+	@list='$(lib_LIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    p=$(am__strip_dir) \
+	    echo " $(RANLIB) '$(DESTDIR)$(libdir)/$$p'"; \
+	    $(RANLIB) "$(DESTDIR)$(libdir)/$$p"; \
+	  else :; fi; \
+	done
+
+uninstall-libLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(lib_LIBRARIES)'; for p in $$list; do \
+	  p=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+	  rm -f "$(DESTDIR)$(libdir)/$$p"; \
+	done
+
+clean-libLIBRARIES:
+	-test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
+
+clean-noinstLIBRARIES:
+	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libadios.a: $(libadios_a_OBJECTS) $(libadios_a_DEPENDENCIES) 
+	-rm -f libadios.a
+	$(libadios_a_AR) libadios.a $(libadios_a_OBJECTS) $(libadios_a_LIBADD)
+	$(RANLIB) libadios.a
+libadios_internal_nompi.a: $(libadios_internal_nompi_a_OBJECTS) $(libadios_internal_nompi_a_DEPENDENCIES) 
+	-rm -f libadios_internal_nompi.a
+	$(libadios_internal_nompi_a_AR) libadios_internal_nompi.a $(libadios_internal_nompi_a_OBJECTS) $(libadios_internal_nompi_a_LIBADD)
+	$(RANLIB) libadios_internal_nompi.a
+libadiosf.a: $(libadiosf_a_OBJECTS) $(libadiosf_a_DEPENDENCIES) 
+	-rm -f libadiosf.a
+	$(libadiosf_a_AR) libadiosf.a $(libadiosf_a_OBJECTS) $(libadiosf_a_LIBADD)
+	$(RANLIB) libadiosf.a
+libadiosread.a: $(libadiosread_a_OBJECTS) $(libadiosread_a_DEPENDENCIES) 
+	-rm -f libadiosread.a
+	$(libadiosread_a_AR) libadiosread.a $(libadiosread_a_OBJECTS) $(libadiosread_a_LIBADD)
+	$(RANLIB) libadiosread.a
+libadiosread_nompi.a: $(libadiosread_nompi_a_OBJECTS) $(libadiosread_nompi_a_DEPENDENCIES) 
+	-rm -f libadiosread_nompi.a
+	$(libadiosread_nompi_a_AR) libadiosread_nompi.a $(libadiosread_nompi_a_OBJECTS) $(libadiosread_nompi_a_LIBADD)
+	$(RANLIB) libadiosread_nompi.a
+libadiosreadf.a: $(libadiosreadf_a_OBJECTS) $(libadiosreadf_a_DEPENDENCIES) 
+	-rm -f libadiosreadf.a
+	$(libadiosreadf_a_AR) libadiosreadf.a $(libadiosreadf_a_OBJECTS) $(libadiosreadf_a_LIBADD)
+	$(RANLIB) libadiosreadf.a
+libadiosreadf_nompi.a: $(libadiosreadf_nompi_a_OBJECTS) $(libadiosreadf_nompi_a_DEPENDENCIES) 
+	-rm -f libadiosreadf_nompi.a
+	$(libadiosreadf_nompi_a_AR) libadiosreadf_nompi.a $(libadiosreadf_nompi_a_OBJECTS) $(libadiosreadf_nompi_a_LIBADD)
+	$(RANLIB) libadiosreadf_nompi.a
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
+	done
+
+clean-binPROGRAMS:
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+nssi-staging-server$(EXEEXT): $(nssi_staging_server_OBJECTS) $(nssi_staging_server_DEPENDENCIES) 
+	@rm -f nssi-staging-server$(EXEEXT)
+	$(CXXLINK) $(nssi_staging_server_LDFLAGS) $(nssi_staging_server_OBJECTS) $(nssi_staging_server_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.c.o:
+	$(COMPILE) -c $<
+
+.c.obj:
+	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+	$(LTCOMPILE) -c -o $@ $<
+
+libadios_a-adios.o: adios.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios.o `test -f 'adios.c' || echo '$(srcdir)/'`adios.c
+
+libadios_a-adios.obj: adios.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios.obj `if test -f 'adios.c'; then $(CYGPATH_W) 'adios.c'; else $(CYGPATH_W) '$(srcdir)/adios.c'; fi`
+
+libadios_a-common_adios.o: common_adios.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-common_adios.o `test -f 'common_adios.c' || echo '$(srcdir)/'`common_adios.c
+
+libadios_a-common_adios.obj: common_adios.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-common_adios.obj `if test -f 'common_adios.c'; then $(CYGPATH_W) 'common_adios.c'; else $(CYGPATH_W) '$(srcdir)/common_adios.c'; fi`
+
+libadios_a-adios_transport_hooks.o: adios_transport_hooks.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_transport_hooks.o `test -f 'adios_transport_hooks.c' || echo '$(srcdir)/'`adios_transport_hooks.c
+
+libadios_a-adios_transport_hooks.obj: adios_transport_hooks.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_transport_hooks.obj `if test -f 'adios_transport_hooks.c'; then $(CYGPATH_W) 'adios_transport_hooks.c'; else $(CYGPATH_W) '$(srcdir)/adios_transport_hooks.c'; fi`
+
+libadios_a-adios_mpi.o: adios_mpi.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_mpi.o `test -f 'adios_mpi.c' || echo '$(srcdir)/'`adios_mpi.c
+
+libadios_a-adios_mpi.obj: adios_mpi.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_mpi.obj `if test -f 'adios_mpi.c'; then $(CYGPATH_W) 'adios_mpi.c'; else $(CYGPATH_W) '$(srcdir)/adios_mpi.c'; fi`
+
+libadios_a-adios_mpi_lustre.o: adios_mpi_lustre.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_mpi_lustre.o `test -f 'adios_mpi_lustre.c' || echo '$(srcdir)/'`adios_mpi_lustre.c
+
+libadios_a-adios_mpi_lustre.obj: adios_mpi_lustre.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_mpi_lustre.obj `if test -f 'adios_mpi_lustre.c'; then $(CYGPATH_W) 'adios_mpi_lustre.c'; else $(CYGPATH_W) '$(srcdir)/adios_mpi_lustre.c'; fi`
+
+libadios_a-adios_mpi_amr.o: adios_mpi_amr.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_mpi_amr.o `test -f 'adios_mpi_amr.c' || echo '$(srcdir)/'`adios_mpi_amr.c
+
+libadios_a-adios_mpi_amr.obj: adios_mpi_amr.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_mpi_amr.obj `if test -f 'adios_mpi_amr.c'; then $(CYGPATH_W) 'adios_mpi_amr.c'; else $(CYGPATH_W) '$(srcdir)/adios_mpi_amr.c'; fi`
+
+libadios_a-adios_posix.o: adios_posix.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_posix.o `test -f 'adios_posix.c' || echo '$(srcdir)/'`adios_posix.c
+
+libadios_a-adios_posix.obj: adios_posix.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_posix.obj `if test -f 'adios_posix.c'; then $(CYGPATH_W) 'adios_posix.c'; else $(CYGPATH_W) '$(srcdir)/adios_posix.c'; fi`
+
+libadios_a-adios_posix1.o: adios_posix1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_posix1.o `test -f 'adios_posix1.c' || echo '$(srcdir)/'`adios_posix1.c
+
+libadios_a-adios_posix1.obj: adios_posix1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_posix1.obj `if test -f 'adios_posix1.c'; then $(CYGPATH_W) 'adios_posix1.c'; else $(CYGPATH_W) '$(srcdir)/adios_posix1.c'; fi`
+
+libadios_a-adios_internals.o: adios_internals.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_internals.o `test -f 'adios_internals.c' || echo '$(srcdir)/'`adios_internals.c
+
+libadios_a-adios_internals.obj: adios_internals.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_internals.obj `if test -f 'adios_internals.c'; then $(CYGPATH_W) 'adios_internals.c'; else $(CYGPATH_W) '$(srcdir)/adios_internals.c'; fi`
+
+libadios_a-adios_internals_mxml.o: adios_internals_mxml.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_internals_mxml.o `test -f 'adios_internals_mxml.c' || echo '$(srcdir)/'`adios_internals_mxml.c
+
+libadios_a-adios_internals_mxml.obj: adios_internals_mxml.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_internals_mxml.obj `if test -f 'adios_internals_mxml.c'; then $(CYGPATH_W) 'adios_internals_mxml.c'; else $(CYGPATH_W) '$(srcdir)/adios_internals_mxml.c'; fi`
+
+libadios_a-buffer.o: buffer.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-buffer.o `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c
+
+libadios_a-buffer.obj: buffer.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-buffer.obj `if test -f 'buffer.c'; then $(CYGPATH_W) 'buffer.c'; else $(CYGPATH_W) '$(srcdir)/buffer.c'; fi`
+
+libadios_a-adios_socket.o: adios_socket.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_socket.o `test -f 'adios_socket.c' || echo '$(srcdir)/'`adios_socket.c
+
+libadios_a-adios_socket.obj: adios_socket.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_socket.obj `if test -f 'adios_socket.c'; then $(CYGPATH_W) 'adios_socket.c'; else $(CYGPATH_W) '$(srcdir)/adios_socket.c'; fi`
+
+libadios_a-adios_bp_v1.o: adios_bp_v1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_bp_v1.o `test -f 'adios_bp_v1.c' || echo '$(srcdir)/'`adios_bp_v1.c
+
+libadios_a-adios_bp_v1.obj: adios_bp_v1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_bp_v1.obj `if test -f 'adios_bp_v1.c'; then $(CYGPATH_W) 'adios_bp_v1.c'; else $(CYGPATH_W) '$(srcdir)/adios_bp_v1.c'; fi`
+
+libadios_a-adios_endianness.o: adios_endianness.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_endianness.o `test -f 'adios_endianness.c' || echo '$(srcdir)/'`adios_endianness.c
+
+libadios_a-adios_endianness.obj: adios_endianness.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_endianness.obj `if test -f 'adios_endianness.c'; then $(CYGPATH_W) 'adios_endianness.c'; else $(CYGPATH_W) '$(srcdir)/adios_endianness.c'; fi`
+
+libadios_a-bp_utils.o: bp_utils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-bp_utils.o `test -f 'bp_utils.c' || echo '$(srcdir)/'`bp_utils.c
+
+libadios_a-bp_utils.obj: bp_utils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-bp_utils.obj `if test -f 'bp_utils.c'; then $(CYGPATH_W) 'bp_utils.c'; else $(CYGPATH_W) '$(srcdir)/bp_utils.c'; fi`
+
+libadios_a-futils.o: futils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-futils.o `test -f 'futils.c' || echo '$(srcdir)/'`futils.c
+
+libadios_a-futils.obj: futils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-futils.obj `if test -f 'futils.c'; then $(CYGPATH_W) 'futils.c'; else $(CYGPATH_W) '$(srcdir)/futils.c'; fi`
+
+libadios_a-adios_error.o: adios_error.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_error.o `test -f 'adios_error.c' || echo '$(srcdir)/'`adios_error.c
+
+libadios_a-adios_error.obj: adios_error.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_error.obj `if test -f 'adios_error.c'; then $(CYGPATH_W) 'adios_error.c'; else $(CYGPATH_W) '$(srcdir)/adios_error.c'; fi`
+
+libadios_a-adios_read.o: adios_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_read.o `test -f 'adios_read.c' || echo '$(srcdir)/'`adios_read.c
+
+libadios_a-adios_read.obj: adios_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_read.obj `if test -f 'adios_read.c'; then $(CYGPATH_W) 'adios_read.c'; else $(CYGPATH_W) '$(srcdir)/adios_read.c'; fi`
+
+libadios_a-adios_read_hooks.o: adios_read_hooks.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_read_hooks.o `test -f 'adios_read_hooks.c' || echo '$(srcdir)/'`adios_read_hooks.c
+
+libadios_a-adios_read_hooks.obj: adios_read_hooks.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_read_hooks.obj `if test -f 'adios_read_hooks.c'; then $(CYGPATH_W) 'adios_read_hooks.c'; else $(CYGPATH_W) '$(srcdir)/adios_read_hooks.c'; fi`
+
+libadios_a-common_read.o: common_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-common_read.o `test -f 'common_read.c' || echo '$(srcdir)/'`common_read.c
+
+libadios_a-common_read.obj: common_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-common_read.obj `if test -f 'common_read.c'; then $(CYGPATH_W) 'common_read.c'; else $(CYGPATH_W) '$(srcdir)/common_read.c'; fi`
+
+libadios_a-read_bp.o: read_bp.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-read_bp.o `test -f 'read_bp.c' || echo '$(srcdir)/'`read_bp.c
+
+libadios_a-read_bp.obj: read_bp.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-read_bp.obj `if test -f 'read_bp.c'; then $(CYGPATH_W) 'read_bp.c'; else $(CYGPATH_W) '$(srcdir)/read_bp.c'; fi`
+
+libadios_a-globals.o: globals.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-globals.o `test -f 'globals.c' || echo '$(srcdir)/'`globals.c
+
+libadios_a-globals.obj: globals.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-globals.obj `if test -f 'globals.c'; then $(CYGPATH_W) 'globals.c'; else $(CYGPATH_W) '$(srcdir)/globals.c'; fi`
+
+libadios_a-adios_dart.o: adios_dart.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_dart.o `test -f 'adios_dart.c' || echo '$(srcdir)/'`adios_dart.c
+
+libadios_a-adios_dart.obj: adios_dart.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_dart.obj `if test -f 'adios_dart.c'; then $(CYGPATH_W) 'adios_dart.c'; else $(CYGPATH_W) '$(srcdir)/adios_dart.c'; fi`
+
+libadios_a-read_dart.o: read_dart.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-read_dart.o `test -f 'read_dart.c' || echo '$(srcdir)/'`read_dart.c
+
+libadios_a-read_dart.obj: read_dart.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-read_dart.obj `if test -f 'read_dart.c'; then $(CYGPATH_W) 'read_dart.c'; else $(CYGPATH_W) '$(srcdir)/read_dart.c'; fi`
+
+libadios_a-adios_dimes.o: adios_dimes.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_dimes.o `test -f 'adios_dimes.c' || echo '$(srcdir)/'`adios_dimes.c
+
+libadios_a-adios_dimes.obj: adios_dimes.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_dimes.obj `if test -f 'adios_dimes.c'; then $(CYGPATH_W) 'adios_dimes.c'; else $(CYGPATH_W) '$(srcdir)/adios_dimes.c'; fi`
+
+libadios_a-read_dimes.o: read_dimes.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-read_dimes.o `test -f 'read_dimes.c' || echo '$(srcdir)/'`read_dimes.c
+
+libadios_a-read_dimes.obj: read_dimes.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-read_dimes.obj `if test -f 'read_dimes.c'; then $(CYGPATH_W) 'read_dimes.c'; else $(CYGPATH_W) '$(srcdir)/read_dimes.c'; fi`
+
+libadios_a-adios_datatap.o: adios_datatap.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_datatap.o `test -f 'adios_datatap.c' || echo '$(srcdir)/'`adios_datatap.c
+
+libadios_a-adios_datatap.obj: adios_datatap.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_datatap.obj `if test -f 'adios_datatap.c'; then $(CYGPATH_W) 'adios_datatap.c'; else $(CYGPATH_W) '$(srcdir)/adios_datatap.c'; fi`
+
+libadios_a-adios_phdf5.o: adios_phdf5.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_phdf5.o `test -f 'adios_phdf5.c' || echo '$(srcdir)/'`adios_phdf5.c
+
+libadios_a-adios_phdf5.obj: adios_phdf5.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_phdf5.obj `if test -f 'adios_phdf5.c'; then $(CYGPATH_W) 'adios_phdf5.c'; else $(CYGPATH_W) '$(srcdir)/adios_phdf5.c'; fi`
+
+libadios_a-adios_nc4.o: adios_nc4.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_nc4.o `test -f 'adios_nc4.c' || echo '$(srcdir)/'`adios_nc4.c
+
+libadios_a-adios_nc4.obj: adios_nc4.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_nc4.obj `if test -f 'adios_nc4.c'; then $(CYGPATH_W) 'adios_nc4.c'; else $(CYGPATH_W) '$(srcdir)/adios_nc4.c'; fi`
+
+libadios_a-adios_nssi_config.o: adios_nssi_config.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_nssi_config.o `test -f 'adios_nssi_config.c' || echo '$(srcdir)/'`adios_nssi_config.c
+
+libadios_a-adios_nssi_config.obj: adios_nssi_config.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_nssi_config.obj `if test -f 'adios_nssi_config.c'; then $(CYGPATH_W) 'adios_nssi_config.c'; else $(CYGPATH_W) '$(srcdir)/adios_nssi_config.c'; fi`
+
+libadios_a-adios_nssi.o: adios_nssi.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_nssi.o `test -f 'adios_nssi.c' || echo '$(srcdir)/'`adios_nssi.c
+
+libadios_a-adios_nssi.obj: adios_nssi.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_nssi.obj `if test -f 'adios_nssi.c'; then $(CYGPATH_W) 'adios_nssi.c'; else $(CYGPATH_W) '$(srcdir)/adios_nssi.c'; fi`
+
+libadios_a-adios_nssi_filter.o: adios_nssi_filter.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_nssi_filter.o `test -f 'adios_nssi_filter.c' || echo '$(srcdir)/'`adios_nssi_filter.c
+
+libadios_a-adios_nssi_filter.obj: adios_nssi_filter.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_nssi_filter.obj `if test -f 'adios_nssi_filter.c'; then $(CYGPATH_W) 'adios_nssi_filter.c'; else $(CYGPATH_W) '$(srcdir)/adios_nssi_filter.c'; fi`
+
+libadios_a-adios_mpi_stagger.o: adios_mpi_stagger.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_mpi_stagger.o `test -f 'adios_mpi_stagger.c' || echo '$(srcdir)/'`adios_mpi_stagger.c
+
+libadios_a-adios_mpi_stagger.obj: adios_mpi_stagger.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_mpi_stagger.obj `if test -f 'adios_mpi_stagger.c'; then $(CYGPATH_W) 'adios_mpi_stagger.c'; else $(CYGPATH_W) '$(srcdir)/adios_mpi_stagger.c'; fi`
+
+libadios_a-adios_mpi_aggregate.o: adios_mpi_aggregate.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_mpi_aggregate.o `test -f 'adios_mpi_aggregate.c' || echo '$(srcdir)/'`adios_mpi_aggregate.c
+
+libadios_a-adios_mpi_aggregate.obj: adios_mpi_aggregate.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_mpi_aggregate.obj `if test -f 'adios_mpi_aggregate.c'; then $(CYGPATH_W) 'adios_mpi_aggregate.c'; else $(CYGPATH_W) '$(srcdir)/adios_mpi_aggregate.c'; fi`
+
+libadios_a-adios_provenance.o: adios_provenance.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_provenance.o `test -f 'adios_provenance.c' || echo '$(srcdir)/'`adios_provenance.c
+
+libadios_a-adios_provenance.obj: adios_provenance.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_provenance.obj `if test -f 'adios_provenance.c'; then $(CYGPATH_W) 'adios_provenance.c'; else $(CYGPATH_W) '$(srcdir)/adios_provenance.c'; fi`
+
+libadios_a-adios_mpi_cio.o: adios_mpi_cio.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_mpi_cio.o `test -f 'adios_mpi_cio.c' || echo '$(srcdir)/'`adios_mpi_cio.c
+
+libadios_a-adios_mpi_cio.obj: adios_mpi_cio.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_mpi_cio.obj `if test -f 'adios_mpi_cio.c'; then $(CYGPATH_W) 'adios_mpi_cio.c'; else $(CYGPATH_W) '$(srcdir)/adios_mpi_cio.c'; fi`
+
+libadios_a-adios_mpi_stripe.o: adios_mpi_stripe.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_mpi_stripe.o `test -f 'adios_mpi_stripe.c' || echo '$(srcdir)/'`adios_mpi_stripe.c
+
+libadios_a-adios_mpi_stripe.obj: adios_mpi_stripe.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_mpi_stripe.obj `if test -f 'adios_mpi_stripe.c'; then $(CYGPATH_W) 'adios_mpi_stripe.c'; else $(CYGPATH_W) '$(srcdir)/adios_mpi_stripe.c'; fi`
+
+libadios_a-adios_mpi_amr1.o: adios_mpi_amr1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_mpi_amr1.o `test -f 'adios_mpi_amr1.c' || echo '$(srcdir)/'`adios_mpi_amr1.c
+
+libadios_a-adios_mpi_amr1.obj: adios_mpi_amr1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_mpi_amr1.obj `if test -f 'adios_mpi_amr1.c'; then $(CYGPATH_W) 'adios_mpi_amr1.c'; else $(CYGPATH_W) '$(srcdir)/adios_mpi_amr1.c'; fi`
+
+libadios_a-adios_adaptive.o: adios_adaptive.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_adaptive.o `test -f 'adios_adaptive.c' || echo '$(srcdir)/'`adios_adaptive.c
+
+libadios_a-adios_adaptive.obj: adios_adaptive.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_adaptive.obj `if test -f 'adios_adaptive.c'; then $(CYGPATH_W) 'adios_adaptive.c'; else $(CYGPATH_W) '$(srcdir)/adios_adaptive.c'; fi`
+
+libadios_a-adios_nssi_args.o: adios_nssi_args.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_nssi_args.o `test -f 'adios_nssi_args.c' || echo '$(srcdir)/'`adios_nssi_args.c
+
+libadios_a-adios_nssi_args.obj: adios_nssi_args.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_a_CPPFLAGS) $(CPPFLAGS) $(libadios_a_CFLAGS) $(CFLAGS) -c -o libadios_a-adios_nssi_args.obj `if test -f 'adios_nssi_args.c'; then $(CYGPATH_W) 'adios_nssi_args.c'; else $(CYGPATH_W) '$(srcdir)/adios_nssi_args.c'; fi`
+
+libadios_internal_nompi_a-mpidummy.o: mpidummy.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_internal_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadios_internal_nompi_a-mpidummy.o `test -f 'mpidummy.c' || echo '$(srcdir)/'`mpidummy.c
+
+libadios_internal_nompi_a-mpidummy.obj: mpidummy.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_internal_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadios_internal_nompi_a-mpidummy.obj `if test -f 'mpidummy.c'; then $(CYGPATH_W) 'mpidummy.c'; else $(CYGPATH_W) '$(srcdir)/mpidummy.c'; fi`
+
+libadios_internal_nompi_a-adios_bp_v1.o: adios_bp_v1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_internal_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadios_internal_nompi_a-adios_bp_v1.o `test -f 'adios_bp_v1.c' || echo '$(srcdir)/'`adios_bp_v1.c
+
+libadios_internal_nompi_a-adios_bp_v1.obj: adios_bp_v1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_internal_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadios_internal_nompi_a-adios_bp_v1.obj `if test -f 'adios_bp_v1.c'; then $(CYGPATH_W) 'adios_bp_v1.c'; else $(CYGPATH_W) '$(srcdir)/adios_bp_v1.c'; fi`
+
+libadios_internal_nompi_a-adios_endianness.o: adios_endianness.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_internal_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadios_internal_nompi_a-adios_endianness.o `test -f 'adios_endianness.c' || echo '$(srcdir)/'`adios_endianness.c
+
+libadios_internal_nompi_a-adios_endianness.obj: adios_endianness.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_internal_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadios_internal_nompi_a-adios_endianness.obj `if test -f 'adios_endianness.c'; then $(CYGPATH_W) 'adios_endianness.c'; else $(CYGPATH_W) '$(srcdir)/adios_endianness.c'; fi`
+
+libadios_internal_nompi_a-bp_utils.o: bp_utils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_internal_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadios_internal_nompi_a-bp_utils.o `test -f 'bp_utils.c' || echo '$(srcdir)/'`bp_utils.c
+
+libadios_internal_nompi_a-bp_utils.obj: bp_utils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_internal_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadios_internal_nompi_a-bp_utils.obj `if test -f 'bp_utils.c'; then $(CYGPATH_W) 'bp_utils.c'; else $(CYGPATH_W) '$(srcdir)/bp_utils.c'; fi`
+
+libadios_internal_nompi_a-adios_internals.o: adios_internals.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_internal_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadios_internal_nompi_a-adios_internals.o `test -f 'adios_internals.c' || echo '$(srcdir)/'`adios_internals.c
+
+libadios_internal_nompi_a-adios_internals.obj: adios_internals.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_internal_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadios_internal_nompi_a-adios_internals.obj `if test -f 'adios_internals.c'; then $(CYGPATH_W) 'adios_internals.c'; else $(CYGPATH_W) '$(srcdir)/adios_internals.c'; fi`
+
+libadios_internal_nompi_a-buffer.o: buffer.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_internal_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadios_internal_nompi_a-buffer.o `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c
+
+libadios_internal_nompi_a-buffer.obj: buffer.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_internal_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadios_internal_nompi_a-buffer.obj `if test -f 'buffer.c'; then $(CYGPATH_W) 'buffer.c'; else $(CYGPATH_W) '$(srcdir)/buffer.c'; fi`
+
+libadios_internal_nompi_a-adios_transport_hooks.o: adios_transport_hooks.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_internal_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadios_internal_nompi_a-adios_transport_hooks.o `test -f 'adios_transport_hooks.c' || echo '$(srcdir)/'`adios_transport_hooks.c
+
+libadios_internal_nompi_a-adios_transport_hooks.obj: adios_transport_hooks.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_internal_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadios_internal_nompi_a-adios_transport_hooks.obj `if test -f 'adios_transport_hooks.c'; then $(CYGPATH_W) 'adios_transport_hooks.c'; else $(CYGPATH_W) '$(srcdir)/adios_transport_hooks.c'; fi`
+
+libadios_internal_nompi_a-adios_error.o: adios_error.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_internal_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadios_internal_nompi_a-adios_error.o `test -f 'adios_error.c' || echo '$(srcdir)/'`adios_error.c
+
+libadios_internal_nompi_a-adios_error.obj: adios_error.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_internal_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadios_internal_nompi_a-adios_error.obj `if test -f 'adios_error.c'; then $(CYGPATH_W) 'adios_error.c'; else $(CYGPATH_W) '$(srcdir)/adios_error.c'; fi`
+
+libadios_internal_nompi_a-adios_internals_mxml.o: adios_internals_mxml.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_internal_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadios_internal_nompi_a-adios_internals_mxml.o `test -f 'adios_internals_mxml.c' || echo '$(srcdir)/'`adios_internals_mxml.c
+
+libadios_internal_nompi_a-adios_internals_mxml.obj: adios_internals_mxml.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadios_internal_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadios_internal_nompi_a-adios_internals_mxml.obj `if test -f 'adios_internals_mxml.c'; then $(CYGPATH_W) 'adios_internals_mxml.c'; else $(CYGPATH_W) '$(srcdir)/adios_internals_mxml.c'; fi`
+
+libadiosf_a-adiosf.o: adiosf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adiosf.o `test -f 'adiosf.c' || echo '$(srcdir)/'`adiosf.c
+
+libadiosf_a-adiosf.obj: adiosf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adiosf.obj `if test -f 'adiosf.c'; then $(CYGPATH_W) 'adiosf.c'; else $(CYGPATH_W) '$(srcdir)/adiosf.c'; fi`
+
+libadiosf_a-common_adios.o: common_adios.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-common_adios.o `test -f 'common_adios.c' || echo '$(srcdir)/'`common_adios.c
+
+libadiosf_a-common_adios.obj: common_adios.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-common_adios.obj `if test -f 'common_adios.c'; then $(CYGPATH_W) 'common_adios.c'; else $(CYGPATH_W) '$(srcdir)/common_adios.c'; fi`
+
+libadiosf_a-adios_transport_hooks.o: adios_transport_hooks.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_transport_hooks.o `test -f 'adios_transport_hooks.c' || echo '$(srcdir)/'`adios_transport_hooks.c
+
+libadiosf_a-adios_transport_hooks.obj: adios_transport_hooks.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_transport_hooks.obj `if test -f 'adios_transport_hooks.c'; then $(CYGPATH_W) 'adios_transport_hooks.c'; else $(CYGPATH_W) '$(srcdir)/adios_transport_hooks.c'; fi`
+
+libadiosf_a-adios_mpi.o: adios_mpi.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_mpi.o `test -f 'adios_mpi.c' || echo '$(srcdir)/'`adios_mpi.c
+
+libadiosf_a-adios_mpi.obj: adios_mpi.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_mpi.obj `if test -f 'adios_mpi.c'; then $(CYGPATH_W) 'adios_mpi.c'; else $(CYGPATH_W) '$(srcdir)/adios_mpi.c'; fi`
+
+libadiosf_a-adios_mpi_lustre.o: adios_mpi_lustre.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_mpi_lustre.o `test -f 'adios_mpi_lustre.c' || echo '$(srcdir)/'`adios_mpi_lustre.c
+
+libadiosf_a-adios_mpi_lustre.obj: adios_mpi_lustre.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_mpi_lustre.obj `if test -f 'adios_mpi_lustre.c'; then $(CYGPATH_W) 'adios_mpi_lustre.c'; else $(CYGPATH_W) '$(srcdir)/adios_mpi_lustre.c'; fi`
+
+libadiosf_a-adios_mpi_amr.o: adios_mpi_amr.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_mpi_amr.o `test -f 'adios_mpi_amr.c' || echo '$(srcdir)/'`adios_mpi_amr.c
+
+libadiosf_a-adios_mpi_amr.obj: adios_mpi_amr.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_mpi_amr.obj `if test -f 'adios_mpi_amr.c'; then $(CYGPATH_W) 'adios_mpi_amr.c'; else $(CYGPATH_W) '$(srcdir)/adios_mpi_amr.c'; fi`
+
+libadiosf_a-adios_posix.o: adios_posix.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_posix.o `test -f 'adios_posix.c' || echo '$(srcdir)/'`adios_posix.c
+
+libadiosf_a-adios_posix.obj: adios_posix.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_posix.obj `if test -f 'adios_posix.c'; then $(CYGPATH_W) 'adios_posix.c'; else $(CYGPATH_W) '$(srcdir)/adios_posix.c'; fi`
+
+libadiosf_a-adios_posix1.o: adios_posix1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_posix1.o `test -f 'adios_posix1.c' || echo '$(srcdir)/'`adios_posix1.c
+
+libadiosf_a-adios_posix1.obj: adios_posix1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_posix1.obj `if test -f 'adios_posix1.c'; then $(CYGPATH_W) 'adios_posix1.c'; else $(CYGPATH_W) '$(srcdir)/adios_posix1.c'; fi`
+
+libadiosf_a-adios_internals.o: adios_internals.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_internals.o `test -f 'adios_internals.c' || echo '$(srcdir)/'`adios_internals.c
+
+libadiosf_a-adios_internals.obj: adios_internals.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_internals.obj `if test -f 'adios_internals.c'; then $(CYGPATH_W) 'adios_internals.c'; else $(CYGPATH_W) '$(srcdir)/adios_internals.c'; fi`
+
+libadiosf_a-adios_internals_mxml.o: adios_internals_mxml.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_internals_mxml.o `test -f 'adios_internals_mxml.c' || echo '$(srcdir)/'`adios_internals_mxml.c
+
+libadiosf_a-adios_internals_mxml.obj: adios_internals_mxml.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_internals_mxml.obj `if test -f 'adios_internals_mxml.c'; then $(CYGPATH_W) 'adios_internals_mxml.c'; else $(CYGPATH_W) '$(srcdir)/adios_internals_mxml.c'; fi`
+
+libadiosf_a-buffer.o: buffer.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-buffer.o `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c
+
+libadiosf_a-buffer.obj: buffer.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-buffer.obj `if test -f 'buffer.c'; then $(CYGPATH_W) 'buffer.c'; else $(CYGPATH_W) '$(srcdir)/buffer.c'; fi`
+
+libadiosf_a-adios_socket.o: adios_socket.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_socket.o `test -f 'adios_socket.c' || echo '$(srcdir)/'`adios_socket.c
+
+libadiosf_a-adios_socket.obj: adios_socket.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_socket.obj `if test -f 'adios_socket.c'; then $(CYGPATH_W) 'adios_socket.c'; else $(CYGPATH_W) '$(srcdir)/adios_socket.c'; fi`
+
+libadiosf_a-adios_bp_v1.o: adios_bp_v1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_bp_v1.o `test -f 'adios_bp_v1.c' || echo '$(srcdir)/'`adios_bp_v1.c
+
+libadiosf_a-adios_bp_v1.obj: adios_bp_v1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_bp_v1.obj `if test -f 'adios_bp_v1.c'; then $(CYGPATH_W) 'adios_bp_v1.c'; else $(CYGPATH_W) '$(srcdir)/adios_bp_v1.c'; fi`
+
+libadiosf_a-adios_endianness.o: adios_endianness.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_endianness.o `test -f 'adios_endianness.c' || echo '$(srcdir)/'`adios_endianness.c
+
+libadiosf_a-adios_endianness.obj: adios_endianness.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_endianness.obj `if test -f 'adios_endianness.c'; then $(CYGPATH_W) 'adios_endianness.c'; else $(CYGPATH_W) '$(srcdir)/adios_endianness.c'; fi`
+
+libadiosf_a-futils.o: futils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-futils.o `test -f 'futils.c' || echo '$(srcdir)/'`futils.c
+
+libadiosf_a-futils.obj: futils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-futils.obj `if test -f 'futils.c'; then $(CYGPATH_W) 'futils.c'; else $(CYGPATH_W) '$(srcdir)/futils.c'; fi`
+
+libadiosf_a-adios_error.o: adios_error.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_error.o `test -f 'adios_error.c' || echo '$(srcdir)/'`adios_error.c
+
+libadiosf_a-adios_error.obj: adios_error.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_error.obj `if test -f 'adios_error.c'; then $(CYGPATH_W) 'adios_error.c'; else $(CYGPATH_W) '$(srcdir)/adios_error.c'; fi`
+
+libadiosf_a-bp_utils.o: bp_utils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-bp_utils.o `test -f 'bp_utils.c' || echo '$(srcdir)/'`bp_utils.c
+
+libadiosf_a-bp_utils.obj: bp_utils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-bp_utils.obj `if test -f 'bp_utils.c'; then $(CYGPATH_W) 'bp_utils.c'; else $(CYGPATH_W) '$(srcdir)/bp_utils.c'; fi`
+
+libadiosf_a-adiosf_read.o: adiosf_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adiosf_read.o `test -f 'adiosf_read.c' || echo '$(srcdir)/'`adiosf_read.c
+
+libadiosf_a-adiosf_read.obj: adiosf_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adiosf_read.obj `if test -f 'adiosf_read.c'; then $(CYGPATH_W) 'adiosf_read.c'; else $(CYGPATH_W) '$(srcdir)/adiosf_read.c'; fi`
+
+libadiosf_a-adios_read_hooks.o: adios_read_hooks.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_read_hooks.o `test -f 'adios_read_hooks.c' || echo '$(srcdir)/'`adios_read_hooks.c
+
+libadiosf_a-adios_read_hooks.obj: adios_read_hooks.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_read_hooks.obj `if test -f 'adios_read_hooks.c'; then $(CYGPATH_W) 'adios_read_hooks.c'; else $(CYGPATH_W) '$(srcdir)/adios_read_hooks.c'; fi`
+
+libadiosf_a-common_read.o: common_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-common_read.o `test -f 'common_read.c' || echo '$(srcdir)/'`common_read.c
+
+libadiosf_a-common_read.obj: common_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-common_read.obj `if test -f 'common_read.c'; then $(CYGPATH_W) 'common_read.c'; else $(CYGPATH_W) '$(srcdir)/common_read.c'; fi`
+
+libadiosf_a-read_bp.o: read_bp.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-read_bp.o `test -f 'read_bp.c' || echo '$(srcdir)/'`read_bp.c
+
+libadiosf_a-read_bp.obj: read_bp.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-read_bp.obj `if test -f 'read_bp.c'; then $(CYGPATH_W) 'read_bp.c'; else $(CYGPATH_W) '$(srcdir)/read_bp.c'; fi`
+
+libadiosf_a-globals.o: globals.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-globals.o `test -f 'globals.c' || echo '$(srcdir)/'`globals.c
+
+libadiosf_a-globals.obj: globals.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-globals.obj `if test -f 'globals.c'; then $(CYGPATH_W) 'globals.c'; else $(CYGPATH_W) '$(srcdir)/globals.c'; fi`
+
+libadiosf_a-adios_dart.o: adios_dart.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_dart.o `test -f 'adios_dart.c' || echo '$(srcdir)/'`adios_dart.c
+
+libadiosf_a-adios_dart.obj: adios_dart.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_dart.obj `if test -f 'adios_dart.c'; then $(CYGPATH_W) 'adios_dart.c'; else $(CYGPATH_W) '$(srcdir)/adios_dart.c'; fi`
+
+libadiosf_a-read_dart.o: read_dart.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-read_dart.o `test -f 'read_dart.c' || echo '$(srcdir)/'`read_dart.c
+
+libadiosf_a-read_dart.obj: read_dart.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-read_dart.obj `if test -f 'read_dart.c'; then $(CYGPATH_W) 'read_dart.c'; else $(CYGPATH_W) '$(srcdir)/read_dart.c'; fi`
+
+libadiosf_a-adios_dimes.o: adios_dimes.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_dimes.o `test -f 'adios_dimes.c' || echo '$(srcdir)/'`adios_dimes.c
+
+libadiosf_a-adios_dimes.obj: adios_dimes.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_dimes.obj `if test -f 'adios_dimes.c'; then $(CYGPATH_W) 'adios_dimes.c'; else $(CYGPATH_W) '$(srcdir)/adios_dimes.c'; fi`
+
+libadiosf_a-read_dimes.o: read_dimes.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-read_dimes.o `test -f 'read_dimes.c' || echo '$(srcdir)/'`read_dimes.c
+
+libadiosf_a-read_dimes.obj: read_dimes.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-read_dimes.obj `if test -f 'read_dimes.c'; then $(CYGPATH_W) 'read_dimes.c'; else $(CYGPATH_W) '$(srcdir)/read_dimes.c'; fi`
+
+libadiosf_a-adios_datatap.o: adios_datatap.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_datatap.o `test -f 'adios_datatap.c' || echo '$(srcdir)/'`adios_datatap.c
+
+libadiosf_a-adios_datatap.obj: adios_datatap.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_datatap.obj `if test -f 'adios_datatap.c'; then $(CYGPATH_W) 'adios_datatap.c'; else $(CYGPATH_W) '$(srcdir)/adios_datatap.c'; fi`
+
+libadiosf_a-adios_phdf5.o: adios_phdf5.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_phdf5.o `test -f 'adios_phdf5.c' || echo '$(srcdir)/'`adios_phdf5.c
+
+libadiosf_a-adios_phdf5.obj: adios_phdf5.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_phdf5.obj `if test -f 'adios_phdf5.c'; then $(CYGPATH_W) 'adios_phdf5.c'; else $(CYGPATH_W) '$(srcdir)/adios_phdf5.c'; fi`
+
+libadiosf_a-adios_nc4.o: adios_nc4.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_nc4.o `test -f 'adios_nc4.c' || echo '$(srcdir)/'`adios_nc4.c
+
+libadiosf_a-adios_nc4.obj: adios_nc4.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_nc4.obj `if test -f 'adios_nc4.c'; then $(CYGPATH_W) 'adios_nc4.c'; else $(CYGPATH_W) '$(srcdir)/adios_nc4.c'; fi`
+
+libadiosf_a-adios_nssi_config.o: adios_nssi_config.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_nssi_config.o `test -f 'adios_nssi_config.c' || echo '$(srcdir)/'`adios_nssi_config.c
+
+libadiosf_a-adios_nssi_config.obj: adios_nssi_config.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_nssi_config.obj `if test -f 'adios_nssi_config.c'; then $(CYGPATH_W) 'adios_nssi_config.c'; else $(CYGPATH_W) '$(srcdir)/adios_nssi_config.c'; fi`
+
+libadiosf_a-adios_nssi.o: adios_nssi.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_nssi.o `test -f 'adios_nssi.c' || echo '$(srcdir)/'`adios_nssi.c
+
+libadiosf_a-adios_nssi.obj: adios_nssi.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_nssi.obj `if test -f 'adios_nssi.c'; then $(CYGPATH_W) 'adios_nssi.c'; else $(CYGPATH_W) '$(srcdir)/adios_nssi.c'; fi`
+
+libadiosf_a-adios_nssi_filter.o: adios_nssi_filter.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_nssi_filter.o `test -f 'adios_nssi_filter.c' || echo '$(srcdir)/'`adios_nssi_filter.c
+
+libadiosf_a-adios_nssi_filter.obj: adios_nssi_filter.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_nssi_filter.obj `if test -f 'adios_nssi_filter.c'; then $(CYGPATH_W) 'adios_nssi_filter.c'; else $(CYGPATH_W) '$(srcdir)/adios_nssi_filter.c'; fi`
+
+libadiosf_a-adios_mpi_stagger.o: adios_mpi_stagger.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_mpi_stagger.o `test -f 'adios_mpi_stagger.c' || echo '$(srcdir)/'`adios_mpi_stagger.c
+
+libadiosf_a-adios_mpi_stagger.obj: adios_mpi_stagger.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_mpi_stagger.obj `if test -f 'adios_mpi_stagger.c'; then $(CYGPATH_W) 'adios_mpi_stagger.c'; else $(CYGPATH_W) '$(srcdir)/adios_mpi_stagger.c'; fi`
+
+libadiosf_a-adios_mpi_aggregate.o: adios_mpi_aggregate.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_mpi_aggregate.o `test -f 'adios_mpi_aggregate.c' || echo '$(srcdir)/'`adios_mpi_aggregate.c
+
+libadiosf_a-adios_mpi_aggregate.obj: adios_mpi_aggregate.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_mpi_aggregate.obj `if test -f 'adios_mpi_aggregate.c'; then $(CYGPATH_W) 'adios_mpi_aggregate.c'; else $(CYGPATH_W) '$(srcdir)/adios_mpi_aggregate.c'; fi`
+
+libadiosf_a-adios_provenance.o: adios_provenance.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_provenance.o `test -f 'adios_provenance.c' || echo '$(srcdir)/'`adios_provenance.c
+
+libadiosf_a-adios_provenance.obj: adios_provenance.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_provenance.obj `if test -f 'adios_provenance.c'; then $(CYGPATH_W) 'adios_provenance.c'; else $(CYGPATH_W) '$(srcdir)/adios_provenance.c'; fi`
+
+libadiosf_a-adios_mpi_cio.o: adios_mpi_cio.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_mpi_cio.o `test -f 'adios_mpi_cio.c' || echo '$(srcdir)/'`adios_mpi_cio.c
+
+libadiosf_a-adios_mpi_cio.obj: adios_mpi_cio.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_mpi_cio.obj `if test -f 'adios_mpi_cio.c'; then $(CYGPATH_W) 'adios_mpi_cio.c'; else $(CYGPATH_W) '$(srcdir)/adios_mpi_cio.c'; fi`
+
+libadiosf_a-adios_mpi_stripe.o: adios_mpi_stripe.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_mpi_stripe.o `test -f 'adios_mpi_stripe.c' || echo '$(srcdir)/'`adios_mpi_stripe.c
+
+libadiosf_a-adios_mpi_stripe.obj: adios_mpi_stripe.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_mpi_stripe.obj `if test -f 'adios_mpi_stripe.c'; then $(CYGPATH_W) 'adios_mpi_stripe.c'; else $(CYGPATH_W) '$(srcdir)/adios_mpi_stripe.c'; fi`
+
+libadiosf_a-adios_mpi_amr1.o: adios_mpi_amr1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_mpi_amr1.o `test -f 'adios_mpi_amr1.c' || echo '$(srcdir)/'`adios_mpi_amr1.c
+
+libadiosf_a-adios_mpi_amr1.obj: adios_mpi_amr1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_mpi_amr1.obj `if test -f 'adios_mpi_amr1.c'; then $(CYGPATH_W) 'adios_mpi_amr1.c'; else $(CYGPATH_W) '$(srcdir)/adios_mpi_amr1.c'; fi`
+
+libadiosf_a-adios_adaptive.o: adios_adaptive.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_adaptive.o `test -f 'adios_adaptive.c' || echo '$(srcdir)/'`adios_adaptive.c
+
+libadiosf_a-adios_adaptive.obj: adios_adaptive.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_adaptive.obj `if test -f 'adios_adaptive.c'; then $(CYGPATH_W) 'adios_adaptive.c'; else $(CYGPATH_W) '$(srcdir)/adios_adaptive.c'; fi`
+
+libadiosf_a-adios_nssi_args.o: adios_nssi_args.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_nssi_args.o `test -f 'adios_nssi_args.c' || echo '$(srcdir)/'`adios_nssi_args.c
+
+libadiosf_a-adios_nssi_args.obj: adios_nssi_args.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosf_a_CPPFLAGS) $(CPPFLAGS) $(libadiosf_a_CFLAGS) $(CFLAGS) -c -o libadiosf_a-adios_nssi_args.obj `if test -f 'adios_nssi_args.c'; then $(CYGPATH_W) 'adios_nssi_args.c'; else $(CYGPATH_W) '$(srcdir)/adios_nssi_args.c'; fi`
+
+libadiosread_a-adios_bp_v1.o: adios_bp_v1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-adios_bp_v1.o `test -f 'adios_bp_v1.c' || echo '$(srcdir)/'`adios_bp_v1.c
+
+libadiosread_a-adios_bp_v1.obj: adios_bp_v1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-adios_bp_v1.obj `if test -f 'adios_bp_v1.c'; then $(CYGPATH_W) 'adios_bp_v1.c'; else $(CYGPATH_W) '$(srcdir)/adios_bp_v1.c'; fi`
+
+libadiosread_a-adios_endianness.o: adios_endianness.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-adios_endianness.o `test -f 'adios_endianness.c' || echo '$(srcdir)/'`adios_endianness.c
+
+libadiosread_a-adios_endianness.obj: adios_endianness.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-adios_endianness.obj `if test -f 'adios_endianness.c'; then $(CYGPATH_W) 'adios_endianness.c'; else $(CYGPATH_W) '$(srcdir)/adios_endianness.c'; fi`
+
+libadiosread_a-bp_utils.o: bp_utils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-bp_utils.o `test -f 'bp_utils.c' || echo '$(srcdir)/'`bp_utils.c
+
+libadiosread_a-bp_utils.obj: bp_utils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-bp_utils.obj `if test -f 'bp_utils.c'; then $(CYGPATH_W) 'bp_utils.c'; else $(CYGPATH_W) '$(srcdir)/bp_utils.c'; fi`
+
+libadiosread_a-futils.o: futils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-futils.o `test -f 'futils.c' || echo '$(srcdir)/'`futils.c
+
+libadiosread_a-futils.obj: futils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-futils.obj `if test -f 'futils.c'; then $(CYGPATH_W) 'futils.c'; else $(CYGPATH_W) '$(srcdir)/futils.c'; fi`
+
+libadiosread_a-adios_error.o: adios_error.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-adios_error.o `test -f 'adios_error.c' || echo '$(srcdir)/'`adios_error.c
+
+libadiosread_a-adios_error.obj: adios_error.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-adios_error.obj `if test -f 'adios_error.c'; then $(CYGPATH_W) 'adios_error.c'; else $(CYGPATH_W) '$(srcdir)/adios_error.c'; fi`
+
+libadiosread_a-adios_read.o: adios_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-adios_read.o `test -f 'adios_read.c' || echo '$(srcdir)/'`adios_read.c
+
+libadiosread_a-adios_read.obj: adios_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-adios_read.obj `if test -f 'adios_read.c'; then $(CYGPATH_W) 'adios_read.c'; else $(CYGPATH_W) '$(srcdir)/adios_read.c'; fi`
+
+libadiosread_a-adios_read_hooks.o: adios_read_hooks.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-adios_read_hooks.o `test -f 'adios_read_hooks.c' || echo '$(srcdir)/'`adios_read_hooks.c
+
+libadiosread_a-adios_read_hooks.obj: adios_read_hooks.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-adios_read_hooks.obj `if test -f 'adios_read_hooks.c'; then $(CYGPATH_W) 'adios_read_hooks.c'; else $(CYGPATH_W) '$(srcdir)/adios_read_hooks.c'; fi`
+
+libadiosread_a-common_read.o: common_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-common_read.o `test -f 'common_read.c' || echo '$(srcdir)/'`common_read.c
+
+libadiosread_a-common_read.obj: common_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-common_read.obj `if test -f 'common_read.c'; then $(CYGPATH_W) 'common_read.c'; else $(CYGPATH_W) '$(srcdir)/common_read.c'; fi`
+
+libadiosread_a-read_bp.o: read_bp.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-read_bp.o `test -f 'read_bp.c' || echo '$(srcdir)/'`read_bp.c
+
+libadiosread_a-read_bp.obj: read_bp.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-read_bp.obj `if test -f 'read_bp.c'; then $(CYGPATH_W) 'read_bp.c'; else $(CYGPATH_W) '$(srcdir)/read_bp.c'; fi`
+
+libadiosread_a-globals.o: globals.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-globals.o `test -f 'globals.c' || echo '$(srcdir)/'`globals.c
+
+libadiosread_a-globals.obj: globals.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-globals.obj `if test -f 'globals.c'; then $(CYGPATH_W) 'globals.c'; else $(CYGPATH_W) '$(srcdir)/globals.c'; fi`
+
+libadiosread_a-read_dart.o: read_dart.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-read_dart.o `test -f 'read_dart.c' || echo '$(srcdir)/'`read_dart.c
+
+libadiosread_a-read_dart.obj: read_dart.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-read_dart.obj `if test -f 'read_dart.c'; then $(CYGPATH_W) 'read_dart.c'; else $(CYGPATH_W) '$(srcdir)/read_dart.c'; fi`
+
+libadiosread_a-read_dimes.o: read_dimes.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-read_dimes.o `test -f 'read_dimes.c' || echo '$(srcdir)/'`read_dimes.c
+
+libadiosread_a-read_dimes.obj: read_dimes.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_a-read_dimes.obj `if test -f 'read_dimes.c'; then $(CYGPATH_W) 'read_dimes.c'; else $(CYGPATH_W) '$(srcdir)/read_dimes.c'; fi`
+
+libadiosread_nompi_a-mpidummy.o: mpidummy.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-mpidummy.o `test -f 'mpidummy.c' || echo '$(srcdir)/'`mpidummy.c
+
+libadiosread_nompi_a-mpidummy.obj: mpidummy.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-mpidummy.obj `if test -f 'mpidummy.c'; then $(CYGPATH_W) 'mpidummy.c'; else $(CYGPATH_W) '$(srcdir)/mpidummy.c'; fi`
+
+libadiosread_nompi_a-adios_bp_v1.o: adios_bp_v1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-adios_bp_v1.o `test -f 'adios_bp_v1.c' || echo '$(srcdir)/'`adios_bp_v1.c
+
+libadiosread_nompi_a-adios_bp_v1.obj: adios_bp_v1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-adios_bp_v1.obj `if test -f 'adios_bp_v1.c'; then $(CYGPATH_W) 'adios_bp_v1.c'; else $(CYGPATH_W) '$(srcdir)/adios_bp_v1.c'; fi`
+
+libadiosread_nompi_a-adios_endianness.o: adios_endianness.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-adios_endianness.o `test -f 'adios_endianness.c' || echo '$(srcdir)/'`adios_endianness.c
+
+libadiosread_nompi_a-adios_endianness.obj: adios_endianness.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-adios_endianness.obj `if test -f 'adios_endianness.c'; then $(CYGPATH_W) 'adios_endianness.c'; else $(CYGPATH_W) '$(srcdir)/adios_endianness.c'; fi`
+
+libadiosread_nompi_a-bp_utils.o: bp_utils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-bp_utils.o `test -f 'bp_utils.c' || echo '$(srcdir)/'`bp_utils.c
+
+libadiosread_nompi_a-bp_utils.obj: bp_utils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-bp_utils.obj `if test -f 'bp_utils.c'; then $(CYGPATH_W) 'bp_utils.c'; else $(CYGPATH_W) '$(srcdir)/bp_utils.c'; fi`
+
+libadiosread_nompi_a-futils.o: futils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-futils.o `test -f 'futils.c' || echo '$(srcdir)/'`futils.c
+
+libadiosread_nompi_a-futils.obj: futils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-futils.obj `if test -f 'futils.c'; then $(CYGPATH_W) 'futils.c'; else $(CYGPATH_W) '$(srcdir)/futils.c'; fi`
+
+libadiosread_nompi_a-adios_error.o: adios_error.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-adios_error.o `test -f 'adios_error.c' || echo '$(srcdir)/'`adios_error.c
+
+libadiosread_nompi_a-adios_error.obj: adios_error.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-adios_error.obj `if test -f 'adios_error.c'; then $(CYGPATH_W) 'adios_error.c'; else $(CYGPATH_W) '$(srcdir)/adios_error.c'; fi`
+
+libadiosread_nompi_a-adios_read.o: adios_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-adios_read.o `test -f 'adios_read.c' || echo '$(srcdir)/'`adios_read.c
+
+libadiosread_nompi_a-adios_read.obj: adios_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-adios_read.obj `if test -f 'adios_read.c'; then $(CYGPATH_W) 'adios_read.c'; else $(CYGPATH_W) '$(srcdir)/adios_read.c'; fi`
+
+libadiosread_nompi_a-adios_read_hooks.o: adios_read_hooks.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-adios_read_hooks.o `test -f 'adios_read_hooks.c' || echo '$(srcdir)/'`adios_read_hooks.c
+
+libadiosread_nompi_a-adios_read_hooks.obj: adios_read_hooks.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-adios_read_hooks.obj `if test -f 'adios_read_hooks.c'; then $(CYGPATH_W) 'adios_read_hooks.c'; else $(CYGPATH_W) '$(srcdir)/adios_read_hooks.c'; fi`
+
+libadiosread_nompi_a-common_read.o: common_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-common_read.o `test -f 'common_read.c' || echo '$(srcdir)/'`common_read.c
+
+libadiosread_nompi_a-common_read.obj: common_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-common_read.obj `if test -f 'common_read.c'; then $(CYGPATH_W) 'common_read.c'; else $(CYGPATH_W) '$(srcdir)/common_read.c'; fi`
+
+libadiosread_nompi_a-read_bp.o: read_bp.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-read_bp.o `test -f 'read_bp.c' || echo '$(srcdir)/'`read_bp.c
+
+libadiosread_nompi_a-read_bp.obj: read_bp.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-read_bp.obj `if test -f 'read_bp.c'; then $(CYGPATH_W) 'read_bp.c'; else $(CYGPATH_W) '$(srcdir)/read_bp.c'; fi`
+
+libadiosread_nompi_a-adios_internals.o: adios_internals.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-adios_internals.o `test -f 'adios_internals.c' || echo '$(srcdir)/'`adios_internals.c
+
+libadiosread_nompi_a-adios_internals.obj: adios_internals.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-adios_internals.obj `if test -f 'adios_internals.c'; then $(CYGPATH_W) 'adios_internals.c'; else $(CYGPATH_W) '$(srcdir)/adios_internals.c'; fi`
+
+libadiosread_nompi_a-buffer.o: buffer.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-buffer.o `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c
+
+libadiosread_nompi_a-buffer.obj: buffer.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-buffer.obj `if test -f 'buffer.c'; then $(CYGPATH_W) 'buffer.c'; else $(CYGPATH_W) '$(srcdir)/buffer.c'; fi`
+
+libadiosread_nompi_a-adios_transport_hooks.o: adios_transport_hooks.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-adios_transport_hooks.o `test -f 'adios_transport_hooks.c' || echo '$(srcdir)/'`adios_transport_hooks.c
+
+libadiosread_nompi_a-adios_transport_hooks.obj: adios_transport_hooks.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-adios_transport_hooks.obj `if test -f 'adios_transport_hooks.c'; then $(CYGPATH_W) 'adios_transport_hooks.c'; else $(CYGPATH_W) '$(srcdir)/adios_transport_hooks.c'; fi`
+
+libadiosread_nompi_a-globals.o: globals.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-globals.o `test -f 'globals.c' || echo '$(srcdir)/'`globals.c
+
+libadiosread_nompi_a-globals.obj: globals.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-globals.obj `if test -f 'globals.c'; then $(CYGPATH_W) 'globals.c'; else $(CYGPATH_W) '$(srcdir)/globals.c'; fi`
+
+libadiosread_nompi_a-read_dart.o: read_dart.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-read_dart.o `test -f 'read_dart.c' || echo '$(srcdir)/'`read_dart.c
+
+libadiosread_nompi_a-read_dart.obj: read_dart.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-read_dart.obj `if test -f 'read_dart.c'; then $(CYGPATH_W) 'read_dart.c'; else $(CYGPATH_W) '$(srcdir)/read_dart.c'; fi`
+
+libadiosread_nompi_a-read_dimes.o: read_dimes.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-read_dimes.o `test -f 'read_dimes.c' || echo '$(srcdir)/'`read_dimes.c
+
+libadiosread_nompi_a-read_dimes.obj: read_dimes.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosread_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosread_nompi_a-read_dimes.obj `if test -f 'read_dimes.c'; then $(CYGPATH_W) 'read_dimes.c'; else $(CYGPATH_W) '$(srcdir)/read_dimes.c'; fi`
+
+libadiosreadf_a-adios_bp_v1.o: adios_bp_v1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-adios_bp_v1.o `test -f 'adios_bp_v1.c' || echo '$(srcdir)/'`adios_bp_v1.c
+
+libadiosreadf_a-adios_bp_v1.obj: adios_bp_v1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-adios_bp_v1.obj `if test -f 'adios_bp_v1.c'; then $(CYGPATH_W) 'adios_bp_v1.c'; else $(CYGPATH_W) '$(srcdir)/adios_bp_v1.c'; fi`
+
+libadiosreadf_a-adios_endianness.o: adios_endianness.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-adios_endianness.o `test -f 'adios_endianness.c' || echo '$(srcdir)/'`adios_endianness.c
+
+libadiosreadf_a-adios_endianness.obj: adios_endianness.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-adios_endianness.obj `if test -f 'adios_endianness.c'; then $(CYGPATH_W) 'adios_endianness.c'; else $(CYGPATH_W) '$(srcdir)/adios_endianness.c'; fi`
+
+libadiosreadf_a-bp_utils.o: bp_utils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-bp_utils.o `test -f 'bp_utils.c' || echo '$(srcdir)/'`bp_utils.c
+
+libadiosreadf_a-bp_utils.obj: bp_utils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-bp_utils.obj `if test -f 'bp_utils.c'; then $(CYGPATH_W) 'bp_utils.c'; else $(CYGPATH_W) '$(srcdir)/bp_utils.c'; fi`
+
+libadiosreadf_a-futils.o: futils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-futils.o `test -f 'futils.c' || echo '$(srcdir)/'`futils.c
+
+libadiosreadf_a-futils.obj: futils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-futils.obj `if test -f 'futils.c'; then $(CYGPATH_W) 'futils.c'; else $(CYGPATH_W) '$(srcdir)/futils.c'; fi`
+
+libadiosreadf_a-adios_error.o: adios_error.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-adios_error.o `test -f 'adios_error.c' || echo '$(srcdir)/'`adios_error.c
+
+libadiosreadf_a-adios_error.obj: adios_error.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-adios_error.obj `if test -f 'adios_error.c'; then $(CYGPATH_W) 'adios_error.c'; else $(CYGPATH_W) '$(srcdir)/adios_error.c'; fi`
+
+libadiosreadf_a-adiosf_read.o: adiosf_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-adiosf_read.o `test -f 'adiosf_read.c' || echo '$(srcdir)/'`adiosf_read.c
+
+libadiosreadf_a-adiosf_read.obj: adiosf_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-adiosf_read.obj `if test -f 'adiosf_read.c'; then $(CYGPATH_W) 'adiosf_read.c'; else $(CYGPATH_W) '$(srcdir)/adiosf_read.c'; fi`
+
+libadiosreadf_a-adios_read_hooks.o: adios_read_hooks.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-adios_read_hooks.o `test -f 'adios_read_hooks.c' || echo '$(srcdir)/'`adios_read_hooks.c
+
+libadiosreadf_a-adios_read_hooks.obj: adios_read_hooks.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-adios_read_hooks.obj `if test -f 'adios_read_hooks.c'; then $(CYGPATH_W) 'adios_read_hooks.c'; else $(CYGPATH_W) '$(srcdir)/adios_read_hooks.c'; fi`
+
+libadiosreadf_a-common_read.o: common_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-common_read.o `test -f 'common_read.c' || echo '$(srcdir)/'`common_read.c
+
+libadiosreadf_a-common_read.obj: common_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-common_read.obj `if test -f 'common_read.c'; then $(CYGPATH_W) 'common_read.c'; else $(CYGPATH_W) '$(srcdir)/common_read.c'; fi`
+
+libadiosreadf_a-read_bp.o: read_bp.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-read_bp.o `test -f 'read_bp.c' || echo '$(srcdir)/'`read_bp.c
+
+libadiosreadf_a-read_bp.obj: read_bp.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-read_bp.obj `if test -f 'read_bp.c'; then $(CYGPATH_W) 'read_bp.c'; else $(CYGPATH_W) '$(srcdir)/read_bp.c'; fi`
+
+libadiosreadf_a-globals.o: globals.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-globals.o `test -f 'globals.c' || echo '$(srcdir)/'`globals.c
+
+libadiosreadf_a-globals.obj: globals.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-globals.obj `if test -f 'globals.c'; then $(CYGPATH_W) 'globals.c'; else $(CYGPATH_W) '$(srcdir)/globals.c'; fi`
+
+libadiosreadf_a-read_dart.o: read_dart.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-read_dart.o `test -f 'read_dart.c' || echo '$(srcdir)/'`read_dart.c
+
+libadiosreadf_a-read_dart.obj: read_dart.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-read_dart.obj `if test -f 'read_dart.c'; then $(CYGPATH_W) 'read_dart.c'; else $(CYGPATH_W) '$(srcdir)/read_dart.c'; fi`
+
+libadiosreadf_a-read_dimes.o: read_dimes.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-read_dimes.o `test -f 'read_dimes.c' || echo '$(srcdir)/'`read_dimes.c
+
+libadiosreadf_a-read_dimes.obj: read_dimes.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_a-read_dimes.obj `if test -f 'read_dimes.c'; then $(CYGPATH_W) 'read_dimes.c'; else $(CYGPATH_W) '$(srcdir)/read_dimes.c'; fi`
+
+libadiosreadf_nompi_a-mpidummy.o: mpidummy.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-mpidummy.o `test -f 'mpidummy.c' || echo '$(srcdir)/'`mpidummy.c
+
+libadiosreadf_nompi_a-mpidummy.obj: mpidummy.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-mpidummy.obj `if test -f 'mpidummy.c'; then $(CYGPATH_W) 'mpidummy.c'; else $(CYGPATH_W) '$(srcdir)/mpidummy.c'; fi`
+
+libadiosreadf_nompi_a-adios_bp_v1.o: adios_bp_v1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-adios_bp_v1.o `test -f 'adios_bp_v1.c' || echo '$(srcdir)/'`adios_bp_v1.c
+
+libadiosreadf_nompi_a-adios_bp_v1.obj: adios_bp_v1.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-adios_bp_v1.obj `if test -f 'adios_bp_v1.c'; then $(CYGPATH_W) 'adios_bp_v1.c'; else $(CYGPATH_W) '$(srcdir)/adios_bp_v1.c'; fi`
+
+libadiosreadf_nompi_a-adios_endianness.o: adios_endianness.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-adios_endianness.o `test -f 'adios_endianness.c' || echo '$(srcdir)/'`adios_endianness.c
+
+libadiosreadf_nompi_a-adios_endianness.obj: adios_endianness.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-adios_endianness.obj `if test -f 'adios_endianness.c'; then $(CYGPATH_W) 'adios_endianness.c'; else $(CYGPATH_W) '$(srcdir)/adios_endianness.c'; fi`
+
+libadiosreadf_nompi_a-bp_utils.o: bp_utils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-bp_utils.o `test -f 'bp_utils.c' || echo '$(srcdir)/'`bp_utils.c
+
+libadiosreadf_nompi_a-bp_utils.obj: bp_utils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-bp_utils.obj `if test -f 'bp_utils.c'; then $(CYGPATH_W) 'bp_utils.c'; else $(CYGPATH_W) '$(srcdir)/bp_utils.c'; fi`
+
+libadiosreadf_nompi_a-futils.o: futils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-futils.o `test -f 'futils.c' || echo '$(srcdir)/'`futils.c
+
+libadiosreadf_nompi_a-futils.obj: futils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-futils.obj `if test -f 'futils.c'; then $(CYGPATH_W) 'futils.c'; else $(CYGPATH_W) '$(srcdir)/futils.c'; fi`
+
+libadiosreadf_nompi_a-adios_error.o: adios_error.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-adios_error.o `test -f 'adios_error.c' || echo '$(srcdir)/'`adios_error.c
+
+libadiosreadf_nompi_a-adios_error.obj: adios_error.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-adios_error.obj `if test -f 'adios_error.c'; then $(CYGPATH_W) 'adios_error.c'; else $(CYGPATH_W) '$(srcdir)/adios_error.c'; fi`
+
+libadiosreadf_nompi_a-adiosf_read.o: adiosf_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-adiosf_read.o `test -f 'adiosf_read.c' || echo '$(srcdir)/'`adiosf_read.c
+
+libadiosreadf_nompi_a-adiosf_read.obj: adiosf_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-adiosf_read.obj `if test -f 'adiosf_read.c'; then $(CYGPATH_W) 'adiosf_read.c'; else $(CYGPATH_W) '$(srcdir)/adiosf_read.c'; fi`
+
+libadiosreadf_nompi_a-adios_read_hooks.o: adios_read_hooks.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-adios_read_hooks.o `test -f 'adios_read_hooks.c' || echo '$(srcdir)/'`adios_read_hooks.c
+
+libadiosreadf_nompi_a-adios_read_hooks.obj: adios_read_hooks.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-adios_read_hooks.obj `if test -f 'adios_read_hooks.c'; then $(CYGPATH_W) 'adios_read_hooks.c'; else $(CYGPATH_W) '$(srcdir)/adios_read_hooks.c'; fi`
+
+libadiosreadf_nompi_a-common_read.o: common_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-common_read.o `test -f 'common_read.c' || echo '$(srcdir)/'`common_read.c
+
+libadiosreadf_nompi_a-common_read.obj: common_read.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-common_read.obj `if test -f 'common_read.c'; then $(CYGPATH_W) 'common_read.c'; else $(CYGPATH_W) '$(srcdir)/common_read.c'; fi`
+
+libadiosreadf_nompi_a-read_bp.o: read_bp.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-read_bp.o `test -f 'read_bp.c' || echo '$(srcdir)/'`read_bp.c
+
+libadiosreadf_nompi_a-read_bp.obj: read_bp.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-read_bp.obj `if test -f 'read_bp.c'; then $(CYGPATH_W) 'read_bp.c'; else $(CYGPATH_W) '$(srcdir)/read_bp.c'; fi`
+
+libadiosreadf_nompi_a-read_dart.o: read_dart.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-read_dart.o `test -f 'read_dart.c' || echo '$(srcdir)/'`read_dart.c
+
+libadiosreadf_nompi_a-read_dart.obj: read_dart.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-read_dart.obj `if test -f 'read_dart.c'; then $(CYGPATH_W) 'read_dart.c'; else $(CYGPATH_W) '$(srcdir)/read_dart.c'; fi`
+
+libadiosreadf_nompi_a-read_dimes.o: read_dimes.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-read_dimes.o `test -f 'read_dimes.c' || echo '$(srcdir)/'`read_dimes.c
+
+libadiosreadf_nompi_a-read_dimes.obj: read_dimes.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libadiosreadf_nompi_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libadiosreadf_nompi_a-read_dimes.obj `if test -f 'read_dimes.c'; then $(CYGPATH_W) 'read_dimes.c'; else $(CYGPATH_W) '$(srcdir)/read_dimes.c'; fi`
+
+.cpp.o:
+	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+	$(LTCXXCOMPILE) -c -o $@ $<
+
+nssi_staging_server-nssi_staging_server.o: nssi_staging_server.cpp
+	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nssi_staging_server_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o nssi_staging_server-nssi_staging_server.o `test -f 'nssi_staging_server.cpp' || echo '$(srcdir)/'`nssi_staging_server.cpp
+
+nssi_staging_server-nssi_staging_server.obj: nssi_staging_server.cpp
+	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nssi_staging_server_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o nssi_staging_server-nssi_staging_server.obj `if test -f 'nssi_staging_server.cpp'; then $(CYGPATH_W) 'nssi_staging_server.cpp'; else $(CYGPATH_W) '$(srcdir)/nssi_staging_server.cpp'; fi`
+
+nssi_staging_server-aggregation.o: aggregation.cpp
+	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nssi_staging_server_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o nssi_staging_server-aggregation.o `test -f 'aggregation.cpp' || echo '$(srcdir)/'`aggregation.cpp
+
+nssi_staging_server-aggregation.obj: aggregation.cpp
+	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nssi_staging_server_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o nssi_staging_server-aggregation.obj `if test -f 'aggregation.cpp'; then $(CYGPATH_W) 'aggregation.cpp'; else $(CYGPATH_W) '$(srcdir)/aggregation.cpp'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+install-includeHEADERS: $(include_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"
+	@list='$(include_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f=$(am__strip_dir) \
+	  echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
+	  $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
+	done
+
+uninstall-includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(include_HEADERS)'; for p in $$list; do \
+	  f=$(am__strip_dir) \
+	  echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(includedir)/$$f"; \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(includedir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libLIBRARIES \
+	clean-libtool clean-noinstLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-includeHEADERS
+
+install-exec-am: install-binPROGRAMS install-libLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \
+	uninstall-info-am uninstall-libLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic clean-libLIBRARIES clean-libtool \
+	clean-noinstLIBRARIES ctags distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-data install-data-am install-exec \
+	install-exec-am install-includeHEADERS install-info \
+	install-info-am install-libLIBRARIES install-man install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-binPROGRAMS \
+	uninstall-includeHEADERS uninstall-info-am \
+	uninstall-libLIBRARIES
+
+
+# The next line forces automake to build adios_nssi_args.[ch] before compiling adios_nssi_config.c
+# Note, the order of dist_*SOURCES and nodist_*SOURCES above should but does not solve this alone.
+ at BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE at adios_nssi_config.c: adios_nssi_args.c
+
+ at BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE at adios_nssi_args.h:  $(srcdir)/adios_nssi_args.x Makefile.am
+ at BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE@	rm -f $@
+#	@echo "#include <lwfs/lwfs_config.h>" >> $@
+#	@echo "#ifndef LWFS_HAVE_STRUCT_SOCKADDR_IN" >> $@
+#	@echo "#define LWFS_HAVE_STRUCT_SOCKADDR_IN" >> $@
+#	@echo "struct sockaddr_in { " >> $@
+#	@echo '  int a;' >> $@
+#	@echo '};' >> $@
+#	@echo '#endif' >> $@;
+ at BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE@	rpcgen -h $(srcdir)/adios_nssi_args.x >> $@
+
+ at BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE at adios_nssi_args.c: adios_nssi_args.h 
+ at BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE@	rm -f adios_nssi_args.c
+ at BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE@	rpcgen -c $(srcdir)/adios_nssi_args.x \
+ at BUILD_WRITE_TRUE@@HAVE_NSSI_TRUE@		| grep -v "include \"\.\." > adios_nssi_args.c
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/adios.c b/src/adios.c
new file mode 100644
index 0000000..a2e47dc
--- /dev/null
+++ b/src/adios.c
@@ -0,0 +1,334 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include "../config.h"
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdint.h>
+
+// xml parser
+#include <mxml.h>
+
+#include "adios.h"
+#include "common_adios.h"
+#include "adios_transport_hooks.h"
+#include "adios_bp_v1.h"
+#include "adios_internals.h"
+#include "adios_internals_mxml.h"
+#include "globals.h"
+
+extern struct adios_transport_struct * adios_transports;
+
+int adios_set_application_id (int id)
+{
+    globals_adios_set_application_id (id);
+    return 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int adios_init (const char * config)
+{
+    return common_adios_init (config);
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+// all XML file pieces will be provided by another series of calls
+int adios_init_noxml ()
+{
+    return common_adios_init_noxml ();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int adios_finalize (int mype)
+{
+    return common_adios_finalize (mype);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int adios_allocate_buffer (enum ADIOS_BUFFER_ALLOC_WHEN adios_buffer_alloc_when
+                          ,uint64_t buffer_size)
+{
+    return common_adios_allocate_buffer (adios_buffer_alloc_when, buffer_size);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int adios_open (int64_t * fd, const char * group_name, const char * name
+               ,const char * mode, void * comm
+               )
+{
+    return common_adios_open (fd, group_name, name, mode, comm);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int adios_group_size (int64_t fd_p, uint64_t data_size
+                     ,uint64_t * total_size
+                     )
+{
+    return common_adios_group_size (fd_p, data_size, total_size);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/* This C api function is a bit different from the Fortran api funcion, but
+ * they call the same common_adios_write()
+ */
+int adios_write (int64_t fd_p, const char * name, void * var)
+{
+    struct adios_file_struct * fd = (struct adios_file_struct *) fd_p;
+    if (!fd)
+    {
+        fprintf (stderr, "Invalid handle passed to adios_write\n");
+        return 1;
+    }
+
+    struct adios_var_struct * v = fd->group->vars;
+    struct adios_method_list_struct * m = fd->group->methods;
+
+    if (m && m->next == NULL && m->method->m == ADIOS_METHOD_NULL)
+    {
+        // nothing to do so just return
+        return 0;
+    }
+
+    v = adios_find_var_by_name (v, name, fd->group->all_unique_var_names);
+
+    if (!v)
+    {
+        fprintf (stderr, "Bad var name (ignored): '%s'\n", name);
+
+        return 1;
+    }
+
+    if (fd->mode == adios_mode_read)
+    {
+        if (   strcasecmp (name, fd->group->group_comm)
+            && v->is_dim != adios_flag_yes
+           )
+        {
+            fprintf (stderr, "write attempted on %s in %s.  This was opened for read\n" ,name , fd->name);
+            return 1;
+        }
+    }
+
+    if (!var)
+    {
+        fprintf (stderr, "Invalid data: %s\n", name);
+
+        return 1;
+    }
+
+    if (v->data)
+    {
+        free (v->data);
+        v->data = 0;
+    }
+
+    if (v->dimensions)
+    {
+        v->data = var;
+    }
+    else
+    {
+        uint64_t element_size = adios_get_type_size (v->type, var);
+
+        switch (v->type)
+        {
+            case adios_byte:
+            case adios_short:
+            case adios_integer:
+            case adios_long:
+            case adios_unsigned_byte:
+            case adios_unsigned_short:
+            case adios_unsigned_integer:
+            case adios_unsigned_long:
+            case adios_real:
+            case adios_double:
+            case adios_long_double:
+            case adios_complex:
+            case adios_double_complex:
+                v->data = malloc (element_size);
+                if (!v->data)
+                {
+                    fprintf (stderr, "cannot allocate %lld bytes to copy "
+                                     "scalar %s\n"
+                            ,element_size
+                            ,v->name
+                            );
+
+                    return 0;
+                }
+
+                memcpy ((char *) v->data, var, element_size);
+                break;
+
+            case adios_string:
+                v->data = malloc (element_size + 1);
+                if (!v->data)
+                {
+                    fprintf (stderr, "cannot allocate %lld bytes to copy "
+                                     "scalar %s\n"
+                            ,element_size
+                            ,v->name
+                            );
+
+                    return 0;
+                }
+                ((char *) v->data) [element_size] = 0;
+                memcpy ((char *) v->data, var, element_size);
+                break;
+
+            default:
+                v->data = 0;
+                break;
+        }
+    }
+
+    common_adios_write (fd, v, var);
+    // v->data is set to NULL in the above call
+
+    if (fd->mode == adios_mode_write || fd->mode == adios_mode_append) 
+    {
+        adios_copy_var_written (&fd->group->vars_written, v, fd);
+    }
+
+    return 0;
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+int adios_get_write_buffer (int64_t fd_p, const char * name
+                           ,uint64_t * size
+                           ,void ** buffer
+                           )
+{
+    return common_adios_get_write_buffer (fd_p, name, size, buffer);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int adios_read (int64_t fd_p, const char * name, void * buffer
+               ,uint64_t buffer_size
+               )
+{
+    return common_adios_read (fd_p, name, buffer, buffer_size);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int adios_set_path (int64_t fd_p, const char * path)
+{
+    return common_adios_set_path (fd_p, path);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int adios_set_path_var (int64_t fd_p, const char * path, const char * name)
+{
+    return common_adios_set_path_var (fd_p, path, name);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// hint that we reached the end of an iteration (for asynchronous pacing)
+int adios_end_iteration ()
+{
+    return common_adios_end_iteration ();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// hint to start communicating
+int adios_start_calculation ()
+{
+    return common_adios_start_calculation ();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// hint to stop communicating
+int adios_stop_calculation ()
+{
+    return common_adios_stop_calculation ();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int adios_close (int64_t fd_p)
+{
+    return common_adios_close (fd_p);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// Methods normally only called by the XML parser
+//////////////////////////////////////////////////////////////////////////////
+
+// adios_common_declare_group is in adios_internals.c
+
+///////////////////////////////////////////////////////////////////////////////
+// group a list of vars into a composite group
+int adios_declare_group (int64_t * id, const char * name
+                        ,const char * time_index
+                        )
+{
+    int ret;
+    ret = adios_common_declare_group (id, name, adios_flag_no
+                                      ,""
+                                      ,""
+                                      ,time_index
+                                      );
+    if (ret == 1) {
+        struct adios_group_struct * g = (struct adios_group_struct *) *id;
+        g->all_unique_var_names = adios_flag_no;
+    }
+    return ret;
+}
+
+
+int adios_free_group (int64_t id)
+{
+    return adios_common_free_group (id);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+// adios_common_define_var is in adios_internals.c
+
+// declare a single var as an entry in a group
+int adios_define_var (int64_t group_id, const char * name
+                     ,const char * path, int type
+                     ,const char * dimensions
+                     ,const char * global_dimensions
+                     ,const char * local_offsets
+                     )
+{
+    return adios_common_define_var (group_id, name, path
+                                   ,(enum ADIOS_DATATYPES) type
+                                   ,dimensions
+                                   ,global_dimensions, local_offsets
+                                   );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+// adios_common_define_attribute is in adios_internals.c
+
+int adios_define_attribute (int64_t group, const char * name
+                           ,const char * path, enum ADIOS_DATATYPES type
+                           ,const char * value, const char * var
+                           )
+{
+    return adios_common_define_attribute (group, name, path, type, value, var);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+// adios_common_select_method is in adios_internals_mxml.c
+int adios_select_method (int64_t group, const char * method
+                        ,const char * parameters
+                        ,const char * base_path
+                        )
+{
+    return adios_common_select_method_by_group_id (0, method, parameters, group
+                                                  ,base_path, 0
+                                                  );
+}
+
diff --git a/src/adios.h b/src/adios.h
new file mode 100644
index 0000000..c52b220
--- /dev/null
+++ b/src/adios.h
@@ -0,0 +1,172 @@
+/*
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#ifndef ADIOS_H
+#define ADIOS_H
+
+#include "adios_types.h"
+#include <stdint.h>
+
+// ADIOS - Adaptable IO System
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Global setup using the XML file
+int adios_init (const char * config);
+
+int adios_finalize (int mype);
+
+// end user calls for each I/O operation
+// modes = "r" = "read", "w" = "write", "a" = "append", "u" = "update"
+int adios_open (int64_t * fd, const char * group_name, const char * name
+               ,const char * mode, void * comm
+               );
+
+int adios_group_size (int64_t fd_p, uint64_t data_size
+                     ,uint64_t * total_size
+                     );
+
+int adios_write (int64_t fd_p, const char * name, void * var);
+
+int adios_get_write_buffer (int64_t fd_p, const char * name
+                           ,uint64_t * size
+                           ,void ** buffer
+                           );
+
+int adios_read (int64_t fd_p, const char * name, void * buffer
+               ,uint64_t buffer_size
+               );
+
+int adios_set_path (int64_t fd_p, const char * path);
+
+int adios_set_path_var (int64_t fd_p, const char * path, const char * name);
+
+int adios_end_iteration (void);
+
+int adios_start_calculation (void);
+
+int adios_stop_calculation (void);
+
+int adios_close (int64_t fd_p);
+
+// ADIOS No-XML API's
+int adios_init_noxml (void);
+
+// To allocate ADIOS buffer
+int adios_allocate_buffer (enum ADIOS_BUFFER_ALLOC_WHEN adios_buffer_alloc_when
+                          ,uint64_t buffer_size);
+
+// To declare a ADIOS group
+int adios_declare_group (int64_t * id, const char * name
+                        ,const char * time_index
+                        );
+// To free a ADIOS group
+int adios_free_group (int64_t id);
+
+// To select a I/O method for a ADIOS group
+int adios_select_method (int64_t group, const char * method
+                        ,const char * parameters
+                        ,const char * base_path
+                        );
+
+// To define a ADIOS variable
+int adios_define_var (int64_t group_id, const char * name
+                     ,const char * path, int type
+                     ,const char * dimensions
+                     ,const char * global_dimensions
+                     ,const char * local_offsets
+                     );
+
+int adios_define_attribute (int64_t group, const char * name
+                           ,const char * path, enum ADIOS_DATATYPES type
+                           ,const char * value, const char * var
+                           );
+
+/********************************************/
+/*           F O R T R A N  A P I           */
+/********************************************/
+/* In fortran, you do not need to include this header file.
+   Just link the code with the adios library.
+*/
+/*
+void FC_FUNC_(adiosf_init, ADIOSF_INIT) (const char * config, int* err, int config_size);
+void FC_FUNC_(adiosf_init_local, ADIOSF_INIT_LOCAL) (int * err);
+void FC_FUNC_(adiosf_finalize, ADIOSF_FINALIZE) (int * mype, int * err);
+void FC_FUNC_(adiosf_allocate_buffer, ADIOSF_ALLOCATE_BUFFER) (int * err);
+void FC_FUNC_(adiosf_open, ADIOSF_OPEN) (int64_t * fd, const char * group_name, const char * name
+                 ,const char * mode, int * err
+                 ,int group_name_size, int name_size, int mode_size
+                 );
+void FC_FUNC_(adiosf_group_size, ADIOSF_GROUP_SIZE) (int64_t * fd_p, int64_t * data_size
+                       ,int64_t * total_size, void * comm, int * err
+                       );
+void FC_FUNC_(adiosf_write, ADIOSF_WRITE) (int64_t * fd_p, const char * name, void * var, int * err
+                  ,int name_size
+                  );
+void FC_FUNC_(adiosf_get_write_buffer, ADIOSF_GET_WRITE_BUFFER) (int64_t * fd_p, const char * name
+                             ,int64_t * size
+                             ,void ** buffer, int * err, int name_size
+                             );
+void FC_FUNC_(adiosf_read, ADIOSF_READ) (int64_t * fd_p, const char * name, void * buffer
+                 ,int64_t * buffer_size, int * err, int name_size
+                 );
+void FC_FUNC_(adiosf_set_path, ADIOSF_SET_PATH) (int64_t * fd_p, const char * path, int * err
+                     ,int path_size
+                     );
+void FC_FUNC_(adiosf_set_path_var, ADIOSF_SET_PATH_VAR) (int64_t * fd_p, const char * path
+                         ,const char * name, int * err
+                         ,int path_size, int name_size
+                         );
+void FC_FUNC_(adiosf_end_iteration, ADIOSF_END_ITERATION) (int * err);
+void FC_FUNC_(adiosf_start_calculation, ADIOSF_START_CALCULATION) (int * err);
+void FC_FUNC_(adiosf_stop_calculation, ADIOSF_STOP_CALCULATION) (int * err);
+void FC_FUNC_(adiosf_close, ADIOSF_CLOSE) (int64_t * fd_p, int * err);
+void FC_FUNC_(adiosf_declare_group, ADIOSF_DECLARE_GROUP) (int64_t * id, const char * name
+                          ,const char * coordination_comm
+                          ,const char * coordination_var
+                          ,const char * time_index, int * err
+                          ,int name_size, int coordination_comm_size
+                          ,int coordination_var_size, int time_index_size
+                          );
+void FC_FUNC_(adiosf_define_var, ADIOSF_DEFINE_VAR) (int64_t * group_id, const char * name
+                       ,const char * path, int * type
+                       ,const char * dimensions
+                       ,const char * global_dimensions
+                       ,const char * local_offsets, int * err
+                       ,int name_size, int path_size, int dimensions_size
+                       ,int global_dimensions_size, int local_offsets_size
+                       );
+void FC_FUNC_(adiosf_define_attribute, ADIOSF_DEFINE_ATTRIBUTE) (int64_t * group, const char * name
+                             ,const char * path, int type, const char * value
+                             ,const char * var, int * err
+                             ,int name_size, int path_size, int value_size
+                             ,int var_size
+                             );
+void FC_FUNC_(adiosf_select_method, ADIOSF_SELECT_METHOD) (int * priority, const char * method
+                          ,const char * parameters, const char * type
+                          ,const char * base_path, int * iters, int * err
+                          ,int method_size
+                          ,int parameters_size, int type_size
+                          ,int base_path_size
+                          );
+void FC_FUNC_(adiosf_select_method, ADIOSF_SELECT_METHOD) (int * priority, const char * method
+                          ,const char * parameters, const char * type
+                          ,const char * base_path, int * iters, int * err
+                          ,int method_size
+                          ,int parameters_size, int type_size
+                          ,int base_path_size
+                          );
+*/
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/src/adios_bp_v1.c b/src/adios_bp_v1.c
new file mode 100644
index 0000000..c07ed12
--- /dev/null
+++ b/src/adios_bp_v1.c
@@ -0,0 +1,2323 @@
+/*
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <errno.h>
+#include <arpa/inet.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include "adios_types.h"
+#include "adios_internals.h"
+#include "adios_bp_v1.h"
+#include "adios_endianness.h"
+
+#if defined(__APPLE__)
+#    define O_LARGEFILE 0
+#endif
+
+#define BYTE_ALIGN 8
+static void alloc_aligned (struct adios_bp_buffer_struct_v1 * b, uint64_t size)
+{
+    b->allocated_buff_ptr = malloc (size + BYTE_ALIGN - 1);
+    if (!b->allocated_buff_ptr)
+    {
+        fprintf (stderr, "Cannot allocate: %llu\n", size);
+
+        b->buff = 0;
+        b->length = 0;
+
+        return;
+    }
+    uint64_t p = (uint64_t) b->allocated_buff_ptr;
+    b->buff = (char *) ((p + BYTE_ALIGN - 1) & ~(BYTE_ALIGN - 1));
+    b->length = size;
+}
+
+static void realloc_aligned (struct adios_bp_buffer_struct_v1 * b
+                            ,uint64_t size
+                            )
+{
+    b->allocated_buff_ptr = realloc (b->allocated_buff_ptr
+                                    ,size + BYTE_ALIGN - 1
+                                    );
+    if (!b->allocated_buff_ptr)
+    {
+        fprintf (stderr, "Cannot allocate: %llu\n", size);
+
+        b->buff = 0;
+        b->length = 0;
+
+        return;
+    }
+    uint64_t p = (uint64_t) b->allocated_buff_ptr;
+    b->buff = (char *) ((p + BYTE_ALIGN - 1) & ~(BYTE_ALIGN - 1));
+    b->length = size;
+}
+
+void adios_shared_buffer_free (struct adios_bp_buffer_struct_v1 * b)
+{
+    if (b->allocated_buff_ptr)
+        free (b->allocated_buff_ptr);
+    b->allocated_buff_ptr = 0;
+    b->buff = 0;
+    b->offset = 0;
+    b->length = 0;
+}
+
+void adios_buffer_struct_init (struct adios_bp_buffer_struct_v1 * b)
+{
+    b->f = -1;
+    b->allocated_buff_ptr = 0;
+    b->buff = 0;
+    b->length = 0;
+    b->change_endianness = adios_flag_unknown;
+    b->version = 0;
+    b->offset = 0;
+    b->end_of_pgs = 0;
+    b->pg_index_offset = 0;
+    b->pg_size = 0;
+    b->vars_index_offset = 0;
+    b->vars_size = 0;
+    b->file_size = 0;
+    b->read_pg_offset = 0;
+    b->read_pg_size = 0;
+}
+
+void adios_buffer_struct_clear (struct adios_bp_buffer_struct_v1 * b)
+{
+    if (b->allocated_buff_ptr)
+        free (b->allocated_buff_ptr);
+    adios_buffer_struct_init (b);
+}
+
+// *****************************************************************************
+// buff must be 4 bytes
+int adios_parse_version (struct adios_bp_buffer_struct_v1 * b
+                        ,uint32_t * version
+                        )
+{
+    // if high bit set, big endian
+    uint32_t test = 1;
+
+    if (b->length < 4)
+    {
+        fprintf (stderr, "adios_parse_version requires a buffer of at least "
+                         "4 bytes.  Only %llu were provided\n"
+                ,b->length
+                );
+
+        return 1;
+    }
+
+    *version = ntohl (*(uint32_t *) (b->buff + b->offset));
+    char *v = (char *) version;
+    if (   (*v && !*(char *) &test)       // both writer and this machine are big endian
+        || (!*(v+3) && *(char *) &test)   // both are little endian
+       )
+    {
+        b->change_endianness = adios_flag_no;
+        //fprintf(stderr, "no need to change endianness\n");
+    }
+    else
+    {
+        //fprintf(stderr, "change endianness\n");
+        b->change_endianness = adios_flag_yes;
+    }
+
+    *version = *version & 0x7fffffff;
+
+    return 0;
+}
+
+// buff must be 16 bytes
+int adios_parse_index_offsets_v1 (struct adios_bp_buffer_struct_v1 * b)
+{
+    if (b->length - b->offset < 24)
+    {
+        fprintf (stderr, "adios_parse_index_offsets_v1 requires a buffer of "
+                         "at least 24 bytes.  Only %llu were provided\n"
+                ,b->length - b->offset
+                );
+
+        return 1;
+    }
+
+    uint64_t attrs_end = b->file_size - 28;
+    int i;
+
+    char * t;
+
+    t = b->buff + b->offset;
+    b->pg_index_offset = *(uint64_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_64(b->pg_index_offset);
+    }
+
+    b->offset += 8;
+
+    b->vars_index_offset = *(uint64_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_64(b->vars_index_offset);
+    }
+
+    t = b->buff + b->offset;
+    b->offset += 8;
+
+    b->attrs_index_offset = *(uint64_t *) (b->buff + b->offset);
+    t = b->buff + b->offset;
+    if(b->change_endianness == adios_flag_yes) {
+        swap_64(b->attrs_index_offset);
+    }
+
+    b->offset += 8;
+
+    b->end_of_pgs = b->pg_index_offset;
+    b->pg_size = b->vars_index_offset - b->pg_index_offset;
+    b->vars_size = b->attrs_index_offset - b->vars_index_offset;
+    b->attrs_size = attrs_end - b->attrs_index_offset;
+
+    return 0;
+}
+
+int adios_parse_process_group_index_v1 (struct adios_bp_buffer_struct_v1 * b
+                         ,struct adios_index_process_group_struct_v1 ** pg_root
+                         )
+{
+    struct adios_index_process_group_struct_v1 ** root;
+    if (b->length - b->offset < 16)
+    {
+        fprintf (stderr, "adios_parse_process_group_index_v1 requires a buffer "
+                         "of at least 16 bytes.  Only %llu were provided\n"
+                ,b->length - b->offset
+                );
+
+        return 1;
+    }
+
+    root = pg_root;
+
+    uint64_t process_groups_count;
+    uint64_t process_groups_length;
+
+    process_groups_count = *(uint64_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_64(process_groups_count);
+    }
+    b->offset += 8;
+
+    process_groups_length = *(uint64_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_64(process_groups_length);
+    }
+    b->offset += 8;
+
+    // validate remaining length
+
+    uint64_t i;
+    for (i = 0; i < process_groups_count; i++)
+    {
+        uint16_t length_of_group;
+        // validate remaining length
+        length_of_group = *(uint16_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_16(length_of_group);
+        }
+        b->offset += 2;
+
+        if (!*root)
+        {
+            *root = (struct adios_index_process_group_struct_v1 *)
+                   malloc (sizeof(struct adios_index_process_group_struct_v1));
+            (*root)->next = 0;
+        }
+        uint16_t length_of_name;
+
+        length_of_name = *(uint16_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_16(length_of_name);
+        }
+        b->offset += 2;
+        (*root)->group_name = (char *) malloc (length_of_name + 1);
+        (*root)->group_name [length_of_name] = '\0';
+        memcpy ((*root)->group_name, b->buff + b->offset, length_of_name);
+        b->offset += length_of_name;
+
+        (*root)->adios_host_language_fortran =
+                             (*(b->buff + b->offset) == 'y' ? adios_flag_yes
+                                                            : adios_flag_no
+                             );
+        b->offset += 1;
+
+        (*root)->process_id = *(uint32_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_32((*root)->process_id);
+        }
+        b->offset += 4;
+
+        length_of_name = *(uint16_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_16(length_of_name);
+        }
+        b->offset += 2;
+        (*root)->time_index_name = (char *) malloc (length_of_name + 1);
+        (*root)->time_index_name [length_of_name] = '\0';
+        memcpy ((*root)->time_index_name, b->buff + b->offset, length_of_name);
+        b->offset += length_of_name;
+
+        (*root)->time_index = *(uint32_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_32((*root)->time_index);
+        }
+        b->offset += 4;
+
+        (*root)->offset_in_file = *(uint64_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_64((*root)->offset_in_file);
+        }
+        b->offset += 8;
+
+        root = &(*root)->next;
+    }
+
+    return 0;
+}
+
+int adios_parse_vars_index_v1 (struct adios_bp_buffer_struct_v1 * b
+                              ,struct adios_index_var_struct_v1 ** vars_root
+                              )
+{
+    struct adios_index_var_struct_v1 ** root;
+
+    if (b->length - b->offset < 10)
+    {
+        fprintf (stderr, "adios_parse_vars_index_v1 requires a buffer "
+                         "of at least 10 bytes.  Only %llu were provided\n"
+                ,b->length - b->offset
+                );
+
+        return 1;
+    }
+
+    root = vars_root;
+
+    uint16_t vars_count;
+    uint64_t vars_length;
+
+    vars_count = *(uint16_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_16(vars_count);
+    }
+    b->offset += 2;
+
+    vars_length = *(uint64_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_64(vars_length);
+    }
+    b->offset += 8;
+
+    // validate remaining length
+
+    int i;
+    for (i = 0; i < vars_count; i++)
+    {
+        if (!*root)
+        {
+            *root = (struct adios_index_var_struct_v1 *)
+                          malloc (sizeof (struct adios_index_var_struct_v1));
+            (*root)->next = 0;
+        }
+        uint8_t flag;
+        uint32_t var_entry_length;
+        uint16_t len;
+        uint64_t characteristics_sets_count;
+        uint64_t type_size;
+
+        var_entry_length = *(uint32_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_32(var_entry_length);
+        }
+        b->offset += 4;
+
+        (*root)->id = *(uint16_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_16((*root)->id);
+        }
+        b->offset += 2;
+
+        len = *(uint16_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_16(len);
+        }
+        b->offset += 2;
+        (*root)->group_name = (char *) malloc (len + 1);
+        (*root)->group_name [len] = '\0';
+        strncpy ((*root)->group_name, b->buff + b->offset, len);
+        b->offset += len;
+
+        len = *(uint16_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_16(len);
+        }
+        b->offset += 2;
+        (*root)->var_name = (char *) malloc (len + 1);
+        (*root)->var_name [len] = '\0';
+        strncpy ((*root)->var_name, b->buff + b->offset, len);
+        b->offset += len;
+
+        len = *(uint16_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_16(len);
+        }
+        b->offset += 2;
+        (*root)->var_path = (char *) malloc (len + 1);
+        (*root)->var_path [len] = '\0';
+        strncpy ((*root)->var_path, b->buff + b->offset, len);
+        b->offset += len;
+
+        flag = *(b->buff + b->offset);
+        (*root)->type = (enum ADIOS_DATATYPES) flag;
+        b->offset += 1;
+        type_size = adios_get_type_size ((*root)->type, "");
+
+        characteristics_sets_count = *(uint64_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_64(characteristics_sets_count);
+        }
+        (*root)->characteristics_count = characteristics_sets_count;
+        (*root)->characteristics_allocated = characteristics_sets_count;
+        b->offset += 8;
+
+        // validate remaining length: offsets_count * (8 + 2 * (size of type))
+        uint64_t j;
+        (*root)->characteristics = malloc (characteristics_sets_count
+                         * sizeof (struct adios_index_characteristic_struct_v1)
+                        );
+        memset ((*root)->characteristics, 0
+               ,  characteristics_sets_count
+                * sizeof (struct adios_index_characteristic_struct_v1)
+               );
+        for (j = 0; j < characteristics_sets_count; j++)
+        {
+            uint8_t characteristic_set_count;
+            uint32_t characteristic_set_length;
+            uint8_t item = 0;
+
+            (*root)->characteristics [j].stats = 0;
+            characteristic_set_count = (uint8_t) *(b->buff + b->offset);
+            b->offset += 1;
+
+            characteristic_set_length = *(uint32_t *) (b->buff + b->offset);
+            if(b->change_endianness == adios_flag_yes) {
+                swap_32(characteristic_set_length);
+            }
+            b->offset += 4;
+
+            while (item < characteristic_set_count)
+            {
+                uint8_t flag;
+                enum ADIOS_CHARACTERISTICS c;
+                flag = *(b->buff + b->offset);
+                c = (enum ADIOS_CHARACTERISTICS) flag;
+                b->offset += 1;
+
+                switch (c)
+                {
+                    case adios_characteristic_min:
+                    case adios_characteristic_max:
+                    case adios_characteristic_value:
+                    {
+                        uint16_t data_size;
+                        void * data = 0;
+
+                        if ((*root)->type == adios_string)
+                        {
+                            data_size = *(uint16_t *) (b->buff + b->offset);
+                            if(b->change_endianness == adios_flag_yes) {
+                                swap_16(data_size);
+                            }
+                            b->offset += 2;
+                        }
+                        else
+                        {
+                            data_size = adios_get_type_size ((*root)->type, "");
+                        }
+
+                        switch ((*root)->type)
+                        {
+                            case adios_byte:
+                            case adios_short:
+                            case adios_integer:
+                            case adios_long:
+                            case adios_unsigned_byte:
+                            case adios_unsigned_short:
+                            case adios_unsigned_integer:
+                            case adios_unsigned_long:
+                            case adios_real:
+                            case adios_double:
+                            case adios_long_double:
+                            case adios_complex:
+                            case adios_double_complex:
+                                data = malloc (data_size);
+
+                                if (!data)
+                                {
+                                    fprintf (stderr, "cannot allocate %d bytes "
+                                                     "to copy scalar %s\n"
+                                            ,data_size
+                                            ,(*root)->var_name
+                                            );
+
+                                    return 1;
+                                }
+
+                                memcpy (data, (b->buff + b->offset), data_size);
+                                if(b->change_endianness == adios_flag_yes) {
+                                    if((*root)->type == adios_complex) {
+                                        // TODO
+                                    }
+                                    else if((*root)->type == adios_double_complex) {
+                                        // TODO
+                                    }
+                                    else {
+                                        switch(data_size)
+                                        {
+                                            case 2:
+                                                swap_16_ptr(data);
+                                                break;
+                                            case 4:
+                                                swap_32_ptr(data);
+                                                break;
+                                            case 8:
+                                                swap_64_ptr(data);
+                                                break;
+                                            case 16:
+                                                swap_128_ptr(data);
+                                                break;
+                                       }
+                                    }
+                                }
+                                b->offset += data_size;
+                                break;
+
+                            case adios_string:
+                                data = malloc (data_size + 1);
+
+                                if (!data)
+                                {
+                                    fprintf (stderr, "cannot allocate %d bytes "
+                                                     "to copy scalar %s\n"
+                                            ,data_size
+                                            ,(*root)->var_name
+                                            );
+
+                                    return 1;
+                                }
+
+                                ((char *) data) [data_size] = '\0';
+                                memcpy (data, (b->buff + b->offset), data_size);
+                                b->offset += data_size;
+                                break;
+
+                            default:
+                                data = 0;
+                                break;
+                        }
+
+                        switch (c)
+                        {
+                            case adios_characteristic_value:
+                                (*root)->characteristics [j].value = data;
+                                break;
+
+                            // NCSU - reading older bp files
+                            // adios_characteristic_min, max are not used anymore. If this is encountered it is an older bp file format
+                            // Code below reads min and min, and sets the bitmap for those 2 alone
+                            case adios_characteristic_min:
+                                if (!(*root)->characteristics [j].stats)
+                                {
+                                    (*root)->characteristics [j].stats = malloc (sizeof(struct adios_index_characteristics_stat_struct *));
+                                    (*root)->characteristics [j].stats[0] = malloc (2 * sizeof(struct adios_index_characteristics_stat_struct));
+                                    (*root)->characteristics [j].bitmap = 0;
+                                }
+                                (*root)->characteristics [j].stats[0][adios_statistic_min].data = data;
+                                (*root)->characteristics [j].bitmap |= (1 << adios_statistic_min);
+                                break;
+
+                            case adios_characteristic_max:
+                                if (!(*root)->characteristics [j].stats)
+                                {
+                                    (*root)->characteristics [j].stats = malloc (sizeof(struct adios_index_characteristics_stat_struct *));
+                                    (*root)->characteristics [j].stats[0] = malloc (2 * sizeof(struct adios_index_characteristics_stat_struct));
+                                    (*root)->characteristics [j].bitmap = 0;
+                                }
+                                (*root)->characteristics [j].stats[0][adios_statistic_max].data = data;
+                                (*root)->characteristics [j].bitmap |= (1 << adios_statistic_max);
+                                break;
+                        }
+                        break;
+                    }
+
+                    // NCSU - Statistics - Parsing stat related info from bp file based on the bitmap
+                    case adios_characteristic_stat:
+                    {
+                        uint8_t k, c, idx;
+                        uint64_t count = adios_get_stat_set_count((*root)->type);
+                        uint16_t characteristic_size;
+
+                        (*root)->characteristics [j].stats = malloc (count * sizeof(struct adios_index_characteristics_stat_struct *));
+
+                        for (c = 0; c < count; c ++)
+                        {
+                            (*root)->characteristics [j].stats[c] = calloc(ADIOS_STAT_LENGTH, sizeof(struct adios_index_characteristics_stat_struct));
+
+                            k = idx = 0;
+                            while ((*root)->characteristics[j].bitmap >> k)
+                            {
+                                (*root)->characteristics [j].stats[c][k].data = 0;
+
+                                if (((*root)->characteristics[j].bitmap >> k) & 1)
+                                {
+                                    if (k == adios_statistic_hist)
+                                    {
+                                        struct adios_index_characteristics_hist_struct * hist = malloc(sizeof(struct adios_index_characteristics_hist_struct));
+                                        uint32_t bi, num_breaks;
+
+                                        (*root)->characteristics [j].stats[c][idx].data = hist;
+
+                                        // Getting the number of breaks of histogram
+                                        hist->num_breaks = * (uint32_t *) (b->buff + b->offset);
+                                        if(b->change_endianness == adios_flag_yes) {
+                                            swap_32(hist->num_breaks);
+                                        }
+                                        b->offset += 4;
+
+                                        num_breaks = hist->num_breaks;
+
+                                        // Getting the min of histogram
+                                        hist->max = *(double *) (b->buff + b->offset);
+                                        if(b->change_endianness == adios_flag_yes) {
+                                            swap_64(hist->min);
+                                        }
+                                        b->offset += 8;
+
+                                        // Getting the max of histogram
+                                        hist->max = *(double *) (b->buff + b->offset);
+                                        if(b->change_endianness == adios_flag_yes) {
+                                            swap_64(hist->max);
+                                        }
+                                        b->offset += 8;
+
+                                        // Getting the frequencies of the histogram
+                                        hist->frequencies = malloc ((num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, ""));
+                                        memcpy(hist->frequencies, (b->buff + b->offset), (num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, ""));
+
+                                        if(b->change_endianness == adios_flag_yes) {
+                                            for(bi = 0; bi <= num_breaks; bi ++) {
+                                                swap_32(hist->frequencies[bi]);
+                                            }
+                                        }
+                                        b->offset += 4 * (num_breaks + 1);
+
+                                        // Getting the breaks of the histogram
+                                        hist->breaks = malloc (num_breaks * adios_get_type_size(adios_double, ""));
+                                        memcpy(hist->breaks, (b->buff + b->offset), num_breaks * adios_get_type_size(adios_double, ""));
+                                        if(b->change_endianness == adios_flag_yes) {
+                                            for(bi = 0; bi < num_breaks; bi ++)
+                                                swap_64(hist->breaks[bi]);
+                                        }
+                                        b->offset += 8 * num_breaks;
+                                    }
+                                    else
+                                    {
+                                        // NCSU - Generic for non-histogram data
+                                        characteristic_size = adios_get_stat_size((*root)->characteristics [j].stats[c][idx].data, (*root)->type, k);
+                                        (*root)->characteristics [j].stats[c][idx].data = malloc (characteristic_size);
+
+                                        void * data = (*root)->characteristics [j].stats[c][idx].data;
+                                        memcpy (data, (b->buff + b->offset), characteristic_size);
+                                        b->offset += characteristic_size;
+
+                                        if(b->change_endianness == adios_flag_yes)
+                                            swap_ptr(data, characteristic_size * 8);
+                                    }
+                                    idx ++;
+                                }
+                                k ++;
+                            }
+                        }
+                        break;
+                    }
+
+                    // NCSU - Reading bitmap value
+                    case adios_characteristic_bitmap:
+                    {
+                        (*root)->characteristics [j].bitmap =
+                                            *(uint32_t *) (b->buff + b->offset);
+                        if(b->change_endianness == adios_flag_yes) {
+                            swap_32((*root)->characteristics [j].bitmap);
+                        }
+                        b->offset += 4;
+                        break;
+                    }
+
+                    case adios_characteristic_offset:
+                    {
+                        uint64_t size = adios_get_type_size ((*root)->type, "");
+                        (*root)->characteristics [j].offset =
+                                            *(uint64_t *) (b->buff + b->offset);
+                        if(b->change_endianness == adios_flag_yes) {
+                            swap_64((*root)->characteristics [j].offset);
+                        }
+                        b->offset += 8;
+
+                        break;
+                    }
+
+                    case adios_characteristic_payload_offset:
+                    {
+                        uint64_t size = adios_get_type_size ((*root)->type, "");
+                        (*root)->characteristics [j].payload_offset =
+                                            *(uint64_t *) (b->buff + b->offset);
+                        if(b->change_endianness == adios_flag_yes) {
+                            swap_64((*root)->characteristics [j].payload_offset);
+                        }
+                        b->offset += 8;
+
+                        break;
+                    }
+
+                    case adios_characteristic_file_name:
+                    {
+                        len = *(uint16_t *) (b->buff + b->offset);
+                        if(b->change_endianness == adios_flag_yes) {
+                            swap_64(len);
+                        }
+                        b->offset += 2;
+
+                        (*root)->characteristics [j].file_name = malloc (len + 1);
+                        (*root)->characteristics [j].file_name[len] = '\0';
+                        strncpy ((*root)->characteristics [j].file_name, b->buff + b->offset, len);
+                        b->offset += len;
+
+                        break;
+                    }
+
+                    case adios_characteristic_time_index:
+                    {
+                        (*root)->characteristics [j].time_index =
+                                            *(uint32_t *) (b->buff + b->offset);
+                        if(b->change_endianness == adios_flag_yes) {
+                            swap_32((*root)->characteristics [j].time_index);
+                        }
+                        b->offset += 4;
+
+                        break;
+                    }
+
+                    case adios_characteristic_dimensions:
+                    {
+                        uint16_t dims_length;
+
+                        (*root)->characteristics [j].dims.count =
+                                           *(uint8_t *) (b->buff + b->offset);
+                        b->offset += 1;
+
+                        dims_length = *(uint16_t *) (b->buff + b->offset);
+                        if(b->change_endianness == adios_flag_yes) {
+                            swap_16(dims_length);
+                        }
+                        b->offset += 2;
+
+                       (*root)->characteristics [j].dims.dims = (uint64_t *)
+                                                         malloc (dims_length);
+                       memcpy ((*root)->characteristics [j].dims.dims
+                              ,(b->buff + b->offset)
+                              ,dims_length
+                              );
+                        if(b->change_endianness == adios_flag_yes) {
+                            uint16_t di = 0;
+                            uint16_t dims_num = dims_length / 8;
+                            for (di = 0; di < dims_num; di ++) {
+                                swap_64(((*root)->characteristics [j].dims.dims)[di]);
+                            }
+                        }
+                        b->offset += dims_length;
+                    }
+                }
+                item++;
+            }
+        }
+
+        root = &(*root)->next;
+    }
+
+    return 0;
+}
+
+int adios_parse_attributes_index_v1 (struct adios_bp_buffer_struct_v1 * b
+                          ,struct adios_index_attribute_struct_v1 ** attrs_root
+                          )
+{
+    struct adios_index_attribute_struct_v1 ** root;
+
+    if (b->length - b->offset < 10)
+    {
+        fprintf (stderr, "adios_parse_attributes_index_v1 requires a buffer "
+                         "of at least 10 bytes.  Only %llu were provided\n"
+                ,b->length - b->offset
+                );
+
+        return 1;
+    }
+
+    root = attrs_root;
+
+    uint16_t attrs_count;
+    uint64_t attrs_length;
+
+    attrs_count = *(uint16_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_16(attrs_count);
+    }
+    b->offset += 2;
+
+    attrs_length = *(uint64_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_64(attrs_length);
+    }
+    b->offset += 8;
+
+    // validate remaining length
+
+    int i;
+    for (i = 0; i < attrs_count; i++)
+    {
+        if (!*root)
+        {
+            *root = (struct adios_index_attribute_struct_v1 *)
+                      malloc (sizeof (struct adios_index_attribute_struct_v1));
+            (*root)->next = 0;
+        }
+        uint8_t flag;
+        uint32_t attr_entry_length;
+        uint16_t len;
+        uint64_t characteristics_sets_count;
+        uint64_t type_size;
+
+        attr_entry_length = *(uint32_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_32(attr_entry_length);
+        }
+        b->offset += 4;
+
+        (*root)->id = *(uint16_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_16((*root)->id);
+        }
+        b->offset += 2;
+
+        len = *(uint16_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_16(len);
+        }
+        b->offset += 2;
+        (*root)->group_name = (char *) malloc (len + 1);
+        (*root)->group_name [len] = '\0';
+        strncpy ((*root)->group_name, b->buff + b->offset, len);
+        b->offset += len;
+
+        len = *(uint16_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_16(len);
+        }
+        b->offset += 2;
+        (*root)->attr_name = (char *) malloc (len + 1);
+        (*root)->attr_name [len] = '\0';
+        strncpy ((*root)->attr_name, b->buff + b->offset, len);
+        b->offset += len;
+
+        len = *(uint16_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_16(len);
+        }
+        b->offset += 2;
+        (*root)->attr_path = (char *) malloc (len + 1);
+        (*root)->attr_path [len] = '\0';
+        strncpy ((*root)->attr_path, b->buff + b->offset, len);
+        b->offset += len;
+
+        flag = *(b->buff + b->offset);
+        (*root)->type = (enum ADIOS_DATATYPES) flag;
+        b->offset += 1;
+        type_size = adios_get_type_size ((*root)->type, "");
+
+        characteristics_sets_count = *(uint64_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_64(characteristics_sets_count);
+        }
+        (*root)->characteristics_count = characteristics_sets_count;
+        (*root)->characteristics_allocated = characteristics_sets_count;
+        b->offset += 8;
+
+        // validate remaining length: offsets_count * (8 + 2 * (size of type))
+        uint64_t j;
+        (*root)->characteristics = malloc (characteristics_sets_count
+                       * sizeof (struct adios_index_characteristic_struct_v1)
+                      );
+        memset ((*root)->characteristics, 0
+               ,  characteristics_sets_count
+                * sizeof (struct adios_index_characteristic_struct_v1)
+               );
+        for (j = 0; j < characteristics_sets_count; j++)
+        {
+            uint8_t characteristic_set_count;
+            uint32_t characteristic_set_length;
+            uint8_t item = 0;
+
+            characteristic_set_count = (uint8_t) *(b->buff + b->offset);
+            b->offset += 1;
+
+            characteristic_set_length = *(uint32_t *) (b->buff + b->offset);
+            if(b->change_endianness == adios_flag_yes) {
+                swap_32(characteristic_set_length);
+            }
+            b->offset += 4;
+
+            while (item < characteristic_set_count)
+            {
+                uint8_t flag;
+                enum ADIOS_CHARACTERISTICS c;
+                flag = *(b->buff + b->offset);
+                c = (enum ADIOS_CHARACTERISTICS) flag;
+                b->offset += 1;
+
+                switch (c)
+                {
+                    case adios_characteristic_value:
+                    {
+                        uint16_t data_size;
+                        void * data = 0;
+
+                        if ((*root)->type == adios_string)
+                        {
+                            data_size = *(uint16_t *) (b->buff + b->offset);
+                            if(b->change_endianness == adios_flag_yes) {
+                                swap_16(data_size);
+                            }
+                            b->offset += 2;
+                        }
+                        else
+                        {
+                            data_size = adios_get_type_size ((*root)->type, "");
+                        }
+
+                        data = malloc (data_size + 1);
+                        ((char *) data) [data_size] = '\0';
+
+                        if (!data)
+                        {
+                            fprintf (stderr, "cannot allocate %d bytes to "
+                                             "copy scalar %s\n"
+                                    ,data_size
+                                    ,(*root)->attr_name
+                                    );
+
+                            return 1;
+                        }
+
+                        switch ((*root)->type)
+                        {
+                            case adios_byte:
+                            case adios_short:
+                            case adios_integer:
+                            case adios_long:
+                            case adios_unsigned_byte:
+                            case adios_unsigned_short:
+                            case adios_unsigned_integer:
+                            case adios_unsigned_long:
+                            case adios_real:
+                            case adios_double:
+                            case adios_long_double:
+                            case adios_complex:
+                            case adios_double_complex:
+                                memcpy (data, (b->buff + b->offset), data_size);
+
+                                if(b->change_endianness == adios_flag_yes) {
+                                    if((*root)->type == adios_complex) {
+                                        // TODO
+                                    }
+                                    else if((*root)->type == adios_double_complex) {
+                                        // TODO
+                                    }
+                                    else {
+                                        switch(data_size)
+                                        {
+                                            case 2:
+                                                swap_16_ptr(data);
+                                                break;
+                                            case 4:
+                                                swap_32_ptr(data);
+                                                break;
+                                            case 8:
+                                                swap_64_ptr(data);
+                                                break;
+                                            case 16:
+                                                swap_128_ptr(data);
+                                                break;
+                                        }
+                                    }
+                                }
+
+                                b->offset += data_size;
+                                break;
+                            case adios_string:
+                                memcpy (data, (b->buff + b->offset), data_size);
+                                b->offset += data_size;
+                                break;
+
+                            default:
+                                free (data);
+                                data = 0;
+                                break;
+                        }
+
+                        (*root)->characteristics [j].value = data;
+
+                        break;
+                    }
+
+                    case adios_characteristic_offset:
+                    {
+                        uint64_t size = adios_get_type_size ((*root)->type, "");
+                        (*root)->characteristics [j].offset =
+                                            *(uint64_t *) (b->buff + b->offset);
+                        if(b->change_endianness == adios_flag_yes) {
+                            swap_64((*root)->characteristics [j].offset);
+                        }
+                        b->offset += 8;
+
+                        break;
+                    }
+
+                    case adios_characteristic_bitmap:
+                    {
+                        uint32_t size = adios_get_type_size ((*root)->type, "");
+                        (*root)->characteristics [j].offset =
+                                            *(uint32_t *) (b->buff + b->offset);
+                        if(b->change_endianness == adios_flag_yes) {
+                            swap_32((*root)->characteristics [j].offset);
+                        }
+                        b->offset += 4;
+
+                        break;
+                    }
+
+                    case adios_characteristic_payload_offset:
+                    {
+                        uint64_t size = adios_get_type_size ((*root)->type, "");
+                        (*root)->characteristics [j].payload_offset =
+                                            *(uint64_t *) (b->buff + b->offset);
+                        if(b->change_endianness == adios_flag_yes) {
+                            swap_64((*root)->characteristics [j].payload_offset);
+                        }
+                        b->offset += 8;
+
+                        break;
+                    }
+
+                    case adios_characteristic_file_name:
+                    {
+                        len = *(uint16_t *) (b->buff + b->offset);
+                        if(b->change_endianness == adios_flag_yes) {
+                            swap_64(len);
+                        }
+                        b->offset += 2;
+
+                        (*root)->characteristics [j].file_name = malloc (len + 1);
+                        (*root)->characteristics [j].file_name[len] = '\0';
+                        strncpy ((*root)->characteristics [j].file_name, b->buff + b->offset, len);
+                        b->offset += len;
+
+                        break;
+                    }
+
+                    case adios_characteristic_time_index:
+                    {
+                        (*root)->characteristics [j].time_index =
+                                            *(uint32_t *) (b->buff + b->offset);
+                        if(b->change_endianness == adios_flag_yes) {
+                            swap_32((*root)->characteristics [j].time_index);
+                        }
+                        b->offset += 4;
+
+                        break;
+                    }
+
+                    case adios_characteristic_var_id:
+                    {
+                        (*root)->characteristics [j].var_id =
+                                            *(uint16_t *) (b->buff + b->offset);
+                        if(b->change_endianness == adios_flag_yes) {
+                            swap_16((*root)->characteristics [j].var_id);
+                        }
+                        b->offset += 2;
+
+                        break;
+                    }
+                }
+                item++;
+            }
+        }
+
+        root = &(*root)->next;
+    }
+
+    return 0;
+}
+
+int adios_parse_process_group_header_v1 (struct adios_bp_buffer_struct_v1 * b
+                       ,struct adios_process_group_header_struct_v1 * pg_header
+                            )
+{
+    if (b->length - b->offset < 16)
+    {
+        fprintf (stderr, "adios_parse_process_group_header_v1 requires a "
+                         "buffer of at least 16 bytes.  "
+                         "Only %llu were provided\n"
+                ,b->length - b->offset
+                );
+
+        return 1;
+    }
+
+    uint64_t size;
+    size = *(uint64_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_64(size);
+    }
+    b->offset += 8;
+
+    pg_header->host_language_fortran =
+                             (*(b->buff + b->offset) == 'y' ? adios_flag_yes
+                                                            : adios_flag_no
+                             );
+    b->offset += 1;
+
+    uint16_t len;
+    uint8_t count;
+    len = *(uint16_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_16(len);
+    }
+    b->offset += 2;
+    pg_header->name = (char *) malloc (len + 1);
+    pg_header->name [len] = '\0';
+    memcpy (pg_header->name, b->buff + b->offset, len);
+    b->offset += len;
+
+    pg_header->coord_var_id = *(uint16_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_16(pg_header->coord_var_id);
+    }
+    b->offset += 2;
+    len = *(uint16_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_16(len);
+    }
+    b->offset += 2;
+    pg_header->time_index_name = (char *) malloc (len + 1);
+    pg_header->time_index_name [len] = '\0';
+    memcpy (pg_header->time_index_name, b->buff + b->offset, len);
+    b->offset += len;
+
+    pg_header->time_index = *(uint32_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_32(pg_header->time_index);
+    }
+    b->offset += 4;
+
+    pg_header->methods_count = *(b->buff + b->offset);
+    b->offset += 1;
+
+    // length of methods section
+    len = *(uint16_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_16(len);
+    }
+    b->offset += 2;
+
+    int i;
+    struct adios_method_info_struct_v1 ** root;
+
+    pg_header->methods = 0;
+    root = &pg_header->methods;
+    for (i = 0; i < pg_header->methods_count; i++)
+    {
+        uint8_t flag;
+        if (!*root)
+        {
+            *root = (struct adios_method_info_struct_v1 *)
+                        malloc (sizeof (struct adios_method_info_struct_v1));
+            (*root)->next = 0;
+        }
+
+        flag = *(b->buff + b->offset);
+        (*root)->id = (enum ADIOS_IO_METHOD) flag;
+        b->offset += 1;
+
+        len = *(uint16_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_16(len);
+        }
+        b->offset += 2;
+        (*root)->parameters = (char *) malloc (len + 1);
+        (*root)->parameters [len] = '\0';
+        strncpy ((*root)->parameters, b->buff + b->offset, len);
+        b->offset += len;
+
+        root = &(*root)->next;
+    }
+
+    return 0;
+}
+
+int adios_parse_vars_header_v1 (struct adios_bp_buffer_struct_v1 * b
+                               ,struct adios_vars_header_struct_v1 * vars_header
+                               )
+{
+
+    if (b->length - b->offset < 10)
+    {
+        fprintf (stderr, "adios_parse_vars_header_v1 requires a "
+                         "buffer of at least 10 bytes.  "
+                         "Only %llu were provided\n"
+                ,b->length - b->offset
+                );
+
+        vars_header->count = 0;
+        vars_header->length = 0;
+
+        return 1;
+    }
+
+    vars_header->count = *(uint16_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_16(vars_header->count);
+    }
+    b->offset += 2;
+    vars_header->length = *(uint64_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_64(vars_header->length);
+    }
+    b->offset += 8;
+
+    return 0;
+}
+
+int adios_parse_var_data_header_v1 (struct adios_bp_buffer_struct_v1 * b
+                               ,struct adios_var_header_struct_v1 * var_header
+                               )
+{
+    if (b->length - b->offset < 21)
+    {
+        fprintf (stderr, "adios_parse_var_data_header_v1 requires a "
+                         "buffer of at least 21 bytes.  "
+                         "Only %llu were provided\n"
+                ,b->length - b->offset
+                );
+
+        return 1;
+    }
+
+    uint64_t initial_offset = b->offset;  // save to calc payload size
+    uint64_t length_of_var;
+    uint16_t len;
+    uint8_t flag;
+
+    length_of_var = *(uint64_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_64(length_of_var);
+    }
+    b->offset += 8;
+
+    //validate remaining length
+
+    var_header->id = *(uint16_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_16(var_header->id);
+    }
+    b->offset += 2;
+
+    len = *(uint16_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_16(len);
+    }
+    b->offset += 2;
+    var_header->name = (char *) malloc (len + 1);
+    var_header->name [len] = '\0';
+    memcpy (var_header->name, b->buff + b->offset, len);
+    b->offset += len;
+
+    len = *(uint16_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_16(len);
+    }
+    b->offset += 2;
+    var_header->path = (char *) malloc (len + 1);
+    var_header->path [len] = '\0';
+    memcpy (var_header->path, b->buff + b->offset, len);
+    b->offset += len;
+
+    flag = *(b->buff + b->offset);
+    var_header->type = (enum ADIOS_DATATYPES) flag;
+    b->offset += 1;
+
+    var_header->is_dim = (*(b->buff + b->offset) == 'y' ? adios_flag_yes
+                                                        : adios_flag_no
+                         );
+    b->offset += 1;
+
+    int i;
+    uint8_t dims_count;
+    uint16_t dims_length;
+    uint8_t characteristics_count;
+    uint32_t characteristics_length;
+
+    // validate remaining length
+
+    dims_count = *(b->buff + b->offset);
+    b->offset += 1;
+    dims_length = *(uint16_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_16(dims_length);
+    }
+    b->offset += 2;
+
+    var_header->dims = 0;
+    struct adios_dimension_struct_v1 ** root = &var_header->dims;
+
+    for (i = 0; i < dims_count; i++)
+    {
+        uint8_t flag;
+
+        if (!*root)
+        {
+            *root = (struct adios_dimension_struct_v1 *)
+                           malloc (sizeof (struct adios_dimension_struct_v1));
+            (*root)->next = 0;
+        }
+
+        (*root)->dimension.rank = 0;
+        (*root)->dimension.var_id = 0;
+        (*root)->dimension.time_index = adios_flag_no;
+
+        (*root)->global_dimension.rank = 0;
+        (*root)->global_dimension.var_id = 0;
+        (*root)->global_dimension.time_index = adios_flag_no;
+
+        (*root)->local_offset.rank = 0;
+        (*root)->local_offset.var_id = 0;
+        (*root)->local_offset.time_index = adios_flag_no;
+
+        flag = *(b->buff + b->offset);
+        b->offset += 1;
+        if (flag == 'y')
+        {
+            (*root)->dimension.rank = 0;
+            (*root)->dimension.var_id = *(uint16_t *) (b->buff + b->offset);
+            if(b->change_endianness == adios_flag_yes) {
+                swap_16((*root)->dimension.var_id);
+            }
+            if ((*root)->dimension.var_id == 0)
+                (*root)->dimension.time_index = adios_flag_yes;
+            b->offset += 2;
+        }
+        else
+        {
+            (*root)->dimension.rank = *(uint64_t *) (b->buff + b->offset);
+            if(b->change_endianness == adios_flag_yes) {
+                swap_64((*root)->dimension.rank);
+            }
+            (*root)->dimension.var_id = 0;
+            b->offset += 8;
+        }
+
+        flag = *(b->buff + b->offset);
+        b->offset += 1;
+        if (flag == 'y')
+        {
+            (*root)->global_dimension.rank = 0;
+            (*root)->global_dimension.var_id = *(uint16_t *)
+                                                         (b->buff + b->offset);
+            if(b->change_endianness == adios_flag_yes) {
+                swap_16((*root)->global_dimension.var_id);
+            }
+            if ((*root)->global_dimension.var_id == 0)
+                (*root)->global_dimension.time_index = adios_flag_yes;
+            b->offset += 2;
+        }
+        else
+        {
+            (*root)->global_dimension.rank = *(uint64_t *)
+                                                         (b->buff + b->offset);
+            if(b->change_endianness == adios_flag_yes) {
+                swap_64((*root)->global_dimension.rank);
+            }
+            (*root)->global_dimension.var_id = 0;
+            b->offset += 8;
+        }
+
+        flag = *(b->buff + b->offset);
+        b->offset += 1;
+        if (flag == 'y')
+        {
+            (*root)->local_offset.rank = 0;
+            (*root)->local_offset.var_id = *(uint16_t *) (b->buff + b->offset);
+            if(b->change_endianness == adios_flag_yes) {
+                swap_16((*root)->local_offset.var_id);
+            }
+            if ((*root)->local_offset.var_id == 0)
+                (*root)->local_offset.time_index = adios_flag_yes;
+            b->offset += 2;
+        }
+        else
+        {
+            (*root)->local_offset.rank = *(uint64_t *) (b->buff + b->offset);
+            if(b->change_endianness == adios_flag_yes) {
+                swap_64((*root)->local_offset.rank);
+            }
+            (*root)->local_offset.var_id = 0;
+            b->offset += 8;
+        }
+
+        root = &(*root)->next;
+    }
+
+    characteristics_count = *(b->buff + b->offset);
+    b->offset += 1;
+    characteristics_length = *(uint32_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_32(characteristics_length);
+    }
+    b->offset += 4;
+
+    uint64_t size = adios_get_type_size (var_header->type, "");
+
+    var_header->characteristics.offset = 0;
+    var_header->characteristics.payload_offset = 0;
+    var_header->characteristics.stats = 0;
+    var_header->characteristics.value = 0;
+    var_header->characteristics.dims.count = 0;
+    var_header->characteristics.dims.dims = 0;
+    for (i = 0; i < characteristics_count; i++)
+    {
+        uint8_t flag;
+        enum ADIOS_CHARACTERISTICS c;
+
+        flag = *(b->buff + b->offset);
+        b->offset += 1;
+        c = (enum ADIOS_CHARACTERISTICS) flag;
+
+        switch (c)
+        {
+            case adios_characteristic_offset:
+                var_header->characteristics.offset = *(uint64_t *)
+                                                        (b->buff + b->offset);
+                if(b->change_endianness == adios_flag_yes) {
+                    swap_64(var_header->characteristics.offset);
+                }
+                b->offset += 8;
+                break;
+
+            case adios_characteristic_payload_offset:
+                var_header->characteristics.payload_offset = *(uint64_t *)
+                                                        (b->buff + b->offset);
+                if(b->change_endianness == adios_flag_yes) {
+                    swap_64(var_header->characteristics.payload_offset);
+                }
+                b->offset += 8;
+                break;
+
+            //NCSU - Read in bitmap
+            case adios_characteristic_bitmap:
+                var_header->characteristics.bitmap = *(uint32_t *)
+                                                        (b->buff + b->offset);
+                if(b->change_endianness == adios_flag_yes) {
+                    swap_32(var_header->characteristics.bitmap);
+                }
+                b->offset += 4;
+                break;
+
+            //NCSU - Read in the statistics
+            case adios_characteristic_stat:
+            {
+                uint8_t j = 0, idx = 0;
+                uint8_t c = 0, count = adios_get_stat_set_count (var_header->type);
+                uint64_t characteristic_size;
+
+                var_header->characteristics.stats = malloc(count * sizeof(struct adios_index_characteristics_stat_struct *));
+
+                for (c = 0; c < count; c ++)
+                {
+                    idx = j = 0;
+                    var_header->characteristics.stats[c] = calloc(ADIOS_STAT_LENGTH, sizeof(struct adios_index_characteristics_stat_struct));
+
+                    while (var_header->characteristics.bitmap >> j)
+                    {
+                        if ((var_header->characteristics.bitmap >> j) & 1)
+                        {
+                            if (j == adios_statistic_hist)
+                            {
+                                struct adios_index_characteristics_hist_struct * hist = malloc (sizeof(struct adios_index_characteristics_hist_struct));
+                                uint32_t bi, num_breaks;
+
+                                var_header->characteristics.stats[c][idx].data = hist;
+
+                                // Getting the number of bins
+                                hist->num_breaks = * (uint32_t *) (b->buff + b->offset);
+
+                                if(b->change_endianness == adios_flag_yes) {
+                                    swap_32(hist->num_breaks);
+                                }
+                                b->offset += 4;
+
+                                num_breaks = hist->num_breaks;
+
+                                // Getting the min hist value
+                                hist->min = * (double *) (b->buff + b->offset);
+                                if(b->change_endianness == adios_flag_yes) {
+                                    swap_64(hist->min);
+                                }
+                                b->offset += 8;
+
+                                // Getting the max hist value
+                                hist->max = * (double *) (b->buff + b->offset);
+
+                                if(b->change_endianness == adios_flag_yes) {
+                                    swap_64(hist->max);
+                                }
+                                b->offset += 8;
+
+                                // Getting the frequencies
+                                hist->frequencies = malloc((num_breaks + 1)  * adios_get_type_size(adios_unsigned_integer, ""));
+                                memcpy (hist->frequencies
+                                       ,(b->buff + b->offset), (num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, "")
+                                       );
+
+                                if(b->change_endianness == adios_flag_yes) {
+                                    for(bi = 0; bi <= num_breaks; bi++)
+                                        swap_32(hist->frequencies[bi]);
+                                }
+                                b->offset += 4 * (num_breaks + 1);
+
+                                // Getting the break points
+                                hist->breaks = malloc(num_breaks * adios_get_type_size(adios_double, ""));
+                                memcpy (hist->breaks, (b->buff + b->offset), num_breaks * 8);
+
+                                if(b->change_endianness == adios_flag_yes) {
+                                    for(bi = 0; bi < num_breaks; bi++)
+                                        swap_64(hist->breaks[bi]);
+                                }
+                                b->offset += 8 * num_breaks;
+                            }
+                            else
+                            {
+                                characteristic_size = adios_get_stat_size(var_header->characteristics.stats[c][idx].data, var_header->type, j);
+
+                                var_header->characteristics.stats[c][idx].data = malloc(characteristic_size);
+                                memcpy (var_header->characteristics.stats[c][idx].data, (b->buff + b->offset)
+                                   ,characteristic_size
+                                   );
+
+                                if(b->change_endianness == adios_flag_yes) {
+                                    swap_adios_type(var_header->characteristics.stats[c][idx].data, var_header->type);
+                                }
+
+                                b->offset += characteristic_size;
+                            }
+
+                            idx ++;
+                        }
+                        j ++;
+                    }
+                }
+                break;
+            }
+
+            case adios_characteristic_dimensions:
+            {
+                uint8_t dim_count;
+                uint16_t dim_length;
+
+                dim_count = *(b->buff + b->offset);
+                b->offset += 1;
+                dim_length = *(uint16_t *) (b->buff + b->offset);
+                if(b->change_endianness == adios_flag_yes) {
+                    swap_16(dim_length);
+                }
+                b->offset += 2;
+
+                var_header->characteristics.dims.dims = malloc (dim_length);
+                memcpy (var_header->characteristics.dims.dims
+                       ,(b->buff + b->offset), dim_length
+                       );
+                if(b->change_endianness == adios_flag_yes) {
+                    uint16_t di = 0;
+                    uint16_t dim_num = dim_length / 8;
+                    for (di = 0; di < dim_num; di ++) {
+                         swap_64((var_header->characteristics.dims.dims)[di]);
+                    }
+                }
+                b->offset += dim_length;
+                break;
+            }
+
+            // NCSU - Adding backward compatibility
+            // Reading min and max here implies older bp file
+            case adios_characteristic_min:
+                if (!var_header->characteristics.stats)
+                {
+                    var_header->characteristics.stats = malloc(sizeof(struct adios_index_characteristics_stat_struct *));
+                    var_header->characteristics.stats[0] = malloc(2 * sizeof(struct adios_index_characteristics_stat_struct));
+                    var_header->characteristics.bitmap = 0;
+                }
+                var_header->characteristics.stats[0][adios_statistic_min].data = malloc (size);
+                var_header->characteristics.bitmap |= (1 << adios_statistic_min);
+                memcpy (var_header->characteristics.stats[0][adios_statistic_min].data, (b->buff + b->offset)
+                       ,size
+                       );
+
+                if(b->change_endianness == adios_flag_yes) {
+                    swap_adios_type(var_header->characteristics.stats[0][adios_statistic_min].data, var_header->type);
+                }
+                b->offset += size;
+                break;
+
+            case adios_characteristic_max:
+                if (!var_header->characteristics.stats)
+                {
+                    var_header->characteristics.stats = malloc(sizeof(struct adios_index_characteristics_stat_struct *));
+                    var_header->characteristics.stats[0] = malloc(2 * sizeof(struct adios_index_characteristics_stat_struct));
+                    var_header->characteristics.bitmap = 0;
+                }
+                var_header->characteristics.stats[0][adios_statistic_max].data = malloc (size);
+                var_header->characteristics.bitmap |= (1 << adios_statistic_max);
+                memcpy (var_header->characteristics.stats[0][adios_statistic_max].data, (b->buff + b->offset)
+                       ,size
+                       );
+
+                if(b->change_endianness == adios_flag_yes) {
+                    swap_adios_type(var_header->characteristics.stats[0][adios_statistic_max].data, var_header->type);
+                }
+                b->offset += size;
+                break;
+
+            case adios_characteristic_value:
+            {
+                uint16_t val_size = *(uint16_t *) (b->buff + b->offset);
+                if(b->change_endianness == adios_flag_yes) {
+                    swap_16(val_size);
+                }
+                b->offset += 2;
+
+                var_header->characteristics.value = malloc (val_size + 1);
+                ((char *) var_header->characteristics.value) [val_size] = '\0';
+                memcpy (var_header->characteristics.value, (b->buff + b->offset)
+                       ,val_size
+                       );
+
+                // TODO: do we need byte-swap here?
+                b->offset += val_size;
+                break;
+            }
+        }
+    }
+
+    var_header->payload_size = length_of_var - (b->offset - initial_offset);
+
+    return 0;
+}
+
+int adios_clear_process_group_header_v1 (
+                       struct adios_process_group_header_struct_v1 * pg_header)
+{
+    pg_header->host_language_fortran = adios_flag_unknown;
+    if (pg_header->name)
+    {
+        free (pg_header->name);
+        pg_header->name = 0;
+    }
+    pg_header->coord_var_id = 0;
+    if (pg_header->time_index_name)
+    {
+        free (pg_header->time_index_name);
+        pg_header->time_index_name = 0;
+    }
+    pg_header->time_index = 0;
+    while (pg_header->methods)
+    {
+        struct adios_method_info_struct_v1 * t = pg_header->methods->next;
+        pg_header->methods->id = (enum ADIOS_IO_METHOD) 0;
+        if (pg_header->methods->parameters)
+        {
+            free (pg_header->methods->parameters);
+            pg_header->methods->parameters = 0;
+        }
+        free (pg_header->methods);
+        pg_header->methods = t;
+    }
+    pg_header->methods_count = 0;
+
+    return 0;
+}
+
+int adios_clear_var_header_v1 (struct adios_var_header_struct_v1 * var_header)
+{
+    if (var_header->name)
+    {
+        free (var_header->name);
+        var_header->name = 0;
+    }
+    if (var_header->path)
+    {
+        free (var_header->path);
+        var_header->path = 0;
+    }
+    while (var_header->dims)
+    {
+        struct adios_dimension_struct_v1 * d = var_header->dims->next;
+        free (var_header->dims);
+        var_header->dims = d;
+    }
+    struct adios_index_characteristic_struct_v1 * c
+                                                = &var_header->characteristics;
+
+    c->offset = 0;
+
+    // NCSU - Clear stat
+    if (c->stats)
+    {
+        uint8_t j = 0, idx = 0;
+        uint8_t i = 0, count = adios_get_stat_set_count(var_header->type);
+
+        while (c->bitmap >> j)
+        {
+            if ((c->bitmap >> j) & 1)
+            {
+                for (i = 0; i < count; i ++)
+				{
+					if (j == adios_statistic_hist)
+					{
+						struct adios_index_characteristics_hist_struct * hist = (struct adios_index_characteristics_hist_struct *) (c->stats[i][idx].data);
+						free (hist->breaks);
+						free (hist->frequencies);
+						free (hist);
+					}
+					else
+                    	free (c->stats[i][idx].data);
+				}
+                idx ++;
+            }
+            j ++;
+        }
+
+        for (i = 0; i < count; i ++)
+            free (c->stats [i]);
+
+        free (c->stats);
+        c->stats = 0;
+    }
+    if (c->dims.dims)
+    {
+        free (c->dims.dims);
+        c->dims.count = 0;
+        c->dims.dims = 0;
+    }
+    if (c->value)
+    {
+        free (c->value);
+        c->value = 0;
+    }
+    c->var_id = 0;
+
+    return 0;
+}
+
+int adios_parse_var_data_payload_v1 (struct adios_bp_buffer_struct_v1 * b
+                             ,struct adios_var_header_struct_v1 * var_header
+                             ,struct adios_var_payload_struct_v1 * var_payload
+                             ,uint64_t payload_buffer_size
+                             )
+{
+    if (b->length - b->offset < var_header->payload_size)
+    {
+        fprintf (stderr, "adios_parse_var_data_payload_v1 for name %s "
+                         "path %s requires a "
+                         "buffer of at least %llu bytes.  "
+                         "Only %llu were provided\n"
+                ,var_header->name, var_header->path
+                ,var_header->payload_size, b->length - b->offset
+                );
+
+        b->offset += var_header->payload_size;
+
+        return 1;
+    }
+    if (   payload_buffer_size < var_header->payload_size
+        && var_payload && var_payload->payload
+       )
+    {
+        fprintf (stderr, "reading var name %s path %s requires a "
+                         "buffer of at least %llu bytes.  "
+                         "Only %llu were provided\n"
+                ,var_header->name, var_header->path
+                ,var_header->payload_size, payload_buffer_size
+                );
+
+        b->offset += var_header->payload_size;
+
+        return 1;
+    }
+
+    uint64_t size = adios_get_type_size (var_header->type, "");
+
+    if (var_payload)
+    {
+        if (var_payload->payload)
+        {
+            memcpy (var_payload->payload, (b->buff + b->offset)
+                   ,var_header->payload_size
+                   );
+            if(b->change_endianness == adios_flag_yes) {
+                swap_adios_type_array(var_payload->payload, var_header->type, var_header->payload_size);
+            }
+            if (var_header->type == adios_string) {
+                ((char*)var_payload->payload)[var_header->payload_size] = '\0';
+            }
+            b->offset += var_header->payload_size;
+        }
+        else
+        {
+            b->offset += var_header->payload_size;
+        }
+    }
+    else
+    {
+        b->offset += var_header->payload_size;
+    }
+
+    return 0;
+}
+
+int adios_parse_attributes_header_v1 (struct adios_bp_buffer_struct_v1 * b
+                      ,struct adios_attributes_header_struct_v1 * attrs_header
+                      )
+{
+    if (b->length - b->offset < 10)
+    {
+        fprintf (stderr, "adios_parse_attributes_header_v1 requires a "
+                         "buffer of at least 10 bytes.  "
+                         "Only %llu were provided\n"
+                ,b->length - b->offset
+                );
+
+        attrs_header->count = 0;
+        attrs_header->length = 0;
+
+        return 1;
+    }
+
+    attrs_header->count = *(uint16_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_16(attrs_header->count);
+    }
+    b->offset += 2;
+
+    attrs_header->length = *(uint64_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_64(attrs_header->length);
+    }
+    b->offset += 8;
+
+    return 0;
+}
+
+int adios_parse_attribute_v1 (struct adios_bp_buffer_struct_v1 * b
+                             ,struct adios_attribute_struct_v1 * attribute
+                             )
+{
+    if (b->length - b->offset < 15)
+    {
+        fprintf (stderr, "adios_parse_attribute_data_payload_v1 requires a "
+                         "buffer of at least 15 bytes.  "
+                         "Only %llu were provided\n"
+                ,b->length - b->offset
+                );
+
+        return 1;
+    }
+
+    uint32_t attribute_length;
+    uint16_t len;
+
+    attribute_length = *(uint32_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_32(attribute_length);
+    }
+    b->offset += 4;
+    attribute->id = *(uint16_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_16(attribute->id);
+    }
+    b->offset += 2;
+
+    len = *(uint16_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_16(len);
+    }
+    b->offset += 2;
+    attribute->name = (char *) malloc (len + 1);
+    attribute->name [len] = '\0';
+    strncpy (attribute->name, b->buff + b->offset, len);
+    b->offset += len;
+
+    len = *(uint16_t *) (b->buff + b->offset);
+    if(b->change_endianness == adios_flag_yes) {
+        swap_16(len);
+    }
+    b->offset += 2;
+    attribute->path = (char *) malloc (len + 1);
+    attribute->path [len] = '\0';
+    strncpy (attribute->path, b->buff + b->offset, len);
+    b->offset += len;
+
+    attribute->is_var = (*(b->buff + b->offset) == 'y' ? adios_flag_yes
+                                                       : adios_flag_no
+                        );
+    b->offset += 1;
+    if (attribute->is_var == adios_flag_yes)
+    {
+        attribute->var_id = *(uint16_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_16(attribute->var_id);
+        }
+        b->offset += 2;
+        attribute->type = adios_unknown;
+        attribute->length = 0;
+        attribute->value = 0;
+    }
+    else
+    {
+        uint8_t flag;
+        attribute->var_id = 0;
+        flag = *(b->buff + b->offset);
+        attribute->type = (enum ADIOS_DATATYPES) flag;
+        b->offset += 1;
+        attribute->length = *(uint32_t *) (b->buff + b->offset);
+        if(b->change_endianness == adios_flag_yes) {
+            swap_32(attribute->length);
+        }
+        b->offset += 4;
+
+        attribute->value = malloc (attribute->length + 1);
+        ((char *) attribute->value) [attribute->length] = '\0';
+        memcpy (attribute->value, (b->buff + b->offset), attribute->length);
+
+        // TODO: do we need byte-swap here?
+        if(b->change_endianness == adios_flag_yes) {
+            swap_adios_type(attribute->value, attribute->type);
+        }
+        b->offset += attribute->length;
+    }
+
+    return 0;
+}
+
+int adios_clear_attribute_v1 (struct adios_attribute_struct_v1 * attribute)
+{
+    attribute->id = 0;
+    if (attribute->name)
+    {
+        free (attribute->name);
+        attribute->name = 0;
+    }
+    if (attribute->path)
+    {
+        free (attribute->path);
+        attribute->path = 0;
+    }
+    attribute->is_var = adios_flag_unknown;
+    attribute->var_id = 0;
+    attribute->type = adios_unknown;
+    attribute->length = 0;
+    if (attribute->value)
+    {
+        free (attribute->value);
+        attribute->value = 0;
+    }
+    return 0;
+}
+
+void * adios_dupe_data_scalar (enum ADIOS_DATATYPES type, void * in)
+{
+    void * out;
+    int element_size = adios_get_type_size (type, in);
+
+    void * d;
+
+    switch (type)
+    {
+        case adios_byte:
+        case adios_short:
+        case adios_integer:
+        case adios_long:
+        case adios_unsigned_byte:
+        case adios_unsigned_short:
+        case adios_unsigned_integer:
+        case adios_unsigned_long:
+        case adios_real:
+        case adios_double:
+        case adios_long_double:
+        case adios_complex:
+        case adios_double_complex:
+            d = malloc (element_size);
+            if (!d)
+            {
+                fprintf (stderr, "cannot allocate %d bytes to copy scalar\n"
+                        ,element_size
+                        );
+
+                return 0;
+            }
+
+            memcpy ((char *) d, (char *) in, element_size);
+            break;
+
+        case adios_string:
+            d = malloc (element_size + 1);
+            if (!d)
+            {
+                fprintf (stderr, "cannot allocate %d bytes to copy scalar\n"
+                        ,element_size + 1
+                        );
+
+                return 0;
+            }
+
+            memcpy ((char *) d, (char *) in, element_size + 1);
+            break;
+
+        default:
+            d = 0;
+            break;
+    }
+
+    return d;
+}
+
+// *****************************************************************************
+void adios_init_buffer_read_version (struct adios_bp_buffer_struct_v1 * b)
+{
+    if (!b->buff)
+    {
+        alloc_aligned (b, 28);
+        memset (b->buff, 0, 28);
+        if (!b->buff)
+            fprintf(stderr, "could not allocate 28 bytes\n");
+        b->offset = 24;
+    }
+}
+
+// last 4 bytes of file
+void adios_posix_read_version (struct adios_bp_buffer_struct_v1 * b)
+{
+    uint64_t buffer_size;
+    uint64_t start;
+    uint64_t r;
+
+    adios_init_buffer_read_version (b);
+
+    lseek (b->f, b->file_size - 28, SEEK_SET);
+
+    r = read (b->f, b->buff, 28);
+    if (r != 28)
+        fprintf (stderr, "could not read 28 bytes. read only: %llu\n", r);
+}
+
+void adios_init_buffer_read_index_offsets (struct adios_bp_buffer_struct_v1 * b)
+{
+    b->offset = 0; // just move to the start of the buffer
+}
+
+void adios_posix_read_index_offsets (struct adios_bp_buffer_struct_v1 * b)
+{
+    adios_init_buffer_read_index_offsets (b);
+}
+
+void adios_init_buffer_read_process_group_index (
+                                          struct adios_bp_buffer_struct_v1 * b
+                                          )
+{
+    realloc_aligned (b, b->pg_size);
+    b->offset = 0;
+}
+
+void adios_posix_read_process_group_index (struct adios_bp_buffer_struct_v1 * b)
+{
+    adios_init_buffer_read_process_group_index (b);
+
+    lseek (b->f, b->pg_index_offset, SEEK_SET);
+    read (b->f, b->buff, b->pg_size);
+}
+
+void adios_init_buffer_read_vars_index (struct adios_bp_buffer_struct_v1 * b)
+{
+    realloc_aligned (b, b->vars_size);
+    b->offset = 0;
+}
+
+void adios_posix_read_vars_index (struct adios_bp_buffer_struct_v1 * b)
+{
+    adios_init_buffer_read_vars_index (b);
+
+    uint64_t r;
+
+    lseek (b->f, b->vars_index_offset, SEEK_SET);
+    r = read (b->f, b->buff, b->vars_size);
+
+    if (r != b->vars_size)
+        fprintf (stderr, "reading vars_index: wanted %llu, read: %llu\n"
+                ,b->vars_size, r
+                );
+}
+
+void adios_init_buffer_read_attributes_index
+                                        (struct adios_bp_buffer_struct_v1 * b)
+{
+    realloc_aligned (b, b->attrs_size);
+    b->offset = 0;
+}
+
+void adios_posix_read_attributes_index (struct adios_bp_buffer_struct_v1 * b)
+{
+    adios_init_buffer_read_attributes_index (b);
+
+    uint64_t r;
+
+    lseek (b->f, b->attrs_index_offset, SEEK_SET);
+    r = read (b->f, b->buff, b->attrs_size);
+
+    if (r != b->attrs_size)
+        fprintf (stderr, "reading attributess_index: wanted %llu, read: %llu\n"
+                ,b->attrs_size, r
+                );
+}
+
+void adios_init_buffer_read_process_group (struct adios_bp_buffer_struct_v1 * b)
+{
+    realloc_aligned (b, b->read_pg_size);
+    b->offset = 0;
+}
+
+uint64_t adios_posix_read_process_group (struct adios_bp_buffer_struct_v1 * b)
+{
+    uint64_t pg_size = 0;
+
+    adios_init_buffer_read_process_group (b);
+
+    do
+    {
+        lseek (b->f, b->read_pg_offset + pg_size, SEEK_SET);
+        pg_size += read (b->f, b->buff + pg_size, b->read_pg_size - pg_size);
+    } while (errno && pg_size != b->read_pg_size);
+
+    if (pg_size != b->read_pg_size)
+    {
+        fprintf (stderr, "adios_read_process_group: "
+                         "Tried to read: %llu, but only got: %llu error: %s\n"
+                ,b->read_pg_size, pg_size, strerror (errno)
+                );
+
+        pg_size = 0;
+    }
+
+    return pg_size;
+}
+
+int adios_posix_open_read_internal (const char * filename
+                                   ,const char * base_path
+                                   ,struct adios_bp_buffer_struct_v1 * b
+                                   )
+{
+    char * name;
+    struct stat s;
+
+    name = malloc (strlen (base_path) + strlen (filename) + 1);
+    sprintf (name, "%s%s", base_path, filename);
+
+    if (stat (name, &s) == 0)
+        b->file_size = s.st_size;
+
+    b->f = open (name, O_RDONLY | O_LARGEFILE);
+    if (b->f == -1)
+    {
+        fprintf (stderr, "ADIOS POSIX: file not found: %s\n", name);
+
+        free (name);
+
+        return 0;
+    }
+
+    free (name);
+
+    return 1;
+}
+
+void adios_posix_close_internal (struct adios_bp_buffer_struct_v1 * b)
+{
+    if (b->f != -1)
+    {
+        close (b->f);
+    }
+
+    b->f = -1;
+    adios_buffer_struct_clear (b);
+}
+
+uint64_t adios_get_type_size (enum ADIOS_DATATYPES type, void * var)
+{
+    switch (type)
+    {
+        case adios_byte:
+        case adios_unsigned_byte:
+            return 1;
+
+        case adios_string:
+            if (!var)
+                return 0;
+            else
+                return strlen ((char *) var);
+
+        case adios_short:
+        case adios_unsigned_short:
+            return 2;
+
+        case adios_integer:
+        case adios_unsigned_integer:
+            return 4;
+
+        case adios_long:
+        case adios_unsigned_long:
+            return 8;
+
+        case adios_real:
+            return 4;
+
+        case adios_double:
+            return 8;
+
+        case adios_long_double:
+            return 16;
+
+        case adios_complex:
+            return 2 * 4;
+
+        case adios_double_complex:
+            return 2 * 8;
+
+        default:
+            return -1;
+    }
+}
+
+//NCSU - Get the size of the statistic id
+uint64_t adios_get_stat_size (void * data, enum ADIOS_DATATYPES type, enum ADIOS_STAT stat_id)
+{
+    uint64_t size = 0;
+
+    switch (type)
+    {
+        case adios_complex:
+            switch (stat_id)
+            {
+                case adios_statistic_min:
+                case adios_statistic_max:
+                case adios_statistic_sum:
+                case adios_statistic_sum_square:
+                    return adios_get_type_size(adios_double, "");
+
+                case adios_statistic_finite:
+                    return adios_get_type_size(adios_byte, "");
+
+                case adios_statistic_cnt:
+                    return adios_get_type_size(adios_unsigned_integer, "");
+            }
+        case adios_double_complex:
+            switch (stat_id)
+            {
+                case adios_statistic_min:
+                case adios_statistic_max:
+                case adios_statistic_sum:
+                case adios_statistic_sum_square:
+                    return adios_get_type_size(adios_long_double, "");
+
+                case adios_statistic_finite:
+                    return adios_get_type_size(adios_byte, "");
+
+                case adios_statistic_cnt:
+                    return adios_get_type_size(adios_unsigned_integer, "");
+            }
+        default:
+        {
+            switch (stat_id)
+            {
+                case adios_statistic_min:
+                case adios_statistic_max:
+                    return adios_get_type_size(type, "");
+
+                case adios_statistic_sum:
+                case adios_statistic_sum_square:
+                    return adios_get_type_size(adios_double, "");
+
+                case adios_statistic_finite:
+                    return adios_get_type_size(adios_byte, "");
+
+                case adios_statistic_cnt:
+                    return adios_get_type_size(adios_unsigned_integer, "");
+
+                case adios_statistic_hist:
+                {
+                    struct adios_hist_struct * hist = (struct adios_hist_struct *) data;
+                    size += adios_get_type_size(adios_unsigned_integer, ""); // Number of breaks
+                    size += adios_get_type_size(adios_double, ""); // Min
+                    size += adios_get_type_size(adios_double, ""); // Max
+                    size += ((hist->num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, ""));
+                    size += (hist->num_breaks * adios_get_type_size(adios_double, ""));
+                    return size;
+                }
+                default:
+                    return -1;
+            }
+        }
+    }
+}
+
+//NCSU - Returns count of the set of characteristcs for a variable
+uint8_t adios_get_stat_set_count (enum ADIOS_DATATYPES type)
+{
+    // NCSU - Complex numbers have the statistic related values repeated.
+    // NCSU - Holds values for real, imaginary, complex parts
+    if (type == adios_complex || type == adios_double_complex)
+        return 3;
+    return 1;
+}
+
diff --git a/src/adios_bp_v1.h b/src/adios_bp_v1.h
new file mode 100644
index 0000000..991449d
--- /dev/null
+++ b/src/adios_bp_v1.h
@@ -0,0 +1,322 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#ifndef ADIOS_BP_V1_H
+#define ADIOS_BP_V1_H
+#include "stdint.h"
+#include "unistd.h"
+#include "adios_types.h"
+#include "adios_transport_hooks.h"
+
+#define ADIOS_VERSION_NUM_MASK                       0x00000011
+#define ADIOS_VERSION_HAVE_SUBFILE                   0x00000100
+#define ADIOS_VERSION_HAVE_TIME_INDEX_CHARACTERISTIC 0x00000200
+enum ADIOS_CHARACTERISTICS
+{
+     adios_characteristic_value          = 0
+    ,adios_characteristic_min            = 1 // This is no longer used. Used to read in older bp file format
+    ,adios_characteristic_max            = 2 // This is no longer used. Used to read in older bp file format
+    ,adios_characteristic_offset         = 3
+    ,adios_characteristic_dimensions     = 4
+    ,adios_characteristic_var_id         = 5
+    ,adios_characteristic_payload_offset = 6
+    ,adios_characteristic_file_name      = 7
+    ,adios_characteristic_time_index     = 8
+    ,adios_characteristic_bitmap         = 9
+    ,adios_characteristic_stat           = 10
+};
+
+#ifndef ADIOS_STAT_LENGTH
+	#define ADIOS_STAT_LENGTH 7 
+#endif
+
+// NCSU - Adding statistics
+enum ADIOS_STAT
+{
+     adios_statistic_min             = 0
+    ,adios_statistic_max             = 1
+    ,adios_statistic_cnt			 = 2 
+    ,adios_statistic_sum			 = 3 
+    ,adios_statistic_sum_square 	 = 4 
+    ,adios_statistic_hist		 	 = 5 
+	,adios_statistic_finite		     = 6 
+};
+
+struct adios_bp_buffer_struct_v1
+{
+    int f;             // the file handle
+    uint64_t file_size;
+    uint32_t version;
+
+    char * allocated_buff_ptr;  // initial alloc for aligning on 8-byte boundary
+
+    char * buff;
+    uint64_t length;
+    uint64_t offset;   // buffer_offset
+
+    enum ADIOS_FLAG change_endianness;
+
+    off_t file_offset;
+    uint64_t end_of_pgs;          // where the last process group ends
+    uint64_t pg_index_offset;     // process groups index starts
+    uint64_t pg_size;             // process groups index size
+    uint64_t vars_index_offset;   // vars index start
+    uint64_t vars_size;           // vars index size
+    uint64_t attrs_index_offset;  // attributes index start
+    uint64_t attrs_size;          // attributes index size
+
+    uint64_t read_pg_offset;
+    uint64_t read_pg_size;
+};
+
+struct adios_index_process_group_struct_v1
+{
+    char * group_name;
+    enum ADIOS_FLAG adios_host_language_fortran;
+    uint32_t process_id;
+    char * time_index_name;
+    uint32_t time_index;
+    uint64_t offset_in_file;
+
+    struct adios_index_process_group_struct_v1 * next;
+};
+
+struct adios_index_characteristic_dims_struct_v1
+{
+    uint8_t count;
+    uint64_t * dims;  // each 3 uint64_t represents one dimension (l, g, o)
+};
+
+// NCSU - Generic data for all statistics
+struct adios_index_characteristics_stat_struct
+{
+	void * data;
+};
+
+// NCSU - Structure for histogram
+struct adios_index_characteristics_hist_struct
+{
+    double min; //minimum value of histogram ** for when we use complex variables
+    double max; //maximum value of histogram
+    uint32_t num_breaks; //number of break points for the histogram
+    uint32_t * frequencies; //array of frequencies for the histogram
+    double * breaks; //breaks array for the histogram, output this to gnuplot
+};
+
+struct adios_index_characteristic_struct_v1
+{
+    uint64_t offset;  // beginning of the var or attr entry
+    struct adios_index_characteristic_dims_struct_v1 dims;
+    uint16_t var_id;
+	void * value;
+    uint64_t payload_offset;   // beginning of the var or attr payload
+    char * file_name;
+    uint32_t time_index;
+
+	uint32_t bitmap;
+
+	struct adios_index_characteristics_stat_struct ** stats;
+};
+
+struct adios_index_var_struct_v1
+{
+    uint16_t id;
+    char * group_name;
+    char * var_name;
+    char * var_path;
+    enum ADIOS_DATATYPES type;
+
+    uint64_t characteristics_count;
+    uint64_t characteristics_allocated;
+
+    struct adios_index_characteristic_struct_v1 * characteristics;
+
+    struct adios_index_var_struct_v1 * next;
+};
+
+struct adios_index_attribute_struct_v1
+{
+    uint16_t id;
+    char * group_name;
+    char * attr_name;
+    char * attr_path;
+    enum ADIOS_DATATYPES type;
+
+    uint64_t characteristics_count;
+    uint64_t characteristics_allocated;
+
+    struct adios_index_characteristic_struct_v1 * characteristics;
+
+    struct adios_index_attribute_struct_v1 * next;
+};
+
+struct adios_method_info_struct_v1
+{
+    enum ADIOS_IO_METHOD id;
+    char * parameters;
+
+    struct adios_method_info_struct_v1 * next;
+};
+
+struct adios_dimension_item_struct_v1
+{
+    uint64_t rank;
+    uint16_t var_id;
+    enum ADIOS_FLAG time_index;
+};
+
+struct adios_dimension_struct_v1
+{
+    struct adios_dimension_item_struct_v1 dimension;
+    struct adios_dimension_item_struct_v1 global_dimension;
+    struct adios_dimension_item_struct_v1 local_offset;
+    struct adios_dimension_struct_v1 * next;
+};
+
+struct adios_process_group_header_struct_v1
+{
+    enum ADIOS_FLAG host_language_fortran;
+    char * name;
+    uint16_t coord_var_id;
+    char * time_index_name;
+    uint32_t time_index;
+    uint8_t methods_count;
+    struct adios_method_info_struct_v1 * methods;
+};
+
+struct adios_vars_header_struct_v1
+{
+    uint16_t count;
+    uint64_t length;
+};
+
+struct adios_attributes_header_struct_v1
+{
+    uint16_t count;
+    uint64_t length;
+};
+
+struct adios_var_header_struct_v1
+{
+    uint16_t id;
+    char * name;
+    char * path;
+    enum ADIOS_DATATYPES type;
+    enum ADIOS_FLAG is_dim;
+    struct adios_dimension_struct_v1 * dims;
+    struct adios_index_characteristic_struct_v1 characteristics;
+    uint64_t payload_size;
+};
+
+struct adios_var_payload_struct_v1
+{
+    void * payload;
+};
+
+struct adios_attribute_struct_v1
+{
+    uint16_t id;
+    char * name;
+    char * path;
+
+    enum ADIOS_FLAG is_var;
+
+    uint16_t var_id;
+
+    enum ADIOS_DATATYPES type;
+    uint32_t length;
+    void * value;
+};
+
+void adios_shared_buffer_free (struct adios_bp_buffer_struct_v1 * b);
+void adios_buffer_struct_init (struct adios_bp_buffer_struct_v1 * b);
+void adios_buffer_struct_clear (struct adios_bp_buffer_struct_v1 * b);
+
+void * adios_dupe_data_scalar (enum ADIOS_DATATYPES type, void * in);
+
+// buff must be 4 bytes
+int adios_parse_version (struct adios_bp_buffer_struct_v1 * b
+                        ,uint32_t * version
+                        );
+
+// buff must be 16 bytes
+int adios_parse_index_offsets_v1 (struct adios_bp_buffer_struct_v1 * b);
+
+int adios_parse_process_group_index_v1 (struct adios_bp_buffer_struct_v1 * b
+                         ,struct adios_index_process_group_struct_v1 ** pg_root
+                         );
+
+int adios_parse_vars_index_v1 (struct adios_bp_buffer_struct_v1 * b
+                              ,struct adios_index_var_struct_v1 ** vars_root
+                              );
+int adios_parse_attributes_index_v1 (struct adios_bp_buffer_struct_v1 * b
+                          ,struct adios_index_attribute_struct_v1 ** attrs_root
+                          );
+
+int adios_parse_process_group_header_v1 (struct adios_bp_buffer_struct_v1 * b
+                     ,struct adios_process_group_header_struct_v1 * pg_header
+                     );
+
+int adios_parse_vars_header_v1 (struct adios_bp_buffer_struct_v1 * b
+                               ,struct adios_vars_header_struct_v1 * vars_header
+                               );
+
+int adios_parse_var_data_header_v1 (struct adios_bp_buffer_struct_v1 * b
+                                ,struct adios_var_header_struct_v1 * var_header
+                                );
+
+int adios_parse_var_data_payload_v1 (struct adios_bp_buffer_struct_v1 * b
+                              ,struct adios_var_header_struct_v1 * var_header
+                              ,struct adios_var_payload_struct_v1 * var_payload
+                              ,uint64_t payload_size
+                              );
+
+int adios_parse_attributes_header_v1 (struct adios_bp_buffer_struct_v1 * b
+                       ,struct adios_attributes_header_struct_v1 * attrs_header
+                       );
+
+int adios_parse_attribute_v1 (struct adios_bp_buffer_struct_v1 * b
+                             ,struct adios_attribute_struct_v1 * attribute
+                             );
+int adios_clear_process_group_header_v1 (
+                     struct adios_process_group_header_struct_v1 * pg_header);
+int adios_clear_var_header_v1 (struct adios_var_header_struct_v1 * var_header);
+int adios_clear_attribute_v1 (struct adios_attribute_struct_v1 * attribute);
+
+// ****************************************************************************
+// functions from adios_posix.c used for file reading
+
+void adios_init_buffer_read_version (struct adios_bp_buffer_struct_v1 * b);
+void adios_posix_read_version (struct adios_bp_buffer_struct_v1 * b);
+
+void adios_init_buffer_read_index_offsets ( struct adios_bp_buffer_struct_v1 * b);
+void adios_posix_read_index_offsets (struct adios_bp_buffer_struct_v1 * b);
+
+void adios_init_buffer_read_process_group_index ( struct adios_bp_buffer_struct_v1 * b);
+void adios_posix_read_process_group_index (struct adios_bp_buffer_struct_v1 * b);
+
+void adios_init_buffer_read_process_group (struct adios_bp_buffer_struct_v1 * b);
+void adios_init_buffer_read_vars_index (struct adios_bp_buffer_struct_v1 * b);
+void adios_posix_read_vars_index (struct adios_bp_buffer_struct_v1 * b);
+
+void adios_init_buffer_read_attributes_index
+                                        (struct adios_bp_buffer_struct_v1 * b);
+void adios_posix_read_attributes_index (struct adios_bp_buffer_struct_v1 * b);
+
+void adios_init_buffer_read_procss_group (struct adios_bp_buffer_struct_v1 * b);
+uint64_t adios_posix_read_process_group (struct adios_bp_buffer_struct_v1 * b);
+
+int adios_posix_open_read_internal (const char * filename
+                                   ,const char * base_path
+                                   ,struct adios_bp_buffer_struct_v1 * b
+                                   );
+void adios_posix_close_internal (struct adios_bp_buffer_struct_v1 * b);
+
+// ADIOS statistics related functions
+uint64_t adios_get_stat_size (void * data, enum ADIOS_DATATYPES type, enum ADIOS_STAT stat_id);
+uint8_t adios_get_stat_set_count (enum ADIOS_DATATYPES type);
+#endif
diff --git a/src/adios_dart.c b/src/adios_dart.c
new file mode 100644
index 0000000..0a7bc51
--- /dev/null
+++ b/src/adios_dart.c
@@ -0,0 +1,510 @@
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+// xml parser
+#include <mxml.h>
+
+// dart
+#include <sys/uio.h>
+
+// see if we have MPI or other tools
+#include "config.h"
+
+// mpi
+#if HAVE_MPI
+#include "mpi.h"
+#endif
+
+#include "adios.h"
+#include "adios_types.h"
+#include "adios_transport_hooks.h"
+#include "adios_internals.h"
+#include "adios_internals_mxml.h"
+
+#include "dart.h"
+
+/*#define DART_DO_VERSIONING  define it at configure as -DDART_DO_VERSIONING in CFLAGS */
+
+
+static int adios_dart_initialized = 0;
+#define MAXDARTNAMELEN 128
+static char dart_type_var_name[MAXDARTNAMELEN];
+static char dart_var_name[MAXDARTNAMELEN];
+
+struct adios_DART_data_struct
+{
+    int rank;   // dart rank or MPI rank if MPI is available
+    int peers;  // from xml parameter or group communicator
+    int appid;  // from xml parameter or 1
+    int time_index; // versioning in DataSpaces, start from 0
+    int n_writes; // how many times adios_write has been called
+};
+
+
+
+int get_dim_rank_value(struct adios_dimension_item_struct * dim_info, struct adios_group_struct *group)
+{
+    if(!dim_info)
+       return 0;
+
+    if(dim_info->id != 0)
+    {
+        struct adios_var_struct *dim_var = NULL;
+        dim_var = adios_find_var_by_id(group->vars, dim_info->id);
+        if(!dim_var || !dim_var->data)
+           return 0;
+        
+        int rank = 0;
+        switch ( dim_var->type )
+        {
+        case adios_unsigned_byte:
+             rank = (*(uint8_t*) dim_var->data);
+             break;
+        case adios_byte:
+             rank = (*(int8_t*) dim_var->data);
+             break;
+        case adios_unsigned_short:
+             rank = (*(uint16_t*) dim_var->data);
+             break;
+        case adios_short:
+             rank = (*(int16_t*) dim_var->data);
+             break;
+        case adios_unsigned_integer:
+             rank = (*(uint32_t*) dim_var->data);
+             break;
+        case adios_integer:
+             rank = (*(int32_t*) dim_var->data);
+             break;
+        case adios_unsigned_long:
+             rank = (*(uint64_t*) dim_var->data);
+             break;
+        case adios_long:
+             rank = (*(int64_t*) dim_var->data);
+             break;
+
+        default: break;
+        }
+
+        return rank;
+    }
+    else
+    {
+        return dim_info->rank;
+    }
+}
+
+void adios_dart_init (const char * parameters,
+                     struct adios_method_struct * method
+                     )
+{
+    struct adios_DART_data_struct *p = 0;
+    if (!adios_dart_initialized)
+    {
+        adios_dart_initialized = 1;
+    }
+   
+    method->method_data = calloc (1, sizeof (struct adios_DART_data_struct));
+    p = (struct adios_DART_data_struct*)method->method_data;
+    
+    int index, i;
+    char temp[64];
+    int num_peers;
+    int appid;
+    int was_set;
+    
+    num_peers = 1;
+    // Application ID should be set by the application calling adios_set_application_id()
+    appid = globals_adios_get_application_id (&was_set);
+    if (!was_set)
+        appid = 1;
+
+    //Init the static data structure
+    p->peers = num_peers;
+    p->appid = appid;
+    p->time_index = 0;
+    p->n_writes = 0;
+
+    fprintf(stderr, "adios_dart_init: appid=%d\n", p->appid);
+   
+}
+
+
+static void adios_dart_var_to_comm  (const char * comm_name
+                                    ,enum ADIOS_FLAG host_language_fortran
+                                    ,void * data
+                                    ,MPI_Comm * comm
+                                    )
+{
+    if (data)
+    {
+        int t = *(int *) data;
+
+        if (!comm_name || !strcmp (comm_name, ""))
+        {
+            if (!t)
+            {
+                fprintf (stderr, "communicator not provided and none "
+                                 "listed in XML.  Defaulting to "
+                                 "MPI_COMM_SELF\n"
+                        );
+
+                *comm = MPI_COMM_SELF;
+            }
+            else
+            {
+                if (host_language_fortran == adios_flag_yes)
+                {
+                    *comm = MPI_Comm_f2c (t);
+                }
+                else
+                {
+                    *comm = *(MPI_Comm *) data;
+                }
+            }
+        }
+        else
+        {
+            if (!t)
+            {
+                fprintf (stderr, "communicator not provided but one "
+                                 "listed in XML.  Defaulting to "
+                                 "MPI_COMM_WORLD\n"
+                        );
+
+                *comm = MPI_COMM_WORLD;
+            }
+            else
+            {
+                if (host_language_fortran == adios_flag_yes)
+                {
+                    *comm = MPI_Comm_f2c (t);
+                }
+                else
+                {
+                    *comm = *(MPI_Comm *) data;
+                }
+            }
+        }
+    }
+    else
+    {
+        fprintf (stderr, "coordination-communication not provided. "
+                         "Using MPI_COMM_WORLD instead\n"
+                );
+
+        *comm = MPI_COMM_WORLD;
+    }
+}
+
+int adios_dart_open (struct adios_file_struct * fd,
+                    struct adios_method_struct * method,
+                    void *comm
+                    )
+{
+    int ret = 0;
+    struct adios_DART_data_struct *p = (struct adios_DART_data_struct *)
+                                                method->method_data;
+    int num_peers = p->peers;
+  
+    fprintf(stderr, "adios_dart_open: open %s, mode=%d, time_index=%d \n",
+                        fd->name, fd->mode, p->time_index);
+
+    // connect to DART at the very first adios_open(), disconnect in adios_finalize()
+    // connect only if the READ API has not connected yet
+    if (!globals_adios_is_dart_connected()) {
+
+#if HAVE_MPI
+    // if we have MPI and a communicator, we can get the exact size of this application
+    // that we need to tell DART
+        MPI_Comm group_comm;
+        if (comm) {
+            adios_dart_var_to_comm (fd->group->group_comm, fd->group->adios_host_language_fortran,
+                                    comm, &group_comm);
+            MPI_Comm_rank ( group_comm, &(p->rank));
+            MPI_Comm_size ( group_comm, &num_peers);
+            p->peers = num_peers;
+        }
+#endif
+
+        fprintf(stderr, "adios_dart_open: rank=%d connect to DART, peers=%d, appid=%d \n",
+                        p->rank, num_peers, p->appid);
+
+        //Init the dart client
+        ret = dart_init (num_peers, p->appid);
+        if (ret) {
+            fprintf(stderr, "adios_dart_open: rank=%d Failed to connect to DART: err=%d,  rank=%d\n", p->rank, ret);        
+            return ret;
+        }
+
+#if ! HAVE_MPI
+        dart_rank (&(p->rank));
+        dart_peers (&(p->peers));
+#endif
+
+        fprintf(stderr, "adios_dart_open: rank=%d connected to DART: peers=%d\n", p->rank, p->peers);        
+    }
+    globals_adios_set_dart_connected_from_writer();
+   
+    if( fd->mode == adios_mode_write )
+    {
+        fprintf(stderr, "adios_dart_open: rank=%d call write lock...\n", p->rank);        
+        dart_lock_on_write (fd->name);  
+        fprintf(stderr, "adios_dart_open: rank=%d got write lock\n", p->rank);        
+    }
+    else if( fd->mode == adios_mode_read )
+    {
+        dart_lock_on_read (fd->name);
+    } 
+  
+    return ret;
+}
+
+enum ADIOS_FLAG adios_dart_should_buffer (struct adios_file_struct * fd
+                                         ,struct adios_method_struct * method
+                                         )
+{
+    return adios_flag_no;  // this will take care of it
+}
+
+
+void adios_dart_write (struct adios_file_struct * fd
+                      ,struct adios_var_struct * v
+                      ,void * data
+                      ,struct adios_method_struct * method
+                      )
+{
+    struct adios_DART_data_struct *p = (struct adios_DART_data_struct *)
+                                                            method->method_data;
+    struct adios_group_struct *group = fd->group;
+    //Get var size
+    //  FIXME: type size of a string >2GB does not fit to int. 
+    //  adios_get_type_size returns uint64_t but dart_put handles only int
+    //  as element size
+    int var_type_size = (int) adios_get_type_size(v->type, v->data);
+    //Get var name
+    char * var_name = v->name;
+    int err;
+
+    //Get two offset coordinate values
+    unsigned int version;
+
+    int dims[3]={1,1,1}, lb[3]={0,0,0}, ub[3]={0,0,0}; /* lower and upper bounds for DataSpaces */
+    int ndims = 0;
+    struct adios_dimension_struct* var_dimensions = v->dimensions;
+    // Calculate lower and upper bounds for each available dimension (up to 3 dims)
+    while( var_dimensions && ndims < 3)
+    {
+        dims[ndims] = get_dim_rank_value(&(var_dimensions->dimension), group);
+        lb[ndims] = get_dim_rank_value(&(var_dimensions->local_offset), group);
+        ub[ndims] = lb[ndims] + dims[ndims] - 1;
+        var_dimensions = var_dimensions->next;
+        ndims++;
+    }
+
+#ifdef DART_DO_VERSIONING
+    version = p->time_index;  /* Add new data as separate to DataSpaces */
+#else
+    version = 0;              /* Update/overwrite data in DataSpaces  (we write time_index as a variable at close)*/
+#endif
+    
+    if (v->path != NULL && v->path[0] != '\0' && strcmp(v->path,"/")) 
+        snprintf(dart_var_name, MAXDARTNAMELEN, "%s/%s/%s", fd->name, v->path, v->name);
+    else 
+        snprintf(dart_var_name, MAXDARTNAMELEN, "%s/%s", fd->name, v->name);
+
+    snprintf(dart_type_var_name, MAXDARTNAMELEN, "TYPE@%s", dart_var_name);
+    
+    /* Scalar variables are put in space ONLY by rank = 0 process */
+//    if (var_dimensions > 0 || p->rank == 0) {
+    
+        fprintf(stderr, "var_name=%s, type=%s(%d) elemsize=%d, version=%d, size_x=%d, size_y=%d, size_z=%d, (%d,%d,%d), (%d,%d,%d)\n",
+                dart_var_name, adios_type_to_string_int(v->type), v->type, var_type_size, version,
+                dims[0], dims[1], dims[2], lb[0], lb[1], lb[2], ub[0], ub[1], ub[2]);
+
+        /* Put type info as T<varname>, integer in 0,0,0,0,0,0 position */
+        err = dart_put(dart_type_var_name, version, 4, 0,0,0,0,0,0, &(v->type)); 
+
+        if (group->adios_host_language_fortran == adios_flag_yes || ndims == 1) {
+            /* Flip 1st and 2nd dimension for DataSpaces representation
+               for any Fortran writings and for any 1D array*/
+            dart_put(dart_var_name, version, var_type_size, lb[1], lb[0], lb[2], ub[1], ub[0], ub[2], data);
+        } else {
+            /* Keep dimension order in case of C writer of 2-3D arrays for DataSpaces representation */
+            dart_put(dart_var_name, version, var_type_size, lb[0], lb[1], lb[2], ub[0], ub[1], ub[2], data);
+        }
+//    }
+}
+
+void adios_dart_get_write_buffer (struct adios_file_struct * fd
+                                 ,struct adios_var_struct * v
+                                 ,uint64_t * size
+                                 ,void ** buffer
+                                 ,struct adios_method_struct * method
+                                 )
+{
+    uint64_t mem_allowed;
+
+    if (*size == 0)
+    {
+        *buffer = 0;
+
+        return;
+    }
+
+    if (v->data && v->free_data == adios_flag_yes)
+    {
+        adios_method_buffer_free (v->data_size);
+        free (v->data);
+        v->data = NULL;
+    }
+
+    mem_allowed = adios_method_buffer_alloc (*size);
+    if (mem_allowed == *size)
+    {
+        *buffer = malloc (*size);
+        if (!*buffer)
+        {
+            adios_method_buffer_free (mem_allowed);
+            fprintf (stderr, "Out of memory allocating %llu bytes for %s\n"
+                    ,*size, v->name
+                    );
+            v->got_buffer = adios_flag_no;
+            v->free_data = adios_flag_no;
+            v->data_size = 0;
+            v->data = 0;
+            *size = 0;
+            *buffer = 0;
+        }
+        else
+        {
+            v->got_buffer = adios_flag_yes;
+            v->free_data = adios_flag_yes;
+            v->data_size = mem_allowed;
+            v->data = *buffer;
+        }
+    }
+    else
+    {
+        adios_method_buffer_free (mem_allowed);
+        fprintf (stderr, "OVERFLOW: Cannot allocate requested buffer of %llu "
+                         "bytes for %s\n"
+                ,*size
+                ,v->name
+                );
+        *size = 0;
+        *buffer = 0;
+    }
+}
+
+/* NOT IMPLEMENTED. Use the Read API to read variables */
+void adios_dart_read (struct adios_file_struct * fd
+                     ,struct adios_var_struct * v, void * buffer
+                     ,uint64_t buffer_size
+                     ,struct adios_method_struct * method
+                     )
+{
+    struct adios_DART_data_struct *p = (struct adios_DART_data_struct *)
+                                                            method->method_data;
+    uint64_t var_type_size = adios_get_type_size(v->type, v->data);
+
+    //Get var name
+    char * var_name = v->name;
+
+    //Get two offset coordinate values
+    int version, offset1[3],offset2[3];
+    int dim_size[3];
+    memset(offset1, 0, 3*sizeof(int));
+    memset(offset2, 0, 3*sizeof(int));
+    memset(dim_size, 0, 3*sizeof(int));
+
+    version = p->time_index;
+
+    //dart_lock_on_read_();
+
+    //dart_get
+
+    //dart_unlock_on_read_();
+}
+
+void adios_dart_close (struct adios_file_struct * fd
+                      ,struct adios_method_struct * method
+                      )
+{
+    //TODO
+    struct adios_DART_data_struct *p = (struct adios_DART_data_struct *)
+                                                method->method_data;
+
+    if( fd->mode == adios_mode_write )
+    {
+        if (p->rank == 0) {
+            /* Write two adios specific variables with the name of the file and name of the group into the space */
+            /* ADIOS Read API fopen() checks these variables to see if writing already happened */
+            unsigned int version;
+#ifdef DART_DO_VERSIONING
+            version = p->time_index;  /* Add new data as separate to DataSpaces */
+#else
+            version = 0;              /* Update/overwrite data in DataSpaces */
+#endif
+            snprintf(dart_var_name, MAXDARTNAMELEN, "FILE@%s", fd->name);
+            printf("%s: put %s = %d into space\n", __func__, dart_var_name, p->time_index);
+            dart_put(dart_var_name, version, 4, 0, 0, 0, 0, 0, 0, &(p->time_index)); 
+
+            snprintf(dart_var_name, MAXDARTNAMELEN, "GROUP@%s", fd->group->name);
+            printf("%s: put %s = %d into space\n", __func__, dart_var_name, p->time_index);
+            dart_put(dart_var_name, version, 4, 0, 0, 0, 0, 0, 0, &(p->time_index)); 
+        }
+
+        printf("%s: call dart_put_sync()\n", __func__);
+        dart_put_sync();
+        printf("%s: call dart_unlock_on_write(%s)\n", __func__, fd->name);
+        dart_unlock_on_write(fd->name);
+    }
+    else if( fd->mode == adios_mode_read )
+    {
+        dart_unlock_on_read(fd->name);
+    } 
+
+    /* Increment the time index */
+    p->time_index++;
+
+
+    printf("%s: exit\n", __func__);
+}
+
+void adios_dart_finalize (int mype, struct adios_method_struct * method)
+{
+    struct adios_DART_data_struct *p = (struct adios_DART_data_struct *)
+                                                method->method_data;
+
+    // disconnect from dart if we are connected from writer but not anymore from reader
+    if (globals_adios_is_dart_connected_from_writer() && 
+        !globals_adios_is_dart_connected_from_both())
+    {
+        printf("%s: call dart_barrier(), rank=%d\n", __func__,mype);
+        dart_barrier();
+        printf("%s: call dart_finalize(), rank=%d\n", __func__,mype);
+        dart_finalize();
+
+    }
+    globals_adios_set_dart_disconnected_from_writer();
+
+    adios_dart_initialized = 0;
+
+    printf("%s: exit\n", __func__);
+}
+
+void adios_dart_end_iteration (struct adios_method_struct * method)
+{
+}
+
+void adios_dart_start_calculation (struct adios_method_struct * method)
+{
+}
+
+void adios_dart_stop_calculation (struct adios_method_struct * method)
+{
+}
+
diff --git a/src/adios_datatap.c b/src/adios_datatap.c
new file mode 100644
index 0000000..eba8f34
--- /dev/null
+++ b/src/adios_datatap.c
@@ -0,0 +1,1082 @@
+#include "config.h"
+
+#if NO_DATATAP == 0
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ffs.h>
+#include <atl.h>
+#include <mpi.h>
+#include "adios.h"
+#include "adios_internals.h"
+#include "adios_transport_hooks.h"
+
+#include <sys/queue.h>
+#if HAVE_PORTALS == 1
+#include <thin_portal.h>
+#elif HAVE_INFINIBAND == 1
+#include <thin_ib.h>
+#endif
+
+
+#define STARTINGSIZE 16
+
+//static LIST_HEAD(listhead, fm_structure) globallist;
+
+#define OPLEN 4
+static char OP[OPLEN] = { '+', '-', '*', '/' };
+static char *OP_REP[OPLEN] = { "_plus_", "_minus_", "_mult_", "_div_" };
+
+int rank = -1;
+
+typedef struct nametable_
+{
+	char *originalname;
+	char *mangledname;
+	  LIST_ENTRY(nametable_) entries;
+} nametable;
+
+
+
+typedef struct altname_
+{
+	char *name;
+	FMField *field;											   //contains the field list
+	  LIST_ENTRY(altname_) entries;
+} altname;
+
+typedef struct dimnames_
+{
+	char *name;
+	  LIST_HEAD(alts, altname_) altlist;
+	  LIST_ENTRY(dimnames_) entries;
+} dimnames;
+
+
+int mpisize  = 1;
+
+struct fm_structure
+{
+	FMFormatRec *format;
+	int size;												   //in bytes - no padding
+	unsigned char *buffer;
+	int snd_count;
+	IOhandle *s;
+	FMFormat ioformat;
+	attr_list alist;	
+
+	LIST_HEAD(tablehead, nametable_) namelist;
+	LIST_HEAD(dims, dimnames_) dimlist;
+};
+
+
+typedef struct datatap_method_data
+{
+	int opencount;
+	int initialized;
+	int cycle_id;
+	char *pfile;
+	struct fm_structure *fm;
+} dmd;
+
+MPI_Comm adios_mpi_comm_world = MPI_COMM_WORLD;
+int initialized = 0;
+
+
+static char *
+getFixedName(char *name)
+{
+	char *tempname = (char *) malloc(sizeof(char) * 255);
+	tempname = strdup(name);
+
+
+	char *oldname = strdup(name);
+	char *loc = NULL;
+	int i;
+
+	do
+	{
+		for (i = 0; i < OPLEN; i++)
+		{
+	//checking operator OP[i]
+			loc = strchr(oldname, OP[i]);
+			if (loc == NULL)
+				continue;
+			*loc = 0;
+			snprintf(tempname, 255, "%s%s%s", oldname, OP_REP[i], &loc[1]);
+			free(oldname);
+			oldname = strdup(tempname);
+		}
+	}
+	while (loc != NULL);
+
+
+
+	return tempname;
+}
+
+
+
+//return a list of all the names associated with the variable
+static char **
+getAltName(char *variable, int *count)
+{
+	if (count == NULL)
+		return NULL;
+
+	return NULL;
+
+}
+
+
+static char *
+findFixedName(struct fm_structure *fm, char *name)
+{
+	nametable *node;
+
+	for (node = fm->namelist.lh_first; node != NULL;
+		 node = node->entries.le_next)
+	{
+		if (!strcmp(node->originalname, name))
+		{
+	//matched
+			return node->mangledname;
+		}
+
+	}
+
+	return name;
+}
+
+
+extern void
+adios_datatap_init(const char *params, struct adios_method_struct *method)
+{
+	if (method->method_data != NULL)
+	{
+		dmd *mdata = (dmd *) method->method_data;
+		if (mdata->initialized == 1)
+			return;
+	}
+
+	method->method_data = (void *) malloc(sizeof(struct datatap_method_data));
+	dmd *mdata = (dmd *) method->method_data;
+	memset(mdata, 0, sizeof(dmd));
+
+	mdata->opencount = 0;
+	mdata->initialized = 1;
+	if (params != NULL && strlen(params) > 1)
+	{
+//contains the file name of the file to read?
+		mdata->pfile = strdup(params);
+	}
+	else
+		mdata->pfile = strdup("params");
+
+	MPI_Comm_rank(adios_mpi_comm_world, &rank);
+	MPI_Comm_size(adios_mpi_comm_world, &mpisize);
+
+	fflush(stderr);
+
+}
+
+static altname *
+findAltName(struct fm_structure *current_fm, char *dimname, char *varname)
+{
+	int len = strlen(dimname) + strlen(varname) + 2;
+	char *aname = (char *) malloc(sizeof(char) * len);
+	strcpy(aname, dimname);
+	strcat(aname, "_");
+	strcat(aname, varname);
+	dimnames *d = NULL;
+
+	for (d = current_fm->dimlist.lh_first; d != NULL; d = d->entries.le_next)
+	{
+		if (!strcmp(d->name, dimname))
+		{
+	//matched
+			break;
+		}
+
+	}
+
+	if (d == NULL)
+	{
+		d = (dimnames *) malloc(sizeof(dimnames));
+		d->name = dimname;
+		LIST_INIT(&d->altlist);
+		LIST_INSERT_HEAD(&current_fm->dimlist, d, entries);
+	}
+
+	FMField *field = (FMField *) malloc(sizeof(FMField));
+
+	altname *a = (altname *) malloc(sizeof(altname));
+	a->name = aname;
+	a->field = field;
+	field->field_name = strdup(aname);
+	field->field_type = strdup("integer");
+	field->field_size = sizeof(int);
+	field->field_offset = -1;
+
+
+	LIST_INSERT_HEAD(&d->altlist, a, entries);
+
+	return a;
+}
+
+
+
+extern int
+adios_datatap_open(struct adios_file_struct *fd,
+		   struct adios_method_struct *method, void*comm)
+{
+	if (fd == NULL || method == NULL)
+	{
+		fprintf(stderr, "Bad input parameters\n");
+		return -1;
+	}
+
+	dmd *mdata = (dmd *) method->method_data;
+
+	if (mdata != NULL)
+	{
+		if (mdata->initialized == 0)
+		{
+			fprintf(stderr, "method not initialized properly\n");
+			return;
+		}
+	}
+	else
+	{
+		fprintf(stderr, "method not initialized\n");
+		return -1;
+	}
+
+	if (mdata->fm != NULL)
+	{
+		return -1;
+	}
+
+
+
+	struct adios_group_struct *t = method->group;
+	if (t == NULL)
+	{
+		fprintf(stderr, "group is not initialized properly\n");
+		return -1;
+	}
+
+	struct adios_var_struct *fields = t->vars;
+	if (fields == NULL)
+	{
+		fprintf(stderr, "adios vars not initalized properly in the group\n");
+		return -1;
+	}
+
+//iterate through all the types
+//create a format rec
+	FMFormatRec *format = (FMFormatRec *) malloc(sizeof(FMFormatRec) * 2);
+	if (format == NULL)
+	{
+		perror("memory allocation failed");
+		return -1;
+	}
+
+	memset(format, 0, sizeof(FMFormatRec) * 2);
+
+
+	struct fm_structure *current_fm =
+		(struct fm_structure *) malloc(sizeof(struct fm_structure));
+	if (current_fm == NULL)
+	{
+		perror("memory allocation failed");
+		return -1;
+	}
+
+	memset(current_fm, 0, sizeof(struct fm_structure));
+	current_fm->alist = create_attr_list();
+	set_int_attr(current_fm->alist, attr_atom_from_string("mpisize"), mpisize);
+	
+
+	LIST_INIT(&current_fm->namelist);
+	LIST_INIT(&current_fm->dimlist);
+
+
+
+//associate the FMFormat rec with the fm_structure
+	current_fm->format = format;
+	format->format_name = strdup(t->name);
+
+//allocate field list
+	if (t->var_count == 0)
+	{
+		fprintf(stderr, "no variables in this group - possibly an error\n");
+		return -1;
+
+	}
+
+	int altvarcount = 0;
+
+	FMFieldList field_list =
+		(FMFieldList) malloc(sizeof(FMField) * (t->var_count + 1));
+	if (field_list == NULL)
+	{
+		perror("memory allocation failed");
+		return -1;
+	}
+
+//keep count of the total number of fields
+	int fieldno = 0;
+
+
+//for each type look through all the fields
+	struct adios_var_struct *f;
+	for (f = t->vars; f != NULL; f = f->next, fieldno++)
+	{
+//make the field list
+//check name for + - * / (operators) and replace them
+		char *tempname = getFixedName(f->name);
+
+
+		if (strcmp(tempname, f->name))
+		{
+	//strings don't match
+	//add to name list
+			nametable *namenode = (nametable *) malloc(sizeof(nametable));
+			namenode->originalname = strdup(f->name);
+			namenode->mangledname = strdup(tempname);
+
+			LIST_INSERT_HEAD(&current_fm->namelist, namenode, entries);
+		}
+
+
+//
+		field_list[fieldno].field_name = strdup(tempname);
+		free(tempname);
+
+		if (!f->dimensions)
+		{
+			switch (f->type)
+			{
+			case adios_unknown:
+				fprintf(stderr, "bad type error\n");
+				fieldno--;
+				break;
+
+			case adios_integer:
+				field_list[fieldno].field_type = strdup("integer");
+				field_list[fieldno].field_size = sizeof(int);
+				field_list[fieldno].field_offset = current_fm->size;
+				current_fm->size += sizeof(int);
+				break;
+
+			case adios_real:
+				field_list[fieldno].field_type = strdup("float");
+				field_list[fieldno].field_size = sizeof(float);
+				field_list[fieldno].field_offset = current_fm->size;
+				current_fm->size += sizeof(float);
+				break;
+
+			case adios_string:
+				field_list[fieldno].field_type = strdup("string");
+				field_list[fieldno].field_size = sizeof(char);
+				field_list[fieldno].field_offset = current_fm->size;
+				current_fm->size += sizeof(unsigned char *);
+				break;
+
+			case adios_double:
+				field_list[fieldno].field_type = strdup("float");
+				field_list[fieldno].field_size = sizeof(double);
+				field_list[fieldno].field_offset = current_fm->size;
+				current_fm->size += sizeof(double);
+				break;
+
+
+			case adios_byte:
+				field_list[fieldno].field_type = strdup("char");
+				field_list[fieldno].field_size = sizeof(char);
+				field_list[fieldno].field_offset = current_fm->size;
+				current_fm->size += sizeof(char);
+				break;
+
+			default:
+				fprintf(stderr, "unknown type error %d\n", f->type);
+				fieldno--;
+				break;
+			}
+		}
+		else
+		{
+	//its a vector!
+	//find out the dimensions by walking the dimension list
+			struct adios_dimension_struct *d = f->dimensions;
+#define DIMSIZE 10240
+			char dims[DIMSIZE] = { 0 };
+#define ELSIZE 256
+			char el[ELSIZE] = { 0 };
+
+
+	//create the dimension thingy
+			for (; d != NULL; d = d->next)
+			{
+				//for each dimension just take the upper_bound
+				if (d->dimension.id)
+				{
+				    //findFixedName returns the mangled name from the original name
+				    struct adios_var_struct *tmp_var = adios_find_var_by_id(t->vars, d->dimension.id);
+				    char *name =
+					findFixedName(current_fm, 
+						      tmp_var->name);
+				    //create the alternate name for this variable and the array its defining
+				    altname *a = findAltName(current_fm, name,
+							     (char*)field_list[fieldno].field_name);
+				    //altname is a new variable that we need to add to the field list
+				    altvarcount++;
+
+				    snprintf(el, ELSIZE, "[%s]", a->name);
+//					fprintf(stderr, "%s\t", el);
+				    //offset_increment is just the size of the pointer
+
+				}
+				else			//its a number
+				{
+					//if its a number the offset_increment will be the size of the variable*rank
+					snprintf(el, ELSIZE, "[%d]", d->dimension.rank);
+				}
+				strncat(dims, el, DIMSIZE);
+			}
+// 			fprintf(stderr, "%s\n", dims);
+
+			while(current_fm->size % 8 != 0)
+			{
+				current_fm->size ++;					
+			}
+
+			switch (f->type)
+			{
+			case adios_unknown:
+				fprintf(stderr, "bad type error\n");
+				fieldno--;
+				break;
+
+			case adios_integer:
+				field_list[fieldno].field_type =
+					(char *) malloc(sizeof(char) * 255);
+				snprintf((char *) field_list[fieldno].field_type, 255,
+						 "integer%s", dims);
+				field_list[fieldno].field_size = sizeof(int);
+				
+				field_list[fieldno].field_offset = current_fm->size;
+				current_fm->size += sizeof(void *);
+				break;
+
+			case adios_real:
+				field_list[fieldno].field_type =
+					(char *) malloc(sizeof(char) * 255);
+				snprintf((char *) field_list[fieldno].field_type, 255,
+						 "float%s", dims);
+				field_list[fieldno].field_size = sizeof(float);
+				field_list[fieldno].field_offset = current_fm->size;
+				current_fm->size += sizeof(void *);
+				break;
+
+			case adios_string:
+				field_list[fieldno].field_type = strdup("string");
+				field_list[fieldno].field_size = sizeof(char);
+				field_list[fieldno].field_offset = current_fm->size;
+				current_fm->size += sizeof(void *);
+				break;
+
+			case adios_double:
+				field_list[fieldno].field_type =
+					(char *) malloc(sizeof(char) * 255);
+				snprintf((char *) field_list[fieldno].field_type, 255,
+						 "float%s", dims);
+				field_list[fieldno].field_size = sizeof(double);
+				field_list[fieldno].field_offset = current_fm->size;
+				current_fm->size += sizeof(void *);
+				break;
+
+			case adios_byte:
+				field_list[fieldno].field_type =
+					(char *) malloc(sizeof(char) * 255);
+				snprintf((char *) field_list[fieldno].field_type, 255, "char%s",
+						 dims);
+				field_list[fieldno].field_size = sizeof(char);
+				field_list[fieldno].field_offset = current_fm->size;
+				current_fm->size += sizeof(void *);
+				break;
+
+			default:
+				fprintf(stderr, "unknown type error %d\n", f->type);
+				fieldno--;
+				break;
+			}
+
+		}
+
+//      fprintf(formatfile, "%s, %s, %d, %d\n", field_list[fieldno].field_name, field_list[fieldno].field_type,field_list[fieldno].field_size,field_list[fieldno].field_offset); 
+
+
+	}
+
+	dimnames *d = NULL;
+// 	fprintf(stderr,
+// 			"============================\n\tdims and alts\n============================\n");
+// 	fprintf(stderr, "altvarcount = %d\n", altvarcount);
+	field_list =
+		(FMFieldList) realloc(field_list,
+							  sizeof(FMField) * (altvarcount + t->var_count +
+												 1));
+
+	for (d = current_fm->dimlist.lh_first; d != NULL; d = d->entries.le_next)
+	{
+// 		fprintf(stderr, "%s\t", d->name);
+		altname *a = NULL;
+		for (a = d->altlist.lh_first; a != NULL; a = a->entries.le_next)
+		{
+// 			fprintf(stderr, "%s\t", a->name);
+			a->field->field_offset = current_fm->size;
+			current_fm->size += sizeof(int);
+			memcpy(&field_list[fieldno], a->field, sizeof(FMField));
+			fieldno++;
+
+		}
+// 		fprintf(stderr, "\n");
+
+	}
+
+// 	fprintf(stderr,
+// 			"============================\n\tdims and alts\n============================\n");
+
+
+
+//terminate the the fieldlist
+	for (; fieldno < (t->var_count + 1+altvarcount); fieldno++)
+	{
+		field_list[fieldno].field_type = NULL;
+		field_list[fieldno].field_name = NULL;
+		field_list[fieldno].field_offset = 0;
+		field_list[fieldno].field_size = 0;
+	}
+
+// 	fprintf(stderr, "=======================\n");
+
+
+//dump field list to check
+	{
+
+		FMField *f = field_list;
+		int x = 0;
+
+		for (x = 0; x < fieldno; x++)
+		{
+			f = &field_list[x];
+			if (f == NULL || f->field_name == NULL || f->field_size == 0)
+				break;
+
+//  			fprintf(stderr, "%d: %s %s %d %d\n",
+//  					x, f->field_name, f->field_type, f->field_size,
+//  					f->field_offset);
+
+		}
+
+	}
+
+//associate field list
+	format->field_list = field_list;
+
+	current_fm->format->struct_size = current_fm->size;
+	current_fm->buffer = (unsigned char *) malloc(current_fm->size);
+	memset(current_fm->buffer, 0, current_fm->size);
+
+#if HAVE_PORTALS == 1
+//defined(__CRAYXT_COMPUTE_LINUX_TARGET)
+	current_fm->s = InitIOFromFile("param", rank);
+	current_fm->s->rank = rank;
+	current_fm->ioformat = register_data(current_fm->s, current_fm->format);
+#elif HAVE_INFINIBAND == 1
+	current_fm->s = EVthin_ib_InitIOFile("param", 1, rank);
+	current_fm->ioformat =
+		EVthin_ib_registerData(current_fm->s, current_fm->format);
+	{
+		//we can read the code from here
+ 		char codebuffer[1024*1024];
+		char readbuffer[1024*1024];
+		
+		char *filename = getenv("FILTER");
+		
+		if(filename != NULL)
+		{
+			FILE *codefile  = fopen(filename, "r");
+			if(codefile != NULL) 
+			{
+				fread(readbuffer, sizeof(char), 1024*1024, codefile);
+				fclose(codefile);
+			}
+		
+			if(!strcmp(filename, "warp_stat.c"))
+			{	
+//				sprintf(codebuffer, readbuffer, 0);						
+				set_code(current_fm->s, readbuffer);
+			}
+			else if(!strcmp(filename, "warp_bb.c"))
+			{
+//				sprintf(codebuffer, readbuffer);						
+				set_code(current_fm->s, readbuffer);				
+			}
+			else if(!strcmp(filename, "warp_order.c"))
+			{
+				set_code(current_fm->s, readbuffer);											
+			}
+			else if(!strcmp(filename, "warp_tag.c"))
+			{
+				set_code(current_fm->s, readbuffer);											
+			}
+			else if(!strcmp(filename, "warp_bbs.c"))
+			{
+				set_code(current_fm->s, readbuffer);											
+			}
+
+		}
+	}
+	
+#endif
+
+	current_fm->snd_count = 0;
+
+	mdata->fm = current_fm;
+
+	return 0;
+	
+}
+
+static FMField *
+internal_find_field(char *name, FMFieldList flist)
+{
+	FMField *f = flist;
+	while (f->field_name != NULL && strcmp(f->field_name, name))
+	{
+		f++;
+	}
+
+	return f;
+}
+ 
+extern enum ADIOS_FLAG adios_datatap_should_buffer (struct adios_file_struct * fd
+                                                   ,struct adios_method_struct * method)
+{
+}
+
+extern void
+adios_datatap_write(struct adios_file_struct *fd,
+					struct adios_var_struct *f,
+					void *data, struct adios_method_struct *method)
+{
+	struct fm_structure *fm;
+	dmd *mdata = (dmd *) method->method_data;
+
+
+	struct adios_group_struct *group = method->group;
+
+	fm = mdata->fm;
+
+	if (group == NULL || fm == NULL)
+	{
+		fprintf(stderr, "group or fm is null - improperly initialized\n");
+		return;
+
+	}
+
+
+	FMFieldList flist = fm->format->field_list;
+	FMField *field = NULL;
+
+	char *fixedname = findFixedName(fm, f->name);
+
+	field = internal_find_field(fixedname, flist);
+	if (field != NULL)
+	{
+		if (!f->dimensions)
+		{
+			//scalar quantity
+			if (data)
+			{
+				//why wouldn't it have data?
+				memcpy(&fm->buffer[field->field_offset], data,
+					   field->field_size);
+
+				//scalar quantities can have altnames also so assign those
+				if(field->field_name != NULL)
+				{
+					
+					dimnames *d = NULL;
+					for (d = fm->dimlist.lh_first; d != NULL;
+						 d = d->entries.le_next)
+					{
+						if (!strcmp(d->name, field->field_name))
+						{
+							//matches
+							//check if there are altnames
+							altname *a = NULL;
+							for (a = d->altlist.lh_first; a != NULL;
+								 a = a->entries.le_next)
+							{
+								//use the altname field to get the data into the buffer
+								memcpy(&fm->buffer[a->field->field_offset], data,
+									   a->field->field_size);
+								//debug
+//  								int *testingint = (int*)&fm->buffer[a->field->field_offset];
+								
+//   								fprintf(stderr, "writing %s to %s at %d %d\n",
+//   										f->name, a->name, a->field->field_offset,
+//  										(int)*testingint);
+
+							}
+						}
+					}
+				}
+			}
+
+			else
+			{
+				fprintf(stderr, "no data for  scalar %s\n", f->name);
+
+			}
+
+
+		}
+		else
+		{
+			//vector quantity
+			if (data)
+			{
+				//we just need to copy the pointer stored in f->data
+				memcpy(&fm->buffer[field->field_offset], &data, sizeof(void *));
+
+			}
+			else
+			{
+				fprintf(stderr, "no data for vector %s\n", f->name);
+			}
+		}
+	}
+}
+
+static void internal_adios_datatap_write(struct adios_file_struct *fd,
+										 struct adios_method_struct *method);
+
+extern void
+adios_datatap_close(struct adios_file_struct *fd,
+					struct adios_method_struct *method)
+{
+
+	dmd *mdata = method->method_data;
+
+
+	if (!mdata->initialized)
+	{
+		return;
+	}
+
+
+	if (fd->mode & adios_mode_write)
+	{
+		internal_adios_datatap_write(fd, method);
+	}
+
+}
+
+
+void
+internal_adios_datatap_write(struct adios_file_struct *fd,
+							 struct adios_method_struct *method)
+{
+
+
+	if (fd == NULL)
+	{
+		fprintf(stderr, "fd is null\n");
+
+		return;
+	}
+
+	dmd *mdata = method->method_data;
+
+
+	struct adios_group_struct *t = method->group;
+
+
+
+//initialize the globallist
+
+//iterate through all the types
+//find the correct format by name
+	struct fm_structure *fm = mdata->fm;
+
+	if (t == NULL || fm == NULL)
+	{
+		fprintf(stderr, "improperly initialized for write\n");
+
+		return;
+
+	}
+
+// 	fprintf(stderr, "\t---\n");
+// 	fflush(stderr);
+
+
+//          FMContext src_context = create_local_FMcontext(NULL);
+//           FMFormat ioformat = register_data_format(src_context, fm->format);
+//          int size =0;
+//           FFSBuffer encode_buffer = create_FFSBuffer();       
+//          char *xfer = FFSencode(encode_buffer, ioformat, fm->buffer, &size);
+//           FFSFile file = open_FFSfile("/tmp/temp", "w");
+//           write_FFSfile(file, ioformat, fm->buffer);
+//           close_FFSfile(file);
+
+//#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
+#if HAVE_PORTALS == 1
+	if (fm->snd_count > 0)
+	{
+		send_end(fm->s);
+	}
+#elif HAVE_INFINIBAND == 1
+	if (fm->snd_count > 0)
+	{
+		EVthin_ib_endSend(fm->s);
+	}
+#endif
+
+
+//now that we have all the info lets call write on each of these data types
+//#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
+#if HAVE_PORTALS == 1
+	start_send(fm->s, fm->buffer, fm->size, fm->ioformat, NULL);
+
+#elif HAVE_INFINIBAND == 1
+// 	fprintf(stderr, "size = %d\n", fm->size);
+	
+	EVthin_ib_startSend(fm->s, fm->buffer, fm->size, fm->ioformat, fm->alist);
+#endif
+
+	fm->snd_count++;
+
+
+}
+
+extern void
+adios_datatap_finalize(int mype, struct adios_method_struct *method)
+{
+
+	dmd *mdata = method->method_data;
+
+
+	struct adios_group_struct *t = method->group;
+
+
+
+//initialize the globallist
+
+//iterate through all the types
+//find the correct format by name
+	struct fm_structure *fm = mdata->fm;
+
+	if (t == NULL || fm == NULL)
+	{
+		fprintf(stderr, "improperly initialized for finalize %p %p\n", t, fm);
+
+		return;
+
+	}
+
+#if HAVE_PORTALS == 1
+	if (fm->snd_count > 0)
+	{
+		char buffer[128];
+		sprintf(buffer, "client-%d", rank);
+
+		outputTimingInfo(buffer);
+
+		send_end(fm->s);
+
+	}
+#elif HAVE_INFINIBAND == 1
+	if (fm->snd_count > 0)
+	{
+
+		char buffer[128];
+		sprintf(buffer, "client-%d", rank);
+
+		EVthin_ib_outputTimingInfo(buffer);
+
+		EVthin_ib_endSend(fm->s);
+	}
+#endif
+
+}
+
+
+extern void
+adios_datatap_end_iteration(struct adios_method_struct *method)
+{
+	struct fm_structure *fm;
+	dmd *mdata = (dmd *) method->method_data;
+	fm = mdata->fm;
+
+	if (fm == NULL)
+		return;
+
+
+#if HAVE_PORTALS == 1
+	startIter(fm->s);
+#elif HAVE_INFINIBAND == 1
+	EVthin_ib_startIter(fm->s);
+#endif
+
+	mdata->cycle_id = 0;
+
+}
+
+extern void
+adios_datatap_start_calculation(struct adios_method_struct *method)
+{
+	struct fm_structure *fm;
+	dmd *mdata = (dmd *) method->method_data;
+	fm = mdata->fm;
+
+	if (fm == NULL)
+		return;
+
+
+#if HAVE_PORTALS == 1
+	startCompute(fm->s, mdata->cycle_id);
+#elif HAVE_INFINIBAND == 1
+	EVthin_ib_startCompute(fm->s, mdata->cycle_id);
+#endif
+
+
+}
+
+extern void
+adios_datatap_stop_calculation(struct adios_method_struct *method)
+{
+	struct fm_structure *fm;
+	dmd *mdata = (dmd *) method->method_data;
+	fm = mdata->fm;
+
+	if (fm == NULL)
+		return;
+
+
+#if HAVE_PORTALS == 1
+	endCompute(fm->s, mdata->cycle_id);
+#elif HAVE_INFINIBAND == 1
+	EVthin_ib_endCompute(fm->s, mdata->cycle_id);
+#endif
+
+	mdata->cycle_id++;
+
+}
+
+extern void
+adios_datatap_get_write_buffer(struct adios_file_struct *fd,
+			       struct adios_var_struct *f,
+			       uint64_t *size,
+			       void **buffer,
+			       struct adios_method_struct *method)
+{
+	fprintf(stderr, "adios_datatap_write_get_buffer: datatap disabled, "
+			"no portals support\n");
+}
+
+
+void
+adios_datatap_read(struct adios_file_struct *fd,
+		   struct adios_var_struct *f,
+		   void *buffer, uint64_t buffer_size,
+		   struct adios_method_struct *method)
+{
+
+}
+
+#else
+
+
+void
+adios_datatap_read(struct adios_file_struct *fd,
+				   struct adios_var_struct *f,
+				   void *buffer, struct adios_method_struct *method)
+{
+
+}
+
+extern void
+adios_datatap_get_write_buffer(struct adios_file_struct *fd,
+							   struct adios_var_struct *f,
+							   unsigned long long *size,
+							   void **buffer,
+							   struct adios_method_struct *method)
+{
+}
+
+extern void
+adios_datatap_stop_calculation(struct adios_method_struct *method)
+{
+}
+
+extern void
+adios_datatap_start_calculation(struct adios_method_struct *method)
+{
+}
+
+extern void
+adios_datatap_end_iteration(struct adios_method_struct *method)
+{
+}
+
+extern void
+adios_datatap_finalize(int mype, struct adios_method_struct *method)
+{
+}
+
+extern void
+adios_datatap_close(struct adios_file_struct *fd,
+					struct adios_method_struct *method)
+{
+}
+
+extern void
+adios_datatap_write(struct adios_file_struct *fd,
+					struct adios_var_struct *f,
+					void *data, struct adios_method_struct *method)
+{
+}
+
+extern void
+adios_datatap_open(struct adios_file_struct *fd,
+				   struct adios_method_struct *method)
+{
+}
+
+extern void
+adios_datatap_init(const char *params, struct adios_method_struct *method)
+{
+}
+
+enum ADIOS_FLAG adios_datatap_should_buffer (struct adios_file_struct * fd
+                                            ,struct adios_method_struct * method)
+{
+}
+#endif
+
+/*	FILE *formatfile = fopen("/tmp/formatfile","a+");
+	if(formatfile == NULL) {
+		fprintf(stderr, "can not open format file\n");
+		exit(0);
+	}
+	fprintf(formatfile, "\n\n\n");
+	fclose(formatfile);
+
+*/
diff --git a/src/adios_dimes.c b/src/adios_dimes.c
new file mode 100644
index 0000000..9bcb2de
--- /dev/null
+++ b/src/adios_dimes.c
@@ -0,0 +1,485 @@
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+// xml parser
+#include <mxml.h>
+
+// dart
+#include <sys/uio.h>
+
+// see if we have MPI or other tools
+#include "config.h"
+
+// mpi
+#if HAVE_MPI
+#include "mpi.h"
+#endif
+
+#include "adios.h"
+#include "adios_types.h"
+#include "adios_transport_hooks.h"
+#include "adios_internals.h"
+#include "adios_internals_mxml.h"
+
+#include "dimes.h"
+/*#define DIMES_DO_VERSIONING define it at configure as -DDART_DO_VERSIONING in CFLAGS*/
+
+static int adios_dimes_initialized = 0;
+#define MAX_DIMES_NAMELEN 128
+static char dimes_type_var_name[MAX_DIMES_NAMELEN];
+static char dimes_var_name[MAX_DIMES_NAMELEN];
+
+static int dimes_sync_id = 0;
+
+struct adios_DIMES_data_struct
+{
+	int rank; //dart rank or MPI rank if MPI is available
+	int peers; //from xml parameter or group communicator
+	int appid; //from xml parameter or 1
+	int time_index; //versioning in DIMES, start from 0
+	int n_writes; //how many times adioes_write has been called
+};
+
+int adios_dimes_get_dim_rank_value(struct adios_dimension_item_struct * dim_info, struct adios_group_struct *group)
+{
+    if(!dim_info)
+       return 0;
+
+    if(dim_info->id != 0)
+    {
+        struct adios_var_struct *dim_var = NULL;
+        dim_var = adios_find_var_by_id(group->vars, dim_info->id);
+        if(!dim_var || !dim_var->data)
+           return 0;
+        
+        int rank = 0;
+        switch ( dim_var->type )
+        {
+        case adios_unsigned_byte:
+             rank = (*(uint8_t*) dim_var->data);
+             break;
+        case adios_byte:
+             rank = (*(int8_t*) dim_var->data);
+             break;
+        case adios_unsigned_short:
+             rank = (*(uint16_t*) dim_var->data);
+             break;
+        case adios_short:
+             rank = (*(int16_t*) dim_var->data);
+             break;
+        case adios_unsigned_integer:
+             rank = (*(uint32_t*) dim_var->data);
+             break;
+        case adios_integer:
+             rank = (*(int32_t*) dim_var->data);
+             break;
+        case adios_unsigned_long:
+             rank = (*(uint64_t*) dim_var->data);
+             break;
+        case adios_long:
+             rank = (*(int64_t*) dim_var->data);
+             break;
+
+        default: break;
+        }
+
+        return rank;
+    }
+    else
+    {
+        return dim_info->rank;
+    }
+}
+
+void adios_dimes_init(const char *parameters,
+					struct adios_method_struct *method)
+{
+	struct adios_DIMES_data_struct *p = NULL;
+	if(!adios_dimes_initialized){
+		adios_dimes_initialized = 1;
+	}
+	
+    	method->method_data = calloc (1, sizeof (struct adios_DIMES_data_struct));
+    	p = (struct adios_DIMES_data_struct*)method->method_data;
+	
+	int index, i;
+	char temp[64];
+	int num_peers;
+	int appid;
+	int was_set;
+	
+	num_peers = 1; //Init value
+	//application ID should be set by the application calling adios_set_application_id()
+	appid = globals_adios_get_application_id(&was_set);
+	if(!was_set)
+		appid = 1;
+	
+	//init the static data structure
+	p->peers = num_peers;
+	p->appid = appid;
+	p->time_index = 0;
+	p->n_writes = 0;
+	
+	fprintf(stderr, "adios_dimes_init: appid=%d, peers=%d\n", p->appid, p->peers);
+   
+}
+
+static void adios_dimes_var_to_comm(const char *comm_name,
+								enum ADIOS_FLAG host_language_fortran,
+								void *data,
+								MPI_Comm *comm)
+{
+    if (data)
+    {
+        int t = *(int *) data;
+
+        if (!comm_name || !strcmp (comm_name, ""))
+        {
+            if (!t)
+            {
+                fprintf (stderr, "communicator not provided and none "
+                                 "listed in XML.  Defaulting to "
+                                 "MPI_COMM_SELF\n"
+                        );
+
+                *comm = MPI_COMM_SELF;
+            }
+            else
+            {
+                if (host_language_fortran == adios_flag_yes)
+                {
+                    *comm = MPI_Comm_f2c (t);
+                }
+                else
+                {
+                    *comm = *(MPI_Comm *) data;
+                }
+            }
+        }
+        else
+        {
+            if (!t)
+            {
+                fprintf (stderr, "communicator not provided but one "
+                                 "listed in XML.  Defaulting to "
+                                 "MPI_COMM_WORLD\n"
+                        );
+
+                *comm = MPI_COMM_WORLD;
+            }
+            else
+            {
+                if (host_language_fortran == adios_flag_yes)
+                {
+                    *comm = MPI_Comm_f2c (t);
+                }
+                else
+                {
+                    *comm = *(MPI_Comm *) data;
+                }
+            }
+        }
+    }
+    else
+    {
+        fprintf (stderr, "coordination-communication not provided. "
+                         "Using MPI_COMM_WORLD instead\n"
+                );
+
+        *comm = MPI_COMM_WORLD;
+    }
+}								
+
+int adios_dimes_open(struct adios_file_struct *fd,
+					struct adios_method_struct *method,
+					void *comm)
+{
+	int ret = 0;
+	struct adios_DIMES_data_struct *p = (struct adios_DIMES_data_struct*)
+									method->method_data;
+	int num_peers = p->peers;
+	
+        fprintf(stderr, "adios_dimes_open: open %s, mode=%d, time_index=%d \n",
+                        fd->name, fd->mode, p->time_index);	
+	
+#if HAVE_MPI
+		//Get applicaitons size / process rank info from MPI communicator,
+		//which is necessary for dimes
+		MPI_Comm group_comm;
+		if(comm) {
+			adios_dimes_var_to_comm(fd->group->group_comm,fd->group->adios_host_language_fortran,
+									comm, &group_comm);
+			MPI_Comm_rank(group_comm, &(p->rank));
+			MPI_Comm_size(group_comm, &num_peers);
+			p->peers = num_peers;
+		}
+#endif
+	
+	//connect to DIMES index srv at the very first adios_open(),disconnect in adios_finalize()
+	if(!globals_adios_is_dimes_connected()){
+		//Init dimes client
+		//int num_total_peers = 64+16+1;
+		ret = dimes_init(num_peers,num_peers,p->appid);
+		if(ret<0){
+			fprintf(stderr, "adios_dimes_open: rank=%d Failed to connect to index srv: err=%d,  rank=%d\n", p->rank, ret);        
+            		return ret;
+		}
+		
+#if !HAVE_MPI
+		p->rank = dimes_rank();
+		p->peers = dimes_peers();
+#endif
+
+		fprintf(stderr,"adios_dimes_open:rank=%d connected to DIMES index srv: peers=%d, appid=%d\n",
+			p->rank, p->peers, p->appid);
+	}
+	globals_adios_set_dimes_connected_from_writer();
+	
+	return ret;
+}
+
+enum ADIOS_FLAG adios_dimes_should_buffer(struct adios_file_struct *fd,
+										struct adios_method_struct *method)
+{
+	return adios_flag_no;
+}
+
+void adios_dimes_write(struct adios_file_struct *fd,
+			struct adios_var_struct *v,
+			void *data,
+			struct adios_method_struct *method)
+{
+	struct adios_DIMES_data_struct *p = (struct adios_DIMES_data_struct *)
+							method->method_data;
+	
+	struct adios_group_struct *group = fd->group;
+	
+	//Get var size
+	int var_type_size = (int)adios_get_type_size(v->type,v->data);
+	//Get var name
+	char *var_name = v->name;
+	int err;
+	
+	//Get two offset coordinate values
+	unsigned int version;
+	
+	int dims[3]={1,1,1},lb[3]={0,0,0},ub[3]={0,0,0};/*lower and upper bounds*/
+	int ndims = 0;
+	struct adios_dimension_struct *var_dimensions = v->dimensions;
+	//Calculate lower and upper bounds for each var(up to 3 dims)
+	while( var_dimensions && ndims<3 ){
+		dims[ndims] = adios_dimes_get_dim_rank_value(&(var_dimensions->dimension), group);
+		lb[ndims] = adios_dimes_get_dim_rank_value(&(var_dimensions->local_offset),group);
+		ub[ndims] = lb[ndims] + dims[ndims] - 1;
+		var_dimensions = var_dimensions->next;
+		ndims++;
+	}
+	
+#ifdef DIMES_DO_VERSIONING
+	version = p->time_index;
+#else
+	version = 0;
+#endif
+
+	//Construct var name and var type name	
+	snprintf(dimes_var_name, MAX_DIMES_NAMELEN, "%s/%s", fd->name, v->name);
+	snprintf(dimes_type_var_name, MAX_DIMES_NAMELEN, "TYPE@%s", dimes_var_name);
+
+	/*Scalar variables are put into space only by rank=0 process*/
+	if(p->rank == 0){
+		err = dimes_put_scalar(dimes_type_var_name,version,4,0,0,0,0,0,0,v->type);
+	}
+
+	/*	
+	if(group->adios_host_language_fortran == adios_flag_yes || ndims == 1){
+		//Flip 1st and 2nd dimension for any Fortran writings and any 1D array
+		dimes_put(dimes_var_name, version, var_type_size,lb[1],lb[0],lb[2],ub[1],ub[0],ub[2],data,1);
+	} else {
+		//Keep dimension order in case of C writer of 2-3D arrays
+		dimes_put(dimes_var_name, version, var_type_size,lb[0],lb[1],lb[2],ub[0],ub[1],ub[2],data,1);
+	}
+	*/
+	if( lb[0]==0 && lb[1]==0 && lb[2]==0 && ub[0]==0 && ub[1]==0 && ub[2]==0){
+		if(p->rank == 0){
+			/*Scalar variables are put into space only by rank=0 process*/
+			int scalar_data = *(int *)data;
+			dimes_put_scalar(dimes_var_name, version, 4, 0,0,0,0,0,0, scalar_data);
+
+			fprintf(stderr, "var_name=%s, type=%s(%d) elemsize=%d, version=%d, size_x=%d, size_y=%d, size_z=%d, (%d,%d,%d), (%d,%d,%d)\n",
+				dimes_var_name, adios_type_to_string_int(v->type), v->type, var_type_size, version,
+				dims[0], dims[1], dims[2], lb[0], lb[1], lb[2], ub[0], ub[1], ub[2]);
+		}
+	}
+	else {
+		/*Multi-dimension(1-D,2-D or 3-D) array is put into space*/
+		if(group->adios_host_language_fortran == adios_flag_yes || ndims == 1){
+			//Flip 1st and 2nd dimension for any Fortran writings and any 1D array
+			dimes_put(dimes_var_name, version, var_type_size,lb[1],lb[0],lb[2],ub[1],ub[0],ub[2],data,1);
+		} else {
+			//Keep dimension order in case of C writer of 2-3D arrays
+			dimes_put(dimes_var_name, version, var_type_size,lb[0],lb[1],lb[2],ub[0],ub[1],ub[2],data,1);
+		}
+	
+		/*
+		fprintf(stderr, "var_name=%s, type=%s(%d) elemsize=%d, version=%d, size_x=%d, size_y=%d, size_z=%d, (%d,%d,%d), (%d,%d,%d)\n",
+			dimes_var_name, adios_type_to_string_int(v->type), v->type, var_type_size, version,
+			dims[0], dims[1], dims[2], lb[0], lb[1], lb[2], ub[0], ub[1], ub[2]);
+		*/
+	}
+}
+
+void adios_dimes_get_write_buffer(struct adios_file_struct *fd,
+				struct adios_var_struct *v,
+				uint64_t *size,
+				void **buffer,
+				struct adios_method_struct *method)
+{
+    uint64_t mem_allowed;
+
+    if (*size == 0)
+    {
+        *buffer = 0;
+
+        return;
+    }
+
+    if (v->data && v->free_data == adios_flag_yes)
+    {
+        adios_method_buffer_free (v->data_size);
+        free (v->data);
+        v->data = NULL;
+    }
+
+    mem_allowed = adios_method_buffer_alloc (*size);
+    if (mem_allowed == *size)
+    {
+        *buffer = malloc (*size);
+        if (!*buffer)
+        {
+            adios_method_buffer_free (mem_allowed);
+            fprintf (stderr, "Out of memory allocating %llu bytes for %s\n"
+                    ,*size, v->name
+                    );
+            v->got_buffer = adios_flag_no;
+            v->free_data = adios_flag_no;
+            v->data_size = 0;
+            v->data = 0;
+            *size = 0;
+            *buffer = 0;
+        }
+        else
+        {
+            v->got_buffer = adios_flag_yes;
+            v->free_data = adios_flag_yes;
+            v->data_size = mem_allowed;
+            v->data = *buffer;
+        }
+    }
+    else
+    {
+        adios_method_buffer_free (mem_allowed);
+        fprintf (stderr, "OVERFLOW: Cannot allocate requested buffer of %llu "
+                         "bytes for %s\n"
+                ,*size
+                ,v->name
+                );
+        *size = 0;
+        *buffer = 0;
+    }
+}
+
+/*NOT IMPLEMENTED. Use READ API to read variables*/
+void adios_dimes_read(struct adios_file_struct *fd,
+					struct adios_var_struct *v, void *buffer,
+					uint64_t buffer_size,
+					struct adios_method_struct *method)
+{
+	//NOT TO DO
+}
+
+void adios_dimes_close(struct adios_file_struct *fd,
+					struct adios_method_struct *method)
+{
+	struct adios_DIMES_data_struct *p = (struct adios_DIMES_data_struct *)
+											method->method_data;
+
+	unsigned int version;	
+#ifdef DIMES_DO_VERSIONING
+	version = p->time_index;
+	dimes_sync_id = version;
+#else
+	version = 0;
+	dimes_sync_id++;
+#endif
+
+
+	if(fd->mode == adios_mode_write)
+	{
+	    //put file name & group name scalar info
+       	    if (p->rank == 0) {
+            /* Write two adios specific variables with the name of the file and name of the group into the space */
+            /* ADIOS Read API fopen() checks these variables to see if writing already happened */
+            snprintf(dimes_var_name, MAX_DIMES_NAMELEN, "FILE@%s", fd->name);
+            printf("%s: put %s = %d into space\n", __func__, dimes_var_name, p->time_index);
+            dimes_put_scalar(dimes_var_name, version, 4, 0, 0, 0, 0, 0, 0, p->time_index);
+
+	    }
+	}
+	else if(fd->mode == adios_mode_read)
+	{
+		fprintf(stderr,"adios_dimes_open: should not happens when fd->mode==adios_mode_read\n");
+	}
+
+	//Synchronization
+	if( fd->mode == adios_mode_write )
+	{
+		//printf("%s: call dimes_sync()\n",__func__);
+		dimes_sync(dimes_sync_id);
+		//dimes_wait();	
+	}
+	else if( fd->mode == adios_mode_read )
+	{
+		fprintf(stderr,"adios_dimes_close: should not happens when fd->mode==adios_mode_read\n");
+	}
+	
+	/*Incrementa of time index*/
+	p->time_index++;
+	
+	printf("%s: exit\n", __func__);
+}
+
+void adios_dimes_finalize(int mype, struct adios_method_struct *method)
+{
+	struct adios_DIMES_data_struct *p =(struct adios_DIMES_data_struct *)
+											method->method_data;
+	
+	//disconnect from dimes if it is connected from writer but not anymore from reader??
+	if(globals_adios_is_dimes_connected_from_writer() &&
+		!globals_adios_is_dimes_connected_from_both())
+	{
+		printf("%s: call dimes_barrier(), rank=%d\n",__func__,mype);
+		dimes_barrier();
+		printf("%s: call dimes_finalize(), rank=%d\n",__func__,mype);
+		dimes_finalize();
+	}
+	globals_adios_set_dimes_disconnected_from_writer();
+	
+	adios_dimes_initialized = 0;
+	
+	printf("%s: exit\n",__func__);
+}
+
+void adios_dimes_end_iteration(struct adios_method_struct *method)
+{
+}
+
+void adios_dimes_start_calculation (struct adios_method_struct * method)
+{
+}
+
+void adios_dimes_stop_calculation (struct adios_method_struct * method)
+{
+}
diff --git a/src/adios_endianness.c b/src/adios_endianness.c
new file mode 100644
index 0000000..33d54c3
--- /dev/null
+++ b/src/adios_endianness.c
@@ -0,0 +1,139 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdint.h>
+#include <stdio.h>
+#include "adios_types.h"
+
+void show_bytes(unsigned char * start, int len)
+{
+    int i;
+    for (i = 0; i < len; i ++) {
+        fprintf(stderr, " %.2x", start[i]);
+    }
+    fprintf(stderr, "\n");
+}
+
+
+void swap_16_ptr(void *data) 
+{
+    uint16_t d = *(uint16_t *)data;
+    *(uint16_t *)data = d>>8 | d<<8;
+}
+
+
+void swap_32_ptr(void *data)
+{
+    uint32_t d = *(uint32_t *)data;
+    *(uint32_t *)data = ((d&0x000000FF)<<24) 
+                      + ((d&0x0000FF00)<<8)
+	                  + ((d&0x00FF0000)>>8)
+	                  + ((d&0xFF000000)>>24);
+}
+
+
+void swap_64_ptr(void *data)
+{
+    uint64_t d = *(uint64_t *)data;
+    *(uint64_t *)data = ((d&0x00000000000000FF)<<56) 
+		                  + ((d&0x000000000000FF00)<<40)
+		                  + ((d&0x0000000000FF0000)<<24)
+		                  + ((d&0x00000000FF000000)<<8)
+		                  + ((d&0x000000FF00000000LL)>>8)
+		                  + ((d&0x0000FF0000000000LL)>>24)
+		                  + ((d&0x00FF000000000000LL)>>40)
+		                  + ((d&0xFF00000000000000LL)>>56);
+}
+
+
+void swap_128_ptr(void *data)
+{
+    uint64_t d = *(uint64_t *)data;
+    *(uint64_t *)data = ((d&0x00000000000000FF)<<56) 
+		                  + ((d&0x000000000000FF00)<<40)
+		                  + ((d&0x0000000000FF0000)<<24)
+		                  + ((d&0x00000000FF000000)<<8)
+		                  + ((d&0x000000FF00000000LL)>>8)
+		                  + ((d&0x0000FF0000000000LL)>>24)
+		                  + ((d&0x00FF000000000000LL)>>40)
+		                  + ((d&0xFF00000000000000LL)>>56);
+    d = *((uint64_t *)data + 1);
+    d = ((d&0x00000000000000FF)<<56) 
+		                  + ((d&0x000000000000FF00)<<40)
+		                  + ((d&0x0000000000FF0000)<<24)
+		                  + ((d&0x00000000FF000000)<<8)
+		                  + ((d&0x000000FF00000000LL)>>8)
+		                  + ((d&0x0000FF0000000000LL)>>24)
+		                  + ((d&0x00FF000000000000LL)>>40)
+		                  + ((d&0xFF00000000000000LL)>>56);
+    *((uint64_t *)data + 1) = *(uint64_t *)data;
+    *(uint64_t *)data = d; 
+}
+
+
+void swap_adios_type(void *data, enum ADIOS_DATATYPES type)
+{
+    if(type == adios_string) {
+        return;
+	}
+	else {
+		uint64_t size = adios_get_type_size (type, "");
+
+		switch (size)
+		{
+			case 1:
+				break;
+			case 2:
+				swap_16_ptr(data);
+				break;
+			case 4:
+				swap_32_ptr(data);
+				break;
+			case 8:
+				swap_64_ptr(data);
+				break;
+			case 16:
+				swap_128_ptr(data);
+				break;
+			case adios_complex:
+			case adios_double_complex:
+				// TODO
+				break;
+		}
+	}
+}
+
+
+void swap_adios_type_array(void *data, enum ADIOS_DATATYPES type, uint64_t payload_size)
+{
+    uint64_t size = adios_get_type_size (type, "");
+    uint64_t num_elements = payload_size / size;
+
+    uint64_t i = 0;
+	for(i = 0; i < num_elements; i ++) {
+        swap_adios_type((char *)data + i*size, type);
+	}    
+}
+
+void swap_ptr(void * data, int size)
+{
+	switch (size)
+	{
+		case 16:
+			swap_16_ptr(data);
+			break;
+		case 32:
+			swap_32_ptr(data);
+			break;
+		case 64:
+			swap_64_ptr(data);
+			break;
+		case 128:
+			swap_128_ptr(data);
+			break;
+	}
+}
diff --git a/src/adios_endianness.h b/src/adios_endianness.h
new file mode 100644
index 0000000..5e1541b
--- /dev/null
+++ b/src/adios_endianness.h
@@ -0,0 +1,37 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#ifndef ENDIANNESS_H 
+#define ENDIANNESS_H 1
+
+#include "adios_types.h"
+
+void show_bytes(unsigned char * start, int len);
+
+void swap_ptr(void * data, int size);
+
+void swap_16_ptr(void *data);
+
+void swap_32_ptr(void *data);
+
+void swap_64_ptr(void *data);
+
+void swap_128_ptr(void *data);
+
+#define swap_16(data) swap_16_ptr(&(data))
+
+#define swap_32(data) swap_32_ptr(&(data))
+
+#define swap_64(data) swap_64_ptr(&(data))
+
+#define swap_128(data) swap_128_ptr(&(data))
+
+void swap_adios_type(void *data, enum ADIOS_DATATYPES type);
+
+void swap_adios_type_array(void *payload, enum ADIOS_DATATYPES type, uint64_t payload_size);
+
+#endif
diff --git a/src/adios_error.c b/src/adios_error.c
new file mode 100644
index 0000000..711281b
--- /dev/null
+++ b/src/adios_error.c
@@ -0,0 +1,48 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include "adios_error.h"
+
+#ifdef DMALLOC
+#include "dmalloc.h"
+#endif
+
+#define ERRMSG_MAXLEN 256
+
+//  adios_errno is extern defined in adios_read.h and adiosf.c
+int adios_errno;  
+
+// string to store last error message
+// cannot be static because adios_errmsg returns it
+char aerr[ERRMSG_MAXLEN];
+
+const char *adios_get_last_errmsg (void) 
+{ 
+    return aerr; 
+}
+
+void error (enum ADIOS_ERRCODES errno, char *fmt, ...) 
+{
+    va_list ap;
+    adios_errno = (int)errno;
+    va_start(ap, fmt);
+    (void) vsnprintf(aerr, ERRMSG_MAXLEN, fmt, ap);
+    va_end(ap);
+}
+
+void error_at_line (enum ADIOS_ERRCODES errno, const char* filename, unsigned int linenum, char *fmt, ...)
+{
+    va_list ap;
+    adios_errno = (int)errno;
+    va_start(ap, fmt);
+    (void) vsnprintf(aerr, ERRMSG_MAXLEN, fmt, ap);
+    va_end(ap);
+}
diff --git a/src/adios_error.h b/src/adios_error.h
new file mode 100644
index 0000000..a136918
--- /dev/null
+++ b/src/adios_error.h
@@ -0,0 +1,40 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#ifndef __ADIOS_ERROR_H_
+#define __ADIOS_ERROR_H_
+
+enum ADIOS_ERRCODES {
+     err_no_error = 0
+    ,err_no_memory
+    ,err_MPI_open_error
+    ,err_file_not_found_error
+    ,err_invalid_file_pointer
+    ,err_invalid_group
+    ,err_invalid_group_struct
+    ,err_invalid_varid
+    ,err_invalid_varname
+    ,err_corrupted_variable
+    ,err_invalid_attrid
+    ,err_invalid_attrname
+    ,err_corrupted_attribute
+    ,err_invalid_attribute_reference
+    ,err_invalid_timestep
+    ,err_no_data_at_timestep
+    ,err_time_at_wrong_dimension
+    ,err_invalid_read_method
+    ,err_connection_failed
+    ,err_out_of_bound
+    ,err_unspecified
+};
+
+void error (enum ADIOS_ERRCODES errno, char *fmt, ...);
+void error_at_line (enum ADIOS_ERRCODES errno, const char* filename, unsigned int linenum, char *fmt, ...);
+
+const char* adios_get_last_errmsg (void);
+
+#endif
diff --git a/src/adios_internals.c b/src/adios_internals.c
new file mode 100644
index 0000000..4daca6c
--- /dev/null
+++ b/src/adios_internals.c
@@ -0,0 +1,4993 @@
+/*
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <math.h>
+#include <string.h>
+#include <ctype.h>  /* isdigit() */
+#include <unistd.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <arpa/inet.h>
+#include <stdint.h>
+#include <sys/stat.h>
+
+#include "adios.h"
+#include "adios_internals.h"
+#include "adios_bp_v1.h"
+
+static struct adios_method_list_struct * adios_methods = 0;
+static struct adios_group_list_struct * adios_groups = 0;
+
+int adios_int_is_var (const char * temp) // 1 == yes, 0 == no
+{
+    if (!temp)
+        return 1;
+
+    if (*temp == '-' || isdigit (*temp))
+    {
+        while (*temp)
+        {
+            if (isdigit (*temp))
+                temp++;
+            else
+                return 1;
+        }
+    }
+    else
+        return 1;
+
+    return 0;
+}
+
+int adios_int_is_num (char * temp) // 1 == yes, 0 == no
+{
+    char * extra = 0;
+
+    strtod (temp, &extra);
+
+    if (extra)
+        return 0;
+    else
+        return 1;
+
+    return 0;
+}
+
+struct adios_var_struct * adios_find_var_by_name (struct adios_var_struct * root
+                                                 ,const char * name
+                                                 ,enum ADIOS_FLAG unique_names
+                                                 )
+{
+    int done = 0;
+    struct adios_var_struct * var = 0;
+
+    if (!name)
+    {
+        done = 1;
+        root = 0;
+    }
+
+    while (!done && root)
+    {
+        char * compare_name = root->name;
+        char * compare_name_path = root->name;
+        if (unique_names == adios_flag_no)
+        {
+            compare_name_path = malloc (  strlen (root->name)
+                                        + strlen (root->path)
+                                        + 2 // null term and '/'
+                                       );
+            if (!strcmp (root->path, "/"))
+                sprintf (compare_name_path, "/%s", root->name);
+            else
+                sprintf (compare_name_path, "%s/%s", root->path, root->name);
+        }
+
+        if (   !strcasecmp (name, compare_name)
+            || (   unique_names == adios_flag_no
+                && !strcasecmp (name, compare_name_path)
+               )
+           )
+        {
+            done = 1;
+            var = root;
+        }
+        else
+        {
+            root = root->next;
+        }
+
+        if (unique_names == adios_flag_no)
+        {
+            free (compare_name_path);
+        }
+    }
+
+    return var;
+}
+
+struct adios_attribute_struct * adios_find_attribute_by_name
+                                        (struct adios_attribute_struct * root
+                                        ,const char * name
+                                        ,enum ADIOS_FLAG unique_names
+                                        )
+{
+    int done = 0;
+    struct adios_attribute_struct * attr = 0;
+
+    if (!name)
+    {
+        done = 1;
+        root = 0;
+    }
+
+    while (!done && root)
+    {
+        char * compare_name = root->name;
+        char * compare_name_path = root->name;
+        if (unique_names == adios_flag_no)
+        {
+            compare_name_path = malloc (  strlen (root->name)
+                                        + strlen (root->path)
+                                        + 2 // null term and '/'
+                                       );
+            if (!strcmp (root->path, "/"))
+                sprintf (compare_name_path, "/%s", root->name);
+            else
+                sprintf (compare_name_path, "%s/%s", root->path, root->name);
+        }
+
+        if (   !strcasecmp (name, compare_name)
+            || (   unique_names == adios_flag_no
+                && !strcasecmp (name, compare_name_path)
+               )
+           )
+        {
+            done = 1;
+            attr = root;
+        }
+        else
+        {
+            root = root->next;
+        }
+
+        if (unique_names == adios_flag_no)
+        {
+            free (compare_name_path);
+        }
+    }
+
+    return attr;
+}
+
+struct adios_var_struct * adios_find_var_by_id (struct adios_var_struct * root
+                                               ,uint16_t id
+                                               )
+{
+    while (root)
+    {
+        if (root->id == id)
+            return root;
+        else
+            root = root->next;
+    }
+
+    return NULL;
+}
+
+struct adios_attribute_struct * adios_find_attribute_by_id
+                                         (struct adios_attribute_struct * root
+                                         ,uint16_t id
+                                         )
+{
+    while (root)
+    {
+        if (root->id == id)
+            return root;
+        else
+            root = root->next;
+    }
+
+    return NULL;
+}
+
+int adios_parse_dimension (const char * dimension
+                          ,const char * global_dimension
+                          ,const char * local_offset
+                          ,struct adios_group_struct * g
+                          ,struct adios_dimension_struct * dim
+                          )
+{
+    if (!dimension)
+    {
+        fprintf (stderr, "adios_parse_dimension: dimension not provided\n");
+
+        return 0;
+    }
+
+    dim->dimension.rank = 0;
+    dim->dimension.id = 0;
+    dim->dimension.time_index = adios_flag_no;
+    if (adios_int_is_var (dimension))
+    {
+        struct adios_var_struct * var = 0;
+        dim->dimension.rank = 0;
+        var = adios_find_var_by_name (g->vars, dimension
+                                     ,g->all_unique_var_names
+                                     );
+        if (!var)
+        {
+            struct adios_attribute_struct * attr = 0;
+            attr = adios_find_attribute_by_name (g->attributes, dimension
+                                                ,g->all_unique_var_names
+                                                );
+
+            if (!attr)
+            {
+                if (   g->time_index_name
+                    && !strcasecmp (g->time_index_name, dimension)
+                   )
+                {
+                    dim->dimension.time_index = adios_flag_yes;
+                }
+                else
+                {
+                    fprintf (stderr, "config.xml: invalid var dimension: %s\n"
+                            ,dimension
+                            );
+
+                    return 0;
+                }
+            }
+            else
+            {
+                if (attr->var)
+                {
+                    switch (attr->var->type)
+                    {
+                        case adios_string:
+                        case adios_real:
+                        case adios_double:
+                        case adios_long_double:
+                        case adios_complex:
+                        case adios_double_complex:
+                            fprintf (stderr, "config.xml: var dimension %s "
+                                             "has an invalid type: %s\n"
+                                    ,attr->name
+                                    ,adios_type_to_string_int (attr->var->type)
+                                    );
+                            return 0;
+
+                        default: // the integral numeric types are all fine
+                            break;
+                    }
+                    attr->var->is_dim = adios_flag_yes;
+                }
+                else
+                {
+                    switch (attr->type)
+                    {
+                        case adios_string:
+                        case adios_real:
+                        case adios_double:
+                        case adios_long_double:
+                        case adios_complex:
+                        case adios_double_complex:
+                            fprintf (stderr, "config.xml: var dimension %s "
+                                             "has an invalid type: %s\n"
+                                    ,attr->name
+                                    ,adios_type_to_string_int (attr->type)
+                                    );
+                            return 0;
+
+                        default: // the integral numeric types are all fine
+                            break;
+                    }
+                }
+                dim->dimension.id = attr->id;
+            }
+        }
+        else
+        {
+            switch (var->type)
+            {
+                case adios_string:
+                case adios_real:
+                case adios_double:
+                case adios_long_double:
+                case adios_complex:
+                case adios_double_complex:
+                    fprintf (stderr, "config.xml: var dimension %s "
+                                     "has an invalid type: %s\n"
+                            ,var->name
+                            ,adios_type_to_string_int (var->type)
+                            );
+                    return 0;
+
+                default: // the integral numeric types are all fine
+                    break;
+            }
+
+            dim->dimension.id = var->id;
+            var->is_dim = adios_flag_yes;
+        }
+    }
+    else
+    {
+        dim->dimension.id = 0;
+        dim->dimension.rank = atoi (dimension);
+    }
+
+    if (!global_dimension)
+    {
+        fprintf (stderr, "adios_parse_dimension: global_dimension not "
+                         "provided\n"
+                );
+
+        return 0;
+    }
+
+    if (adios_int_is_var (global_dimension))
+    {
+        struct adios_var_struct * var = 0;
+        dim->global_dimension.rank = 0;
+        var = adios_find_var_by_name (g->vars, global_dimension
+                                     ,g->all_unique_var_names
+                                     );
+        if (!var)
+        {
+            struct adios_attribute_struct * attr = 0;
+            attr = adios_find_attribute_by_name (g->attributes, global_dimension
+                                                ,g->all_unique_var_names
+                                                );
+
+            if (!attr)
+            {
+                if (   g->time_index_name
+                    && !strcasecmp (g->time_index_name, global_dimension)
+                   )
+                {
+                    dim->global_dimension.time_index = adios_flag_yes;
+                }
+                else
+                {
+                    fprintf (stderr, "config.xml: invalid global-bounds "
+                                     "dimension: %s\n"
+                            ,global_dimension
+                            );
+
+                    return 0;
+                }
+            }
+            else
+            {
+                if (attr->var)
+                {
+                    switch (attr->var->type)
+                    {
+                        case adios_string:
+                        case adios_real:
+                        case adios_double:
+                        case adios_long_double:
+                        case adios_complex:
+                        case adios_double_complex:
+                            fprintf (stderr, "config.xml: var dimension %s "
+                                             "has an invalid type: %s\n"
+                                    ,attr->name
+                                    ,adios_type_to_string_int (attr->var->type)
+                                    );
+                            return 0;
+
+                        default: // the integral numeric types are all fine
+                            break;
+                    }
+                    attr->var->is_dim = adios_flag_yes;
+                }
+                else
+                {
+                    switch (attr->type)
+                    {
+                        case adios_string:
+                        case adios_real:
+                        case adios_double:
+                        case adios_long_double:
+                        case adios_complex:
+                        case adios_double_complex:
+                            fprintf (stderr, "config.xml: var dimension %s "
+                                             "has an invalid type: %s\n"
+                                    ,attr->name
+                                    ,adios_type_to_string_int (attr->type)
+                                    );
+                            return 0;
+
+                        default: // the integral numeric types are all fine
+                            break;
+                    }
+                }
+                dim->global_dimension.id = attr->id;
+            }
+        }
+        else
+        {
+            switch (var->type)
+            {
+                case adios_string:
+                case adios_real:
+                case adios_double:
+                case adios_long_double:
+                case adios_complex:
+                case adios_double_complex:
+                    fprintf (stderr, "config.xml: var dimension %s "
+                                     "has an invalid type: %s\n"
+                            ,var->name
+                            ,adios_type_to_string_int (var->type)
+                            );
+                    return 0;
+
+                default: // the integral numeric types are all fine
+                    break;
+            }
+            var->is_dim = adios_flag_yes;
+            dim->global_dimension.id = var->id;
+        }
+    }
+    else
+    {
+        dim->global_dimension.id = 0;
+        dim->global_dimension.rank = strtol (global_dimension, NULL, 10);
+    }
+
+    if (!local_offset)
+    {
+        fprintf (stderr, "adios_parse_dimension: local-offset not provided\n");
+
+        return 0;
+    }
+
+    if (adios_int_is_var (local_offset))
+    {
+        struct adios_var_struct * var = 0;
+        dim->local_offset.rank = 0;
+        var = adios_find_var_by_name (g->vars, local_offset
+                                     ,g->all_unique_var_names
+                                     );
+        if (!var)
+        {
+            struct adios_attribute_struct * attr = 0;
+            attr = adios_find_attribute_by_name (g->attributes, local_offset
+                                                ,g->all_unique_var_names
+                                                );
+
+            if (!attr)
+            {
+                if (   g->time_index_name
+                    && !strcasecmp (g->time_index_name, local_offset)
+                   )
+                {
+                    dim->local_offset.time_index = adios_flag_yes;
+                }
+                else
+                {
+                    fprintf (stderr, "config.xml: invalid var local_offset: "
+                                     "%s\n"
+                            ,local_offset
+                            );
+
+                    return 0;
+                }
+            }
+            else
+            {
+                if (attr->var)
+                {
+                    switch (attr->var->type)
+                    {
+                        case adios_string:
+                        case adios_real:
+                        case adios_double:
+                        case adios_long_double:
+                        case adios_complex:
+                        case adios_double_complex:
+                            fprintf (stderr, "config.xml: var dimension %s "
+                                             "has an invalid type: %s\n"
+                                    ,attr->name
+                                    ,adios_type_to_string_int (attr->var->type)
+                                    );
+                            return 0;
+
+                        default: // the integral numeric types are all fine
+                            break;
+                    }
+                    attr->var->is_dim = adios_flag_yes;
+                }
+                else
+                {
+                    switch (attr->type)
+                    {
+                        case adios_string:
+                        case adios_real:
+                        case adios_double:
+                        case adios_long_double:
+                        case adios_complex:
+                        case adios_double_complex:
+                            fprintf (stderr, "config.xml: var dimension %s "
+                                             "has an invalid type: %s\n"
+                                    ,attr->name
+                                    ,adios_type_to_string_int (attr->type)
+                                    );
+                            return 0;
+
+                        default: // the integral numeric types are all fine
+                            break;
+                    }
+                }
+                dim->local_offset.id = attr->id;
+            }
+        }
+        else
+        {
+            switch (var->type)
+            {
+                case adios_string:
+                case adios_real:
+                case adios_double:
+                case adios_long_double:
+                case adios_complex:
+                case adios_double_complex:
+                    fprintf (stderr, "config.xml: var dimension %s "
+                                     "has an invalid type: %s\n"
+                            ,var->name
+                            ,adios_type_to_string_int (var->type)
+                            );
+                    return 0;
+
+                default: // the integral numeric types are all fine
+                    break;
+            }
+            var->is_dim = adios_flag_yes;
+            dim->local_offset.id = var->id;
+        }
+    }
+    else
+    {
+        dim->local_offset.id = 0;
+        dim->local_offset.rank = strtol (local_offset, NULL, 10);
+    }
+
+    return 1;
+}
+
+struct adios_method_list_struct * adios_get_methods ()
+{
+    return adios_methods;
+}
+
+struct adios_group_list_struct * adios_get_groups ()
+{
+    return adios_groups;
+}
+
+
+int adios_parse_scalar_string (enum ADIOS_DATATYPES type, char * value
+                              ,void ** out
+                              )
+{
+    char * end;
+
+    switch (type)
+    {
+        case adios_byte:
+        case adios_short:
+        case adios_integer:
+        {
+            int errno_save = errno;
+            long t = strtol (value, &end, 10);
+            if (errno != errno_save || (end != 0 && *end != '\0'))
+            {
+                fprintf (stderr, "value: '%s' not valid integer\n"
+                        ,value
+                        );
+
+                return 0;
+            }
+            else
+            {
+                switch (type)
+                {
+                    case adios_byte:
+                        if (t < SCHAR_MIN || t > SCHAR_MAX)
+                        {
+                            fprintf (stderr, "type is %s, value "
+                                             "is out of range: '%s'\n"
+                                    ,adios_type_to_string_int (type), value
+                                    );
+
+                            return 0;
+                        }
+                        else
+                        {
+                            *out = malloc (1);
+                            *((int8_t *) *out) = t;
+
+                            return 1;
+                        }
+                    case adios_short:
+                        if (t < SHRT_MIN || t > SHRT_MAX)
+                        {
+                            fprintf (stderr, "type is %s, value "
+                                             "is out of range: '%s'\n"
+                                    ,adios_type_to_string_int (type), value
+                                    );
+
+                            return 0;
+                        }
+                        else
+                        {
+                            *out = malloc (2);
+                            *((int16_t *) *out) = t;
+
+                            return 1;
+                        }
+                    case adios_integer:
+                        if (t < INT_MIN || t > INT_MAX)
+                        {
+                            fprintf (stderr, "type is %s, value "
+                                             "is out of range: '%s'\n"
+                                    ,adios_type_to_string_int (type), value
+                                    );
+
+                            return 0;
+                        }
+                        else
+                        {
+                            *out = malloc (4);
+                            *((int32_t *) *out) = t;
+
+                            return 1;
+                        }
+                }
+            }
+        }
+        case adios_long:
+        {
+            int errno_save = errno;
+            int64_t t = strtoll (value, &end, 10);
+            if (errno != errno_save || (end != 0 && *end != '\0'))
+            {
+                fprintf (stderr, "type is %s, value is out of range: '%s'\n"
+                        ,adios_type_to_string_int (type), value
+                        );
+
+                return 0;
+            }
+            else
+            {
+                *out = malloc (8);
+                *((int64_t *) *out) = t;
+
+                return 1;
+            }
+        }
+        case adios_unsigned_byte:
+        case adios_unsigned_short:
+        case adios_unsigned_integer:
+        {
+            int errno_save = errno;
+            unsigned long t = strtoul (value, &end, 10);
+            if (errno != errno_save || (end != 0 && *end != '\0'))
+            {
+                fprintf (stderr, "value: '%s' not valid integer\n"
+                        ,value
+                        );
+
+                return 0;
+            }
+            else
+            {
+                switch (type)
+                {
+                    case adios_unsigned_byte:
+                        if (t > UCHAR_MAX)
+                        {
+                            fprintf (stderr, "type is %s, value "
+                                             "is out of range: '%s'\n"
+                                    ,adios_type_to_string_int (type), value
+                                    );
+
+                            return 0;
+                        }
+                        else
+                        {
+                            *out = malloc (1);
+                            *((uint8_t *) *out) = t;
+
+                            return 1;
+                        }
+                    case adios_unsigned_short:
+                        if (t > USHRT_MAX)
+                        {
+                            fprintf (stderr, "type is %s, value "
+                                             "is out of range: '%s'\n"
+                                    ,adios_type_to_string_int (type), value
+                                    );
+
+                            return 0;
+                        }
+                        else
+                        {
+                            *out = malloc (2);
+                            *((uint16_t *) *out) = t;
+
+                            return 1;
+                        }
+                    case adios_unsigned_integer:
+                        if (t > UINT_MAX)
+                        {
+                            fprintf (stderr, "type is %s, value "
+                                             "is out of range: '%s'\n"
+                                    ,adios_type_to_string_int (type), value
+                                    );
+
+                            return 0;
+                        }
+                        else
+                        {
+                            *out = malloc (4);
+                            *((uint32_t *) *out) = t;
+
+                            return 1;
+                        }
+                }
+            }
+        }
+        case adios_unsigned_long:
+        {
+            int errno_save = errno;
+            uint64_t t = strtoull (value, &end, 10);
+            if (errno != errno_save || (end != 0 && *end != '\0'))
+            {
+                fprintf (stderr, "type is %s, value is out of range: '%s'\n"
+                        ,adios_type_to_string_int (type), value
+                        );
+
+                return 0;
+            }
+            else
+            {
+                *out = malloc (8);
+                *((uint64_t *) *out) = t;
+
+                return 1;
+            }
+        }
+        case adios_real:
+        {
+            int errno_save = errno;
+            float t = strtof (value, &end);
+            if (errno != errno_save || (end != 0 && *end != '\0'))
+            {
+                fprintf (stderr, "type is %s, value is out of range: '%s'\n"
+                        ,adios_type_to_string_int (type), value
+                        );
+
+                return 0;
+            }
+            else
+            {
+                *out = malloc (4);
+                *((float *) *out) = t;
+
+                return 1;
+            }
+        }
+        case adios_double:
+        {
+            int errno_save = errno;
+            double t = strtod (value, &end);
+            if (errno != errno_save || (end != 0 && *end != '\0'))
+            {
+                fprintf (stderr, "type is %s, value is out of range: '%s'\n"
+                        ,adios_type_to_string_int (type), value
+                        );
+
+                return 0;
+            }
+            else
+            {
+                *out = malloc (8);
+                *((double *) *out) = t;
+
+                return 1;
+            }
+        }
+        case adios_long_double:
+        {
+            int errno_save = errno;
+            long double t = strtold (value, &end);
+            if (errno != errno_save || (end != 0 && *end != '\0'))
+            {
+                fprintf (stderr, "type is %s, value is out of range: '%s'\n"
+                        ,adios_type_to_string_int (type), value
+                        );
+
+                return 0;
+            }
+            else
+            {
+                *out = malloc (16);
+                *((long double *) *out) = t;
+            }
+        }
+        case adios_string:
+        {
+            *out = (void *) strdup (value);
+
+            return 1;
+        }
+        case adios_complex:
+        {
+            fprintf (stderr, "adios_complex type validation needs to be "
+                             "implemented\n");
+            return 1;
+        }
+        case adios_double_complex:
+        {
+            fprintf (stderr, "adios_double_complex type validation needs to "
+                             "be implemented\n");
+            return 1;
+        }
+
+        case adios_unknown:
+        default:
+            fprintf (stderr, "unknown type cannot be validated\n");
+
+            return 0;
+    }
+
+    return 1;
+}
+
+int adios_common_define_attribute (int64_t group, const char * name
+                                  ,const char * path
+                                  ,enum ADIOS_DATATYPES type
+                                  ,const char * value
+                                  ,const char * var
+                                  )
+{
+    struct adios_group_struct * g = (struct adios_group_struct *) group;
+    struct adios_attribute_struct * attr = (struct adios_attribute_struct *)
+                              malloc (sizeof (struct adios_attribute_struct));
+
+    attr->name = strdup (name);
+    attr->path = strdup (path);
+    if (value)
+    {
+        if (type == adios_unknown)
+        {
+            fprintf (stderr, "config.xml: attribute element %s has invalid "
+                             "type attribute\n"
+                    ,name
+                    );
+
+            free (attr->name);
+            free (attr->path);
+            free (attr);
+
+            return 0;
+        }
+        attr->type = type;
+        if (adios_parse_scalar_string (type, (void *) value, &attr->value))
+        {
+            attr->var = 0;
+        }
+        else
+        {
+            fprintf (stderr, "config.xml: attribute element %s has invalid "
+                             "value attribute: '%s'\n"
+                    ,name, value
+                    );
+
+            free (attr->value);
+            free (attr->name);
+            free (attr->path);
+            free (attr);
+
+            return 0;
+        }
+    }
+    else
+    {
+        attr->value = 0;
+        attr->type = adios_unknown;
+        attr->var = adios_find_var_by_name (g->vars, var
+                                           ,g->all_unique_var_names
+                                           );
+
+        if (attr->var == 0)
+        {
+            fprintf (stderr, "config.xml: attribute element %s references "
+                             "var %s that has not been defined.\n"
+                    ,name, var
+                    );
+
+            free (attr->name);
+            free (attr->path);
+            free (attr);
+
+            return 0;
+        }
+    }
+
+    attr->next = 0;
+
+    adios_append_attribute (&g->attributes, attr, ++g->member_count);
+
+    return 1;
+}
+
+/*void adios_extract_string (char ** out, const char * in, int size)
+{
+    if (in && out)
+    {
+        *out = malloc (strlen (in) + 1);
+        strcpy (*out, in);
+    }
+// for some Fortran implementations, we get a size for a string.
+// for others (like PGI), we don't and it isn't null terminated
+// unless we do it explicitly.  Assume that it is null terminated
+// for now.
+//
+#if 0
+    int i = 0;
+    memcpy (out, in, size);
+    while (i < size)
+    {
+        if (out [i] == ' ')
+        {
+            out [i] = 0;
+            return;
+        }
+        else
+            i++;
+    }
+    out [i] = 0;
+#endif
+}*/
+
+void adios_append_method (struct adios_method_struct * method)
+{
+    struct adios_method_list_struct ** root = &adios_methods;
+
+    while (root)
+    {
+        if (!*root)
+        {
+            struct adios_method_list_struct * new_node =
+                 (struct adios_method_list_struct *)
+                   malloc (sizeof (struct adios_method_list_struct));
+
+            if (!new_node)
+            {
+                fprintf (stderr, "out of memory in adios_append_method\n");
+            }
+            new_node->method = method;
+            new_node->next = 0;
+
+            *root = new_node;
+            root = 0;
+        }
+        else
+        {
+            root = &(*root)->next;
+        }
+    }
+}
+
+void adios_add_method_to_group (struct adios_method_list_struct ** root
+                               ,struct adios_method_struct * method
+                               )
+{
+    while (root)
+    {
+        if (!*root)
+        {
+            struct adios_method_list_struct * new_node =
+                 (struct adios_method_list_struct *)
+                   malloc (sizeof (struct adios_method_list_struct));
+
+            if (!new_node)
+            {
+                fprintf (stderr, "out of memory in adios_append_method\n");
+            }
+            new_node->method = method;
+            new_node->next = 0;
+
+            *root = new_node;
+            root = 0;
+        }
+        else
+        {
+            root = &(*root)->next;
+        }
+    }
+}
+
+void adios_append_group (struct adios_group_struct * group)
+{
+    struct adios_group_list_struct ** root = &adios_groups;
+    int id = 1;
+
+    while (root)
+    {
+        if (!*root)
+        {
+            struct adios_group_list_struct * new_node =
+                 (struct adios_group_list_struct *)
+                   malloc (sizeof (struct adios_group_list_struct));
+
+            if (!new_node)
+            {
+                fprintf (stderr, "out of memory in adios_append_group\n");
+            }
+            group->id = id;
+            new_node->group = group;
+            new_node->next = 0;
+
+            *root = new_node;
+            root = 0;
+        }
+        else
+        {
+            root = &(*root)->next;
+            id++;
+        }
+    }
+}
+
+// return is whether or not the name is unique
+enum ADIOS_FLAG adios_append_var (struct adios_var_struct ** root
+                                 ,struct adios_var_struct * var
+                                 ,uint16_t id
+                                 )
+{
+    enum ADIOS_FLAG unique_names = adios_flag_yes;
+
+    while (root)
+    {
+        if (   unique_names == adios_flag_yes
+            && *root
+            && !strcasecmp ((*root)->name, var->name)
+           )
+        {
+            unique_names = adios_flag_no;
+        }
+        if (!*root)
+        {
+            var->id = id;
+            *root = var;
+            root = 0;
+        }
+        else
+        {
+            root = &(*root)->next;
+        }
+    }
+
+    return unique_names;
+}
+
+void adios_append_dimension (struct adios_dimension_struct ** root
+                            ,struct adios_dimension_struct * dimension
+                            )
+{
+    while (root)
+    {
+        if (!*root)
+        {
+            *root = dimension;
+            root = 0;
+        }
+        else
+        {
+            root = &(*root)->next;
+        }
+    }
+}
+
+void adios_append_attribute (struct adios_attribute_struct ** root
+                            ,struct adios_attribute_struct * attribute
+                            ,uint16_t id
+                            )
+{
+    while (root)
+    {
+        if (!*root)
+        {
+            attribute->id = id;
+            *root = attribute;
+            root = 0;
+        }
+        else
+        {
+            root = &(*root)->next;
+        }
+    }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// functions to support C & Fortran interface
+///////////////////////////////////////////////////////////////////////////////
+int adios_common_declare_group (int64_t * id, const char * name
+                               ,enum ADIOS_FLAG host_language_fortran
+                               ,const char * coordination_comm
+                               ,const char * coordination_var
+                               ,const char * time_index_name
+                               )
+{
+    struct adios_group_struct * g = (struct adios_group_struct *)
+                             malloc (sizeof (struct adios_group_struct));
+
+    g->name = strdup (name);
+    g->adios_host_language_fortran = host_language_fortran;
+    g->all_unique_var_names = adios_flag_yes;
+    g->id = 0; // will be set in adios_append_group
+    g->member_count = 0; // will be set in adios_append_group
+    g->var_count = 0;
+    g->vars = 0;
+    g->vars_written = 0;
+    g->attributes = 0;
+    g->group_by = (coordination_var ? strdup (coordination_var) : 0L);
+    g->group_comm = (coordination_comm ? strdup (coordination_comm) : 0L);
+    g->time_index_name = (time_index_name ? strdup (time_index_name) : 0L);
+    g->time_index = 0;
+    g->process_id = 0;
+    g->methods = 0;
+    g->mesh = 0;
+
+    *id = (int64_t) g;
+
+    adios_append_group (g);
+
+    return 1;
+}
+
+int adios_common_free_group (int64_t id)
+{
+    struct adios_group_list_struct * root = adios_groups;
+    struct adios_group_list_struct * old_root = adios_groups;
+    struct adios_group_struct * g = (struct adios_group_struct *) id;
+
+    if (!root)
+    {
+        fprintf (stderr, "Err in adios_common_free_group()\n");
+        return -1;
+    }
+    while (root && root->group->id != g->id)
+    {
+        old_root = root;
+        root = root->next;
+    };
+
+    if (!root)
+    {
+        // Didn't find the group
+        fprintf (stderr, "Err in adios_common_free_group()\n");
+        return -1;
+    }
+
+    // old_root->root->root next
+    if (old_root == adios_groups)
+    {
+        adios_groups =  root->next;
+    }
+    else
+    {
+        old_root->next = root->next;
+    }
+
+    if (g->name)
+        free (g->name);
+
+    while (g->vars)
+    {
+        struct adios_var_struct * vars = g->vars->next;
+
+        if (g->vars->name)
+            free (g->vars->name);
+        if (g->vars->path)
+            free (g->vars->path);
+
+        while (g->vars->dimensions)
+        {
+            struct adios_dimension_struct * dimensions
+                            = g->vars->dimensions->next;
+
+            free (g->vars->dimensions);
+            g->vars->dimensions = dimensions;
+        }
+
+        // NCSU - Clear Stat
+        if (g->vars->stats)
+		{
+            uint8_t j = 0, idx = 0;
+            uint8_t c = 0, count = adios_get_stat_set_count(g->vars->type);
+
+            for (c = 0; c < count; c ++)
+            {
+                while (g->vars->bitmap >> j)
+                {
+                    if ((g->vars->bitmap >> j) & 1)
+                    {
+                        if (j == adios_statistic_hist)
+                        {
+                            struct adios_hist_struct * hist = (struct adios_hist_struct *) (g->vars->stats[c][idx].data);
+                            free (hist->breaks);
+                            free (hist->frequencies);
+                            free (hist);
+                        }
+                        else
+                            free (g->vars->stats[c][idx].data);
+
+                        idx ++;
+                    }
+                    j ++;
+                }
+                free (g->vars->stats[c]);
+            }
+            free (g->vars->stats);		
+		}
+
+        if (g->vars->data)
+            free (g->vars->data);
+
+        free (g->vars);
+        g->vars = vars;
+    }
+
+    free (root);
+
+    return 0;
+}
+
+void trim_spaces (char * str)
+{
+    char * t = str, * p = NULL;
+    while (*t != '\0')
+    {
+        if (*t == ' ')
+        {
+            p = t + 1;
+            strcpy (t, p);
+        }
+        else
+            t++;
+    }
+
+}
+
+static void tokenize_dimensions (const char * str, char *** tokens, int * count)
+{
+    if (!str)
+    {
+        *tokens = 0;
+        *count = 0;
+
+        return;
+    }
+
+    char * save_str = strdup (str);
+    char * t = save_str;
+    int i;
+
+    trim_spaces (save_str);
+
+    if (strlen (save_str) > 0)
+        *count = 1;
+    else
+    {
+        *tokens = 0;
+        *count = 0;
+        free (save_str);
+
+        return;
+    }
+
+    while (*t)
+    {
+        if (*t == ',')
+            (*count)++;
+        t++;
+    }
+
+    *tokens = (char **) malloc (sizeof (char **) * *count);
+    (*tokens) [0] = strdup (strtok (save_str, ","));
+    for (i = 1; i < *count; i++)
+    {
+        (*tokens) [i] = strdup (strtok (NULL, ","));
+    }
+
+    free (save_str);
+}
+
+static void cleanup_dimensions (char *** tokens, int * count)
+{
+    int i;
+    for (i = 0; i < *count; i++)
+    {
+        free ((*tokens) [i]);
+    }
+    free (*tokens);
+    *tokens = 0;
+    *count = 0;
+}
+
+int adios_common_define_var_characteristics (struct adios_group_struct * g
+                                            , const char * var_name
+                                            , const char * bin_intervals
+                                            , const char * bin_min
+                                            , const char * bin_max
+                                            , const char * bin_count
+                                            )
+{
+    struct adios_var_struct * root = g->vars, * var;
+
+    var = adios_find_var_by_name (root, var_name, adios_flag_no);
+
+    struct adios_hist_struct * hist;
+
+    if (var->type == adios_complex || var->type == adios_double_complex)
+        return 0;
+
+    int i = 0, j = 0;
+    while ((var->bitmap >> j) && (j < adios_statistic_hist))
+    {
+        if ((var->bitmap >> j) & 1)
+            i ++;
+        j ++;
+    }
+
+    hist = var->stats[0][i].data = (struct adios_hist_struct *) malloc (sizeof(struct adios_hist_struct));
+
+    if (!var)
+    {
+           fprintf (stderr, "config.xml: Didn't find the variable %s for analysis\n", var_name);
+        return 0;
+    }
+    else
+    {
+        int i;
+        if (bin_intervals)
+        {
+            int count;
+            char ** bin_tokens = 0;
+
+            tokenize_dimensions (bin_intervals, &bin_tokens, &count);
+
+            if (!count)
+            {
+                fprintf (stderr, "config.xml: unable to tokenize break points\n");
+                return 0;
+            }
+
+            hist->breaks = calloc(count, sizeof(double));
+
+            if(!hist || !hist->breaks)
+            {
+                fprintf (stderr, "config.xml: unable to allocate memory for histogram break points in "
+                        "adios_common_define_var_characteristics\n");
+                return 0;
+            }
+
+            for(i = 0; i < count; i++)
+            {
+                hist->breaks[i] = atof(bin_tokens[i]);
+                if(i > 0 && (hist->breaks[i] <= hist->breaks[i-1]))
+                {
+                    fprintf (stderr, "config.xml: break points should be in increasing order "
+                        "adios_common_define_var_characteristics\n");
+                    return 0;
+                }
+            }
+
+            hist->num_breaks = count;
+            hist->min = hist->breaks[0];
+
+            if(count > 0)
+                hist->max = hist->breaks[count - 1];
+            else
+                hist->max = hist->min;
+
+            var->bitmap = var->bitmap | (1 << adios_statistic_hist);
+        }
+        else
+        {
+            if(!bin_max || !bin_min || !bin_count)
+            {
+                fprintf (stderr, "config.xml: unable to generate break points\n");
+                return 0;
+            }
+
+            int count = atoi(bin_count);
+
+            if (!count)
+            {
+                fprintf (stderr, "config.xml: bin count is undefined\n");
+                return 0;
+            }
+
+            hist->num_breaks = count + 1;
+            hist->min = atof(bin_min);
+            hist->max = atof(bin_max);
+            hist->breaks = calloc(hist->num_breaks, sizeof(double));
+
+            if(!hist || !hist->breaks)
+            {
+                fprintf (stderr, "config.xml: unable to allocate memory for histogram break points in "
+                        "adios_common_define_var_characteristics\n");
+                return 0;
+            }
+
+            if (hist->min >= hist->max)
+            {
+                fprintf (stderr, "config.xml: minimum boundary value greater than maximum\n");
+                return 0;
+            }
+
+            for(i = 0; i < hist->num_breaks; i ++)
+                hist->breaks[i] = hist->min + i * (hist->max - hist->min) / count;
+
+            var->bitmap = var->bitmap | (1 << adios_statistic_hist);
+        }
+    }
+
+
+    return 1;
+}
+
+int adios_common_define_var (int64_t group_id, const char * name
+                            ,const char * path, enum ADIOS_DATATYPES type
+                            ,const char * dimensions
+                            ,const char * global_dimensions
+                            ,const char * local_offsets
+                            )
+{
+    struct adios_group_struct * t = (struct adios_group_struct *) group_id;
+    struct adios_var_struct * v = (struct adios_var_struct *)
+                               malloc (sizeof (struct adios_var_struct));
+    char * dim_temp;
+    char * g_dim_temp;
+    char * lo_dim_temp;
+    enum ADIOS_FLAG flag;
+    uint8_t i;
+    if (dimensions)
+        dim_temp = strdup (dimensions);
+    else
+        dim_temp = 0;
+    if (global_dimensions)
+        g_dim_temp = strdup (global_dimensions);
+    else
+        g_dim_temp = 0;
+    if (local_offsets)
+        lo_dim_temp = strdup (local_offsets);
+    else
+        lo_dim_temp = 0;
+
+    v->name = strdup (name);
+    v->path = strdup (path);
+    v->type = type;
+    v->dimensions = 0;
+    v->is_dim = adios_flag_no;
+    v->got_buffer = adios_flag_no;
+    v->free_data = adios_flag_no;
+
+    v->data = 0;
+    v->write_offset = 0;
+
+    v->data_size = 0;
+
+    v->next = 0;
+
+    // NCSU - Initializing stat related info
+    v->stats = 0;
+    v->bitmap = 0;
+
+    // '1' at the bit location of stat id in adios_bp_v1.h, enables calculation of statistic.
+    for (i = 0; i < ADIOS_STAT_LENGTH; i++)
+        v->bitmap |= (1 << i);
+
+    // Default values for histogram not yet implemented. Disabling it.
+    v->bitmap ^= (1 << adios_statistic_hist);
+
+    // For complex numbers, the set of statistics occur thrice: stat[0] - magnitude, stat[1] - real, stat[2] - imaginary
+    if (v->type == adios_complex || v->type == adios_double_complex)
+    {
+        uint8_t c;
+        v->stats = malloc (3 * sizeof(struct adios_stat_struct *));
+
+        for (c = 0; c < 3; c ++)
+            v->stats[c] = calloc (ADIOS_STAT_LENGTH, sizeof(struct adios_stat_struct));
+    }
+    else
+    {
+        v->stats = malloc (sizeof(struct adios_stat_struct *));
+        v->stats[0] = calloc (ADIOS_STAT_LENGTH, sizeof(struct adios_stat_struct));
+    }
+
+    // NCSU - End of initializing stat related info
+
+    if (dim_temp && strcmp (dim_temp, ""))
+    {
+        int dim_count;
+        char ** dim_tokens = 0;
+
+        int g_dim_count;
+        char ** g_dim_tokens = 0;
+
+        int lo_dim_count;
+        char ** lo_dim_tokens = 0;
+
+        int i = 0;
+
+        tokenize_dimensions (dim_temp, &dim_tokens, &dim_count);
+        tokenize_dimensions (g_dim_temp, &g_dim_tokens, &g_dim_count);
+        tokenize_dimensions (lo_dim_temp, &lo_dim_tokens, &lo_dim_count);
+
+        while (i < dim_count)
+        {
+            int ret;
+            struct adios_dimension_struct * d =
+                     (struct adios_dimension_struct *)
+                         calloc (1, sizeof (struct adios_dimension_struct));
+
+            if (!d)
+            {
+                fprintf (stderr, "config.xml: out of memory in "
+                                 "adios_common_define_var\n"
+                        );
+
+                return 0;
+            }
+            char * dim = 0;
+            char * g_dim = "0";
+            char * lo_dim = "0";
+
+            if (i < dim_count)
+                dim = dim_tokens [i];
+            if (i < g_dim_count)
+                g_dim = g_dim_tokens [i];
+            if (i < lo_dim_count)
+                lo_dim = lo_dim_tokens [i];
+
+            if (!(ret = adios_parse_dimension (dim, g_dim, lo_dim, t, d)))
+            {
+                free (dim_temp);
+                free (g_dim_temp);
+                free (lo_dim_temp);
+                free (v->name);
+                free (v->path);
+                free (v);
+                cleanup_dimensions (&dim_tokens, &dim_count);
+                cleanup_dimensions (&g_dim_tokens, &g_dim_count);
+                cleanup_dimensions (&lo_dim_tokens, &lo_dim_count);
+
+                return ret;
+            }
+
+            adios_append_dimension (&v->dimensions, d);
+
+            i++;
+        }
+        cleanup_dimensions (&dim_tokens, &dim_count);
+        cleanup_dimensions (&g_dim_tokens, &g_dim_count);
+        cleanup_dimensions (&lo_dim_tokens, &lo_dim_count);
+    }
+
+    if (dim_temp)
+        free (dim_temp);
+    if (g_dim_temp)
+        free (g_dim_temp);
+    if (lo_dim_temp)
+        free (lo_dim_temp);
+
+    flag = adios_append_var (&t->vars, v, ++t->member_count);
+    if (flag == adios_flag_no)
+    {
+        t->all_unique_var_names = adios_flag_no;
+    }
+    t->var_count++;
+
+    return 1;
+}
+
+void adios_common_get_group (int64_t * group_id, const char * name)
+{
+    struct adios_group_list_struct * g = adios_get_groups ();
+
+    *group_id = 0;
+
+    while (g)
+    {
+        if (!strcasecmp (g->group->name, name))
+        {
+            *group_id = (int64_t) g->group;
+
+            return;
+        }
+
+        g = g->next;
+    }
+
+    fprintf (stderr, "adios-group '%s' not found in configuration file\n"
+            ,name
+            );
+}
+
+// *****************************************************************************
+static void buffer_write (char ** buffer, uint64_t * buffer_size
+                         ,uint64_t * buffer_offset
+                         ,const void * data, uint64_t size
+                         )
+{
+    if (*buffer_offset + size > *buffer_size || *buffer == 0)
+    {
+        char * b = realloc (*buffer, *buffer_offset + size + 1000);
+        if (b)
+        {
+            *buffer = b;
+            *buffer_size = (*buffer_offset + size + 1000);
+        }
+        else
+        {
+            fprintf (stderr, "Cannot allocate memory in buffer_write.  "
+                             "Requested: %llu\n", *buffer_offset + size + 1000);
+
+            return;
+        }
+    }
+
+    memcpy (*buffer + *buffer_offset, data, size);
+    *buffer_offset += size;
+}
+
+static uint16_t adios_calc_var_characteristics_dims_overhead
+                                                  (struct adios_var_struct * v)
+{
+    uint16_t overhead = 0;
+    struct adios_dimension_struct * d = v->dimensions;
+
+    overhead += 1; // count
+    overhead += 2; // length
+
+    while (d)
+    {
+        overhead += 8 + 8 + 8; // the dims
+
+        d = d->next;
+    }
+
+    return overhead;
+}
+
+// NCSU -This function precomputes the amount of overhead consumed by statistics
+uint16_t adios_calc_var_characteristics_stat_overhead (struct adios_var_struct * var)
+{
+    uint16_t i, j, overhead;
+    overhead = j = i = 0;
+
+    while (var->bitmap >> j)
+    {
+        // NCSU - This characteristic is present. It adds to the overhead
+        if ((var->bitmap >> j) & 1)
+            overhead += adios_get_stat_size(var->stats[0][i ++].data, var->type, j);
+        j ++;
+    }
+
+    return overhead;
+}
+
+
+static uint16_t adios_calc_var_characteristics_overhead
+                                                  (struct adios_var_struct * v)
+{
+    uint16_t overhead = 0;
+
+    overhead += 1 + 4; // count + length
+
+    switch (v->type)
+    {
+        case adios_string:   // nothing for strings
+            //overhead += 1; // id
+            //overhead += 2; // size
+            break;
+
+        default:   // the 12 numeric types
+            if (v->dimensions)
+            {
+                overhead += 1; // id for bitmap
+                overhead += 4; // value for bitmap
+
+                overhead += 1;  // id for statistics
+                // For complex numbers - min, max, avg repeated thrice
+                overhead += adios_get_stat_set_count(v->type) * adios_calc_var_characteristics_stat_overhead (v);
+
+                overhead += 1;  // id
+                overhead += adios_calc_var_characteristics_dims_overhead (v);
+            }
+    }
+
+    return overhead;
+}
+
+uint16_t adios_calc_var_overhead_v1 (struct adios_var_struct * v)
+{
+    uint16_t overhead = 0;
+
+    struct adios_dimension_struct * d = v->dimensions;
+
+    overhead += 8; // length of var entry
+    overhead += 2; // member id
+    overhead += 2; // length of name
+    overhead += strlen (v->name); // name
+    overhead += 2; // length of path
+    overhead += strlen (v->path); // path
+    overhead += 1; // datatype
+    overhead += 1; // used as a dimension flag
+
+    overhead += 1; // ranks
+    overhead += 2; // dimensions length
+    while (d)
+    {
+        overhead += 1; // var flag
+        if (   d->dimension.id == 0
+            && d->dimension.time_index == adios_flag_no
+           )
+        {
+            overhead += 8; // value
+        }
+        else
+        {
+            overhead += 2; // member id
+        }
+
+        overhead += 1; // var flag
+        if (   d->global_dimension.id == 0
+            && d->global_dimension.time_index == adios_flag_no
+           )
+        {
+            overhead += 8; // value
+        }
+        else
+        {
+            overhead += 2; // member id
+        }
+
+        overhead += 1; // var flag
+        if (   d->local_offset.id == 0
+            && d->local_offset.time_index == adios_flag_no
+           )
+        {
+            overhead += 8; // value
+        }
+        else
+        {
+            overhead += 2; // member id
+        }
+
+        d = d->next;
+    }
+    overhead += adios_calc_var_characteristics_overhead (v);
+
+    return overhead;
+}
+
+uint32_t adios_calc_attribute_overhead_v1 (struct adios_attribute_struct * a)
+{
+    uint32_t overhead = 0;
+
+    overhead += 4; // attribute length
+    overhead += 2; // member id
+    overhead += 2; // length of name
+    overhead += strlen (a->name); // name
+    overhead += 2; // length of path
+    overhead += strlen (a->path); // path
+    overhead += 1; // var flag
+    if (a->var)
+        overhead += 2; // var member id
+    else
+    {
+        overhead += 1; // datatype
+        overhead += 4; // length of value
+        overhead += adios_get_type_size (a->type, a->value); // value
+    }
+
+    return overhead;
+}
+
+uint64_t adios_calc_overhead_v1 (struct adios_file_struct * fd)
+{
+    uint64_t overhead = 0;
+    struct adios_var_struct * v = fd->group->vars;
+    struct adios_attribute_struct * a = fd->group->attributes;
+    struct adios_method_list_struct * m = fd->group->methods;
+
+    overhead += 8; // process group length
+    overhead += 1; // host language flag
+    overhead += 2; // length of group name
+    overhead += strlen (fd->group->name); // group name
+    overhead += 2; // coordination var id
+    overhead += 2; // length of time index name
+    overhead += ((fd->group->time_index_name)
+                    ? strlen (fd->group->time_index_name)
+                    : 0
+                );  // time index name
+    overhead += 4; // time index
+
+    overhead += 1; // count of methods employed
+    overhead += 2; // length of methods section
+
+    while (m)
+    {
+        overhead += 1; // method ID
+        overhead += 2; // method params length
+        overhead += strlen (m->method->parameters);
+        m = m->next;
+    }
+
+    overhead += 2; // count of vars
+    overhead += 8; // length of vars section
+
+    while (v)
+    {
+        overhead += adios_calc_var_overhead_v1 (v);
+
+        v = v->next;
+    }
+
+    overhead += 2; // attributes count
+    overhead += 8; // attributes length
+
+    while (a)
+    {
+        overhead += adios_calc_attribute_overhead_v1 (a);
+
+        a = a->next;
+    }
+
+    return overhead;
+}
+
+int adios_write_process_group_header_v1 (struct adios_file_struct * fd
+                                        ,uint64_t total_size
+                                        )
+{
+    struct adios_group_struct * g = fd->group;
+
+    uint8_t flag;
+    struct adios_var_struct * var;
+    uint16_t len;
+    char * temp;
+
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &total_size, 8);
+
+    flag = (g->adios_host_language_fortran == adios_flag_yes ? 'y' : 'n');
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &flag, 1);
+
+    len = strlen (g->name);
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &len, 2);
+
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, g->name, len);
+
+    var = adios_find_var_by_name (g->vars, g->group_by
+                                 ,g->all_unique_var_names
+                                 );
+    if (var)
+    {
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &var->id, 2);
+    }
+    else
+    {
+        uint16_t i = 0;
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &i, 2);
+    }
+
+    len = ((g->time_index_name) ? strlen (g->time_index_name) : 0);
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &len, 2);
+
+    if (g->time_index_name)
+    {
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                     ,g->time_index_name, len
+                     );
+    }
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                 ,&g->time_index, 4
+                 );
+
+    struct adios_method_list_struct * m = fd->group->methods;
+    uint8_t methods_count = 0;
+    uint16_t methods_length = 0;
+    while (m)
+    {
+        methods_count++;
+        methods_length += 1 + 2 + strlen (m->method->parameters);
+
+        m = m->next;
+    }
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                 ,&methods_count, 1
+                 );
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                 ,&methods_length, 2
+                 );
+
+    m = fd->group->methods;
+    while (m)
+    {
+        uint16_t len = strlen (m->method->parameters);
+
+        flag = (uint8_t) m->method->m;
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &flag, 1);
+
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &len, 2);
+
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                     ,m->method->parameters, len
+                     );
+
+        m = m->next;
+    }
+
+    if (fd->bytes_written < fd->offset)
+        fd->bytes_written = fd->offset;
+
+    return 0;
+}
+
+static void index_append_process_group_v1 (
+                          struct adios_index_process_group_struct_v1 ** root
+                         ,struct adios_index_process_group_struct_v1 * item
+                         )
+{
+    while (root)
+    {
+        if (!*root)
+        {
+            *root = item;
+            root = 0;
+        }
+        else
+        {
+            root = &(*root)->next;
+        }
+    }
+}
+
+static void index_append_var_v1 (struct adios_index_var_struct_v1 ** root
+                                ,struct adios_index_var_struct_v1 * item
+                                )
+{
+    while (root)
+    {
+        if (!*root)
+        {
+            *root = item;
+            root = 0;
+        }
+        else
+        {
+            if (   !strcasecmp (item->group_name, (*root)->group_name)
+                && !strcasecmp (item->var_name, (*root)->var_name)
+                && !strcasecmp (item->var_path, (*root)->var_path)
+                && item->type == (*root)->type
+               )
+            {
+                if (    (*root)->characteristics_count
+                      + item->characteristics_count
+                    > (*root)->characteristics_allocated
+                   )
+                {
+                    int new_items = (item->characteristics_count == 1)
+                                         ? 100 : item->characteristics_count;
+                    (*root)->characteristics_allocated =
+                            (*root)->characteristics_count + new_items;
+                    void * ptr;
+                    ptr = realloc ((*root)->characteristics
+                            ,  (*root)->characteristics_allocated
+                        * sizeof (struct adios_index_characteristic_struct_v1)
+                            );
+
+                    if (ptr)
+                    {
+                        (*root)->characteristics = ptr;
+                    }
+                    else
+                    {
+                        fprintf (stderr, "error allocating memory to build "
+                                         "var index.  Index aborted\n"
+                                );
+
+                        return;
+                    }
+                }
+                memcpy (&(*root)->characteristics
+                                             [(*root)->characteristics_count]
+                       ,item->characteristics
+                       ,  item->characteristics_count
+                        * sizeof (struct adios_index_characteristic_struct_v1)
+                       );
+
+                (*root)->characteristics_count += item->characteristics_count;
+
+                free (item->characteristics);
+                free (item->group_name);
+                free (item->var_name);
+                free (item->var_path);
+                free (item);
+
+                root = 0;  // exit the loop
+            }
+            else
+            {
+                root = &(*root)->next;
+            }
+        }
+    }
+}
+
+static void index_append_attribute_v1
+                                (struct adios_index_attribute_struct_v1 ** root
+                                ,struct adios_index_attribute_struct_v1 * item
+                                )
+{
+    while (root)
+    {
+        if (!*root)
+        {
+            *root = item;
+            root = 0;
+        }
+        else
+        {
+            if (   !strcasecmp (item->group_name, (*root)->group_name)
+                && !strcasecmp (item->attr_name, (*root)->attr_name)
+                && !strcasecmp (item->attr_path, (*root)->attr_path)
+               )
+            {
+                if (    (*root)->characteristics_count
+                      + item->characteristics_count
+                    > (*root)->characteristics_allocated
+                   )
+                {
+                    int new_items = (item->characteristics_count == 1)
+                                         ? 100 : item->characteristics_count;
+                    (*root)->characteristics_allocated =
+                                   (*root)->characteristics_count + new_items;
+                    void * ptr;
+                    ptr = realloc ((*root)->characteristics
+                            ,  (*root)->characteristics_allocated
+                       * sizeof (struct adios_index_characteristic_struct_v1)
+                            );
+
+                    if (ptr)
+                    {
+                        (*root)->characteristics = ptr;
+                    }
+                    else
+                    {
+                        fprintf (stderr, "error allocating memory to build "
+                                         "attribute index.  Index aborted\n"
+                                );
+
+                        return;
+                    }
+                }
+                memcpy (&(*root)->characteristics
+                                              [(*root)->characteristics_count]
+                       ,item->characteristics
+                       ,  item->characteristics_count
+                        * sizeof (struct adios_index_characteristic_struct_v1)
+                       );
+
+                (*root)->characteristics_count += item->characteristics_count;
+
+                free (item->characteristics);
+                free (item->group_name);
+                free (item->attr_name);
+                free (item->attr_path);
+                free (item);
+
+                root = 0;  // exit the loop
+            }
+            else
+            {
+                root = &(*root)->next;
+            }
+        }
+    }
+}
+
+// p2 and v2 will be destroyed as part of the merge operation...
+void adios_merge_index_v1 (struct adios_index_process_group_struct_v1 ** p1
+                          ,struct adios_index_var_struct_v1 ** v1
+                          ,struct adios_index_attribute_struct_v1 ** a1
+                          ,struct adios_index_process_group_struct_v1 * p2
+                          ,struct adios_index_var_struct_v1 * v2
+                          ,struct adios_index_attribute_struct_v1 * a2
+                          )
+{
+    // this will just add it on to the end and all should work fine
+    index_append_process_group_v1 (p1, p2);
+
+    // need to do vars attrs one at a time to merge them properly
+    struct adios_index_var_struct_v1 * v_temp;
+    struct adios_index_attribute_struct_v1 * a_temp;
+
+    while (v2)
+    {
+        v_temp = v2->next;
+        v2->next = 0;
+        index_append_var_v1 (v1, v2);
+        v2 = v_temp;
+    }
+
+    while (a2)
+    {
+        a_temp = a2->next;
+        a2->next = 0;
+        index_append_attribute_v1 (a1, a2);
+        a2 = a_temp;
+    }
+}
+
+// sort pg/var indexes by time index
+void adios_sort_index_v1 (struct adios_index_process_group_struct_v1 ** p1
+                         ,struct adios_index_var_struct_v1 ** v1
+                         ,struct adios_index_attribute_struct_v1 ** a1
+                         )
+{
+    struct adios_index_process_group_struct_v1 * p2 = 0, * p1_temp, * p2_temp, * p2_temp_prev;
+    struct adios_index_var_struct_v1 * v2 = 0, * v1_temp, * v2_temp, * v2_temp_prev;
+    struct adios_index_attribute_struct_v1 * a2 = 0, * a1_temp, * a2_temp, * a2_temp_prev;
+    int i, j;
+
+    while (*p1)
+    {
+        // if new index list is empty
+        if (!p2)
+        {
+            p2 = *p1;
+            *p1 = (*p1)->next;
+            p2->next = 0;
+        }
+        else
+        {
+            p2_temp = p2;
+            p2_temp_prev = p2;
+
+            while (p2_temp && (*p1)->time_index >= p2_temp->time_index)
+            {
+                p2_temp_prev = p2_temp;
+                p2_temp = p2_temp->next;
+            }
+
+            if (!p2_temp)
+            {
+                p2_temp_prev->next = *p1;
+                *p1 = (*p1)->next;
+                p2_temp_prev->next->next = 0;
+            }
+            else
+            {
+                p1_temp = (*p1)->next;
+                (*p1)->next = p2_temp;
+                p2_temp_prev->next = *p1;
+
+                *p1 = p1_temp;
+            }
+
+        }
+    }
+
+    *p1 = p2;
+
+    v1_temp = *v1;
+
+    while (v1_temp)
+    {
+        for (i = 0; i < v1_temp->characteristics_count; i++)
+        {
+            for (j = 0; j < v1_temp->characteristics_count - i - 1; j++)
+            {
+                if (v1_temp->characteristics[j].time_index > v1_temp->characteristics[j + 1].time_index)
+                {
+                    uint64_t t_offset;  // beginning of the var or attr entry
+                    struct adios_index_characteristic_dims_struct_v1 t_dims;
+                    uint16_t t_var_id;
+                    void * t_value;
+                    uint64_t t_payload_offset;   // beginning of the var or attr payload
+                    char * t_file_name;
+                    uint32_t t_time_index;
+
+                    uint32_t t_bitmap;
+
+                    struct adios_index_characteristics_stat_struct ** t_stats;
+
+                    t_offset = v1_temp->characteristics[j].offset;
+                    t_dims.count = v1_temp->characteristics[j].dims.count;
+                    t_dims.dims = v1_temp->characteristics[j].dims.dims;
+                    t_var_id = v1_temp->characteristics[j].var_id;
+                    t_value = v1_temp->characteristics[j].value;
+                    t_payload_offset = v1_temp->characteristics[j].payload_offset;
+                    t_file_name = v1_temp->characteristics[j].file_name;
+                    t_time_index = v1_temp->characteristics[j].time_index;
+                    t_bitmap = v1_temp->characteristics[j].bitmap;
+                    t_stats = v1_temp->characteristics[j].stats;
+                    
+                    v1_temp->characteristics[j].offset = v1_temp->characteristics[j + 1].offset;
+                    v1_temp->characteristics[j].dims.count = v1_temp->characteristics[j + 1].dims.count;
+                    v1_temp->characteristics[j].dims.dims = v1_temp->characteristics[j + 1].dims.dims;
+                    v1_temp->characteristics[j].var_id = v1_temp->characteristics[j + 1].var_id;
+                    v1_temp->characteristics[j].value = v1_temp->characteristics[j + 1].value;
+                    v1_temp->characteristics[j].payload_offset = v1_temp->characteristics[j + 1].payload_offset;
+                    v1_temp->characteristics[j].file_name = v1_temp->characteristics[j + 1].file_name;
+                    v1_temp->characteristics[j].time_index = v1_temp->characteristics[j + 1].time_index;
+                    v1_temp->characteristics[j].bitmap = v1_temp->characteristics[j + 1].bitmap;
+                    v1_temp->characteristics[j].stats = v1_temp->characteristics[j + 1].stats;
+
+                    v1_temp->characteristics[j + 1].offset = t_offset;
+                    v1_temp->characteristics[j + 1].dims.count = t_dims.count;
+                    v1_temp->characteristics[j + 1].dims.dims = t_dims.dims;
+                    v1_temp->characteristics[j + 1].var_id = t_var_id;
+                    v1_temp->characteristics[j + 1].value = t_value;
+                    v1_temp->characteristics[j + 1].payload_offset = t_payload_offset;
+                    v1_temp->characteristics[j + 1].file_name = t_file_name;
+                    v1_temp->characteristics[j + 1].time_index = t_time_index;
+                    v1_temp->characteristics[j + 1].bitmap = t_bitmap;
+                    v1_temp->characteristics[j + 1].stats = t_stats;
+                }
+            }
+        }
+
+        v1_temp = v1_temp->next;
+    }
+
+    // no need to sort attributes
+}
+
+static void adios_clear_process_groups_index_v1 (
+                            struct adios_index_process_group_struct_v1 * root
+                           )
+{
+    while (root)
+    {
+        struct adios_index_process_group_struct_v1 * temp = root->next;
+        if (root->group_name)
+            free (root->group_name);
+        if (root->time_index_name)
+            free (root->time_index_name);
+        free (root);
+        root = temp;
+    }
+}
+
+// NCSU - Clears up the statistical data from variable index table
+static void adios_clear_vars_index_v1 (struct adios_index_var_struct_v1 * root)
+{
+    while (root)
+    {
+        int i;
+        struct adios_index_var_struct_v1 * temp = root->next;
+
+        if (root->group_name)
+            free (root->group_name);
+        if (root->var_name)
+            free (root->var_name);
+        if (root->var_path)
+            free (root->var_path);
+
+        for (i = 0; i < root->characteristics_count; i++)
+        {
+            if (root->characteristics [i].dims.count != 0)
+                free (root->characteristics [i].dims.dims);
+            if (root->characteristics [i].value)
+                free (root->characteristics [i].value);
+
+            // NCSU - Clears up the statistical data, based on bitmap
+            if (root->characteristics [i].stats != 0)
+            {
+                uint8_t j = 0, idx = 0;
+                uint8_t c = 0, count = adios_get_stat_set_count(root->type);
+
+                for (c = 0; c < count; c ++)
+                {
+                    while (root->characteristics [i].bitmap >> j)
+                    {
+                        if ((root->characteristics [i].bitmap >> j) & 1)
+                        {
+							if (j == adios_statistic_hist)
+							{
+								struct adios_index_characteristics_hist_struct * hist = (struct adios_index_characteristics_hist_struct	*) root->characteristics [i].stats[c][idx].data;
+								free (hist->breaks);
+								free (hist->frequencies);
+							}	
+							else
+                           		free (root->characteristics [i].stats[c][idx].data);
+                            idx ++;
+                        }
+                        j ++;
+                    }
+                    free (root->characteristics [i].stats [c]);
+                }
+
+				free (root->characteristics [i].stats);
+            }
+        }
+        if (root->characteristics)
+            free (root->characteristics);
+
+        free (root);
+        root = temp;
+    }
+}
+
+// NCSU - Clears up the statistical data, based on bitmap
+static void adios_clear_attributes_index_v1
+                                (struct adios_index_attribute_struct_v1 * root)
+{
+    while (root)
+    {
+        int i;
+        struct adios_index_attribute_struct_v1 * temp = root->next;
+
+        if (root->group_name)
+            free (root->group_name);
+        if (root->attr_name)
+            free (root->attr_name);
+        if (root->attr_path)
+            free (root->attr_path);
+        for (i = 0; i < root->characteristics_count; i++)
+        {
+            if (root->characteristics [i].dims.count != 0)
+                free (root->characteristics [i].dims.dims);
+
+            // NCSU - Clears up the statistical data, based on bitmap
+            if (root->characteristics [i].stats != 0)
+            {
+                uint8_t j = 0, idx = 0;
+                uint8_t c = 0, count = adios_get_stat_set_count(root->type);
+                for (c = 0; c < count; c ++)
+                {
+                    while (root->characteristics [i].bitmap >> j)
+                    {
+                        if ((root->characteristics [i].bitmap >> j) & 1)
+                        {
+							if (j == adios_statistic_hist)
+	                    	{
+								struct adios_index_characteristics_hist_struct * hist = (struct adios_index_characteristics_hist_struct *) root->characteristics [i].stats[c][idx].data;
+								free (hist->breaks);
+								free (hist->frequencies);
+								free (hist);
+	                     	}
+							else
+								free (root->characteristics [i].stats[c][idx].data);
+
+                            idx ++;
+                        }
+                        j ++;
+                    }
+                    free (root->characteristics [i].stats [c]);
+                }
+                free (root->characteristics [i].stats);
+            }
+
+        }
+        if (root->characteristics)
+            free (root->characteristics);
+
+        free (root);
+        root = temp;
+    }
+}
+
+
+void adios_clear_index_v1 (struct adios_index_process_group_struct_v1 * pg_root
+                          ,struct adios_index_var_struct_v1 * vars_root
+                          ,struct adios_index_attribute_struct_v1 * attrs_root
+                          )
+{
+    adios_clear_process_groups_index_v1 (pg_root);
+    adios_clear_vars_index_v1 (vars_root);
+    adios_clear_attributes_index_v1 (attrs_root);
+}
+
+static uint8_t count_dimensions (struct adios_dimension_struct * dimensions)
+{
+    uint8_t count = 0;
+
+    while (dimensions)
+    {
+        count++;
+        dimensions = dimensions->next;
+    }
+
+    return count;
+}
+
+static uint64_t cast_var_data_as_uint64 (const char * parent_name
+                                        ,enum ADIOS_DATATYPES type
+                                        ,void * data
+                                        )
+{
+    if (!data)
+    {
+        fprintf (stderr, "cannot write var since dim %s not provided\n"
+                ,parent_name
+                );
+        return 0;
+    }
+
+    switch (type)
+    {
+        case adios_byte:
+            return (uint64_t) *(int8_t *) data;
+
+        case adios_short:
+            return (uint64_t) *(int16_t *) data;
+
+        case adios_integer:
+            return (uint64_t) *(int32_t *) data;
+
+        case adios_long:
+            return (uint64_t) *(int64_t *) data;
+
+        case adios_unsigned_byte:
+            return (uint64_t) *(uint8_t *) data;
+
+        case adios_unsigned_short:
+            return (uint64_t) *(uint16_t *) data;
+
+        case adios_unsigned_integer:
+            return (uint64_t) *(uint32_t *) data;
+
+        case adios_unsigned_long:
+            return (uint64_t) *(uint64_t *) data;
+
+        case adios_real:
+            return (uint64_t) *(float *) data;
+
+        case adios_double:
+            return (uint64_t) *(double *) data;
+
+        case adios_long_double:
+            return (uint64_t) *(long double *) data;
+
+        case adios_string:
+        case adios_complex:
+        case adios_double_complex:
+            fprintf (stderr, "Cannot convert type %s to integer for var %s\n"
+                    ,adios_type_to_string_int (type), parent_name
+                    );
+
+            return 0;
+    }
+    return 0;
+}
+
+static uint64_t get_value_for_dim (struct adios_file_struct * fd
+                                ,struct adios_dimension_item_struct * dimension
+                                )
+{
+    uint64_t dim = 0;
+
+    if (dimension->id != 0)
+    {
+        struct adios_var_struct * var = adios_find_var_by_id (fd->group->vars
+                                                             ,dimension->id
+                                                             );
+        if (var)
+        {
+            if (var->data)
+            {
+                dim = cast_var_data_as_uint64 (var->name, var->type, var->data);
+            }
+            else
+            {
+                fprintf (stderr, "array dimension data missing\n");
+            }
+        }
+        else
+        {
+            struct adios_attribute_struct * attr = adios_find_attribute_by_id
+                                                        (fd->group->attributes
+                                                        ,dimension->id
+                                                        );
+            if (attr)
+            {
+                if (attr->var)
+                {
+                    if (attr->var->data)
+                    {
+                        dim = cast_var_data_as_uint64 (attr->var->name
+                                                      ,attr->var->type
+                                                      ,attr->var->data
+                                                      );
+                    }
+                    else
+                    {
+                        fprintf (stderr, "array dimension data missing\n");
+                    }
+                }
+                else
+                {
+                    dim = cast_var_data_as_uint64 (attr->name, attr->type
+                                                  ,attr->value
+                                                  );
+                }
+            }
+            else
+            {
+                fprintf (stderr, "invalid dimension member id: %d\n"
+                        ,dimension->id
+                        );
+            }
+        }
+    }
+    else
+    {
+        if (dimension->time_index == adios_flag_yes)
+            dim = 1;
+        else
+            dim = dimension->rank;
+    }
+
+    return dim;
+}
+
+void adios_copy_var_written (struct adios_var_struct ** root
+                            ,struct adios_var_struct * var
+                            ,struct adios_file_struct * fd
+                            )
+{
+    struct adios_var_struct * var_new;
+
+    while (root)
+    {
+        if (!*root)
+        {
+            var_new = (struct adios_var_struct *) malloc
+                                                  (sizeof (struct adios_var_struct));
+            //var_new->id = ++fd->group->member_count;
+            var_new->id = var->id;
+            var_new->parent_id = var->id;
+            var_new->name = strdup (var->name);
+            var_new->path = strdup (var->path);
+            var_new->type = var->type;
+            var_new->dimensions = 0;
+            var_new->got_buffer = var->got_buffer;
+            var_new->is_dim = var->is_dim;
+            var_new->write_offset = var->write_offset;
+            var_new->stats = 0;
+            var_new->free_data = var->free_data;
+            var_new->data = 0;
+            var_new->data_size = var->data_size;
+            var_new->next = 0;
+
+            uint64_t size = adios_get_type_size (var->type, var->data);
+            switch (var->type)
+            {
+                case adios_byte:
+                case adios_unsigned_byte:
+                case adios_short:
+                case adios_unsigned_short:
+                case adios_integer:
+                case adios_unsigned_integer:
+                case adios_long:
+                case adios_unsigned_long:
+                case adios_real:
+                case adios_double:
+                case adios_long_double:
+                case adios_complex:
+                case adios_double_complex:
+                    if (var->dimensions)
+                    {
+                        uint8_t c;
+                        uint8_t j;
+                        struct adios_dimension_struct * d = var->dimensions;
+                        /*
+                         *
+                         * NOT ALL METHODS TRACK MIN/MAX.  CHECK BEFORE TRYING TO COPY.
+                         *
+                         */
+                       // NCSU Statistics - copy stat to new var struct
+                        uint8_t count = adios_get_stat_set_count(var->type);
+                        uint8_t idx = 0;
+                        uint64_t characteristic_size;
+
+                        var_new->bitmap = var->bitmap;
+                        var_new->stats = malloc (count * sizeof(struct adios_stat_struct *));
+
+                        // Set of characteristics will be repeated thrice for complex numbers
+                        for (c = 0; c < count; c ++)
+                        {
+                            var_new->stats[c] = calloc(ADIOS_STAT_LENGTH, sizeof (struct adios_stat_struct));
+
+                            j = idx = 0;
+                            while (var->bitmap >> j)
+                             {
+                                if ((var->bitmap >> j) & 1)
+                                {
+                                    if (var->stats[c][idx].data != NULL)
+                                    {
+                                        if (j == adios_statistic_hist)
+                                        {
+                                            var_new->stats[c][idx].data = (struct adios_hist_struct *) malloc (sizeof(struct adios_hist_struct));
+
+                                            struct adios_hist_struct * var_hist = var->stats[c][idx].data;
+                                            struct adios_hist_struct * var_new_hist = var_new->stats[c][idx].data;
+
+                                            var_new_hist->min = var_hist->min;
+                                            var_new_hist->max = var_hist->max;
+                                            var_new_hist->num_breaks = var_hist->num_breaks;
+
+                                            var_new_hist->frequencies = malloc ((var_hist->num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, ""));
+                                            memcpy (var_new_hist->frequencies, var_hist->frequencies, (var_hist->num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, ""));
+                                            var_new_hist->breaks = malloc ((var_hist->num_breaks) * adios_get_type_size(adios_double, ""));
+                                            memcpy (var_new_hist->breaks, var_hist->breaks, (var_hist->num_breaks) * adios_get_type_size(adios_double, ""));
+                                        }
+                                        else
+                                        {
+                                            characteristic_size = adios_get_stat_size(var->stats[c][idx].data, var->type, j);
+                                            var_new->stats[c][idx].data = malloc (characteristic_size);
+                                            memcpy (var_new->stats[c][idx].data, var->stats[c][idx].data, characteristic_size);
+                                        }
+
+                                        idx ++;
+                                    }
+                                }
+                                j ++;
+                            }
+                        }
+
+                        c = count_dimensions (var->dimensions);
+
+                        for (j = 0; j < c; j++)
+                        {
+                            struct adios_dimension_struct * d_new = (struct adios_dimension_struct *)
+                                                            malloc (sizeof (struct adios_dimension_struct));
+                            // de-reference dimension id
+                            d_new->dimension.id = 0;
+                            d_new->dimension.rank = get_value_for_dim (fd, &d->dimension);
+                            d_new->dimension.time_index = d->dimension.time_index;
+                            d_new->global_dimension.id = 0;
+                            d_new->global_dimension.rank = get_value_for_dim (fd, &d->global_dimension);
+                            d_new->global_dimension.time_index = d->global_dimension.time_index;
+                            d_new->local_offset.id = 0;
+                            d_new->local_offset.rank = get_value_for_dim (fd, &d->local_offset);
+                            d_new->local_offset.time_index = d->local_offset.time_index;
+                            d_new->next = 0;
+
+                            adios_append_dimension (&var_new->dimensions, d_new);
+
+                            d = d->next;
+                        }
+                    }
+                    else
+                    {
+                        var_new->stats = 0;
+                        var_new->data = malloc (size);
+                        memcpy (var_new->data, var->data, size);
+                    }
+
+                    break;
+
+                case adios_string:
+                {
+                    var_new->data = malloc (size + 1);
+                    memcpy (var_new->data, var->data, size);
+                    ((char *) (var_new->data)) [size] = 0;
+
+                    break;
+                }
+            }
+
+            *root = var_new;
+            root = 0;
+        }
+        else
+        {
+            root = &(*root)->next;
+        }
+    }
+}
+
+void adios_build_index_v1 (struct adios_file_struct * fd
+                          ,struct adios_index_process_group_struct_v1 ** pg_root
+                          ,struct adios_index_var_struct_v1 ** vars_root
+                          ,struct adios_index_attribute_struct_v1 ** attrs_root
+                          )
+{
+    struct adios_group_struct * g = fd->group;
+    struct adios_var_struct * v = g->vars_written;
+    struct adios_attribute_struct * a = g->attributes;
+    struct adios_index_process_group_struct_v1 * g_item;
+
+    uint64_t process_group_count = 0;
+    uint16_t var_count = 0;
+
+    g_item = (struct adios_index_process_group_struct_v1 *)
+                malloc (sizeof (struct adios_index_process_group_struct_v1));
+    g_item->group_name = (g->name ? strdup (g->name) : 0L);
+    g_item->adios_host_language_fortran = g->adios_host_language_fortran;
+    g_item->process_id = g->process_id;
+    g_item->time_index_name = (g->time_index_name ? strdup (g->time_index_name) : 0L);
+    g_item->time_index = g->time_index;
+    g_item->offset_in_file = fd->pg_start_in_file;
+    g_item->next = 0;
+
+    // build the groups and vars index
+    index_append_process_group_v1 (pg_root, g_item);
+
+    while (v)
+    {
+        // only add items that were written to the index
+        if (v->write_offset != 0)
+        {
+            struct adios_index_var_struct_v1 * v_index;
+            v_index = malloc (sizeof (struct adios_index_var_struct_v1));
+            v_index->characteristics = malloc (
+                           sizeof (struct adios_index_characteristic_struct_v1)
+                          );
+
+            v_index->id = v->id;
+            v_index->group_name = (g->name ? strdup (g->name) : 0L);
+            v_index->var_name = (v->name ? strdup (v->name) : 0L);
+            v_index->var_path = (v->path ? strdup (v->path) : 0L);
+            v_index->type = v->type;
+            v_index->characteristics_count = 1;
+            v_index->characteristics_allocated = 1;
+            v_index->characteristics [0].offset = v->write_offset;
+            // Find the old var in g->vars.
+            // We need this to calculate the correct payload_offset, because that
+            // holds the variable references in the dimensions, while v-> contains
+            // only numerical values
+            struct adios_var_struct * old_var = adios_find_var_by_id (g->vars, v->parent_id);
+            v_index->characteristics [0].payload_offset = v->write_offset
+                            + adios_calc_var_overhead_v1 (old_var)
+                            - strlen (old_var->path)  // take out the length of path defined in XML
+                            + strlen (v->path); // add length of the actual, current path of this var
+            v_index->characteristics [0].file_name = (fd->subfile_name ? strdup (fd->subfile_name) : 0L);
+            v_index->characteristics [0].time_index = g_item->time_index;
+
+            v_index->characteristics [0].value = 0;
+            v_index->characteristics [0].dims.count = 0;
+
+            // NCSU - Initializing stat related info in index
+            v_index->characteristics [0].bitmap = 0;
+            v_index->characteristics [0].stats = 0;
+
+            uint64_t size = adios_get_type_size (v->type, v->data);
+            switch (v->type)
+            {
+                case adios_byte:
+                case adios_unsigned_byte:
+                case adios_short:
+                case adios_unsigned_short:
+                case adios_integer:
+                case adios_unsigned_integer:
+                case adios_long:
+                case adios_unsigned_long:
+                case adios_real:
+                case adios_double:
+                case adios_long_double:
+                case adios_complex:
+                case adios_double_complex:
+                    if (v->dimensions)
+                    {
+                        uint8_t c;
+                        uint8_t j;
+                        struct adios_dimension_struct * d = v->dimensions;
+
+                        // NCSU - Copy statistics from var struct to index
+                        uint8_t count = adios_get_stat_set_count(v->type);
+                        uint8_t idx = 0;
+                        uint64_t characteristic_size;
+
+                        v_index->characteristics [0].bitmap = v->bitmap;
+                        v_index->characteristics [0].stats = malloc (count * sizeof(struct adios_index_characteristics_stat_struct *));
+
+                        // Set of characteristics will be repeated thrice for complex numbers
+                        for (c = 0; c < count; c ++)
+                        {
+                            v_index->characteristics [0].stats[c] = calloc(ADIOS_STAT_LENGTH, sizeof (struct adios_index_characteristics_stat_struct));
+
+                            j = idx = 0;
+                            while (v_index->characteristics [0].bitmap >> j)
+                            {
+                                if ((v_index->characteristics [0].bitmap >> j) & 1)
+                                {
+                                    if (v->stats[c][idx].data != NULL)
+                                    {
+                                        if (j == adios_statistic_hist)
+                                        {
+                                            v_index->characteristics [0].stats[c][idx].data = (struct adios_index_characteristics_hist_struct *) malloc (sizeof(struct adios_index_characteristics_hist_struct));
+
+                                            struct adios_hist_struct * v_hist = v->stats[c][idx].data;
+                                            struct adios_hist_struct * v_index_hist = v_index->characteristics [0].stats[c][idx].data;
+
+                                            v_index_hist->min = v_hist->min;
+                                            v_index_hist->max = v_hist->max;
+                                            v_index_hist->num_breaks = v_hist->num_breaks;
+
+                                            v_index_hist->frequencies = malloc ((v_hist->num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, ""));
+                                            memcpy (v_index_hist->frequencies, v_hist->frequencies, (v_hist->num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, ""));
+                                            v_index_hist->breaks = malloc ((v_hist->num_breaks) * adios_get_type_size(adios_double, ""));
+                                            memcpy (v_index_hist->breaks, v_hist->breaks, (v_hist->num_breaks) * adios_get_type_size(adios_double, ""));
+                                        }
+                                        else
+                                        {
+                                            characteristic_size = adios_get_stat_size(v->stats[c][idx].data, v->type, j);
+                                            v_index->characteristics [0].stats[c][idx].data = malloc (characteristic_size);
+                                            memcpy (v_index->characteristics [0].stats[c][idx].data, v->stats[c][idx].data, characteristic_size);
+                                        }
+
+                                        idx ++;
+                                    }
+                                }
+                                j ++;
+                            }
+                        }
+                        // NCSU - End of copy, for statistics
+
+                        c = count_dimensions (v->dimensions);
+                        v_index->characteristics [0].dims.count = c;
+                        // (local, global, local offset)
+                        v_index->characteristics [0].dims.dims = malloc
+                            (3 * 8 * v_index->characteristics [0].dims.count);
+                        for (j = 0; j < c; j++)
+                        {
+                            v_index->characteristics [0].dims.dims [j * 3 + 0] =
+                                   get_value_for_dim (fd, &d->dimension);
+                            v_index->characteristics [0].dims.dims [j * 3 + 1] =
+                                   get_value_for_dim (fd, &d->global_dimension);
+                            v_index->characteristics [0].dims.dims [j * 3 + 2] =
+                                   get_value_for_dim (fd, &d->local_offset);
+
+                            d = d->next;
+                        }
+                        v_index->characteristics [0].value = 0;
+                    }
+                    else
+                    {
+                        v_index->characteristics [0].bitmap = 0;
+                        v_index->characteristics [0].stats = 0;
+
+                        v_index->characteristics [0].value = malloc (size);
+                        memcpy (v_index->characteristics [0].value, v->data
+                               ,size
+                               );
+                        v_index->characteristics [0].dims.count = 0;
+                        v_index->characteristics [0].dims.dims = 0;
+                    }
+
+                    break;
+
+                case adios_string:
+                {
+                    v_index->characteristics [0].value = malloc (size + 1);
+                    memcpy (v_index->characteristics [0].value, v->data, size);
+                    ((char *) (v_index->characteristics [0].value)) [size] = 0;
+
+                    break;
+                }
+            }
+            v_index->next = 0;
+
+            // this fn will either take ownership for free
+            index_append_var_v1 (vars_root, v_index);
+        }
+
+        v = v->next;
+    }
+
+    while (a)
+    {
+        // only add items that were written to the index
+        if (a->write_offset != 0)
+        {
+            struct adios_index_attribute_struct_v1 * a_index;
+            a_index = malloc (sizeof (struct adios_index_attribute_struct_v1));
+            a_index->characteristics = malloc (
+                           sizeof (struct adios_index_characteristic_struct_v1)
+                          );
+
+            a_index->id = a->id;
+            a_index->group_name = (g->name ? strdup (g->name) : 0L);
+            a_index->attr_name = (a->name ? strdup (a->name) : 0L);
+            a_index->attr_path = (a->path ? strdup (a->path) : 0L);
+            a_index->type = a->type;
+            a_index->characteristics_count = 1;
+            a_index->characteristics_allocated = 1;
+            uint64_t size = adios_get_type_size (a->type, a->value);
+
+            a_index->characteristics [0].offset = a->write_offset;
+            a_index->characteristics [0].payload_offset = a->write_offset + adios_calc_attribute_overhead_v1 (a);
+            a_index->characteristics [0].file_name = (fd->subfile_name ? strdup (fd->subfile_name) : 0L);
+            a_index->characteristics [0].time_index = 0;
+
+            // NCSU -,Initializing stat related info in attribute index
+            a_index->characteristics [0].bitmap = 0;
+            a_index->characteristics [0].stats = 0;
+
+            if (a->value)
+            {
+                a_index->characteristics [0].value = malloc (size + 1);
+                ((char *) (a_index->characteristics [0].value)) [size] = 0;
+                memcpy (a_index->characteristics [0].value, a->value, size);
+            }
+            else
+            {
+                a_index->characteristics [0].value = 0;
+            }
+            a_index->characteristics [0].dims.count = 0;
+            a_index->characteristics [0].dims.dims = 0;
+            if (a->var)
+                a_index->characteristics [0].var_id = a->var->id;
+            else
+                a_index->characteristics [0].var_id = 0;
+
+            a_index->next = 0;
+
+            // this fn will either take ownership for free
+            index_append_attribute_v1 (attrs_root, a_index);
+        }
+
+        a = a->next;
+    }
+}
+
+int adios_write_index_v1 (char ** buffer
+                         ,uint64_t * buffer_size
+                         ,uint64_t * buffer_offset
+                         ,uint64_t index_start
+                         ,struct adios_index_process_group_struct_v1 * pg_root
+                         ,struct adios_index_var_struct_v1 * vars_root
+                         ,struct adios_index_attribute_struct_v1 * attrs_root
+                         )
+{
+    uint64_t groups_count = 0;
+    uint16_t vars_count = 0;
+    uint16_t attrs_count = 0;
+
+    uint64_t index_size = 0;
+    uint64_t pg_index_start = index_start;
+    uint64_t vars_index_start = 0;
+    uint64_t attrs_index_start = 0;
+
+    // we need to save the offset we will write the count and size
+    uint64_t buffer_offset_start = 0; // since we realloc, we can't save a ptr
+
+    // save for the process group index
+    buffer_offset_start = *buffer_offset;
+
+    *buffer_offset += (8 + 8); // save space for groups count and index size
+
+    while (pg_root)
+    {
+        uint8_t flag;
+        uint16_t len;
+        uint16_t group_size = 0;
+        uint64_t group_start = *buffer_offset;
+
+        groups_count++;
+
+        *buffer_offset += 2; // save space for the size
+
+        len = strlen (pg_root->group_name);
+        buffer_write (buffer, buffer_size, buffer_offset, &len, 2);
+        index_size += 2;
+        group_size += 2;
+        buffer_write (buffer, buffer_size, buffer_offset
+                     ,pg_root->group_name, len
+                     );
+        index_size += len;
+        group_size += len;
+
+        flag = (pg_root->adios_host_language_fortran == adios_flag_yes ? 'y'
+                                                                       : 'n'
+               );
+        buffer_write (buffer, buffer_size, buffer_offset, &flag, 1);
+        index_size += 1;
+        group_size += 1;
+
+        buffer_write (buffer, buffer_size, buffer_offset
+                     ,&pg_root->process_id, 4
+                     );
+        index_size += 4;
+        group_size += 4;
+
+        if (pg_root->time_index_name)
+        {
+            len = strlen (pg_root->time_index_name);
+        }
+        else
+        {
+            len = 0;
+        }
+        buffer_write (buffer, buffer_size, buffer_offset, &len, 2);
+        index_size += 2;
+        group_size += 2;
+        if (len)
+        {
+            buffer_write (buffer, buffer_size, buffer_offset
+                         ,pg_root->time_index_name, len
+                         );
+        }
+        index_size += len;
+        group_size += len;
+
+        buffer_write (buffer, buffer_size, buffer_offset
+                     ,&pg_root->time_index, 4
+                     );
+        index_size += 4;
+        group_size += 4;
+        buffer_write (buffer, buffer_size, buffer_offset
+                     ,&pg_root->offset_in_file, 8
+                     );
+        index_size += 8;
+        group_size += 8;
+
+        buffer_write (buffer, buffer_size, &group_start, &group_size, 2);
+
+        pg_root = pg_root->next;
+    }
+
+    buffer_write (buffer, buffer_size, &buffer_offset_start, &groups_count, 8);
+    buffer_write (buffer, buffer_size, &buffer_offset_start, &index_size, 8);
+
+    buffer_offset_start = *buffer_offset; // save to write the vars_count/size
+    vars_index_start = buffer_offset_start + index_start;
+    index_size = 0;
+
+    *buffer_offset += (2 + 8); // save space for count and size
+
+    while (vars_root)
+    {
+        uint8_t flag;
+        uint16_t len;
+        uint32_t var_size = 0;
+        uint64_t var_start = *buffer_offset;
+        int i;
+
+        vars_count++;
+
+        *buffer_offset += 4; // save space for var length
+
+        buffer_write (buffer, buffer_size, buffer_offset, &vars_root->id, 2);
+        index_size += 2;
+        var_size += 2;
+
+        len = strlen (vars_root->group_name);
+        buffer_write (buffer, buffer_size, buffer_offset, &len, 2);
+        index_size += 2;
+        var_size += 2;
+        buffer_write (buffer, buffer_size, buffer_offset
+                     ,vars_root->group_name, len
+                     );
+        index_size += len;
+        var_size += len;
+
+        len = strlen (vars_root->var_name);
+        buffer_write (buffer, buffer_size, buffer_offset, &len, 2);
+        index_size += 2;
+        var_size += 2;
+        buffer_write (buffer, buffer_size, buffer_offset
+                     ,vars_root->var_name, len
+                     );
+        index_size += len;
+        var_size += len;
+
+        len = strlen (vars_root->var_path);
+        buffer_write (buffer, buffer_size, buffer_offset, &len, 2);
+        index_size += 2;
+        var_size += 2;
+        buffer_write (buffer, buffer_size, buffer_offset
+                     ,vars_root->var_path, len
+                     );
+        index_size += len;
+        var_size += len;
+
+        flag = vars_root->type;
+        buffer_write (buffer, buffer_size, buffer_offset, &flag, 1);
+        index_size += 1;
+        var_size += 1;
+
+        buffer_write (buffer, buffer_size, buffer_offset
+                     ,&vars_root->characteristics_count, 8
+                     );
+        index_size += 8;
+        var_size += 8;
+
+        for (i = 0; i < vars_root->characteristics_count; i++)
+        {
+            uint64_t size;
+            uint8_t characteristic_set_count = 0;
+            uint32_t characteristic_set_length = 0;
+
+            uint64_t characteristic_set_start = *buffer_offset;
+            *buffer_offset += 1 + 4; // save space for characteristic count/len
+            index_size += 1 + 4;
+            var_size += 1 + 4;
+
+            // add an offset characteristic for all vars
+            characteristic_set_count++;
+            flag = (uint8_t) adios_characteristic_offset;
+            buffer_write (buffer, buffer_size, buffer_offset, &flag, 1);
+            index_size += 1;
+            var_size += 1;
+            characteristic_set_length += 1;
+
+            buffer_write (buffer, buffer_size, buffer_offset
+                         ,&vars_root->characteristics [i].offset, 8
+                         );
+            index_size += 8;
+            var_size += 8;
+            characteristic_set_length += 8;
+
+            // add a payload offset characteristic for all vars
+            characteristic_set_count++;
+            flag = (uint8_t) adios_characteristic_payload_offset;
+            buffer_write (buffer, buffer_size, buffer_offset, &flag, 1);
+            index_size += 1;
+            var_size += 1;
+            characteristic_set_length += 1;
+
+            buffer_write (buffer, buffer_size, buffer_offset
+                         ,&vars_root->characteristics [i].payload_offset, 8
+                         );
+            index_size += 8;
+            var_size += 8;
+            characteristic_set_length += 8;
+
+            // add a file name characteristic for all vars
+            if (vars_root->characteristics [i].file_name)
+            {
+                characteristic_set_count++;
+                flag = (uint8_t) adios_characteristic_file_name;
+                buffer_write (buffer, buffer_size, buffer_offset, &flag, 1);
+                index_size += 1;
+                var_size += 1;
+                characteristic_set_length += 1;
+
+                len = strlen (vars_root->characteristics [i].file_name);
+                buffer_write (buffer, buffer_size, buffer_offset, &len, 2);
+                index_size += 2;
+                var_size += 2;
+
+                buffer_write (buffer, buffer_size, buffer_offset
+                             ,vars_root->characteristics [i].file_name, len
+                             );
+                index_size += len;
+                var_size += len;
+                characteristic_set_length += len;
+            }
+
+            // add a time index characteristic for all vars
+            characteristic_set_count++;
+            flag = (uint8_t) adios_characteristic_time_index;
+            buffer_write (buffer, buffer_size, buffer_offset, &flag, 1);
+            index_size += 1;
+            var_size += 1;
+            characteristic_set_length += 1;
+
+            buffer_write (buffer, buffer_size, buffer_offset
+                         ,&vars_root->characteristics [i].time_index, 4
+                         );
+            index_size += 4;
+            var_size += 4;
+            characteristic_set_length += 4;
+
+            // depending on if it is an array or not, generate a different
+            // additional set of characteristics
+            size = adios_get_type_size (vars_root->type
+                                       ,vars_root->characteristics [i].value
+                                       );
+
+            switch (vars_root->type)
+            {
+                case adios_byte:
+                case adios_unsigned_byte:
+                case adios_short:
+                case adios_unsigned_short:
+                case adios_integer:
+                case adios_unsigned_integer:
+                case adios_long:
+                case adios_unsigned_long:
+                case adios_real:
+                case adios_double:
+                case adios_long_double:
+                case adios_complex:
+                case adios_double_complex:
+                    if (vars_root->characteristics [i].dims.count)
+                    {
+                        // add a dimensions characteristic
+                        characteristic_set_count++;
+                        flag = (uint8_t) adios_characteristic_dimensions;
+                        buffer_write (buffer, buffer_size, buffer_offset
+                                     ,&flag, 1
+                                     );
+                        index_size += 1;
+                        var_size += 1;
+                        characteristic_set_length += 1;
+
+                        buffer_write (buffer, buffer_size, buffer_offset
+                                     ,&vars_root->characteristics [i].dims.count
+                                     ,1
+                                     );
+                        index_size += 1;
+                        var_size += 1;
+                        characteristic_set_length += 1;
+
+                        len = 3 * 8 * vars_root->characteristics [i].dims.count;
+                        buffer_write (buffer, buffer_size, buffer_offset
+                                     ,&len, 2
+                                     );
+                        index_size += 2;
+                        var_size += 2;
+                        characteristic_set_length += 2;
+                        buffer_write (buffer, buffer_size, buffer_offset
+                                     ,vars_root->characteristics [i].dims.dims
+                                     ,len
+                                     );
+                        index_size += len;
+                        var_size += len;
+                        characteristic_set_length += len;
+
+                        // NCSU - Adding bitmap
+                        characteristic_set_count++;
+                        flag = (uint8_t) adios_characteristic_bitmap;
+                        buffer_write (buffer, buffer_size, buffer_offset
+                                     ,&flag, 1
+                                     );
+                        index_size += 1;
+                        var_size += 1;
+                        characteristic_set_length += 1;
+
+                        buffer_write (buffer, buffer_size, buffer_offset
+                                     ,&vars_root->characteristics [i].bitmap, 4
+                                     );
+                        index_size += 4;
+                        var_size += 4;
+                        characteristic_set_length += 4;
+
+                        // NCSU - Adding statistics
+                           characteristic_set_count++;
+                        flag = (uint8_t) adios_characteristic_stat;
+                        buffer_write (buffer, buffer_size, buffer_offset
+                                     ,&flag, 1
+                                     );
+                        index_size += 1;
+                        var_size += 1;
+                        characteristic_set_length += 1;
+
+                        uint8_t count = adios_get_stat_set_count(vars_root->type);
+                        uint8_t idx = 0, c, j;
+                        uint64_t characteristic_size;
+
+                        for (c = 0; c < count; c ++)
+                        {
+                            j = idx = 0;
+
+                            while (vars_root->characteristics [i].bitmap >> j)
+                            {
+                                if ((vars_root->characteristics [i].bitmap >> j) & 1)
+                                {
+                                    if (j == adios_statistic_hist)
+                                    {
+                                        struct adios_hist_struct * hist = vars_root->characteristics [i].stats[c][idx].data;
+
+                                        buffer_write (  buffer, buffer_size, buffer_offset
+                                                        , &hist->num_breaks, 4
+                                                     );
+                                        characteristic_size = 4;
+
+                                        buffer_write (  buffer, buffer_size, buffer_offset
+                                                        , &hist->min, 8
+                                                     );
+                                        characteristic_size += 8;
+
+                                        buffer_write (  buffer, buffer_size, buffer_offset
+                                                        , &hist->max, 8
+                                                     );
+                                        characteristic_size += 8;
+
+                                        buffer_write (  buffer, buffer_size, buffer_offset
+                                                        , hist->frequencies, (hist->num_breaks + 1) * 4
+                                                     );
+                                        characteristic_size += (hist->num_breaks + 1) * 4;
+
+                                        buffer_write (  buffer, buffer_size, buffer_offset
+                                                        , hist->breaks, hist->num_breaks * 8
+                                                     );
+                                        characteristic_size += (hist->num_breaks) * 8;
+                                    }
+                                    else
+                                    {
+                                        characteristic_size = adios_get_stat_size(vars_root->characteristics [i].stats[c][idx].data, vars_root->type, j);
+
+                                        buffer_write ( 	buffer, buffer_size, buffer_offset
+                                                         ,vars_root->characteristics [i].stats[c][idx].data, characteristic_size
+                                                      );
+
+                                    }
+
+                                    index_size += characteristic_size;
+                                    var_size += characteristic_size;
+                                    characteristic_set_length += characteristic_size;
+
+                                    idx ++;
+                                }
+                                j ++;
+                            }
+                        }
+                        // NCSU - End of addition statistic to buffer
+                    }
+                    else
+                    {
+                        // add a value characteristic
+                        characteristic_set_count++;
+                        flag = (uint8_t) adios_characteristic_value;
+                        buffer_write (buffer, buffer_size, buffer_offset
+                                     ,&flag, 1
+                                     );
+                        index_size += 1;
+                        var_size += 1;
+                        characteristic_set_length += 1;
+                        buffer_write (buffer, buffer_size, buffer_offset
+                                     ,vars_root->characteristics [i].value, size
+                                     );
+                        index_size += size;
+                        var_size += size;
+                        characteristic_set_length += size;
+                    }
+                    break;
+
+                case adios_string:
+                    {
+                        // add a value characteristic
+                        characteristic_set_count++;
+                        flag = (uint8_t) adios_characteristic_value;
+                        buffer_write (buffer, buffer_size, buffer_offset
+                                     ,&flag, 1
+                                     );
+                        index_size += 1;
+                        var_size += 1;
+                        characteristic_set_length += 1;
+                        if (vars_root->type == adios_string)
+                        {
+                            uint16_t len = (uint16_t) size;
+                            buffer_write (buffer, buffer_size, buffer_offset
+                                         ,&len, 2
+                                         );
+                            index_size += 2;
+                            var_size += 2;
+                            characteristic_set_length += 2;
+                        }
+                        buffer_write (buffer, buffer_size, buffer_offset
+                                     ,vars_root->characteristics [i].value, size
+                                     );
+                        index_size += size;
+                        var_size += size;
+                        characteristic_set_length += size;
+                    }
+                    break;
+            }
+            // characteristics count/size prefix
+            buffer_write (buffer, buffer_size, &characteristic_set_start
+                         ,&characteristic_set_count, 1
+                         );
+            buffer_write (buffer, buffer_size, &characteristic_set_start
+                         ,&characteristic_set_length, 4
+                         );
+        }
+
+        buffer_write (buffer, buffer_size, &var_start, &var_size, 4);
+
+        vars_root = vars_root->next;
+    }
+
+    // vars index count/size prefix
+    buffer_write (buffer, buffer_size, &buffer_offset_start, &vars_count, 2);
+    buffer_write (buffer, buffer_size, &buffer_offset_start, &index_size, 8);
+
+    buffer_offset_start = *buffer_offset; // save to write the attrs_count/size
+    attrs_index_start = buffer_offset_start + index_start;
+    index_size = 0;
+
+    *buffer_offset += (2 + 8); // save space for count and size
+
+    while (attrs_root)
+    {
+        uint8_t flag;
+        uint16_t len;
+        uint32_t attr_size = 0;
+        uint64_t attr_start = *buffer_offset;
+        int i;
+
+        attrs_count++;
+
+        *buffer_offset += 4; // save space for attr length
+
+        buffer_write (buffer, buffer_size, buffer_offset, &attrs_root->id, 2);
+        index_size += 2;
+        attr_size += 2;
+
+        len = strlen (attrs_root->group_name);
+        buffer_write (buffer, buffer_size, buffer_offset, &len, 2);
+        index_size += 2;
+        attr_size += 2;
+        buffer_write (buffer, buffer_size, buffer_offset
+                     ,attrs_root->group_name, len
+                     );
+        index_size += len;
+        attr_size += len;
+
+        len = strlen (attrs_root->attr_name);
+        buffer_write (buffer, buffer_size, buffer_offset, &len, 2);
+        index_size += 2;
+        attr_size += 2;
+        buffer_write (buffer, buffer_size, buffer_offset
+                     ,attrs_root->attr_name, len
+                     );
+        index_size += len;
+        attr_size += len;
+
+        len = strlen (attrs_root->attr_path);
+        buffer_write (buffer, buffer_size, buffer_offset, &len, 2);
+        index_size += 2;
+        attr_size += 2;
+        buffer_write (buffer, buffer_size, buffer_offset
+                     ,attrs_root->attr_path, len
+                     );
+        index_size += len;
+        attr_size += len;
+
+        flag = attrs_root->type;
+        buffer_write (buffer, buffer_size, buffer_offset, &flag, 1);
+        index_size += 1;
+        attr_size += 1;
+
+        buffer_write (buffer, buffer_size, buffer_offset
+                     ,&attrs_root->characteristics_count, 8
+                     );
+        index_size += 8;
+        attr_size += 8;
+
+        for (i = 0; i < attrs_root->characteristics_count; i++)
+        {
+            uint64_t size;
+            uint8_t characteristic_set_count = 0;
+            uint32_t characteristic_set_length = 0;
+
+            uint64_t characteristic_set_start = *buffer_offset;
+            *buffer_offset += 1 + 4; // save space for characteristic count/len
+            index_size += 1 + 4;
+            attr_size += 1 + 4;
+
+            // add an offset characteristic for all attrs
+            characteristic_set_count++;
+            flag = (uint8_t) adios_characteristic_offset;
+            buffer_write (buffer, buffer_size, buffer_offset, &flag, 1);
+            index_size += 1;
+            attr_size += 1;
+            characteristic_set_length += 1;
+
+            buffer_write (buffer, buffer_size, buffer_offset
+                         ,&attrs_root->characteristics [i].offset, 8
+                         );
+            index_size += 8;
+            attr_size += 8;
+            characteristic_set_length += 8;
+
+            // add a payload offset characteristic for all attrs
+            characteristic_set_count++;
+            flag = (uint8_t) adios_characteristic_payload_offset;
+            buffer_write (buffer, buffer_size, buffer_offset, &flag, 1);
+            index_size += 1;
+            attr_size += 1;
+            characteristic_set_length += 1;
+
+            buffer_write (buffer, buffer_size, buffer_offset
+                         ,&attrs_root->characteristics [i].payload_offset, 8
+                         );
+            index_size += 8;
+            attr_size += 8;
+            characteristic_set_length += 8;
+
+            // add a file name characteristic for all attrs
+            if (attrs_root->characteristics [i].file_name)
+            {
+                characteristic_set_count++;
+                flag = (uint8_t) adios_characteristic_file_name;
+                buffer_write (buffer, buffer_size, buffer_offset, &flag, 1);
+                index_size += 1;
+                attr_size += 1;
+                characteristic_set_length += 1;
+
+                len = strlen (attrs_root->characteristics [i].file_name);
+                buffer_write (buffer, buffer_size, buffer_offset, &len, 2);
+                index_size += 2;
+                attr_size += 2;
+
+                buffer_write (buffer, buffer_size, buffer_offset
+                             ,attrs_root->characteristics [i].file_name, len
+                             );
+                index_size += len;
+                attr_size += len;
+                characteristic_set_length += len;
+            }
+
+            // add a time index characteristic for all attrs
+            characteristic_set_count++;
+            flag = (uint8_t) adios_characteristic_time_index;
+            buffer_write (buffer, buffer_size, buffer_offset, &flag, 1);
+            index_size += 1;
+            attr_size += 1;
+            characteristic_set_length += 1;
+
+            buffer_write (buffer, buffer_size, buffer_offset
+                         ,&attrs_root->characteristics [i].time_index, 4
+                         );
+            index_size += 4;
+            attr_size += 4;
+            characteristic_set_length += 4;
+
+            size = adios_get_type_size (attrs_root->type
+                                       ,attrs_root->characteristics [i].value
+                                       );
+
+            if (attrs_root->characteristics [i].value != 0)
+            {
+                // add a value characteristic
+                characteristic_set_count++;
+                flag = (uint8_t) adios_characteristic_value;
+                buffer_write (buffer, buffer_size, buffer_offset
+                             ,&flag, 1
+                             );
+                index_size += 1;
+                attr_size += 1;
+                characteristic_set_length += 1;
+                if (attrs_root->type == adios_string)
+                {
+                    uint16_t len = (uint16_t) size;
+                    buffer_write (buffer, buffer_size, buffer_offset
+                                 ,&len, 2
+                                 );
+                    index_size += 2;
+                    attr_size += 2;
+                    characteristic_set_length += 2;
+                }
+                buffer_write (buffer, buffer_size, buffer_offset
+                             ,attrs_root->characteristics [i].value, size
+                             );
+                index_size += size;
+                attr_size += size;
+                characteristic_set_length += size;
+            }
+            if (attrs_root->characteristics [i].var_id != 0)
+            {
+                // add a var id characteristic
+                characteristic_set_count++;
+                flag = (uint8_t) adios_characteristic_var_id;
+                buffer_write (buffer, buffer_size, buffer_offset
+                             ,&flag, 1
+                             );
+                index_size += 1;
+                attr_size += 1;
+                characteristic_set_length += 1;
+                buffer_write (buffer, buffer_size, buffer_offset
+                             ,&attrs_root->characteristics [i].var_id, 2
+                             );
+                index_size += 2;
+                attr_size += 2;
+                characteristic_set_length += 2;
+            }
+
+            // characteristics count/size prefix
+            buffer_write (buffer, buffer_size, &characteristic_set_start
+                         ,&characteristic_set_count, 1
+                         );
+            buffer_write (buffer, buffer_size, &characteristic_set_start
+                         ,&characteristic_set_length, 4
+                         );
+        }
+
+        buffer_write (buffer, buffer_size, &attr_start, &attr_size, 4);
+
+        attrs_root = attrs_root->next;
+    }
+
+    // attrs index count/size prefix
+    buffer_write (buffer, buffer_size, &buffer_offset_start, &attrs_count, 2);
+    buffer_write (buffer, buffer_size, &buffer_offset_start, &index_size, 8);
+
+    // location of the beginning of the indexes (first proc groups then vars)
+    buffer_write (buffer, buffer_size, buffer_offset, &pg_index_start, 8);
+    buffer_write (buffer, buffer_size, buffer_offset, &vars_index_start, 8);
+    buffer_write (buffer, buffer_size, buffer_offset, &attrs_index_start, 8);
+
+    return 0;
+}
+
+int adios_write_version_v1 (char ** buffer
+                           ,uint64_t * buffer_size
+                           ,uint64_t * buffer_offset
+                           )
+{
+    uint32_t test = 1;
+
+    if (!*(char *) &test)
+        test = 0x80000000;
+    else
+        test = 0;
+
+    test += 1;   // first data storage version
+    // For the new read API to be able to read back older file format,
+    // set this flag
+    test |= ADIOS_VERSION_HAVE_TIME_INDEX_CHARACTERISTIC;
+
+    test = htonl (test);
+
+    buffer_write (buffer, buffer_size, buffer_offset, &test, 4);
+
+    return 0;
+}
+
+int adios_write_version_flag_v1 (char ** buffer
+                                ,uint64_t * buffer_size
+                                ,uint64_t * buffer_offset
+                                ,uint32_t flag
+                                )
+{
+    uint32_t test = 1;
+
+    if (!*(char *) &test)
+        test = 0x80000000;
+    else
+        test = 0;
+
+    // version number 1 byte, endiness 1 byte,
+    // the rest is user-defined options 2 bytes
+    test += 1;   // master index file version
+    // For the new read API to be able to read back older file format,
+    // set this flag
+    test |= ADIOS_VERSION_HAVE_TIME_INDEX_CHARACTERISTIC | flag;
+
+    test = htonl (test);
+
+    buffer_write (buffer, buffer_size, buffer_offset, &test, 4);
+
+    return 0;
+}
+
+static uint16_t calc_dimension_size (struct adios_dimension_struct * dimension)
+{
+    uint16_t size = 0;
+
+    size += 1; // var (y or n)
+
+    if (   dimension->dimension.id == 0
+        && dimension->dimension.time_index == adios_flag_no
+       )  // it is a number
+    {
+        size += 8;  // size of value
+    }
+    else   // it is a var
+    {
+        size += 2;  // size of var ID
+    }
+
+    size += 1; // var (y or n)
+
+    if (   dimension->global_dimension.id == 0
+        && dimension->global_dimension.time_index == adios_flag_no
+       )  // it is a number
+    {
+        size += 8; // default to a rank
+    }
+    else
+    {
+        size += 2;  // size of var ID
+    }
+
+    size += 1; // var (y or n)
+
+    if (   dimension->local_offset.id == 0
+        && dimension->local_offset.time_index == adios_flag_no
+       )  // it is a number
+    {
+        size += 8;  // default to a rank
+    }
+    else
+    {
+        size += 2;  // size of var ID
+    }
+
+    return size;
+}
+
+static uint16_t calc_dimensions_size (struct adios_dimension_struct * dimension)
+{
+    uint16_t size = 0;
+
+    while (dimension)
+    {
+        size += calc_dimension_size (dimension);
+
+        dimension = dimension->next;
+    }
+
+    return size;
+}
+
+static
+uint64_t adios_write_dimension_v1 (struct adios_file_struct * fd
+                                  ,struct adios_dimension_struct * dimension
+                                  )
+{
+    uint64_t size = 0;
+    uint8_t var;
+
+    if (   dimension->dimension.id == 0
+        && dimension->dimension.time_index == adios_flag_no
+       )
+    {
+        var = 'n';
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &var, 1);
+        size += 1;
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                     ,&dimension->dimension.rank, 8
+                     );
+        size += 8;
+    }
+    else
+    {
+        var = 'y';
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &var, 1);
+        size += 1;
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                     ,&dimension->dimension.id, 2
+                     );
+        size += 2;
+    }
+
+    if (   dimension->global_dimension.id == 0
+        && dimension->global_dimension.time_index == adios_flag_no
+       )
+    {
+        var = 'n';
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &var, 1);
+        size += 1;
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                     ,&dimension->global_dimension.rank, 8
+                     );
+        size += 8;
+    }
+    else
+    {
+        var = 'y';
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &var, 1);
+        size += 1;
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                     ,&dimension->global_dimension.id, 2
+                     );
+        size += 2;
+    }
+
+    if (   dimension->local_offset.id == 0
+        && dimension->local_offset.time_index == adios_flag_no
+       )
+    {
+        var = 'n';
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &var, 1);
+        size += 1;
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                     ,&dimension->local_offset.rank, 8
+                     );
+        size += 8;
+    }
+    else
+    {
+        var = 'y';
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &var, 1);
+        size += 1;
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                     ,&dimension->local_offset.id, 2
+                     );
+        size += 2;
+    }
+
+    return size;
+}
+
+static
+uint16_t adios_write_dimensions_v1 (struct adios_file_struct * fd
+                                   ,struct adios_dimension_struct * dimensions
+                                   )
+{
+    uint16_t size = 0;
+    uint16_t dimensions_size = calc_dimensions_size (dimensions);
+    uint8_t ranks = count_dimensions (dimensions);
+
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &ranks, 1);
+    size += 1;
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &dimensions_size, 2);
+    size += 2;
+
+    while (dimensions)
+    {
+        size += adios_write_dimension_v1 (fd, dimensions);
+
+        dimensions = dimensions->next;
+    }
+
+    return size;
+}
+
+uint16_t adios_write_var_characteristics_dims_v1 (struct adios_file_struct * fd
+                                                 ,struct adios_var_struct * v
+                                                 )
+{
+    uint16_t total_size = 0;
+    uint8_t dims_count = 0;
+    uint16_t dims_length = 0;
+    struct adios_dimension_struct * d = v->dimensions;
+    uint64_t count_offset = fd->offset;
+
+    fd->offset += 1;
+    total_size += 1; // count
+
+    fd->offset += 2;
+    total_size += 2; // length
+
+    while (d)
+    {
+        uint64_t dim = 0;
+
+        dims_count++;
+
+        dim = get_value_for_dim (fd, &d->dimension);
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &dim, 8);
+        total_size += 8;
+        dims_length += 8;
+
+        dim = get_value_for_dim (fd, &d->global_dimension);
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &dim, 8);
+        total_size += 8;
+        dims_length += 8;
+
+        dim = get_value_for_dim (fd, &d->local_offset);
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &dim, 8);
+        total_size += 8;
+        dims_length += 8;
+
+        d = d->next;
+    }
+
+    buffer_write (&fd->buffer, &fd->buffer_size, &count_offset, &dims_count, 1);
+    buffer_write (&fd->buffer, &fd->buffer_size, &count_offset, &dims_length, 2);
+
+    return total_size;
+}
+
+uint16_t adios_write_var_characteristics_v1 (struct adios_file_struct * fd
+                                            ,struct adios_var_struct * v
+                                            )
+{
+    uint8_t flag;
+    uint64_t size;
+    uint16_t len;
+    uint8_t characteristic_set_count = 0;
+    uint32_t characteristic_set_length = 0;
+    uint64_t index_size = 0;
+
+    uint64_t characteristic_set_start = fd->offset;
+    fd->offset += 1 + 4; // save space for characteristic count/len
+    index_size += 1 + 4;
+
+    // depending on if it is an array or not, generate a different
+    // additional set of characteristics
+    size = adios_get_type_size (v->type, v->data);
+
+    switch (v->type)
+    {
+        case adios_byte:
+        case adios_unsigned_byte:
+        case adios_short:
+        case adios_unsigned_short:
+        case adios_integer:
+        case adios_unsigned_integer:
+        case adios_long:
+        case adios_unsigned_long:
+        case adios_real:
+        case adios_double:
+        case adios_long_double:
+        case adios_complex:
+        case adios_double_complex:
+            if (v->dimensions)
+            {
+                // add a dimensions characteristic
+                characteristic_set_count++;
+                flag = (uint8_t) adios_characteristic_dimensions;
+                buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                             ,&flag, 1
+                             );
+                index_size += 1;
+                characteristic_set_length += 1;
+
+                len = adios_write_var_characteristics_dims_v1 (fd, v);
+                index_size += len;
+                characteristic_set_length += len;
+
+                // add the bitmap of characteristics
+                characteristic_set_count++;
+                flag = (uint8_t) adios_characteristic_bitmap;
+                buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                             ,&flag, 1
+                             );
+                index_size += 1;
+                characteristic_set_length += 1;
+
+                buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                             ,&v->bitmap, 4
+                             );
+                index_size += 4;
+                characteristic_set_length += 4;
+
+                // add a stat value characteristic
+                characteristic_set_count++;
+                flag = (uint8_t) adios_characteristic_stat;
+                buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                             ,&flag, 1
+                             );
+                index_size += 1;
+                characteristic_set_length += 1;
+
+                uint8_t j, c;
+                uint8_t count = adios_get_stat_set_count(v->type);
+                uint8_t idx = 0;
+                uint64_t characteristic_size;
+
+                for (c = 0; c < count; c ++)
+                {
+                    j = idx = 0;
+                    while (v->bitmap >> j)
+                    {
+                        if ((v->bitmap >> j) & 1)
+                        {
+                            if (j == adios_statistic_hist)
+                            {
+                                struct adios_hist_struct * hist = v->stats[c][idx].data;
+                                int32_t num_breaks = hist->num_breaks;
+                                // Adding number of bins
+                                buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                                             ,&hist->num_breaks, 4
+                                             );
+                                characteristic_size = 4;
+
+                                 // Adding min bin
+                                buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                                            ,&hist->min, 8
+                                             );
+                                characteristic_size += 8;
+
+                                 // Adding max bin
+                                buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                                             ,&hist->max, 8
+                                             );
+                                characteristic_size += 8;
+
+                                // add a frequencies value characteristic
+                                buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                                             ,hist->frequencies, 4 * (num_breaks + 1)
+                                             );
+                                characteristic_size += 4 * (num_breaks + 1);
+
+                                // add the breaks value characteristic
+                                buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                                             ,hist->breaks, 8 * num_breaks
+                                             );
+                                characteristic_size += 8 * num_breaks;
+                            }
+                            else
+                            {
+                                characteristic_size = adios_get_stat_size(v->stats[c][idx].data, v->type, j);
+
+                                buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                                         ,v->stats[c][idx].data, characteristic_size
+                                         );
+                            }
+
+                            index_size += characteristic_size;
+                            characteristic_set_length += characteristic_size;
+                            idx ++;
+                        }
+                        j ++;
+                    }
+                }
+            }
+            break;
+
+        case adios_string:
+            break;
+    }
+    // characteristics count/size prefix
+    buffer_write (&fd->buffer, &fd->buffer_size, &characteristic_set_start
+                 ,&characteristic_set_count, 1
+                 );
+    buffer_write (&fd->buffer, &fd->buffer_size, &characteristic_set_start
+                 ,&characteristic_set_length, 4
+                 );
+
+
+    return index_size;
+}
+
+int adios_generate_var_characteristics_v1 (struct adios_file_struct * fd
+                                    ,struct adios_var_struct * var
+                                    )
+{
+    uint64_t total_size = adios_get_var_size (var, fd->group, var->data);
+    uint64_t size = 0;
+
+    if (var->bitmap == 0)
+        return ;
+
+    int32_t map[32];
+    memset (map, -1, sizeof(map));
+
+#if 1
+#define HIST(a) \
+{ \
+int j = 0, low, high, mid; \
+low=0; \
+high=hist->num_breaks - 1; \
+if (hist->breaks[low] > a) \
+    hist->frequencies[0] += 1; \
+else if (a >= hist->breaks[high]) \
+    hist->frequencies[high + 1] += 1; \
+else if (hist->breaks[low] <= a && a < hist->breaks[high]) \
+{ \
+    while(high-low>=2) \
+    { \
+        mid=(high+low)/2; \
+        if(a >= hist->breaks[mid]) \
+        { \
+            low=mid; \
+        } \
+        else \
+        { \
+            high=mid; \
+        } \
+    } \
+    hist->frequencies[low + 1] += 1; \
+} \
+}
+#endif
+
+#if 1
+#define ADIOS_STATISTICS(a,b) \
+{\
+a * data = (a *) var->data; \
+int i, j; \
+struct adios_stat_struct * stats = var->stats[0]; \
+a * min, * max; \
+double * sum, * sum_square; \
+uint32_t * cnt; \
+struct adios_hist_struct * hist = 0; \
+i = j = 0; \
+while (var->bitmap >> j) { \
+    if ((var->bitmap >> j) & 1)	{\
+        map [j] = i; \
+        if (j == adios_statistic_hist) \
+            ;\
+        else \
+            stats[i].data = malloc(adios_get_stat_size(NULL, var->type, j)); \
+        i ++; \
+    } \
+    j ++; \
+} \
+min = (a *) stats[map[adios_statistic_min]].data; \
+max = (a *) stats[map[adios_statistic_max]].data; \
+sum = (double *) stats[map[adios_statistic_sum]].data; \
+sum_square = (double *) stats[map[adios_statistic_sum_square]].data; \
+cnt = (uint32_t *) stats[map[adios_statistic_cnt]].data; \
+*cnt = 0;\
+if (map[adios_statistic_hist] != -1) {\
+    hist = (struct adios_hist_struct *) stats[map[adios_statistic_hist]].data; \
+    hist->frequencies = calloc ((hist->num_breaks + 1), adios_get_type_size(adios_unsigned_integer, "")); \
+} \
+int finite = 0; \
+size = 0; \
+while ((size * b) < total_size) \
+{ \
+    if (isnan (data [size]) || !isfinite (data [size])) {\
+        size ++; \
+        continue; \
+    }\
+    if (!finite) { \
+        *min = data [size]; \
+        *max = data [size]; \
+        *sum = data [size]; \
+        *sum_square = (data [size] * data [size]) ; \
+        *cnt = *cnt + 1; \
+        if (map[adios_statistic_hist] != -1) \
+            HIST(data [size]); \
+        finite = 1; \
+        size ++; \
+        continue; \
+    } \
+    if (data [size] < *min) \
+        *min = data [size]; \
+    if (data [size] > *max) \
+        *max = data [size]; \
+    *sum += data [size]; \
+    *sum_square += (data [size] * data [size]) ; \
+    *cnt = *cnt + 1; \
+    if (map[adios_statistic_hist] != -1) \
+        HIST(data [size]); \
+       size++; \
+} \
+if (map[adios_statistic_finite] != -1) \
+    * ((uint8_t * ) stats[map[adios_statistic_finite]].data) = finite; \
+return 0; \
+}
+#else
+#define MIN_MAX(a,b)\
+{\
+a * data = (a *) var->data; \
+var->min = malloc (b); \
+var->max = malloc (b); \
+a * min = (a *) var->min; \
+a * max = (a *) var->max; \
+*min = data [0]; \
+*max = data [0]; \
+return 0; \
+}
+#endif
+
+    switch (var->type)
+    {
+        case adios_byte:
+            ADIOS_STATISTICS(int8_t,1)
+
+        case adios_unsigned_byte:
+            ADIOS_STATISTICS(uint8_t,1)
+
+        case adios_short:
+            ADIOS_STATISTICS(int16_t,2)
+
+        case adios_unsigned_short:
+            ADIOS_STATISTICS(uint16_t,2)
+
+        case adios_integer:
+            ADIOS_STATISTICS(int32_t,4)
+
+        case adios_unsigned_integer:
+            ADIOS_STATISTICS(uint32_t,4)
+
+        case adios_long:
+            ADIOS_STATISTICS(int64_t,8)
+
+        case adios_unsigned_long:
+            ADIOS_STATISTICS(uint64_t,8)
+
+        case adios_real:
+            ADIOS_STATISTICS(float,4)
+
+        case adios_double:
+            ADIOS_STATISTICS(double,8)
+
+        case adios_long_double:
+            ADIOS_STATISTICS(long double,16)
+
+        case adios_complex:
+        {
+            int i, j, c, count = 3;
+            struct adios_stat_struct ** stats = var->stats;
+            float * data = var->data;
+            i = j = 0;
+
+            while (var->bitmap >> j) {
+                if ((var->bitmap >> j) & 1)	{
+                    map [j] = i;
+                    for (c = 0; c < count; c ++)
+                        if (j != adios_statistic_hist)
+                            stats[c][i].data = malloc(adios_get_stat_size(NULL, var->type, j));
+                    i ++;
+                }
+                j ++;
+            }
+
+            double *min_i, *min_r, *min_m;
+            double *max_i, *max_r, *max_m;
+            double *sum_i, *sum_r, *sum_m;
+            double *sum_square_i, *sum_square_r, *sum_square_m;
+            //struct adios_hist_struct *hist, *hist_i, *hist_r, *hist_m;
+            uint32_t *cnt_i, *cnt_r, *cnt_m;
+            double magnitude;
+            uint8_t finite = 0;
+
+            min_m = (double *) stats[0][map[adios_statistic_min]].data;
+            min_r = (double *) stats[1][map[adios_statistic_min]].data;
+            min_i = (double *) stats[2][map[adios_statistic_min]].data;
+
+            max_m = (double *) stats[0][map[adios_statistic_max]].data;
+            max_r = (double *) stats[1][map[adios_statistic_max]].data;
+            max_i = (double *) stats[2][map[adios_statistic_max]].data;
+
+            sum_m = (double *) stats[0][map[adios_statistic_sum]].data;
+            sum_r = (double *) stats[1][map[adios_statistic_sum]].data;
+            sum_i = (double *) stats[2][map[adios_statistic_sum]].data;
+
+            sum_square_m = (double *) stats[0][map[adios_statistic_sum_square]].data;
+            sum_square_r = (double *) stats[1][map[adios_statistic_sum_square]].data;
+            sum_square_i = (double *) stats[2][map[adios_statistic_sum_square]].data;
+
+            cnt_m = (uint32_t *) stats[0][map[adios_statistic_cnt]].data;
+            cnt_r = (uint32_t *) stats[1][map[adios_statistic_cnt]].data;
+            cnt_i = (uint32_t *) stats[2][map[adios_statistic_cnt]].data;
+
+            // Histogram is not available for complex numbers, yet.
+            /*
+            if (map[adios_statistic_hist] != -1) {
+                hist_r = (struct adios_hist_struct *) stat[0][map[adios_statistic_hist]].data;
+                hist_i = (struct adios_hist_struct *) stat[1][map[adios_statistic_hist]].data;
+                hist_m = (struct adios_hist_struct *) stat[2][map[adios_statistic_hist]].data;
+
+                hist_r->frequencies = calloc ((hist->num_breaks + 1), adios_get_type_size(adios_unsigned_integer, ""));
+                hist_i->frequencies = calloc ((hist->num_breaks + 1), adios_get_type_size(adios_unsigned_integer, ""));
+                hist_m->frequencies = calloc ((hist->num_breaks + 1), adios_get_type_size(adios_unsigned_integer, ""));
+            }
+            */
+
+            *cnt_r = *cnt_i = *cnt_m = 0;
+            *min_r = *min_i = *min_m = INFINITY;
+            *max_r = *max_i = *max_m = -INFINITY;
+            *sum_r = *sum_i = *sum_m = 0;
+            *sum_square_r = *sum_square_i = *sum_square_m = 0;
+
+            while ((size * sizeof(float)) < total_size) {
+
+                magnitude = sqrt((double) data [size] * data [size] + (double) data[size + 1] * data[size + 1]);
+
+                // Both real and imaginary parts have to be finite, else skip calculating the characteristic
+                if ( isnan(data [size]) || !isfinite(data [size]) || isnan(data[size + 1]) || !isfinite(data[size + 1]) ) {
+                    size += 2;
+                    continue;
+                }
+
+                finite = 1;
+
+                // Updating the characteristic values
+                if (data [size] < *min_r)
+                    *min_r = data [size];
+                if (data [size + 1] < *min_i)
+                    *min_i = data [size + 1];
+                if (magnitude < *min_m)
+                    *min_m = magnitude;
+
+                if (data [size] > *max_r)
+                    *max_r = data [size];
+                if (data [size + 1] > *max_i)
+                    *max_i = data [size + 1];
+                if (magnitude > *max_m)
+                    *max_m = magnitude;
+
+                *sum_r += data [size];
+                *sum_i += data [size + 1];
+                *sum_m += magnitude;
+
+                *sum_square_r += (double) data [size] * data [size];
+                *sum_square_i += (double) data [size + 1] * data [size + 1];
+                *sum_square_m += magnitude * magnitude;
+
+                *cnt_r = *cnt_r + 1;
+                *cnt_i = *cnt_i + 1;
+                *cnt_m = *cnt_m + 1;
+                // Histogram not available yet
+                /*
+                if (map[adios_statistic_hist] != -1)
+                {
+                    hist = hist_r;
+                    HIST (data[size]);
+
+                    hist = hist_i;
+                    HIST (data[size + 1]);
+
+                    hist = hist_m;
+                    HIST (magnitude);
+                }
+                */
+
+                   size += 2;
+            }
+
+            if (map[adios_statistic_finite] != -1)
+                for (c = 0; c < count; c ++)
+                    * ((uint8_t * ) stats[c][map[adios_statistic_finite]].data) = finite;
+
+            return 0;
+        }
+
+        case adios_double_complex:
+        {
+            int i, j, c, count = 3;
+            struct adios_stat_struct ** stats = var->stats;
+            double * data = var->data;
+            i = j = 0;
+
+            while (var->bitmap >> j) {
+                if ((var->bitmap >> j) & 1)	{
+                    map [j] = i;
+                    for (c = 0; c < count; c ++)
+                        if (j != adios_statistic_hist)
+                            stats[c][i].data = malloc(adios_get_stat_size(NULL, var->type, j));
+                    i ++;
+                }
+                j ++;
+            }
+
+            long double *min_i, *min_r, *min_m;
+            long double *max_i, *max_r, *max_m;
+            long double *sum_i, *sum_r, *sum_m;
+            long double *sum_square_i, *sum_square_r, *sum_square_m;
+            //struct adios_hist_struct *hist, *hist_i, *hist_r, *hist_m;
+            uint32_t *cnt_i, *cnt_r, *cnt_m;
+            long double magnitude;
+            uint8_t finite = 0;
+
+            min_m = (long double *) stats[0][map[adios_statistic_min]].data;
+            min_r = (long double *) stats[1][map[adios_statistic_min]].data;
+            min_i = (long double *) stats[2][map[adios_statistic_min]].data;
+
+            max_m = (long double *) stats[0][map[adios_statistic_max]].data;
+            max_r = (long double *) stats[1][map[adios_statistic_max]].data;
+            max_i = (long double *) stats[2][map[adios_statistic_max]].data;
+
+            sum_m = (long double *) stats[0][map[adios_statistic_sum]].data;
+            sum_r = (long double *) stats[1][map[adios_statistic_sum]].data;
+            sum_i = (long double *) stats[2][map[adios_statistic_sum]].data;
+
+            sum_square_m = (long double *) stats[0][map[adios_statistic_sum_square]].data;
+            sum_square_r = (long double *) stats[1][map[adios_statistic_sum_square]].data;
+            sum_square_i = (long double *) stats[2][map[adios_statistic_sum_square]].data;
+
+
+            // Histogram not available for complex numbers yet
+            /*
+            if (map[adios_statistic_hist] != -1) {
+                hist_r = (struct adios_hist_struct *) stat[0][map[adios_statistic_hist]].data;
+                hist_i = (struct adios_hist_struct *) stat[1][map[adios_statistic_hist]].data;
+                hist_m = (struct adios_hist_struct *) stat[2][map[adios_statistic_hist]].data;
+
+                hist_r->frequencies = calloc ((hist->num_breaks + 1), adios_get_type_size(adios_unsigned_integer, ""));
+                hist_i->frequencies = calloc ((hist->num_breaks + 1), adios_get_type_size(adios_unsigned_integer, ""));
+                hist_m->frequencies = calloc ((hist->num_breaks + 1), adios_get_type_size(adios_unsigned_integer, ""));
+            }
+            */
+
+            cnt_m = (uint32_t *) stats[0][map[adios_statistic_cnt]].data;
+            cnt_r = (uint32_t *) stats[1][map[adios_statistic_cnt]].data;
+            cnt_i = (uint32_t *) stats[2][map[adios_statistic_cnt]].data;
+
+            *cnt_r = *cnt_i = *cnt_m = 0;
+            *min_r = *min_i = *min_m = INFINITY;
+            *max_r = *max_i = *max_m = -INFINITY;
+            *sum_r = *sum_i = *sum_m = 0;
+            *sum_square_r = *sum_square_i = *sum_square_m = 0;
+
+            while ((size * sizeof(double)) < total_size)
+            {
+                long double magnitude = sqrt((long double) data [size] * data [size] + (long double) data[size + 1] * data[size + 1]);
+
+                // Both real and imaginary parts have to be finite, else skip calculating the characteristic
+                if ( isnan(data [size]) || !isfinite(data [size]) || isnan(data[size + 1]) || !isfinite(data[size + 1]) ) {
+                    size += 2;
+                    continue;
+                }
+
+                finite = 1;
+
+                if (data [size] < *min_r)
+                    *min_r = data [size];
+                if (data [size + 1] < *min_i)
+                    *min_i = data [size + 1];
+                if (magnitude < *min_m)
+                    *min_m = magnitude;
+
+                if (data [size] > *max_r)
+                    *max_r = data [size];
+                if (data [size + 1] > *max_i)
+                    *max_i = data [size + 1];
+                if (magnitude > *max_m)
+                    *max_m = magnitude;
+
+                *sum_r += data [size];
+                *sum_i += data [size + 1];
+                *sum_m += magnitude;
+
+                *sum_square_r += (long double) data [size] * data [size];
+                *sum_square_i += (long double) data [size + 1] * data [size + 1];
+                *sum_square_m += magnitude * magnitude;
+
+                // Histgram has not available for complex yet
+                /*
+                if (map[adios_statistic_hist] != -1)
+                {
+                    hist = hist_r;
+                    HIST (data[size]);
+
+                    hist = hist_i;
+                    HIST (data[size + 1]);
+
+                    hist = hist_m;
+                    HIST (magnitude);
+                }
+                */
+
+                *cnt_r = *cnt_r + 1;
+                *cnt_i = *cnt_i + 1;
+                *cnt_m = *cnt_m + 1;
+
+                   size += 2;
+            }
+
+            if (map[adios_statistic_finite] != -1)
+                for (c = 0; c < count; c ++)
+                    * ((uint8_t * ) stats[c][map[adios_statistic_finite]].data) = finite;
+
+            return 0;
+        }
+
+        case adios_string:
+        {
+            var->stats = 0;
+
+            return 0;
+        }
+
+        default:
+        {
+            uint64_t data = adios_unknown;
+            var->stats = 0;
+
+            return 0;
+        }
+    }
+}
+
+// data is only there for sizing
+uint64_t adios_write_var_header_v1 (struct adios_file_struct * fd
+                                   ,struct adios_var_struct * v
+                                   )
+{
+    uint64_t total_size = 0;
+    uint8_t flag;
+    uint16_t len;
+
+    uint64_t start = fd->offset;  // save to write the size
+    v->write_offset = fd->offset + fd->base_offset; // save offset in file
+    fd->offset += 8;              // save space for the size
+    total_size += 8;              // makes final parsing easier
+
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &v->id, 2);
+    total_size += 2;
+
+    len = strlen (v->name);
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &len, 2);
+    total_size += 2;
+
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, v->name, len);
+    total_size += len;
+
+    len = strlen (v->path);
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &len, 2);
+    total_size += 2;
+
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, v->path, len);
+    total_size += len;
+
+    flag = v->type;
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &flag, 1);
+    total_size += 1;
+
+    flag = (v->is_dim == adios_flag_yes ? 'y' : 'n');
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &flag, 1);
+    total_size += 1;
+
+    total_size += adios_write_dimensions_v1 (fd, v->dimensions);
+
+    adios_generate_var_characteristics_v1 (fd, v);
+    total_size += adios_write_var_characteristics_v1 (fd, v);
+
+    total_size += adios_get_var_size (v, fd->group, v->data); // payload
+
+    buffer_write (&fd->buffer, &fd->buffer_size, &start, &total_size, 8);
+
+    fd->vars_written++;
+
+    if (fd->bytes_written < fd->offset)
+        fd->bytes_written = fd->offset;
+
+    return total_size;
+}
+
+int adios_write_var_payload_v1 (struct adios_file_struct * fd
+                               ,struct adios_var_struct * var
+                               )
+{
+    uint64_t size;
+
+    // write payload
+    size = adios_get_var_size (var, fd->group, var->data);
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, var->data, size);
+
+    if (fd->bytes_written < fd->offset)
+        fd->bytes_written = fd->offset;
+
+    return 0;
+}
+
+int adios_write_attribute_v1 (struct adios_file_struct * fd
+                             ,struct adios_attribute_struct * a
+                             )
+{
+    uint64_t start;        // save the start to write the size
+    uint32_t size = 0;
+    uint16_t len = 0;
+    uint8_t flag = 0;
+
+    // save space for attr length
+    start = fd->offset;
+    a->write_offset = fd->offset + fd->base_offset; // save offset in file
+    fd->offset += 4;
+
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &a->id, 2);
+    size += 2;
+
+    len = strlen (a->name);
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &len, 2);
+    size += 2;
+
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, a->name, len);
+    size += len;
+
+    len = strlen (a->path);
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &len, 2);
+    size += 2;
+
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, a->path, len);
+    size += len;
+
+    flag = (a->var ? 'y' : 'n');
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &flag, 1);
+    size += 1;
+
+    if (a->var)
+    {
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                     ,&a->var->id, 2
+                     );
+        size += 2;
+    }
+    else
+    {
+        flag = a->type;
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &flag, 1);
+        size += 1;
+
+        uint32_t t = adios_get_type_size (a->type, a->value);
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &t, 4);
+        size += 4;
+
+        buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset
+                     ,a->value, t
+                     );
+        size += t;
+    }
+
+    // put in the size we have put in for this attribute
+    buffer_write (&fd->buffer, &fd->buffer_size, &start, &size, 4);
+
+    fd->vars_written++;
+
+    if (fd->bytes_written < fd->offset)
+        fd->bytes_written = fd->offset;
+
+    return 0;
+}
+
+int adios_write_open_vars_v1 (struct adios_file_struct * fd)
+{
+    fd->vars_written = 0;
+
+    // it is now setup to write the vars and then the attrs on close
+    fd->vars_start = fd->offset;
+
+    fd->offset += (2 + 8); // (count + size)
+
+    if (fd->bytes_written < fd->offset)
+        fd->bytes_written = fd->offset;
+
+    return 0;
+}
+
+int adios_write_close_vars_v1 (struct adios_file_struct * fd)
+{
+    // close the var area (count and total size) and write the attributes
+    uint64_t size = fd->offset - fd->vars_start;
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->vars_start, &fd->vars_written, 2);
+
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->vars_start, &size, 8);
+
+    return 0;
+}
+
+int adios_write_open_attributes_v1 (struct adios_file_struct * fd)
+{
+    fd->vars_start = fd->offset;   // save the start of attr area for size
+    fd->offset += (2 + 8);         // space to write the count and size
+    fd->vars_written = 0;
+
+    if (fd->bytes_written < fd->offset)
+        fd->bytes_written = fd->offset;
+
+    return 0;
+}
+
+int adios_write_close_attributes_v1 (struct adios_file_struct * fd)
+{
+    // write attribute count and total size
+    uint64_t size = fd->offset - fd->vars_start;
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->vars_start, &fd->vars_written, 2);
+
+    buffer_write (&fd->buffer, &fd->buffer_size, &fd->vars_start, &size, 8);
+
+    return 0;
+}
+
+// *****************************************************************************
+
+static int adios_multiply_dimensions (uint64_t * size
+                                     ,struct adios_var_struct * var
+                                     ,enum ADIOS_DATATYPES type
+                                     ,void * data
+                                     )
+{
+    switch (type)
+    {
+        case adios_unsigned_byte:
+            *size *= (*(uint8_t *) data);
+            return 1;
+
+        case adios_byte:
+            *size *= (*(int8_t *) data);
+            return 1;
+
+        case adios_unsigned_short:
+            *size *= (*(uint16_t *) data);
+            return 1;
+
+        case adios_short:
+            *size *= (*(int16_t *) data);
+            return 1;
+
+        case adios_unsigned_integer:
+            *size *= (*(uint32_t *) data);
+            return 1;
+
+        case adios_integer:
+            *size *= (*(int32_t *) data);
+            return 1;
+
+        case adios_unsigned_long:
+            *size *= (*(uint64_t *) data);
+            return 1;
+
+        case adios_long:
+            *size *= (*(int64_t *) data);
+            return 1;
+
+        default:
+            fprintf (stderr, "Invalid datatype for array dimension on "
+                             "var %s: %s\n"
+                    ,var->name
+                    ,adios_type_to_string_int (type)
+                    );
+
+            return 0;
+    }
+}
+
+uint64_t adios_get_var_size (struct adios_var_struct * var
+                            ,struct adios_group_struct * group, void * data
+                            )
+{
+    uint64_t size = 0;
+
+    size = adios_get_type_size (var->type, data);
+
+    if (var->dimensions)
+    {
+        struct adios_dimension_struct * d = var->dimensions;
+
+        while (d)
+        {
+            // calculate the size for this dimension element
+            if (d->dimension.id != 0)
+            {
+                struct adios_var_struct * dim_var = 0;
+
+                dim_var = adios_find_var_by_id (group->vars, d->dimension.id);
+
+                // first check to make sure all vars are provided
+                if (!dim_var)
+                {
+                    struct adios_attribute_struct * attr = 0;
+                    attr = adios_find_attribute_by_id (group->attributes
+                                                      ,d->dimension.id
+                                                      );
+                    if (attr)
+                    {
+                        if (attr->var)
+                        {
+                            if (!attr->var->data)
+                            {
+                                fprintf (stderr, "adios_get_var_size: "
+                                                 "sizing of %s failed because "
+                                                 "dimension component %s was "
+                                                 "not provided\n"
+                                        ,var->name, attr->var->name
+                                        );
+
+                                return 0;
+                            }
+                            else
+                            {
+                                if (!adios_multiply_dimensions (&size, var
+                                                               ,attr->var->type
+                                                               ,attr->var->data
+                                                               )
+                                   )
+                                {
+                                    return 0;
+                                }
+                            }
+                        }
+                        else
+                        {
+                            if (!adios_multiply_dimensions (&size, var
+                                                           ,attr->type
+                                                           ,attr->value
+                                                           )
+                               )
+                            {
+                                return 0;
+                            }
+                        }
+                    }
+                    else
+                    {
+                        fprintf (stderr, "adios_get_var_size: "
+                                         "sizing of %s failed because "
+                                         "dimension component was not "
+                                         "provided\n"
+                                ,var->name
+                                );
+
+                        return 0;
+                    }
+                }
+                else
+                {
+                    if (!dim_var->data)
+                    {
+                        fprintf (stderr, "adios_get_var_size: "
+                                         "sizing of %s failed because "
+                                         "dimension component %s was not "
+                                         "provided\n"
+                                ,var->name, dim_var->name
+                                );
+
+                        return 0;
+                    }
+                    else
+                    {
+                        if (!adios_multiply_dimensions (&size, var
+                                                       ,dim_var->type
+                                                       ,dim_var->data
+                                                       )
+                           )
+                        {
+                            return 0;
+                        }
+                    }
+                }
+            }
+            else
+            {
+                if (d->dimension.time_index == adios_flag_no)
+                {
+                    size *= d->dimension.rank;
+                }
+                // the time index doesn't take up space...
+            }
+
+            d = d->next;
+        }
+    }
+
+    return size;
+}
+
+const char * adios_type_to_string_int (int type)
+{
+    switch (type)
+    {
+        case adios_unsigned_byte:    return "unsigned byte";
+        case adios_unsigned_short:   return "unsigned short";
+        case adios_unsigned_integer: return "unsigned integer";
+        case adios_unsigned_long:    return "unsigned long long";
+
+        case adios_byte:             return "byte";
+        case adios_short:            return "short";
+        case adios_integer:          return "integer";
+        case adios_long:             return "long long";
+
+        case adios_real:             return "real";
+        case adios_double:           return "double";
+        case adios_long_double:      return "long double";
+
+        case adios_string:           return "string";
+        case adios_complex:          return "complex";
+        case adios_double_complex:   return "double complex";
+
+        default:
+        {
+            static char buf [50];
+            sprintf (buf, "(unknown: %d)", type);
+            return buf;
+        }
+    }
+}
+
+const char * adios_file_mode_to_string (int mode)
+{
+    static char buf [50];
+
+    switch (mode)
+    {
+        case adios_mode_write:  return "write";
+        case adios_mode_read:   return "read";
+        case adios_mode_update: return "update";
+        case adios_mode_append: return "append";
+
+        default:
+            sprintf (buf, "(unknown: %d)", mode);
+    }
+
+    return buf;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// Queue management code intended for adaptive API use
+//////////////////////////////////////////////////////////////////////////////
+void list_init (List * list, void (* destroy) (void * data))
+{
+    list->size = 0;
+    list->destroy = destroy;
+    list->head = NULL;
+    list->tail = NULL;
+
+    return;
+}
+
+void list_destroy (List * list)
+{
+    void * data;
+
+    while (list_size (list) > 0)
+    {
+        if (list_rem_next (list, NULL, (void **) &data) == 0 && list->destroy != NULL)
+        {
+            list->destroy (data);
+        }
+    }
+
+    memset (list, 0, sizeof (List));
+
+    return;
+}
+
+int list_ins_next (List * list, ListElmt * element, const void * data)
+{
+    ListElmt * new_element;
+
+    if ((new_element = (ListElmt *) malloc (sizeof (ListElmt))) == NULL)
+        return -1;
+
+    new_element->data = (void *) data;
+
+    if (element == NULL)
+    {
+        if  (list_size (list) == 0)
+            list->tail = new_element;
+
+        new_element->next = list->head;
+        list->head = new_element;
+    }
+    else
+    {
+        if (element->next == NULL)
+            list->tail = new_element;
+
+        new_element->next = element->next;
+        element->next = new_element;
+    }
+
+    list->size++;
+
+    return 0;
+}
+
+int list_rem_next (List * list, ListElmt * element, void ** data)
+{
+    ListElmt * old_element;
+
+    if (list_size (list) == 0)
+        return -1;
+
+    if (element == NULL)
+    {
+        *data = list->head->data;
+        old_element = list->head;
+        list->head = list->head->next;
+
+        if (list_size (list) == 1)
+            list->tail = NULL;
+    }
+    else
+    {
+        if (element->next == NULL)
+            return -1;
+
+        *data = element->next->data;
+        old_element = element->next;
+        element->next = element->next->next;
+
+        if (element->next == NULL)
+            list->tail = element;
+    }
+
+    free (old_element);
+
+    list->size--;
+
+    return 0;
+}
+
+int queue_enqueue (Queue * queue, const void * data)
+{
+    return list_ins_next (queue, list_tail (queue), data);
+}
+
+int queue_dequeue (Queue * queue, void ** data)
+{
+    return list_rem_next (queue, NULL, data);
+}
diff --git a/src/adios_internals.h b/src/adios_internals.h
new file mode 100644
index 0000000..ebdadd0
--- /dev/null
+++ b/src/adios_internals.h
@@ -0,0 +1,561 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#ifndef ADIOS_INTERNALS_H
+#define ADIOS_INTERNALS_H
+
+#include <stdint.h>
+#include <stdlib.h>
+
+// need the enum for the transports
+#include "adios_transport_hooks.h"
+#include "adios_bp_v1.h"
+
+enum ADIOS_METHOD_MODE {adios_mode_write  = 1
+                       ,adios_mode_read   = 2
+                       ,adios_mode_update = 3 // not supported yet
+                       ,adios_mode_append = 4
+                       };
+
+struct adios_dimension_struct;
+struct adios_var_struct;
+
+// NCSU - Generic data for statistics
+struct adios_stat_struct 
+{
+	void * data;
+};
+
+
+struct adios_var_struct
+{
+    uint16_t id;
+    uint16_t parent_id;
+
+    char * name;
+    char * path;
+    enum ADIOS_DATATYPES type;
+    struct adios_dimension_struct * dimensions;
+    enum ADIOS_FLAG got_buffer;
+    enum ADIOS_FLAG is_dim;   // if it is a dimension, we need to
+                              // track for netCDF usage
+    uint64_t write_offset;  // offset this var was written at  [for writes]
+
+    enum ADIOS_FLAG free_data;    // primarily used for writing
+    void * data;                  // primarily used for reading
+    uint64_t data_size;           // primarily used for reading
+
+	// NCSU - Adding stat related variables
+	struct adios_stat_struct ** stats; // 2D array. Complex numbers can contain upto 3 parts
+	uint32_t bitmap;
+
+    struct adios_var_struct * next;
+};
+
+// NCSU - structure for histogram
+struct adios_hist_struct
+{   
+    double min; //minimum value of histogram ** for when we use complex variables
+    double max; //maximum value of histogram
+    uint32_t num_breaks; //number of break points for the histogram
+    uint32_t * frequencies; //array of frequencies for the histogram
+    double * breaks; //breaks array for the histogram, output this to gnuplot
+};
+
+struct adios_attribute_struct
+{
+    uint16_t id;
+    char * name;
+    char * path;
+    enum ADIOS_DATATYPES type;
+    void * value;
+    struct adios_var_struct * var;
+    uint64_t write_offset;  // offset this var was written at  [for writes]
+
+    struct adios_attribute_struct * next;
+};
+
+struct adios_method_struct
+{
+    enum ADIOS_IO_METHOD m;
+    char * base_path;
+    char * method;
+    void * method_data;
+    char * parameters;
+    int iterations;
+    int priority;
+    struct adios_group_struct * group;
+};
+
+struct adios_method_list_struct
+{
+    struct adios_method_struct * method;
+    struct adios_method_list_struct * next;
+};
+
+enum ADIOS_MESH_TYPE
+{
+     ADIOS_MESH_UNIFORM      = 1
+    ,ADIOS_MESH_STRUCTURED   = 2
+    ,ADIOS_MESH_RECTILINEAR  = 3
+    ,ADIOS_MESH_UNSTRUCTURED = 4
+};
+
+struct adios_mesh_uniform_struct;
+struct adios_mesh_rectilinear_struct;
+struct adios_mesh_structured_struct;
+struct adios_mesh_unstructured_struct;
+
+struct adios_mesh_struct
+{
+    enum ADIOS_FLAG time_varying;
+    enum ADIOS_MESH_TYPE type;
+    union 
+    {
+        struct adios_mesh_uniform_struct * uniform;
+        struct adios_mesh_rectilinear_struct * rectilinear;
+        struct adios_mesh_structured_struct * structured;
+        struct adios_mesh_unstructured_struct * unstructured;
+    };
+};
+
+struct adios_group_struct
+{
+    uint16_t id;
+    uint16_t member_count;
+    uint64_t group_offset;
+
+    char * name;
+    int var_count;
+    enum ADIOS_FLAG adios_host_language_fortran;
+    enum ADIOS_FLAG all_unique_var_names;
+    struct adios_var_struct * vars;
+    struct adios_var_struct * vars_written;
+    struct adios_attribute_struct * attributes;
+    char * group_comm;
+    char * group_by;
+    char * time_index_name;
+    uint32_t time_index;
+    uint32_t process_id;
+
+    struct adios_method_list_struct * methods;
+
+    struct adios_mesh_struct * mesh;
+};
+
+struct adios_group_list_struct
+{
+    struct adios_group_struct * group;
+
+    struct adios_group_list_struct * next;
+};
+
+struct adios_file_struct
+{
+    char * name;
+    char * subfile_name;
+    struct adios_group_struct * group;
+    enum ADIOS_METHOD_MODE mode;
+    uint64_t data_size;
+    uint64_t write_size_bytes;
+
+    enum ADIOS_FLAG shared_buffer;
+
+    uint64_t pg_start_in_file; //  where this pg started in the file
+
+    uint64_t base_offset;   // where writing last ocurred
+
+    char * buffer;          // buffer we use for building the output
+    uint64_t offset;        // current offset to write at
+    uint64_t bytes_written; // largest offset into buffer written to
+    uint64_t buffer_size;   // how big the buffer is currently
+
+    uint64_t vars_start;    // offset for where to put the var/attr count
+    uint16_t vars_written;  // count of vars/attrs to write
+};
+
+struct adios_dimension_item_struct
+{
+    uint64_t rank;
+    uint16_t id;
+    enum ADIOS_FLAG time_index;
+};
+
+struct adios_dimension_struct
+{
+    struct adios_dimension_item_struct dimension;
+    struct adios_dimension_item_struct global_dimension;
+    struct adios_dimension_item_struct local_offset;
+    struct adios_dimension_struct * next;
+};
+
+typedef void (* ADIOS_INIT_FN) (const char * parameters
+                               ,struct adios_method_struct * method
+                               );
+typedef int (* ADIOS_OPEN_FN) (struct adios_file_struct * fd
+                              ,struct adios_method_struct * method, void * comm
+                              );
+typedef enum ADIOS_FLAG (* ADIOS_SHOULD_BUFFER_FN)
+                                       (struct adios_file_struct * fd
+                                       ,struct adios_method_struct * method
+                                       );
+typedef void (* ADIOS_WRITE_FN) (struct adios_file_struct * fd
+                                ,struct adios_var_struct * v
+                                ,void * data
+                                ,struct adios_method_struct * method
+                                );
+typedef void (* ADIOS_GET_WRITE_BUFFER_FN) (struct adios_file_struct * fd
+                                           ,struct adios_var_struct * v
+                                           ,uint64_t * size
+                                           ,void ** buffer
+                                           ,struct adios_method_struct * method
+                                           );
+typedef void (* ADIOS_READ_FN) (struct adios_file_struct * fd
+                               ,struct adios_var_struct * v
+                               ,void * buffer
+                               ,uint64_t buffer_size
+                               ,struct adios_method_struct * method
+                               );
+typedef void (* ADIOS_CLOSE_FN) (struct adios_file_struct * fd
+                                ,struct adios_method_struct * method
+                                );
+typedef void (* ADIOS_FINALIZE_FN) (int mype
+                                   ,struct adios_method_struct * method
+                                   );
+typedef void (* ADIOS_END_ITERATION_FN) (struct adios_method_struct * method);
+typedef void (* ADIOS_START_CALCULATION_FN)
+                                        (struct adios_method_struct * method);
+typedef void (* ADIOS_STOP_CALCULATION_FN)
+                                        (struct adios_method_struct * method);
+
+struct adios_transport_struct
+{
+    ADIOS_INIT_FN adios_init_fn;
+    ADIOS_OPEN_FN adios_open_fn;
+    ADIOS_SHOULD_BUFFER_FN adios_should_buffer_fn;
+    ADIOS_WRITE_FN adios_write_fn;
+    ADIOS_GET_WRITE_BUFFER_FN adios_get_write_buffer_fn;
+    ADIOS_READ_FN adios_read_fn;
+    ADIOS_CLOSE_FN adios_close_fn;
+    ADIOS_FINALIZE_FN adios_finalize_fn;
+    ADIOS_END_ITERATION_FN adios_end_iteration_fn;
+    ADIOS_START_CALCULATION_FN adios_start_calculation_fn;
+    ADIOS_STOP_CALCULATION_FN adios_stop_calculation_fn;
+};
+
+struct adios_buffer_part_entry
+{
+    void * buffer;
+    size_t buffer_size;
+};
+
+struct adios_parse_buffer_struct
+{
+    struct adios_var_struct * vars;
+    enum ADIOS_FLAG all_unique_var_names;
+    uint64_t buffer_len;
+    void * buffer;
+};
+
+////////////////////////
+// mesh support data structures
+////////////////////////
+struct adios_mesh_item_struct
+{
+    double rank;
+    struct adios_var_struct * var;
+};
+
+struct adios_mesh_item_list_struct
+{
+    struct adios_mesh_item_struct item;
+    struct adios_mesh_item_list_struct * next;
+};
+
+struct adios_mesh_var_list_struct
+{
+    struct adios_var_struct * var;
+    struct adios_mesh_var_list_struct * next;
+};
+
+struct adios_mesh_cell_list_struct
+{
+    enum ADIOS_FLAG cells_uniform;
+    struct adios_mesh_item_struct count;
+    struct adios_var_struct * data;
+    struct adios_mesh_item_struct type;
+};
+
+struct adios_mesh_cell_list_list_struct
+{
+    struct adios_mesh_cell_list_struct cell_list;
+    struct adios_mesh_cell_list_list_struct * next;
+};
+
+//////////////////////////////////////////////////////////////
+// Main mesh structs
+//////////////////////////////////////////////////////////////
+struct adios_mesh_uniform_struct
+{
+    struct adios_mesh_item_list_struct * dimensions;
+    struct adios_mesh_item_list_struct * origin;
+    struct adios_mesh_item_list_struct * spacing;
+};
+
+struct adios_mesh_rectilinear_struct
+{
+    enum ADIOS_FLAG coordinates_single_var;
+    struct adios_mesh_item_list_struct * dimensions;
+    struct adios_mesh_var_list_struct * coordinates;
+};
+
+struct adios_mesh_structured_struct
+{
+    enum ADIOS_FLAG points_single_var;
+    struct adios_mesh_item_struct * nspace;
+    struct adios_mesh_item_list_struct * dimensions;
+    struct adios_mesh_var_list_struct * points;
+};
+
+struct adios_mesh_unstructured_struct
+{
+    struct adios_mesh_item_struct * components;
+    struct adios_mesh_item_struct * points_count;
+    struct adios_var_struct * points;
+    struct adios_mesh_cell_list_list_struct * cell_list;
+};
+
+//////////////////////////////////////////////////////////////////////////////
+// Function Delcarations
+//////////////////////////////////////////////////////////////////////////////
+uint64_t adios_size_of_var (struct adios_var_struct * v, void * data);
+uint64_t adios_size_of_attribute (struct adios_attribute_struct * a);
+
+uint64_t adios_data_size (struct adios_group_struct * g);
+
+struct adios_method_list_struct * adios_get_methods (void);
+struct adios_group_list_struct * adios_get_groups (void);
+
+struct adios_var_struct * adios_find_var_by_name (struct adios_var_struct * root
+                                                 ,const char * name
+                                                 ,enum ADIOS_FLAG unique_names
+                                                 );
+struct adios_var_struct * adios_find_var_by_id (struct adios_var_struct * root
+                                               ,uint16_t id
+                                               );
+struct adios_attribute_struct * adios_find_attribute_by_id
+                                         (struct adios_attribute_struct * root
+                                         ,uint16_t id
+                                         );
+
+struct adios_attribute_struct * adios_find_attribute_var_by_name
+                                       (struct adios_attribute_struct * root
+                                       ,const char * name
+                                       );
+
+struct adios_attribute_struct * adios_find_attribute_var_by_id
+                                       (struct adios_attribute_struct * root
+                                       ,uint16_t id
+                                       );
+
+/*void adios_parse_buffer (struct adios_file_struct * fd, char * buffer
+                        ,uint64_t len
+                        );*/
+
+int adios_parse_dimension (const char * dimension
+                          ,const char * global_dimension
+                          ,const char * local_offset
+                          ,struct adios_group_struct * g
+                          ,struct adios_dimension_struct * dim
+                          );
+
+/*void adios_extract_string (char ** out, const char * in, int size);*/
+
+int adios_common_define_attribute (int64_t group, const char * name
+                                  ,const char * path
+                                  ,enum ADIOS_DATATYPES type
+                                  ,const char * value
+                                  ,const char * var
+                                  );
+
+void adios_append_method (struct adios_method_struct * method);
+
+void adios_add_method_to_group (struct adios_method_list_struct ** root
+                               ,struct adios_method_struct * method
+                               );
+
+void adios_append_group (struct adios_group_struct * group);
+
+// is the var name unique
+enum ADIOS_FLAG adios_append_var (struct adios_var_struct ** root
+                                 ,struct adios_var_struct * var
+                                 ,uint16_t id
+                                 );
+
+void adios_append_dimension (struct adios_dimension_struct ** root
+                            ,struct adios_dimension_struct * dimension
+                            );
+
+void adios_append_attribute (struct adios_attribute_struct ** root
+                            ,struct adios_attribute_struct * attribute
+                            ,uint16_t id
+                            );
+
+int adios_common_declare_group (int64_t * id, const char * name
+                               ,enum ADIOS_FLAG host_language_fortran
+                               ,const char * coordination_comm
+                               ,const char * coordination_var
+                               ,const char * time_index
+                               );
+
+int adios_common_define_var (int64_t group_id, const char * name
+                            ,const char * path, enum ADIOS_DATATYPES type
+                            ,const char * dimensions
+                            ,const char * global_dimensions
+                            ,const char * local_offsets
+                            );
+
+int adios_common_define_var_characteristcs  (struct adios_group_struct * g, const char * var_name
+                            				,const char * bin_interval 
+                            				,const char * bin_min
+                            				,const char * bin_max
+                            				,const char * bin_count
+                            				);
+
+void adios_common_get_group (int64_t * group_id, const char * name);
+int adios_common_free_group (int64_t id);
+
+// ADIOS file format functions
+
+uint16_t adios_calc_var_overhead_v1 (struct adios_var_struct * v);
+uint32_t adios_calc_attribute_overhead_v1 (struct adios_attribute_struct * a);
+uint64_t adios_calc_overhead_v1 (struct adios_file_struct * fd);
+
+int adios_write_version_v1 (char ** buffer
+                           ,uint64_t * buffer_size
+                           ,uint64_t * buffer_offset
+                           );
+int adios_write_process_group_header_v1 (struct adios_file_struct * fd
+                                        ,uint64_t total_size
+                                        );
+
+// data is only there for sizing
+uint64_t adios_write_var_header_v1 (struct adios_file_struct * fd
+                                   ,struct adios_var_struct * v
+                                   );
+int adios_generate_var_characteristics_v1 (struct adios_file_struct * fd
+                                          ,struct adios_var_struct * var
+                                          );
+uint16_t adios_write_var_characteristics_v1 (struct adios_file_struct * fd
+                                            ,struct adios_var_struct * var
+                                            );
+int adios_write_var_payload_v1 (struct adios_file_struct * fd
+                               ,struct adios_var_struct * var
+                               );
+int adios_write_attribute_v1 (struct adios_file_struct * fd
+                             ,struct adios_attribute_struct * a
+                             );
+int adios_write_open_vars_v1 (struct adios_file_struct * fd);
+int adios_write_close_vars_v1 (struct adios_file_struct * fd);
+int adios_write_open_attributes_v1 (struct adios_file_struct * fd);
+int adios_write_close_attributes_v1 (struct adios_file_struct * fd);
+int adios_write_index_v1 (char ** buffer
+                         ,uint64_t * buffer_size
+                         ,uint64_t * buffer_offset
+                         ,uint64_t index_start
+                         ,struct adios_index_process_group_struct_v1 * pg_root
+                         ,struct adios_index_var_struct_v1 * vars_root
+                         ,struct adios_index_attribute_struct_v1 * attrs_root
+                         );
+
+void adios_build_index_v1 (struct adios_file_struct * fd
+                       ,struct adios_index_process_group_struct_v1 ** pg_root
+                       ,struct adios_index_var_struct_v1 ** vars_root
+                       ,struct adios_index_attribute_struct_v1 ** attrs_root
+                       );
+void adios_merge_index_v1 (
+                   struct adios_index_process_group_struct_v1 ** main_pg_root
+                  ,struct adios_index_var_struct_v1 ** main_vars_root
+                  ,struct adios_index_attribute_struct_v1 ** main_attrs_root
+                  ,struct adios_index_process_group_struct_v1 * new_pg_root
+                  ,struct adios_index_var_struct_v1 * new_vars_root
+                  ,struct adios_index_attribute_struct_v1 * new_attrs_root
+                  );
+void adios_clear_index_v1 (struct adios_index_process_group_struct_v1 * pg_root
+                          ,struct adios_index_var_struct_v1 * vars_root
+                          ,struct adios_index_attribute_struct_v1 * attrs_root
+                          );
+
+uint64_t adios_get_type_size (enum ADIOS_DATATYPES type, void * var);
+uint64_t adios_get_var_size (struct adios_var_struct * var
+                            ,struct adios_group_struct * group, void * data
+                            );
+
+uint64_t adios_get_stat_size (void * data, enum ADIOS_DATATYPES type, enum ADIOS_STAT stat_id);
+uint8_t adios_get_stat_set_count (enum ADIOS_DATATYPES type);
+
+const char * adios_type_to_string_int (int type);
+const char * adios_file_mode_to_string (int mode);
+
+// the following are defined in adios_transport_hooks.c
+void adios_init_transports (struct adios_transport_struct ** transports);
+int adios_parse_method (const char * buf, enum ADIOS_IO_METHOD * method
+                       ,int * requires_group_comm
+                       );
+
+/* some internal functions that adios_internals.c and adios_internals_mxml.c share */
+int adios_int_is_var (const char * temp); // 1 == yes, 0 == no
+int adios_int_is_num (char * temp); // 1 == yes, 0 == no
+
+// queue code for adaptive message passing
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* LIST */
+typedef struct ListElmt_
+{
+    void             * data;
+    struct ListElmt_ * next;
+} ListElmt;
+
+typedef struct List_
+{
+    volatile int      size;
+    int      (* match) (const void * key1, const void * key2);
+    void     (* destroy) (void * data);
+    ListElmt * head;
+    ListElmt * tail;
+} List;
+
+void list_init (List * list, void (* destroy) (void * data));
+void list_destroy (List * list);
+int list_ins_next (List * list, ListElmt * element, const void * data);
+int list_rem_next (List * list, ListElmt * element, void ** data);
+#define list_size(list) ((list)->size)
+#define list_head(list) ((list)->head)
+#define list_tail(list) ((list)->tail)
+#define list_is_head(list, element) ((element) == (list)->head ? 1 : 0)
+#define list_is_tail(element) ((element)->next == NULL ? 1 : 0)
+#define list_data(element) ((element)->data)
+#define list_next(element) ((element)->next)
+
+/* QUEUE */
+typedef List Queue;
+
+#define queue_init list_init
+#define queue_destroy list_destroy
+int queue_enqueue (Queue * queue, const void * data);
+int queue_dequeue (Queue * queue, void ** data);
+#define queue_peek(queue) ((queue)->head == NULL ? NULL : (queue)->head->data)
+#define queue_size list_size
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/adios_internals_mxml.c b/src/adios_internals_mxml.c
new file mode 100644
index 0000000..2e9bb1d
--- /dev/null
+++ b/src/adios_internals_mxml.c
@@ -0,0 +1,3398 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <sys/stat.h> /* struct stat */
+
+// xml parser
+#include <mxml.h>
+
+#ifdef _NOMPI
+    /* Sequential processes can use the library compiled with -D_NOMPI */
+#   include "mpidummy.h"
+#else
+    /* Parallel applications should use MPI to communicate  */
+#   include "mpi.h"
+#endif
+
+#include "adios.h"
+#include "adios_transport_hooks.h"
+#include "adios_bp_v1.h"
+#include "adios_internals.h"
+#include "adios_internals_mxml.h"
+#include "buffer.h"
+
+static enum ADIOS_FLAG adios_host_language_fortran = adios_flag_yes;
+
+static struct adios_method_list_struct * adios_methods = 0;
+static struct adios_group_list_struct * adios_groups = 0;
+
+struct adios_transport_struct * adios_transports = 0;
+static int adios_transports_initialized = 0;
+
+// this macro makes getting the attributes easier
+// fix the bgp bugs
+#define GET_ATTR(n,attr,var,en)                              \
+if (!strcasecmp (n, attr->name)) {                           \
+    if (!var)                                                \
+    {                                                        \
+        var = attr->value;                                   \
+        continue;                                            \
+    }                                                        \
+    else                                                     \
+    {                                                        \
+        fprintf (stderr, "xml: duplicate attribute %s on %s (ignored)",n,en); \
+        continue;                                            \
+    }                                                        \
+}
+
+static enum ADIOS_DATATYPES parseType (const char * type, const char * name)
+{
+    if (   !strcasecmp (type, "byte")
+        || !strcasecmp (type, "integer*1")
+       )
+        return adios_byte;
+
+    if (   !strcasecmp (type, "short")
+        || !strcasecmp (type, "integer*2")
+       )
+        return adios_short;
+
+    if (   !strcasecmp (type, "integer")
+        || !strcasecmp (type, "integer*4")
+       )
+        return adios_integer;
+
+    if (   !strcasecmp (type, "long")
+        || !strcasecmp (type, "integer*8")
+       )
+        return adios_long;
+
+    if (   !strcasecmp (type, "unsigned byte")
+        || !strcasecmp (type, "unsigned integer*1")
+       )
+        return adios_unsigned_byte;
+
+    if (   !strcasecmp (type, "unsigned short")
+        || !strcasecmp (type, "unsigned integer*2")
+       )
+        return adios_unsigned_short;
+
+    if (   !strcasecmp (type, "unsigned integer")
+        || !strcasecmp (type, "unsigned integer*4")
+       )
+        return adios_unsigned_integer;
+
+    if (   !strcasecmp (type, "unsigned long")
+        || !strcasecmp (type, "unsigned integer*8")
+       )
+        return adios_unsigned_long;
+
+    if (   !strcasecmp (type, "real")
+        || !strcasecmp (type, "real*4")
+        || !strcasecmp (type, "float")
+       )
+        return adios_real;
+
+    if (   !strcasecmp (type, "real*8")
+        || !strcasecmp (type, "double")
+        || !strcasecmp (type, "long float")
+       )
+        return adios_double;
+
+    if (   !strcasecmp (type, "real*16")
+        || !strcasecmp (type, "long double")
+       )
+        return adios_long_double;
+
+    if (!strcasecmp (type, "string"))
+        return adios_string;
+
+    if (   !strcasecmp (type, "complex")
+        || !strcasecmp (type, "complex*8")
+       )
+        return adios_complex;
+
+    if (   !strcasecmp (type, "double complex")
+        || !strcasecmp (type, "complex*16")
+       )
+        return adios_double_complex;
+
+    fprintf (stderr, "config.xml: invalid type: %s in var %s\n", type, name);
+
+    return adios_unknown;
+}
+
+static enum ADIOS_FLAG parseFlag (const char * attr_name, const char * flag
+                                 ,enum ADIOS_FLAG default_value
+                                 )
+{
+    if (!flag)
+        return default_value;
+
+    if (!strcasecmp (flag, "yes"))
+        return adios_flag_yes;
+
+    if (!strcasecmp (flag, "no"))
+        return adios_flag_no;
+
+    fprintf (stderr, "config.xml: %s must have a value of 'yes' or 'no' "
+                     "not: %s\n", attr_name, flag
+            );
+
+    return adios_flag_unknown;
+}
+
+
+static void adios_append_mesh_item (struct adios_mesh_item_list_struct ** root
+                                   ,struct adios_mesh_item_list_struct * item
+                                   )
+{
+    while (root)
+    {
+        if (!*root)
+        {
+            *root = item;
+            root = 0;
+        }
+        else
+        {
+            root = &(*root)->next;
+        }
+    }
+}
+
+static void adios_append_mesh_var (struct adios_mesh_var_list_struct ** root
+                                  ,struct adios_mesh_var_list_struct * var
+                                  )
+{
+    while (root)
+    {
+        if (!*root)
+        {
+            *root = var;
+            root = 0;
+        }
+        else
+        {
+            root = &(*root)->next;
+        }
+    }
+}
+
+static void adios_append_mesh_cell_list
+                           (struct adios_mesh_cell_list_list_struct ** root
+                           ,struct adios_mesh_cell_list_list_struct * cell_list
+                           )
+{
+    while (root)
+    {
+        if (!*root)
+        {
+            *root = cell_list;
+            root = 0;
+        }
+        else
+        {
+            root = &(*root)->next;
+        }
+    }
+}
+
+
+// dimensions is a comma separated list of dimension magnitudes
+static int parseMeshUniformDimensions (const char * dimensions
+                                      ,struct adios_group_struct * new_group
+                                      ,struct adios_mesh_uniform_struct * mesh
+                                      )
+{
+    char * c;  // comma location
+    char * d1; // save of strdup
+    char * tmp;
+    struct adios_mesh_item_list_struct * item = 0;
+
+    if (!dimensions)
+    {
+        fprintf (stderr, "config.xml: mesh uniform dimensions value "
+                         "required\n"
+                );
+
+        return 0;
+    }
+
+    d1 = strdup (dimensions);
+
+    c = d1;
+    tmp = c;
+
+    while (c && *c)
+    {
+        if (*c == ',')
+        {
+            item = (struct adios_mesh_item_list_struct *) malloc
+                            (sizeof (struct adios_mesh_item_list_struct));
+            item->next = 0;
+
+            if (!item)
+            {
+                fprintf (stderr, "Out of memory parseMeshUniformDimensions\n");
+                free (d1);
+
+                return 0;
+            }
+
+            *c = '\0';
+            if (adios_int_is_num (tmp))
+            {
+                item->item.rank = strtod (tmp, 0);
+                item->item.var = 0;
+            }
+            else
+            {
+                item->item.rank = 0.0;
+                item->item.var =
+                    adios_find_var_by_name (new_group->vars, tmp
+                                           ,new_group->all_unique_var_names
+                                           );
+                if (!item->item.var)
+                {
+                    fprintf (stderr, "config.xml: invalid var dimension: %s\n"
+                            ,tmp
+                            );
+                    free (d1);
+
+                    return 0;
+                }
+            }
+            adios_append_mesh_item (&(mesh->dimensions), item);
+            tmp = c + 1;
+        }
+        else
+            c++;
+    }
+
+    free (d1);
+
+    return 1;
+}
+
+static int parseMeshUniformOrigin (const char * origin
+                                  ,struct adios_group_struct * new_group
+                                  ,struct adios_mesh_uniform_struct * mesh
+                                  )
+{
+    char * c;  // comma location
+    char * d1; // save of strdup
+    struct adios_mesh_item_list_struct * item = 0;
+
+    if (!origin)
+    {
+        fprintf (stderr, "config.xml: mesh uniform origin value "
+                         "required\n"
+                );
+
+        return 0;
+    }
+
+    d1 = strdup (origin);
+
+    c = strtok (d1, ",");
+
+    while (c)
+    {
+        item = (struct adios_mesh_item_list_struct *) malloc
+                            (sizeof (struct adios_mesh_item_list_struct));
+        item->next = 0;
+
+        if (!item)
+        {
+            fprintf (stderr, "Out of memory parseMeshUniformOrigin\n");
+            free (d1);
+
+            return 0;
+        }
+
+        if (adios_int_is_var (c))
+        {
+            item->item.rank = 0.0;
+            item->item.var =
+                    adios_find_var_by_name (new_group->vars, c
+                                           ,new_group->all_unique_var_names
+                                           );
+            if (!item->item.var)
+            {
+                fprintf (stderr, "config.xml: invalid var dimension: %s\n"
+                        ,c
+                        );
+                free (d1);
+
+                return 0;
+            }
+        }
+        else
+        {
+            item->item.rank = strtod (c, 0);
+            item->item.var = 0;
+        }
+
+        adios_append_mesh_item (&(mesh->origin), item);
+
+        c = strtok (NULL, ",");
+    }
+
+    free (d1);
+
+    return 1;
+}
+
+static int parseMeshUniformSpacing (const char * spacing
+                                   ,struct adios_group_struct * new_group
+                                   ,struct adios_mesh_uniform_struct * mesh
+                                   )
+{
+    char * c;  // comma location
+    char * d1; // save of strdup
+    char * tmp;
+    struct adios_mesh_item_list_struct * item = 0;
+
+    if (!spacing)
+    {
+        fprintf (stderr, "config.xml: mesh uniform spacing value "
+                         "required\n"
+                );
+
+        return 0;
+    }
+
+    d1 = strdup (spacing);
+
+    c = d1;
+    tmp = c;
+
+    while (c && *c)
+    {
+        if (*c == ',')
+        {
+            item = (struct adios_mesh_item_list_struct *) malloc
+                            (sizeof (struct adios_mesh_item_list_struct));
+            item->next = 0;
+
+            if (!item)
+            {
+                fprintf (stderr, "Out of memory parseMeshUniformSpacing\n");
+                free (d1);
+
+                return 0;
+            }
+
+            *c = '\0';
+            if (adios_int_is_num (tmp))
+            {
+                item->item.rank = strtod (tmp, 0);
+                item->item.var = 0;
+            }
+            else
+            {
+                item->item.rank = 0.0;
+                item->item.var =
+                    adios_find_var_by_name (new_group->vars, tmp
+                                           ,new_group->all_unique_var_names
+                                           );
+                if (!item->item.var)
+                {
+                    fprintf (stderr, "config.xml: invalid var dimension: %s\n"
+                            ,tmp
+                            );
+                    free (d1);
+
+                    return 0;
+                }
+            }
+            adios_append_mesh_item (&(mesh->spacing), item);
+            tmp = c + 1;
+        }
+        else
+            c++;
+    }
+
+    free (d1);
+
+    return 1;
+}
+
+static int parseMeshRectilinearDimensions (const char * dimensions
+                                          ,struct adios_group_struct * new_group
+                                          ,struct adios_mesh_rectilinear_struct * mesh
+                                          )
+{
+    char * c;  // comma location
+    char * d1; // save of strdup
+    char * tmp;
+    struct adios_mesh_item_list_struct * item = 0;
+
+    if (!dimensions)
+    {
+        fprintf (stderr, "config.xml: mesh rectilinear dimensions value "
+                         "required\n"
+                );
+
+        return 0;
+    }
+
+    d1 = strdup (dimensions);
+
+    c = d1;
+    tmp = c;
+
+    while (c && *c)
+    {
+        if (*c == ',')
+        {
+            item = (struct adios_mesh_item_list_struct *) malloc
+                            (sizeof (struct adios_mesh_item_list_struct));
+            item->next = 0;
+
+            if (!item)
+            {
+                fprintf (stderr, "Out of memory parseMeshRectilinearDimensions\n");
+                free (d1);
+
+                return 0;
+            }
+
+            *c = '\0';
+            if (adios_int_is_num (tmp))
+            {
+                item->item.rank = strtod (tmp, 0);
+                item->item.var = 0;
+            }
+            else
+            {
+                item->item.rank = 0.0;
+                item->item.var =
+                    adios_find_var_by_name (new_group->vars, tmp
+                                           ,new_group->all_unique_var_names
+                                           );
+                if (!item->item.var)
+                {
+                    fprintf (stderr, "config.xml: invalid var dimension: %s\n"
+                            ,tmp
+                            );
+                    free (d1);
+
+                    return 0;
+                }
+            }
+            adios_append_mesh_item (&(mesh->dimensions), item);
+            tmp = c + 1;
+        }
+        else
+            c++;
+    }
+
+    free (d1);
+
+    return 1;
+}
+
+static int parseMeshRectilinearCoordinatesMultiVar (const char * coordinates
+                                                   ,struct adios_group_struct * new_group
+                                                   ,struct adios_mesh_rectilinear_struct * mesh
+                                                   )
+{
+    char * c;  // comma location
+    char * d1; // save of strdup
+    char * tmp;
+    struct adios_mesh_var_list_struct * var = 0;
+
+    if (!coordinates)
+    {
+        fprintf (stderr, "config.xml: mesh rectilinear coordinates-multi-var "
+                         "value required\n"
+                );
+
+        return 0;
+    }
+
+    d1 = strdup (coordinates);
+
+    c = d1;
+    tmp = c;
+
+    while (c && *c)
+    {
+        if (*c == ',')
+        {
+            var = (struct adios_mesh_var_list_struct *) malloc
+                            (sizeof (struct adios_mesh_var_list_struct));
+            var->next = 0;
+
+            if (!var)
+            {
+                fprintf (stderr, "Out of memory "
+                                 "parseMeshRectilinearCoordinatesMultiVar\n"
+                        );
+                free (d1);
+
+                return 0;
+            }
+
+            *c = '\0';
+            if (adios_int_is_var (tmp))
+            {
+                var->var =
+                    adios_find_var_by_name (new_group->vars, tmp
+                                           ,new_group->all_unique_var_names
+                                           );
+                if (!var->var)
+                {
+                    fprintf (stderr, "config.xml: invalid var dimension: %s\n"
+                            ,tmp
+                            );
+                    free (d1);
+
+                    return 0;
+                }
+            }
+            adios_append_mesh_var (&(mesh->coordinates), var);
+            tmp = c + 1;
+        }
+        else
+            c++;
+    }
+
+    free (d1);
+
+    return 1;
+}
+
+static int parseMeshRectilinearCoordinatesSingleVar (const char * coordinates
+                                                    ,struct adios_group_struct * new_group
+                                                    ,struct adios_mesh_rectilinear_struct * mesh
+                                                    )
+{
+    char * c;  // comma location
+    char * d1; // save of strdup
+    char * tmp;
+    struct adios_mesh_var_list_struct * var = 0;
+
+    if (!coordinates)
+    {
+        fprintf (stderr, "config.xml: mesh rectilinear coordinates-single-var "
+                         "value required\n"
+                );
+
+        return 0;
+    }
+
+    d1 = strdup (coordinates);
+
+    c = d1;
+    tmp = c;
+
+    while (c && *c)
+    {
+        if (*c == ',')
+        {
+            var = (struct adios_mesh_var_list_struct *) malloc
+                            (sizeof (struct adios_mesh_var_list_struct));
+            var->next = 0;
+
+            if (!var)
+            {
+                fprintf (stderr, "Out of memory "
+                                 "parseMeshRectilinearCoordinatesSingleVar\n"
+                        );
+                free (d1);
+
+                return 0;
+            }
+
+            *c = '\0';
+            if (adios_int_is_var (tmp))
+            {
+                var->var =
+                    adios_find_var_by_name (new_group->vars, tmp
+                                           ,new_group->all_unique_var_names
+                                           );
+                if (!var->var)
+                {
+                    fprintf (stderr, "config.xml: invalid var dimension: %s\n"
+                            ,tmp
+                            );
+                    free (d1);
+
+                    return 0;
+                }
+            }
+            adios_append_mesh_var (&(mesh->coordinates), var);
+            tmp = c + 1;
+        }
+        else
+            c++;
+    }
+
+    free (d1);
+
+    return 1;
+}
+
+static int parseMeshStructuredNspace (const char * nspace
+                                     ,struct adios_group_struct * new_group
+                                     ,struct adios_mesh_structured_struct * mesh
+                                     )
+{
+    char * c;  // comma location
+    char * d1; // save of strdup
+    struct adios_mesh_item_struct * item = 0;
+
+    if (!nspace)
+    {
+        fprintf (stderr, "config.xml: mesh structured nspace value "
+                         "required\n"
+                );
+
+        return 0;
+    }
+
+    d1 = strdup (nspace);
+
+    c = strtok (d1, ",");
+
+    while (c)
+    {
+        item = (struct adios_mesh_item_struct *) malloc
+                            (sizeof (struct adios_mesh_item_struct));
+
+        if (!item)
+        {
+            fprintf (stderr, "Out of memory parseMeshStructuredNspace\n");
+            free (d1);
+
+            return 0;
+        }
+
+        if (adios_int_is_var (c))
+        {
+            item->rank = 0.0;
+            item->var =
+                    adios_find_var_by_name (new_group->vars, c
+                                           ,new_group->all_unique_var_names
+                                           );
+            if (!item->var)
+            {
+                fprintf (stderr, "config.xml: invalid var dimension: %s\n"
+                        ,c
+                        );
+                free (d1);
+
+                return 0;
+            }
+        }
+        else
+        {
+            item->rank = strtod (c, 0);
+            item->var = 0;
+        }
+
+        mesh->nspace = item;
+
+        c = strtok (NULL, ",");
+    }
+
+    free (d1);
+
+    return 1;
+}
+
+static int parseMeshStructuredDimensions (const char * dimensions
+                                         ,struct adios_group_struct * new_group
+                                         ,struct adios_mesh_structured_struct * mesh
+                                         )
+{
+    char * c;  // comma location
+    char * d1; // save of strdup
+    struct adios_mesh_item_list_struct * item = 0;
+
+    if (!dimensions)
+    {
+        fprintf (stderr, "config.xml: mesh structured dimensions value "
+                         "required\n"
+                );
+
+        return 0;
+    }
+
+    d1 = strdup (dimensions);
+
+    c = strtok (d1, ",");
+
+    while (c)
+    {
+        item = (struct adios_mesh_item_list_struct *) malloc
+                            (sizeof (struct adios_mesh_item_list_struct));
+        item->next = 0;
+
+        if (!item)
+        {
+            fprintf (stderr, "Out of memory parseMeshStructuredDimensions\n");
+            free (d1);
+
+            return 0;
+        }
+
+        if (adios_int_is_var (c))
+        {
+            item->item.rank = 0.0;
+            item->item.var =
+                    adios_find_var_by_name (new_group->vars, c
+                                           ,new_group->all_unique_var_names
+                                           );
+            if (!item->item.var)
+            {
+                fprintf (stderr, "config.xml: invalid var dimension: %s\n"
+                        ,c
+                        );
+                free (d1);
+
+                return 0;
+            }
+        }
+        else
+        {
+            item->item.rank = strtod (c, 0);
+            item->item.var = 0;
+        }
+
+        adios_append_mesh_item (&(mesh->dimensions), item);
+
+        c = strtok (NULL, ",");
+    }
+
+    free (d1);
+
+    return 1;
+}
+
+static int parseMeshStructuredPointsMultiVar (const char * points
+                                             ,struct adios_group_struct * new_group
+                                             ,struct adios_mesh_structured_struct * mesh
+                                             )
+{
+    char * c;  // comma location
+    char * d1; // save of strdup
+    struct adios_mesh_var_list_struct * var = 0;
+
+    if (!points)
+    {
+        fprintf (stderr, "config.xml: mesh structured points-multi-var value "
+                         "required\n"
+                );
+
+        return 0;
+    }
+
+    d1 = strdup (points);
+
+    c = strtok (d1, ",");
+
+    while (c)
+    {
+        var = (struct adios_mesh_var_list_struct *) malloc
+                        (sizeof (struct adios_mesh_var_list_struct));
+        var->next = 0;
+
+        if (!var)
+        {
+            fprintf (stderr, "Out of memory parseMeshStructuredPointsMultiVar\n");
+            free (d1);
+
+            return 0;
+        }
+
+        if (adios_int_is_var (c))
+        {
+            var->var =
+                    adios_find_var_by_name (new_group->vars, c
+                                           ,new_group->all_unique_var_names
+                                           );
+            if (!var->var)
+            {
+                fprintf (stderr, "config.xml: invalid var dimension: %s\n"
+                        ,c
+                        );
+                free (d1);
+
+                return 0;
+            }
+        }
+        else
+        {
+            var->var = 0;
+        }
+
+        adios_append_mesh_var (&(mesh->points), var);
+
+        c = strtok (NULL, ",");
+    }
+
+    free (d1);
+
+    return 1;
+}
+
+static int parseMeshStructuredPointsSingleVar (const char * points
+                                              ,struct adios_group_struct * new_group
+                                              ,struct adios_mesh_structured_struct * mesh
+                                              )
+{
+    char * c;  // comma location
+    char * d1; // save of strdup
+    struct adios_mesh_var_list_struct * var = 0;
+
+    if (!points)
+    {
+        fprintf (stderr, "config.xml: mesh structured points-single-var value "
+                         "required\n"
+                );
+
+        return 0;
+    }
+
+    d1 = strdup (points);
+
+    c = strtok (d1, ",");
+
+    while (c)
+    {
+        var = (struct adios_mesh_var_list_struct *) malloc
+                        (sizeof (struct adios_mesh_var_list_struct));
+        var->next = 0;
+
+        if (!var)
+        {
+            fprintf (stderr, "Out of memory parseMeshStructuredPointsSingleVar\n");
+            free (d1);
+
+            return 0;
+        }
+
+        if (adios_int_is_var (c))
+        {
+            var->var =
+                    adios_find_var_by_name (new_group->vars, c
+                                           ,new_group->all_unique_var_names
+                                           );
+            if (!var->var)
+            {
+                fprintf (stderr, "config.xml: invalid var dimension: %s\n"
+                        ,c
+                        );
+                free (d1);
+
+                return 0;
+            }
+        }
+        else
+        {
+            var->var = 0;
+        }
+
+        adios_append_mesh_var (&(mesh->points), var);
+
+        c = strtok (NULL, ",");
+    }
+
+    free (d1);
+
+    return 1;
+}
+
+static int parseMeshUnstructuredPoints (const char * components
+                                       ,const char * number_of_points
+                                       ,const char * value
+                                       ,struct adios_group_struct * new_group
+                                       ,struct adios_mesh_unstructured_struct * mesh
+                                       )
+{
+    char * c;  // comma location
+    char * d1; // save of strdup
+    struct adios_var_struct * var = 0;
+
+    if (!components)
+    {
+        fprintf (stderr, "config.xml: mesh structured points-single-var value "
+                         "required\n"
+                );
+
+        return 0;
+    }
+
+    d1 = strdup (components);
+
+    c = strtok (d1, ",");
+
+    while (c)
+    {
+        if (adios_int_is_var (c))
+        {
+            var = adios_find_var_by_name (new_group->vars, c
+                                         ,new_group->all_unique_var_names
+                                         );
+            if (!var)
+            {
+                fprintf (stderr, "config.xml: invalid var dimension: %s\n"
+                        ,c
+                        );
+                free (d1);
+
+                return 0;
+            }
+        }
+        else
+        {
+            var = 0;
+        }
+
+        mesh->points = var;
+
+        c = strtok (NULL, ",");
+    }
+
+    free (d1);
+
+    return 1;
+}
+
+static int parseMeshUnstructuredUniformCells (const char * count
+                                             ,const char * data
+                                             ,const char * type
+                                             ,struct adios_group_struct * new_group
+                                             ,struct adios_mesh_unstructured_struct * mesh
+                                             )
+{
+    char * c;  // comma location
+    char * d1; // save of strdup
+    struct adios_mesh_cell_list_list_struct * cell_list = 0;
+
+    if (!count)
+    {
+        fprintf (stderr, "config.xml: mesh unstructured uniform-cells "
+                         "count value required\n"
+                );
+
+        return 0;
+    }
+    if (!data)
+    {
+        fprintf (stderr, "config.xml: mesh unstructured uniform-cells "
+                         "data value required\n"
+                );
+
+        return 0;
+    }
+    if (!type)
+    {
+        fprintf (stderr, "config.xml: mesh unstructured uniform-cells "
+                         "type value required\n"
+                );
+
+        return 0;
+    }
+
+    d1 = strdup (count);
+    c = strtok (d1, ",");
+
+    cell_list = (struct adios_mesh_cell_list_list_struct *) malloc
+                        (sizeof (struct adios_mesh_cell_list_list_struct));
+    cell_list->next = 0;
+
+    if (!cell_list)
+    {
+        fprintf (stderr, "Out of memory parseMeshStructuredPointsSingleVar\n");
+        free (d1);
+
+        return 0;
+    }
+
+    while (c)
+    {
+        if (adios_int_is_var (c))
+        {
+            cell_list->cell_list.count.var =
+                    adios_find_var_by_name (new_group->vars, c
+                                           ,new_group->all_unique_var_names
+                                           );
+            cell_list->cell_list.count.rank = 0;
+            if (!cell_list->cell_list.count.var)
+            {
+                fprintf (stderr, "config.xml: invalid var dimension: %s\n"
+                        ,c
+                        );
+                free (d1);
+
+                return 0;
+            }
+        }
+        else
+        {
+            cell_list->cell_list.count.var = 0;
+            cell_list->cell_list.count.rank = strtod (c, 0);
+        }
+
+        c = strtok (NULL, ",");
+    }
+    free (d1);
+
+    d1 = strdup (data);
+    c = strtok (d1, ",");
+    while (c)
+    {
+        if (adios_int_is_var (c))
+        {
+            cell_list->cell_list.data =
+                 adios_find_var_by_name (new_group->vars, c
+                                        ,new_group->all_unique_var_names
+                                        );
+            if (!cell_list->cell_list.data)
+            {
+                fprintf (stderr, "config.xml: invalid var dimension: %s\n"
+                        ,c
+                        );
+                free (d1);
+
+                return 0;
+            }
+        }
+        else
+        {
+            cell_list->cell_list.data = 0;
+        }
+
+        c = strtok (NULL, ",");
+    }
+    free (d1);
+
+    d1 = strdup (type);
+    c = strtok (d1, ",");
+    while (c)
+    {
+        if (adios_int_is_var (c))
+        {
+            cell_list->cell_list.type.var =
+                     adios_find_var_by_name (new_group->vars, c
+                                            ,new_group->all_unique_var_names
+                                            );
+            cell_list->cell_list.type.rank = 0;
+            if (!cell_list->cell_list.type.var)
+            {
+                fprintf (stderr, "config.xml: invalid var dimension: %s\n"
+                        ,c
+                        );
+                free (d1);
+
+                return 0;
+            }
+        }
+        else
+        {
+            cell_list->cell_list.type.var = 0;
+            cell_list->cell_list.type.rank = strtod (c, 0);
+        }
+
+        c = strtok (NULL, ",");
+    }
+    free (d1);
+
+    adios_append_mesh_cell_list (&(mesh->cell_list), cell_list);
+
+    return 1;
+}
+
+static int parseMeshUnstructuredMixedCells (const char * count
+                                           ,const char * data
+                                           ,const char * types
+                                           ,struct adios_group_struct * new_group
+                                           ,struct adios_mesh_unstructured_struct * mesh
+                                           )
+{
+    char * c;  // comma location
+    char * d1; // save of strdup
+    struct adios_mesh_cell_list_list_struct * cell_list = 0;
+
+    if (!count)
+    {
+        fprintf (stderr, "config.xml: mesh unstructured uniform-cells "
+                         "count value required\n"
+                );
+
+        return 0;
+    }
+    if (!data)
+    {
+        fprintf (stderr, "config.xml: mesh unstructured uniform-cells "
+                         "data value required\n"
+                );
+
+        return 0;
+    }
+    if (!types)
+    {
+        fprintf (stderr, "config.xml: mesh unstructured uniform-cells "
+                         "types value required\n"
+                );
+
+        return 0;
+    }
+
+    d1 = strdup (count);
+    c = strtok (d1, ",");
+
+    cell_list = (struct adios_mesh_cell_list_list_struct *) malloc
+                        (sizeof (struct adios_mesh_cell_list_list_struct));
+    cell_list->next = 0;
+
+    if (!cell_list)
+    {
+        fprintf (stderr, "Out of memory parseMeshStructuredPointsSingleVar\n");
+        free (d1);
+
+        return 0;
+    }
+
+    while (c)
+    {
+        if (adios_int_is_var (c))
+        {
+            cell_list->cell_list.count.var =
+                   adios_find_var_by_name (new_group->vars, c
+                                          ,new_group->all_unique_var_names
+                                          );
+            cell_list->cell_list.count.rank = 0;
+            if (!cell_list->cell_list.count.var)
+            {
+                fprintf (stderr, "config.xml: invalid var dimension: %s\n"
+                        ,c
+                        );
+                free (d1);
+
+                return 0;
+            }
+        }
+        else
+        {
+            cell_list->cell_list.count.var = 0;
+            cell_list->cell_list.count.rank = strtod (c, 0);
+        }
+
+        c = strtok (NULL, ",");
+    }
+    free (d1);
+
+    d1 = strdup (data);
+    c = strtok (d1, ",");
+    while (c)
+    {
+        if (adios_int_is_var (c))
+        {
+            cell_list->cell_list.data =
+                   adios_find_var_by_name (new_group->vars, c
+                                          ,new_group->all_unique_var_names
+                                          );
+            if (!cell_list->cell_list.data)
+            {
+                fprintf (stderr, "config.xml: invalid var dimension: %s\n"
+                        ,c
+                        );
+                free (d1);
+
+                return 0;
+            }
+        }
+        else
+        {
+            cell_list->cell_list.data = 0;
+        }
+
+        c = strtok (NULL, ",");
+    }
+    free (d1);
+
+    d1 = strdup (types);
+    c = strtok (d1, ",");
+    while (c)
+    {
+        if (adios_int_is_var (c))
+        {
+            cell_list->cell_list.type.var =
+                   adios_find_var_by_name (new_group->vars, c
+                                          ,new_group->all_unique_var_names
+                                          );
+            cell_list->cell_list.type.rank = 0;
+            if (!cell_list->cell_list.type.var)
+            {
+                fprintf (stderr, "config.xml: invalid var dimension: %s\n"
+                        ,c
+                        );
+                free (d1);
+
+                return 0;
+            }
+        }
+        else
+        {
+            cell_list->cell_list.type.var = 0;
+            cell_list->cell_list.type.rank = strtod (c, 0);
+        }
+
+        c = strtok (NULL, ",");
+    }
+    free (d1);
+
+    adios_append_mesh_cell_list (&(mesh->cell_list), cell_list);
+
+    return 1;
+}
+
+// primary mesh XML parsing
+static int parseMeshUniform (mxml_node_t * node
+                            ,struct adios_group_struct * new_group
+                            ,struct adios_mesh_uniform_struct ** mesh
+                            )
+{
+    mxml_node_t * n;
+    int saw_dimensions = 0;
+    int saw_origin = 0;
+    int saw_spacing = 0;
+
+    for (n = mxmlWalkNext (node, node, MXML_DESCEND)
+        ;n
+        ;n = mxmlWalkNext (n, node, MXML_DESCEND)
+        )
+    {
+        if (n->type != MXML_ELEMENT)
+        {
+            continue;
+        }
+
+        if (!strcasecmp (n->value.element.name, "dimensions"))
+        {
+            const char * dimensions;
+
+            if (saw_dimensions)
+            {
+                fprintf (stderr, "config.xml: only one dimensions "
+                 "definition allowed per mesh sructured-points\n"
+                        );
+
+                return 0;
+            }
+
+            saw_dimensions = 1;
+            dimensions = mxmlElementGetAttr (n, "value");
+
+            if (!dimensions)
+            {
+                fprintf (stderr, "config.xml: value attribute on "
+                                 "dimensions required\n"
+                        );
+
+                return 0;
+            }
+
+            if (!parseMeshUniformDimensions (dimensions, new_group, *mesh))
+                return 0;
+        } else
+        if (!strcasecmp (n->value.element.name, "origin"))
+        {
+            const char * value;
+
+            if (saw_origin)
+            {
+                fprintf (stderr, "config.xml: only one origin "
+                                 "definition allowed per mesh uniform\n"
+                        );
+
+                return 0;
+            }
+
+            saw_origin = 1;
+            value = mxmlElementGetAttr (n, "value");
+
+            if (!value)
+            {
+                fprintf (stderr, "config.xml: value attribute on "
+                                 "origin required\n"
+                        );
+
+                return 0;
+            }
+
+            if (!parseMeshUniformOrigin (value, new_group, *mesh))
+                return 0;
+        } else
+        if (!strcasecmp (n->value.element.name, "spacing"))
+        {
+            const char * value;
+
+            if (saw_spacing)
+            {
+                fprintf (stderr, "config.xml: only one spacing "
+                                 "definition allowed per mesh uniform\n"
+                        );
+
+                return 0;
+            }
+
+            saw_spacing = 1;
+            value = mxmlElementGetAttr (n, "value");
+
+            if (!value)
+            {
+                fprintf (stderr, "config.xml: value attribute on "
+                                 "spacing required\n"
+                        );
+
+                return 0;
+            }
+
+            if (!parseMeshUniformSpacing (value, new_group, *mesh))
+                return 0;
+        } else
+        {
+            if (!strncmp (n->value.element.name, "!--", 3)) // a comment
+            {
+                continue;
+            }
+        }
+    }
+
+    if (!saw_dimensions)
+    {
+        fprintf (stderr, "config.xml: dimensions required on mesh "
+                         "type=uniform\n"
+                );
+
+        return 0;
+    }
+
+    return 1;
+}
+
+static int parseMeshRectilinear (mxml_node_t * node
+                               ,struct adios_group_struct * new_group
+                               ,struct adios_mesh_rectilinear_struct ** mesh
+                               )
+{
+    mxml_node_t * n;
+    int saw_dimensions = 0;
+    int saw_coordinates_multi_var = 0;
+    int saw_coordinates_single_var = 0;
+
+    for (n = mxmlWalkNext (node, node, MXML_DESCEND)
+        ;n
+        ;n = mxmlWalkNext (n, node, MXML_DESCEND)
+        )
+    {
+        if (n->type != MXML_ELEMENT)
+        {
+            continue;
+        }
+
+        if (!strcasecmp (n->value.element.name, "dimensions"))
+        {
+            const char * value;
+
+            if (saw_dimensions)
+            {
+                fprintf (stderr, "config.xml: only one dimensions "
+                                 "definition allowed per mesh rectilinear\n"
+                        );
+
+                return 0;
+            }
+
+            saw_dimensions = 1;
+            value = mxmlElementGetAttr (n, "value");
+
+            if (!value)
+            {
+                fprintf (stderr, "config.xml: value attribute on "
+                                 "dimensions required\n"
+                        );
+
+                return 0;
+            }
+
+            if (!parseMeshRectilinearDimensions (value, new_group, *mesh))
+                return 0;
+        } else
+        if (!strcasecmp (n->value.element.name, "coordinates-multi-var"))
+        {
+            const char * value;
+
+            if (saw_coordinates_multi_var || saw_coordinates_single_var)
+            {
+                fprintf (stderr, "config.xml: only one coordinates "
+                                 "definition allowed per mesh rectilinear\n"
+                        );
+
+                return 0;
+            }
+
+            saw_coordinates_multi_var = 1;
+            value = mxmlElementGetAttr (n, "value");
+
+            if (!value)
+            {
+                fprintf (stderr, "config.xml: value attribute on "
+                                 "coordinates-multi-var required\n"
+                        );
+
+                return 0;
+            }
+
+            if (!parseMeshRectilinearCoordinatesMultiVar (value, new_group, *mesh))
+                return 0;
+            (*mesh)->coordinates_single_var = adios_flag_no;
+        } else
+        if (!strcasecmp (n->value.element.name, "coordinates-single-var"))
+        {
+            const char * value;
+
+            if (saw_coordinates_single_var || saw_coordinates_multi_var)
+            {
+                fprintf (stderr, "config.xml: only one coordinates "
+                                 "definition allowed per mesh rectilinear\n"
+                        );
+
+                return 0;
+            }
+
+            saw_coordinates_single_var = 1;
+            value = mxmlElementGetAttr (n, "value");
+
+            if (!value)
+            {
+                fprintf (stderr, "config.xml: value attribute on "
+                                 "coordinates-single-var required\n"
+                        );
+
+                return 0;
+            }
+
+            if (!parseMeshRectilinearCoordinatesSingleVar (value, new_group, *mesh))
+                return 0;
+            (*mesh)->coordinates_single_var = adios_flag_yes;
+        } else
+        {
+            if (!strncmp (n->value.element.name, "!--", 3)) // a comment
+            {
+                continue;
+            }
+        }
+    }
+
+    if (!saw_dimensions)
+    {
+        fprintf (stderr, "config.xml: dimensions required on mesh "
+                         "type=rectilinear\n"
+                );
+
+        return 0;
+    }
+    if (!saw_coordinates_multi_var && !saw_coordinates_single_var)
+    {
+        fprintf (stderr, "config.xml: coordinates-multi-var or "
+                         "coordinates-single-var required on mesh "
+                         "type=rectilinear\n"
+                );
+
+        return 0;
+    }
+
+    return 1;
+}
+
+static int parseMeshStructured (mxml_node_t * node
+                               ,struct adios_group_struct * new_group
+                               ,struct adios_mesh_structured_struct ** mesh
+                               )
+{
+    mxml_node_t * n;
+    int saw_nspace = 0;
+    int saw_dimensions = 0;
+    int saw_points_multi_var = 0;
+    int saw_points_single_var = 0;
+
+    for (n = mxmlWalkNext (node, node, MXML_DESCEND)
+        ;n
+        ;n = mxmlWalkNext (n, node, MXML_DESCEND)
+        )
+    {
+        if (n->type != MXML_ELEMENT)
+        {
+            continue;
+        }
+
+        if (!strcasecmp (n->value.element.name, "nspace"))
+        {
+            const char * value;
+
+            if (saw_nspace)
+            {
+                fprintf (stderr, "config.xml: only one nspace "
+                                 "definition allowed per mesh structured\n"
+                        );
+
+                return 0;
+            }
+
+            saw_nspace = 1;
+            value = mxmlElementGetAttr (n, "value");
+
+            if (!value)
+            {
+                fprintf (stderr, "config.xml: value attribute on "
+                                 "nspace required\n"
+                        );
+
+                return 0;
+            }
+
+            if (!parseMeshStructuredNspace (value, new_group, *mesh))
+                return 0;
+        } else
+        if (!strcasecmp (n->value.element.name, "dimensions"))
+        {
+            const char * value;
+
+            if (saw_dimensions)
+            {
+                fprintf (stderr, "config.xml: only one dimensions "
+                                 "definition allowed per mesh structured\n"
+                        );
+
+                return 0;
+            }
+
+            saw_dimensions = 1;
+            value = mxmlElementGetAttr (n, "value");
+
+            if (!value)
+            {
+                fprintf (stderr, "config.xml: value attribute on "
+                                 "dimensions required\n"
+                        );
+
+                return 0;
+            }
+
+            if (!parseMeshStructuredDimensions (value, new_group, *mesh))
+                return 0;
+        } else
+        if (!strcasecmp (n->value.element.name, "points-multi-var"))
+        {
+            const char * value;
+
+            if (saw_points_multi_var || saw_points_single_var)
+            {
+                fprintf (stderr, "config.xml: only one points "
+                                 "definition allowed per mesh structured\n"
+                        );
+
+                return 0;
+            }
+
+            saw_points_multi_var = 1;
+            value = mxmlElementGetAttr (n, "value");
+
+            if (!value)
+            {
+                fprintf (stderr, "config.xml: value attribute on "
+                                 "points-multi-var required\n"
+                        );
+
+                return 0;
+            }
+
+            if (!parseMeshStructuredPointsMultiVar (value, new_group, *mesh))
+                return 0;
+            (*mesh)->points_single_var = adios_flag_no;
+        } else
+        if (!strcasecmp (n->value.element.name, "points-single-var"))
+        {
+            const char * value;
+
+            if (saw_points_multi_var || saw_points_single_var)
+            {
+                fprintf (stderr, "config.xml: only one points "
+                                 "definition allowed per mesh structured\n"
+                        );
+
+                return 0;
+            }
+
+            saw_points_single_var = 1;
+            value = mxmlElementGetAttr (n, "value");
+
+            if (!value)
+            {
+                fprintf (stderr, "config.xml: value attribute on "
+                                 "points-single-var required\n"
+                        );
+
+                return 0;
+            }
+
+            if (!parseMeshStructuredPointsSingleVar (value, new_group, *mesh))
+                return 0;
+            (*mesh)->points_single_var = adios_flag_yes;
+        } else
+        {
+            if (!strncmp (n->value.element.name, "!--", 3)) // a comment
+            {
+                continue;
+            }
+        }
+    }
+
+    if (!saw_dimensions)
+    {
+        fprintf (stderr, "config.xml: dimensions required on mesh "
+                         "type=structured\n"
+                );
+
+        return 0;
+    }
+    if (!saw_points_multi_var && !saw_points_single_var)
+    {
+        fprintf (stderr, "config.xml: points-single-var or points-multi-var "
+                         "required on mesh type=structured\n"
+                );
+
+        return 0;
+    }
+
+    return 1;
+}
+
+static int parseMeshUnstructured (mxml_node_t * node
+                                 ,struct adios_group_struct * new_group
+                                 ,struct adios_mesh_unstructured_struct ** mesh
+                                 )
+{
+    mxml_node_t * n;
+    int saw_points = 0;
+    int saw_cell_set = 0;
+
+    for (n = mxmlWalkNext (node, node, MXML_DESCEND)
+        ;n
+        ;n = mxmlWalkNext (n, node, MXML_DESCEND)
+        )
+    {
+        if (n->type != MXML_ELEMENT)
+        {
+            continue;
+        }
+
+        if (!strcasecmp (n->value.element.name, "points"))
+        {
+            const char * components;
+            const char * number_of_points;
+            const char * value;
+
+            if (saw_points)
+            {
+                fprintf (stderr, "config.xml: only one points "
+                                 "definition allowed per mesh unstructured\n"
+                        );
+
+                return 0;
+            }
+
+            saw_points = 1;
+            components = mxmlElementGetAttr (n, "components");
+            number_of_points = mxmlElementGetAttr (n, "number-of-points");
+            value = mxmlElementGetAttr (n, "value");
+
+            if (!components)
+            {
+                fprintf (stderr, "config.xml: components attribute on "
+                                 "points required\n"
+                        );
+
+                return 0;
+            }
+            if (!number_of_points)
+            {
+                fprintf (stderr, "config.xml: number-of-points attribute on "
+                                 "points required\n"
+                        );
+
+                return 0;
+            }
+            if (!value)
+            {
+                fprintf (stderr, "config.xml: value attribute on "
+                                 "points required\n"
+                        );
+
+                return 0;
+            }
+
+            if (!parseMeshUnstructuredPoints (components, number_of_points
+                                             ,value, new_group, *mesh
+                                             )
+               )
+                return 0;
+        } else
+        if (!strcasecmp (n->value.element.name, "uniform-cells"))
+        {
+            const char * count;
+            const char * data;
+            const char * type;
+
+            saw_cell_set = 1;
+            count = mxmlElementGetAttr (n, "count");
+            data = mxmlElementGetAttr (n, "data");
+            type = mxmlElementGetAttr (n, "type");
+
+            if (!count)
+            {
+                fprintf (stderr, "config.xml: count attribute on "
+                                 "uniform-cells required\n"
+                        );
+
+                return 0;
+            }
+            if (!data)
+            {
+                fprintf (stderr, "config.xml: data attribute on "
+                                 "uniform-cells required\n"
+                        );
+
+                return 0;
+            }
+            if (!type)
+            {
+                fprintf (stderr, "config.xml: type attribute on "
+                                 "uniform-cells required\n"
+                        );
+
+                return 0;
+            }
+
+            if (!parseMeshUnstructuredUniformCells (count, data, type
+                                                   ,new_group, *mesh
+                                                   )
+               )
+                return 0;
+        } else
+        if (!strcasecmp (n->value.element.name, "mixed-cells"))
+        {
+            const char * count;
+            const char * data;
+            const char * types;
+
+            saw_cell_set = 1;
+            count = mxmlElementGetAttr (n, "count");
+            data = mxmlElementGetAttr (n, "data");
+            types = mxmlElementGetAttr (n, "types");
+
+            if (!count)
+            {
+                fprintf (stderr, "config.xml: count attribute on "
+                                 "mixed-cells required\n"
+                        );
+
+                return 0;
+            }
+            if (!data)
+            {
+                fprintf (stderr, "config.xml: data attribute on "
+                                 "mixed-cells required\n"
+                        );
+
+                return 0;
+            }
+            if (!types)
+            {
+                fprintf (stderr, "config.xml: types attribute on "
+                                 "mixed-cells required\n"
+                        );
+
+                return 0;
+            }
+
+            if (!parseMeshUnstructuredMixedCells (count, data, types
+                                                   ,new_group, *mesh
+                                                   )
+               )
+                return 0;
+        } else
+        {
+            if (!strncmp (n->value.element.name, "!--", 3)) // a comment
+            {
+                continue;
+            }
+        }
+    }
+
+    if (!saw_points)
+    {
+        fprintf (stderr, "config.xml: grid-nodes required on mesh "
+                         "type=unstructured\n"
+                );
+
+        return 0;
+    }
+    if (!saw_cell_set)
+    {
+        fprintf (stderr, "config.xml: at least one cell-set required on "
+                         "mesh type=unstructured\n"
+                );
+
+        return 0;
+    }
+
+    return 1;
+}
+
+static int validatePath (const struct adios_var_struct * vars
+                        ,const char * test_path
+                        )
+{
+    // if it is a default path, it is ok by default
+    if (!strcmp (test_path, "/"))
+    {
+        return 1;
+    }
+
+    char * path = strdup (test_path);
+    int len = strlen (path);
+    char * path_only;
+    char * var_only;
+    char * last_slash = strrchr (path, '/'); // find the last '/'
+    path_only = (char *) malloc (len + 1);
+    var_only = (char *) malloc (len + 1);
+    memset (path_only, 0, len + 1);
+    memset (var_only, 0, len + 1);
+    if (last_slash == path + len - 1)  // if it is a trailing '/', remove
+    {
+        last_slash = '\0';
+        last_slash = strrchr (path, '/');
+    }
+    if (last_slash == 0)
+    {
+        strcpy (path_only, "/");
+        strcpy (var_only, path);
+    }
+    else
+    {
+        strncpy (path_only, path, (last_slash - path));
+        strncpy (var_only, last_slash + 1, (len - (last_slash - path + 1)));
+    }
+
+    while (vars)
+    {
+        int path_only_len = strlen (path_only);
+        int var_path_len = strlen (vars->path);
+        int var_name_len = strlen (vars->name);
+        char full_path_matches = (!strcasecmp (vars->path, path));
+        char path_matches = (!strcasecmp (vars->path, path_only));
+        char var_matches = (!strcasecmp (vars->name, var_only));
+        char prefix_matches = 0;
+        char * path_var;
+        path_var = (char *) malloc (var_path_len + var_name_len + 2);
+        sprintf (path_var, "%s/%s", vars->path, vars->name);
+        char path_var_matches = (!strcasecmp (path_var, path));
+
+        if (var_path_len >= len && path_only_len > 0)
+            prefix_matches = (!strncmp (vars->path, path_only, path_only_len));
+        if (!prefix_matches)
+            prefix_matches = (!strncmp (vars->path, path, len));
+        int var_len = strlen (var_only);
+
+        if (   (path_matches && var_matches)
+            || (path_matches && var_len == 0)
+            || (full_path_matches)
+            || (prefix_matches)
+            || (path_var_matches)
+           )
+        {
+            free (path);
+            free (path_only);
+            free (var_only);
+            free (path_var);
+
+            return 1;
+        }
+        vars = vars->next;
+        free (path_var);
+    }
+
+    // not found
+    free (path);
+    free (path_only);
+    free (var_only);
+
+    return 0;
+}
+
+static int parseGroup (mxml_node_t * node)
+{
+    mxml_node_t * n;
+
+    const char * datagroup_name = 0;
+    const char * coordination_comm = 0;
+    const char * coordination_var = 0;
+    const char * host_language = 0;
+    const char * time_index_name = 0;
+
+    int64_t      ptr_new_group;
+    struct adios_group_struct * new_group;
+    enum ADIOS_FLAG host_language_fortran = adios_flag_yes;
+    int i;
+
+    for (i = 0; i < node->value.element.num_attrs; i++)
+    {
+        mxml_attr_t * attr = &node->value.element.attrs [i];
+
+        GET_ATTR("name",attr,datagroup_name,"adios-group")
+        // JL: 1-2010
+        // Although this is not used, we aer leaving in the retrevial
+        // of this to avoid messages from all of the existing XML files.
+        // In a few months, once everything has been updated, we can remove
+        // this code
+        GET_ATTR("coordination-communicator",attr,coordination_comm,"adios-group")
+        GET_ATTR("coordination-var",attr,coordination_var,"adios-group")
+        GET_ATTR("host-language",attr,host_language,"adios-group")
+        GET_ATTR("time-index",attr,time_index_name,"adios-group")
+        fprintf (stderr, "config.xml: unknown attribute '%s' on %s "
+                         "(ignored)\n"
+                ,attr->name
+                ,"adios-group"
+                );
+    }
+
+    if (!datagroup_name)
+    {
+        fprintf (stderr,
+                 "config.xml: name attribute required on adios-group\n");
+
+        return 0;
+    }
+    if (!host_language)
+    {
+        host_language_fortran = adios_host_language_fortran;
+    }
+    else
+    {
+        if (!strcasecmp (host_language, "Fortran"))
+        {
+            host_language_fortran = adios_flag_yes;
+        }
+        else
+        {
+            if (!strcasecmp (host_language, "C"))
+            {
+                host_language_fortran = adios_flag_no;
+            }
+            else
+            {
+                fprintf (stderr, "config.xml: invalid host-language %s"
+                        ,host_language
+                        );
+
+                return 0;
+            }
+        }
+    }
+
+// fix the bgp bugs 
+/*
+    adios_common_declare_group ((int64_t *) &new_group, datagroup_name
+                               ,host_language_fortran, coordination_comm
+                               ,coordination_var, time_index_name
+                               );
+*/
+    adios_common_declare_group (&ptr_new_group, datagroup_name
+                               ,host_language_fortran, coordination_comm
+                               ,coordination_var, time_index_name
+                               );
+     new_group = (struct adios_group_struct *)ptr_new_group;
+
+    for (n = mxmlWalkNext (node, node, MXML_DESCEND)
+        ;n
+        ;n = mxmlWalkNext (n, node, MXML_NO_DESCEND)
+        )
+    {
+        const char * gb_global_dimensions = "";
+        const char * gb_local_offsets = "";
+
+        if (n->type != MXML_ELEMENT)
+        {
+            continue;
+        }
+
+        if (!strcasecmp (n->value.element.name, "var"))
+        {
+            const char * name = 0;
+            const char * path = 0;
+            const char * type = 0;
+            const char * dimensions = 0;
+            const char * dimension = 0;
+            const char * gread = 0;
+            const char * gwrite = 0;
+            const char * read_flag = 0;
+            enum ADIOS_DATATYPES t1;
+
+            for (i = 0; i < n->value.element.num_attrs; i++)
+            {
+                mxml_attr_t * attr = &n->value.element.attrs [i];
+
+                GET_ATTR("name",attr,name,"var")
+                GET_ATTR("path",attr,path,"var")
+                GET_ATTR("type",attr,type,"var")
+                GET_ATTR("dimensions",attr,dimensions,"var")
+                GET_ATTR("dimension",attr,dimension,"var")
+                GET_ATTR("gwrite",attr,gwrite,"var")
+                GET_ATTR("gread",attr,gread,"var")
+                GET_ATTR("read",attr,read_flag,"var")
+                fprintf (stderr, "config.xml: unknown attribute '%s' on %s "
+                                 "(ignored)\n"
+                        ,attr->name
+                        ,"var"
+                        );
+            }
+
+            if (!name)
+                name = "";  // this will catch the error
+            if (!path)
+                path = "/";
+            if (!type)
+                type = ""; // this will catch the error
+            t1 = parseType (type, name);
+
+            if (!dimensions)
+            {
+                dimensions = dimension;
+                if (!dimensions)
+                    dimensions = "";
+            }
+
+            if (read_flag)
+                parseFlag ("read", read_flag, adios_flag_no);
+
+// fix the bgp bugs
+//            if (!adios_common_define_var (*(int64_t *) &new_group, name
+            if (!adios_common_define_var (ptr_new_group, name
+                                         ,path, t1, dimensions
+                                         ,gb_global_dimensions
+                                         ,gb_local_offsets
+                                         )
+               )
+            {
+                return 0;
+            }
+        } else
+        if (!strcasecmp (n->value.element.name, "global-bounds"))
+        {
+            mxml_node_t * n1;   // used for global_bounds
+            struct adios_global_bounds_struct * new_global_bounds = 0;
+
+            const char * dimensions = 0;
+            const char * dimension = 0;
+            const char * global_dimensions = 0;
+            const char * global_dimension = 0;
+            const char * offsets = 0;
+            const char * offset = 0;
+            const char * local_offsets = 0;
+            const char * local_offset = 0;
+
+            for (i = 0; i < n->value.element.num_attrs; i++)
+            {
+                mxml_attr_t * attr = &n->value.element.attrs [i];
+
+                GET_ATTR("dimensions",attr,dimensions,"var")
+                GET_ATTR("dimension",attr,dimension,"var")
+
+                GET_ATTR("global-dimensions",attr,global_dimensions,"var")
+                GET_ATTR("global-dimension",attr,global_dimension,"var")
+
+                GET_ATTR("offsets",attr,offsets,"var")
+                GET_ATTR("offset",attr,offset,"var")
+
+                GET_ATTR("local-offsets",attr,local_offsets,"var")
+                GET_ATTR("local-offset",attr,local_offset,"var")
+
+                fprintf (stderr, "config.xml: unknown attribute '%s' on %s "
+                                 "(ignored)\n"
+                        ,attr->name
+                        ,"global-bounds"
+                        );
+            }
+
+            if (!dimensions)
+            {
+                dimensions = (dimension ? dimension : global_dimensions);
+                dimensions = (dimensions ? dimensions : global_dimension);
+                if (!dimensions)
+                {
+                    fprintf (stderr, "config.xml: dimensions required on "
+                                     "global-bounds\n"
+                            );
+
+                    return 0;
+                }
+            }
+            if (!offsets)
+            {
+                offsets = (offset ? offset : local_offsets);
+                offsets = (offsets ? offsets : local_offset);
+                fprintf (stderr, "config.xml: offsets required on "
+                                 "global-bounds\n"
+                        );
+
+                return 0;
+            }
+
+            gb_global_dimensions = dimensions;
+            gb_local_offsets = offsets;
+
+            for (n1 = mxmlWalkNext (n, n, MXML_DESCEND)
+                ;n1
+                ;n1 = mxmlWalkNext (n1, n, MXML_DESCEND)
+                )
+            {
+                if (n1->type != MXML_ELEMENT)
+                {
+                    continue;
+                }
+
+                if (!strcasecmp (n1->value.element.name, "var"))
+                {
+                    const char * name = 0;
+                    const char * path = 0;
+                    const char * type = 0;
+                    const char * dimension = 0;
+                    const char * dimensions = 0;
+                    const char * gwrite = 0;
+                    const char * gread = 0;
+                    const char * read_flag = 0;
+                    enum ADIOS_DATATYPES t1;
+
+                    for (i = 0; i < n1->value.element.num_attrs; i++)
+                    {
+                        mxml_attr_t * attr = &n1->value.element.attrs [i];
+
+                        GET_ATTR("name",attr,name,"var")
+                        GET_ATTR("path",attr,path,"var")
+                        GET_ATTR("type",attr,type,"global-bounds var")
+                        GET_ATTR("dimensions",attr,dimensions,"var")
+                        GET_ATTR("dimension",attr,dimension,"var")
+                        GET_ATTR("gwrite",attr,gwrite,"var")
+                        GET_ATTR("gread",attr,gread,"var")
+                        GET_ATTR("read",attr,read_flag,"var")
+                        fprintf (stderr, "config.xml: unknown attribute '%s' "
+                                         "on %s (ignored)\n"
+                                ,attr->name
+                                ,"var"
+                                );
+                    }
+
+                    if (!name)
+                        name = "";  // this will catch the error
+                    if (!path)
+                        path = "/";
+                    if (!type)
+                        type = ""; // this will catch the error
+                    t1 = parseType (type, name);
+                    if (!dimensions)
+                        dimensions = dimension;
+
+                    if (read_flag)
+                        parseFlag ("read", read_flag, adios_flag_no);
+// fix the bgp bugs
+//                    if (!adios_common_define_var (*(int64_t *) &new_group
+                    if (!adios_common_define_var (ptr_new_group
+                                                 ,name
+                                                 ,path, t1, dimensions
+                                                 ,gb_global_dimensions
+                                                 ,gb_local_offsets
+                                                 )
+                       )
+                    {
+                        return 0;
+                    }
+                } else
+                {
+                    if (!strncmp (n1->value.element.name, "!--", 3)) // comment
+                    {
+                        continue;
+                    }
+                    else
+                    {
+                        fprintf (stderr, "config.xml: invalid xml element: "
+                                         "'%s'\n"
+                                ,n1->value.element.name
+                                );
+
+                        return 0;
+                    }
+                }
+            }
+
+            gb_global_dimensions = "";
+            gb_local_offsets = "";
+        } else
+        if (!strcasecmp (n->value.element.name, "attribute"))
+        {
+            const char * name = 0;
+            const char * path = 0;
+            const char * value = 0;
+            const char * type = 0;
+            const char * var = 0;
+            enum ADIOS_DATATYPES t1;
+
+            for (i = 0; i < n->value.element.num_attrs; i++)
+            {
+                mxml_attr_t * attr = &n->value.element.attrs [i];
+
+                GET_ATTR("name",attr,name,"var")
+                GET_ATTR("path",attr,path,"var")
+                GET_ATTR("type",attr,type,"var")
+                GET_ATTR("value",attr,value,"var")
+                GET_ATTR("var",attr,var,"var")
+                fprintf (stderr, "config.xml: unknown attribute '%s' on %s "
+                                 "(ignored)\n"
+                        ,attr->name
+                        ,"attribute"
+                        );
+            }
+
+            if (!name)
+            {
+                fprintf (stderr, "config.xml: attribute element requires "
+                                 "name\n");
+
+                return 0;
+            }
+            if (!path)
+            {
+                fprintf (stderr, "config.xml: attribute element requires "
+                                 "path\n");
+
+                return 0;
+            }
+            if ((!value && !var) || (value && var))
+            {
+                fprintf (stderr, "config.xml: attriute element '%s' "
+                                 "requires either value OR var\n"
+                        ,name
+                        );
+
+                return 0;
+            }
+            if (var && type)
+            {
+                fprintf (stderr, "config.xml: attriute element '%s'. "
+                                 "The type of an associated var is part "
+                                 "of the associated var element and cannot "
+                                 "be provided as part of the attribute "
+                                 "element."
+                                 "\n"
+                        ,name
+                        );
+
+                return 0;
+            }
+            if (!type && value)
+            {
+                type = "string";
+            }
+            if (!var)
+            {
+                t1 = parseType (type, name);
+            }
+            else
+            {
+                t1 = adios_unknown;
+            }
+// fix the bgp bugs
+//            if (!adios_common_define_attribute (*(int64_t *) &new_group, name
+            if (!adios_common_define_attribute (ptr_new_group, name
+                                               ,path, t1, value, var
+                                               )
+               )
+            {
+                return 0;
+            }
+        } else
+        if (!strcasecmp (n->value.element.name, "mesh"))
+        {
+            const char * type;
+            const char * time_varying;
+
+            new_group->mesh = (struct adios_mesh_struct *) malloc
+                                           (sizeof (struct adios_mesh_struct));
+            type = mxmlElementGetAttr (n, "type");
+            time_varying = mxmlElementGetAttr (n, "time-varying");
+
+            if (!type)
+                type = "";
+
+            if (!strcasecmp (type, "uniform"))
+            {
+                new_group->mesh->type = ADIOS_MESH_UNIFORM;
+                new_group->mesh->uniform =
+                    (struct adios_mesh_uniform_struct *)
+                         calloc (1, sizeof (struct adios_mesh_uniform_struct));
+                parseMeshUniform (n, new_group, &new_group->mesh->uniform);
+            } else
+            if (!strcasecmp (type, "structured"))
+            {
+                new_group->mesh->type = ADIOS_MESH_STRUCTURED;
+                new_group->mesh->structured =
+                    (struct adios_mesh_structured_struct *)
+                       calloc (1, sizeof (struct adios_mesh_structured_struct));
+                parseMeshStructured (n, new_group
+                                    ,&new_group->mesh->structured);
+            } else
+            if (!strcasecmp (type, "rectilinear"))
+            {
+                new_group->mesh->type = ADIOS_MESH_RECTILINEAR;
+                new_group->mesh->rectilinear =
+                    (struct adios_mesh_rectilinear_struct *)
+                      calloc (1, sizeof (struct adios_mesh_rectilinear_struct));
+                parseMeshRectilinear (n, new_group
+                                     ,&new_group->mesh->rectilinear);
+            } else
+            if (!strcasecmp (type, "unstructured"))
+            {
+                new_group->mesh->type = ADIOS_MESH_UNSTRUCTURED;
+                new_group->mesh->unstructured =
+                    (struct adios_mesh_unstructured_struct *)
+                     calloc (1, sizeof (struct adios_mesh_unstructured_struct));
+
+                parseMeshUnstructured (n, new_group
+                                      ,&new_group->mesh->unstructured);
+            } else
+            {
+                fprintf (stderr, "config.xml: invalid mesh type: '%s'\n"
+                        ,type
+                        );
+
+                return 0;
+            }
+
+            new_group->mesh->time_varying = parseFlag
+                               ("time-varying", time_varying, adios_flag_no);
+
+            if (new_group->mesh->time_varying == adios_flag_unknown)
+            {
+                return 1;
+            }
+        } else
+        if (!strcasecmp (n->value.element.name, "gwrite"))
+        {
+            const char * src = 0;
+
+            for (i = 0; i < n->value.element.num_attrs; i++)
+            {
+                mxml_attr_t * attr = &n->value.element.attrs [i];
+
+                GET_ATTR("src",attr,src,"var")
+                fprintf (stderr, "config.xml: unknown attribute '%s' on %s "
+                                 "(ignored)\n"
+                        ,attr->name
+                        ,"gwrite"
+                        );
+            }
+            if (!src)
+            {
+                fprintf (stderr, "config.xml: gwrite element requires "
+                                 "src\n");
+
+                return 0;
+            }
+        } else
+        {
+            if (!strncmp (n->value.element.name, "!--", 3)) // a comment
+            {
+                continue;
+            }
+            else
+            {
+                fprintf (stderr, "config.xml: invalid xml element: '%s'\n"
+                        ,n->value.element.name
+                        );
+
+                return 0;
+            }
+        }
+    }
+
+    // now that we have declared the whole group, validate that the
+    // paths specified in attributes refer to real things or give
+    // a warning
+    struct adios_attribute_struct * a = new_group->attributes;
+    while (a)
+    {
+        if (!validatePath (new_group->vars, a->path))
+        {
+/*
+            fprintf (stderr, "config.xml warning: attribute element '%s' "
+                             "has path '%s' that does not match "
+                             "any var path or name.\n"
+                    ,a->name, a->path
+                    );
+*/
+        }
+
+        a = a->next;
+    }
+
+    return 1;
+}
+
+static int parseAnalysis (mxml_node_t * node)
+{
+    mxml_node_t * n;
+
+    const char * group = 0;
+    const char * var = 0;
+    const char * bin_intervals = 0;
+    const char * bin_count = 0;
+    const char * bin_min = 0;
+    const char * bin_max = 0;
+
+    int i;
+    int64_t group_id;
+    struct adios_group_struct * g;
+
+    for (i = 0; i < node->value.element.num_attrs; i++)
+    {
+        mxml_attr_t * attr = &node->value.element.attrs [i];
+
+        GET_ATTR("adios-group",attr,group,"analysis")
+        GET_ATTR("var",attr,var,"analysis")
+        GET_ATTR("break-points",attr,bin_intervals,"analysis")
+        GET_ATTR("min",attr,bin_min,"analysis")
+        GET_ATTR("max",attr,bin_max,"analysis")
+        GET_ATTR("count",attr,bin_count,"analysis")
+        fprintf (stderr, "config.xml: unknown attribute '%s' on %s "
+                         "(ignored)\n"
+                ,attr->name
+                ,"method"
+                );
+    }
+
+    if (!var)
+    {
+        fprintf (stderr, "config.xml: variable name must be given\n");
+        return 0;
+    }
+
+    if (!group)
+    {
+        fprintf (stderr, "config.xml: adios-group name must be given\n");
+        return 0;
+    }
+
+    adios_common_get_group (&group_id, group);
+    g = (struct adios_group_struct *) group_id;
+
+    if (!g)
+    {
+        fprintf (stderr, "config.xml: Didn't find group %s for analysis\n", group);
+        return 0;
+    }
+    if(!adios_common_define_var_characteristics(g, var, bin_intervals, bin_min, bin_max, bin_count))
+        return 0;
+
+    return 1;
+}
+
+static int parseMethod (mxml_node_t * node)
+{
+    mxml_node_t * n;
+
+    const char * priority = 0;
+    const char * iterations = 0;
+    const char * base_path = 0;
+    const char * method = 0;
+    const char * group = 0;
+    const char * parameters = 0;
+    int p1;
+    int i1;
+    int i;
+
+    for (i = 0; i < node->value.element.num_attrs; i++)
+    {
+        mxml_attr_t * attr = &node->value.element.attrs [i];
+
+        GET_ATTR("priority",attr,priority,"method")
+        GET_ATTR("iterations",attr,iterations,"method")
+        GET_ATTR("base-path",attr,base_path,"method")
+        GET_ATTR("method",attr,method,"method")
+        GET_ATTR("group",attr,group,"method")
+        fprintf (stderr, "config.xml: unknown attribute '%s' on %s "
+                         "(ignored)\n"
+                ,attr->name
+                ,"method"
+                );
+    }
+
+    // Check for parameters, if they exist
+    n = mxmlWalkNext (node, node, MXML_DESCEND);
+    if (n != NULL)
+    {
+        parameters = n->value.text.string;
+    }
+    else
+    {
+        parameters = NULL;
+    }
+
+    if (!priority)
+        p1 = 1;
+    else
+        p1 = atoi (priority);
+    if (!iterations)
+        i1 = 1;
+    else
+        i1 = atoi (iterations);
+    if (!parameters)
+        parameters = "";
+    if (!base_path)
+        base_path = "";
+    else
+    {
+        uint16_t len = strlen (base_path);
+        if (len > 0 && base_path [len - 1] != '/')
+        {
+            fprintf (stderr, "config.xml: method %s for group %s base-path "
+                             "must end with a '/' character\n"
+                    ,method, group
+                    );
+
+            return 0;
+        }
+    }
+    if (!group)
+        group = "";
+    if (!method)
+        method = "";
+
+    if (!adios_common_select_method (p1, method, parameters, group
+                                    ,base_path, i1
+                                    )
+       )
+    {
+        return 0;
+    }
+
+    return 1;
+}
+
+static int parseBuffer (mxml_node_t * node)
+{
+    const char * size_MB = 0;
+    const char * free_memory_percentage = 0;
+    const char * allocate_time = 0;
+
+    int i;
+
+    int size = -1;
+
+    for (i = 0; i < node->value.element.num_attrs; i++)
+    {
+        mxml_attr_t * attr = &node->value.element.attrs [i];
+
+        GET_ATTR("size-MB",attr,size_MB,"method")
+        GET_ATTR("free-memory-percentage",attr,free_memory_percentage,"method")
+        GET_ATTR("allocate-time",attr,allocate_time,"method")
+        fprintf (stderr, "config.xml: unknown attribute '%s' on %s "
+                         "(ignored)\n"
+                ,attr->name
+                ,"buffer"
+                );
+    }
+
+
+
+    if ((!size_MB && !free_memory_percentage) || !allocate_time)
+    {
+        fprintf (stderr, "config.xml: must define allocate-time and either "
+                         "size-MB or free-memory-percentage for "
+                         "buffer element\n"
+                );
+
+        return 0;
+    }
+    else
+    {
+        if (!strcasecmp (allocate_time, "now"))
+        {
+            adios_buffer_alloc_when_set (ADIOS_BUFFER_ALLOC_NOW);
+        }
+        else
+        {
+            if (!strcasecmp (allocate_time, "oncall"))
+            {
+                adios_buffer_alloc_when_set (ADIOS_BUFFER_ALLOC_LATER);
+            }
+            else
+            {
+                fprintf (stderr, "config.xml: buffer allocate-time %s "
+                                 "invalid. ('now' or 'oncall')\n"
+                        ,allocate_time
+                        );
+
+                return 0;
+            }
+        }
+
+        if (size_MB)
+        {
+            adios_buffer_alloc_percentage_set (0);
+            size = atoi (size_MB);
+            if (size_MB == 0)
+            {
+                fprintf (stderr, "config.xml: buffer size-MB is either 0 or "
+                                 "cannot be parsed: %s"
+                        ,size_MB
+                        );
+
+                return 0;
+            }
+
+            if (size < 1)
+                size = 1; // we need a minimum 1 MB buffer
+
+            adios_buffer_size_requested_set ((uint64_t) size * 1024 * 1024);
+        }
+        else
+        {
+            adios_buffer_alloc_percentage_set (1);
+            size = atoi (free_memory_percentage);
+            if (size > 0 && size <= 100)
+            {
+                adios_buffer_size_requested_set ((uint64_t) size);
+            }
+            else
+            {
+                fprintf (stderr, "config.xml: buffer free-memory-percentage %s "
+                                 "is not an integer between 1 and 100\n"
+                        ,free_memory_percentage
+                        );
+
+                return 0;
+            }
+        }
+
+        if (adios_buffer_alloc_when_get() == ADIOS_BUFFER_ALLOC_NOW)
+        {
+            return adios_set_buffer_size ();
+        }
+    }
+
+    return 1;
+}
+
+int adios_parse_config (const char * config)
+{
+    FILE * fp = 0;
+    mxml_node_t * doc = NULL;
+    mxml_node_t * node = NULL;
+    mxml_node_t * root = NULL;
+    int saw_datagroup = 0;
+    int saw_method = 0;
+    int saw_buffer = 0;
+
+    if (!adios_transports_initialized)
+    {
+        adios_transports_initialized = 1;
+        adios_init_transports (&adios_transports);
+    }
+
+    char * buffer = NULL;
+//#if HAVE_MPI
+    int buffer_size = 0;
+    int rank;
+    MPI_Comm_rank (MPI_COMM_WORLD, &rank);
+    if (rank == 0)
+    {
+//#endif
+        fp = fopen (config, "r");
+        if (!fp)
+        {
+            fprintf (stderr, "missing config file %s\n", config);
+
+            return 0;
+        }
+        struct stat s;
+        if (stat (config, &s) == 0)
+        {
+            buffer = malloc (s.st_size + 1);
+            buffer [s.st_size] = 0;
+        }
+        if (buffer)
+        {
+            size_t bytes_read = fread (buffer, 1, s.st_size, fp);
+            if (bytes_read != s.st_size)
+            {
+                fprintf (stderr, "error reading config file: %s. Expected %d Got %d\n"
+                        ,config, s.st_size, bytes_read );
+
+                return 0;
+            }
+        }
+        else
+        {
+            fprintf (stderr, "error allocating %d for reading config.\n"
+                    ,s.st_size + 1
+                    );
+
+            return 0;
+        }
+        fclose (fp);
+//#if HAVE_MPI
+        buffer_size = s.st_size;
+        MPI_Bcast (&buffer_size, 1, MPI_INT, 0, MPI_COMM_WORLD);
+        MPI_Bcast (buffer, buffer_size, MPI_BYTE, 0, MPI_COMM_WORLD);
+    }
+    else
+    {
+        MPI_Bcast (&buffer_size, 1, MPI_INT, 0, MPI_COMM_WORLD);
+        buffer = malloc (buffer_size + 1);
+        if (!buffer)
+        {
+            fprintf (stderr, "cannot allocate %d bytes to receive config file\n"
+                    ,buffer_size + 1
+                    );
+
+            return 0;
+        }
+        MPI_Bcast (buffer, buffer_size, MPI_BYTE, 0, MPI_COMM_WORLD);
+        buffer [buffer_size] = 0;
+    }
+//#endif
+
+    doc = mxmlLoadString (NULL, buffer, MXML_TEXT_CALLBACK);
+    free (buffer);
+    buffer = NULL;
+
+    if (!doc)
+    {
+        fprintf (stderr, "config.xml: unknown error parsing XML "
+                         "(probably structural)\n"
+                         "Did you remember to start the file with\n"
+                         "<?xml version=\"1.0\"?>\n");
+
+        return 0;
+    }
+
+    root = doc;
+
+    while (root && root->type != MXML_ELEMENT)
+    {
+        root = mxmlWalkNext (root, doc, MXML_DESCEND);
+    }
+
+    while (!strncmp (root->value.element.name, "!--", 3))
+    {
+        root = mxmlWalkNext (root, doc, MXML_NO_DESCEND);
+        root = mxmlWalkNext (root, doc, MXML_NO_DESCEND);
+    }
+
+    if (strcasecmp (root->value.element.name, "adios-config"))
+    {
+        if (strncmp (root->value.element.name, "?xml", 4))
+        {
+            fprintf (stderr, "config.xml: invalid root xml element: %s\n"
+                    ,root->value.element.name
+                    );
+
+            mxmlRelease (doc);
+
+            return 0;
+        }
+        else
+        {
+            while (!strncmp (root->value.element.name, "!--", 3))
+            {
+                root = mxmlWalkNext (root, doc, MXML_NO_DESCEND);
+            }
+
+            root = mxmlWalkNext (root, doc, MXML_DESCEND);  // skip ver num
+            root = mxmlWalkNext (root, doc, MXML_NO_DESCEND);  // get next
+            while (!strncmp (root->value.element.name, "!--", 3))
+            {
+                root = mxmlWalkNext (root, doc, MXML_NO_DESCEND);
+                root = mxmlWalkNext (root, doc, MXML_NO_DESCEND);
+            }
+        }
+    }
+    else
+    {
+        //printf ("it is adios-config\n");
+    }
+
+
+    if (strcasecmp (root->value.element.name, "adios-config"))
+    {
+        fprintf (stderr, "config.xml: invalid root xml element: %s\n"
+                ,root->value.element.name
+                );
+
+        mxmlRelease (doc);
+
+        return 0;
+    }
+    else
+    {
+        const char * host_language = 0;
+        int i;
+
+        for (i = 0; i < root->value.element.num_attrs; i++)
+        {
+            mxml_attr_t * attr = &root->value.element.attrs [i];
+
+            GET_ATTR("host-language",attr,host_language,"var")
+            fprintf (stderr, "config.xml: unknown attribute '%s' on %s "
+                             "(ignored)\n"
+                    ,attr->name
+                    ,"adios-config"
+                    );
+        }
+
+        if (!host_language)
+        {
+            host_language = "Fortran";
+        }
+
+        if (!strcasecmp (host_language, "Fortran"))
+        {
+            adios_host_language_fortran = adios_flag_yes;
+        }
+        else
+        {
+            if (!strcasecmp (host_language, "C"))
+            {
+                adios_host_language_fortran = adios_flag_no;
+            }
+            else
+            {
+                fprintf (stderr, "config.xml: invalid host-language %s"
+                        ,host_language
+                        );
+
+                mxmlRelease (doc);
+
+                return 0;
+            }
+        }
+    }
+
+    for (node = mxmlWalkNext (root, doc, MXML_DESCEND_FIRST)
+        ;node
+        ;node = mxmlWalkNext (node, root, MXML_NO_DESCEND)
+        )
+    {
+        if (node->type != MXML_ELEMENT)
+        {
+            continue;
+        }
+
+        if (!strcasecmp (node->value.element.name, "adios-group"))
+        {
+            if (!parseGroup (node))
+                break;
+            saw_datagroup = 1;
+        }
+        else
+        {
+            if (   !strcasecmp (node->value.element.name, "transport")
+                || !strcasecmp (node->value.element.name, "method")
+               )
+            {
+                if (!parseMethod (node))
+                    break;
+                saw_method = 1;
+            }
+            else
+            {
+                if (!strcasecmp (node->value.element.name, "buffer"))
+                {
+                    if (!parseBuffer (node))
+                        break;
+                    saw_buffer = 1;
+                }
+				else
+				{
+                    if (!strcasecmp (node->value.element.name, "analysis"))
+                    {
+                        if (!parseAnalysis(node))
+                            break;
+                    }
+                	else
+                	{
+                	    if (!strncmp (node->value.element.name, "!--", 3))
+                	    {
+                	        continue;
+                	    }
+                	    else
+                	    {
+                	        fprintf (stderr, "config.xml: invalid element: %s\n"
+                	                ,node->value.element.name
+                	                );
+
+                	        break;
+                	    }
+					}
+                }
+            }
+        }
+    }
+
+    mxmlRelease (doc);
+
+    if (!saw_datagroup)
+    {
+        fprintf (stderr, "config.xml: must define at least 1 adios-group in "
+                         "config.xml\n"
+                );
+
+        return 0;
+    }
+    if (!saw_method)
+    {
+        fprintf (stderr, "config.xml: must define at least 1 method for "
+                         "the adios-group in config.xml\n"
+                );
+
+        return 0;
+    }
+    if (!saw_buffer)
+    {
+        fprintf (stderr, "config.xml: must define the buffer element in "
+                         "config.xml\n"
+                );
+
+        return 0;
+    }
+
+    return 1;
+}
+
+int adios_local_config ()
+{
+    if (!adios_transports_initialized)
+    {
+        adios_transports_initialized = 1;
+        adios_init_transports (&adios_transports);
+    }
+
+    return 1;
+}
+
+int adios_common_select_method (int priority, const char * method
+                               ,const char * parameters, const char * group
+                               ,const char * base_path, int iters
+                               )
+{
+    int64_t group_id;
+    struct adios_group_struct * g;
+    struct adios_method_struct * new_method;
+    int requires_group_comm = 0;
+
+    new_method = (struct adios_method_struct *)
+                           malloc (sizeof (struct adios_method_struct));
+    
+    new_method->m = ADIOS_METHOD_UNKNOWN;
+    new_method->base_path = strdup (base_path);
+    new_method->method = strdup (method);
+    new_method->parameters = strdup (parameters);
+    new_method->iterations = iters;
+    new_method->priority = priority;
+    new_method->method_data = 0;
+    new_method->group = 0;
+
+    if (adios_parse_method (method, &new_method->m, &requires_group_comm))
+    {
+        if (   new_method->m != ADIOS_METHOD_UNKNOWN
+            && new_method->m != ADIOS_METHOD_NULL
+            && adios_transports [new_method->m].adios_init_fn
+           )
+        {
+            adios_transports [new_method->m].adios_init_fn
+                                       (parameters, new_method);
+        }
+    }
+    else
+    {
+        fprintf (stderr, "config.xml: invalid transport: %s\n", method);
+
+        free (new_method->base_path);
+        free (new_method->method);
+        free (new_method->parameters);
+        free (new_method);
+
+        return 0;
+    }
+
+    adios_common_get_group (&group_id, group);
+    g = (struct adios_group_struct *) group_id;
+    if (!g)
+    {
+        fprintf (stderr, "config.xml: Didn't find group: %s for transport: %s\n"
+                ,group, method
+                );
+
+        free (new_method->base_path);
+        free (new_method->method);
+        free (new_method->parameters);
+        free (new_method);
+
+        return 0;
+    }
+    else
+    {
+        // JL: 1-2010
+        // we no longer require this since we moved the coordiantion
+        // communicator to the open call. Leaving code here, just in case.
+        // once this has been validated thoroughly, remove this block of code.
+        //if (requires_group_comm && !g->group_comm)
+        //{
+        //    fprintf (stderr, "config.xml: method %s for group %s.  Group does "
+        //                     "not have the required coordination-communicator"
+        //                     ".\n"
+        //            ,method, group
+        //            );
+
+        //    free (new_method->base_path);
+        //    free (new_method->method);
+        //    free (new_method->parameters);
+        //    free (new_method);
+
+        //    return 0;
+        //}
+        adios_add_method_to_group (&g->methods, new_method);
+        new_method->group = g;
+    }
+
+    adios_append_method (new_method);
+
+    return 1;
+}
+
+int adios_common_select_method_by_group_id (int priority, const char * method
+                                           ,const char * parameters, int64_t group_id
+                                           ,const char * base_path, int iters
+                                           )
+{
+    struct adios_group_struct * g;
+    struct adios_method_struct * new_method;
+    int requires_group_comm = 0;
+
+    new_method = (struct adios_method_struct *)
+                           malloc (sizeof (struct adios_method_struct));
+
+    new_method->m = ADIOS_METHOD_UNKNOWN;
+    new_method->base_path = strdup (base_path);
+    new_method->method = strdup (method);
+    new_method->parameters = strdup (parameters);
+    new_method->iterations = iters;
+    new_method->priority = priority;
+    new_method->method_data = 0;
+    new_method->group = 0;
+
+    if (adios_parse_method (method, &new_method->m, &requires_group_comm))
+    {
+        if (   new_method->m != ADIOS_METHOD_UNKNOWN
+            && new_method->m != ADIOS_METHOD_NULL
+            && adios_transports [new_method->m].adios_init_fn
+           )
+        {
+            adios_transports [new_method->m].adios_init_fn
+                                       (parameters, new_method);
+        }
+    }
+    else
+    {
+        fprintf (stderr, "config.xml: invalid transport: %s\n", method);
+
+        free (new_method->base_path);
+        free (new_method->method);
+        free (new_method->parameters);
+        free (new_method);
+
+        return 0;
+    }
+
+    g = (struct adios_group_struct *) group_id;
+    if (!g)
+    {
+        fprintf (stderr, "config.xml: invalid group id: %llu for transport: %s\n"
+                ,group_id, method
+                );
+
+        free (new_method->base_path);
+        free (new_method->method);
+        free (new_method->parameters);
+        free (new_method);
+
+        return 0;
+    }
+    else
+    {
+        if (requires_group_comm && !g->group_comm)
+        {
+            fprintf (stderr, "config.xml: method %s for group %s.  Group does "
+                             "not have the required coordination-communicator"
+                             ".\n"
+                    ,method, g->name
+                    );
+
+            free (new_method->base_path);
+            free (new_method->method);
+            free (new_method->parameters);
+            free (new_method);
+
+            return 0;
+        }
+        adios_add_method_to_group (&g->methods, new_method);
+        new_method->group = g;
+    }
+
+    adios_append_method (new_method);
+
+    return 1;
+}
+
+void adios_cleanup ()
+{
+    adios_transports_initialized = 0;
+    if (adios_transports)
+        free (adios_transports);
+    adios_transports = 0;
+
+    while (adios_methods)
+    {
+        struct adios_method_list_struct * methods = adios_methods->next;
+        if (adios_methods->method->base_path)
+            free (adios_methods->method->base_path);
+        if (adios_methods->method->method)
+            free (adios_methods->method->method);
+        if (adios_methods->method->method_data)
+            free (adios_methods->method->method_data);
+        if (adios_methods->method->parameters)
+            free (adios_methods->method->parameters);
+        free (adios_methods->method);
+        free (adios_methods);
+        adios_methods = methods;
+    }
+
+    while (adios_groups)
+    {
+        struct adios_group_list_struct * groups = adios_groups->next;
+
+        if (adios_groups->group->name)
+            free (adios_groups->group->name);
+
+        while (adios_groups->group->vars)
+        {
+            struct adios_var_struct * vars = adios_groups->group->vars->next;
+
+            if (adios_groups->group->vars->name)
+                free (adios_groups->group->vars->name);
+            if (adios_groups->group->vars->path)
+                free (adios_groups->group->vars->path);
+
+            while (adios_groups->group->vars->dimensions)
+            {
+                struct adios_dimension_struct * dimensions
+                                = adios_groups->group->vars->dimensions->next;
+
+                free (adios_groups->group->vars->dimensions);
+                adios_groups->group->vars->dimensions = dimensions;
+            }
+
+			// NCSU - Clean up stat
+            if (adios_groups->group->vars->stats)
+			{
+				int j, idx;
+				int c, count = 1;
+
+				if (adios_groups->group->vars->type == adios_complex || adios_groups->group->vars->type == adios_double_complex)
+					count = 3;
+
+				for (c = 0; c < count; c ++)
+				{
+					j = idx = 0;
+					while (adios_groups->group->vars->bitmap >> j)
+					{
+						if (adios_groups->group->vars->bitmap >> j & 1)
+						{
+                            if (j == adios_statistic_hist)
+                            {
+								struct adios_index_characteristics_hist_struct * hist = (struct adios_index_characteristics_hist_struct *) adios_groups->group->vars->stats[c][idx].data;
+								free (hist->breaks);
+								free (hist->frequencies);
+								free (hist);
+							}
+						    else
+								free (adios_groups->group->vars->stats[c][idx].data);
+							idx ++;
+						}
+						j ++;
+					}
+				}
+
+                free (adios_groups->group->vars->stats);
+			}
+            if (adios_groups->group->vars->data)
+                free (adios_groups->group->vars->data);
+
+            free (adios_groups->group->vars);
+            adios_groups->group->vars = vars;
+        }
+
+        while (adios_groups->group->attributes)
+        {
+            struct adios_attribute_struct * attributes
+                                        = adios_groups->group->attributes->next;
+
+            if (adios_groups->group->attributes->name)
+                free (adios_groups->group->attributes->name);
+            if (adios_groups->group->attributes->path)
+                free (adios_groups->group->attributes->path);
+            if (adios_groups->group->attributes->value)
+                free (adios_groups->group->attributes->value);
+
+            free (adios_groups->group->attributes);
+            adios_groups->group->attributes = attributes;
+        }
+
+        if (adios_groups->group->group_comm)
+            free (adios_groups->group->group_comm);
+        if (adios_groups->group->group_by)
+            free (adios_groups->group->group_by);
+        if (adios_groups->group->time_index_name)
+            free (adios_groups->group->time_index_name);
+
+        while (adios_groups->group->methods)
+        {
+            struct adios_method_list_struct * m = adios_groups->group->methods->next;
+            free (adios_groups->group->methods);
+            adios_groups->group->methods = m;
+        }
+
+        if (adios_groups->group->mesh)
+        {
+            switch (adios_groups->group->mesh->type)
+            {
+                case ADIOS_MESH_UNIFORM:
+                {
+                    struct adios_mesh_item_list_struct * i;
+                    while (adios_groups->group->mesh->uniform->dimensions)
+                    {
+                        i = adios_groups->group->mesh->uniform->dimensions->next;
+                        free (adios_groups->group->mesh->uniform->dimensions);
+                        adios_groups->group->mesh->uniform->dimensions = i;
+                    }
+                    while (adios_groups->group->mesh->uniform->origin)
+                    {
+                        i = adios_groups->group->mesh->uniform->origin->next;
+                        free (adios_groups->group->mesh->uniform->origin);
+                        adios_groups->group->mesh->uniform->origin = i;
+                    }
+                    while (adios_groups->group->mesh->uniform->spacing)
+                    {
+                        i = adios_groups->group->mesh->uniform->spacing->next;
+                        free (adios_groups->group->mesh->uniform->spacing);
+                        adios_groups->group->mesh->uniform->spacing = i;
+                    }
+
+                    break;
+                }
+
+                case ADIOS_MESH_STRUCTURED:
+                {
+                    struct adios_mesh_item_list_struct * i;
+                    struct adios_mesh_var_list_struct * v;
+                    while (adios_groups->group->mesh->structured->dimensions)
+                    {
+                        i = adios_groups->group->mesh->structured->dimensions->next;
+                        free (adios_groups->group->mesh->structured->dimensions);
+                        adios_groups->group->mesh->structured->dimensions = i;
+                    }
+                    while (adios_groups->group->mesh->structured->points)
+                    {
+                        v = adios_groups->group->mesh->structured->points->next;
+                        free (adios_groups->group->mesh->structured->points);
+                        adios_groups->group->mesh->structured->points = v;
+                    }
+                    if (adios_groups->group->mesh->structured->nspace)
+                        free (adios_groups->group->mesh->structured->nspace);
+
+                    break;
+                }
+
+                case ADIOS_MESH_RECTILINEAR:
+                {
+                    struct adios_mesh_item_list_struct * i;
+                    struct adios_mesh_var_list_struct * v;
+                    while (adios_groups->group->mesh->rectilinear->dimensions)
+                    {
+                        i = adios_groups->group->mesh->rectilinear->dimensions->next;
+                        free (adios_groups->group->mesh->rectilinear->dimensions);
+                        adios_groups->group->mesh->rectilinear->dimensions = i;
+                    }
+                    while (adios_groups->group->mesh->rectilinear->coordinates)
+                    {
+                        v = adios_groups->group->mesh->rectilinear->coordinates->next;
+                        free (adios_groups->group->mesh->rectilinear->coordinates);
+                        adios_groups->group->mesh->rectilinear->coordinates = v;
+                    }
+
+                    break;
+                }
+
+                case ADIOS_MESH_UNSTRUCTURED:
+                {
+                    if (adios_groups->group->mesh->unstructured->components)
+                        free (adios_groups->group->mesh->unstructured->components);
+                    if (adios_groups->group->mesh->unstructured->points_count)
+                        free (adios_groups->group->mesh->unstructured->points_count);
+                    while (adios_groups->group->mesh->unstructured->cell_list)
+                    {
+                        struct adios_mesh_cell_list_list_struct * next
+                          = adios_groups->group->mesh->unstructured->cell_list->next;
+                        free (adios_groups->group->mesh->unstructured->cell_list);
+                        adios_groups->group->mesh->unstructured->cell_list = next;
+                    }
+
+                    break;
+                }
+            }
+
+            free (adios_groups->group->mesh);
+        }
+
+        free (adios_groups->group);
+        free (adios_groups);
+        adios_groups = groups;
+    }
+}
+
+
diff --git a/src/adios_internals_mxml.h b/src/adios_internals_mxml.h
new file mode 100644
index 0000000..e67dc7e
--- /dev/null
+++ b/src/adios_internals_mxml.h
@@ -0,0 +1,28 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#ifndef ADIOS_INTERNALS_MXML_H
+#define ADIOS_INTERNALS_MXML_H
+
+int adios_parse_config (const char * config);
+int adios_local_config ();
+int adios_common_select_method (int priority, const char * method
+                               ,const char * parameters, const char * group 
+                               ,const char * base_path, int iters
+                               );
+int adios_common_select_method_by_group_id (int priority, const char * method
+                                           ,const char * parameters, int64_t group_id
+                                           ,const char * base_path, int iters
+                                           );
+void adios_cleanup ();
+
+int adios_set_buffer_size (void);
+
+uint64_t adios_method_buffer_alloc (uint64_t size);
+int adios_method_buffer_free (uint64_t size);
+
+#endif
diff --git a/src/adios_mpi.c b/src/adios_mpi.c
new file mode 100644
index 0000000..10d1414
--- /dev/null
+++ b/src/adios_mpi.c
@@ -0,0 +1,2452 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#if defined(__APPLE__)
+#	include <sys/param.h>
+#	include <sys/mount.h>
+#else
+#	include <sys/vfs.h>
+#endif
+#include <sys/ioctl.h>
+#include <assert.h>
+
+// mpi
+#include "mpi.h"
+
+// xml parser
+#include <mxml.h>
+
+#include "adios.h"
+#include "adios_transport_hooks.h"
+#include "adios_bp_v1.h"
+#include "adios_internals.h"
+#include "buffer.h"
+
+static int adios_mpi_initialized = 0;
+
+#define COLLECT_METRICS 0
+
+
+struct adios_MPI_data_struct
+{
+    MPI_File fh;
+    MPI_Request req;
+    MPI_Status status;
+    MPI_Comm group_comm;
+    MPI_Info info;      // set with base hints for Lustre
+    int rank;
+    int size;
+
+    void * comm; // used to pass from open to should_buffer until cleaned up
+
+    struct adios_bp_buffer_struct_v1 b;
+
+    struct adios_index_process_group_struct_v1 * old_pg_root;
+    struct adios_index_var_struct_v1 * old_vars_root;
+    struct adios_index_attribute_struct_v1 * old_attrs_root;
+
+    uint64_t vars_start;
+    uint64_t vars_header_size;
+    uint16_t storage_targets;  // number of storage targets being used
+};
+
+#if COLLECT_METRICS
+// see adios_adaptive_finalize for what each represents
+struct timeval_writer
+{
+    struct timeval t;  // time value
+    int pid;            // process id
+};
+
+static
+int timeval_writer_compare (const void * left, const void * right)
+{
+    struct timeval_writer * l = (struct timeval_writer *) left;
+    struct timeval_writer * r = (struct timeval_writer *) right;
+
+    if (l->pid < r->pid) return -1;
+    if (l->pid == r->pid) return 0;
+    if (l->pid > r->pid) return 1;
+}
+
+struct timing_metrics
+{
+    struct timeval t0, t5, t6, t7, t8, t11, t12, t13;
+    struct timeval t14, t16, t19, t20, t21, t22, t23;
+    struct timeval t27, t28;
+
+    uint64_t write_count; // number used
+    uint64_t write_size;  // number allocated
+    struct timeval * t24;
+};
+
+static struct timing_metrics timing;
+
+// Subtract the `struct timeval' values X and Y,
+// storing the result in RESULT.
+// Return 1 if the difference is negative, otherwise 0.
+static int timeval_subtract (struct timeval * result
+                            ,struct timeval * x, struct timeval * y
+                            )
+{
+  // Perform the carry for the later subtraction by updating y.
+  if (x->tv_usec < y->tv_usec)
+  {
+    int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1;
+    y->tv_usec -= 1000000 * nsec;
+    y->tv_sec += nsec;
+  }
+  if (x->tv_usec - y->tv_usec > 1000000)
+  {
+    int nsec = (x->tv_usec - y->tv_usec) / 1000000;
+    y->tv_usec += 1000000 * nsec;
+    y->tv_sec -= nsec;
+  }
+
+  // Compute the time remaining to wait.
+  // tv_usec is certainly positive.
+  result->tv_sec = x->tv_sec - y->tv_sec;
+  result->tv_usec = x->tv_usec - y->tv_usec;
+
+  // Return 1 if result is negative.
+  return x->tv_sec < y->tv_sec;
+}
+
+static void print_metric (FILE * f, struct timing_metrics * t, int iteration, int rank, int size, int sub_coord_rank);
+
+static
+void print_metrics (struct adios_MPI_data_struct * md, int iteration)
+{
+    MPI_Barrier (md->group_comm);
+    if (md->rank == 0)
+    {
+        int i;
+        struct timing_metrics * t;
+        int * sub_coord_ranks;
+
+        t = malloc (sizeof (struct timing_metrics) * md->size);
+        sub_coord_ranks = malloc (sizeof (int) * md->size);
+
+        memcpy (&t [0], &timing, sizeof (struct timing_metrics));
+
+        // get the bulk data
+        MPI_Gather (&timing, sizeof (struct timing_metrics), MPI_BYTE
+                   ,t, sizeof (struct timing_metrics), MPI_BYTE
+                   ,0, md->group_comm
+                   );
+
+        // get the write timing
+        int * index_sizes = malloc (4 * md->size);
+        int * index_offsets = malloc (4 * md->size);
+        uint32_t total_size = 0;
+        char * recv_buffer = 0;
+        char * recv_buffer1 = 0;
+        char * recv_buffer2 = 0;
+        char * recv_buffer3 = 0;
+        for (i = 0; i < md->size; i++)
+        {
+            index_sizes [i] = t [i].write_count * sizeof (struct timeval);
+            index_offsets [i] = total_size;
+            total_size += t [i].write_count * sizeof (struct timeval);
+        }
+
+        recv_buffer = malloc (total_size + 1);
+
+        MPI_Gatherv (t [0].t24, 0, MPI_BYTE
+                    ,recv_buffer, index_sizes, index_offsets, MPI_BYTE
+                    ,0, md->group_comm
+                    );
+
+        t [0].t24 = timing.t24;
+        for (i = 1; i < md->size; i++)
+        {
+            t [i].t24 = (struct timeval *) (recv_buffer + index_offsets [i]);
+        }
+
+        // print the detailed metrics
+        FILE * f = fopen ("adios_metrics", "a");
+        for (i = 0; i < md->size; i++)
+        {
+            print_metric (f, &t [i], iteration, i, md->size
+                         ,sub_coord_ranks [i]
+                         );
+        }
+        fclose (f);
+
+        free (sub_coord_ranks);
+        free (t);
+        free (recv_buffer);
+        free (recv_buffer1);
+        free (recv_buffer2);
+        free (recv_buffer3);
+        free (index_sizes);
+        free (index_offsets);
+    }
+    else
+    {
+        // send the bulk data
+        MPI_Gather (&timing, sizeof (struct timing_metrics), MPI_BYTE
+                   ,&timing, sizeof (struct timing_metrics), MPI_BYTE
+                   ,0, md->group_comm
+                   );
+
+        // send the write timing
+        MPI_Gatherv (timing.t24, timing.write_count * sizeof (struct timeval)
+                    ,MPI_BYTE
+                    ,0, 0, 0, 0
+                    ,0, md->group_comm
+                    );
+    }
+    MPI_Barrier (md->group_comm);
+}
+
+static void print_metric (FILE * f, struct timing_metrics * t, int iteration, int rank, int size, int sub_coord_rank)
+{
+    struct timeval diff;
+    if (rank == 0)
+    {
+        timeval_subtract (&diff, &t->t6, &t->t5);
+        fprintf (f, "dd\t%2d\tMass file open:\t%02d.%06d\n"
+                ,iteration, diff.tv_sec, diff.tv_usec);
+
+        timeval_subtract (&diff, &t->t5, &t->t16);
+        fprintf (f, "ee\t%2d\tBuild file offsets:\t%02d.%06d\n"
+                ,iteration, diff.tv_sec, diff.tv_usec);
+
+        timeval_subtract (&diff, &t->t11, &t->t0);
+        fprintf (f, "hh\t%2d\tTotal time:\t%02d.%06d\n"
+                ,iteration, diff.tv_sec, diff.tv_usec);
+    }
+    
+    timeval_subtract (&diff, &t->t13, &t->t12);
+    fprintf (f, "ii\t%2d\tLocal index creation:\t%6d\t%02d.%06d\n"
+            ,iteration, rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t->t22, &t->t21);
+    fprintf (f, "kk\t%2d\tshould buffer time:\t%6d\t%02d.%06d\n"
+            ,iteration, rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t->t19, &t->t23);
+    fprintf (f, "ll\t%2d\tclose startup time:\t%6d\t%02d.%06d\n"
+            ,iteration, rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t->t19, &t->t0);
+    fprintf (f, "mm\t%2d\tsetup time:\t%6d\t%02d.%06d\n"
+            ,iteration, rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t->t14, &t->t20);
+    fprintf (f, "nn\t%2d\tcleanup time:\t%6d\t%02d.%06d\n"
+            ,iteration, rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t->t21, &t->t0);
+    fprintf (f, "oo\t%2d\topen->should_buffer time:\t%6d\t%02d.%06d\n"
+            ,iteration, rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &(t->t24 [0]), &t->t21);
+    fprintf (f, "pp\t%2d\tshould_buffer->write1 time:\t%6d\t%02d.%06d\n"
+            ,iteration, rank, diff.tv_sec, diff.tv_usec);
+
+    fprintf (f, "aa\t%2d\tprocess write time:\t%6d\t%02d.%06d\n"
+            ,iteration, rank, t->t8.tv_sec, t->t8.tv_usec);
+
+    timeval_subtract (&diff, &t->t11, &t->t23);
+    fprintf (f, "vv\t%2d\tclose start to shutdown time:\t%6d\t%02d.%06d\n"
+           ,iteration, rank, (int)diff.tv_sec, (int)diff.tv_usec);
+
+    timeval_subtract (&diff, &t->t28, &t->t23);
+    fprintf (f, "ww\t%2d\tclose total time:\t%6d\t%02d.%06d\n"
+            ,iteration, rank, (int)diff.tv_sec, (int)diff.tv_usec);
+}
+#endif
+
+static void adios_var_to_comm (const char * comm_name
+                              ,enum ADIOS_FLAG host_language_fortran
+                              ,void * data
+                              ,MPI_Comm * comm
+                              )
+{
+    if (data)
+    {
+        int t = *(int *) data;
+
+        if (!comm_name)
+        {
+            if (!t)
+            {
+                fprintf (stderr, "communicator not provided and none "
+                                 "listed in XML.  Defaulting to "
+                                 "MPI_COMM_SELF\n"
+                        );
+
+                *comm = MPI_COMM_SELF;
+            }
+            else
+            {
+                if (host_language_fortran == adios_flag_yes)
+                {
+                    *comm = MPI_Comm_f2c (t);
+                }
+                else
+                {
+                    *comm = *(MPI_Comm *) data;
+                }
+            }
+        }
+        else
+        {
+            if (!strcmp (comm_name, ""))
+            {
+                if (!t)
+                {
+                    fprintf (stderr, "communicator not provided and none "
+                                     "listed in XML.  Defaulting to "
+                                     "MPI_COMM_SELF\n"
+                            );
+
+                    *comm = MPI_COMM_SELF;
+                }
+                else
+                {
+                    if (host_language_fortran == adios_flag_yes)
+                    {
+                        *comm = MPI_Comm_f2c (t);
+                    }
+                    else
+                    {
+                        *comm = *(MPI_Comm *) data;
+                    }
+                }
+            }
+            else
+            {
+                if (!t)
+                {
+                    fprintf (stderr, "communicator not provided but one "
+                                     "listed in XML.  Defaulting to "
+                                     "MPI_COMM_WORLD\n"
+                            );
+
+                    *comm = MPI_COMM_WORLD;
+                }
+                else
+                {
+                    if (host_language_fortran == adios_flag_yes)
+                    {
+                        *comm = MPI_Comm_f2c (t);
+                    }
+                    else
+                    {
+                        *comm = *(MPI_Comm *) data;
+                    }
+                }
+            }
+        }
+    }
+    else
+    {
+        fprintf (stderr, "coordination-communication not provided. "
+                         "Using MPI_COMM_WORLD instead\n"
+                );
+
+        *comm = MPI_COMM_WORLD;
+    }
+}
+
+void adios_mpi_init (const char * parameters
+                    ,struct adios_method_struct * method
+                    )
+{
+    struct adios_MPI_data_struct * md = (struct adios_MPI_data_struct *)
+                                                    method->method_data;
+    if (!adios_mpi_initialized)
+    {
+        adios_mpi_initialized = 1;
+    }
+    method->method_data = malloc (sizeof (struct adios_MPI_data_struct));
+    md = (struct adios_MPI_data_struct *) method->method_data;
+    md->fh = 0;
+    md->req = 0;
+    memset (&md->status, 0, sizeof (MPI_Status));
+    MPI_Info_create (&md->info);
+    MPI_Info_set (md->info, "romio_ds_read", "disable");
+    MPI_Info_set (md->info, "romio_ds_write", "disable");
+    MPI_Info_set (md->info, "ind_wr_buffer_size", "16777216");
+    md->rank = 0;
+    md->size = 0;
+    md->group_comm = MPI_COMM_NULL;
+    md->old_pg_root = 0;
+    md->old_vars_root = 0;
+    md->old_attrs_root = 0;
+    md->vars_start = 0;
+    md->vars_header_size = 0;
+    md->storage_targets = 0;
+
+    adios_buffer_struct_init (&md->b);
+#if COLLECT_METRICS
+    // init the pointer for the first go around avoiding the bad free in open
+    timing.t24 = 0;
+#endif
+}
+
+int adios_mpi_open (struct adios_file_struct * fd
+                   ,struct adios_method_struct * method, void * comm
+                   )
+{
+    struct adios_MPI_data_struct * md = (struct adios_MPI_data_struct *)
+                                                    method->method_data;
+
+#if COLLECT_METRICS
+    gettimeofday (&timing.t0, NULL); // only used on rank == size - 1, but we don't
+                              // have the comm yet to get the rank/size
+#endif
+    // we have to wait for the group_size (should_buffer) to get the comm
+    // before we can do an open for any of the modes
+    md->comm = comm;
+
+#if COLLECT_METRICS
+    timing.write_count = 0;
+    timing.write_size = 0;
+    if (timing.t24) free (timing.t24);
+    timing.t24 = 0;
+#endif
+
+    return 1;
+}
+
+static
+void build_offsets (struct adios_bp_buffer_struct_v1 * b
+                   ,MPI_Offset * offsets, int size, char * group_name
+                   ,struct adios_index_process_group_struct_v1 * pg_root
+                   )
+{
+    while (pg_root)
+    {
+        if (!strcasecmp (pg_root->group_name, group_name))
+        {
+            MPI_Offset size = 0;
+
+            if (pg_root->next)
+            {
+                size = pg_root->next->offset_in_file - pg_root->offset_in_file;
+            }
+            else
+            {
+                size = b->pg_index_offset - pg_root->offset_in_file;
+            }
+
+            offsets [pg_root->process_id * 3] = pg_root->offset_in_file;
+            offsets [pg_root->process_id * 3 + 1] = size;
+            offsets [pg_root->process_id * 3 + 2] = b->version;
+        }
+
+        pg_root = pg_root->next;
+    }
+}
+
+static void
+adios_mpi_build_file_offset(struct adios_MPI_data_struct *md,
+                            struct adios_file_struct *fd, char *name)
+{
+    if (md->group_comm != MPI_COMM_NULL)
+    {
+        if (md->rank == 0)
+        {
+            // make one space for offset and one for size
+            MPI_Offset * offsets = malloc(sizeof (MPI_Offset)
+                                           * md->size);
+            int i;
+
+            offsets [0] = fd->write_size_bytes;
+// mpixlc_r on Eugene doesn't support 64 bit mode. Therefore the following may have problem
+// on Eugene for large data size since MPI_LONG_LONG is 32bit 
+            MPI_Gather (&(fd->write_size_bytes), 1, MPI_LONG_LONG
+                       ,offsets, 1, MPI_LONG_LONG
+                       ,0, md->group_comm);
+
+// top section: make things a consistent stripe size
+// bottom section: just pack the file
+#if 0
+            // find the largest and use that as a basis for stripe
+            // size for each process writing
+            uint64_t biggest_size = 0;
+            for (i = 0; i < md->size; i++)
+            {
+                if (offsets [i] > biggest_size)
+                    biggest_size = offsets [i];
+            }
+            // now round up to the next stripe size increment (Lustre: 64 KB)
+#define STRIPE_INCREMENT (64 * 1024)
+            // (according to the Lustre reps, use 1 MB instead of 64 KB?)
+//#define STRIPE_INCREMENT (1024 * 1024)
+            if (biggest_size % (STRIPE_INCREMENT))
+            {
+                biggest_size = (  ((biggest_size / STRIPE_INCREMENT) + 1)
+                                * STRIPE_INCREMENT
+                               );
+            }
+            // also round up the base_offset, just in case
+            if (fd->base_offset % (STRIPE_INCREMENT))
+            {
+                fd->base_offset = (  ((fd->base_offset / STRIPE_INCREMENT) + 1)
+                                   * STRIPE_INCREMENT
+                                  );
+            }
+#undef STRIPE_INCREMENT
+            offsets [0 + 0] = fd->base_offset;
+            offsets [0 + 1] = biggest_size;
+
+            for (i = 1; i < md->size; i++)
+            {
+                offsets [i * 2 + 0] = offsets [(i - 1) * 2 + 0] + biggest_size;
+                offsets [i * 2 + 1] = biggest_size;
+            }
+            md->b.pg_index_offset =   offsets [(md->size - 1) * 2 + 0]
+                                    + biggest_size;
+#else
+
+            uint64_t last_offset = offsets [0];
+            offsets [0] = fd->base_offset;
+            for (i = 1; i < md->size; i++)
+            {
+                uint64_t this_offset = offsets [i];
+                offsets [i] = offsets [i - 1] + last_offset;
+                last_offset = this_offset;
+            }
+            md->b.pg_index_offset =   offsets [md->size - 1]
+                                    + last_offset;
+#endif
+            MPI_Scatter (offsets, 1, MPI_LONG_LONG
+                        ,offsets, 1, MPI_LONG_LONG
+                        ,0, md->group_comm
+                        );
+            fd->base_offset = offsets [0];
+            fd->pg_start_in_file = fd->base_offset;
+            free (offsets);
+        }
+        else
+        {
+            MPI_Offset offset[1];
+            offset[0] = fd->write_size_bytes;
+
+            MPI_Gather (offset, 1, MPI_LONG_LONG
+                       ,offset, 1, MPI_LONG_LONG
+                       ,0, md->group_comm
+                       );
+
+            MPI_Scatter (offset, 1, MPI_LONG_LONG
+                        ,offset, 1, MPI_LONG_LONG
+                        ,0, md->group_comm
+                        );
+            fd->base_offset = offset [0];
+            fd->pg_start_in_file = fd->base_offset;
+        }
+    }
+    else
+    {
+        md->b.pg_index_offset = fd->write_size_bytes;
+    }
+}
+
+#if 0
+// LUSTRE Structure
+// from /usr/include/lustre/lustre_user.h
+#define LUSTRE_SUPER_MAGIC 0x0BD00BD0
+#  define LOV_USER_MAGIC 0x0BD10BD0
+#  define LL_IOC_LOV_SETSTRIPE  _IOW ('f', 154, long)
+#  define LL_IOC_LOV_GETSTRIPE  _IOW ('f', 155, long)
+struct lov_user_ost_data {           // per-stripe data structure
+        uint64_t l_object_id;        // OST object ID
+        uint64_t l_object_gr;        // OST object group (creating MDS number)
+        uint32_t l_ost_gen;          // generation of this OST index
+        uint32_t l_ost_idx;          // OST index in LOV
+} __attribute__((packed));
+struct lov_user_md {                 // LOV EA user data (host-endian)
+        uint32_t lmm_magic;          // magic number = LOV_USER_MAGIC_V1
+        uint32_t lmm_pattern;        // LOV_PATTERN_RAID0, LOV_PATTERN_RAID1
+        uint64_t lmm_object_id;      // LOV object ID
+        uint64_t lmm_object_gr;      // LOV object group
+        uint32_t lmm_stripe_size;    // size of stripe in bytes
+        uint16_t lmm_stripe_count;   // num stripes in use for this object
+        uint16_t lmm_stripe_offset;  // starting stripe offset in lmm_objects
+        struct lov_user_ost_data  lmm_objects[0]; // per-stripe data
+} __attribute__((packed));
+
+// do the magic ioctl calls to set Lustre's stripe size
+static void set_stripe_size (struct adios_file_struct * fd
+                            ,struct adios_MPI_data_struct * md
+                            ,const char * filename
+                            )
+{
+    struct statfs fsbuf;
+    int err;
+
+    // Note: Since each file might have different write_buffer,
+    // So we will reset write_buffer even buffer_size != 0
+    err = statfs (filename, &fsbuf);
+    if (!err && fsbuf.f_type == LUSTRE_SUPER_MAGIC)
+    {
+        int f;
+        int old_mask;
+        int perm;
+
+        old_mask = umask (022);
+        umask (old_mask);
+        perm = old_mask ^ 0666;
+
+        f = open (filename, O_RDONLY | O_CREAT, perm);
+        if (f != -1)
+        {
+            struct lov_user_md lum;
+            lum.lmm_magic = LOV_USER_MAGIC;
+            lum.lmm_stripe_size = md->biggest_size;
+            err = ioctl (f, LL_IOC_LOV_SETSTRIPE, (void *) &lum);
+            // if err != 0, the must not be Lustre
+            lum.lmm_stripe_count = 0;
+            err = ioctl (f, LL_IOC_LOV_GETSTRIPE, (void *) &lum);
+            // if err != 0, the must not be Lustre
+            if (err == 0)
+            {
+                md->storage_targets = lum.lmm_stripe_count;
+            }
+            close (f);
+        }
+    }
+}
+#endif
+
+enum ADIOS_FLAG adios_mpi_should_buffer (struct adios_file_struct * fd
+                                        ,struct adios_method_struct * method
+                                        )
+{
+    int i;
+    struct adios_MPI_data_struct * md = (struct adios_MPI_data_struct *)
+                                                      method->method_data;
+    char * name;
+    int err;
+    int flag;    // used for coordinating the MPI_File_open
+
+    int previous;
+    int current;
+    int next;
+
+#if COLLECT_METRICS
+    gettimeofday (&timing.t21, NULL);
+#endif
+
+    name = malloc (strlen (method->base_path) + strlen (fd->name) + 1);
+    sprintf (name, "%s%s", method->base_path, fd->name);
+
+    adios_var_to_comm (fd->group->group_comm
+                      ,fd->group->adios_host_language_fortran
+                      ,md->comm
+                      ,&md->group_comm
+                      );
+    if (md->group_comm != MPI_COMM_NULL)
+    {
+        MPI_Comm_rank (md->group_comm, &md->rank);
+        MPI_Comm_size (md->group_comm, &md->size);
+    }
+    fd->group->process_id = md->rank;
+
+    if (md->rank == md->size - 1)
+        next = -1;
+    else
+        next = md->rank + 1;
+    previous = md->rank - 1;
+    current = md->rank;
+
+    fd->base_offset = 0;
+
+    switch (fd->mode)
+    {
+        case adios_mode_read:
+        {
+            if (md->group_comm == MPI_COMM_NULL || md->rank == 0)
+            {
+                err = MPI_File_open (MPI_COMM_SELF, name, MPI_MODE_RDONLY
+                                    ,md->info, &md->fh
+                                    );
+                if (err != MPI_SUCCESS)
+                {
+                    char e [MPI_MAX_ERROR_STRING];
+                    int len = 0;
+                    memset (e, 0, MPI_MAX_ERROR_STRING);
+                    MPI_Error_string (err, e, &len);
+                    fprintf (stderr, "1: MPI open read failed for %s: '%s'\n"
+                            ,name, e
+                            );
+                    free (name);
+
+                    return adios_flag_no;
+                }
+
+                MPI_Offset file_size;
+                MPI_File_get_size (md->fh, &file_size);
+                md->b.file_size = file_size;
+
+                adios_init_buffer_read_version (&md->b);
+                MPI_File_seek (md->fh, md->b.file_size - md->b.length
+                              ,MPI_SEEK_SET
+                              );
+                MPI_File_read (md->fh, md->b.buff, md->b.length, MPI_BYTE
+                              ,&md->status
+                              );
+                adios_parse_version (&md->b, &md->b.version);
+
+                adios_init_buffer_read_index_offsets (&md->b);
+                // already in the buffer
+                adios_parse_index_offsets_v1 (&md->b);
+
+                adios_init_buffer_read_process_group_index (&md->b);
+                MPI_File_seek (md->fh, md->b.pg_index_offset
+                              ,MPI_SEEK_SET
+                              );
+                MPI_File_read (md->fh, md->b.buff, md->b.pg_size, MPI_BYTE
+                              ,&md->status
+                              );
+                adios_parse_process_group_index_v1 (&md->b
+                                                   ,&md->old_pg_root
+                                                   );
+
+#if 1
+                adios_init_buffer_read_vars_index (&md->b);
+                MPI_File_seek (md->fh, md->b.vars_index_offset
+                              ,MPI_SEEK_SET
+                              );
+                MPI_File_read (md->fh, md->b.buff, md->b.vars_size, MPI_BYTE
+                              ,&md->status
+                              );
+                adios_parse_vars_index_v1 (&md->b, &md->old_vars_root);
+
+                adios_init_buffer_read_attributes_index (&md->b);
+                MPI_File_seek (md->fh, md->b.attrs_index_offset
+                              ,MPI_SEEK_SET
+                              );
+                MPI_File_read (md->fh, md->b.buff, md->b.attrs_size, MPI_BYTE
+                              ,&md->status
+                              );
+                adios_parse_attributes_index_v1 (&md->b, &md->old_attrs_root);
+#endif
+
+                fd->base_offset = md->b.end_of_pgs;
+            }
+
+            if (   md->group_comm != MPI_COMM_NULL
+                && md->group_comm != MPI_COMM_SELF
+               )
+            {
+                if (md->rank == 0)
+                {
+                    MPI_Offset * offsets = malloc (  sizeof (MPI_Offset)
+                                                   * md->size * 3
+                                                  );
+                    memset (offsets, 0, sizeof (MPI_Offset) * md->size * 3);
+
+                    // go through the pg index to build the offsets array
+                    build_offsets (&md->b, offsets, md->size
+                                  ,fd->group->name, md->old_pg_root
+                                  );
+                    MPI_Scatter (offsets, 3, MPI_LONG_LONG
+                                ,offsets, 3, MPI_LONG_LONG
+                                ,0, md->group_comm
+                                );
+                    md->b.read_pg_offset = offsets [0];
+                    md->b.read_pg_size = offsets [1];
+                    free (offsets);
+                }
+                else
+                {
+                    MPI_Offset offset [3];
+                    offset [0] = offset [1] = offset [2] = 0;
+
+                    MPI_Scatter (offset, 3, MPI_LONG_LONG
+                                ,offset, 3, MPI_LONG_LONG
+                                ,0, md->group_comm
+                                );
+
+                    md->b.read_pg_offset = offset [0];
+                    md->b.read_pg_size = offset [1];
+                    md->b.version = offset [2];
+                }
+            }
+
+            // cascade the opens to avoid trashing the metadata server
+            if (previous == -1)
+            {
+                // note rank 0 is already open
+                // don't open it again here
+
+                if (next != -1)
+                {
+                    MPI_Isend (&flag, 1, MPI_INT, next, current
+                              ,md->group_comm, &md->req
+                              );
+                }
+            }
+            else
+            {
+                MPI_Recv (&flag, 1, MPI_INT, previous, previous
+                         ,md->group_comm, &md->status
+                         );
+                if (next != -1)
+                {
+                    MPI_Isend (&flag, 1, MPI_INT, next, current
+                              ,md->group_comm, &md->req
+                              );
+                }
+                err = MPI_File_open (MPI_COMM_SELF, name
+                                    ,MPI_MODE_RDONLY
+                                    ,md->info
+                                    ,&md->fh
+                                    );
+            }
+
+            if (err != MPI_SUCCESS)
+            {
+                char e [MPI_MAX_ERROR_STRING];
+                int len = 0;
+                memset (e, 0, MPI_MAX_ERROR_STRING);
+                MPI_Error_string (err, e, &len);
+                fprintf (stderr, "2: MPI open write failed for %s: '%s'\n"
+                        ,name, e
+                        );
+                free (name);
+
+                return adios_flag_no;
+            }
+
+            break;
+        }
+
+        case adios_mode_write:
+        {
+            fd->base_offset = 0;
+            fd->pg_start_in_file = 0;
+#if COLLECT_METRICS                     
+            gettimeofday (&timing.t16, NULL);
+#endif
+
+            // figure out the offsets and create the file with proper striping
+            // before the MPI_File_open is called
+            adios_mpi_build_file_offset (md, fd, name);
+            //set_stripe_size (fd, md, name);
+#if COLLECT_METRICS
+            gettimeofday (&timing.t5, NULL);
+#endif
+
+            // cascade the opens to avoid trashing the metadata server
+            if (previous == -1)
+            {
+                MPI_File_delete (name, MPI_INFO_NULL);  // make sure clean
+
+                err = MPI_File_open (MPI_COMM_SELF, name
+                                    ,MPI_MODE_WRONLY | MPI_MODE_CREATE
+                                    ,md->info
+                                    ,&md->fh
+                                    );
+                if (next != -1)
+                {
+                    MPI_Isend (&flag, 1, MPI_INT, next, current
+                              ,md->group_comm, &md->req
+                              );
+                }
+            }
+            else
+            {
+                MPI_Recv (&flag, 1, MPI_INT, previous, previous
+                         ,md->group_comm, &md->status
+                         );
+                if (next != -1)
+                {
+                    MPI_Isend (&flag, 1, MPI_INT, next, current
+                              ,md->group_comm, &md->req
+                              );
+                }
+                err = MPI_File_open (MPI_COMM_SELF, name
+                                    ,MPI_MODE_WRONLY
+                                    ,md->info
+                                    ,&md->fh
+                                    );
+            }
+
+            if (err != MPI_SUCCESS)
+            {
+                char e [MPI_MAX_ERROR_STRING];
+                int len = 0;
+                memset (e, 0, MPI_MAX_ERROR_STRING);
+                MPI_Error_string (err, e, &len);
+                fprintf (stderr, "3: MPI open write failed for %s: '%s'\n"
+                        ,name, e
+                        );
+                free (name);
+
+                return adios_flag_no;
+            }
+#if COLLECT_METRICS
+            gettimeofday (&timing.t6, NULL);
+#endif
+
+            break;
+        }
+
+        case adios_mode_append:
+        {
+            int old_file = 1;
+            adios_buffer_struct_clear (&md->b);
+
+            if (md->group_comm == MPI_COMM_NULL || md->rank == 0)
+            {
+                err = MPI_File_open (MPI_COMM_SELF, name, MPI_MODE_RDONLY
+                                    ,md->info, &md->fh
+                                    );
+
+                if (err != MPI_SUCCESS)
+                {
+                    old_file = 0;
+                    MPI_File_close (&md->fh);
+                    err = MPI_File_open (MPI_COMM_SELF, name
+                                        ,MPI_MODE_WRONLY | MPI_MODE_CREATE
+                                        ,md->info, &md->fh
+                                        );
+                    if (err != MPI_SUCCESS)
+                    {
+                        char e [MPI_MAX_ERROR_STRING];
+                        int len = 0;
+                        memset (e, 0, MPI_MAX_ERROR_STRING);
+                        MPI_Error_string (err, e, &len);
+                        fprintf (stderr, "4: MPI open write failed for %s: '%s'\n"
+                                ,name, e
+                                );
+                        free (name);
+
+                        return adios_flag_no;
+                    }
+                }
+                MPI_Bcast (&old_file, 1, MPI_INT, 0, md->group_comm);
+            }
+            else
+            {
+                if (md->group_comm != MPI_COMM_NULL)
+                    MPI_Bcast (&old_file, 1, MPI_INT, 0, md->group_comm);
+            }
+
+            if (old_file)
+            {
+                if (md->group_comm == MPI_COMM_NULL || md->rank == 0)
+                {
+                    if (err != MPI_SUCCESS)
+                    {
+                        md->b.file_size = 0;
+                    }
+                    else
+                    {
+                        MPI_Offset file_size;
+                        MPI_File_get_size (md->fh, &file_size);
+                        md->b.file_size = file_size;
+                    }
+
+                    adios_init_buffer_read_version (&md->b);
+                    MPI_File_seek (md->fh, md->b.file_size - md->b.length
+                                  ,MPI_SEEK_SET
+                                  );
+                    MPI_File_read (md->fh, md->b.buff, md->b.length, MPI_BYTE
+                                  ,&md->status
+                                  );
+                    adios_parse_version (&md->b, &md->b.version);
+
+                    adios_init_buffer_read_index_offsets (&md->b);
+                    // already in the buffer
+                    adios_parse_index_offsets_v1 (&md->b);
+
+                    adios_init_buffer_read_process_group_index (&md->b);
+                    MPI_File_seek (md->fh, md->b.pg_index_offset
+                                  ,MPI_SEEK_SET
+                                  );
+                    MPI_File_read (md->fh, md->b.buff, md->b.pg_size, MPI_BYTE
+                                  ,&md->status
+                                  );
+
+                    adios_parse_process_group_index_v1 (&md->b
+                                                       ,&md->old_pg_root
+                                                       );
+
+                    // find the largest time index so we can append properly
+                    struct adios_index_process_group_struct_v1 * p;
+                    uint32_t max_time_index = 0;
+                    p = md->old_pg_root;
+                    while (p)
+                    {
+                        if (p->time_index > max_time_index)
+                            max_time_index = p->time_index;
+                        p = p->next;
+                    }
+                    fd->group->time_index = ++max_time_index;
+                    MPI_Bcast (&fd->group->time_index, 1, MPI_INT, 0
+                              ,md->group_comm
+                              );
+
+                    adios_init_buffer_read_vars_index (&md->b);
+                    MPI_File_seek (md->fh, md->b.vars_index_offset
+                                  ,MPI_SEEK_SET
+                                  );
+                    MPI_File_read (md->fh, md->b.buff, md->b.vars_size, MPI_BYTE
+                                  ,&md->status
+                                  );
+                    adios_parse_vars_index_v1 (&md->b, &md->old_vars_root);
+
+                    adios_init_buffer_read_attributes_index (&md->b);
+                    MPI_File_seek (md->fh, md->b.attrs_index_offset
+                                  ,MPI_SEEK_SET
+                                  );
+                    MPI_File_read (md->fh, md->b.buff, md->b.attrs_size
+                                  ,MPI_BYTE, &md->status
+                                  );
+                    adios_parse_attributes_index_v1 (&md->b
+                                                    ,&md->old_attrs_root
+                                                    );
+
+                    fd->base_offset = md->b.end_of_pgs;
+                    fd->pg_start_in_file = fd->base_offset;
+                }
+                else
+                {
+                    fd->base_offset = 0;
+                    fd->pg_start_in_file = 0;
+                    MPI_Bcast (&fd->group->time_index, 1, MPI_INT, 0
+                              ,md->group_comm
+                              );
+                }
+
+                MPI_File_close (&md->fh);
+            }
+            else
+            {
+                fd->base_offset = 0;
+                fd->pg_start_in_file = 0;
+
+                if (md->rank == 0)
+                    MPI_File_close (&md->fh);
+            }
+
+            // figure out the offsets and create the file with proper striping
+            // before the MPI_File_open is called
+            adios_mpi_build_file_offset (md, fd, name);
+            //set_stripe_size (fd, md, name);
+
+            // cascade the opens to avoid trashing the metadata server
+            if (previous == -1)
+            {
+                // we know it exists, because we created it if it didn't
+                // when reading the old file so can just open wronly
+                // but adding the create for consistency with write mode
+                // so it is easier to merge write/append later
+                err = MPI_File_open (MPI_COMM_SELF, name
+                                    ,MPI_MODE_WRONLY | MPI_MODE_CREATE
+                                    ,md->info
+                                    ,&md->fh
+                                    );
+                if (next != -1)
+                {
+                    MPI_Isend (&flag, 1, MPI_INT, next, current
+                              ,md->group_comm, &md->req
+                              );
+                }
+            }
+            else
+            {
+                MPI_Recv (&flag, 1, MPI_INT, previous, previous
+                         ,md->group_comm, &md->status
+                         );
+                if (next != -1)
+                {
+                    MPI_Isend (&flag, 1, MPI_INT, next, current
+                              ,md->group_comm, &md->req
+                              );
+                }
+                err = MPI_File_open (MPI_COMM_SELF, name
+                                    ,MPI_MODE_WRONLY
+                                    ,md->info
+                                    ,&md->fh
+                                    );
+            }
+
+            if (err != MPI_SUCCESS)
+            {
+                char e [MPI_MAX_ERROR_STRING];
+                int len = 0;
+                memset (e, 0, MPI_MAX_ERROR_STRING);
+                MPI_Error_string (err, e, &len);
+                fprintf (stderr, "5: MPI open write failed for %s: '%s'\n"
+                        ,name, e
+                        );
+                free (name);
+
+                return adios_flag_no;
+            }
+
+            break;
+        }
+
+        default:
+        {
+            fprintf (stderr, "Unknown file mode: %d\n", fd->mode);
+
+            free (name);
+
+            return adios_flag_no;
+        }
+    }
+
+    free (name);
+
+    if (fd->shared_buffer == adios_flag_no && fd->mode != adios_mode_read)
+    {
+        int err;
+        // write the process group header
+        adios_write_process_group_header_v1 (fd, fd->write_size_bytes);
+
+        MPI_File_seek (md->fh, fd->base_offset, MPI_SEEK_SET);
+#if 0
+        err = MPI_File_write (md->fh, fd->buffer, fd->bytes_written, MPI_BYTE
+                             ,&md->status
+                             );
+#endif
+        {
+            uint64_t total_written = 0;
+            uint64_t to_write = fd->bytes_written;
+            int write_len = 0;
+            int count;
+            char * buf_ptr = fd->buffer;
+            while (total_written < fd->bytes_written)
+            {
+                write_len = (to_write > INT32_MAX) ? INT32_MAX : to_write;
+                err = MPI_File_write (md->fh, buf_ptr, write_len, MPI_BYTE, &md->status);
+                MPI_Get_count(&md->status, MPI_BYTE, &count);
+                if (count != write_len)
+                {
+                    err = count;
+                    break;
+                }
+                total_written += count;
+                buf_ptr += count;
+                to_write -= count;
+                //err = total_written;
+            }
+        }
+        if (err != MPI_SUCCESS)
+        {
+            char e [MPI_MAX_ERROR_STRING];
+            int len = 0;
+            memset (e, 0, MPI_MAX_ERROR_STRING);
+            MPI_Error_string (err, e, &len);
+            fprintf (stderr, "adios_mpi_should_buffer failed %s: '%s'\n"
+                    ,fd->name, e
+                    );
+            free (name);
+
+            return adios_flag_no;
+        }
+
+        int count;
+        MPI_Get_count (&md->status, MPI_BYTE, &count);
+        if (count != fd->bytes_written)
+        {
+            fprintf (stderr, "a:MPI method tried to write %llu, "
+                             "only wrote %d\n"
+                    ,fd->bytes_written
+                    ,count
+                    );
+        }
+        fd->base_offset += count;
+        fd->offset = 0;
+        fd->bytes_written = 0;
+        adios_shared_buffer_free (&md->b);
+
+        // setup for writing vars
+        adios_write_open_vars_v1 (fd);
+        md->vars_start = fd->base_offset;
+        md->vars_header_size = fd->offset;
+        fd->base_offset += fd->offset;
+        MPI_File_seek (md->fh, md->vars_header_size, MPI_SEEK_CUR);
+        fd->offset = 0;
+        fd->bytes_written = 0;
+        adios_shared_buffer_free (&md->b);
+    }
+
+#if COLLECT_METRICS
+    gettimeofday (&timing.t22, NULL);
+#endif
+    return fd->shared_buffer;
+}
+
+void adios_mpi_write (struct adios_file_struct * fd
+                     ,struct adios_var_struct * v
+                     ,void * data
+                     ,struct adios_method_struct * method
+                     )
+{
+    struct adios_MPI_data_struct * md = (struct adios_MPI_data_struct *)
+                                                      method->method_data;
+
+    if (v->got_buffer == adios_flag_yes)
+    {
+        if (data != v->data)  // if the user didn't give back the same thing
+        {
+            if (v->free_data == adios_flag_yes)
+            {
+                free (v->data);
+                adios_method_buffer_free (v->data_size);
+            }
+        }
+        else
+        {
+            // we already saved all of the info, so we're ok.
+            return;
+        }
+    }
+
+    if (fd->shared_buffer == adios_flag_no)
+    {
+        int err;
+        // var payload sent for sizing information
+        adios_write_var_header_v1 (fd, v);
+
+#if 0
+        err = MPI_File_write (md->fh, fd->buffer, fd->bytes_written
+                             ,MPI_BYTE, &md->status
+                             );
+#endif
+        {
+            uint64_t total_written = 0;
+            uint64_t to_write = fd->bytes_written;
+            int write_len = 0;
+            int count;
+            char * buf_ptr = fd->buffer;
+            while (total_written < fd->bytes_written)
+            {
+                write_len = (to_write > INT32_MAX) ? INT32_MAX : to_write;
+                err = MPI_File_write (md->fh, buf_ptr, write_len, MPI_BYTE, &md->status);
+                MPI_Get_count(&md->status, MPI_BYTE, &count);
+                if (count != write_len)
+                {
+                    err = count;
+                    break;
+                }
+                total_written += count;
+                buf_ptr += count;
+                to_write -= count;
+                //err = total_written;
+            }
+        }
+        if (err != MPI_SUCCESS) 
+        {              
+            char e [MPI_MAX_ERROR_STRING];
+            int len = 0;
+            memset (e, 0, MPI_MAX_ERROR_STRING);
+            MPI_Error_string (err, e, &len);
+            fprintf (stderr, "adios_mpi_write (1) failed %s: '%s'\n"
+                    ,fd->name, e
+                    );       
+        }
+
+        int count;
+        MPI_Get_count (&md->status, MPI_BYTE, &count);
+        if (count != fd->bytes_written)
+        {
+            fprintf (stderr, "b:MPI method tried to write %llu, "
+                             "only wrote %d\n"
+                    ,fd->bytes_written
+                    ,count
+                    );
+        }
+        fd->base_offset += count;
+        fd->offset = 0;
+        fd->bytes_written = 0;
+        adios_shared_buffer_free (&md->b);
+
+        // write payload
+        // adios_write_var_payload_v1 (fd, v);
+        uint64_t var_size = adios_get_var_size (v, fd->group, v->data);
+
+        if (fd->base_offset + var_size > fd->pg_start_in_file + fd->write_size_bytes)
+            fprintf (stderr, "adios_mpi_write exceeds pg bound(1). File is corrupted. "
+                             "Need to enlarge group size. \n");
+#if 0
+        err = MPI_File_write (md->fh, v->data, var_size, MPI_BYTE, &md->status);
+#endif
+        {
+            uint64_t total_written = 0;
+            uint64_t to_write = var_size;
+            int write_len = 0;
+            int count;
+            char * buf_ptr = v->data;
+            while (total_written < var_size)
+            {
+                write_len = (to_write > INT32_MAX) ? INT32_MAX : to_write;
+                err = MPI_File_write (md->fh, buf_ptr, write_len, MPI_BYTE, &md->status);
+                MPI_Get_count(&md->status, MPI_BYTE, &count);
+                if (count != write_len)
+                {
+                    err = count;
+                    break;
+                }
+                total_written += count;
+                buf_ptr += count;
+                to_write -= count;
+                //err = total_written;
+            }
+        }
+        if (err != MPI_SUCCESS) 
+        {              
+            char e [MPI_MAX_ERROR_STRING];
+            int len = 0;
+            memset (e, 0, MPI_MAX_ERROR_STRING);
+            MPI_Error_string (err, e, &len);
+            fprintf (stderr, "adios_mpi_write (2) failed %s: '%s'\n"
+                    ,fd->name, e
+                    );       
+        }
+
+        MPI_Get_count (&md->status, MPI_BYTE, &count);
+        if (count != var_size)
+        {
+            fprintf (stderr, "c:MPI method tried to write %llu, "
+                             "only wrote %d\n"
+                    ,var_size
+                    ,count
+                    );
+        }
+        fd->base_offset += count;
+        fd->offset = 0;
+        fd->bytes_written = 0;
+        adios_shared_buffer_free (&md->b);
+    }
+#if COLLECT_METRICS
+    if (timing.write_count == timing.write_size)
+    {
+        timing.write_size += 10;
+        timing.t24 = realloc (timing.t24, sizeof (struct timeval)
+                                          * timing.write_size
+                             );
+        assert (timing.t24 != 0);
+    }
+    gettimeofday (&(timing.t24 [timing.write_count++]), NULL);
+#endif
+}
+
+void adios_mpi_get_write_buffer (struct adios_file_struct * fd
+                                ,struct adios_var_struct * v
+                                ,uint64_t * size
+                                ,void ** buffer
+                                ,struct adios_method_struct * method
+                                )
+{
+    uint64_t mem_allowed;
+
+    if (*size == 0)
+    {
+        *buffer = 0;
+
+        return;
+    }
+
+    if (v->data && v->free_data)
+    {
+        adios_method_buffer_free (v->data_size);
+        free (v->data);
+    }
+
+    mem_allowed = adios_method_buffer_alloc (*size);
+    if (mem_allowed == *size)
+    {
+        *buffer = malloc (*size);
+        if (!*buffer)
+        {
+            adios_method_buffer_free (mem_allowed);
+            fprintf (stderr, "Out of memory allocating %llu bytes for %s\n"
+                    ,*size, v->name
+                    );
+            v->got_buffer = adios_flag_no;
+            v->free_data = adios_flag_no;
+            v->data_size = 0;
+            v->data = 0;
+            *size = 0;
+            *buffer = 0;
+        }
+        else
+        {
+            v->got_buffer = adios_flag_yes;
+            v->free_data = adios_flag_yes;
+            v->data_size = mem_allowed;
+            v->data = *buffer;
+        }
+    }
+    else
+    {
+        adios_method_buffer_free (mem_allowed);
+        fprintf (stderr, "OVERFLOW: Cannot allocate requested buffer of %llu "
+                         "bytes for %s\n"
+                ,*size
+                ,v->name
+                );
+        *size = 0;
+        *buffer = 0;
+    }
+}
+
+void adios_mpi_read (struct adios_file_struct * fd
+                    ,struct adios_var_struct * v, void * buffer
+                    ,uint64_t buffer_size
+                    ,struct adios_method_struct * method
+                    )
+{
+    v->data = buffer;
+    v->data_size = buffer_size;
+}
+
+static void adios_mpi_do_read (struct adios_file_struct * fd
+                              ,struct adios_method_struct * method
+                              )
+{
+    struct adios_MPI_data_struct * md = (struct adios_MPI_data_struct *)
+                                                      method->method_data;
+    struct adios_var_struct * v = fd->group->vars;
+
+    struct adios_parse_buffer_struct data;
+
+    data.vars = v;
+    data.buffer = 0;
+    data.buffer_len = 0;
+
+    switch (md->b.version & ADIOS_VERSION_NUM_MASK)
+    {
+        case 1:
+        {
+            // the three section headers
+            struct adios_process_group_header_struct_v1 pg_header;
+            struct adios_vars_header_struct_v1 vars_header;
+            struct adios_attributes_header_struct_v1 attrs_header;
+
+            struct adios_var_header_struct_v1 var_header;
+            struct adios_var_payload_struct_v1 var_payload;
+            struct adios_attribute_struct_v1 attribute;
+
+            int i;
+
+            adios_init_buffer_read_process_group (&md->b);
+            MPI_File_seek (md->fh, md->b.read_pg_offset
+                          ,MPI_SEEK_SET
+                          );
+            MPI_File_read (md->fh, md->b.buff, md->b.read_pg_size, MPI_BYTE
+                          ,&md->status
+                          );
+            adios_parse_process_group_header_v1 (&md->b, &pg_header);
+
+            adios_parse_vars_header_v1 (&md->b, &vars_header);
+
+            for (i = 0; i < vars_header.count; i++)
+            {
+                memset (&var_payload, 0
+                       ,sizeof (struct adios_var_payload_struct_v1)
+                       );
+                adios_parse_var_data_header_v1 (&md->b, &var_header);
+
+                struct adios_var_struct * v1 = v;
+                while (v1)
+                {
+                    if (   strcasecmp (var_header.name, v1->name)
+                        || strcasecmp (var_header.path, v1->path)
+                       )
+                    {
+                        v1 = v1->next;
+                    }
+                    else
+                    {
+                        break;
+                    }
+                }
+
+                if (v1)
+                {
+                    var_payload.payload = v1->data;
+                    adios_parse_var_data_payload_v1 (&md->b, &var_header
+                                                    ,&var_payload
+                                                    ,v1->data_size
+                                                    );
+                }
+                else
+                {
+                    printf ("MPI read: skipping name: %s path: %s\n"
+                           ,var_header.name, var_header.path
+                           );
+                    adios_parse_var_data_payload_v1 (&md->b, &var_header
+                                                    ,NULL, 0
+                                                    );
+                }
+
+                adios_clear_var_header_v1 (&var_header);
+            }
+
+#if 1
+            adios_parse_attributes_header_v1 (&md->b, &attrs_header);
+
+            for (i = 0; i < attrs_header.count; i++)
+            {
+                adios_parse_attribute_v1 (&md->b, &attribute);
+                adios_clear_attribute_v1 (&attribute);
+            }
+#endif
+            adios_clear_process_group_header_v1 (&pg_header);
+
+            break;
+        }
+
+        default:
+            fprintf (stderr, "MPI read: file version unknown: %u\n"
+                    ,md->b.version
+                    );
+            return;
+    }
+
+    adios_buffer_struct_clear (&md->b);
+}
+
+void adios_mpi_close (struct adios_file_struct * fd
+                     ,struct adios_method_struct * method
+                     )
+{
+    struct adios_MPI_data_struct * md = (struct adios_MPI_data_struct *)
+                                                 method->method_data;
+    struct adios_attribute_struct * a = fd->group->attributes;
+
+    struct adios_index_process_group_struct_v1 * new_pg_root = 0;
+    struct adios_index_var_struct_v1 * new_vars_root = 0;
+    struct adios_index_attribute_struct_v1 * new_attrs_root = 0;
+#if COLLECT_METRICS
+    gettimeofday (&timing.t23, NULL);
+    timing.t19.tv_sec = timing.t23.tv_sec;
+    timing.t19.tv_usec = timing.t23.tv_usec;
+    static int iteration = 0;
+#endif
+
+    switch (fd->mode)
+    {
+        case adios_mode_read:
+        {
+            // read the index to find the place to start reading
+            adios_mpi_do_read (fd, method);
+            struct adios_var_struct * v = fd->group->vars;
+            while (v)
+            {
+                v->data = 0;
+                v = v->next;
+            }
+
+            break;
+        }
+
+        case adios_mode_write:
+        {
+            char * buffer = 0;
+            uint64_t buffer_size = 0;
+            uint64_t buffer_offset = 0;
+            uint64_t index_start = md->b.pg_index_offset;
+            int err;
+
+            if (fd->shared_buffer == adios_flag_no)
+            {
+                MPI_Offset new_off;
+                // set it up so that it will start at 0, but have correct sizes
+                MPI_File_get_position (md->fh, &new_off);
+                fd->offset = fd->base_offset - md->vars_start;
+                fd->vars_start = 0;
+                fd->buffer_size = 0;
+                adios_write_close_vars_v1 (fd);
+                // fd->vars_start gets updated with the size written
+                MPI_File_seek (md->fh, md->vars_start, MPI_SEEK_SET);
+#if 0
+                err = MPI_File_write (md->fh, fd->buffer, md->vars_header_size
+                                     ,MPI_BYTE, &md->status
+                                     );
+#endif
+                {
+                    uint64_t total_written = 0;
+                    uint64_t to_write = md->vars_header_size;
+                    int write_len = 0;
+                    int count;
+                    char * buf_ptr = fd->buffer;
+                    while (total_written < md->vars_header_size)
+                    {
+                        write_len = (to_write > INT32_MAX) ? INT32_MAX : to_write;
+                        err = MPI_File_write (md->fh, buf_ptr, write_len, MPI_BYTE, &md->status);
+                        MPI_Get_count(&md->status, MPI_BYTE, &count);
+                        if (count != write_len)
+                        {
+                            err = count;
+                            break;
+                        }
+                        total_written += count;
+                        buf_ptr += count;
+                        to_write -= count;
+                        //err = total_written;
+                    }
+                }
+                if (err != MPI_SUCCESS) 
+                {              
+                    char e [MPI_MAX_ERROR_STRING];
+                    int len = 0;
+                    memset (e, 0, MPI_MAX_ERROR_STRING);
+                    MPI_Error_string (err, e, &len);
+                    fprintf (stderr, "adios_mpi_close (1) failed %s: '%s'\n"
+                            ,fd->name, e
+                            );       
+
+                }
+
+                int count;
+                MPI_Get_count (&md->status, MPI_BYTE, &count);
+                if (count != md->vars_header_size)
+                {
+                    fprintf (stderr, "d:MPI method tried to write %llu, "
+                                     "only wrote %d\n"
+                            ,md->vars_header_size
+                            ,count
+                            );
+                }
+                fd->offset = 0;
+                fd->bytes_written = 0;
+                adios_shared_buffer_free (&md->b);
+
+                adios_write_open_attributes_v1 (fd);
+                md->vars_start = new_off;
+                md->vars_header_size = fd->offset;
+                MPI_File_seek (md->fh, new_off + md->vars_header_size
+                              ,MPI_SEEK_SET
+                              ); // go back to end, but after attr header
+                fd->base_offset += fd->offset;  // add size of header
+                fd->offset = 0;
+                fd->bytes_written = 0;
+
+                while (a)
+                {
+                    adios_write_attribute_v1 (fd, a);
+                    if (fd->base_offset + fd->bytes_written > fd->pg_start_in_file + fd->write_size_bytes)
+                        fprintf (stderr, "mpi_file_write exceeds PG bound(2). File is corrupted. "
+                                         "Need to enlarge group size.\n");
+#if 0
+                    err = MPI_File_write (md->fh, fd->buffer, fd->bytes_written
+                                         ,MPI_BYTE, &md->status
+                                         );
+#endif
+                    {
+                        uint64_t total_written = 0;
+                        uint64_t to_write = fd->bytes_written;
+                        int write_len = 0;
+                        int count;
+                        char * buf_ptr = fd->buffer;
+                        while (total_written < fd->bytes_written)
+                        {
+                            write_len = (to_write > INT32_MAX) ? INT32_MAX : to_write;
+                            err = MPI_File_write (md->fh, buf_ptr, write_len, MPI_BYTE, &md->status);
+                            MPI_Get_count(&md->status, MPI_BYTE, &count);
+                            if (count != write_len)
+                            {
+                                err = count;
+                                break;
+                            }
+                            total_written += count;
+                            buf_ptr += count;
+                            to_write -= count;
+                            //err = total_written;
+                        }
+                    }
+                    if (err != MPI_SUCCESS) 
+                    {              
+                        char e [MPI_MAX_ERROR_STRING];
+                        int len = 0;
+                        memset (e, 0, MPI_MAX_ERROR_STRING);
+                        MPI_Error_string (err, e, &len);
+                        fprintf (stderr, "adios_mpi_close (2) failed %s: '%s'\n"
+                                ,fd->name, e
+                                );       
+
+                    }
+
+                    MPI_Get_count (&md->status, MPI_BYTE, &count);
+                    if (count != fd->bytes_written)
+                    {
+                        fprintf (stderr, "e:MPI method tried to write %llu, "
+                                         "only wrote %d\n"
+                                ,fd->bytes_written
+                                ,count
+                                );
+                    }
+                    fd->base_offset += count;
+                    fd->offset = 0;
+                    fd->bytes_written = 0;
+                    adios_shared_buffer_free (&md->b);
+
+                    a = a->next;
+                }
+
+                // set it up so that it will start at 0, but have correct sizes
+                fd->offset = fd->base_offset - md->vars_start;
+                fd->vars_start = 0;
+                fd->buffer_size = 0;
+                adios_write_close_attributes_v1 (fd);
+                MPI_File_seek (md->fh, md->vars_start, MPI_SEEK_SET);
+                // fd->vars_start gets updated with the size written
+#if 0
+                err = MPI_File_write (md->fh, fd->buffer, md->vars_header_size
+                                     ,MPI_BYTE, &md->status
+                                     );
+#endif
+                {
+                    uint64_t total_written = 0;
+                    uint64_t to_write = md->vars_header_size;
+                    int write_len = 0;
+                    int count;
+                    char * buf_ptr = fd->buffer;
+                    while (total_written < md->vars_header_size)
+                    {
+                        write_len = (to_write > INT32_MAX) ? INT32_MAX : to_write;
+                        err = MPI_File_write (md->fh, buf_ptr, write_len, MPI_BYTE, &md->status);
+                        MPI_Get_count(&md->status, MPI_BYTE, &count);
+                        if (count != write_len)
+                        {
+                            err = count;
+                            break;
+                        }
+                        total_written += count;
+                        buf_ptr += count;
+                        to_write -= count;
+                        //err = total_written;
+                    }
+                }
+                if (err != MPI_SUCCESS) 
+                {              
+                    char e [MPI_MAX_ERROR_STRING];
+                    int len = 0;
+                    memset (e, 0, MPI_MAX_ERROR_STRING);
+                    MPI_Error_string (err, e, &len);
+                    fprintf (stderr, "adios_mpi_close (3) failed %s: '%s'\n"
+                            ,fd->name, e
+                            );       
+                }
+
+                MPI_Get_count (&md->status, MPI_BYTE, &count);
+                if (count != md->vars_header_size)
+                {
+                    fprintf (stderr, "f:MPI method tried to write %llu, "
+                                     "only wrote %d\n"
+                            ,md->vars_header_size
+                            ,count
+                            );
+                }
+                fd->offset = 0;
+                fd->bytes_written = 0;
+            }
+
+#if COLLECT_METRICS
+            gettimeofday (&timing.t19, NULL);
+            gettimeofday (&timing.t12, NULL);
+#endif
+            // build index appending to any existing index
+            adios_build_index_v1 (fd, &md->old_pg_root, &md->old_vars_root
+                                 ,&md->old_attrs_root
+                                 );
+            // if collective, gather the indexes from the rest and call
+            if (md->group_comm != MPI_COMM_NULL)
+            {
+                if (md->rank == 0)
+                {
+                    int * index_sizes = malloc (4 * md->size);
+                    int * index_offsets = malloc (4 * md->size);
+                    char * recv_buffer = 0;
+                    uint32_t size = 0;
+                    uint32_t total_size = 0;
+                    int i;
+
+                    MPI_Gather (&size, 1, MPI_INT
+                               ,index_sizes, 1, MPI_INT
+                               ,0, md->group_comm
+                               );
+
+                    for (i = 0; i < md->size; i++)
+                    {
+                        index_offsets [i] = total_size;
+                        total_size += index_sizes [i];
+                    } 
+
+                    recv_buffer = malloc (total_size);
+
+                    MPI_Gatherv (&size, 0, MPI_BYTE
+                                ,recv_buffer, index_sizes, index_offsets
+                                ,MPI_BYTE, 0, md->group_comm
+                                );
+
+                    char * buffer_save = md->b.buff;
+                    uint64_t buffer_size_save = md->b.length;
+                    uint64_t offset_save = md->b.offset;
+
+                    for (i = 1; i < md->size; i++)
+                    {
+                        md->b.buff = recv_buffer + index_offsets [i];
+                        md->b.length = index_sizes [i];
+                        md->b.offset = 0;
+
+                        adios_parse_process_group_index_v1 (&md->b
+                                                           ,&new_pg_root
+                                                           );
+                        adios_parse_vars_index_v1 (&md->b, &new_vars_root);
+                        adios_parse_attributes_index_v1 (&md->b
+                                                        ,&new_attrs_root
+                                                        );
+                        adios_merge_index_v1 (&md->old_pg_root
+                                             ,&md->old_vars_root
+                                             ,&md->old_attrs_root
+                                             ,new_pg_root, new_vars_root
+                                             ,new_attrs_root
+                                             );
+                        new_pg_root = 0;
+                        new_vars_root = 0;
+                        new_attrs_root = 0;
+                    }
+                    md->b.buff = buffer_save;
+                    md->b.length = buffer_size_save;
+                    md->b.offset = offset_save;
+
+                    free (recv_buffer);
+                    free (index_sizes);
+                    free (index_offsets);
+                }
+                else
+                {
+                    adios_write_index_v1 (&buffer, &buffer_size, &buffer_offset
+                                         ,0, md->old_pg_root
+                                         ,md->old_vars_root
+                                         ,md->old_attrs_root
+                                         );
+                    uint32_t tmp_buffer_size = (uint32_t) buffer_size;
+                    MPI_Gather (&tmp_buffer_size, 1, MPI_INT, 0, 0, MPI_INT
+                               ,0, md->group_comm
+                               );
+                    MPI_Gatherv (buffer, buffer_size, MPI_BYTE
+                                ,0, 0, 0, MPI_BYTE
+                                ,0, md->group_comm
+                                );
+                }
+            }
+
+#if COLLECT_METRICS
+            gettimeofday (&timing.t13, NULL);
+#endif
+            if (fd->shared_buffer == adios_flag_yes)
+            {
+                // if we need to write > 2 GB, need to do it in parts
+                // since count is limited to INT32_MAX (signed 32-bit max).
+                uint64_t bytes_written = 0;
+                int32_t to_write = 0;
+                if (fd->bytes_written > INT32_MAX)
+                {
+                    to_write = INT32_MAX;
+                }
+                else
+                {
+                    to_write = (int32_t) fd->bytes_written;
+                }
+
+                while (bytes_written < fd->bytes_written)
+                {
+                    // everyone writes their data
+                    if (fd->base_offset + bytes_written + to_write > 
+                           fd->pg_start_in_file + fd->write_size_bytes)
+                        fprintf (stderr, "mpi_file_write exceeds PG bound(3). File is corrupted. "
+                                         "Need to enlarge group size.\n");
+
+                    MPI_File_seek (md->fh, fd->base_offset + bytes_written
+                                  ,MPI_SEEK_SET
+                                  );
+                    err = MPI_File_write (md->fh, fd->buffer + bytes_written
+                                         ,to_write, MPI_BYTE, &md->status
+                                         );
+                    if (err != MPI_SUCCESS) 
+                    {              
+                        char e [MPI_MAX_ERROR_STRING];
+                        int len = 0;
+                        memset (e, 0, MPI_MAX_ERROR_STRING);
+                        MPI_Error_string (err, e, &len);
+                        fprintf (stderr, "adios_mpi_close (4) failed %s: '%s'\n"
+                                ,fd->name, e
+                                );       
+                    }
+                    bytes_written += to_write;
+                    if (fd->bytes_written > bytes_written)
+                    {
+                        if (fd->bytes_written - bytes_written > INT32_MAX)
+                        {
+                            to_write = INT32_MAX;
+                        }
+                        else
+                        {
+                            to_write = fd->bytes_written - bytes_written;
+                        }
+                    }
+                }
+            }
+
+            if (md->rank == 0)
+            {
+                adios_write_index_v1 (&buffer, &buffer_size, &buffer_offset
+                                     ,index_start, md->old_pg_root
+                                     ,md->old_vars_root
+                                     ,md->old_attrs_root
+                                     );
+                adios_write_version_v1 (&buffer, &buffer_size, &buffer_offset);
+
+                MPI_File_seek (md->fh, md->b.pg_index_offset, MPI_SEEK_SET);
+#if 0
+                err = MPI_File_write (md->fh, buffer, buffer_offset, MPI_BYTE
+                                     ,&md->status
+                                     );
+#endif
+                {              
+                    uint64_t total_written = 0;
+                    uint64_t to_write = buffer_offset;
+                    int write_len = 0;
+                    int count;
+                    char * buf_ptr = buffer;
+                    while (total_written < buffer_offset)
+                    {
+                        write_len = (to_write > INT32_MAX) ? INT32_MAX : to_write;
+#if COLLECT_METRICS
+struct timeval a, b;
+gettimeofday (&a, NULL);
+#endif
+                        err = MPI_File_write (md->fh, buf_ptr, write_len, MPI_BYTE, &md->status);
+#if COLLECT_METRICS
+gettimeofday (&b, NULL);
+timeval_subtract (&timing.t8, &b, &a);
+#endif
+                        MPI_Get_count(&md->status, MPI_BYTE, &count);
+                        if (count != write_len)
+                        {
+                            fprintf (stderr, "Need to do multi-write 1 (tried: "
+                                             "%d wrote: %d) errno %d\n"
+                                    ,write_len, count, errno
+                                    );
+                            err = count;
+                            break;
+                        }
+                        total_written += count;
+                        buf_ptr += count;
+                        to_write -= count;
+                        //err = total_written;
+                    }
+                }              
+                if (err != MPI_SUCCESS) 
+                {              
+                    char e [MPI_MAX_ERROR_STRING];
+                    int len = 0;
+                    memset (e, 0, MPI_MAX_ERROR_STRING);
+                    MPI_Error_string (err, e, &len);
+                    fprintf (stderr, "adios_mpi_close (5) failed %s: '%s'\n"
+                            ,fd->name, e
+                            );       
+                }
+            }
+#if COLLECT_METRICS
+            gettimeofday (&timing.t20, NULL);
+            gettimeofday (&timing.t14, NULL);
+#endif
+
+            if (buffer)
+            {
+                free (buffer);
+                buffer = 0;
+                buffer_size = 0;
+                buffer_offset = 0;
+            }
+
+            adios_clear_index_v1 (new_pg_root, new_vars_root, new_attrs_root);
+            adios_clear_index_v1 (md->old_pg_root, md->old_vars_root
+                                 ,md->old_attrs_root
+                                 );
+            new_pg_root = 0;
+            new_vars_root = 0;
+            new_attrs_root = 0;
+            md->old_pg_root = 0;
+            md->old_vars_root = 0;
+            md->old_attrs_root = 0;
+#if COLLECT_METRICS
+            gettimeofday (&timing.t11, NULL);
+#endif
+
+            break;
+        }
+
+        case adios_mode_append:
+        {
+            char * buffer = 0;
+            uint64_t buffer_size = 0;
+            uint64_t buffer_offset = 0;
+            uint64_t index_start = md->b.pg_index_offset;
+            int err;
+
+            if (fd->shared_buffer == adios_flag_no)
+            {
+                MPI_Offset new_off;
+                // set it up so that it will start at 0, but have correct sizes
+                MPI_File_get_position (md->fh, &new_off);
+                fd->offset = fd->base_offset - md->vars_start;
+                fd->vars_start = 0;
+                fd->buffer_size = 0;
+                adios_write_close_vars_v1 (fd);
+                // fd->vars_start gets updated with the size written
+                MPI_File_seek (md->fh, md->vars_start, MPI_SEEK_SET);
+#if 0
+                err = MPI_File_write (md->fh, fd->buffer, md->vars_header_size
+                                     ,MPI_BYTE, &md->status
+                                     );
+#endif
+                {              
+                    uint64_t total_written = 0;
+                    uint64_t to_write = md->vars_header_size;
+                    int write_len = 0;
+                    int count;
+                    char * buf_ptr = fd->buffer;
+                    while (total_written < md->vars_header_size)
+                    {
+                        write_len = (to_write > INT32_MAX) ? INT32_MAX : to_write;
+                        err = MPI_File_write (md->fh, buf_ptr, write_len, MPI_BYTE, &md->status);
+                        MPI_Get_count(&md->status, MPI_BYTE, &count);
+                        if (count != write_len)
+                        {
+                            err = count;
+                            break;
+                        }
+                        total_written += count;
+                        buf_ptr += count;
+                        to_write -= count;
+                        //err = total_written;
+                    }
+                }              
+                if (err != MPI_SUCCESS) 
+                {              
+                    char e [MPI_MAX_ERROR_STRING];
+                    int len = 0;
+                    memset (e, 0, MPI_MAX_ERROR_STRING);
+                    MPI_Error_string (err, e, &len);
+                    fprintf (stderr, "adios_mpi_close (6) failed %s: '%s'\n"
+                            ,fd->name, e
+                            );       
+                }
+
+                int count;
+                MPI_Get_count (&md->status, MPI_BYTE, &count);
+                if (count != md->vars_header_size)
+                {
+                    fprintf (stderr, "d:MPI method tried to write %llu, "
+                                     "only wrote %d\n"
+                            ,md->vars_header_size
+                            ,count
+                            );
+                }
+                fd->offset = 0;
+                fd->bytes_written = 0;
+                adios_shared_buffer_free (&md->b);
+
+                adios_write_open_attributes_v1 (fd);
+                md->vars_start = new_off;
+                md->vars_header_size = fd->offset;
+                MPI_File_seek (md->fh, new_off + md->vars_header_size
+                              ,MPI_SEEK_SET
+                              ); // go back to end, but after attr header
+                fd->base_offset += fd->offset;  // add size of header
+                fd->offset = 0;
+                fd->bytes_written = 0;
+
+                while (a)
+                {
+                    adios_write_attribute_v1 (fd, a);
+#if 0
+                    err = MPI_File_write (md->fh, fd->buffer, fd->bytes_written
+                                         ,MPI_BYTE, &md->status
+                                         );
+#endif
+                    {
+                        uint64_t total_written = 0;
+                        uint64_t to_write = fd->bytes_written;
+                        int write_len = 0;
+                        int count;
+                        char * buf_ptr = fd->buffer;
+                        while (total_written < fd->bytes_written)
+                        {
+                            write_len = (to_write > INT32_MAX) ? INT32_MAX : to_write;
+                            err = MPI_File_write (md->fh, buf_ptr, write_len, MPI_BYTE, &md->status);
+                            MPI_Get_count(&md->status, MPI_BYTE, &count);
+                            if (count != write_len)
+                            {
+                                err = count;
+                                break;
+                            }
+                            total_written += count;
+                            buf_ptr += count;
+                            to_write -= count;
+                            //err = total_written;
+                        }
+                    }              
+                    if (err != MPI_SUCCESS) 
+                    {              
+                        char e [MPI_MAX_ERROR_STRING];
+                        int len = 0;
+                        memset (e, 0, MPI_MAX_ERROR_STRING);
+                        MPI_Error_string (err, e, &len);
+                        fprintf (stderr, "adios_mpi_close (7) failed %s: '%s'\n"
+                                ,fd->name, e
+                                );       
+                    }
+
+                    MPI_Get_count (&md->status, MPI_BYTE, &count);
+                    if (count != fd->bytes_written)
+                    {
+                        fprintf (stderr, "e:MPI method tried to write %llu, "
+                                         "only wrote %d\n"
+                                ,fd->bytes_written
+                                ,count
+                                );
+                    }
+                    fd->base_offset += count;
+                    fd->offset = 0;
+                    fd->bytes_written = 0;
+                    adios_shared_buffer_free (&md->b);
+
+                    a = a->next;
+                }
+
+                // set it up so that it will start at 0, but have correct sizes
+                fd->offset = fd->base_offset - md->vars_start;
+                fd->vars_start = 0;
+                fd->buffer_size = 0;
+                adios_write_close_attributes_v1 (fd);
+                MPI_File_seek (md->fh, md->vars_start, MPI_SEEK_SET);
+                // fd->vars_start gets updated with the size written
+#if 0
+                err = MPI_File_write (md->fh, fd->buffer, md->vars_header_size
+                                     ,MPI_BYTE, &md->status
+                                     );
+#endif
+                {              
+                    uint64_t total_written = 0;
+                    uint64_t to_write = md->vars_header_size;
+                    int write_len = 0;
+                    int count;
+                    char * buf_ptr = fd->buffer;
+                    while (total_written < md->vars_header_size)
+                    {
+                        write_len = (to_write > INT32_MAX) ? INT32_MAX : to_write;
+                        err = MPI_File_write (md->fh, buf_ptr, write_len, MPI_BYTE, &md->status);
+                        MPI_Get_count(&md->status, MPI_BYTE, &count);
+                        if (count != write_len)
+                        {
+                            err = count;
+                            break;
+                        }
+                        total_written += count;
+                        buf_ptr += count;
+                        to_write -= count;
+                        //err = total_written;
+                    }
+                }              
+                if (err != MPI_SUCCESS) 
+                {              
+                    char e [MPI_MAX_ERROR_STRING];
+                    int len = 0;
+                    memset (e, 0, MPI_MAX_ERROR_STRING);
+                    MPI_Error_string (err, e, &len);
+                    fprintf (stderr, "adios_mpi_close (8) failed %s: '%s'\n"
+                            ,fd->name, e
+                            );       
+
+                }
+
+                MPI_Get_count (&md->status, MPI_BYTE, &count);
+                if (count != md->vars_header_size)
+                {
+                    fprintf (stderr, "f:MPI method tried to write %llu, "
+                                     "only wrote %d\n"
+                            ,md->vars_header_size
+                            ,count
+                            );
+                }
+                fd->offset = 0;
+                fd->bytes_written = 0;
+            }
+
+            // build index appending to any existing index
+            adios_build_index_v1 (fd, &md->old_pg_root, &md->old_vars_root
+                                 ,&md->old_attrs_root
+                                 );
+            // if collective, gather the indexes from the rest and call
+            if (md->group_comm != MPI_COMM_NULL)
+            {
+                if (md->rank == 0)
+                {
+                    int * index_sizes = malloc (4 * md->size);
+                    int * index_offsets = malloc (4 * md->size);
+                    char * recv_buffer = 0;
+                    uint32_t size = 0;
+                    uint32_t total_size = 0;
+                    int i;
+
+                    MPI_Gather (&size, 1, MPI_INT
+                               ,index_sizes, 1, MPI_INT
+                               ,0, md->group_comm
+                               );
+
+                    for (i = 0; i < md->size; i++)
+                    {
+                        index_offsets [i] = total_size;
+                        total_size += index_sizes [i];
+                    }
+
+                    recv_buffer = malloc (total_size);
+
+                    MPI_Gatherv (&size, 0, MPI_BYTE
+                                ,recv_buffer, index_sizes, index_offsets
+                                ,MPI_BYTE, 0, md->group_comm
+                                );
+
+                    char * buffer_save = md->b.buff;
+                    uint64_t buffer_size_save = md->b.length;
+                    uint64_t offset_save = md->b.offset;
+
+                    for (i = 1; i < md->size; i++)
+                    {
+                        md->b.buff = recv_buffer + index_offsets [i];
+                        md->b.length = index_sizes [i];
+                        md->b.offset = 0;
+
+                        adios_parse_process_group_index_v1 (&md->b
+                                                           ,&new_pg_root
+                                                           );
+                        adios_parse_vars_index_v1 (&md->b, &new_vars_root);
+                        adios_parse_attributes_index_v1 (&md->b
+                                                        ,&new_attrs_root
+                                                        );
+                        adios_merge_index_v1 (&md->old_pg_root
+                                             ,&md->old_vars_root
+                                             ,&md->old_attrs_root
+                                             ,new_pg_root, new_vars_root
+                                             ,new_attrs_root
+                                             );
+                        new_pg_root = 0;
+                        new_vars_root = 0;
+                        new_attrs_root = 0;
+                    }
+                    md->b.buff = buffer_save;
+                    md->b.length = buffer_size_save;
+                    md->b.offset = offset_save;
+
+                    free (recv_buffer);
+                    free (index_sizes);
+                    free (index_offsets);
+                }
+                else
+                {
+                    adios_write_index_v1 (&buffer, &buffer_size, &buffer_offset
+                                         ,0, md->old_pg_root
+                                         ,md->old_vars_root
+                                         ,md->old_attrs_root
+                                         );
+
+                    int _buffer_size = buffer_size;
+
+                    MPI_Gather (&_buffer_size, 1, MPI_INT, 0, 0, MPI_INT
+                               ,0, md->group_comm
+                               );
+                    MPI_Gatherv (buffer, buffer_size, MPI_BYTE
+                                ,0, 0, 0, MPI_BYTE
+                                ,0, md->group_comm
+                                );
+                }
+            }
+
+            if (fd->shared_buffer == adios_flag_yes)
+            {
+                // everyone writes their data
+                MPI_File_seek (md->fh, fd->base_offset, MPI_SEEK_SET);
+#if 0
+                err = MPI_File_write (md->fh, fd->buffer, fd->bytes_written
+                                     ,MPI_BYTE, &md->status
+                                     );
+#endif
+                {              
+                    uint64_t total_written = 0;
+                    uint64_t to_write = fd->bytes_written;
+                    int write_len = 0;
+                    int count;
+                    char * buf_ptr = fd->buffer;
+                    while (total_written < fd->bytes_written)
+                    {
+                        write_len = (to_write > INT32_MAX) ? INT32_MAX : to_write;
+                        err = MPI_File_write (md->fh, buf_ptr, write_len, MPI_BYTE, &md->status);
+                        MPI_Get_count(&md->status, MPI_BYTE, &count);
+                        if (count != write_len)
+                        {
+                            err = count;
+                            break;
+                        }
+                        total_written += count;
+                        buf_ptr += count;
+                        to_write -= count;
+                        //err = total_written;
+                    }
+                }              
+                if (err != MPI_SUCCESS) 
+                {              
+                    char e [MPI_MAX_ERROR_STRING];
+                    int len = 0;
+                    memset (e, 0, MPI_MAX_ERROR_STRING);
+                    MPI_Error_string (err, e, &len);
+                    fprintf (stderr, "adios_mpi_close (9) failed %s: '%s'\n"
+                            ,fd->name, e
+                            );       
+                }
+            }
+
+            if (md->rank == 0)
+            {
+                adios_write_index_v1 (&buffer, &buffer_size, &buffer_offset
+                                     ,index_start, md->old_pg_root
+                                     ,md->old_vars_root
+                                     ,md->old_attrs_root
+                                     );
+                adios_write_version_v1 (&buffer, &buffer_size, &buffer_offset);
+
+                MPI_File_seek (md->fh, md->b.pg_index_offset, MPI_SEEK_SET);
+#if 0
+                err = MPI_File_write (md->fh, buffer, buffer_offset, MPI_BYTE
+                                     ,&md->status
+                                     );
+#endif
+                {              
+                    uint64_t total_written = 0;
+                    uint64_t to_write = buffer_offset;
+                    int write_len = 0;
+                    int count;
+                    char * buf_ptr = buffer;
+                    while (total_written < buffer_offset)
+                    {
+                        write_len = (to_write > INT32_MAX) ? INT32_MAX : to_write;
+                        err = MPI_File_write (md->fh, buf_ptr, write_len, MPI_BYTE, &md->status);
+                        MPI_Get_count(&md->status, MPI_BYTE, &count);
+                        if (count != write_len)
+                        {
+                            err = count;
+                            break;
+                        }
+                        total_written += count;
+                        buf_ptr += count;
+                        to_write -= count;
+                        //err = total_written;
+                    }
+                }              
+                if (err != MPI_SUCCESS) 
+                {              
+                    char e [MPI_MAX_ERROR_STRING];
+                    int len = 0;
+                    memset (e, 0, MPI_MAX_ERROR_STRING);
+                    MPI_Error_string (err, e, &len);
+                    fprintf (stderr, "adios_mpi_close (10) failed %s: '%s'\n"
+                            ,fd->name, e
+                            );       
+                }
+            }
+
+            free (buffer);
+
+            adios_clear_index_v1 (new_pg_root, new_vars_root, new_attrs_root);
+            adios_clear_index_v1 (md->old_pg_root, md->old_vars_root
+                                 ,md->old_attrs_root
+                                 );
+            new_pg_root = 0;
+            new_vars_root = 0;
+            new_attrs_root = 0;
+            md->old_pg_root = 0;
+            md->old_vars_root = 0;
+            md->old_attrs_root = 0;
+
+            break;
+        }
+
+        default:
+        {
+            fprintf (stderr, "Unknown file mode: %d\n", fd->mode);
+        }
+    }
+
+    if (md && md->fh)
+    {
+#if COLLECT_METRICS
+        MPI_File_sync (md->fh);
+#endif
+        MPI_File_close (&md->fh);
+    }
+
+#if COLLECT_METRICS
+    gettimeofday (&timing.t28, NULL);
+    print_metrics (md, iteration++);
+#endif
+    if (   md->group_comm != MPI_COMM_WORLD
+        && md->group_comm != MPI_COMM_SELF
+        && md->group_comm != MPI_COMM_NULL
+       )
+    {
+        md->group_comm = MPI_COMM_NULL;
+    }
+
+    md->fh = 0;
+    md->req = 0;
+    memset (&md->status, 0, sizeof (MPI_Status));
+    md->group_comm = MPI_COMM_NULL;
+
+    adios_clear_index_v1 (md->old_pg_root, md->old_vars_root
+                         ,md->old_attrs_root
+                         );
+    md->old_pg_root = 0;
+    md->old_vars_root = 0;
+    md->old_attrs_root = 0;
+}
+
+void adios_mpi_finalize (int mype, struct adios_method_struct * method)
+{
+    struct adios_MPI_data_struct * md = (struct adios_MPI_data_struct *)
+                                                    method->method_data;
+    if (adios_mpi_initialized)
+    {
+        adios_mpi_initialized = 0;
+        MPI_Info_free (&md->info);
+    }
+}
+
+void adios_mpi_end_iteration (struct adios_method_struct * method)
+{
+}
+
+void adios_mpi_start_calculation (struct adios_method_struct * method)
+{
+}
+
+void adios_mpi_stop_calculation (struct adios_method_struct * method)
+{
+}
diff --git a/src/adios_mpi_amr.c b/src/adios_mpi_amr.c
new file mode 100644
index 0000000..8155694
--- /dev/null
+++ b/src/adios_mpi_amr.c
@@ -0,0 +1,3181 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <errno.h>
+
+#include <pthread.h>
+// mpi
+#include "mpi.h"
+
+// xml parser
+#include <mxml.h>
+
+#include "adios.h"
+#include "adios_transport_hooks.h"
+#include "adios_bp_v1.h"
+#include "adios_internals.h"
+#include "buffer.h"
+
+static int adios_mpi_amr_initialized = 0;
+static int * g_is_aggregator = 0;
+static int g_num_aggregators = 0;
+static int g_merging_pgs = 0;
+static int g_color1 = 0;
+static int g_color2 = 0;
+static MPI_Offset * g_offsets= 0;
+static pthread_t g_t, g_t1;
+
+static struct adios_MPI_thread_data_open open_thread_data1;
+static struct adios_MPI_thread_data_open open_thread_data2;
+
+#define is_aggregator(rank)  g_is_aggregator[rank]
+#define FREE(v) \
+  if (v)        \
+  {             \
+      free (v); \
+      v = 0;    \
+  }             \
+
+#define SHIM_FOOTER_SIZE 4
+#define ATTR_COUNT_SIZE  2
+#define ATTR_LEN_SIZE    8
+#define MAX_AGG_BUF      704643072
+
+struct adios_MPI_data_struct
+{
+    MPI_File fh;
+    MPI_File mfh;
+    char * subfile_name;
+    MPI_Request req;
+    MPI_Status status;
+    MPI_Comm group_comm;
+    int rank;
+    int size;
+
+    void * comm; // temporary until moved from should_buffer to open
+
+    struct adios_bp_buffer_struct_v1 b;
+
+    struct adios_index_process_group_struct_v1 * old_pg_root;
+    struct adios_index_var_struct_v1 * old_vars_root;
+    struct adios_index_attribute_struct_v1 * old_attrs_root;
+
+    uint64_t vars_start;
+    uint64_t vars_header_size;
+
+    uint64_t striping_unit;  // file system stripe size
+    uint64_t block_unit;
+};
+
+struct adios_MPI_thread_data_open
+{
+    MPI_File * fh;
+    char * name;
+    uint64_t * striping_unit;
+    char * parameters;
+};
+
+struct adios_MPI_thread_data_write
+{
+    MPI_File * fh;
+    uint64_t * base_offset;
+    void * aggr_buff;
+    int * total_data_size;
+    uint64_t * block_unit;
+};
+
+#if COLLECT_METRICS
+// see adios_adaptive_finalize for what each represents
+struct timeval t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t22, t23, t24, t25;
+
+// Subtract the `struct timeval' values X and Y,
+// storing the result in RESULT.
+// Return 1 if the difference is negative, otherwise 0.
+static int timeval_subtract (struct timeval * result
+                            ,struct timeval * x, struct timeval * y
+                            )
+{
+  // Perform the carry for the later subtraction by updating y.
+  if (x->tv_usec < y->tv_usec)
+  {
+    int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1;
+    y->tv_usec -= 1000000 * nsec;
+    y->tv_sec += nsec;
+  }
+  if (x->tv_usec - y->tv_usec > 1000000)
+  {
+    int nsec = (x->tv_usec - y->tv_usec) / 1000000;
+    y->tv_usec += 1000000 * nsec;
+    y->tv_sec -= nsec;
+  }
+
+  // Compute the time remaining to wait.
+  // tv_usec is certainly positive.
+  result->tv_sec = x->tv_sec - y->tv_sec;
+  result->tv_usec = x->tv_usec - y->tv_usec;
+
+  // Return 1 if result is negative.
+  return x->tv_sec < y->tv_sec;
+}
+
+static
+void print_metrics (struct adios_MPI_data_struct * md, int iteration)
+{
+    struct timeval diff;
+    if (md->rank == 0)
+    {
+        timeval_subtract (&diff, &t2, &t1);
+        printf ("cc\t%2d\tFile create (stripe setup):\t%02d.%06d\n"
+               ,iteration, diff.tv_sec, diff.tv_usec);
+        
+        timeval_subtract (&diff, &t6, &t5);
+        printf ("dd\t%2d\tMass file open:\t%02d.%06d\n"
+               ,iteration, diff.tv_sec, diff.tv_usec);
+        
+        timeval_subtract (&diff, &t17, &t16);
+        printf ("ee\t%2d\tBuild file offsets:\t%02d.%06d\n"
+               ,iteration, diff.tv_sec, diff.tv_usec);
+    }
+    if (md->rank == md->size - 1)
+    {   
+        timeval_subtract (&diff, &t10, &t9);
+        printf ("ff\t%2d\tGlobal index creation:\t%02d.%06d\n"
+               ,iteration, diff.tv_sec, diff.tv_usec);
+        
+        timeval_subtract (&diff, &t8, &t7);
+        printf ("gg\t%2d\tAll writes complete (w/ local index):\t%02d.%06d\n"
+               ,iteration, diff.tv_sec, diff.tv_usec);
+        
+        timeval_subtract (&diff, &t11, &t0);
+        printf ("hh\t%2d\tTotal time:\t%02d.%06d\n"
+               ,iteration, diff.tv_sec, diff.tv_usec);
+    }
+    
+    timeval_subtract (&diff, &t13, &t12);
+    printf ("ii\t%2d\tLocal index creation:\t%6d\t%02d.%06d\n"
+           ,iteration, md->rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t22, &t21);
+    printf ("kk\t%2d\tshould buffer time:\t%6d\t%02d.%06d\n"
+           ,iteration, md->rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t19, &t23);
+    printf ("ll\t%2d\tclose startup time:\t%6d\t%02d.%06d\n"
+           ,iteration, md->rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t19, &t0);
+    printf ("mm\t%2d\tsetup time:\t%6d\t%02d.%06d\n"
+           ,iteration, md->rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t14, &t20);
+    printf ("nn\t%2d\tcleanup time:\t%6d\t%02d.%06d\n"
+           ,iteration, md->rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t21, &t0);
+    printf ("oo\t%2d\topen->should_buffer time:\t%6d\t%02d.%06d\n"
+           ,iteration, md->rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t24, &t21);
+    printf ("pp\t%2d\tshould_buffer->write1 time:\t%6d\t%02d.%06d\n"
+           ,iteration, md->rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t25, &t24);
+    printf ("qq1\t%2d\twrite1->write2 time:\t%6d\t%02d.%06d\n"
+           ,iteration, md->rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t23, &t25);
+    printf ("qq2\t%2d\twrite2->close start time:\t%6d\t%02d.%06d\n"
+           ,iteration, md->rank, diff.tv_sec, diff.tv_usec);
+}
+#endif
+
+#if defined(__APPLE__)
+#       include <sys/param.h>
+#       include <sys/mount.h>
+#else
+#       include <sys/statfs.h>
+#endif
+
+// this should be determined at configure time
+//#define ADIOS_LUSTRE
+
+//#ifdef ADIOS_LUSTRE
+#include <sys/ioctl.h>
+//#include <lustre/lustre_user.h>
+//#endif
+// from /usr/include/lustre/lustre_user.h
+#define LUSTRE_SUPER_MAGIC 0x0BD00BD0
+#  define LOV_USER_MAGIC 0x0BD10BD0
+#  define LL_IOC_LOV_SETSTRIPE  _IOW ('f', 154, long)
+#  define LL_IOC_LOV_GETSTRIPE  _IOW ('f', 155, long)
+#define O_LOV_DELAY_CREATE 0100000000
+
+struct lov_user_ost_data {           // per-stripe data structure
+        uint64_t l_object_id;        // OST object ID
+        uint64_t l_object_gr;        // OST object group (creating MDS number)
+        uint32_t l_ost_gen;          // generation of this OST index
+        uint32_t l_ost_idx;          // OST index in LOV
+} __attribute__((packed));
+struct lov_user_md {                 // LOV EA user data (host-endian)
+        uint32_t lmm_magic;          // magic number = LOV_USER_MAGIC_V1
+        uint32_t lmm_pattern;        // LOV_PATTERN_RAID0, LOV_PATTERN_RAID1
+        uint64_t lmm_object_id;      // LOV object ID
+        uint64_t lmm_object_gr;      // LOV object group
+        uint32_t lmm_stripe_size;    // size of stripe in bytes
+        uint16_t lmm_stripe_count;   // num stripes in use for this object
+        uint16_t lmm_stripe_offset;  // starting stripe offset in lmm_objects
+        struct lov_user_ost_data  lmm_objects[0]; // per-stripe data
+} __attribute__((packed));
+
+static void trim_spaces (char * str)
+{
+    char * t = str, * p = NULL;
+    while (*t != '\0')
+    {
+        if (*t == ' ')
+        {
+            p = t + 1;
+            strcpy (t, p);
+        }
+        else
+            t++;
+    }
+
+}
+
+static void
+adios_mpi_amr_set_striping_unit(MPI_File fh, char *filename, char *parameters)
+{
+    struct statfs fsbuf;
+    int err = 0, flag;
+    uint64_t striping_unit = 0;
+    uint64_t block_unit = 0;
+    uint16_t striping_count = 0;
+    char     value[64], *temp_string, *p_count,*p_size;
+    MPI_Info info_used;
+
+//#ifndef ADIOS_LUSTRE
+//    return 0;  // disable stripe-size I/O for non-Lustre file system
+//#else
+    temp_string = (char *) malloc (strlen (parameters) + 1);
+    strcpy (temp_string, parameters);
+    trim_spaces (temp_string);
+
+    if (p_count = strstr (temp_string, "stripe_count"))
+    {
+        char * p = strchr (p_count, '=');
+        char * q = strtok (p, ",");
+        if (!q)
+            striping_count = atoi (q + 1);
+        else
+            striping_count = atoi (p + 1);
+    }
+
+    if (striping_count <= 0)
+        striping_count = 4;
+
+    strcpy (temp_string, parameters);
+    trim_spaces (temp_string);
+
+    if (p_size = strstr (temp_string, "stripe_size"))
+    {
+        char * p = strchr (p_size, '=');
+        char * q = strtok (p, ",");
+        if (!q)
+            striping_unit = atoi(q + 1);
+        else
+            striping_unit = atoi(p + 1);
+    }
+
+    if (striping_unit <= 0)
+        striping_unit = 1048576;
+
+    strcpy (temp_string, parameters);
+    trim_spaces (temp_string);
+
+    if (p_size = strstr (temp_string, "block_size"))
+    {
+        char * p = strchr (p_size, '=');
+        char * q = strtok (p, ",");
+        if (!q)
+            block_unit = atoi(q + 1);
+        else
+            block_unit = atoi(p + 1);
+    }
+
+    if (block_unit <= 0)
+        block_unit = 1048576;
+
+    free (temp_string);
+
+    int fd, old_mask, perm;
+
+    old_mask = umask(022);
+    umask(old_mask);
+    perm = old_mask ^ 0666;
+
+    fd =  open(filename, O_RDONLY | O_CREAT | O_LOV_DELAY_CREATE, perm);
+    if (fd != -1) {
+        struct lov_user_md lum;
+        lum.lmm_magic = LOV_USER_MAGIC;
+        lum.lmm_pattern = 0;
+        lum.lmm_stripe_size = striping_unit;
+        lum.lmm_stripe_count = striping_count;
+        lum.lmm_stripe_offset = g_color1 % 672;
+        ioctl (fd, LL_IOC_LOV_SETSTRIPE
+              ,(void *) &lum
+              );
+
+        if (err == 0 && lum.lmm_stripe_size > 0) {
+            striping_unit = lum.lmm_stripe_size;
+        }
+        close(fd);
+    }
+    else
+        printf("Warning: open failed on file %s %s.\n",filename,strerror(errno));
+//#endif
+}
+
+static void
+adios_mpi_amr_set_block_unit(uint64_t *block_unit, char *parameters)
+{
+    char *temp_string, *p_count,*p_size;
+
+    temp_string = (char *) malloc (strlen (parameters) + 1);
+    strcpy (temp_string, parameters);
+    trim_spaces (temp_string);
+
+    if (p_size = strstr (temp_string, "block_size"))
+    {
+        char * p = strchr (p_size, '=');
+        char * q = strtok (p, ",");
+        if (!q)
+            *block_unit = atoi(q + 1);
+        else
+            *block_unit = atoi(p + 1);
+    }
+
+    if (*block_unit <= 0)
+        *block_unit = 1048576;
+
+    free (temp_string);
+}
+
+static void
+adios_mpi_amr_set_aggregation_parameters(char * parameters, int nproc, int rank)
+{
+    int err = 0, flag, i, aggr_group_size, remain, index;
+    char value[64], *temp_string, *p_count,*p_size;
+
+    temp_string = (char *) malloc (strlen (parameters) + 1);
+    strcpy (temp_string, parameters);
+    trim_spaces (temp_string);
+
+    if (p_size = strstr (temp_string, "num_aggregators"))
+    {
+        char * p = strchr (p_size, '=');
+        char * q = strtok (p, ",");
+        if (!q)
+            g_num_aggregators = atoi(q + 1);
+        else
+            g_num_aggregators = atoi(p + 1);
+    }
+
+    strcpy (temp_string, parameters);
+    trim_spaces (temp_string);
+
+    if (p_size = strstr (temp_string, "merging_pgs"))
+    {
+        char * p = strchr (p_size, '=');
+        char * q = strtok (p, ",");
+        if (!q)
+            g_merging_pgs = atoi(q + 1);
+        else
+            g_merging_pgs = atoi(p + 1);
+    }
+
+    free (temp_string);
+
+    if (g_num_aggregators > nproc || g_num_aggregators <= 0)
+    {
+        g_num_aggregators = nproc;  //no aggregation
+    }
+
+    g_is_aggregator = (int *) malloc (nproc * sizeof(int));
+    if (g_is_aggregator == 0)
+    {
+        fprintf (stderr, "can not malloc\n");
+        return;
+    }
+    memset (g_is_aggregator, 0, nproc * sizeof(int));
+
+    aggr_group_size = nproc / g_num_aggregators;
+    remain = nproc - (int) aggr_group_size * g_num_aggregators;
+
+    index = 0;
+    for (i = 0; i < g_num_aggregators; i++)
+    {
+        g_is_aggregator[index] = 1;
+
+        if (i < remain)
+        {
+            index += aggr_group_size + 1;
+        }
+        else
+        {
+            index += aggr_group_size;
+        }
+    }
+
+    if (remain == 0)
+    {
+        g_color1 = rank / aggr_group_size;
+        g_color2 = rank % aggr_group_size;
+    }
+    else
+    {
+        if (rank < (aggr_group_size + 1) * remain)
+        {
+            g_color1 = rank / (aggr_group_size + 1);
+            g_color2 = rank % (aggr_group_size + 1);
+        }
+        else
+        {
+            g_color1 = remain + (rank - (aggr_group_size + 1) * remain) / aggr_group_size;
+            g_color2 = (rank - (aggr_group_size + 1) * remain)% aggr_group_size;
+        }
+    }
+}
+
+static void adios_mpi_amr_buffer_write (char ** buffer, uint64_t * buffer_size
+                         ,uint64_t * buffer_offset
+                         ,const void * data, uint64_t size
+                         )
+{
+    if (*buffer_offset + size > *buffer_size || *buffer == 0)
+    {
+        char * b = realloc (*buffer, *buffer_offset + size + 1000);
+        if (b)
+        {
+            *buffer = b;
+            *buffer_size = (*buffer_offset + size + 1000);
+        }
+        else
+        {
+            fprintf (stderr, "Cannot allocate memory in adios_mpi_amr_buffer_write.  "
+                             "Requested: %llu\n", *buffer_offset + size + 1000);
+
+            return;
+        }
+    }
+
+    memcpy (*buffer + *buffer_offset, data, size);
+    *buffer_offset += size;
+}
+
+static int
+adios_mpi_amr_get_striping_unit(MPI_File fh, char *filename)
+{
+    struct statfs fsbuf;
+    int err, flag;
+    uint64_t striping_unit = 1048576;
+    char     value[64];
+    MPI_Info info_used;
+
+#if COLLECT_METRICS
+    gettimeofday (&t1, NULL);
+#endif
+
+    // get striping_unit from MPI hint if it has
+    MPI_File_get_info(fh, &info_used);
+    MPI_Info_get(info_used, "striping_unit", 63, value, &flag);
+    MPI_Info_free(&info_used);
+
+    if (flag) return atoi(value);
+
+    // if striping_unit is not set in MPI file info, get it from system
+    err = statfs(filename, &fsbuf);
+    if (err == -1) {
+        printf("Warning: statfs failed %s %s.\n",filename,strerror(errno));
+        return striping_unit;
+    }
+
+    if (!err && fsbuf.f_type == LUSTRE_SUPER_MAGIC) {
+        int fd, old_mask, perm;
+
+        old_mask = umask(022);
+        umask(old_mask);
+        perm = old_mask ^ 0666;
+
+        fd =  open(filename, O_RDONLY, perm);
+        if (fd != -1) {
+            struct lov_user_md lum;
+            lum.lmm_magic = LOV_USER_MAGIC;
+            err = ioctl(fd, LL_IOC_LOV_GETSTRIPE, (void *) &lum);
+            if (err == 0 && lum.lmm_stripe_size > 0) {
+                striping_unit = lum.lmm_stripe_size;
+            }
+            close(fd);
+        }
+        else
+            printf("Warning: open failed on file %s %s.\n",filename,strerror(errno));
+    }
+
+#if COLLECT_METRICS         
+    gettimeofday (&t2, NULL);
+#endif
+    // set the file striping size
+    return striping_unit;
+}
+
+static uint64_t
+adios_mpi_amr_striping_unit_write(MPI_File    fh
+                                  ,MPI_Offset  offset
+                                  ,void       *buf
+                                  ,uint64_t   len
+                                  ,uint64_t   block_unit
+                                  )
+{
+    uint64_t err = -1;
+    MPI_Status status;
+
+    if (len == 0)
+        return 0;
+
+    if (offset == -1) // use current position
+        MPI_File_get_position(fh, &offset);
+    else
+        MPI_File_seek (fh, offset, MPI_SEEK_SET);
+
+    if (block_unit > 0)
+    {
+        MPI_Offset  rem_off = offset;
+        uint64_t    rem_size = len;
+        char       *buf_ptr = buf;
+
+        err = 0;
+        while (rem_size > 0)
+        {
+            uint64_t rem_unit  = block_unit - rem_off % block_unit;
+            int write_len = (rem_unit < rem_size) ? rem_unit : rem_size;
+            int ret_len;
+
+            MPI_File_write (fh, buf_ptr, write_len, MPI_BYTE, &status);
+            MPI_Get_count(&status, MPI_BYTE, &ret_len);
+            if (ret_len < 0) {err = ret_len; break;}
+            err += ret_len;
+            if (ret_len != write_len) break;
+            buf_ptr  += write_len;
+            rem_off  += write_len;
+            rem_size -= write_len;
+        }
+    }
+    else
+    {
+        uint64_t total_written = 0;
+        uint64_t to_write = len;
+        int write_len = 0;
+        int count;
+        char * buf_ptr = buf;
+        while (total_written < len)
+        {
+            write_len = (to_write > INT32_MAX) ? INT32_MAX : to_write;
+            MPI_File_write (fh, buf_ptr, write_len, MPI_BYTE, &status);
+            MPI_Get_count(&status, MPI_BYTE, &count);
+            if (count != write_len)
+            {
+                err = count;
+                break;
+            }
+            total_written += count;
+            buf_ptr += count;
+            to_write -= count;
+            err = total_written;
+        }
+    }
+
+    return err;
+}
+
+struct adios_var_struct * adios_mpi_amr_copy_var (struct adios_var_struct * v)
+{
+    struct adios_var_struct * v_new = (struct adios_var_struct *) 
+                            malloc (sizeof (struct adios_var_struct));
+    if (v_new == 0)
+    {
+        fprintf (stderr, "can not malloc\n");
+        return 0;
+    }
+
+    v_new->name = strdup (v->name);
+    v_new->path = strdup (v->path);
+    v_new->type = v->type;
+    v_new->got_buffer = v->got_buffer;
+    v_new->is_dim = v->is_dim;
+    v_new->write_offset = v->write_offset;
+    v_new->stats = 0;
+    v_new->free_data = v->free_data;
+    v_new->data = 0;
+    v_new->data_size = v->data_size;
+    v_new->next = 0;
+
+    //struct adios_dimension_struct * dimensions;
+
+    return v_new;
+}
+
+void adios_mpi_amr_append_var (struct adios_file_struct * fd, struct adios_var_struct * v)
+{
+    struct adios_var_struct * root = fd->group->vars;
+    if (!root)
+    {
+        root = v;
+        return;
+    }
+
+    while (root->next)
+    {
+        root = root->next;
+    }
+
+    root->next = v;
+}
+
+void adios_mpi_amr_add_offset (uint64_t var_offset_to_add
+                               ,uint64_t attr_offset_to_add
+                               ,struct adios_index_var_struct_v1 * vars_root
+                               ,struct adios_index_attribute_struct_v1 * attrs_root
+                               )
+{
+    while (vars_root)
+    {
+        vars_root->characteristics [0].offset += var_offset_to_add;
+        vars_root->characteristics [0].payload_offset += var_offset_to_add;
+        vars_root = vars_root->next;
+    }
+
+    while (attrs_root)
+    {
+        attrs_root->characteristics [0].offset += attr_offset_to_add;
+        attrs_root->characteristics [0].payload_offset += attr_offset_to_add;
+        attrs_root = attrs_root->next;
+    }
+}
+
+void adios_mpi_amr_subtract_offset (uint64_t var_offset_to_subtract
+                                    ,uint64_t attr_offset_to_subtract
+                                    ,struct adios_index_var_struct_v1 * vars_root
+                                    ,struct adios_index_attribute_struct_v1 * attrs_root
+                                    )
+{
+    while (vars_root)
+    {
+        vars_root->characteristics [0].offset -= var_offset_to_subtract;
+        vars_root->characteristics [0].payload_offset -= var_offset_to_subtract;
+        vars_root = vars_root->next;
+    }
+
+    while (attrs_root)
+    {
+        attrs_root->characteristics [0].offset -= attr_offset_to_subtract;
+        attrs_root->characteristics [0].payload_offset -= attr_offset_to_subtract;
+        attrs_root = attrs_root->next;
+    }
+}
+
+
+void adios_mpi_amr_build_global_index_v1 (char * fname
+                                          ,struct adios_index_process_group_struct_v1 * pg_root
+                                          ,struct adios_index_var_struct_v1 * vars_root
+                                          ,struct adios_index_attribute_struct_v1 * attrs_root
+                                          )
+{
+    int len;
+    char * s;
+
+    while (vars_root)
+    {
+        // Add, e.g., "/restart.bp.0/" in the beginning
+        len = 1 + strlen (fname) + 1 + strlen (vars_root->var_path) + 1;
+        s = (char *)malloc (len);
+
+        sprintf (s, "%s%s%s%s", "/", fname, "/", vars_root->var_path);
+        FREE (vars_root->var_path);
+        vars_root->var_path = s;
+
+        vars_root = vars_root->next;
+    }
+
+    while (attrs_root)
+    {
+        len = 1 + strlen (fname) + 1 + strlen (attrs_root->attr_path) + 1;
+        s = (char *)malloc (len);
+
+        sprintf (s, "%s%s%s%s", "/", fname, "/", attrs_root->attr_path);
+        FREE (attrs_root->attr_path);
+        attrs_root->attr_path = s;
+
+        attrs_root = attrs_root->next;
+    }
+
+}
+
+
+int adios_mpi_amr_calc_aggregator_index (int rank)
+{
+    int j = rank - 1;
+
+    if (is_aggregator (rank))
+        return rank;
+
+    while (j > -1)
+    {
+        if (is_aggregator (j))
+            break;
+        j--;
+    }
+
+    return j;
+}
+
+void * adios_mpi_amr_do_mkdir (void * param)
+{
+    struct adios_file_struct * fd = (struct adios_file_struct *) param;
+    // 4 bytes for ".dir" 
+    char * dir_name = malloc (strlen (fd->name) + 4 + 1);
+    sprintf (dir_name, "%s%s", fd->name, ".dir");
+    
+    mkdir (dir_name, S_IRWXU | S_IRWXG);
+  
+    free (dir_name);
+
+    return NULL;
+}
+
+void * adios_mpi_amr_do_open_thread (void * param)
+{
+    struct adios_MPI_thread_data_open * td = (struct adios_MPI_thread_data_open *) param;
+
+    unlink (td->name);
+    if (td->parameters)
+    {
+        adios_mpi_amr_set_striping_unit (*td->fh
+                                         ,td->name
+                                         ,td->parameters
+                                         );
+    }
+
+    MPI_File_open (MPI_COMM_SELF, td->name
+                  ,MPI_MODE_WRONLY | MPI_MODE_CREATE
+                  ,MPI_INFO_NULL
+                  ,td->fh
+                  );
+
+    *td->striping_unit = adios_mpi_amr_get_striping_unit (*td->fh, td->name);
+ 
+    return NULL;
+}
+
+
+void * adios_mpi_amr_do_write_thread (void * param)
+{
+    struct adios_MPI_thread_data_write * td = (struct adios_MPI_thread_data_write *) param;
+
+    uint64_t count = adios_mpi_amr_striping_unit_write(
+                               *(td->fh)
+                              ,*(td->base_offset)
+                              ,td->aggr_buff
+                              ,*(td->total_data_size)
+                              ,*(td->block_unit));
+
+    if (count != *(td->total_data_size))
+    {
+        fprintf (stderr, "Err in adios_mpi_amr_striping_unit_write()\n");
+    }
+
+    return NULL;
+}
+
+static void adios_var_to_comm (const char * comm_name
+                              ,enum ADIOS_FLAG host_language_fortran
+                              ,void * data
+                              ,MPI_Comm * comm
+                              )
+{
+    if (data)
+    {
+        int t = *(int *) data;
+
+        if (!comm_name)
+        {
+            if (!t)
+            {
+                fprintf (stderr, "communicator not provided and none "
+                                 "listed in XML.  Defaulting to "
+                                 "MPI_COMM_SELF\n"
+                        );
+
+                *comm = MPI_COMM_SELF;
+            }
+            else
+            {
+                if (host_language_fortran == adios_flag_yes)
+                {
+                    *comm = MPI_Comm_f2c (t);
+                }
+                else
+                {
+                    *comm = *(MPI_Comm *) data;
+                }
+            }
+        }
+        else
+        {
+            if (!strcmp (comm_name, ""))
+            {
+                if (!t)
+                {
+                    fprintf (stderr, "communicator not provided and none "
+                                     "listed in XML.  Defaulting to "
+                                     "MPI_COMM_SELF\n"
+                            );
+
+                    *comm = MPI_COMM_SELF;
+                }
+                else
+                {
+                    if (host_language_fortran == adios_flag_yes)
+                    {
+                        *comm = MPI_Comm_f2c (t);
+                    }
+                    else
+                    {
+                        *comm = *(MPI_Comm *) data;
+                    }
+                }
+            }
+            else
+            {
+                if (!t)
+                {
+                    fprintf (stderr, "communicator not provided but one "
+                                     "listed in XML.  Defaulting to "
+                                     "MPI_COMM_WORLD\n"
+                            );
+
+                    *comm = MPI_COMM_WORLD;
+                }
+                else
+                {
+                    if (host_language_fortran == adios_flag_yes)
+                    {
+                        *comm = MPI_Comm_f2c (t);
+                    }
+                    else
+                    {
+                        *comm = *(MPI_Comm *) data;
+                    }
+                }
+            }
+        }
+    }
+    else
+    {
+        fprintf (stderr, "coordination-communication not provided. "
+                         "Using MPI_COMM_WORLD instead\n"
+                );
+
+        *comm = MPI_COMM_WORLD;
+    }
+}
+
+void adios_mpi_amr_init (const char * parameters
+                         ,struct adios_method_struct * method
+                         )
+{
+    struct adios_MPI_data_struct * md = (struct adios_MPI_data_struct *)
+                                                    method->method_data;
+    if (!adios_mpi_amr_initialized)
+    {
+        adios_mpi_amr_initialized = 1;
+    }
+
+    method->method_data = malloc (sizeof (struct adios_MPI_data_struct));
+    md = (struct adios_MPI_data_struct *) method->method_data;
+    md->fh = 0;
+    md->mfh = 0;
+    md->subfile_name = 0;
+    md->req = 0;
+    memset (&md->status, 0, sizeof (MPI_Status));
+    md->rank = 0;
+    md->size = 0;
+    md->group_comm = MPI_COMM_NULL;
+    md->old_pg_root = 0;
+    md->old_vars_root = 0;
+    md->old_attrs_root = 0;
+    md->vars_start = 0;
+    md->vars_header_size = 0;
+
+    adios_buffer_struct_init (&md->b);
+}
+
+int adios_mpi_amr_open (struct adios_file_struct * fd
+                        ,struct adios_method_struct * method, void * comm
+                        )
+{
+    struct adios_MPI_data_struct * md = (struct adios_MPI_data_struct *)
+                                                    method->method_data;
+
+    // we have to wait for the group_size (should_buffer) to get the comm
+    // before we can do an open for any of the modes
+    md->comm = comm;
+
+    return 1;
+}
+
+static
+void build_offsets (struct adios_bp_buffer_struct_v1 * b
+                   ,MPI_Offset * offsets, uint64_t size, char * group_name
+                   ,struct adios_index_process_group_struct_v1 * pg_root
+                   )
+{
+    while (pg_root)
+    {
+        if (!strcasecmp (pg_root->group_name, group_name))
+        {
+            MPI_Offset size = 0;
+
+            if (pg_root->next)
+            {
+                size = pg_root->next->offset_in_file - pg_root->offset_in_file;
+            }
+            else
+            {
+                size = b->pg_index_offset - pg_root->offset_in_file;
+            }
+
+            offsets [pg_root->process_id * 3] = pg_root->offset_in_file;
+            offsets [pg_root->process_id * 3 + 1] = size;
+            offsets [pg_root->process_id * 3 + 2] = b->version;
+        }
+
+        pg_root = pg_root->next;
+    }
+}
+
+enum ADIOS_FLAG adios_mpi_amr_should_buffer (struct adios_file_struct * fd
+                                             ,struct adios_method_struct * method
+                                             )
+{
+    int i;
+    struct adios_MPI_data_struct * md = (struct adios_MPI_data_struct *)
+                                                      method->method_data;
+    char * name, * name_no_path, * ch;
+    char * d_name;
+    int err;
+    int sig;    // used for coordinating the MPI_File_open
+
+    int previous;
+    int current;
+    int next;
+    uint16_t flag;
+
+
+    name = malloc (strlen (method->base_path) + strlen (fd->name) + 1);
+    sprintf (name, "%s%s", method->base_path, fd->name);
+
+    adios_var_to_comm (fd->group->group_comm
+                      ,fd->group->adios_host_language_fortran
+                      ,md->comm
+                      ,&md->group_comm
+                      );
+
+    if (md->group_comm != MPI_COMM_NULL)
+    {
+        MPI_Comm_rank (md->group_comm, &md->rank);
+        MPI_Comm_size (md->group_comm, &md->size);
+    }
+
+    fd->group->process_id = md->rank;
+
+    if (md->rank == md->size - 1)
+        next = -1;
+    else
+        next = md->rank + 1;
+    previous = md->rank - 1;
+    current = md->rank;
+
+    fd->base_offset = 0;
+
+    switch (fd->mode)
+    {
+        case adios_mode_read:
+        {
+            if (md->group_comm == MPI_COMM_NULL || md->rank == 0)
+            {
+                err = MPI_File_open (MPI_COMM_SELF, name, MPI_MODE_RDONLY
+                                    ,MPI_INFO_NULL, &md->fh
+                                    );
+                if (err != MPI_SUCCESS)
+                {
+                    char e [MPI_MAX_ERROR_STRING];
+                    int len = 0;
+                    memset (e, 0, MPI_MAX_ERROR_STRING);
+                    MPI_Error_string (err, e, &len);
+                    fprintf (stderr, "MPI open read failed for %s: '%s'\n"
+                            ,name, e
+                            );
+                    free (name);
+
+                    return adios_flag_no;
+                }
+
+                MPI_Offset file_size;
+                MPI_File_get_size (md->fh, &file_size);
+                md->b.file_size = file_size;
+
+                adios_init_buffer_read_version (&md->b);
+                MPI_File_seek (md->fh, md->b.file_size - md->b.length
+                              ,MPI_SEEK_SET
+                              );
+                MPI_File_read (md->fh, md->b.buff, md->b.length, MPI_BYTE
+                              ,&md->status
+                              );
+                adios_parse_version (&md->b, &md->b.version);
+
+                adios_init_buffer_read_index_offsets (&md->b);
+                // already in the buffer
+                adios_parse_index_offsets_v1 (&md->b);
+
+                adios_init_buffer_read_process_group_index (&md->b);
+                MPI_File_seek (md->fh, md->b.pg_index_offset
+                              ,MPI_SEEK_SET
+                              );
+                MPI_File_read (md->fh, md->b.buff, md->b.pg_size, MPI_BYTE
+                              ,&md->status
+                              );
+                adios_parse_process_group_index_v1 (&md->b
+                                                   ,&md->old_pg_root
+                                                   );
+
+#if 1
+                adios_init_buffer_read_vars_index (&md->b);
+                MPI_File_seek (md->fh, md->b.vars_index_offset
+                              ,MPI_SEEK_SET
+                              );
+                MPI_File_read (md->fh, md->b.buff, md->b.vars_size, MPI_BYTE
+                              ,&md->status
+                              );
+                adios_parse_vars_index_v1 (&md->b, &md->old_vars_root);
+
+                adios_init_buffer_read_attributes_index (&md->b);
+                MPI_File_seek (md->fh, md->b.attrs_index_offset
+                              ,MPI_SEEK_SET
+                              );
+                MPI_File_read (md->fh, md->b.buff, md->b.attrs_size, MPI_BYTE
+                              ,&md->status
+                              );
+                adios_parse_attributes_index_v1 (&md->b, &md->old_attrs_root);
+#endif
+
+                fd->base_offset = md->b.end_of_pgs;
+            }
+
+            if (   md->group_comm != MPI_COMM_NULL
+                && md->group_comm != MPI_COMM_SELF
+               )
+            {
+                if (md->rank == 0)
+                {
+                    MPI_Offset * offsets = malloc (  sizeof (MPI_Offset)
+                                                   * md->size * 3
+                                                  );
+                    memset (offsets, 0, sizeof (MPI_Offset) * md->size * 3);
+
+                    // go through the pg index to build the offsets array
+                    build_offsets (&md->b, offsets, md->size
+                                  ,fd->group->name, md->old_pg_root
+                                  );
+                    MPI_Scatter (offsets, 3, MPI_LONG_LONG
+                                ,offsets, 3, MPI_LONG_LONG
+                                ,0, md->group_comm
+                                );
+                    md->b.read_pg_offset = offsets [0];
+                    md->b.read_pg_size = offsets [1];
+                    free (offsets);
+                }
+                else
+                {
+                    MPI_Offset offset [3];
+                    offset [0] = offset [1] = offset [2] = 0;
+
+                    MPI_Scatter (offset, 3, MPI_LONG_LONG
+                                ,offset, 3, MPI_LONG_LONG
+                                ,0, md->group_comm
+                                );
+
+                    md->b.read_pg_offset = offset [0];
+                    md->b.read_pg_size = offset [1];
+                    md->b.version = offset [2];
+                }
+            }
+
+            // cascade the opens to avoid trashing the metadata server
+            if (previous == -1)
+            {
+                // note rank 0 is already open
+                // don't open it again here
+
+                if (next != -1)
+                {
+                    MPI_Isend (&sig, 1, MPI_INTEGER, next, current
+                              ,md->group_comm, &md->req
+                              );
+                }
+            }
+            else
+            {
+                MPI_Recv (&sig, 1, MPI_INTEGER, previous, previous
+                         ,md->group_comm, &md->status
+                         );
+                if (next != -1)
+                {
+                    MPI_Isend (&sig, 1, MPI_INTEGER, next, current
+                              ,md->group_comm, &md->req
+                              );
+                }
+                err = MPI_File_open (MPI_COMM_SELF, name
+                                    ,MPI_MODE_RDONLY
+                                    ,MPI_INFO_NULL
+                                    ,&md->fh
+                                    );
+            }
+
+            if (err != MPI_SUCCESS)
+            {
+                char e [MPI_MAX_ERROR_STRING];
+                int len = 0;
+                memset (e, 0, MPI_MAX_ERROR_STRING);
+                MPI_Error_string (err, e, &len);
+                fprintf (stderr, "MPI open write failed for %s: '%s'\n"
+                        ,name, e
+                        );
+                free (name);
+
+                return adios_flag_no;
+            }
+
+            break;
+        }
+
+        case adios_mode_write:
+        {
+            if (md->rank == 0)
+            {
+                adios_mpi_amr_do_mkdir (fd);
+            }
+
+            MPI_Barrier (md->group_comm);
+
+            fd->base_offset = 0;
+            fd->pg_start_in_file = 0;
+            adios_mpi_amr_set_aggregation_parameters (method->parameters
+                                                      ,md->size
+                                                      ,md->rank
+                                                      );
+            adios_mpi_amr_set_block_unit (&md->block_unit, method->parameters);
+
+            // Check if fd->name contains path
+            if (ch = strrchr (fd->name, '/'))
+            {
+                name_no_path = malloc (strlen (ch + 1) + 1); 
+                strcpy (name_no_path, ch + 1); 
+            }
+            else
+            {
+                name_no_path = malloc (strlen (fd->name) + 1);
+                strcpy (name_no_path, fd->name);
+            }
+
+            name = realloc (name, strlen (fd->name) + 5 + strlen (method->base_path) + strlen (name_no_path) + 1 + 10 + 1);
+            // create the subfile name, e.g. restart.bp.1
+            // 1 for '.' + 10 for subfile index + 1 for '\0'
+            sprintf (name, "%s%s%s%s.%d", fd->name, ".dir/", method->base_path, name_no_path, g_color1);
+            md->subfile_name = strdup (name);
+            fd->subfile_name = strdup (name);
+
+            free (name_no_path);
+
+            if (is_aggregator(md->rank))
+            {
+                if (fd->shared_buffer == adios_flag_yes)
+                {
+                    if (is_aggregator (md->rank))
+                    {
+                        // open subfiles
+                        open_thread_data1.fh = &md->fh;
+                        open_thread_data1.name = md->subfile_name;
+                        open_thread_data1.striping_unit = &md->striping_unit;
+                        open_thread_data1.parameters = method->parameters;
+
+                        pthread_create (&g_t, NULL
+                                       ,adios_mpi_amr_do_open_thread
+                                       ,(void *) &open_thread_data1
+                                       );
+
+                        // open metadata file
+                        if (md->rank == 0)
+                        {
+                            open_thread_data2.fh = &md->mfh;
+                            open_thread_data2.name = fd->name;
+                            open_thread_data2.striping_unit = &md->striping_unit;
+                            open_thread_data2.parameters = method->parameters;
+
+                            pthread_create (&g_t1, NULL
+                                           ,adios_mpi_amr_do_open_thread
+                                           ,(void *) &open_thread_data2
+                                           );
+                        }
+                    }
+                }
+
+                if (fd->shared_buffer == adios_flag_no)
+                {
+                    unlink (name);
+                    if (md->rank == 0)
+                    {
+                        unlink (fd->name);
+                    }
+
+                    if (method->parameters)
+                    {
+                        adios_mpi_amr_set_striping_unit (md->fh
+                                                         ,name
+                                                         ,method->parameters
+                                                         );
+                    }
+
+                    err = MPI_File_open (MPI_COMM_SELF, name
+                                        ,MPI_MODE_WRONLY | MPI_MODE_CREATE
+                                        ,MPI_INFO_NULL
+                                        ,&md->fh
+                                        );
+                    md->striping_unit = adios_mpi_amr_get_striping_unit (md->fh, name);
+
+                    if (err != MPI_SUCCESS)
+                    {
+                        char e [MPI_MAX_ERROR_STRING];
+                        int len = 0;
+                        memset (e, 0, MPI_MAX_ERROR_STRING);
+                        MPI_Error_string (err, e, &len);
+                        fprintf (stderr, "MPI open write failed for %s: '%s'\n"
+                                ,name, e
+                                );
+                        free (name);
+
+                        return adios_flag_no;
+                    }
+                }
+            }
+
+            if (md->group_comm != MPI_COMM_NULL)
+            {
+                fd->base_offset = 0;
+                fd->pg_start_in_file = fd->base_offset;
+            }
+            else
+            {
+                md->b.pg_index_offset = fd->write_size_bytes;
+            }
+
+            break;
+        }
+
+        case adios_mode_append:
+        {
+            int old_file = 1;
+            adios_buffer_struct_clear (&md->b);
+
+            err = MPI_File_open (MPI_COMM_SELF, name, MPI_MODE_RDONLY
+                                ,MPI_INFO_NULL, &md->fh
+                                );
+
+            if (err != MPI_SUCCESS)
+            {
+                old_file = 0;
+                err = MPI_File_open (MPI_COMM_SELF, name
+                                    ,MPI_MODE_WRONLY | MPI_MODE_CREATE
+                                    ,MPI_INFO_NULL, &md->fh
+                                    );
+
+                if (err != MPI_SUCCESS)
+                {
+                    char e [MPI_MAX_ERROR_STRING];
+                    int len = 0;
+                    memset (e, 0, MPI_MAX_ERROR_STRING);
+                    MPI_Error_string (err, e, &len);
+                    fprintf (stderr, "MPI open write failed for %s: '%s'\n"
+                            ,name, e
+                            );
+                    free (name);
+
+                    return adios_flag_no;
+                }
+                md->striping_unit = adios_mpi_amr_get_striping_unit(md->fh, name);
+            }
+
+            if (old_file)
+            {
+                if (md->group_comm == MPI_COMM_NULL || md->rank == 0)
+                {
+                    if (err != MPI_SUCCESS)
+                    {
+                        md->b.file_size = 0;
+                    }
+                    else
+                    {
+                        MPI_Offset file_size;
+                        MPI_File_get_size (md->fh, &file_size);
+                        md->b.file_size = file_size;
+                    }
+
+                    adios_init_buffer_read_version (&md->b);
+                    MPI_File_seek (md->fh, md->b.file_size - md->b.length
+                                  ,MPI_SEEK_SET
+                                  );
+                    MPI_File_read (md->fh, md->b.buff, md->b.length, MPI_BYTE
+                                  ,&md->status
+                                  );
+                    adios_parse_version (&md->b, &md->b.version);
+
+                    adios_init_buffer_read_index_offsets (&md->b);
+                    // already in the buffer
+                    adios_parse_index_offsets_v1 (&md->b);
+
+                    adios_init_buffer_read_process_group_index (&md->b);
+                    MPI_File_seek (md->fh, md->b.pg_index_offset
+                                  ,MPI_SEEK_SET
+                                  );
+                    MPI_File_read (md->fh, md->b.buff, md->b.pg_size, MPI_BYTE
+                                  ,&md->status
+                                  );
+                    adios_parse_process_group_index_v1 (&md->b
+                                                       ,&md->old_pg_root
+                                                       );
+
+                    adios_init_buffer_read_vars_index (&md->b);
+                    MPI_File_seek (md->fh, md->b.vars_index_offset
+                                  ,MPI_SEEK_SET
+                                  );
+                    MPI_File_read (md->fh, md->b.buff, md->b.vars_size, MPI_BYTE
+                                  ,&md->status
+                                  );
+                    adios_parse_vars_index_v1 (&md->b, &md->old_vars_root);
+
+                    adios_init_buffer_read_attributes_index (&md->b);
+                    MPI_File_seek (md->fh, md->b.attrs_index_offset
+                                  ,MPI_SEEK_SET
+                                  );
+                    MPI_File_read (md->fh, md->b.buff, md->b.attrs_size
+                                  ,MPI_BYTE, &md->status
+                                  );
+                    adios_parse_attributes_index_v1 (&md->b
+                                                    ,&md->old_attrs_root
+                                                    );
+
+                    fd->base_offset = md->b.end_of_pgs;
+                    fd->pg_start_in_file = fd->base_offset;
+                }
+                else
+                {
+                    fd->base_offset = 0;
+                    fd->pg_start_in_file = 0;
+                }
+
+                MPI_File_close (&md->fh);
+            }
+            else
+            {
+                fd->base_offset = 0;
+                fd->pg_start_in_file = 0;
+            }
+
+            // cascade the opens to avoid trashing the metadata server
+            if (previous == -1)
+            {
+                // we know it exists, because we created it if it didn't
+                // when reading the old file so can just open wronly
+                // but adding the create for consistency with write mode
+                // so it is easier to merge write/append later
+                err = MPI_File_open (MPI_COMM_SELF, name
+                                    ,MPI_MODE_WRONLY | MPI_MODE_CREATE
+                                    ,MPI_INFO_NULL
+                                    ,&md->fh
+                                    );
+                md->striping_unit = adios_mpi_amr_get_striping_unit(md->fh, name);
+                if (next != -1)
+                {
+                    MPI_Isend (&sig, 1, MPI_INTEGER, next, current
+                              ,md->group_comm, &md->req
+                              );
+                }
+            }
+            else
+            {
+                MPI_Recv (&sig, 1, MPI_INTEGER, previous, previous
+                         ,md->group_comm, &md->status
+                         );
+                if (next != -1)
+                {
+                    MPI_Isend (&sig, 1, MPI_INTEGER, next, current
+                              ,md->group_comm, &md->req
+                              );
+                }
+                err = MPI_File_open (MPI_COMM_SELF, name
+                                    ,MPI_MODE_WRONLY
+                                    ,MPI_INFO_NULL
+                                    ,&md->fh
+                                    );
+                md->striping_unit = adios_mpi_amr_get_striping_unit(md->fh, name);
+            }
+
+            if (err != MPI_SUCCESS)
+            {
+                char e [MPI_MAX_ERROR_STRING];
+                int len = 0;
+                memset (e, 0, MPI_MAX_ERROR_STRING);
+                MPI_Error_string (err, e, &len);
+                fprintf (stderr, "MPI open write failed for %s: '%s'\n"
+                        ,name, e
+                        );
+                free (name);
+
+                return adios_flag_no;
+            }
+
+            if (md->group_comm != MPI_COMM_NULL)
+            {
+                if (md->rank == 0)
+                {
+                    MPI_Offset * offsets = malloc (  sizeof (MPI_Offset)
+                                                   * md->size
+                                                  );
+
+                    if (fd->write_size_bytes % md->striping_unit)
+                        offsets [0] =  (fd->write_size_bytes / md->striping_unit + 1)
+                                     * md->striping_unit;
+                    else
+                        offsets [0] = fd->write_size_bytes;
+
+                    MPI_Gather (offsets, 1, MPI_LONG_LONG
+                               ,offsets, 1, MPI_LONG_LONG
+                               ,0, md->group_comm
+                               );
+
+                    uint64_t last_offset = offsets [0];
+                    offsets [0] = fd->base_offset;
+                    for (i = 1; i < md->size; i++)
+                    {
+                        uint64_t this_offset = offsets [i];
+                        offsets [i] = offsets [i - 1] + last_offset;
+                        last_offset = this_offset;
+                    }
+                    md->b.pg_index_offset =   offsets [md->size - 1]
+                                            + last_offset;
+                    MPI_Scatter (offsets, 1, MPI_LONG_LONG
+                                ,offsets, 1, MPI_LONG_LONG
+                                ,0, md->group_comm
+                                );
+                    fd->base_offset = offsets [0];
+                    fd->pg_start_in_file = fd->base_offset;
+                    free (offsets);
+                }
+                else
+                {
+                    MPI_Offset offset;
+                    if (fd->write_size_bytes % md->striping_unit)
+                        offset =  (fd->write_size_bytes / md->striping_unit + 1)
+                                     * md->striping_unit;
+                    else
+                        offset = fd->write_size_bytes;
+
+
+                    MPI_Gather (&offset, 1, MPI_LONG_LONG
+                               ,&offset, 1, MPI_LONG_LONG
+                               ,0, md->group_comm
+                               );
+
+                    MPI_Scatter (&offset, 1, MPI_LONG_LONG
+                                ,&offset, 1, MPI_LONG_LONG
+                                ,0, md->group_comm
+                                );
+                    fd->base_offset = offset;
+                    fd->pg_start_in_file = fd->base_offset;
+                }
+            }
+            else
+            {
+                md->b.pg_index_offset = fd->write_size_bytes;
+            }
+
+            break;
+        }
+
+        default:
+        {
+            fprintf (stderr, "Unknown file mode: %d\n", fd->mode);
+
+            free (name);
+
+            return adios_flag_no;
+        }
+    }
+
+    free (name);
+
+    if (fd->shared_buffer == adios_flag_no && fd->mode != adios_mode_read)
+    {
+        uint64_t count;
+        // write the process group header
+        adios_write_process_group_header_v1 (fd, fd->write_size_bytes);
+
+        if (is_aggregator (md->rank))
+        {
+            count = adios_mpi_amr_striping_unit_write(
+                                  md->fh
+                                 ,fd->base_offset
+                                 ,fd->buffer
+                                 ,fd->bytes_written
+                                 ,md->block_unit
+                                 );
+            if (count != fd->bytes_written)
+            {
+                fprintf (stderr, "a:MPI method tried to write %llu, "
+                                 "only wrote %llu\n"
+                        ,fd->bytes_written
+                        ,count
+                        );
+            }
+        }
+        fd->base_offset += count;
+        fd->offset = 0;
+        fd->bytes_written = 0;
+        adios_shared_buffer_free (&md->b);
+
+        // setup for writing vars
+        adios_write_open_vars_v1 (fd);
+        md->vars_start = fd->base_offset;
+        md->vars_header_size = fd->offset;
+        fd->base_offset += fd->offset;
+        MPI_File_seek (md->fh, md->vars_header_size, MPI_SEEK_CUR);
+        fd->offset = 0;
+        fd->bytes_written = 0;
+        adios_shared_buffer_free (&md->b);
+    }
+
+    return fd->shared_buffer;
+}
+
+void adios_mpi_amr_write (struct adios_file_struct * fd
+                         ,struct adios_var_struct * v
+                         ,void * data
+                         ,struct adios_method_struct * method
+                         )
+{
+    struct adios_MPI_data_struct * md = (struct adios_MPI_data_struct *)
+                                                      method->method_data;
+    if (v->got_buffer == adios_flag_yes)
+    {
+        if (data != v->data)  // if the user didn't give back the same thing
+        {
+            if (v->free_data == adios_flag_yes)
+            {
+                free (v->data);
+                adios_method_buffer_free (v->data_size);
+            }
+        }
+        else
+        {
+            // we already saved all of the info, so we're ok.
+            return;
+        }
+    }
+
+    if (fd->shared_buffer == adios_flag_no)
+    {
+        uint64_t total_size = 0;
+        MPI_Comm new_comm;
+        int i, new_rank, new_group_size;
+        void * aggr_buff = 0;
+
+        // var payload sent for sizing information
+        adios_write_var_header_v1 (fd, v);
+        adios_write_var_payload_v1 (fd, v);
+
+        MPI_Comm_split (md->group_comm, g_color1, md->rank, &new_comm);
+        MPI_Comm_rank (new_comm, &new_rank);
+        MPI_Comm_size (new_comm, &new_group_size);
+
+        int bytes_written[new_group_size];
+        int disp[new_group_size];
+
+        MPI_Gather (&fd->bytes_written, 1, MPI_INT
+                   ,bytes_written, 1, MPI_INT
+                   ,0, new_comm);
+
+        disp[0] = 0;
+        for (i = 1; i < new_group_size; i++)
+        {
+            disp[i] = disp[i - 1] + bytes_written[i - 1];
+        }
+        total_size += disp[new_group_size - 1]
+                    + bytes_written[new_group_size - 1];
+
+        if (is_aggregator(md->rank))
+        {
+            aggr_buff = malloc (total_size);
+            if (aggr_buff == 0)
+            {
+                fprintf (stderr, "Can not alloc aggregation buffer.\n"
+                                 "Need to increase the number of aggregators.\n"
+                        );
+                return;
+            }
+        }
+  
+        MPI_Gatherv (fd->buffer, fd->bytes_written, MPI_BYTE
+                    ,aggr_buff, bytes_written, disp, MPI_BYTE
+                    ,0, new_comm);
+
+        fd->vars_written += new_group_size - 1;
+
+        uint64_t count = 0;
+        if (is_aggregator(md->rank))
+        {
+            count = adios_mpi_amr_striping_unit_write(
+                           md->fh
+                          ,-1
+                          ,aggr_buff
+                          ,total_size
+                          ,md->block_unit
+                          );
+            if (count != total_size)
+            {
+                fprintf (stderr, "b:MPI method tried to write %llu, "
+                                 "only wrote %llu\n"
+                        ,total_size
+                        ,count
+                        );
+            }
+
+            FREE (aggr_buff);
+        }
+        else
+        {
+            // Non-aggregators do nothing
+        }
+
+        // Broadcast new offsets to all processors in the communicator.
+        uint64_t new_offsets[new_group_size];
+
+        if (is_aggregator (md->rank))
+        {
+            new_offsets[0] = v->write_offset;
+            for (i = 1; i < new_group_size; i++)
+            {
+                new_offsets[i] = new_offsets[i - 1] + bytes_written[i - 1];
+            }
+        }
+
+        MPI_Bcast (new_offsets, new_group_size, MPI_LONG_LONG, 0, new_comm);
+        v->write_offset = new_offsets[new_rank];
+
+        fd->base_offset += count;
+        fd->offset = 0;
+        fd->bytes_written = 0;
+        adios_shared_buffer_free (&md->b);
+    }
+}
+
+void adios_mpi_amr_get_write_buffer (struct adios_file_struct * fd
+                                ,struct adios_var_struct * v
+                                ,uint64_t * size
+                                ,void ** buffer
+                                ,struct adios_method_struct * method
+                                )
+{
+    uint64_t mem_allowed;
+
+    if (*size == 0)
+    {
+        *buffer = 0;
+
+        return;
+    }
+
+    if (v->data && v->free_data)
+    {
+        adios_method_buffer_free (v->data_size);
+        free (v->data);
+    }
+
+    mem_allowed = adios_method_buffer_alloc (*size);
+    if (mem_allowed == *size)
+    {
+        *buffer = malloc (*size);
+        if (!*buffer)
+        {
+            adios_method_buffer_free (mem_allowed);
+            fprintf (stderr, "Out of memory allocating %llu bytes for %s\n"
+                    ,*size, v->name
+                    );
+            v->got_buffer = adios_flag_no;
+            v->free_data = adios_flag_no;
+            v->data_size = 0;
+            v->data = 0;
+            *size = 0;
+            *buffer = 0;
+        }
+        else
+        {
+            v->got_buffer = adios_flag_yes;
+            v->free_data = adios_flag_yes;
+            v->data_size = mem_allowed;
+            v->data = *buffer;
+        }
+    }
+    else
+    {
+        adios_method_buffer_free (mem_allowed);
+        fprintf (stderr, "OVERFLOW: Cannot allocate requested buffer of %llu "
+                         "bytes for %s\n"
+                ,*size
+                ,v->name
+                );
+        *size = 0;
+        *buffer = 0;
+    }
+}
+
+void adios_mpi_amr_read (struct adios_file_struct * fd
+                    ,struct adios_var_struct * v, void * buffer
+                    ,uint64_t buffer_size
+                    ,struct adios_method_struct * method
+                    )
+{
+    v->data = buffer;
+    v->data_size = buffer_size;
+}
+
+static void adios_mpi_amr_do_read (struct adios_file_struct * fd
+                              ,struct adios_method_struct * method
+                              )
+{
+    struct adios_MPI_data_struct * md = (struct adios_MPI_data_struct *)
+                                                      method->method_data;
+    struct adios_var_struct * v = fd->group->vars;
+
+    struct adios_parse_buffer_struct data;
+
+    data.vars = v;
+    data.buffer = 0;
+    data.buffer_len = 0;
+
+    switch (md->b.version & ADIOS_VERSION_NUM_MASK)
+    {
+        case 1:
+        {
+            // the three section headers
+            struct adios_process_group_header_struct_v1 pg_header;
+            struct adios_vars_header_struct_v1 vars_header;
+            struct adios_attributes_header_struct_v1 attrs_header;
+
+            struct adios_var_header_struct_v1 var_header;
+            struct adios_var_payload_struct_v1 var_payload;
+            struct adios_attribute_struct_v1 attribute;
+
+            uint64_t i;
+
+            adios_init_buffer_read_process_group (&md->b);
+            MPI_File_seek (md->fh, md->b.read_pg_offset
+                          ,MPI_SEEK_SET
+                          );
+            MPI_File_read (md->fh, md->b.buff, md->b.read_pg_size, MPI_BYTE
+                          ,&md->status
+                          );
+            adios_parse_process_group_header_v1 (&md->b, &pg_header);
+
+            adios_parse_vars_header_v1 (&md->b, &vars_header);
+
+            for (i = 0; i < vars_header.count; i++)
+            {
+                memset (&var_payload, 0
+                       ,sizeof (struct adios_var_payload_struct_v1)
+                       );
+                adios_parse_var_data_header_v1 (&md->b, &var_header);
+
+                struct adios_var_struct * v1 = v;
+                while (v1)
+                {
+                    if (   strcasecmp (var_header.name, v1->name)
+                        || strcasecmp (var_header.path, v1->path)
+                       )
+                    {
+                        v1 = v1->next;
+                    }
+                    else
+                    {
+                        break;
+                    }
+                }
+
+                if (v1)
+                {
+                    var_payload.payload = v1->data;
+                    adios_parse_var_data_payload_v1 (&md->b, &var_header
+                                                    ,&var_payload
+                                                    ,v1->data_size
+                                                    );
+                }
+                else
+                {
+                    printf ("MPI read: skipping name: %s path: %s\n"
+                           ,var_header.name, var_header.path
+                           );
+                    adios_parse_var_data_payload_v1 (&md->b, &var_header
+                                                    ,NULL, 0
+                                                    );
+                }
+
+                adios_clear_var_header_v1 (&var_header);
+            }
+
+#if 1
+            adios_parse_attributes_header_v1 (&md->b, &attrs_header);
+
+            for (i = 0; i < attrs_header.count; i++)
+            {
+                adios_parse_attribute_v1 (&md->b, &attribute);
+                adios_clear_attribute_v1 (&attribute);
+            }
+#endif
+            adios_clear_process_group_header_v1 (&pg_header);
+
+            break;
+        }
+
+        default:
+            fprintf (stderr, "MPI read: file version unknown: %u\n"
+                    ,md->b.version
+                    );
+            return;
+    }
+
+    adios_buffer_struct_clear (&md->b);
+}
+
+static
+uint32_t adios_mpi_amr_calculate_attributes_size (struct adios_file_struct * fd)
+{
+    uint32_t overhead = 0;
+    struct adios_attribute_struct * a = fd->group->attributes;
+
+    overhead += 2; // attributes count
+    overhead += 8; // attributes length
+
+    while (a)
+    {
+        overhead += adios_calc_attribute_overhead_v1 (a);
+
+        a = a->next;
+    }
+
+    return overhead;
+}
+
+void adios_mpi_amr_close (struct adios_file_struct * fd
+                     ,struct adios_method_struct * method
+                     )
+{
+    struct adios_MPI_data_struct * md = (struct adios_MPI_data_struct *)
+                                                 method->method_data;
+    struct adios_attribute_struct * a = fd->group->attributes;
+
+    struct adios_index_process_group_struct_v1 * new_pg_root = 0;
+    struct adios_index_var_struct_v1 * new_vars_root = 0;
+    struct adios_index_attribute_struct_v1 * new_attrs_root = 0;
+
+    switch (fd->mode)
+    {
+        case adios_mode_read:
+        {
+            // read the index to find the place to start reading
+            adios_mpi_amr_do_read (fd, method);
+            struct adios_var_struct * v = fd->group->vars;
+            while (v)
+            {
+                v->data = 0;
+                v = v->next;
+            }
+
+            break;
+        }
+
+        case adios_mode_write:
+        {
+            char * buffer = 0;
+            uint64_t buffer_size = 0;
+            uint64_t buffer_offset = 0;
+            uint64_t index_start = md->b.pg_index_offset, index_start1;
+            int * pg_sizes = 0, * disp = 0, * sendbuf = 0, * recvbuf = 0, * attr_sizes = 0;
+            void * aggr_buff = 0;
+            //pthread_t t, t1;
+            //struct adios_MPI_thread_data_open open_thread_data1;
+            //struct adios_MPI_thread_data_open open_thread_data2;
+            struct adios_MPI_thread_data_write write_thread_data;
+            int i, new_rank, new_group_size, new_rank2, new_group_size2, total_data_size = 0, total_data_size1 = 0;;
+            MPI_Comm new_comm, new_comm2;
+
+            MPI_Comm_split (md->group_comm, g_color1, md->rank, &new_comm);
+            MPI_Comm_rank (new_comm, &new_rank);
+            MPI_Comm_size (new_comm, &new_group_size);
+
+            MPI_Comm_split (md->group_comm, g_color2, md->rank, &new_comm2);
+            MPI_Comm_rank (new_comm2, &new_rank2);
+            MPI_Comm_size (new_comm2, &new_group_size2);
+
+            if (fd->shared_buffer == adios_flag_no)
+            {
+                MPI_Offset new_off;
+                // set it up so that it will start at 0, but have correct sizes
+                MPI_File_get_position (md->fh, &new_off);
+                fd->offset = fd->base_offset - md->vars_start;
+                fd->vars_start = 0;
+                fd->buffer_size = 0;
+                adios_write_close_vars_v1 (fd);
+                // fd->vars_start gets updated with the size written
+
+                uint64_t count;
+                if (is_aggregator(md->rank))
+                {
+                    count = adios_mpi_amr_striping_unit_write(
+                                   md->fh
+                                  ,md->vars_start
+                                  ,fd->buffer
+                                  ,md->vars_header_size
+                                  ,md->block_unit
+                                  );
+                    if (count != md->vars_header_size)
+                    {
+                        fprintf (stderr, "d:MPI method tried to write %llu, "
+                                         "only wrote %d\n"
+                                ,md->vars_header_size
+                                ,count
+                                );
+                    }
+                }
+                fd->offset = 0;
+                fd->bytes_written = 0;
+                adios_shared_buffer_free (&md->b);
+
+                adios_write_open_attributes_v1 (fd);
+                md->vars_start = new_off;
+                md->vars_header_size = fd->offset;
+
+                MPI_File_seek (md->fh, new_off + md->vars_header_size
+                              ,MPI_SEEK_SET
+                              ); // go back to end, but after attr header
+
+                fd->base_offset += fd->offset;  // add size of header
+                fd->offset = 0;
+                fd->bytes_written = 0;
+
+                while (a)
+                {
+                    adios_write_attribute_v1 (fd, a);
+
+                    int bytes_written[new_group_size];
+                    int disp[new_group_size];
+                    int total_size = 0;
+                    void * aggr_buff;
+
+                    MPI_Gather (&fd->bytes_written, 1, MPI_INT
+                               ,bytes_written, 1, MPI_INT
+                               ,0, new_comm
+                               );
+
+                    disp[0] = 0;
+                    for (i = 1; i < new_group_size; i++)
+                    {
+                        disp[i] = disp[i - 1] + bytes_written[i - 1];
+                    }
+                    total_size += disp[new_group_size - 1]
+                                + bytes_written[new_group_size - 1];
+
+                    if (is_aggregator(md->rank))
+                    {
+                        aggr_buff = malloc (total_size);
+                        if (aggr_buff == 0)
+                        {
+                            fprintf (stderr, "Can not alloc aggregation buffer.\n"
+                                             "Need to increase the number of aggregators.\n"
+                                    );
+                            return;
+                        }
+                    }
+
+                    MPI_Gatherv (fd->buffer, fd->bytes_written, MPI_BYTE
+                                ,aggr_buff, bytes_written, disp, MPI_BYTE
+                                ,0, new_comm);
+
+                    if (is_aggregator (md->rank))
+                    {
+                        count = adios_mpi_amr_striping_unit_write(
+                                          md->fh,
+                                          -1,
+                                          aggr_buff, //fd->buffer,
+                                          total_size, //fd->bytes_written,
+                                          md->block_unit);
+                        if (count != total_size)
+                        {
+                            fprintf (stderr, "e:MPI method tried to write %llu, "
+                                             "only wrote %llu\n"
+                                     ,fd->bytes_written
+                                     ,count
+                                     );
+                        }
+                    }
+
+                    // Broadcast new offsets to all processors in the communicator.
+                    uint64_t new_offsets[new_group_size];
+
+                    if (is_aggregator (md->rank))
+                    {
+                        new_offsets[0] = a->write_offset;
+                        for (i = 1; i < new_group_size; i++)
+                        {
+                            new_offsets[i] = new_offsets[i - 1] + bytes_written[i - 1];
+                        }
+                    }
+
+                    MPI_Bcast (new_offsets, new_group_size, MPI_LONG_LONG, 0, new_comm);
+                    a->write_offset = new_offsets[new_rank];
+
+                    fd->base_offset += count;
+                    fd->offset = 0;
+                    fd->bytes_written = 0;
+                    adios_shared_buffer_free (&md->b);
+
+                    a = a->next;
+                }
+
+                // set it up so that it will start at 0, but have correct sizes
+                fd->offset = fd->base_offset - md->vars_start;
+                fd->vars_start = 0;
+                fd->buffer_size = 0;
+                adios_write_close_attributes_v1 (fd);
+
+                // fd->vars_start gets updated with the size written
+                if (is_aggregator(md->rank))
+                {
+                    *(uint16_t *)fd->buffer = *(uint16_t *)fd->buffer * new_group_size;
+                    count = adios_mpi_amr_striping_unit_write(
+                                  md->fh,
+                                  md->vars_start,
+                                  fd->buffer,
+                                  md->vars_header_size,
+                                  md->block_unit);
+                    if (count != md->vars_header_size)
+                    {
+                        fprintf (stderr, "f:MPI method tried to write %llu, "
+                                         "only wrote %llu\n"
+                                ,md->vars_header_size
+                                ,count
+                                );
+                    }
+                }
+
+                fd->offset = 0;
+                fd->bytes_written = 0;
+
+                MPI_File_seek (md->fh, fd->base_offset, MPI_SEEK_SET);
+            }
+
+            // if not merge PG's on the aggregator side
+            if (fd->shared_buffer == adios_flag_yes && !g_merging_pgs)
+            {
+                //printf ("do not merge pg\n");
+                struct adios_bp_buffer_struct_v1 b;
+                struct adios_process_group_header_struct_v1 pg_header;
+                struct adios_vars_header_struct_v1 vars_header;
+                int pg_size, header_size;
+                uint64_t vars_count_offset;
+
+                pg_size = fd->bytes_written;
+                pg_sizes = (int *) malloc (new_group_size * 4);
+                disp = (int *) malloc (new_group_size * 4);
+                if (pg_sizes == 0 || disp == 0)
+                {
+                    fprintf (stderr, "can not malloc\n");
+                    return;
+                }
+//moved to adios_group_size
+#if 0
+                if (is_aggregator (md->rank))
+                {
+                    // open subfiles
+                    open_thread_data1.fh = &md->fh;
+                    open_thread_data1.name = md->subfile_name;
+                    open_thread_data1.striping_unit = &md->striping_unit;
+                    open_thread_data1.parameters = method->parameters;
+
+                    pthread_create (&t, NULL
+                                   ,adios_mpi_amr_do_open_thread
+                                   ,(void *) &open_thread_data1
+                                   );
+
+                    // open metadata file
+                    if (md->rank == 0)
+                    {
+                        open_thread_data2.fh = &md->mfh;
+                        open_thread_data2.name = fd->name;
+                        open_thread_data2.striping_unit = &md->striping_unit;
+                        open_thread_data2.parameters = method->parameters;
+
+                        pthread_create (&t1, NULL
+                                       ,adios_mpi_amr_do_open_thread
+                                       ,(void *) &open_thread_data2
+                                       );
+                    }
+                }
+#endif
+                MPI_Allgather (&pg_size, 1, MPI_INT
+                              ,pg_sizes, 1, MPI_INT
+                              ,new_comm);
+
+                disp[0] = 0;
+                for (i = 1; i < new_group_size; i++)
+                {
+                    disp[i] = disp[i - 1] + pg_sizes[i - 1];
+                }
+                total_data_size = disp[new_group_size - 1]
+                                + pg_sizes[new_group_size - 1];
+
+                if (is_aggregator (md->rank))
+                {
+                    if (total_data_size > MAX_AGG_BUF)
+                    {
+                        fprintf (stderr, "The max allowed aggregation buffer is %llu.\n"
+                                         "Need to increase the number of aggregators.\n"
+                                ,MAX_AGG_BUF);
+                        return;
+                    }
+                    aggr_buff = malloc (total_data_size);
+                    if (aggr_buff == 0)
+                    {
+                        fprintf (stderr, "Can not alloc %d bytes for aggregation buffer.\n"
+                                         "Need to increase the number of aggregators.\n"
+                                ,total_data_size);
+                        return;
+                    }
+                }
+                else
+                {
+                }
+
+                MPI_Gatherv (fd->buffer, pg_size, MPI_BYTE
+                            ,aggr_buff, pg_sizes, disp, MPI_BYTE
+                            ,0, new_comm);
+            }
+
+            // Merge PG's on the aggregator side
+            if (fd->shared_buffer == adios_flag_yes && g_merging_pgs)
+            {
+                printf ("do merge pg\n");
+                // Merge PG's on the aggregator side
+                struct adios_bp_buffer_struct_v1 b;
+                struct adios_process_group_header_struct_v1 pg_header;
+                struct adios_vars_header_struct_v1 vars_header;
+                int pg_size, header_size;
+                uint32_t attr_size;
+                uint64_t vars_count_offset;
+
+                // Unfortunately, we need to walk through the buffer to get vars count
+                b.buff = fd->buffer;
+                b.change_endianness = md->b.change_endianness;
+                b.offset = 0;
+                b.length = fd->bytes_written;
+
+                adios_parse_process_group_header_v1 (&b, &pg_header);
+                vars_count_offset = b.offset;
+                adios_clear_process_group_header_v1 (&pg_header);
+
+                adios_parse_vars_header_v1 (&b, &vars_header);
+                header_size = b.offset;
+                attr_size = adios_mpi_amr_calculate_attributes_size (fd);
+
+                // reset vars count
+                if (vars_header.count * new_group_size > UINT16_MAX)
+                {
+                    fprintf (stderr, "Vars count exceed UINT16_MAX");
+                    return;
+                }
+                *(uint16_t *) (b.buff + vars_count_offset) = 
+                                vars_header.count * new_group_size;
+
+                // attributes size is save in the end
+                adios_mpi_amr_buffer_write (&fd->buffer, &fd->buffer_size, &fd->offset, &attr_size, SHIM_FOOTER_SIZE);
+                fd->bytes_written += SHIM_FOOTER_SIZE;
+            
+                // PG header, vars header, vars, attrs header, attrs, 4 bytes
+                if (is_aggregator(md->rank))
+                {
+                    pg_size = fd->bytes_written;
+                }
+                else
+                {
+                    // Non-aggregator process doesn't need to send pg header + vars header
+                    pg_size = fd->bytes_written - header_size;
+                }
+
+                pg_sizes = (int *) malloc (new_group_size * 4);
+                attr_sizes = (int *) malloc (new_group_size * 4);
+                disp = (int *) malloc (new_group_size * 4);
+                sendbuf = (int *) malloc (2 * 4);
+                recvbuf = (int *) malloc (new_group_size * 2 * 4);
+                if (pg_sizes == 0 || attr_sizes == 0 || disp == 0
+                 || sendbuf == 0 || recvbuf == 0)
+                {
+                    fprintf (stderr, "can not malloc\n");
+                    return;
+                }
+  
+                sendbuf[0] = pg_size;
+                sendbuf[1] = attr_size + SHIM_FOOTER_SIZE;
+
+//moved to adios_group_size
+#if 0
+                if (is_aggregator (md->rank))
+                {
+                    open_thread_data1.fh = &md->fh;
+                    open_thread_data1.name = md->subfile_name;
+                    open_thread_data1.striping_unit = &md->striping_unit;
+                    open_thread_data1.parameters = method->parameters;
+
+                    pthread_create (&t, NULL
+                                   ,adios_mpi_amr_do_open_thread
+                                   ,(void *) &open_thread_data1
+                                   );
+
+                    if (md->rank == 0)
+                    {
+                        open_thread_data2.fh = &md->mfh;
+                        open_thread_data2.name = fd->name;
+                        open_thread_data2.striping_unit = &md->striping_unit;
+                        open_thread_data2.parameters = method->parameters;
+
+                        pthread_create (&t1, NULL
+                                       ,adios_mpi_amr_do_open_thread
+                                       ,(void *) &open_thread_data2
+                                       );
+                    }
+                }
+#endif
+                MPI_Allgather (sendbuf, 2, MPI_INT
+                              ,recvbuf, 2, MPI_INT
+                              ,new_comm);
+
+                for (i = 0; i < new_group_size; i++)
+                {
+                    pg_sizes[i] = recvbuf[i * 2];
+                    attr_sizes[i] = recvbuf[i * 2 + 1];
+                }
+   
+                free (sendbuf);
+                free (recvbuf);
+
+                disp[0] = 0;
+                for (i = 1; i < new_group_size; i++)
+                {
+                    disp[i] = disp[i - 1] + pg_sizes[i - 1];
+                }
+                total_data_size = disp[new_group_size - 1]
+                                + pg_sizes[new_group_size - 1];
+
+                if (is_aggregator (md->rank))
+                {
+                    aggr_buff = malloc (total_data_size);
+                    if (aggr_buff == 0)
+                    {
+                        fprintf (stderr, "Can not alloc %d bytes for aggregation buffer.\n"
+                                         "Need to increase the number of aggregators.\n"
+                                ,total_data_size);
+                        return;
+                    }
+                }
+                else
+                {
+                }
+
+                if (is_aggregator (md->rank))
+                { 
+                    uint32_t aggr_attr_size = 0;
+                    void * aggr_attr_buff, * temp_aggr_buff, * temp_aggr_attr_buff;
+                    uint16_t new_attr_count = 0, new_attr_len = 0;
+
+                    MPI_Gatherv (fd->buffer, pg_size, MPI_BYTE
+                                ,aggr_buff, pg_sizes, disp, MPI_BYTE
+                                ,0, new_comm);
+
+                    for (i= 0; i < new_group_size; i++)
+                    {
+                        aggr_attr_size += *(uint32_t *)(aggr_buff
+                                                       + disp[i]
+                                                       + pg_sizes[i]
+                                                       - SHIM_FOOTER_SIZE
+                                                       );
+                    }
+
+                    aggr_attr_buff = malloc (aggr_attr_size);
+                    if (aggr_attr_buff == 0)
+                    {
+                        fprintf (stderr, "can not alloc %d bytes for aggregation buffer.\n"
+                                         "Need to increase the number of aggregators.\n"
+                                ,aggr_attr_size);
+                        return;
+                    }
+
+                    temp_aggr_buff = aggr_buff
+                                   + pg_sizes[0]
+                                   - SHIM_FOOTER_SIZE
+                                   - attr_size;
+                    temp_aggr_attr_buff = aggr_attr_buff;
+
+                    for (i= 0; i < new_group_size; i++)
+                    {
+                        uint32_t temp_attr_size = *(uint32_t *)(aggr_buff
+                                                               + disp[i]
+                                                               + pg_sizes[i]
+                                                               - SHIM_FOOTER_SIZE
+                                                               );
+                        void * temp_attr_ptr = aggr_buff + disp[i] + pg_sizes[i] 
+                                             - SHIM_FOOTER_SIZE - temp_attr_size;
+
+                        new_attr_count += *(uint16_t *)temp_attr_ptr;
+
+                        if (i == 0)
+                        {
+                            new_attr_len += *(uint64_t *)(temp_attr_ptr + ATTR_COUNT_SIZE);
+
+                            memcpy (temp_aggr_attr_buff, temp_attr_ptr, temp_attr_size);
+                            temp_aggr_attr_buff += temp_attr_size;
+                        }
+                        else
+                        {
+                            new_attr_len += *(uint64_t *)(temp_attr_ptr + ATTR_COUNT_SIZE)
+                                          - ATTR_COUNT_SIZE - ATTR_LEN_SIZE;
+
+                            memcpy (temp_aggr_attr_buff
+                                   ,temp_attr_ptr + ATTR_COUNT_SIZE + ATTR_LEN_SIZE
+                                   ,temp_attr_size - ATTR_COUNT_SIZE - ATTR_LEN_SIZE
+                                   );
+                            temp_aggr_attr_buff += temp_attr_size - ATTR_COUNT_SIZE - ATTR_LEN_SIZE;
+
+                            memmove (temp_aggr_buff
+                                    ,aggr_buff + disp[i]
+                                    ,pg_sizes[i] - temp_attr_size - SHIM_FOOTER_SIZE
+                                    );
+                            temp_aggr_buff += pg_sizes[i] - temp_attr_size - SHIM_FOOTER_SIZE;
+                        }
+                    }
+
+                    memcpy (temp_aggr_buff, aggr_attr_buff, aggr_attr_size);
+
+                    *(uint16_t *)temp_aggr_buff = new_attr_count;  //attrs count
+                    *(uint64_t *)(temp_aggr_buff + ATTR_COUNT_SIZE) = new_attr_len;  //attrs length
+
+                    free (aggr_attr_buff);
+                }
+                else
+                {
+                    MPI_Gatherv (fd->buffer + header_size, pg_size, MPI_BYTE
+                                ,aggr_buff, pg_sizes, disp, MPI_BYTE
+                                ,0, new_comm);
+                }
+
+                uint64_t count = 0;
+                if (is_aggregator(md->rank))
+                {
+#if 0
+                    pthread_join (t, NULL);
+          
+                    write_thread_data.fh = &md->fh;
+                    write_thread_data.base_offset = &fd->base_offset;
+                    write_thread_data.aggr_buff = aggr_buff;
+                    write_thread_data.total_data_size = &total_data_size;
+                    write_thread_data.block_unit = &md->block_unit;
+ 
+                    pthread_create (&t, NULL
+                                   ,adios_mpi_amr_do_write_thread
+                                   ,(void *) &write_thread_data
+                                   );
+#endif
+
+#if 0 
+                    count = adios_mpi_amr_striping_unit_write(
+                               md->fh
+                              ,fd->base_offset
+                              ,aggr_buff
+                              ,total_data_size
+                              ,md->block_unit);
+
+                    if (count != total_data_size)
+                    {
+                        fprintf (stderr, "Err in adios_mpi_amr_striping_unit_write()\n");
+                        return;
+                    }
+
+                    free (aggr_buff);
+#endif
+                }
+                else
+                {
+                }
+            }
+
+            // build index appending to any existing index
+            adios_build_index_v1 (fd, &md->old_pg_root, &md->old_vars_root
+                                 ,&md->old_attrs_root
+                                 );
+
+            if (fd->shared_buffer == adios_flag_yes && !g_merging_pgs)
+            {
+                if (!is_aggregator(md->rank))
+                {
+                    uint64_t var_offset_to_add = 0, attr_offset_to_add = 0;
+                    uint64_t var_base_offset = 0, attr_base_offset = 0;
+
+                    // change to relative offset
+                    if (md->old_vars_root)
+                    {
+                        var_base_offset = md->old_vars_root->characteristics [0].offset;
+                    }
+
+                    if (md->old_attrs_root)
+                    {
+                        attr_base_offset = md->old_attrs_root->characteristics [0].offset;
+                    }
+/*
+                    adios_mpi_amr_subtract_offset (var_base_offset
+                                                   ,var_base_offset
+                                                   ,md->old_vars_root
+                                                   ,md->old_attrs_root
+                                                   );
+*/
+
+                    for (i = 0; i < new_rank; i++)
+                    {
+                        attr_offset_to_add += pg_sizes[i];
+                        var_offset_to_add += pg_sizes[i];
+                    }
+
+                    adios_mpi_amr_add_offset (var_offset_to_add
+                                              ,attr_offset_to_add
+                                              ,md->old_vars_root
+                                              ,md->old_attrs_root
+                                              );
+                }
+
+                // pg_sizes, disp are no longer needed from this point on.
+                free (pg_sizes);
+                free (disp);
+            }
+
+            if (fd->shared_buffer == adios_flag_yes && g_merging_pgs)
+            {
+                if (!is_aggregator(md->rank))
+                {
+                    uint64_t var_offset_to_add = 0, attr_offset_to_add = 0;
+                    uint64_t var_base_offset = 0, attr_base_offset = 0; 
+
+                    // change to relative offset
+                    if (md->old_vars_root)
+                    {
+                        var_base_offset = md->old_vars_root->characteristics [0].offset;
+                    }
+
+                    if (md->old_attrs_root)
+                    { 
+                        attr_base_offset = md->old_attrs_root->characteristics [0].offset;
+                    }
+
+                    adios_mpi_amr_subtract_offset (var_base_offset
+                                                   ,attr_base_offset
+                                                   ,md->old_vars_root
+                                                   ,md->old_attrs_root
+                                                   );
+
+                    for (i = 0; i < new_group_size; i++)
+                    {
+                        attr_offset_to_add += pg_sizes[i] - attr_sizes[i];  
+                    }
+
+                    for (i = 0; i < new_rank; i++)
+                    {
+                        attr_offset_to_add += attr_sizes[i] - SHIM_FOOTER_SIZE;  
+                        var_offset_to_add += pg_sizes[i] - attr_sizes[i]; 
+                    }
+
+                    adios_mpi_amr_add_offset (var_offset_to_add
+                                              ,attr_offset_to_add
+                                              ,md->old_vars_root
+                                              ,md->old_attrs_root
+                                              );
+                }
+
+                // pg_sizes, attr_sizs, disp are no longer needed from this point on.
+                free (pg_sizes);
+                free (attr_sizes);
+                free (disp);
+            }
+
+            // if collective, gather the indexes from the rest and call
+            if (md->group_comm != MPI_COMM_NULL)
+            {
+                // Collect index from all MPI processors
+                if (is_aggregator (md->rank))
+                {
+                    int * index_sizes = malloc (4 * new_group_size);
+                    int * index_offsets = malloc (4 * new_group_size);
+                    char * recv_buffer = 0;
+                    uint32_t size = 0, total_size = 0;
+                    int i;
+
+                    MPI_Gather (&size, 1, MPI_INT
+                               ,index_sizes, 1, MPI_INT
+                               ,0, new_comm
+                               );
+
+                    for (i = 0; i < new_group_size; i++)
+                    {
+                        index_offsets [i] = total_size;
+                        total_size += index_sizes [i];
+                    } 
+
+                    recv_buffer = malloc (total_size);
+
+                    MPI_Gatherv (&size, 0, MPI_BYTE
+                                ,recv_buffer, index_sizes, index_offsets
+                                ,MPI_BYTE, 0, new_comm
+                                );
+
+                    char * buffer_save = md->b.buff;
+                    uint64_t buffer_size_save = md->b.length;
+                    uint64_t offset_save = md->b.offset;
+
+                    for (i = 1; i < new_group_size; i++)
+                    {
+                        md->b.buff = recv_buffer + index_offsets [i];
+                        md->b.length = index_sizes [i];
+                        md->b.offset = 0;
+
+                        adios_parse_process_group_index_v1 (&md->b
+                                                           ,&new_pg_root
+                                                           );
+                        adios_parse_vars_index_v1 (&md->b, &new_vars_root);
+                        adios_parse_attributes_index_v1 (&md->b
+                                                        ,&new_attrs_root
+                                                        );
+                        if (g_merging_pgs)
+                            new_pg_root = 0;
+
+                        adios_merge_index_v1 (&md->old_pg_root
+                                             ,&md->old_vars_root
+                                             ,&md->old_attrs_root
+                                             ,new_pg_root, new_vars_root
+                                             ,new_attrs_root
+                                             );
+                        new_pg_root = 0;
+                        new_vars_root = 0;
+                        new_attrs_root = 0;
+                    }
+
+                    md->b.buff = buffer_save;
+                    md->b.length = buffer_size_save;
+                    md->b.offset = offset_save;
+
+                    free (recv_buffer);
+                    free (index_sizes);
+                    free (index_offsets);
+                }
+                else
+                {
+                    adios_write_index_v1 (&buffer, &buffer_size, &buffer_offset
+                                         ,0, md->old_pg_root
+                                         ,md->old_vars_root
+                                         ,md->old_attrs_root
+                                         );
+
+                    MPI_Gather (&buffer_size, 1, MPI_INT, 0, 0, MPI_INT
+                               ,0, new_comm
+                               );
+                    MPI_Gatherv (buffer, buffer_size, MPI_BYTE
+                                ,0, 0, 0, MPI_BYTE
+                                ,0, new_comm
+                                );
+                }
+            }
+
+            // write out indexes in each subfile
+            if (is_aggregator (md->rank))
+            {
+                uint32_t flag = 0;
+#if 0
+                if (fd->shared_buffer == adios_flag_yes)
+                {
+                    pthread_join (t, NULL);
+                    FREE (aggr_buff);
+                }
+
+                MPI_File_get_position (md->fh, (MPI_Offset *)&index_start);
+#endif
+#if 1
+                index_start = total_data_size;
+#endif
+                adios_write_index_v1 (&buffer, &buffer_size
+                                     ,&buffer_offset, index_start
+                                     ,md->old_pg_root
+                                     ,md->old_vars_root
+                                     ,md->old_attrs_root
+                                     );
+//FIXME
+                //adios_write_version_v1 (&buffer, &buffer_size, &buffer_offset, flag);
+                adios_write_version_flag_v1 (&buffer, &buffer_size, &buffer_offset, flag);
+
+                if (fd->shared_buffer == adios_flag_yes)
+                {
+#if 1
+                    aggr_buff = realloc (aggr_buff, total_data_size + buffer_offset);
+                    memcpy (aggr_buff + total_data_size, buffer, buffer_offset); 
+
+                    pthread_join (g_t, NULL);
+
+                    index_start1 = 0;
+                    total_data_size1 = total_data_size + buffer_offset;
+
+                    write_thread_data.fh = &md->fh;
+                    write_thread_data.base_offset = &index_start1;
+                    write_thread_data.aggr_buff = aggr_buff;
+                    write_thread_data.total_data_size = &total_data_size1;
+                    write_thread_data.block_unit = &md->block_unit;
+
+#endif
+
+#if 0
+                    write_thread_data.fh = &md->fh;
+                    write_thread_data.base_offset = &index_start;
+                    write_thread_data.aggr_buff = buffer;
+                    write_thread_data.total_data_size = &buffer_offset;
+                    write_thread_data.block_unit = &md->block_unit;
+#endif
+                    pthread_create (&g_t, NULL
+                                   ,adios_mpi_amr_do_write_thread
+                                   ,(void *) &write_thread_data
+                                   );
+                }
+#if 0
+                adios_mpi_amr_striping_unit_write(
+                                  md->fh,
+                                  -1,
+                                  buffer,
+                                  buffer_offset,
+                                  md->block_unit);
+#endif
+            }
+
+            // collect index among aggregators
+            if (is_aggregator (md->rank))
+            {
+                if (md->rank == 0)
+                {
+                    int * index_sizes = malloc (4 * new_group_size2);
+                    int * index_offsets = malloc (4 * new_group_size2);
+                    char * recv_buffer = 0;
+                    uint32_t size = 0, total_size = 0;
+
+                    MPI_Gather (&size, 1, MPI_INT
+                               ,index_sizes, 1, MPI_INT
+                               ,0, new_comm2
+                               );
+
+                    for (i = 0; i < new_group_size2; i++)
+                    {
+                        index_offsets [i] = total_size;
+                        total_size += index_sizes [i];
+                    }
+
+                    recv_buffer = malloc (total_size);
+
+                    MPI_Gatherv (&size, 0, MPI_BYTE
+                                ,recv_buffer, index_sizes, index_offsets
+                                ,MPI_BYTE, 0, new_comm2
+                                );
+
+                    char * buffer_save = md->b.buff;
+                    uint64_t buffer_size_save = md->b.length;
+                    uint64_t offset_save = md->b.offset;
+
+                    for (i = 1; i < new_group_size2; i++)
+                    {
+                        md->b.buff = recv_buffer + index_offsets [i];
+                        md->b.length = index_sizes [i];
+                        md->b.offset = 0;
+
+                        adios_parse_process_group_index_v1 (&md->b
+                                                           ,&new_pg_root
+                                                           );
+                        adios_parse_vars_index_v1 (&md->b, &new_vars_root);
+                        adios_parse_attributes_index_v1 (&md->b
+                                                        ,&new_attrs_root
+                                                        );
+
+                        adios_merge_index_v1 (&md->old_pg_root
+                                             ,&md->old_vars_root
+                                             ,&md->old_attrs_root
+                                             ,new_pg_root, new_vars_root
+                                             ,new_attrs_root
+                                             );
+                        new_pg_root = 0;
+                        new_vars_root = 0;
+                        new_attrs_root = 0;
+                    }
+
+                    md->b.buff = buffer_save;
+                    md->b.length = buffer_size_save;
+                    md->b.offset = offset_save;
+
+                    free (recv_buffer);
+                    free (index_sizes);
+                    free (index_offsets);
+                }
+                else
+                {
+                    char * buffer2 = 0;
+                    uint64_t buffer_size2 = 0;
+                    uint64_t buffer_offset2 = 0;
+
+                    adios_write_index_v1 (&buffer2, &buffer_size2, &buffer_offset2
+                                         ,0, md->old_pg_root
+                                         ,md->old_vars_root
+                                         ,md->old_attrs_root
+                                         );
+
+                    MPI_Gather (&buffer_size2, 1, MPI_INT
+                               ,0, 0, MPI_INT
+                               ,0, new_comm2
+                               );
+                    MPI_Gatherv (buffer2, buffer_size2, MPI_BYTE
+                                ,0, 0, 0, MPI_BYTE
+                                ,0, new_comm2
+                                );
+
+                    if (buffer2)
+                    {
+                        free (buffer2);
+                        buffer2 = 0;
+                        buffer_size2 = 0;
+                        buffer_offset2 = 0;
+                    }
+                }
+            }
+
+            // write out the metadata file from rank 0
+            if (md->rank == 0)
+            {
+                MPI_File m_file;
+                char * global_index_buffer = 0;
+                uint64_t global_index_buffer_size = 0;
+                uint64_t global_index_buffer_offset = 0;
+                uint64_t global_index_start = 0;
+                uint16_t flag = 0;
+
+                adios_write_index_v1 (&global_index_buffer, &global_index_buffer_size
+                                     ,&global_index_buffer_offset, global_index_start
+                                     ,md->old_pg_root, md->old_vars_root, md->old_attrs_root
+                                     );
+
+                flag |= ADIOS_VERSION_HAVE_SUBFILE;
+
+                adios_write_version_flag_v1 (&global_index_buffer
+                                            ,&global_index_buffer_size
+                                            ,&global_index_buffer_offset
+                                            ,flag
+                                            );
+/*
+                adios_write_version_v1 (&global_index_buffer
+                                       ,&global_index_buffer_size
+                                       ,&global_index_buffer_offset
+                                       );
+*/
+#if 0
+                unlink (fd->name);
+
+                MPI_File_open (MPI_COMM_SELF, fd->name
+                              ,MPI_MODE_RDWR | MPI_MODE_CREATE
+                              ,MPI_INFO_NULL, &m_file
+                              );
+#endif
+                pthread_join (g_t1, NULL);
+                adios_mpi_amr_striping_unit_write(
+                                  md->mfh,
+                                  -1,
+                                  global_index_buffer,
+                                  global_index_buffer_offset,
+                                  md->block_unit);
+
+#if 0
+                adios_mpi_amr_striping_unit_write(
+                                  m_file,
+                                  -1,
+                                  global_index_buffer,
+                                  global_index_buffer_offset,
+                                  md->block_unit);
+
+                MPI_File_close (&m_file);
+#endif
+                if (global_index_buffer)
+                {
+                    free (global_index_buffer);
+                    global_index_buffer = 0;
+                    global_index_buffer_size = 0;
+                    global_index_buffer_offset = 0;
+                }
+            }
+
+            if (is_aggregator (md->rank))
+            {
+                pthread_join (g_t, NULL);
+                FREE (aggr_buff);
+            }
+            FREE (buffer);
+            buffer_size = 0;
+            buffer_offset = 0;
+
+            adios_clear_index_v1 (new_pg_root, new_vars_root, new_attrs_root);
+            adios_clear_index_v1 (md->old_pg_root, md->old_vars_root
+                                 ,md->old_attrs_root
+                                 );
+            new_pg_root = 0;
+            new_vars_root = 0;
+            new_attrs_root = 0;
+            md->old_pg_root = 0;
+            md->old_vars_root = 0;
+            md->old_attrs_root = 0;
+
+            g_num_aggregators = 0;
+            g_color1 = 0;
+            g_color2 = 0;
+
+            FREE (md->subfile_name);
+            FREE (g_is_aggregator);
+            FREE (g_offsets);
+
+            break;
+        }
+
+        case adios_mode_append:
+        {
+            char * buffer = 0;
+            uint64_t buffer_size = 0;
+            uint64_t buffer_offset = 0;
+            uint64_t index_start = md->b.pg_index_offset;
+
+            if (fd->shared_buffer == adios_flag_no)
+            {
+                MPI_Offset new_off;
+                // set it up so that it will start at 0, but have correct sizes
+                MPI_File_get_position (md->fh, &new_off);
+                fd->offset = fd->base_offset - md->vars_start;
+                fd->vars_start = 0;
+                fd->buffer_size = 0;
+                adios_write_close_vars_v1 (fd);
+                // fd->vars_start gets updated with the size written
+                uint64_t count;
+                count = adios_mpi_amr_striping_unit_write(
+                                  md->fh,
+                                  md->vars_start,
+                                  fd->buffer,
+                                  md->vars_header_size,
+                                  md->block_unit);
+                if (count != md->vars_header_size)
+                {
+                    fprintf (stderr, "d:MPI method tried to write %llu, "
+                                     "only wrote %llu\n"
+                            ,md->vars_header_size
+                            ,count
+                            );
+                }
+                fd->offset = 0;
+                fd->bytes_written = 0;
+                adios_shared_buffer_free (&md->b);
+
+                adios_write_open_attributes_v1 (fd);
+                md->vars_start = new_off;
+                md->vars_header_size = fd->offset;
+                MPI_File_seek (md->fh, new_off + md->vars_header_size
+                              ,MPI_SEEK_SET
+                              ); // go back to end, but after attr header
+                fd->base_offset += fd->offset;  // add size of header
+                fd->offset = 0;
+                fd->bytes_written = 0;
+
+                while (a)
+                {
+                    adios_write_attribute_v1 (fd, a);
+                    count = adios_mpi_amr_striping_unit_write(
+                                  md->fh,
+                                  -1,
+                                  fd->buffer,
+                                  fd->bytes_written,
+                                  md->block_unit);
+                    if (count != fd->bytes_written)
+                    {
+                        fprintf (stderr, "e:MPI method tried to write %llu, "
+                                         "only wrote %llu\n"
+                                ,fd->bytes_written
+                                ,count
+                                );
+                    }
+                    fd->base_offset += count;
+                    fd->offset = 0;
+                    fd->bytes_written = 0;
+                    adios_shared_buffer_free (&md->b);
+
+                    a = a->next;
+                }
+
+                // set it up so that it will start at 0, but have correct sizes
+                fd->offset = fd->base_offset - md->vars_start;
+                fd->vars_start = 0;
+                fd->buffer_size = 0;
+                adios_write_close_attributes_v1 (fd);
+                // fd->vars_start gets updated with the size written
+                count = adios_mpi_amr_striping_unit_write(
+                                  md->fh,
+                                  md->vars_start,
+                                  fd->buffer,
+                                  md->vars_header_size,
+                                  md->block_unit);
+                if (count != md->vars_header_size)
+                {
+                    fprintf (stderr, "f:MPI method tried to write %llu, "
+                                     "only wrote %llu\n"
+                            ,md->vars_header_size
+                            ,count
+                            );
+                }
+                fd->offset = 0;
+                fd->bytes_written = 0;
+            }
+
+            // build index appending to any existing index
+            adios_build_index_v1 (fd, &md->old_pg_root, &md->old_vars_root
+                                 ,&md->old_attrs_root
+                                 );
+            // if collective, gather the indexes from the rest and call
+            if (md->group_comm != MPI_COMM_NULL)
+            {
+                if (md->rank == 0)
+                {
+                    int * index_sizes = malloc (4 * md->size);
+                    int * index_offsets = malloc (4 * md->size);
+                    char * recv_buffer = 0;
+                    uint32_t size = 0;
+                    uint32_t total_size = 0;
+                    int i;
+
+                    MPI_Gather (&size, 1, MPI_INT
+                               ,index_sizes, 1, MPI_INT
+                               ,0, md->group_comm
+                               );
+
+                    for (i = 0; i < md->size; i++)
+                    {
+                        index_offsets [i] = total_size;
+                        total_size += index_sizes [i];
+                    }
+
+                    recv_buffer = malloc (total_size);
+
+                    MPI_Gatherv (&size, 0, MPI_BYTE
+                                ,recv_buffer, index_sizes, index_offsets
+                                ,MPI_BYTE, 0, md->group_comm
+                                );
+
+                    char * buffer_save = md->b.buff;
+                    uint64_t buffer_size_save = md->b.length;
+                    uint64_t offset_save = md->b.offset;
+
+                    for (i = 1; i < md->size; i++)
+                    {
+                        md->b.buff = recv_buffer + index_offsets [i];
+                        md->b.length = index_sizes [i];
+                        md->b.offset = 0;
+
+                        adios_parse_process_group_index_v1 (&md->b
+                                                           ,&new_pg_root
+                                                           );
+                        adios_parse_vars_index_v1 (&md->b, &new_vars_root);
+                        adios_parse_attributes_index_v1 (&md->b
+                                                        ,&new_attrs_root
+                                                        );
+                        adios_merge_index_v1 (&md->old_pg_root
+                                             ,&md->old_vars_root
+                                             ,&md->old_attrs_root
+                                             ,new_pg_root, new_vars_root
+                                             ,new_attrs_root
+                                             );
+                        new_pg_root = 0;
+                        new_vars_root = 0;
+                        new_attrs_root = 0;
+                    }
+                    md->b.buff = buffer_save;
+                    md->b.length = buffer_size_save;
+                    md->b.offset = offset_save;
+
+                    free (recv_buffer);
+                    free (index_sizes);
+                    free (index_offsets);
+                }
+                else
+                {
+                    adios_write_index_v1 (&buffer, &buffer_size, &buffer_offset
+                                         ,0, md->old_pg_root
+                                         ,md->old_vars_root
+                                         ,md->old_attrs_root
+                                         );
+
+                    MPI_Gather (&buffer_size, 1, MPI_INT, 0, 0, MPI_INT
+                               ,0, md->group_comm
+                               );
+                    MPI_Gatherv (buffer, buffer_size, MPI_BYTE
+                                ,0, 0, 0, MPI_BYTE
+                                ,0, md->group_comm
+                                );
+                }
+            }
+
+            if (fd->shared_buffer == adios_flag_yes)
+            {
+                // everyone writes their data
+                adios_mpi_amr_striping_unit_write(
+                                  md->fh,
+                                  fd->base_offset,
+                                  fd->buffer,
+                                  fd->bytes_written,
+                                  md->block_unit);
+            }
+
+            if (md->rank == 0)
+            {
+                uint32_t flag = 0;
+
+                adios_write_index_v1 (&buffer, &buffer_size, &buffer_offset
+                                     ,index_start, md->old_pg_root
+                                     ,md->old_vars_root
+                                     ,md->old_attrs_root
+                                     );
+
+                flag |= ADIOS_VERSION_HAVE_SUBFILE;
+                adios_write_version_flag_v1 (&buffer, &buffer_size, &buffer_offset, flag);
+/*
+                adios_write_version_v1 (&buffer, &buffer_size, &buffer_offset);
+*/
+
+                adios_mpi_amr_striping_unit_write(
+                                  md->fh,
+                                  md->b.pg_index_offset,
+                                  buffer,
+                                  buffer_offset,
+                                  md->block_unit);
+            }
+
+            free (buffer);
+
+            adios_clear_index_v1 (new_pg_root, new_vars_root, new_attrs_root);
+            adios_clear_index_v1 (md->old_pg_root, md->old_vars_root
+                                 ,md->old_attrs_root
+                                 );
+            new_pg_root = 0;
+            new_vars_root = 0;
+            new_attrs_root = 0;
+            md->old_pg_root = 0;
+            md->old_vars_root = 0;
+            md->old_attrs_root = 0;
+
+            break;
+        }
+
+        default:
+        {
+            fprintf (stderr, "Unknown file mode: %d\n", fd->mode);
+        }
+    }
+
+    if (md && md->fh)
+        MPI_File_close (&md->fh);
+
+    if (md && md->mfh)
+        MPI_File_close (&md->mfh);
+
+    if (   md->group_comm != MPI_COMM_WORLD
+        && md->group_comm != MPI_COMM_SELF
+        && md->group_comm != MPI_COMM_NULL
+       )
+    {
+        md->group_comm = MPI_COMM_NULL;
+    }
+
+    md->fh = 0;
+    md->mfh = 0;
+    md->req = 0;
+    memset (&md->status, 0, sizeof (MPI_Status));
+    md->group_comm = MPI_COMM_NULL;
+
+    adios_clear_index_v1 (md->old_pg_root, md->old_vars_root
+                         ,md->old_attrs_root
+                         );
+    md->old_pg_root = 0;
+    md->old_vars_root = 0;
+    md->old_attrs_root = 0;
+#if COLLECT_METRICS
+    print_metrics (md, iteration++);
+#endif
+}
+
+void adios_mpi_amr_finalize (int mype, struct adios_method_struct * method)
+{
+// nothing to do here
+    if (adios_mpi_amr_initialized)
+        adios_mpi_amr_initialized = 0;
+}
+
+void adios_mpi_amr_end_iteration (struct adios_method_struct * method)
+{
+}
+
+void adios_mpi_amr_start_calculation (struct adios_method_struct * method)
+{
+}
+
+void adios_mpi_amr_stop_calculation (struct adios_method_struct * method)
+{
+}
diff --git a/src/adios_mpi_lustre.c b/src/adios_mpi_lustre.c
new file mode 100644
index 0000000..866c9f0
--- /dev/null
+++ b/src/adios_mpi_lustre.c
@@ -0,0 +1,2106 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <errno.h>
+
+// mpi
+#include "mpi.h"
+
+// xml parser
+#include <mxml.h>
+
+#include "adios.h"
+#include "adios_transport_hooks.h"
+#include "adios_bp_v1.h"
+#include "adios_internals.h"
+#include "buffer.h"
+
+static int adios_mpi_lustre_initialized = 0;
+
+#define COLLECT_METRICS 0
+
+struct adios_MPI_data_struct
+{
+    MPI_File fh;
+    MPI_Request req;
+    MPI_Status status;
+    MPI_Comm group_comm;
+    int rank;
+    int size;
+
+    void * comm; // temporary until moved from should_buffer to open
+
+    struct adios_bp_buffer_struct_v1 b;
+
+    struct adios_index_process_group_struct_v1 * old_pg_root;
+    struct adios_index_var_struct_v1 * old_vars_root;
+    struct adios_index_attribute_struct_v1 * old_attrs_root;
+
+    uint64_t vars_start;
+    uint64_t vars_header_size;
+
+    uint64_t striping_unit;  // file system stripe size
+    uint64_t block_unit;
+};
+
+#if COLLECT_METRICS
+// see adios_adaptive_finalize for what each represents
+struct timeval t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t22, t23, t24, t25;
+
+// Subtract the `struct timeval' values X and Y,
+// storing the result in RESULT.
+// Return 1 if the difference is negative, otherwise 0.
+static int timeval_subtract (struct timeval * result
+                            ,struct timeval * x, struct timeval * y
+                            )
+{
+  // Perform the carry for the later subtraction by updating y.
+  if (x->tv_usec < y->tv_usec)
+  {
+    int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1;
+    y->tv_usec -= 1000000 * nsec;
+    y->tv_sec += nsec;
+  }
+  if (x->tv_usec - y->tv_usec > 1000000)
+  {
+    int nsec = (x->tv_usec - y->tv_usec) / 1000000;
+    y->tv_usec += 1000000 * nsec;
+    y->tv_sec -= nsec;
+  }
+
+  // Compute the time remaining to wait.
+  // tv_usec is certainly positive.
+  result->tv_sec = x->tv_sec - y->tv_sec;
+  result->tv_usec = x->tv_usec - y->tv_usec;
+
+  // Return 1 if result is negative.
+  return x->tv_sec < y->tv_sec;
+}
+
+static
+void print_metrics (struct adios_MPI_data_struct * md, int iteration)
+{
+    struct timeval diff;
+    if (md->rank == 0)
+    {
+        timeval_subtract (&diff, &t2, &t1);
+        printf ("cc\t%2d\tFile create (stripe setup):\t%02d.%06d\n"
+               ,iteration, diff.tv_sec, diff.tv_usec);
+        
+        timeval_subtract (&diff, &t6, &t5);
+        printf ("dd\t%2d\tMass file open:\t%02d.%06d\n"
+               ,iteration, diff.tv_sec, diff.tv_usec);
+        
+        timeval_subtract (&diff, &t17, &t16);
+        printf ("ee\t%2d\tBuild file offsets:\t%02d.%06d\n"
+               ,iteration, diff.tv_sec, diff.tv_usec);
+    }
+    if (md->rank == md->size - 1)
+    {   
+        timeval_subtract (&diff, &t10, &t9);
+        printf ("ff\t%2d\tGlobal index creation:\t%02d.%06d\n"
+               ,iteration, diff.tv_sec, diff.tv_usec);
+        
+        timeval_subtract (&diff, &t8, &t7);
+        printf ("gg\t%2d\tAll writes complete (w/ local index):\t%02d.%06d\n"
+               ,iteration, diff.tv_sec, diff.tv_usec);
+        
+        timeval_subtract (&diff, &t11, &t0);
+        printf ("hh\t%2d\tTotal time:\t%02d.%06d\n"
+               ,iteration, diff.tv_sec, diff.tv_usec);
+    }
+    
+    timeval_subtract (&diff, &t13, &t12);
+    printf ("ii\t%2d\tLocal index creation:\t%6d\t%02d.%06d\n"
+           ,iteration, md->rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t22, &t21);
+    printf ("kk\t%2d\tshould buffer time:\t%6d\t%02d.%06d\n"
+           ,iteration, md->rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t19, &t23);
+    printf ("ll\t%2d\tclose startup time:\t%6d\t%02d.%06d\n"
+           ,iteration, md->rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t19, &t0);
+    printf ("mm\t%2d\tsetup time:\t%6d\t%02d.%06d\n"
+           ,iteration, md->rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t14, &t20);
+    printf ("nn\t%2d\tcleanup time:\t%6d\t%02d.%06d\n"
+           ,iteration, md->rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t21, &t0);
+    printf ("oo\t%2d\topen->should_buffer time:\t%6d\t%02d.%06d\n"
+           ,iteration, md->rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t24, &t21);
+    printf ("pp\t%2d\tshould_buffer->write1 time:\t%6d\t%02d.%06d\n"
+           ,iteration, md->rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t25, &t24);
+    printf ("qq1\t%2d\twrite1->write2 time:\t%6d\t%02d.%06d\n"
+           ,iteration, md->rank, diff.tv_sec, diff.tv_usec);
+    
+    timeval_subtract (&diff, &t23, &t25);
+    printf ("qq2\t%2d\twrite2->close start time:\t%6d\t%02d.%06d\n"
+           ,iteration, md->rank, diff.tv_sec, diff.tv_usec);
+}
+#endif
+
+#if defined(__APPLE__)
+#	include <sys/param.h>
+#	include <sys/mount.h>
+#else
+#	include <sys/statfs.h>
+#endif
+
+// this should be determined at configure time
+//#define ADIOS_LUSTRE
+
+//#ifdef ADIOS_LUSTRE
+#include <sys/ioctl.h>
+//#include <lustre/lustre_user.h>
+//#endif
+// from /usr/include/lustre/lustre_user.h
+#define LUSTRE_SUPER_MAGIC 0x0BD00BD0
+#  define LOV_USER_MAGIC 0x0BD10BD0
+#  define LL_IOC_LOV_SETSTRIPE  _IOW ('f', 154, long)
+#  define LL_IOC_LOV_GETSTRIPE  _IOW ('f', 155, long)
+#define O_LOV_DELAY_CREATE 0100000000
+
+struct lov_user_ost_data {           // per-stripe data structure
+        uint64_t l_object_id;        // OST object ID
+        uint64_t l_object_gr;        // OST object group (creating MDS number)
+        uint32_t l_ost_gen;          // generation of this OST index
+        uint32_t l_ost_idx;          // OST index in LOV
+} __attribute__((packed));
+struct lov_user_md {                 // LOV EA user data (host-endian)
+        uint32_t lmm_magic;          // magic number = LOV_USER_MAGIC_V1
+        uint32_t lmm_pattern;        // LOV_PATTERN_RAID0, LOV_PATTERN_RAID1
+        uint64_t lmm_object_id;      // LOV object ID
+        uint64_t lmm_object_gr;      // LOV object group
+        uint32_t lmm_stripe_size;    // size of stripe in bytes
+        uint16_t lmm_stripe_count;   // num stripes in use for this object
+        uint16_t lmm_stripe_offset;  // starting stripe offset in lmm_objects
+        struct lov_user_ost_data  lmm_objects[0]; // per-stripe data
+} __attribute__((packed));
+
+static void trim_spaces (char * str)
+{
+    char * t = str, * p = NULL;
+    while (*t != '\0')
+    {
+        if (*t == ' ')
+        {
+            p = t + 1;
+            strcpy (t, p);
+        }
+        else
+            t++;
+    }
+
+}
+
+static void
+adios_mpi_lustre_set_striping_unit(MPI_File fh, char *filename, char *parameters)
+{
+    struct statfs fsbuf;
+    int err = 0, flag;
+    uint64_t striping_unit = 0;
+    uint64_t block_unit = 0;
+    uint16_t striping_count = 0;
+    uint16_t stripe_offset = -1;
+    char     value[64], *temp_string, *p_count,*p_size;
+    MPI_Info info_used;
+
+//#ifndef ADIOS_LUSTRE
+//    return 0;  // disable stripe-size I/O for non-Lustre file system
+//#else
+    temp_string = (char *) malloc (strlen (parameters) + 1);
+    strcpy (temp_string, parameters);
+    trim_spaces (temp_string);
+
+    if (p_count = strstr (temp_string, "stripe_count"))
+    {
+        char * p = strchr (p_count, '=');
+        char * q = strtok (p, ",");
+        if (!q)
+            striping_count = atoi (q + 1);
+        else
+            striping_count = atoi (p + 1);
+    }
+
+    if (striping_count <= 0)
+        striping_count = 4;
+
+    strcpy (temp_string, parameters);
+    trim_spaces (temp_string);
+
+    if (p_size = strstr (temp_string, "stripe_size"))
+    {
+        char * p = strchr (p_size, '=');
+        char * q = strtok (p, ",");
+        if (!q)
+            striping_unit = atoi(q + 1);
+        else
+            striping_unit = atoi(p + 1);
+    }
+
+    if (striping_unit <= 0)
+        striping_unit = 1048576;
+
+    strcpy (temp_string, parameters);
+    trim_spaces (temp_string);
+
+    if (p_size = strstr (temp_string, "stripe_offset"))
+    {
+        char * p = strchr (p_size, '=');
+        char * q = strtok (p, ",");
+        if (!q)
+            stripe_offset = atoi (q + 1);
+        else
+            stripe_offset = atoi (p + 1);
+    }
+
+    if (stripe_offset < -1)
+        stripe_offset = -1;
+
+    strcpy (temp_string, parameters);
+    trim_spaces (temp_string);
+
+    if (p_size = strstr (temp_string, "block_size"))
+    {
+        char * p = strchr (p_size, '=');
+        char * q = strtok (p, ",");
+        if (!q)
+            block_unit = atoi(q + 1);
+        else
+            block_unit = atoi(p + 1);
+    }
+
+    if (block_unit <= 0)
+        block_unit = 1048576;
+
+    free (temp_string);
+
+    int fd, old_mask, perm;
+
+    old_mask = umask(022);
+    umask(old_mask);
+    perm = old_mask ^ 0666;
+
+    fd =  open(filename, O_RDONLY | O_CREAT | O_LOV_DELAY_CREATE, perm);
+    if (fd != -1) {
+        struct lov_user_md lum;
+        lum.lmm_magic = LOV_USER_MAGIC;
+        lum.lmm_pattern = 0;
+        lum.lmm_stripe_size = striping_unit;
+        lum.lmm_stripe_count = striping_count;
+        lum.lmm_stripe_offset = stripe_offset;
+        ioctl (fd, LL_IOC_LOV_SETSTRIPE
+              ,(void *) &lum
+              );
+
+        if (err == 0 && lum.lmm_stripe_size > 0) {
+            striping_unit = lum.lmm_stripe_size;
+        }
+        close(fd);
+    }
+    else
+        printf("Warning: open failed on file %s %s.\n",filename,strerror(errno));
+//#endif
+}
+
+static void
+adios_mpi_lustre_set_block_unit(uint64_t *block_unit, char *parameters)
+{
+    char *temp_string, *p_count,*p_size;
+
+    temp_string = (char *) malloc (strlen (parameters) + 1);
+    strcpy (temp_string, parameters);
+    trim_spaces (temp_string);
+
+    if (p_size = strstr (temp_string, "block_size"))
+    {
+        char * p = strchr (p_size, '=');
+        char * q = strtok (p, ",");
+        if (!q)
+            *block_unit = atoi(q + 1);
+        else
+            *block_unit = atoi(p + 1);
+    }
+
+    if (*block_unit <= 0)
+        *block_unit = 1048576;
+
+    free (temp_string);
+}
+
+static int
+adios_mpi_lustre_get_striping_unit(MPI_File fh, char *filename)
+{
+    struct statfs fsbuf;
+    int err, flag;
+    uint64_t striping_unit = 1048576;
+    char     value[64];
+    MPI_Info info_used;
+
+#if COLLECT_METRICS
+    gettimeofday (&t1, NULL);
+#endif
+
+    // get striping_unit from MPI hint if it has
+    MPI_File_get_info(fh, &info_used);
+    MPI_Info_get(info_used, "striping_unit", 63, value, &flag);
+    MPI_Info_free(&info_used);
+
+    if (flag) return atoi(value);
+
+    // if striping_unit is not set in MPI file info, get it from system
+    err = statfs(filename, &fsbuf);
+    if (err == -1) {
+        printf("Warning: statfs failed %s %s.\n",filename,strerror(errno));
+        return striping_unit;
+    }
+
+    if (!err && fsbuf.f_type == LUSTRE_SUPER_MAGIC) {
+        int fd, old_mask, perm;
+
+        old_mask = umask(022);
+        umask(old_mask);
+        perm = old_mask ^ 0666;
+
+        fd =  open(filename, O_RDONLY, perm);
+        if (fd != -1) {
+            struct lov_user_md lum;
+            lum.lmm_magic = LOV_USER_MAGIC;
+            err = ioctl(fd, LL_IOC_LOV_GETSTRIPE, (void *) &lum);
+            if (err == 0 && lum.lmm_stripe_size > 0) {
+                striping_unit = lum.lmm_stripe_size;
+            }
+            close(fd);
+        }
+        else
+            printf("Warning: open failed on file %s %s.\n",filename,strerror(errno));
+    }
+
+#if COLLECT_METRICS         
+    gettimeofday (&t2, NULL);
+#endif
+    // set the file striping size
+    return striping_unit;
+}
+
+static uint64_t
+adios_mpi_lustre_striping_unit_write(MPI_File    fh,
+                              MPI_Offset  offset,
+                              void       *buf,
+                              uint64_t   len,
+                              uint64_t   block_unit)
+{
+    uint64_t err = -1;
+    MPI_Status status;
+
+    if (len == 0) return 0;
+
+    if (offset == -1) // use current position
+        MPI_File_get_position(fh, &offset);
+    else
+        MPI_File_seek (fh, offset, MPI_SEEK_SET);
+
+    if (block_unit > 0) {
+        MPI_Offset  rem_off = offset;
+        uint64_t    rem_size = len;
+        char       *buf_ptr = buf;
+
+        err = 0;
+        while (rem_size > 0) {
+            uint64_t rem_unit  = block_unit - rem_off % block_unit;
+            int write_len = (rem_unit < rem_size) ? rem_unit : rem_size;
+            int ret_len;
+
+#ifdef _WKL_CHECK_STRIPE_IO
+printf("adios_mpi_lustre_striping_unit_write offset=%12lld len=%12d\n",offset,write_len);offset+=write_len;
+#endif
+            MPI_File_write (fh, buf_ptr, write_len, MPI_BYTE, &status);
+            MPI_Get_count(&status, MPI_BYTE, &ret_len);
+            if (ret_len < 0) {err = ret_len; break;}
+            err += ret_len;
+            if (ret_len != write_len) break;
+            buf_ptr  += write_len;
+            rem_off  += write_len;
+            rem_size -= write_len;
+        }
+    }
+    else {
+#ifdef _WKL_CHECK_STRIPE_IO
+printf("adios_mpi_lustre_striping_unit_write offset=%12lld len=%12d\n",offset,len);
+#endif
+        uint64_t total_written = 0;
+        uint64_t to_write = len;
+        int write_len = 0;
+        int count;
+        char * buf_ptr = buf;
+        while (total_written < len)
+        {
+            write_len = (to_write > INT32_MAX) ? INT32_MAX : to_write;
+            MPI_File_write (fh, buf_ptr, write_len, MPI_BYTE, &status);
+            MPI_Get_count(&status, MPI_BYTE, &count);
+            if (count != write_len)
+            {
+                err = count;
+                break;
+            }
+            total_written += count;
+            buf_ptr += count;
+            to_write -= count;
+            err = total_written;
+        }
+    }
+    return err;
+}
+
+static void adios_var_to_comm (const char * comm_name
+                              ,enum ADIOS_FLAG host_language_fortran
+                              ,void * data
+                              ,MPI_Comm * comm
+                              )
+{
+    if (data)
+    {
+        int t = *(int *) data;
+
+        if (!comm_name)
+        {
+            if (!t)
+            {
+                fprintf (stderr, "communicator not provided and none "
+                                 "listed in XML.  Defaulting to "
+                                 "MPI_COMM_SELF\n"
+                        );
+
+                *comm = MPI_COMM_SELF;
+            }
+            else
+            {
+                if (host_language_fortran == adios_flag_yes)
+                {
+                    *comm = MPI_Comm_f2c (t);
+                }
+                else
+                {
+                    *comm = *(MPI_Comm *) data;
+                }
+            }
+        }
+        else
+        {
+            if (!strcmp (comm_name, ""))
+            {
+                if (!t)
+                {
+                    fprintf (stderr, "communicator not provided and none "
+                                     "listed in XML.  Defaulting to "
+                                     "MPI_COMM_SELF\n"
+                            );
+
+                    *comm = MPI_COMM_SELF;
+                }
+                else
+                {
+                    if (host_language_fortran == adios_flag_yes)
+                    {
+                        *comm = MPI_Comm_f2c (t);
+                    }
+                    else
+                    {
+                        *comm = *(MPI_Comm *) data;
+                    }
+                }
+            }
+            else
+            {
+                if (!t)
+                {
+                    fprintf (stderr, "communicator not provided but one "
+                                     "listed in XML.  Defaulting to "
+                                     "MPI_COMM_WORLD\n"
+                            );
+
+                    *comm = MPI_COMM_WORLD;
+                }
+                else
+                {
+                    if (host_language_fortran == adios_flag_yes)
+                    {
+                        *comm = MPI_Comm_f2c (t);
+                    }
+                    else
+                    {
+                        *comm = *(MPI_Comm *) data;
+                    }
+                }
+            }
+        }
+    }
+    else
+    {
+        fprintf (stderr, "coordination-communication not provided. "
+                         "Using MPI_COMM_WORLD instead\n"
+                );
+
+        *comm = MPI_COMM_WORLD;
+    }
+}
+
+void adios_mpi_lustre_init (const char * parameters
+                    ,struct adios_method_struct * method
+                    )
+{
+    struct adios_MPI_data_struct * md = (struct adios_MPI_data_struct *)
+                                                    method->method_data;
+    if (!adios_mpi_lustre_initialized)
+    {
+        adios_mpi_lustre_initialized = 1;
+    }
+    method->method_data = malloc (sizeof (struct adios_MPI_data_struct));
+    md = (struct adios_MPI_data_struct *) method->method_data;
+    md->fh = 0;
+    md->req = 0;
+    memset (&md->status, 0, sizeof (MPI_Status));
+    md->rank = 0;
+    md->size = 0;
+    md->group_comm = MPI_COMM_NULL;
+    md->old_pg_root = 0;
+    md->old_vars_root = 0;
+    md->old_attrs_root = 0;
+    md->vars_start = 0;
+    md->vars_header_size = 0;
+
+    adios_buffer_struct_init (&md->b);
+}
+
+int adios_mpi_lustre_open (struct adios_file_struct * fd
+                   ,struct adios_method_struct * method, void * comm
+                   )
+{
+    struct adios_MPI_data_struct * md = (struct adios_MPI_data_struct *)
+                                                    method->method_data;
+
+#if COLLECT_METRICS
+    gettimeofday (&t0, NULL); // only used on rank == size - 1, but we don't
+                              // have the comm yet to get the rank/size
+#endif
+    // we have to wait for the group_size (should_buffer) to get the comm
+    // before we can do an open for any of the modes
+    md->comm = comm;
+
+    return 1;
+}
+
+static
+void build_offsets (struct adios_bp_buffer_struct_v1 * b
+                   ,MPI_Offset * offsets, uint64_t size, char * group_name
+                   ,struct adios_index_process_group_struct_v1 * pg_root
+                   )
+{
+    while (pg_root)
+    {
+        if (!strcasecmp (pg_root->group_name, group_name))
+        {
+            MPI_Offset size = 0;
+
+            if (pg_root->next)
+            {
+                size = pg_root->next->offset_in_file - pg_root->offset_in_file;
+            }
+            else
+            {
+                size = b->pg_index_offset - pg_root->offset_in_file;
+            }
+
+            offsets [pg_root->process_id * 3] = pg_root->offset_in_file;
+            offsets [pg_root->process_id * 3 + 1] = size;
+            offsets [pg_root->process_id * 3 + 2] = b->version;
+        }
+
+        pg_root = pg_root->next;
+    }
+}
+
+enum ADIOS_FLAG adios_mpi_lustre_should_buffer (struct adios_file_struct * fd
+                                        ,struct adios_method_struct * method
+                                        )
+{
+    int i;
+    struct adios_MPI_data_struct * md = (struct adios_MPI_data_struct *)
+                                                      method->method_data;
+    char * name;
+    int err;
+    int flag;    // used for coordinating the MPI_File_open
+
+    int previous;
+    int current;
+    int next;
+
+#if COLLECT_METRICS
+    gettimeofday (&t21, NULL);
+#endif
+
+    name = malloc (strlen (method->base_path) + strlen (fd->name) + 1);
+    sprintf (name, "%s%s", method->base_path, fd->name);
+
+    adios_var_to_comm (fd->group->group_comm
+                      ,fd->group->adios_host_language_fortran
+                      ,md->comm
+                      ,&md->group_comm
+                      );
+    if (md->group_comm != MPI_COMM_NULL)
+    {
+        MPI_Comm_rank (md->group_comm, &md->rank);
+        MPI_Comm_size (md->group_comm, &md->size);
+    }
+    fd->group->process_id = md->rank;
+
+    if (md->rank == md->size - 1)
+        next = -1;
+    else
+        next = md->rank + 1;
+    previous = md->rank - 1;
+    current = md->rank;
+
+    fd->base_offset = 0;
+
+    switch (fd->mode)
+    {
+        case adios_mode_read:
+        {
+            if (md->group_comm == MPI_COMM_NULL || md->rank == 0)
+            {
+                err = MPI_File_open (MPI_COMM_SELF, name, MPI_MODE_RDONLY
+                                    ,MPI_INFO_NULL, &md->fh
+                                    );
+                if (err != MPI_SUCCESS)
+                {
+                    char e [MPI_MAX_ERROR_STRING];
+                    int len = 0;
+                    memset (e, 0, MPI_MAX_ERROR_STRING);
+                    MPI_Error_string (err, e, &len);
+                    fprintf (stderr, "MPI open read failed for %s: '%s'\n"
+                            ,name, e
+                            );
+                    free (name);
+
+                    return adios_flag_no;
+                }
+
+                MPI_Offset file_size;
+                MPI_File_get_size (md->fh, &file_size);
+                md->b.file_size = file_size;
+
+                adios_init_buffer_read_version (&md->b);
+                MPI_File_seek (md->fh, md->b.file_size - md->b.length
+                              ,MPI_SEEK_SET
+                              );
+                MPI_File_read (md->fh, md->b.buff, md->b.length, MPI_BYTE
+                              ,&md->status
+                              );
+                adios_parse_version (&md->b, &md->b.version);
+
+                adios_init_buffer_read_index_offsets (&md->b);
+                // already in the buffer
+                adios_parse_index_offsets_v1 (&md->b);
+
+                adios_init_buffer_read_process_group_index (&md->b);
+                MPI_File_seek (md->fh, md->b.pg_index_offset
+                              ,MPI_SEEK_SET
+                              );
+                MPI_File_read (md->fh, md->b.buff, md->b.pg_size, MPI_BYTE
+                              ,&md->status
+                              );
+                adios_parse_process_group_index_v1 (&md->b
+                                                   ,&md->old_pg_root
+                                                   );
+
+#if 1
+                adios_init_buffer_read_vars_index (&md->b);
+                MPI_File_seek (md->fh, md->b.vars_index_offset
+                              ,MPI_SEEK_SET
+                              );
+                MPI_File_read (md->fh, md->b.buff, md->b.vars_size, MPI_BYTE
+                              ,&md->status
+                              );
+                adios_parse_vars_index_v1 (&md->b, &md->old_vars_root);
+
+                adios_init_buffer_read_attributes_index (&md->b);
+                MPI_File_seek (md->fh, md->b.attrs_index_offset
+                              ,MPI_SEEK_SET
+                              );
+                MPI_File_read (md->fh, md->b.buff, md->b.attrs_size, MPI_BYTE
+                              ,&md->status
+                              );
+                adios_parse_attributes_index_v1 (&md->b, &md->old_attrs_root);
+#endif
+
+                fd->base_offset = md->b.end_of_pgs;
+            }
+
+            if (   md->group_comm != MPI_COMM_NULL
+                && md->group_comm != MPI_COMM_SELF
+               )
+            {
+                if (md->rank == 0)
+                {
+                    MPI_Offset * offsets = malloc (  sizeof (MPI_Offset)
+                                                   * md->size * 3
+                                                  );
+                    memset (offsets, 0, sizeof (MPI_Offset) * md->size * 3);
+
+                    // go through the pg index to build the offsets array
+                    build_offsets (&md->b, offsets, md->size
+                                  ,fd->group->name, md->old_pg_root
+                                  );
+                    MPI_Scatter (offsets, 3, MPI_LONG_LONG
+                                ,offsets, 3, MPI_LONG_LONG
+                                ,0, md->group_comm
+                                );
+                    md->b.read_pg_offset = offsets [0];
+                    md->b.read_pg_size = offsets [1];
+                    free (offsets);
+                }
+                else
+                {
+                    MPI_Offset offset [3];
+                    offset [0] = offset [1] = offset [2] = 0;
+
+                    MPI_Scatter (offset, 3, MPI_LONG_LONG
+                                ,offset, 3, MPI_LONG_LONG
+                                ,0, md->group_comm
+                                );
+
+                    md->b.read_pg_offset = offset [0];
+                    md->b.read_pg_size = offset [1];
+                    md->b.version = offset [2];
+                }
+            }
+
+            // cascade the opens to avoid trashing the metadata server
+            if (previous == -1)
+            {
+                // note rank 0 is already open
+                // don't open it again here
+
+                if (next != -1)
+                {
+                    MPI_Isend (&flag, 1, MPI_INT, next, current
+                              ,md->group_comm, &md->req
+                              );
+                }
+            }
+            else
+            {
+                MPI_Recv (&flag, 1, MPI_INT, previous, previous
+                         ,md->group_comm, &md->status
+                         );
+                if (next != -1)
+                {
+                    MPI_Isend (&flag, 1, MPI_INT, next, current
+                              ,md->group_comm, &md->req
+                              );
+                }
+                err = MPI_File_open (MPI_COMM_SELF, name
+                                    ,MPI_MODE_RDONLY
+                                    ,MPI_INFO_NULL
+                                    ,&md->fh
+                                    );
+            }
+
+            if (err != MPI_SUCCESS)
+            {
+                char e [MPI_MAX_ERROR_STRING];
+                int len = 0;
+                memset (e, 0, MPI_MAX_ERROR_STRING);
+                MPI_Error_string (err, e, &len);
+                fprintf (stderr, "MPI open write failed for %s: '%s'\n"
+                        ,name, e
+                        );
+                free (name);
+
+                return adios_flag_no;
+            }
+
+            break;
+        }
+
+        case adios_mode_write:
+        {
+            fd->base_offset = 0;
+            fd->pg_start_in_file = 0;
+#if COLLECT_METRICS                     
+            gettimeofday (&t16, NULL);
+#endif
+            // cascade the opens to avoid trashing the metadata server
+            if (previous == -1)
+            {
+                unlink (name);  // make sure clean
+
+                if (method->parameters)
+                    adios_mpi_lustre_set_striping_unit (md->fh 
+                                                        ,name
+                                                        ,method->parameters);
+                adios_mpi_lustre_set_block_unit (&md->block_unit, method->parameters);
+
+                err = MPI_File_open (MPI_COMM_SELF, name
+                                    ,MPI_MODE_WRONLY | MPI_MODE_CREATE
+                                    ,MPI_INFO_NULL
+                                    ,&md->fh
+                                    );
+
+                md->striping_unit = adios_mpi_lustre_get_striping_unit(md->fh, name);
+
+                if (next != -1)
+                {
+                    MPI_Isend (&flag, 1, MPI_INT, next, current
+                              ,md->group_comm, &md->req
+                              );
+                }
+            }
+            else
+            {
+                MPI_Recv (&flag, 1, MPI_INT, previous, previous
+                         ,md->group_comm, &md->status
+                         );
+                if (next != -1)
+                {
+                    MPI_Isend (&flag, 1, MPI_INT, next, current
+                              ,md->group_comm, &md->req
+                              );
+                }
+
+                adios_mpi_lustre_set_block_unit (&md->block_unit, method->parameters);
+                err = MPI_File_open (MPI_COMM_SELF, name
+                                    ,MPI_MODE_WRONLY
+                                    ,MPI_INFO_NULL
+                                    ,&md->fh
+                                    );
+                md->striping_unit = adios_mpi_lustre_get_striping_unit(md->fh, name);
+            }
+
+            if (err != MPI_SUCCESS)
+            {
+                char e [MPI_MAX_ERROR_STRING];
+                int len = 0;
+                memset (e, 0, MPI_MAX_ERROR_STRING);
+                MPI_Error_string (err, e, &len);
+                fprintf (stderr, "MPI open write failed for %s: '%s'\n"
+                        ,name, e
+                        );
+                free (name);
+
+                return adios_flag_no;
+            }
+
+#if COLLECT_METRICS
+            gettimeofday (&t17, NULL);
+#endif
+            if (md->group_comm != MPI_COMM_NULL)
+            {
+                if (md->rank == 0)
+                {
+                    MPI_Offset * offsets = malloc (  sizeof (MPI_Offset)
+                                                   * md->size
+                                                  );
+
+                    if (fd->write_size_bytes % md->striping_unit)
+                        offsets [0] =  (fd->write_size_bytes / md->striping_unit + 1)
+                                     * md->striping_unit;
+                    else
+                        offsets [0] = fd->write_size_bytes;
+
+                    MPI_Gather (offsets, 1, MPI_LONG_LONG
+                               ,offsets, 1, MPI_LONG_LONG
+                               ,0, md->group_comm
+                               );
+
+                    uint64_t last_offset = offsets [0];
+                    offsets [0] = fd->base_offset;
+                    for (i = 1; i < md->size; i++)
+                    {
+                        uint64_t this_offset = offsets [i];
+                        offsets [i] = offsets [i - 1] + last_offset;
+                        last_offset = this_offset;
+                    }
+                    md->b.pg_index_offset =   offsets [md->size - 1]
+                                            + last_offset;
+                    MPI_Scatter (offsets, 1, MPI_LONG_LONG
+                                ,offsets, 1, MPI_LONG_LONG
+                                ,0, md->group_comm
+                                );
+                    fd->base_offset = offsets [0];
+                    fd->pg_start_in_file = fd->base_offset;
+                    free (offsets);
+                }
+                else
+                {
+                    MPI_Offset offset;
+                    if (fd->write_size_bytes % md->striping_unit)
+                        offset =  (fd->write_size_bytes / md->striping_unit + 1)
+                                  * md->striping_unit;
+                    else
+                        offset = fd->write_size_bytes;
+
+                    MPI_Gather (&offset, 1, MPI_LONG_LONG
+                               ,&offset, 1, MPI_LONG_LONG
+                               ,0, md->group_comm
+                               );
+
+                    MPI_Scatter (&offset, 1, MPI_LONG_LONG
+                                ,&offset, 1, MPI_LONG_LONG
+                                ,0, md->group_comm
+                                );
+                    fd->base_offset = offset;
+                    fd->pg_start_in_file = fd->base_offset;
+                }
+            }
+            else
+            {
+                md->b.pg_index_offset = fd->write_size_bytes;
+            }
+
+#if COLLECT_METRICS
+            gettimeofday (&t6, NULL);
+#endif
+
+            break;
+        }
+
+        case adios_mode_append:
+        {
+            int old_file = 1;
+            adios_buffer_struct_clear (&md->b);
+
+            err = MPI_File_open (MPI_COMM_SELF, name, MPI_MODE_RDONLY
+                                ,MPI_INFO_NULL, &md->fh
+                                );
+
+            if (err != MPI_SUCCESS)
+            {
+                old_file = 0;
+                err = MPI_File_open (MPI_COMM_SELF, name
+                                    ,MPI_MODE_WRONLY | MPI_MODE_CREATE
+                                    ,MPI_INFO_NULL, &md->fh
+                                    );
+
+                if (err != MPI_SUCCESS)
+                {
+                    char e [MPI_MAX_ERROR_STRING];
+                    int len = 0;
+                    memset (e, 0, MPI_MAX_ERROR_STRING);
+                    MPI_Error_string (err, e, &len);
+                    fprintf (stderr, "MPI open write failed for %s: '%s'\n"
+                            ,name, e
+                            );
+                    free (name);
+
+                    return adios_flag_no;
+                }
+                md->striping_unit = adios_mpi_lustre_get_striping_unit(md->fh, name);
+            }
+
+            if (old_file)
+            {
+                if (md->group_comm == MPI_COMM_NULL || md->rank == 0)
+                {
+                    if (err != MPI_SUCCESS)
+                    {
+                        md->b.file_size = 0;
+                    }
+                    else
+                    {
+                        MPI_Offset file_size;
+                        MPI_File_get_size (md->fh, &file_size);
+                        md->b.file_size = file_size;
+                    }
+
+                    adios_init_buffer_read_version (&md->b);
+                    MPI_File_seek (md->fh, md->b.file_size - md->b.length
+                                  ,MPI_SEEK_SET
+                                  );
+                    MPI_File_read (md->fh, md->b.buff, md->b.length, MPI_BYTE
+                                  ,&md->status
+                                  );
+                    adios_parse_version (&md->b, &md->b.version);
+
+                    adios_init_buffer_read_index_offsets (&md->b);
+                    // already in the buffer
+                    adios_parse_index_offsets_v1 (&md->b);
+
+                    adios_init_buffer_read_process_group_index (&md->b);
+                    MPI_File_seek (md->fh, md->b.pg_index_offset
+                                  ,MPI_SEEK_SET
+                                  );
+                    MPI_File_read (md->fh, md->b.buff, md->b.pg_size, MPI_BYTE
+                                  ,&md->status
+                                  );
+                    adios_parse_process_group_index_v1 (&md->b
+                                                       ,&md->old_pg_root
+                                                       );
+
+                    adios_init_buffer_read_vars_index (&md->b);
+                    MPI_File_seek (md->fh, md->b.vars_index_offset
+                                  ,MPI_SEEK_SET
+                                  );
+                    MPI_File_read (md->fh, md->b.buff, md->b.vars_size, MPI_BYTE
+                                  ,&md->status
+                                  );
+                    adios_parse_vars_index_v1 (&md->b, &md->old_vars_root);
+
+                    adios_init_buffer_read_attributes_index (&md->b);
+                    MPI_File_seek (md->fh, md->b.attrs_index_offset
+                                  ,MPI_SEEK_SET
+                                  );
+                    MPI_File_read (md->fh, md->b.buff, md->b.attrs_size
+                                  ,MPI_BYTE, &md->status
+                                  );
+                    adios_parse_attributes_index_v1 (&md->b
+                                                    ,&md->old_attrs_root
+                                                    );
+
+                    fd->base_offset = md->b.end_of_pgs;
+                    fd->pg_start_in_file = fd->base_offset;
+                }
+                else
+                {
+                    fd->base_offset = 0;
+                    fd->pg_start_in_file = 0;
+                }
+
+                MPI_File_close (&md->fh);
+            }
+            else
+            {
+                fd->base_offset = 0;
+                fd->pg_start_in_file = 0;
+            }
+
+            // cascade the opens to avoid trashing the metadata server
+            if (previous == -1)
+            {
+                // we know it exists, because we created it if it didn't
+                // when reading the old file so can just open wronly
+                // but adding the create for consistency with write mode
+                // so it is easier to merge write/append later
+                err = MPI_File_open (MPI_COMM_SELF, name
+                                    ,MPI_MODE_WRONLY | MPI_MODE_CREATE
+                                    ,MPI_INFO_NULL
+                                    ,&md->fh
+                                    );
+                md->striping_unit = adios_mpi_lustre_get_striping_unit(md->fh, name);
+                if (next != -1)
+                {
+                    MPI_Isend (&flag, 1, MPI_INT, next, current
+                              ,md->group_comm, &md->req
+                              );
+                }
+            }
+            else
+            {
+                MPI_Recv (&flag, 1, MPI_INT, previous, previous
+                         ,md->group_comm, &md->status
+                         );
+                if (next != -1)
+                {
+                    MPI_Isend (&flag, 1, MPI_INT, next, current
+                              ,md->group_comm, &md->req
+                              );
+                }
+                err = MPI_File_open (MPI_COMM_SELF, name
+                                    ,MPI_MODE_WRONLY
+                                    ,MPI_INFO_NULL
+                                    ,&md->fh
+                                    );
+                md->striping_unit = adios_mpi_lustre_get_striping_unit(md->fh, name);
+            }
+
+            if (err != MPI_SUCCESS)
+            {
+                char e [MPI_MAX_ERROR_STRING];
+                int len = 0;
+                memset (e, 0, MPI_MAX_ERROR_STRING);
+                MPI_Error_string (err, e, &len);
+                fprintf (stderr, "MPI open write failed for %s: '%s'\n"
+                        ,name, e
+                        );
+                free (name);
+
+                return adios_flag_no;
+            }
+
+            if (md->group_comm != MPI_COMM_NULL)
+            {
+                if (md->rank == 0)
+                {
+                    MPI_Offset * offsets = malloc (  sizeof (MPI_Offset)
+                                                   * md->size
+                                                  );
+
+                    if (fd->write_size_bytes % md->striping_unit)
+                        offsets [0] =  (fd->write_size_bytes / md->striping_unit + 1)
+                                     * md->striping_unit;
+                    else
+                        offsets [0] = fd->write_size_bytes;
+
+                    MPI_Gather (offsets, 1, MPI_LONG_LONG
+                               ,offsets, 1, MPI_LONG_LONG
+                               ,0, md->group_comm
+                               );
+
+                    uint64_t last_offset = offsets [0];
+                    offsets [0] = fd->base_offset;
+                    for (i = 1; i < md->size; i++)
+                    {
+                        uint64_t this_offset = offsets [i];
+                        offsets [i] = offsets [i - 1] + last_offset;
+                        last_offset = this_offset;
+                    }
+                    md->b.pg_index_offset =   offsets [md->size - 1]
+                                            + last_offset;
+                    MPI_Scatter (offsets, 1, MPI_LONG_LONG
+                                ,offsets, 1, MPI_LONG_LONG
+                                ,0, md->group_comm
+                                );
+                    fd->base_offset = offsets [0];
+                    fd->pg_start_in_file = fd->base_offset;
+                    free (offsets);
+                }
+                else
+                {
+                    MPI_Offset offset;
+                    if (fd->write_size_bytes % md->striping_unit)
+                        offset =  (fd->write_size_bytes / md->striping_unit + 1)
+                                     * md->striping_unit;
+                    else
+                        offset = fd->write_size_bytes;
+
+
+                    MPI_Gather (&offset, 1, MPI_LONG_LONG
+                               ,&offset, 1, MPI_LONG_LONG
+                               ,0, md->group_comm
+                               );
+
+                    MPI_Scatter (&offset, 1, MPI_LONG_LONG
+                                ,&offset, 1, MPI_LONG_LONG
+                                ,0, md->group_comm
+                                );
+                    fd->base_offset = offset;
+                    fd->pg_start_in_file = fd->base_offset;
+                }
+            }
+            else
+            {
+                md->b.pg_index_offset = fd->write_size_bytes;
+            }
+
+            break;
+        }
+
+        default:
+        {
+            fprintf (stderr, "Unknown file mode: %d\n", fd->mode);
+
+            free (name);
+
+            return adios_flag_no;
+        }
+    }
+
+    free (name);
+
+    if (fd->shared_buffer == adios_flag_no && fd->mode != adios_mode_read)
+    {
+        // write the process group header
+        adios_write_process_group_header_v1 (fd, fd->write_size_bytes);
+
+        uint64_t count;
+        count = adios_mpi_lustre_striping_unit_write(
+                          md->fh,
+                          fd->base_offset,
+                          fd->buffer,
+                          fd->bytes_written,
+                          md->block_unit);
+        if (count != fd->bytes_written)
+        {
+            fprintf (stderr, "a:MPI method tried to write %llu, "
+                             "only wrote %llu\n"
+                    ,fd->bytes_written
+                    ,count
+                    );
+        }
+        fd->base_offset += count;
+        fd->offset = 0;
+        fd->bytes_written = 0;
+        adios_shared_buffer_free (&md->b);
+
+        // setup for writing vars
+        adios_write_open_vars_v1 (fd);
+        md->vars_start = fd->base_offset;
+        md->vars_header_size = fd->offset;
+        fd->base_offset += fd->offset;
+        MPI_File_seek (md->fh, md->vars_header_size, MPI_SEEK_CUR);
+        fd->offset = 0;
+        fd->bytes_written = 0;
+        adios_shared_buffer_free (&md->b);
+    }
+
+#if COLLECT_METRICS
+    gettimeofday (&t22, NULL);
+#endif
+    return fd->shared_buffer;
+}
+
+void adios_mpi_lustre_write (struct adios_file_struct * fd
+                     ,struct adios_var_struct * v
+                     ,void * data
+                     ,struct adios_method_struct * method
+                     )
+{
+    struct adios_MPI_data_struct * md = (struct adios_MPI_data_struct *)
+                                                      method->method_data;
+
+    if (v->got_buffer == adios_flag_yes)
+    {
+        if (data != v->data)  // if the user didn't give back the same thing
+        {
+            if (v->free_data == adios_flag_yes)
+            {
+                free (v->data);
+                adios_method_buffer_free (v->data_size);
+            }
+        }
+        else
+        {
+            // we already saved all of the info, so we're ok.
+            return;
+        }
+    }
+
+    if (fd->shared_buffer == adios_flag_no)
+    {
+        // var payload sent for sizing information
+        adios_write_var_header_v1 (fd, v);
+
+        uint64_t count;
+        count = adios_mpi_lustre_striping_unit_write(
+                          md->fh,
+                          -1,
+                          fd->buffer,
+                          fd->bytes_written,
+                          md->block_unit);
+        if (count != fd->bytes_written)
+        {
+            fprintf (stderr, "b:MPI method tried to write %llu, "
+                             "only wrote %llu\n"
+                    ,fd->bytes_written
+                    ,count
+                    );
+        }
+        fd->base_offset += count;
+        fd->offset = 0;
+        fd->bytes_written = 0;
+        adios_shared_buffer_free (&md->b);
+
+        // write payload
+        // adios_write_var_payload_v1 (fd, v);
+        uint64_t var_size = adios_get_var_size (v, fd->group, v->data);
+        if (fd->base_offset + var_size > fd->pg_start_in_file + fd->write_size_bytes) 
+            fprintf (stderr, "adios_mpi_write exceeds pg bound. File is corrupted. "
+                             "Need to enlarge group size. \n");
+        count = adios_mpi_lustre_striping_unit_write(
+                          md->fh,
+                          -1,
+                          v->data,
+                          var_size,
+                          md->block_unit);
+        if (count != var_size)
+        {
+            fprintf (stderr, "c:MPI method tried to write %llu, "
+                             "only wrote %llu\n"
+                    ,var_size
+                    ,count
+                    );
+        }
+        fd->base_offset += count;
+        fd->offset = 0;
+        fd->bytes_written = 0;
+        adios_shared_buffer_free (&md->b);
+    }
+#if COLLECT_METRICS
+    static int writes_seen = 0;
+
+    if (writes_seen == 0) gettimeofday (&t24, NULL);
+    else if (writes_seen == 1) gettimeofday (&t25, NULL);
+    writes_seen++;
+#endif
+}
+
+void adios_mpi_lustre_get_write_buffer (struct adios_file_struct * fd
+                                ,struct adios_var_struct * v
+                                ,uint64_t * size
+                                ,void ** buffer
+                                ,struct adios_method_struct * method
+                                )
+{
+    uint64_t mem_allowed;
+
+    if (*size == 0)
+    {
+        *buffer = 0;
+
+        return;
+    }
+
+    if (v->data && v->free_data)
+    {
+        adios_method_buffer_free (v->data_size);
+        free (v->data);
+    }
+
+    mem_allowed = adios_method_buffer_alloc (*size);
+    if (mem_allowed == *size)
+    {
+        *buffer = malloc (*size);
+        if (!*buffer)
+        {
+            adios_method_buffer_free (mem_allowed);
+            fprintf (stderr, "Out of memory allocating %llu bytes for %s\n"
+                    ,*size, v->name
+                    );
+            v->got_buffer = adios_flag_no;
+            v->free_data = adios_flag_no;
+            v->data_size = 0;
+            v->data = 0;
+            *size = 0;
+            *buffer = 0;
+        }
+        else
+        {
+            v->got_buffer = adios_flag_yes;
+            v->free_data = adios_flag_yes;
+            v->data_size = mem_allowed;
+            v->data = *buffer;
+        }
+    }
+    else
+    {
+        adios_method_buffer_free (mem_allowed);
+        fprintf (stderr, "OVERFLOW: Cannot allocate requested buffer of %llu "
+                         "bytes for %s\n"
+                ,*size
+                ,v->name
+                );
+        *size = 0;
+        *buffer = 0;
+    }
+}
+
+void adios_mpi_lustre_read (struct adios_file_struct * fd
+                    ,struct adios_var_struct * v, void * buffer
+                    ,uint64_t buffer_size
+                    ,struct adios_method_struct * method
+                    )
+{
+    v->data = buffer;
+    v->data_size = buffer_size;
+}
+
+static void adios_mpi_lustre_do_read (struct adios_file_struct * fd
+                              ,struct adios_method_struct * method
+                              )
+{
+    struct adios_MPI_data_struct * md = (struct adios_MPI_data_struct *)
+                                                      method->method_data;
+    struct adios_var_struct * v = fd->group->vars;
+
+    struct adios_parse_buffer_struct data;
+
+    data.vars = v;
+    data.buffer = 0;
+    data.buffer_len = 0;
+
+    switch (md->b.version & ADIOS_VERSION_NUM_MASK)
+    {
+        case 1:
+        {
+            // the three section headers
+            struct adios_process_group_header_struct_v1 pg_header;
+            struct adios_vars_header_struct_v1 vars_header;
+            struct adios_attributes_header_struct_v1 attrs_header;
+
+            struct adios_var_header_struct_v1 var_header;
+            struct adios_var_payload_struct_v1 var_payload;
+            struct adios_attribute_struct_v1 attribute;
+
+            uint64_t i;
+
+            adios_init_buffer_read_process_group (&md->b);
+            MPI_File_seek (md->fh, md->b.read_pg_offset
+                          ,MPI_SEEK_SET
+                          );
+            MPI_File_read (md->fh, md->b.buff, md->b.read_pg_size, MPI_BYTE
+                          ,&md->status
+                          );
+            adios_parse_process_group_header_v1 (&md->b, &pg_header);
+
+            adios_parse_vars_header_v1 (&md->b, &vars_header);
+
+            for (i = 0; i < vars_header.count; i++)
+            {
+                memset (&var_payload, 0
+                       ,sizeof (struct adios_var_payload_struct_v1)
+                       );
+                adios_parse_var_data_header_v1 (&md->b, &var_header);
+
+                struct adios_var_struct * v1 = v;
+                while (v1)
+                {
+                    if (   strcasecmp (var_header.name, v1->name)
+                        || strcasecmp (var_header.path, v1->path)
+                       )
+                    {
+                        v1 = v1->next;
+                    }
+                    else
+                    {
+                        break;
+                    }
+                }
+
+                if (v1)
+                {
+                    var_payload.payload = v1->data;
+                    adios_parse_var_data_payload_v1 (&md->b, &var_header
+                                                    ,&var_payload
+                                                    ,v1->data_size
+                                                    );
+                }
+                else
+                {
+                    printf ("MPI read: skipping name: %s path: %s\n"
+                           ,var_header.name, var_header.path
+                           );
+                    adios_parse_var_data_payload_v1 (&md->b, &var_header
+                                                    ,NULL, 0
+                                                    );
+                }
+
+                adios_clear_var_header_v1 (&var_header);
+            }
+
+#if 1
+            adios_parse_attributes_header_v1 (&md->b, &attrs_header);
+
+            for (i = 0; i < attrs_header.count; i++)
+            {
+                adios_parse_attribute_v1 (&md->b, &attribute);
+                adios_clear_attribute_v1 (&attribute);
+            }
+#endif
+            adios_clear_process_group_header_v1 (&pg_header);
+
+            break;
+        }
+
+        default:
+            fprintf (stderr, "MPI read: file version unknown: %u\n"
+                    ,md->b.version
+                    );
+            return;
+    }
+
+    adios_buffer_struct_clear (&md->b);
+}
+
+void adios_mpi_lustre_close (struct adios_file_struct * fd
+                     ,struct adios_method_struct * method
+                     )
+{
+    struct adios_MPI_data_struct * md = (struct adios_MPI_data_struct *)
+                                                 method->method_data;
+    struct adios_attribute_struct * a = fd->group->attributes;
+
+    struct adios_index_process_group_struct_v1 * new_pg_root = 0;
+    struct adios_index_var_struct_v1 * new_vars_root = 0;
+    struct adios_index_attribute_struct_v1 * new_attrs_root = 0;
+#if COLLECT_METRICS
+    gettimeofday (&t23, NULL);
+    static int iteration = 0;
+#endif
+
+    switch (fd->mode)
+    {
+        case adios_mode_read:
+        {
+            // read the index to find the place to start reading
+            adios_mpi_lustre_do_read (fd, method);
+            struct adios_var_struct * v = fd->group->vars;
+            while (v)
+            {
+                v->data = 0;
+                v = v->next;
+            }
+
+            break;
+        }
+
+        case adios_mode_write:
+        {
+            char * buffer = 0;
+            uint64_t buffer_size = 0;
+            uint64_t buffer_offset = 0;
+            uint64_t index_start = md->b.pg_index_offset;
+
+            if (fd->shared_buffer == adios_flag_no)
+            {
+                MPI_Offset new_off;
+                // set it up so that it will start at 0, but have correct sizes
+                MPI_File_get_position (md->fh, &new_off);
+                fd->offset = fd->base_offset - md->vars_start;
+                fd->vars_start = 0;
+                fd->buffer_size = 0;
+                adios_write_close_vars_v1 (fd);
+                // fd->vars_start gets updated with the size written
+                uint64_t count;
+                int retlen;
+                count = adios_mpi_lustre_striping_unit_write(
+                                  md->fh,
+                                  md->vars_start,
+                                  fd->buffer,
+                                  md->vars_header_size,
+                                  md->block_unit);
+                if (count != md->vars_header_size)
+                {
+                    fprintf (stderr, "d:MPI method tried to write %llu, "
+                                     "only wrote %d\n"
+                            ,md->vars_header_size
+                            ,count
+                            );
+                }
+                fd->offset = 0;
+                fd->bytes_written = 0;
+                adios_shared_buffer_free (&md->b);
+
+                adios_write_open_attributes_v1 (fd);
+                md->vars_start = new_off;
+                md->vars_header_size = fd->offset;
+                MPI_File_seek (md->fh, new_off + md->vars_header_size
+                              ,MPI_SEEK_SET
+                              ); // go back to end, but after attr header
+                fd->base_offset += fd->offset;  // add size of header
+                fd->offset = 0;
+                fd->bytes_written = 0;
+
+                while (a)
+                {
+                    adios_write_attribute_v1 (fd, a);
+                    if (fd->base_offset + fd->bytes_written > fd->pg_start_in_file + fd->write_size_bytes)
+                        fprintf (stderr, "adios_mpi_write exceeds pg bound. File is corrupted. "
+                                         "Need to enlarge group size. \n");
+                    count = adios_mpi_lustre_striping_unit_write(
+                                      md->fh,
+                                      -1,
+                                      fd->buffer,
+                                      fd->bytes_written,
+                                      md->block_unit);
+                    if (count != fd->bytes_written)
+                    {
+                        fprintf (stderr, "e:MPI method tried to write %llu, "
+                                         "only wrote %llu\n"
+                                ,fd->bytes_written
+                                ,count
+                                );
+                    }
+                    fd->base_offset += count;
+                    fd->offset = 0;
+                    fd->bytes_written = 0;
+                    adios_shared_buffer_free (&md->b);
+
+                    a = a->next;
+                }
+
+                // set it up so that it will start at 0, but have correct sizes
+                fd->offset = fd->base_offset - md->vars_start;
+                fd->vars_start = 0;
+                fd->buffer_size = 0;
+                adios_write_close_attributes_v1 (fd);
+                // fd->vars_start gets updated with the size written
+                count = adios_mpi_lustre_striping_unit_write(
+                                  md->fh,
+                                  md->vars_start,
+                                  fd->buffer,
+                                  md->vars_header_size,
+                                  md->block_unit);
+                if (count != md->vars_header_size)
+                {
+                    fprintf (stderr, "f:MPI method tried to write %llu, "
+                                     "only wrote %llu\n"
+                            ,md->vars_header_size
+                            ,count
+                            );
+                }
+                fd->offset = 0;
+                fd->bytes_written = 0;
+            }
+
+#if COLLECT_METRICS
+            gettimeofday (&t19, NULL);
+#endif
+#if COLLECT_METRICS
+            gettimeofday (&t7, NULL);
+#endif
+#if COLLECT_METRICS
+            gettimeofday (&t12, NULL);
+#endif
+            // build index appending to any existing index
+            adios_build_index_v1 (fd, &md->old_pg_root, &md->old_vars_root
+                                 ,&md->old_attrs_root
+                                 );
+            // if collective, gather the indexes from the rest and call
+            if (md->group_comm != MPI_COMM_NULL)
+            {
+                if (md->rank == 0)
+                {
+                    int * index_sizes = malloc (4 * md->size);
+                    int * index_offsets = malloc (4 * md->size);
+                    char * recv_buffer = 0;
+                    uint32_t size = 0;
+                    uint32_t total_size = 0;
+                    int i;
+
+                    MPI_Gather (&size, 1, MPI_INT
+                               ,index_sizes, 1, MPI_INT
+                               ,0, md->group_comm
+                               );
+
+                    for (i = 0; i < md->size; i++)
+                    {
+                        index_offsets [i] = total_size;
+                        total_size += index_sizes [i];
+                    } 
+
+                    recv_buffer = malloc (total_size);
+
+                    MPI_Gatherv (&size, 0, MPI_BYTE
+                                ,recv_buffer, index_sizes, index_offsets
+                                ,MPI_BYTE, 0, md->group_comm
+                                );
+
+                    char * buffer_save = md->b.buff;
+                    uint64_t buffer_size_save = md->b.length;
+                    uint64_t offset_save = md->b.offset;
+
+                    for (i = 1; i < md->size; i++)
+                    {
+                        md->b.buff = recv_buffer + index_offsets [i];
+                        md->b.length = index_sizes [i];
+                        md->b.offset = 0;
+
+                        adios_parse_process_group_index_v1 (&md->b
+                                                           ,&new_pg_root
+                                                           );
+                        adios_parse_vars_index_v1 (&md->b, &new_vars_root);
+                        adios_parse_attributes_index_v1 (&md->b
+                                                        ,&new_attrs_root
+                                                        );
+                        adios_merge_index_v1 (&md->old_pg_root
+                                             ,&md->old_vars_root
+                                             ,&md->old_attrs_root
+                                             ,new_pg_root, new_vars_root
+                                             ,new_attrs_root
+                                             );
+                        new_pg_root = 0;
+                        new_vars_root = 0;
+                        new_attrs_root = 0;
+                    }
+                    md->b.buff = buffer_save;
+                    md->b.length = buffer_size_save;
+                    md->b.offset = offset_save;
+
+                    free (recv_buffer);
+                    free (index_sizes);
+                    free (index_offsets);
+                }
+                else
+                {
+                    adios_write_index_v1 (&buffer, &buffer_size, &buffer_offset
+                                         ,0, md->old_pg_root
+                                         ,md->old_vars_root
+                                         ,md->old_attrs_root
+                                         );
+
+                    MPI_Gather (&buffer_size, 1, MPI_INT, 0, 0, MPI_INT
+                               ,0, md->group_comm
+                               );
+                    MPI_Gatherv (buffer, buffer_size, MPI_BYTE
+                                ,0, 0, 0, MPI_BYTE
+                                ,0, md->group_comm
+                                );
+                }
+            }
+
+#if COLLECT_METRICS
+            gettimeofday (&t13, NULL);
+#endif
+            if (fd->shared_buffer == adios_flag_yes)
+            {
+                // everyone writes their data
+                if (fd->base_offset + fd->bytes_written > fd->pg_start_in_file + fd->write_size_bytes)
+                    fprintf (stderr, "adios_mpi_write exceeds pg bound. File is corrupted. "
+                             "Need to enlarge group size. \n");
+
+                adios_mpi_lustre_striping_unit_write(
+                                  md->fh,
+                                  fd->base_offset,
+                                  fd->buffer,
+                                  fd->bytes_written,
+                                  md->block_unit);
+            }
+
+            if (md->rank == 0)
+            {
+                adios_write_index_v1 (&buffer, &buffer_size, &buffer_offset
+                                     ,index_start, md->old_pg_root
+                                     ,md->old_vars_root
+                                     ,md->old_attrs_root
+                                     );
+                adios_write_version_v1 (&buffer, &buffer_size, &buffer_offset);
+
+                adios_mpi_lustre_striping_unit_write(
+                                  md->fh,
+                                  md->b.pg_index_offset,
+                                  buffer,
+                                  buffer_offset,
+                                  md->block_unit);
+            }
+#if COLLECT_METRICS
+            gettimeofday (&t8, NULL);
+#endif
+#if COLLECT_METRICS
+            gettimeofday (&t20, NULL);
+#endif
+#if COLLECT_METRICS
+            gettimeofday (&t14, NULL);
+#endif
+
+            if (buffer)
+            {
+                free (buffer);
+                buffer = 0;
+                buffer_size = 0;
+                buffer_offset = 0;
+            }
+
+            adios_clear_index_v1 (new_pg_root, new_vars_root, new_attrs_root);
+            adios_clear_index_v1 (md->old_pg_root, md->old_vars_root
+                                 ,md->old_attrs_root
+                                 );
+            new_pg_root = 0;
+            new_vars_root = 0;
+            new_attrs_root = 0;
+            md->old_pg_root = 0;
+            md->old_vars_root = 0;
+            md->old_attrs_root = 0;
+#if COLLECT_METRICS
+            gettimeofday (&t11, NULL);
+            t15.tv_sec = t11.tv_sec;
+            t15.tv_usec = t11.tv_usec;
+#endif
+
+            break;
+        }
+
+        case adios_mode_append:
+        {
+            char * buffer = 0;
+            uint64_t buffer_size = 0;
+            uint64_t buffer_offset = 0;
+            uint64_t index_start = md->b.pg_index_offset;
+
+            if (fd->shared_buffer == adios_flag_no)
+            {
+                MPI_Offset new_off;
+                // set it up so that it will start at 0, but have correct sizes
+                MPI_File_get_position (md->fh, &new_off);
+                fd->offset = fd->base_offset - md->vars_start;
+                fd->vars_start = 0;
+                fd->buffer_size = 0;
+                adios_write_close_vars_v1 (fd);
+                // fd->vars_start gets updated with the size written
+                uint64_t count;
+                count = adios_mpi_lustre_striping_unit_write(
+                                  md->fh,
+                                  md->vars_start,
+                                  fd->buffer,
+                                  md->vars_header_size,
+                                  md->block_unit);
+                if (count != md->vars_header_size)
+                {
+                    fprintf (stderr, "d:MPI method tried to write %llu, "
+                                     "only wrote %llu\n"
+                            ,md->vars_header_size
+                            ,count
+                            );
+                }
+                fd->offset = 0;
+                fd->bytes_written = 0;
+                adios_shared_buffer_free (&md->b);
+
+                adios_write_open_attributes_v1 (fd);
+                md->vars_start = new_off;
+                md->vars_header_size = fd->offset;
+                MPI_File_seek (md->fh, new_off + md->vars_header_size
+                              ,MPI_SEEK_SET
+                              ); // go back to end, but after attr header
+                fd->base_offset += fd->offset;  // add size of header
+                fd->offset = 0;
+                fd->bytes_written = 0;
+
+                while (a)
+                {
+                    adios_write_attribute_v1 (fd, a);
+                    count = adios_mpi_lustre_striping_unit_write(
+                                  md->fh,
+                                  -1,
+                                  fd->buffer,
+                                  fd->bytes_written,
+                                  md->block_unit);
+                    if (count != fd->bytes_written)
+                    {
+                        fprintf (stderr, "e:MPI method tried to write %llu, "
+                                         "only wrote %llu\n"
+                                ,fd->bytes_written
+                                ,count
+                                );
+                    }
+                    fd->base_offset += count;
+                    fd->offset = 0;
+                    fd->bytes_written = 0;
+                    adios_shared_buffer_free (&md->b);
+
+                    a = a->next;
+                }
+
+                // set it up so that it will start at 0, but have correct sizes
+                fd->offset = fd->base_offset - md->vars_start;
+                fd->vars_start = 0;
+                fd->buffer_size = 0;
+                adios_write_close_attributes_v1 (fd);
+                // fd->vars_start gets updated with the size written
+                count = adios_mpi_lustre_striping_unit_write(
+                                  md->fh,
+                                  md->vars_start,
+                                  fd->buffer,
+                                  md->vars_header_size,
+                                  md->block_unit);
+                if (count != md->vars_header_size)
+                {
+                    fprintf (stderr, "f:MPI method tried to write %llu, "
+                                     "only wrote %llu\n"
+                            ,md->vars_header_size
+                            ,count
+                            );
+                }
+                fd->offset = 0;
+                fd->bytes_written = 0;
+            }
+
+            // build index appending to any existing index
+            adios_build_index_v1 (fd, &md->old_pg_root, &md->old_vars_root
+                                 ,&md->old_attrs_root
+                                 );
+            // if collective, gather the indexes from the rest and call
+            if (md->group_comm != MPI_COMM_NULL)
+            {
+                if (md->rank == 0)
+                {
+                    int * index_sizes = malloc (4 * md->size);
+                    int * index_offsets = malloc (4 * md->size);
+                    char * recv_buffer = 0;
+                    uint32_t size = 0;
+                    uint32_t total_size = 0;
+                    int i;
+
+                    MPI_Gather (&size, 1, MPI_INT
+                               ,index_sizes, 1, MPI_INT
+                               ,0, md->group_comm
+                               );
+
+                    for (i = 0; i < md->size; i++)
+                    {
+                        index_offsets [i] = total_size;
+                        total_size += index_sizes [i];
+                    }
+
+                    recv_buffer = malloc (total_size);
+
+                    MPI_Gatherv (&size, 0, MPI_BYTE
+                                ,recv_buffer, index_sizes, index_offsets
+                                ,MPI_BYTE, 0, md->group_comm
+                                );
+
+                    char * buffer_save = md->b.buff;
+                    uint64_t buffer_size_save = md->b.length;
+                    uint64_t offset_save = md->b.offset;
+
+                    for (i = 1; i < md->size; i++)
+                    {
+                        md->b.buff = recv_buffer + index_offsets [i];
+                        md->b.length = index_sizes [i];
+                        md->b.offset = 0;
+
+                        adios_parse_process_group_index_v1 (&md->b
+                                                           ,&new_pg_root
+                                                           );
+                        adios_parse_vars_index_v1 (&md->b, &new_vars_root);
+                        adios_parse_attributes_index_v1 (&md->b
+                                                        ,&new_attrs_root
+                                                        );
+                        adios_merge_index_v1 (&md->old_pg_root
+                                             ,&md->old_vars_root
+                                             ,&md->old_attrs_root
+                                             ,new_pg_root, new_vars_root
+                                             ,new_attrs_root
+                                             );
+                        new_pg_root = 0;
+                        new_vars_root = 0;
+                        new_attrs_root = 0;
+                    }
+                    md->b.buff = buffer_save;
+                    md->b.length = buffer_size_save;
+                    md->b.offset = offset_save;
+
+                    free (recv_buffer);
+                    free (index_sizes);
+                    free (index_offsets);
+                }
+                else
+                {
+                    adios_write_index_v1 (&buffer, &buffer_size, &buffer_offset
+                                         ,0, md->old_pg_root
+                                         ,md->old_vars_root
+                                         ,md->old_attrs_root
+                                         );
+
+                    MPI_Gather (&buffer_size, 1, MPI_INT, 0, 0, MPI_INT
+                               ,0, md->group_comm
+                               );
+                    MPI_Gatherv (buffer, buffer_size, MPI_BYTE
+                                ,0, 0, 0, MPI_BYTE
+                                ,0, md->group_comm
+                                );
+                }
+            }
+
+            if (fd->shared_buffer == adios_flag_yes)
+            {
+                // everyone writes their data
+                adios_mpi_lustre_striping_unit_write(
+                                  md->fh,
+                                  fd->base_offset,
+                                  fd->buffer,
+                                  fd->bytes_written,
+                                  md->block_unit);
+            }
+
+            if (md->rank == 0)
+            {
+                adios_write_index_v1 (&buffer, &buffer_size, &buffer_offset
+                                     ,index_start, md->old_pg_root
+                                     ,md->old_vars_root
+                                     ,md->old_attrs_root
+                                     );
+                adios_write_version_v1 (&buffer, &buffer_size, &buffer_offset);
+
+                adios_mpi_lustre_striping_unit_write(
+                                  md->fh,
+                                  md->b.pg_index_offset,
+                                  buffer,
+                                  buffer_offset,
+                                  md->block_unit);
+            }
+
+            free (buffer);
+
+            adios_clear_index_v1 (new_pg_root, new_vars_root, new_attrs_root);
+            adios_clear_index_v1 (md->old_pg_root, md->old_vars_root
+                                 ,md->old_attrs_root
+                                 );
+            new_pg_root = 0;
+            new_vars_root = 0;
+            new_attrs_root = 0;
+            md->old_pg_root = 0;
+            md->old_vars_root = 0;
+            md->old_attrs_root = 0;
+
+            break;
+        }
+
+        default:
+        {
+            fprintf (stderr, "Unknown file mode: %d\n", fd->mode);
+        }
+    }
+
+    if (md && md->fh)
+        MPI_File_close (&md->fh);
+
+    if (   md->group_comm != MPI_COMM_WORLD
+        && md->group_comm != MPI_COMM_SELF
+        && md->group_comm != MPI_COMM_NULL
+       )
+    {
+        md->group_comm = MPI_COMM_NULL;
+    }
+
+    md->fh = 0;
+    md->req = 0;
+    memset (&md->status, 0, sizeof (MPI_Status));
+    md->group_comm = MPI_COMM_NULL;
+
+    adios_clear_index_v1 (md->old_pg_root, md->old_vars_root
+                         ,md->old_attrs_root
+                         );
+    md->old_pg_root = 0;
+    md->old_vars_root = 0;
+    md->old_attrs_root = 0;
+#if COLLECT_METRICS
+    print_metrics (md, iteration++);
+#endif
+}
+
+void adios_mpi_lustre_finalize (int mype, struct adios_method_struct * method)
+{
+// nothing to do here
+    if (adios_mpi_lustre_initialized)
+        adios_mpi_lustre_initialized = 0;
+}
+
+void adios_mpi_lustre_end_iteration (struct adios_method_struct * method)
+{
+}
+
+void adios_mpi_lustre_start_calculation (struct adios_method_struct * method)
+{
+}
+
+void adios_mpi_lustre_stop_calculation (struct adios_method_struct * method)
+{
+}
diff --git a/src/adios_nc4.c b/src/adios_nc4.c
new file mode 100644
index 0000000..ec248e2
--- /dev/null
+++ b/src/adios_nc4.c
@@ -0,0 +1,1796 @@
+/*
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "mpi.h"
+#include "adios.h"
+#include "adios_types.h"
+#include "adios_bp_v1.h"
+#include "adios_transport_hooks.h"
+#include "adios_internals.h"
+#include "netcdf.h"
+
+#include "io_timer.h"
+
+
+#ifndef FALSE
+#      define  FALSE   (0)
+#endif
+#ifndef TRUE
+#      define  TRUE    (1)
+#endif
+#ifndef NULL
+#      define  NULL 0
+#endif
+
+
+typedef char nc4_dimname_t[256];
+
+#define NUM_GP 24
+void adios_nc4_end_iteration(
+        struct adios_method_struct * method)
+{
+}
+void adios_nc4_start_calculation(
+        struct adios_method_struct * method)
+{
+}
+void adios_nc4_stop_calculation(
+        struct adios_method_struct * method)
+{
+}
+void adios_nc4_get_write_buffer(
+        struct adios_file_struct *fd,
+        struct adios_var_struct *v,
+        uint64_t *size,
+        void **buffer,
+        struct adios_method_struct *method)
+{
+}
+
+typedef struct {
+    struct adios_dimension_struct *dims;
+
+    nc4_dimname_t  gbdims_dim0_name;
+    nc4_dimname_t  gbdims_dim1_name;
+    nc4_dimname_t  gbdims_name;
+    nc4_dimname_t *nc4_global_dimnames;
+    nc4_dimname_t *nc4_local_dimnames;
+    nc4_dimname_t *nc4_local_offset_names;
+
+    size_t    *nc4_gbdims;
+    size_t    *nc4_globaldims;
+    size_t    *nc4_localdims;
+    size_t    *nc4_offsets;
+    ptrdiff_t *nc4_strides;
+    int       *nc4_global_dimids;
+    int       *nc4_local_dimids;
+    int       *nc4_loffs_dimids;
+
+    ptrdiff_t nc4_gbstrides[2];
+    size_t    nc4_gbglobaldims[2];
+    size_t    nc4_gblocaldims[2];
+    size_t    nc4_gboffsets[2];
+    int       nc4_gbglobaldims_dimids[2];
+    int       nc4_gbglobaldims_varid;
+
+    enum ADIOS_FLAG has_globaldims;
+    enum ADIOS_FLAG has_localdims;
+    enum ADIOS_FLAG has_localoffsets;
+
+    enum ADIOS_FLAG has_timedim;
+    int             timedim_index;
+
+    int global_dim_count;
+    int local_dim_count;
+    int local_offset_count;
+} deciphered_dims_t;
+struct adios_nc4_data_struct
+{
+    int      fd;
+    int      ncid;
+    int      root_ncid;
+    MPI_Comm group_comm;
+    int      rank;
+    int      size;
+
+    void * comm; // temporary until moved from should_buffer to open
+};
+
+#define NC4_PATH_MAX 1024
+/* Need a struct to encapsulate open file info
+ */
+struct open_file {
+    char                           fpath[NC4_PATH_MAX];
+    char                           fname[NC4_PATH_MAX];
+    struct adios_nc4_data_struct *md;
+    struct adios_file_struct      *f;
+};
+
+/* list of variable offsets */
+static List open_file_list;
+
+
+static int global_rank=-1;
+static int DEBUG=0;
+
+
+
+///////////////////////////
+// Function Declarations
+///////////////////////////
+int getTypeSize(
+        enum ADIOS_DATATYPES type,
+        void *val);
+
+// adios_flag determine whether it is dataset or group
+
+int ncd_gen_name(
+        char *fullname,
+        char *path,
+        char *name);
+int getNC4TypeId(
+        enum ADIOS_DATATYPES type,
+        int *nc4_type_id,
+        enum ADIOS_FLAG fortran_flag);
+
+
+
+
+static struct open_file *open_file_create(
+        const char *path,
+        const char *name,
+        struct adios_nc4_data_struct *method_private_data,
+        struct adios_file_struct *f)
+{
+    struct open_file *of=calloc(1,sizeof(struct open_file));
+
+    strcpy(of->fpath, path);
+    strcpy(of->fname, name);
+    of->md = method_private_data;
+    of->f = f;
+
+
+    return(of);
+}
+static void open_file_free(void *of)
+{
+    free(of);
+}
+static int open_file_equal(const struct open_file *of1, const struct open_file *of2)
+{
+    if ((strcmp(of1->fpath, of2->fpath) == 0) && (strcmp(of1->fname, of2->fname) == 0)) return TRUE;
+
+    return FALSE;
+}
+static struct open_file *open_file_find(const char *path, const char *name)
+{
+    ListElmt *elmt;
+    struct open_file *of;
+
+    if (DEBUG>3) printf("looking for fpath(%s) fname(%s)\n", path, name);
+
+    elmt = list_head(&open_file_list);
+    while(elmt) {
+        of = list_data(elmt);
+        if (DEBUG>3) printf("comparing to fpath(%s) fname(%s)\n", of->fpath, of->fname);
+        if ((strcmp(path, of->fpath) == 0) && (strcmp(name, of->fname) == 0)) {
+            if (DEBUG>3) printf("fpath(%s) fname(%s) ncid(%d) matches search\n", of->fpath, of->fname, of->md->ncid);
+            return of;
+        }
+        elmt = list_next(elmt);
+    }
+
+    return NULL;
+}
+static struct open_file *open_file_delete(const char *path, const char *name)
+{
+    ListElmt *elmt, *prev;
+    struct open_file *of;
+
+    if (DEBUG>3) printf("trying to delete fpath(%s) fname(%s)\n", path, name);
+
+    prev = elmt = list_head(&open_file_list);
+    while(elmt) {
+        of = list_data(elmt);
+        if (DEBUG>3) printf("comparing to fpath(%s) fname(%s)\n", of->fpath, of->fname);
+        if ((strcmp(path, of->fpath) == 0) && (strcmp(name, of->fname) == 0)) {
+            if (DEBUG>3) printf("fpath(%s) fname(%s) matches search\n", of->fpath, of->fname);
+            if (list_is_head(&open_file_list, elmt)) {
+                list_rem_next(&open_file_list, NULL, &of);
+            } else {
+                list_rem_next(&open_file_list, prev, &of);
+            }
+        }
+        prev = elmt;
+        elmt = list_next(elmt);
+    }
+
+    return NULL;
+}
+static void open_file_printall(void)
+{
+    ListElmt *elmt;
+    struct open_file *of;
+
+    elmt = list_head(&open_file_list);
+    while(elmt) {
+        of = list_data(elmt);
+        if (DEBUG>3) printf("fpath(%s) fname(%s) ncid(%d)\n", of->fpath, of->fname, of->md->ncid);
+        elmt = list_next(elmt);
+    }
+}
+
+
+
+
+
+static void parse_dimension_size(
+        struct adios_group_struct *group,
+        struct adios_var_struct *pvar_root,
+        struct adios_attribute_struct *patt_root,
+        struct adios_dimension_item_struct *dim,
+        size_t *dimsize)
+{
+    struct adios_var_struct *var_linked = NULL;
+    struct adios_attribute_struct *attr_linked;
+    if (dim->id) {
+        var_linked = adios_find_var_by_id (pvar_root , dim->id);
+        if (!var_linked) {
+            attr_linked = adios_find_attribute_by_id (patt_root, dim->id);
+            if (!attr_linked->var) {
+                switch (attr_linked->type) {
+                case adios_unsigned_byte:
+                    *dimsize = *(uint8_t *)attr_linked->value;
+                    break;
+                case adios_byte:
+                    *dimsize = *(int8_t *)attr_linked->value;
+                    break;
+                case adios_unsigned_short:
+                    *dimsize = *(uint16_t *)attr_linked->value;
+                    break;
+                case adios_short:
+                    *dimsize = *(int16_t *)attr_linked->value;
+                    break;
+                case adios_unsigned_integer:
+                    *dimsize = *(uint32_t *)attr_linked->value;
+                    break;
+                case adios_integer:
+                    *dimsize = *(int32_t *)attr_linked->value;
+                    break;
+                case adios_unsigned_long:
+                    *dimsize = *(uint64_t *)attr_linked->value;
+                    break;
+                case adios_long:
+                    *dimsize = *(int64_t *)attr_linked->value;
+                    break;
+                default:
+                    fprintf (stderr, "Invalid datatype for array dimension on "
+                            "var %s: %s\n"
+                            ,attr_linked->name
+                            ,adios_type_to_string_int (var_linked->type)
+                    );
+                    break;
+                }
+            } else {
+                var_linked = attr_linked->var;
+            }
+        }
+        if (var_linked && var_linked->data) {
+            *dimsize = *(int *)var_linked->data;
+        }
+    } else {
+        if (dim->time_index == adios_flag_yes) {
+            *dimsize = NC_UNLIMITED;
+            *dimsize = 1;
+        } else {
+            *dimsize = dim->rank;
+        }
+    }
+
+    return;
+}
+static void parse_dimension_name(
+        struct adios_group_struct *group,
+        struct adios_var_struct *pvar_root,
+        struct adios_attribute_struct *patt_root,
+        struct adios_dimension_item_struct *dim,
+        nc4_dimname_t dimname)
+{
+    struct adios_var_struct *var_linked = NULL;
+    struct adios_attribute_struct *attr_linked;
+    if (dim->id) {
+        var_linked = adios_find_var_by_id (pvar_root , dim->id);
+        if (!var_linked) {
+            attr_linked = adios_find_attribute_by_id (patt_root, dim->id);
+            if (!attr_linked->var) {
+//				strcpy(dimname, attr_linked->name);
+                sprintf(dimname, "%s_dim", attr_linked->name);
+            } else {
+                var_linked = attr_linked->var;
+            }
+        }
+        if (var_linked && var_linked->name) {
+//			strcpy(dimname, var_linked->name);
+            sprintf(dimname, "%s_dim", var_linked->name);
+        }
+    } else {
+        if (dim->time_index == adios_flag_yes) {
+//			strcpy(dimname, group->time_index_name);
+            sprintf(dimname, "%s_dim", group->time_index_name);
+        } else {
+            dimname[0] = '\0';
+        }
+    }
+
+    return;
+}
+
+static int write_attribute(
+        int ncid,
+        int root_group,
+        struct adios_var_struct *pvar_root,
+        struct adios_attribute_struct *patt,
+        enum ADIOS_FLAG fortran_flag,
+        int myrank,
+        int nproc)
+{
+    int i, rank = 0;
+    int rc;
+
+    int nc4_type_id;
+    int varid;
+    int attid;
+
+    char attname[255];
+    char varname[255];
+
+    struct adios_dimension_struct * dims;
+    struct adios_var_struct * var_linked;
+
+    int err_code = 0;
+
+
+    ncd_gen_name(attname, patt->path, patt->name);
+    varid = -1;
+    if (strcmp(patt->path,"/")==0) {
+        varid = NC_GLOBAL;
+        strcpy(attname, patt->name);
+    } else {
+        ncd_gen_name(varname, patt->path, "");
+        rc = nc_inq_varid(ncid, varname, &varid);
+        if (rc == NC_NOERR) {
+//    		if (myrank==0) fprintf (stderr, "NC4 ERROR variable(%s) exists in write_attribute, rc=%d\n", varname, rc);
+        } else if (rc == NC_ENOTVAR) {
+            if (myrank==0) fprintf (stderr, "NC4 ERROR variable(%s) does not exist in write_attribute, rc=%d\n", varname, rc);
+            err_code = -2;
+            goto escape;
+        } else {
+            if (myrank==0) fprintf (stderr, "NC4 ERROR inquiring about variable(%s) in write_attribute, rc=%d\n", varname, rc);
+            err_code = -2;
+            goto escape;
+        }
+    }
+
+//	printf("looking for var(%s)\n", last);
+//	printf("got varid(%d) for grp_id(%d).variable(%s) in write_attribute\n", varid, ncid, last);
+    rc = nc_inq_attid(ncid, varid, attname, &attid);
+    if (rc == NC_NOERR) {
+        if (myrank==0) fprintf (stderr, "NC4 ERROR attribute(%s) already exists in write_attribute, rc=%d\n", attname, rc);
+        err_code = 0;
+        goto escape;
+    } else if (rc == NC_ENOTATT) {
+//		if (myrank==0) fprintf (stderr, "NC4 ERROR attribute(%s) does not exist in write_attribute, rc=%d\n", attname, rc);
+    } else {
+        if (myrank==0) fprintf (stderr, "NC4 ERROR inquiring about attribute(%s) in write_attribute, rc=%d\n", attname, rc);
+        err_code = -2;
+        goto escape;
+    }
+
+//	printf("patt->type=%d attname : %s\n", patt->type, attname);
+    if (patt->type == -1) {
+        var_linked = patt->var;
+        if (!var_linked || (var_linked && !var_linked->data)) {
+            fprintf (stderr, "NC4 ERROR: invalid data in var_linked(%s(%d)) (in attribute write), rc=%d\n"
+                    ,var_linked->name, var_linked->id, rc);
+            err_code = -2;
+            goto escape;
+        } else {
+            dims = var_linked->dimensions;
+        }
+        getNC4TypeId(var_linked->type, &nc4_type_id, fortran_flag);
+        // Scalar variable as attribute
+        if (!dims) {
+            rc = nc_put_att(ncid, varid, attname, nc4_type_id, 1, var_linked->data);
+            if (rc != NC_NOERR) {
+                fprintf (stderr, "NC4 ERROR unable to put attribute(%s) in write_attribute, rc=%d\n", attname, rc);
+                err_code = -2;
+                goto escape;
+            }
+        } else {
+            fprintf (stderr, "NC4 ERROR multi-dimensional attribute(%s) unsupported for variable(%s) in write_attribute, rc=%d\n", attname, pvar_root->name, rc);
+            err_code = -2;
+            goto escape;
+            //             while (dims) {
+            //                ++rank;
+            //                dims = dims->next;
+            //             }
+            //
+            //             h5_localdims = (hsize_t *) malloc (rank * sizeof(hsize_t));
+            //             dims = var_linked->dimensions;
+            //             for ( i = 0; i < rank; i++) {
+            //                 if ( dims->dimension.rank == 0 && dims->dimension.id) {
+            //                     var_linked = adios_find_var_by_id (pvar_root , dims->dimension.id);
+            //                     if ( var_linked) {
+            //                         h5_localdims [i] = *(int *)var_linked->data;
+            //                     }
+            //                 } else {
+            //                     h5_localdims [i] = dims->dimension.rank;
+            //                 }
+            //             }
+            //             h5_dataspace_id = H5Screate_simple(rank,h5_localdims, NULL);
+            //             h5_attribute_id = H5Aopen_name ( ncid, attname);
+            //             if (h5_attribute_id < 0) {
+            //                 h5_attribute_id = H5Acreate ( ncid, attname
+            //                                          ,h5_type_id,h5_dataspace_id,0);
+            //                 if (h5_attribute_id < 0) {
+            //                     fprintf (stderr, "NC4 ERROR: getting negative attribute_id "
+            //                                      "in write_attribute: %s\n", attname);
+            //                     err_code = -2;
+            //                  }
+            //             }
+            //             if (h5_attribute_id > 0) {
+            //                 if (myrank == 0 && var_linked->data) {
+            //                     H5Awrite ( h5_attribute_id, h5_type_id, var_linked->data);
+            //                 }
+            //                 H5Aclose ( h5_attribute_id);
+            //             }
+            //             H5Sclose ( h5_dataspace_id);
+            //             free (h5_localdims);
+        }
+    }
+    if (patt->type > 0) {
+        getNC4TypeId(patt->type, &nc4_type_id, fortran_flag);
+        if (nc4_type_id > 0) {
+            if (patt->type == adios_string) {
+                rc = nc_put_att_text(ncid, varid, attname, strlen((char *)patt->value), (const char *)patt->value);
+                if (rc != NC_NOERR) {
+                    fprintf (stderr, "NC4 ERROR unable to put attribute(%s) in write_attribute, rc=%d\n", attname, rc);
+                    err_code = -2;
+                    goto escape;
+                }
+            } else {
+                rc = nc_put_att(ncid, varid, attname, nc4_type_id, 1, patt->value);
+                if (rc != NC_NOERR) {
+                    fprintf (stderr, "NC4 ERROR unable to put attribute(%s) in write_attribute, rc=%d\n", attname, rc);
+                    err_code = -2;
+                    goto escape;
+                }
+            }
+        }
+    }
+escape:
+    return err_code;
+}
+
+static int decipher_dims(
+        int ncid,
+        int root_group,
+        struct adios_group_struct *group,
+        struct adios_var_struct *pvar_root,
+        struct adios_attribute_struct *patt_root,
+        struct adios_var_struct *pvar,
+        int myrank,
+        int nproc,
+        deciphered_dims_t *deciphered_dims)
+{
+    int i=0;
+
+    struct adios_dimension_struct *dims;
+    nc4_dimname_t *nc4_global_dimnames=NULL;
+    nc4_dimname_t *nc4_local_dimnames=NULL;
+    nc4_dimname_t *nc4_local_offset_names=NULL;
+    size_t    *nc4_gbdims;
+    size_t    *nc4_globaldims;
+    size_t    *nc4_localdims;
+    size_t    *nc4_offsets;
+    ptrdiff_t *nc4_strides;
+    int       *nc4_global_dimids;
+    int       *nc4_local_dimids;
+    int       *nc4_loffs_dimids;
+
+    int nc4_gbglobaldims_dimids[2];
+    int nc4_gbglobaldims_varid;
+
+    enum ADIOS_FLAG has_globaldims=adios_flag_no;
+    enum ADIOS_FLAG has_localdims=adios_flag_no;
+    enum ADIOS_FLAG has_localoffsets=adios_flag_no;
+
+    enum ADIOS_FLAG has_timedim=adios_flag_no;
+    int             timedim_index=-1;
+
+    int global_dim_count=0;
+    int local_dim_count=0;
+    int local_offset_count=0;
+
+    char dimname[255];
+
+    memset(deciphered_dims, 0, sizeof(deciphered_dims_t));
+
+    dims=pvar->dimensions;
+    while (dims) {
+        if ((dims->dimension.time_index == adios_flag_yes) &&
+            (dims->dimension.id == 0)) {
+            has_timedim = adios_flag_yes;
+            timedim_index = local_dim_count;
+            local_dim_count++;
+        } else if ((dims->dimension.rank != 0) ||
+            (dims->dimension.rank == 0) && (dims->dimension.id != 0)) {
+            has_localdims=adios_flag_yes;
+            local_dim_count++;
+        }
+        if ((dims->global_dimension.rank != 0) ||
+            (dims->global_dimension.rank == 0) && (dims->global_dimension.id != 0)) {
+            has_globaldims=adios_flag_yes;
+            global_dim_count++;
+        }
+        if ((dims->local_offset.rank != 0) ||
+            (dims->local_offset.rank == 0) && (dims->local_offset.id != 0)) {
+            has_localoffsets=adios_flag_yes;
+            local_offset_count++;
+        }
+        if (DEBUG>3) printf("gdims[%d].rank=%llu; id=%d, time_index=%d\n", i, dims->global_dimension.rank, dims->global_dimension.id, dims->global_dimension.time_index);
+        if (DEBUG>3) printf("ldims[%d].rank=%llu; id=%d, time_index=%d\n", i, dims->dimension.rank, dims->dimension.id, dims->dimension.time_index);
+        if (DEBUG>3) printf("loffs[%d].rank=%llu; id=%d, time_index=%d\n", i, dims->local_offset.rank, dims->local_offset.id, dims->local_offset.time_index);
+        i++;
+        dims = dims->next;
+    }
+
+    if (DEBUG>3) printf("global_dim_count  ==%d\n", global_dim_count);
+    if (DEBUG>3) printf("local_dim_count   ==%d\n", local_dim_count);
+    if (DEBUG>3) printf("calculated local_offset_count==%d\n", local_offset_count);
+    if ((has_localoffsets == adios_flag_yes) && (local_offset_count < global_dim_count)) {
+        if (DEBUG>3) printf("assuming local_offset_count should equal global_dim_count.  FORCING EQUALITY\n");
+        local_offset_count = global_dim_count;
+    }
+
+    nc4_gbdims     = (size_t *)calloc(local_dim_count * 3, sizeof(size_t));
+    nc4_globaldims = nc4_gbdims;
+    nc4_localdims  = nc4_gbdims + local_dim_count;
+    nc4_offsets    = nc4_gbdims + (2*local_dim_count);
+    nc4_strides    = (ptrdiff_t *)calloc(local_dim_count, sizeof(ptrdiff_t));
+    nc4_global_dimnames      = (nc4_dimname_t *)calloc(local_dim_count, sizeof(nc4_dimname_t));
+    nc4_local_dimnames       = (nc4_dimname_t *)calloc(local_dim_count, sizeof(nc4_dimname_t));
+    nc4_local_offset_names   = (nc4_dimname_t *)calloc(local_dim_count, sizeof(nc4_dimname_t));
+    nc4_global_dimids     = (int *)calloc(global_dim_count, sizeof(int));
+    nc4_local_dimids      = (int *)calloc(local_dim_count, sizeof(int));
+    nc4_loffs_dimids      = (int *)calloc(local_offset_count, sizeof(int));
+
+    dims = pvar->dimensions;
+    for (i=0;i<global_dim_count;i++) {
+        parse_dimension_name(group, pvar_root, patt_root, &dims->global_dimension, dimname);
+        ncd_gen_name(nc4_global_dimnames[i], pvar->path, dimname);
+        if (DEBUG>3) printf("global_dimension[%d]->name==%s, ->rank==%llu, ->id==%d, time_index==%d\n",
+                i, nc4_global_dimnames[i], dims->global_dimension.rank, dims->global_dimension.id, dims->global_dimension.time_index);
+        if (dims) {
+            dims = dims -> next;
+        }
+    }
+    dims = pvar->dimensions;
+    for (i=0;i<local_dim_count;i++) {
+        parse_dimension_name(group, pvar_root, patt_root, &dims->dimension, dimname);
+        ncd_gen_name(nc4_local_dimnames[i], pvar->path, dimname);
+        if (DEBUG>3) printf("local_dimension[%d]->name ==%s, ->rank==%llu, ->id==%d, time_index==%d\n",
+                i, nc4_local_dimnames[i], dims->dimension.rank, dims->dimension.id, dims->dimension.time_index);
+        if (dims) {
+            dims = dims -> next;
+        }
+    }
+    dims = pvar->dimensions;
+    for (i=0;i<local_offset_count;i++) {
+        parse_dimension_name(group, pvar_root, patt_root, &dims->local_offset, dimname);
+        ncd_gen_name(nc4_local_offset_names[i], pvar->path, dimname);
+        if (DEBUG>3) printf("local_offset[%d]->name    ==%s, ->rank==%llu, ->id==%d, time_index==%d\n",
+                i, nc4_local_offset_names[i], dims->local_offset.rank, dims->local_offset.id, dims->local_offset.time_index);
+        if (dims) {
+            dims = dims -> next;
+        }
+    }
+    int global_idx=0;
+    int local_idx =0;
+    int loffs_idx =0;
+    dims = pvar->dimensions;
+    if (myrank==0) if (DEBUG>3) printf("timedim_index=%d\n", timedim_index);
+    while (dims) {
+        /* get the global/local/offset arrays */
+        nc4_strides[local_idx] = 1;
+        if (timedim_index == local_idx) {
+            nc4_globaldims[global_idx] = NC_UNLIMITED;
+            nc4_localdims[local_idx] = 1;
+            nc4_offsets[loffs_idx] = 0;
+            parse_dimension_name(group, pvar_root, patt_root, &dims->dimension, dimname);
+            ncd_gen_name(nc4_global_dimnames[global_idx], pvar->path, dimname);
+            strcpy(nc4_local_dimnames[local_idx], nc4_global_dimnames[global_idx]);
+            strcpy(nc4_local_offset_names[loffs_idx], nc4_global_dimnames[global_idx]);
+            if ((global_dim_count < local_dim_count) && (local_idx < local_dim_count)) {
+                global_idx++;
+                loffs_idx++;
+            }
+        } else {
+            parse_dimension_name(group, pvar_root, patt_root, &dims->dimension, dimname);
+            if (dimname[0] == '\0') {
+                sprintf(dimname, "local_%d", local_idx);
+            }
+            ncd_gen_name(nc4_local_dimnames[local_idx], pvar->path, dimname);
+            parse_dimension_size(group, pvar_root, patt_root, &dims->dimension, &nc4_localdims[local_idx]);
+        }
+        if (myrank==0) {
+            if (DEBUG>3) printf("\t%s[%d]: l(%d)", pvar->name, local_idx, nc4_localdims[local_idx]);
+        }
+        local_idx++;
+        if (global_idx < local_dim_count) {
+            parse_dimension_name(group, pvar_root, patt_root, &dims->global_dimension, dimname);
+            if (dimname[0] == '\0') {
+                sprintf(dimname, "global_%d", global_idx);
+            }
+            ncd_gen_name(nc4_global_dimnames[global_idx], pvar->path, dimname);
+            parse_dimension_size(group, pvar_root, patt_root, &dims->global_dimension, &nc4_globaldims[global_idx]);
+            if (myrank==0) {
+                if (DEBUG>3) printf(":g(%d)", nc4_globaldims[global_idx]);
+            }
+            global_idx++;
+        }
+        if (loffs_idx < local_dim_count) {
+            parse_dimension_name(group, pvar_root, patt_root, &dims->local_offset, dimname);
+            if (dimname[0] == '\0') {
+                sprintf(dimname, "offset_%d", loffs_idx);
+            }
+            ncd_gen_name(nc4_local_offset_names[loffs_idx], pvar->path, dimname);
+            parse_dimension_size(group, pvar_root, patt_root, &dims->local_offset, &nc4_offsets[loffs_idx]);
+            if (myrank==0) {
+                if (DEBUG>3) printf(":o(%d)", nc4_offsets[loffs_idx]);
+            }
+            loffs_idx++;
+        }
+        if (myrank==0) {
+            if (DEBUG>3) printf("\n");
+        }
+
+        if (dims) {
+            dims = dims -> next;
+        }
+    }
+    for (i=0;i<local_dim_count;i++) {
+        if (DEBUG>3) printf("nc4_global_dimnames[%d]   ==%s, nc4_globaldims[%d]==%d\n", i, nc4_global_dimnames[i], i, nc4_globaldims[i]);
+        if (DEBUG>3) printf("nc4_local_dimnames[%d]    ==%s, nc4_localdims[%d] ==%d\n", i, nc4_local_dimnames[i], i, nc4_localdims[i]);
+        if (DEBUG>3) printf("nc4_local_offset_names[%d]==%s, nc4_offsets[%d]   ==%d\n", i, nc4_local_offset_names[i], i, nc4_offsets[i]);
+    }
+
+    if ((has_timedim == adios_flag_yes) && (global_dim_count < local_dim_count)) {
+        global_dim_count++;
+        local_offset_count++;
+    }
+
+    deciphered_dims->nc4_gbstrides[0]    = 1;
+    deciphered_dims->nc4_gbstrides[1]    = 1;
+    deciphered_dims->nc4_gbglobaldims[0] = nproc;
+    deciphered_dims->nc4_gbglobaldims[1] = local_dim_count * 3;
+    deciphered_dims->nc4_gboffsets[0]    = myrank;
+    deciphered_dims->nc4_gboffsets[1]    = 0;
+    deciphered_dims->nc4_gblocaldims[0]  = 1;
+    deciphered_dims->nc4_gblocaldims[1]  = local_dim_count * 3;
+
+    ncd_gen_name(dimname, pvar->path, pvar->name);
+    sprintf(deciphered_dims->gbdims_name, "_%s_gbdims", dimname);
+    sprintf(deciphered_dims->gbdims_dim0_name, "_%s_gbdims_dim0", dimname);
+    sprintf(deciphered_dims->gbdims_dim1_name, "_%s_gbdims_dim1", dimname);
+
+
+    /*
+     * Copy local scalers and pointers into deciphered_dims
+     */
+    deciphered_dims->dims=pvar->dimensions;
+    deciphered_dims->nc4_global_dimnames=nc4_global_dimnames;
+    deciphered_dims->nc4_local_dimnames=nc4_local_dimnames;
+    deciphered_dims->nc4_local_offset_names=nc4_local_offset_names;
+
+    deciphered_dims->nc4_gbdims    =nc4_gbdims;
+    deciphered_dims->nc4_globaldims=nc4_globaldims;
+    deciphered_dims->nc4_localdims =nc4_localdims;
+    deciphered_dims->nc4_offsets   =nc4_offsets;
+    deciphered_dims->nc4_strides   =nc4_strides;
+    deciphered_dims->nc4_global_dimids=nc4_global_dimids;
+    deciphered_dims->nc4_local_dimids =nc4_local_dimids;
+    deciphered_dims->nc4_loffs_dimids =nc4_loffs_dimids;
+
+    memcpy(deciphered_dims->nc4_gbglobaldims_dimids, nc4_gbglobaldims_dimids, 2*sizeof(int));
+    deciphered_dims->nc4_gbglobaldims_varid=nc4_gbglobaldims_varid;
+
+    deciphered_dims->has_globaldims=has_globaldims;
+    deciphered_dims->has_localdims=has_localdims;
+    deciphered_dims->has_localoffsets=has_localoffsets;
+
+    deciphered_dims->has_timedim   =has_timedim;
+    deciphered_dims->timedim_index =timedim_index;
+
+    deciphered_dims->global_dim_count=global_dim_count;
+    deciphered_dims->local_dim_count=local_dim_count;
+    deciphered_dims->local_offset_count=local_offset_count;
+}
+
+static int cleanup_deciphered_dims(
+        deciphered_dims_t *deciphered_dims)
+{
+    if (deciphered_dims->nc4_gbdims             != NULL) free(deciphered_dims->nc4_gbdims);
+    if (deciphered_dims->nc4_global_dimnames    != NULL) free(deciphered_dims->nc4_global_dimnames);
+    if (deciphered_dims->nc4_local_dimnames     != NULL) free(deciphered_dims->nc4_local_dimnames);
+    if (deciphered_dims->nc4_local_offset_names != NULL) free(deciphered_dims->nc4_local_offset_names);
+    if (deciphered_dims->nc4_strides            != NULL) free(deciphered_dims->nc4_strides);
+    if (deciphered_dims->nc4_global_dimids      != NULL) free(deciphered_dims->nc4_global_dimids);
+    if (deciphered_dims->nc4_local_dimids       != NULL) free(deciphered_dims->nc4_local_dimids);
+    if (deciphered_dims->nc4_loffs_dimids       != NULL) free(deciphered_dims->nc4_loffs_dimids);
+}
+
+static int read_var(
+        int ncid,
+        int root_group,
+        struct adios_group_struct *group,
+        struct adios_var_struct *pvar_root,
+        struct adios_attribute_struct *patt_root,
+        struct adios_var_struct *pvar,
+        enum ADIOS_FLAG fortran_flag,
+        int myrank,
+        int nproc)
+{
+    int return_code=0;
+    int i, rc;
+    struct adios_dimension_struct * dims = pvar->dimensions;
+    deciphered_dims_t deciphered_dims;
+    char fullname[255];
+
+    int nc4_type_id;
+    int nc4_varid;
+
+    memset(&deciphered_dims, 0, sizeof(deciphered_dims_t));
+
+    getNC4TypeId (pvar->type, &nc4_type_id, fortran_flag);
+    if (nc4_type_id <=0 )
+    {
+        fprintf (stderr, "ERROR in getNC4TypeId in read_var!\n");
+        return_code=-2;
+        goto escape;
+    }
+
+    ncd_gen_name(fullname, pvar->path, pvar->name);
+
+    rc = nc_inq_varid(ncid, fullname, &nc4_varid);
+    if (rc == NC_ENOTVAR) {
+        fprintf(stderr, "NC4 ERROR variable(%s) does not exist in read_var, rc=%d\n", fullname, rc);
+        return_code=-2;
+        goto escape;
+    } else if (rc != NC_NOERR) {
+        fprintf(stderr, "NC4 ERROR checking existence of variable(%s) in read_var, rc=%d\n", fullname, rc);
+        return_code=-2;
+        goto escape;
+    }
+
+    if(myrank==0) if (DEBUG>3) printf("\tenter global reading!\n");
+
+    if (!pvar->dimensions) { // begin scalar read
+        rc = nc_get_var(ncid, nc4_varid, pvar->data);
+        if (rc != NC_NOERR) {
+            fprintf(stderr, "NC4 ERROR getting scalar variable(%s) in read_var\n", fullname);
+            return_code=-2;
+            goto escape;
+        }
+
+        return_code=0;
+        goto escape;
+    } // end scalar write
+
+    if (myrank==0) if (DEBUG>3) printf("read_var deciphering dims\n");
+    decipher_dims(ncid,
+            root_group,
+            group,
+            pvar_root,
+            patt_root,
+            pvar,
+            myrank,
+            nproc,
+            &deciphered_dims);
+    dims = pvar->dimensions;
+
+
+    if (deciphered_dims.has_timedim == adios_flag_no) {
+
+        /* begin reading array with fixed dimensions */
+
+        if (myrank==0) if (DEBUG>3) printf("\treading fixed dimension array var!\n");
+
+        for (i=0;i<deciphered_dims.local_dim_count;i++) {
+            if(myrank==0) {
+                if (DEBUG>3) printf("\tDIMS var:%s dim[%d]:  %d %d %d\n",fullname
+                        ,i, deciphered_dims.nc4_globaldims[i], deciphered_dims.nc4_localdims[i], deciphered_dims.nc4_offsets[i]);
+          }
+        }
+
+        Func_Timer("nc4_varid par_access", rc = nc_var_par_access(ncid, nc4_varid, NC_COLLECTIVE););
+        if (rc != NC_NOERR) {
+            fprintf(stderr, "NC4 ERROR setting parallel access for scalar variable(%s) in read_var, rc=%d\n", fullname, rc);
+            return_code=-2;
+            goto escape;
+        }
+
+//        rc = nc_get_vars(ncid, nc4_varid, deciphered_dims.nc4_offsets, deciphered_dims.nc4_localdims, deciphered_dims.nc4_strides, pvar->data);
+        Func_Timer("getvars", rc = nc_get_vara(ncid, nc4_varid, deciphered_dims.nc4_offsets, deciphered_dims.nc4_localdims, pvar->data););
+        if (rc != NC_NOERR) {
+            fprintf(stderr, "NC4 ERROR getting array variable(%s) in read_var\n", fullname);
+            return_code=-2;
+            goto escape;
+        }
+
+        /* end reading array with fixed dimensions */
+
+    } else {
+
+        /* begin reading array with unlimited dimension */
+
+        size_t current_timestep=0;
+
+        for (i=0;i<deciphered_dims.local_dim_count;i++) {
+            if(myrank==0) {
+                if (DEBUG>3) printf("\tDIMS var:%s dim[%d]:  %d %d %d\n",fullname
+                        ,i, deciphered_dims.nc4_globaldims[i], deciphered_dims.nc4_localdims[i], deciphered_dims.nc4_offsets[i]);
+          }
+        }
+
+        Func_Timer("nc4_varid par_access", rc = nc_var_par_access(ncid, nc4_varid, NC_COLLECTIVE););
+        if (rc != NC_NOERR) {
+            fprintf(stderr, "NC4 ERROR setting parallel access for scalar variable(%s) in write_var, rc=%d\n", fullname, rc);
+            return_code=-2;
+            goto escape;
+        }
+
+        Func_Timer("inqdim", rc = nc_inq_dimid(ncid, deciphered_dims.nc4_local_dimnames[deciphered_dims.timedim_index], &deciphered_dims.nc4_global_dimids[deciphered_dims.timedim_index]););
+        if (rc != NC_NOERR) {
+            fprintf(stderr, "NC4 ERROR inquiring about dimension(%s) for array variable(%s) in write_var, rc=%d\n", deciphered_dims.nc4_local_dimnames[i], fullname, rc);
+            return_code=-2;
+            goto escape;
+        }
+        /* get the current timestep */
+        Func_Timer("inqdimlen", rc = nc_inq_dimlen(ncid, deciphered_dims.nc4_global_dimids[deciphered_dims.timedim_index], &current_timestep););
+        if (rc != NC_NOERR) {
+            fprintf(stderr, "NC4 ERROR error getting current timestep for array variable(%s) in write_var, rc=%d\n", fullname, rc);
+            return_code=-2;
+            goto escape;
+        }
+        if (DEBUG>3) printf("current_timestep==%d\n", current_timestep);
+
+        /* decrement.  dims are 1-based, while offsets are 0-based. */
+        deciphered_dims.nc4_offsets[deciphered_dims.timedim_index]=current_timestep-1;
+        for (i=0;i<deciphered_dims.local_dim_count;i++) {
+            if (DEBUG>3) printf("write_var: deciphered_dims.nc4_offsets[%d]=%lu deciphered_dims.nc4_localdims[%d]=%lu\n",
+                    i, deciphered_dims.nc4_offsets[i],
+                    i, deciphered_dims.nc4_localdims[i]);
+        }
+//        rc = nc_get_vars(ncid, nc4_varid, deciphered_dims.nc4_offsets, deciphered_dims.nc4_localdims, deciphered_dims.nc4_strides, pvar->data);
+        Func_Timer("getvars", rc = nc_get_vara(ncid, nc4_varid, deciphered_dims.nc4_offsets, deciphered_dims.nc4_localdims, pvar->data););
+        if (rc != NC_NOERR) {
+            fprintf(stderr, "NC4 ERROR getting array variable(%s) in read_var\n", fullname);
+            return_code=-2;
+            goto escape;
+        }
+
+        /* end reading array with unlimited dimension */
+
+    }
+
+escape:
+    cleanup_deciphered_dims(&deciphered_dims);
+
+    return return_code;
+}
+
+static int write_header(
+        int ncid,
+        int root_group,
+        struct adios_group_struct *group,
+        struct adios_var_struct *pvar_root,
+        struct adios_attribute_struct *patt_root,
+        struct adios_var_struct *pvar,
+        enum ADIOS_FLAG fortran_flag,
+        int myrank,
+        int nproc)
+{
+    int i;
+    int rc;
+    int return_code=0;
+    int nc4_type_id;
+    int nc4_varid;
+    deciphered_dims_t deciphered_dims;
+    char fullname[255];
+
+//	int myrank=md->rank;
+//	int nproc=md->size;
+
+//	struct adios_var_struct *pvar=fd->group->vars;
+//	enum ADIOS_FLAG fortran_flag=fd->group->adios_host_language_fortran;
+
+    memset(&deciphered_dims, 0, sizeof(deciphered_dims_t));
+
+    getNC4TypeId(pvar->type, &nc4_type_id, fortran_flag);
+    if(nc4_type_id <= 0) {
+        fprintf(stderr, "NC4 ERROR in getH5TypeId in write_var\n");
+        return_code=-2;
+        goto escape;
+    }
+
+    ncd_gen_name(fullname, pvar->path, pvar->name);
+
+    if (!pvar->dimensions) { // begin scalar write
+        Func_Timer("inqvar", rc = nc_inq_varid(ncid, fullname, &nc4_varid););
+        if (rc == NC_ENOTVAR) {
+            if (pvar->type == adios_string) {
+                size_t str_var_dimid=0;
+                char str_var_dimname[40];
+                sprintf(str_var_dimname, "%s_dim", fullname);
+                Func_Timer("defdim", rc = nc_def_dim(ncid, str_var_dimname, strlen((char *)pvar->data)+1, &str_var_dimid););
+                if (rc != NC_NOERR) {
+                    fprintf(stderr, "NC4 ERROR defining string variable(%s) dim in write_var, rc=%d\n", fullname, rc);
+                    return_code=-2;
+                    goto escape;
+                }
+                Func_Timer("defvar", rc = nc_def_var(ncid, fullname, nc4_type_id, 1, &str_var_dimid, &nc4_varid););
+                if (rc != NC_NOERR) {
+                    fprintf(stderr, "NC4 ERROR defining string variable(%s) in write_var, rc=%d\n", fullname, rc);
+                    return_code=-2;
+                    goto escape;
+                }
+            } else {
+                Func_Timer("defvar", rc = nc_def_var(ncid, fullname, nc4_type_id, 0, NULL, &nc4_varid););
+                if (rc != NC_NOERR) {
+                    fprintf(stderr, "NC4 ERROR defining scalar variable(%s) in write_var, rc=%d\n", fullname, rc);
+                    return_code=-2;
+                    goto escape;
+                }
+            }
+        }
+
+        goto escape;
+    } // end scalar write
+
+    if (myrank==0) if (DEBUG>3) printf("write_header deciphering dims\n");
+    decipher_dims(ncid,
+            root_group,
+            group,
+            pvar_root,
+            patt_root,
+            pvar,
+            myrank,
+            nproc,
+            &deciphered_dims);
+
+    enum ADIOS_FLAG var_exists = adios_flag_yes;
+    Func_Timer("inqvar", rc = nc_inq_varid(ncid, fullname, &nc4_varid););
+    if (rc == NC_ENOTVAR) {
+        var_exists=adios_flag_no;
+    } else if (rc != NC_NOERR) {
+        fprintf(stderr, "NC4 ERROR checking existence of variable(%s) in write_var, rc=%d\n", fullname, rc);
+        return_code=-2;
+        goto escape;
+    }
+
+    if (deciphered_dims.has_timedim == adios_flag_no) {
+
+        /* begin writing array with fixed dimensions */
+
+        if (myrank==0) if (DEBUG>3) printf("\twriting fixed dimension array var!\n");
+
+        if (var_exists == adios_flag_no) {
+            for (i=0;i<deciphered_dims.local_dim_count;i++) {
+                Func_Timer("inqdim", rc = nc_inq_dimid(ncid, deciphered_dims.nc4_local_dimnames[i], &deciphered_dims.nc4_local_dimids[i]););
+                if (rc == NC_EBADDIM) {
+                    Func_Timer("defdim", rc = nc_def_dim(ncid, deciphered_dims.nc4_local_dimnames[i], deciphered_dims.nc4_localdims[i], &deciphered_dims.nc4_local_dimids[i]););
+                    if (rc != NC_NOERR) {
+                        fprintf(stderr, "NC4 ERROR defining array dimension(%s) in write_var, rc=%d\n", deciphered_dims.nc4_local_dimnames[i], rc);
+                        return_code=-2;
+                        goto escape;
+                    }
+                } else if (rc != NC_NOERR) {
+                    fprintf(stderr, "NC4 ERROR inquiring about dimension(%s) for array variable(%s) in write_var, rc=%d\n", deciphered_dims.nc4_local_dimnames[i], fullname, rc);
+                    return_code=-2;
+                    goto escape;
+                }
+            }
+            for (i=0;i<deciphered_dims.global_dim_count;i++) {
+                Func_Timer("inqdim", rc = nc_inq_dimid(ncid, deciphered_dims.nc4_global_dimnames[i], &deciphered_dims.nc4_global_dimids[i]););
+                if (rc == NC_EBADDIM) {
+                    Func_Timer("defdim", rc = nc_def_dim(ncid, deciphered_dims.nc4_global_dimnames[i], deciphered_dims.nc4_globaldims[i], &deciphered_dims.nc4_global_dimids[i]););
+                    if (rc != NC_NOERR) {
+                        fprintf(stderr, "NC4 ERROR defining array dimension(%s) in write_var, rc=%d\n", deciphered_dims.nc4_global_dimnames[i], rc);
+                        return_code=-2;
+                        goto escape;
+                    }
+                } else if (rc != NC_NOERR) {
+                    fprintf(stderr, "NC4 ERROR inquiring about dimension(%s) for array variable(%s) in write_var, rc=%d\n", deciphered_dims.nc4_global_dimnames[i], fullname, rc);
+                    return_code=-2;
+                    goto escape;
+                }
+            }
+            if (deciphered_dims.has_globaldims == adios_flag_yes) {
+                Func_Timer("defvar", rc = nc_def_var(ncid, fullname, nc4_type_id, deciphered_dims.global_dim_count, deciphered_dims.nc4_global_dimids, &nc4_varid););
+                if (rc != NC_NOERR) {
+                    fprintf(stderr, "NC4 ERROR defining array variable(%s) with global dims in write_var, rc=%d\n", fullname, rc);
+                    return_code=-2;
+                    goto escape;
+                }
+            } else {
+                Func_Timer("defvar", rc = nc_def_var(ncid, fullname, nc4_type_id, deciphered_dims.local_dim_count, deciphered_dims.nc4_local_dimids, &nc4_varid););
+                if (rc != NC_NOERR) {
+                    fprintf(stderr, "NC4 ERROR defining array variable(%s) with local dims in write_var, rc=%d\n", fullname, rc);
+                    return_code=-2;
+                    goto escape;
+                }
+            }
+        }
+
+        if (DEBUG>3) printf("got varid(%d) for grp_id(%d).variable(%s) in write_attribute, rc=%d\n", nc4_varid, ncid, fullname, rc);
+        if (DEBUG>3) printf("sizeof(size_t)==%d\n", sizeof(size_t));
+
+        /* end writing array with fixed dimensions */
+
+    } else {
+
+        /* begin writing array with unlimited dimension */
+
+        size_t current_timestep=0;
+
+        if (myrank==0) if (DEBUG>3) printf("\twriting timestep array var!\n");
+
+        if (var_exists == adios_flag_no) {
+            /* define the dims and var */
+            for (i=0;i<deciphered_dims.global_dim_count;i++) {
+                if (DEBUG>3) printf("inq dim name=%s, size=%d\n", deciphered_dims.nc4_global_dimnames[i], deciphered_dims.nc4_globaldims[i]);
+                Func_Timer("inqdim", rc = nc_inq_dimid(ncid, deciphered_dims.nc4_global_dimnames[i], &deciphered_dims.nc4_global_dimids[i]););
+                if (rc == NC_EBADDIM) {
+                    if (DEBUG>3) printf("def dim name=%s, size=%d\n", deciphered_dims.nc4_global_dimnames[i], deciphered_dims.nc4_globaldims[i]);
+                    Func_Timer("defdim", rc = nc_def_dim(ncid, deciphered_dims.nc4_global_dimnames[i], deciphered_dims.nc4_globaldims[i], &deciphered_dims.nc4_global_dimids[i]););
+                    if (rc != NC_NOERR) {
+                        fprintf(stderr, "NC4 ERROR defining array dimension(%s) in write_var, rc=%d\n", deciphered_dims.nc4_global_dimnames[i], rc);
+                        return_code=-2;
+                        goto escape;
+                    }
+                } else if (rc != NC_NOERR) {
+                    fprintf(stderr, "NC4 ERROR inquiring about dimension(%s) for array variable(%s) in write_var, rc=%d\n", deciphered_dims.nc4_global_dimnames[i], fullname, rc);
+                    return_code=-2;
+                    goto escape;
+                }
+            }
+            for (i=0;i<deciphered_dims.local_dim_count;i++) {
+                if (DEBUG>3) printf("inq dim name=%s, size=%d\n", deciphered_dims.nc4_local_dimnames[i], deciphered_dims.nc4_localdims[i]);
+                Func_Timer("inqdim", rc = nc_inq_dimid(ncid, deciphered_dims.nc4_local_dimnames[i], &deciphered_dims.nc4_local_dimids[i]););
+                if (rc == NC_EBADDIM) {
+                    if (DEBUG>3) printf("def dim name=%s, size=%d\n", deciphered_dims.nc4_local_dimnames[i], deciphered_dims.nc4_localdims[i]);
+                    Func_Timer("defdim", rc = nc_def_dim(ncid, deciphered_dims.nc4_local_dimnames[i], deciphered_dims.nc4_localdims[i], &deciphered_dims.nc4_local_dimids[i]););
+                    if (rc != NC_NOERR) {
+                        fprintf(stderr, "NC4 ERROR defining array dimension(%s) in write_var, rc=%d\n", deciphered_dims.nc4_global_dimnames[i], rc);
+                        return_code=-2;
+                        goto escape;
+                    }
+                } else if (rc != NC_NOERR) {
+                    fprintf(stderr, "NC4 ERROR inquiring about dimension(%s) for array variable(%s) in write_var, rc=%d\n", deciphered_dims.nc4_global_dimnames[i], fullname, rc);
+                    return_code=-2;
+                    goto escape;
+                }
+            }
+
+            Func_Timer("defvar", rc = nc_def_var(ncid, fullname, nc4_type_id, deciphered_dims.local_dim_count, deciphered_dims.nc4_global_dimids, &nc4_varid););
+            if (rc != NC_NOERR) {
+                fprintf(stderr, "NC4 ERROR defining array variable(%s) in write_var, rc=%d\n", fullname, rc);
+                return_code=-2;
+                goto escape;
+            }
+        }
+
+        /* end writing array with unlimited dimension */
+
+    }
+
+escape:
+    cleanup_deciphered_dims(&deciphered_dims);
+
+    return return_code;
+}
+
+static int write_var(
+        int ncid,
+        int root_group,
+        struct adios_group_struct *group,
+        struct adios_var_struct *pvar_root,
+        struct adios_attribute_struct *patt_root,
+        struct adios_var_struct *pvar,
+        enum ADIOS_FLAG fortran_flag,
+        int myrank,
+        int nproc)
+{
+    int i;
+    int rc;
+    int return_code=0;
+    int nc4_type_id;
+    int nc4_varid;
+    deciphered_dims_t deciphered_dims;
+    char fullname[255];
+
+    memset(&deciphered_dims, 0, sizeof(deciphered_dims_t));
+
+    getNC4TypeId(pvar->type, &nc4_type_id, fortran_flag);
+    if(nc4_type_id <= 0) {
+        fprintf(stderr, "NC4 ERROR in getH5TypeId in write_var\n");
+        return_code=-2;
+        goto escape;
+    }
+
+    ncd_gen_name(fullname, pvar->path, pvar->name);
+
+    Func_Timer("inqvar", rc = nc_inq_varid(ncid, fullname, &nc4_varid););
+    if (rc == NC_ENOTVAR) {
+        write_header(ncid, root_group, group, pvar_root, patt_root, pvar, fortran_flag, myrank, nproc);
+//		return 0;
+    }
+
+//	Func_Timer("enddef", rc = nc_enddef(ncid););
+//	if (rc != NC_NOERR) {
+//		if (myrank==0) fprintf(stderr, "NC4 ERROR ending define mode for scalar variable(%s) in write_var, rc=%d\n", fullname, rc);
+////		return_code=-2;
+////		goto escape;
+//	}
+
+    if (DEBUG>3) printf("rank(%d) write_var: ncid(%lu) varid(%lu) pvar->data=%p\n", global_rank, ncid, nc4_varid, pvar->data);
+
+    if (!pvar->dimensions) { // begin scalar write
+        Func_Timer("inqvar", rc = nc_inq_varid(ncid, fullname, &nc4_varid););
+        if (rc == NC_ENOTVAR) {
+            fprintf(stderr, "NC4 ERROR scalar variable(%s) does not exist in write_var, rc=%d\n", fullname, rc);
+            return_code=-2;
+            goto escape;
+        } else if (rc != NC_NOERR) {
+            fprintf(stderr, "NC4 ERROR checking existence of variable(%s) in write_var, rc=%d\n", fullname, rc);
+            return_code=-2;
+            goto escape;
+        }
+        Func_Timer("nc4_varid par_access", rc = nc_var_par_access(ncid, nc4_varid, NC_COLLECTIVE););
+        if (rc != NC_NOERR) {
+            fprintf(stderr, "NC4 ERROR setting parallel access for scalar variable(%s) in write_var, rc=%d\n", fullname, rc);
+            return_code=-2;
+            goto escape;
+        }
+
+        Func_Timer("putvar", rc = nc_put_var(ncid, nc4_varid, pvar->data););
+        if (rc != NC_NOERR) {
+            fprintf(stderr, "NC4 ERROR putting scalar variable(%s) in write_var, rc=%d\n", fullname, rc);
+            return_code=-2;
+            goto escape;
+        }
+        if (DEBUG>3) printf("groupid=%d\n",ncid);
+        if (DEBUG>3) printf("write dataset: name=%s/%s rc=%d myrank=%d\n"
+                 , pvar->path,fullname, rc, myrank);
+
+        goto escape;
+    } // end scalar write
+
+
+    if (myrank==0) if (DEBUG>3) printf("write_var deciphering dims\n");
+    decipher_dims(ncid,
+            root_group,
+            group,
+            pvar_root,
+            patt_root,
+            pvar,
+            myrank,
+            nproc,
+            &deciphered_dims);
+
+    enum ADIOS_FLAG var_exists = adios_flag_yes;
+    Func_Timer("inqvar", rc = nc_inq_varid(ncid, fullname, &nc4_varid););
+    if (rc == NC_ENOTVAR) {
+        fprintf(stderr, "NC4 ERROR array variable(%s) does not exist in write_var, rc=%d\n", fullname, rc);
+        return_code=-2;
+        goto escape;
+    } else if (rc != NC_NOERR) {
+        fprintf(stderr, "NC4 ERROR checking existence of variable(%s) in write_var, rc=%d\n", fullname, rc);
+        return_code=-2;
+        goto escape;
+    }
+
+    if (deciphered_dims.has_timedim == adios_flag_no) {
+
+        /* begin writing array with fixed dimensions */
+
+        if (myrank==0) if (DEBUG>3) printf("\twriting fixed dimension array var!\n");
+
+        Func_Timer("nc4_varid par_access", rc = nc_var_par_access(ncid, nc4_varid, NC_COLLECTIVE););
+        if (rc != NC_NOERR) {
+            fprintf(stderr, "NC4 ERROR setting parallel access for scalar variable(%s) in write_var, rc=%d\n", fullname, rc);
+            return_code=-2;
+            goto escape;
+        }
+
+        if (DEBUG>3) printf("got varid(%d) for grp_id(%d).variable(%s) in write_attribute, rc=%d\n", nc4_varid, ncid, fullname, rc);
+        if (DEBUG>3) printf("sizeof(size_t)==%d\n", sizeof(size_t));
+
+//		Func_Timer("putvars", rc = nc_put_vars(ncid, nc4_varid, deciphered_dims.nc4_offsets, deciphered_dims.nc4_localdims, deciphered_dims.nc4_strides, pvar->data););
+        Func_Timer("putvars", rc = nc_put_vara(ncid, nc4_varid, deciphered_dims.nc4_offsets, deciphered_dims.nc4_localdims, pvar->data););
+        if (rc != NC_NOERR) {
+            fprintf(stderr, "NC4 ERROR putting to array variable(%s) in write_var, rc=%d\n", fullname, rc);
+            return_code=-2;
+            goto escape;
+        }
+
+        /* end writing array with fixed dimensions */
+
+    } else {
+
+        /* begin writing array with unlimited dimension */
+
+        size_t current_timestep=0;
+
+        if (myrank==0) if (DEBUG>3) printf("\twriting timestep array var!\n");
+
+        Func_Timer("nc4_varid par_access", rc = nc_var_par_access(ncid, nc4_varid, NC_COLLECTIVE););
+        if (rc != NC_NOERR) {
+            fprintf(stderr, "NC4 ERROR setting parallel access for scalar variable(%s) in write_var, rc=%d\n", fullname, rc);
+            return_code=-2;
+            goto escape;
+        }
+
+        Func_Timer("inqdim", rc = nc_inq_dimid(ncid, deciphered_dims.nc4_local_dimnames[deciphered_dims.timedim_index], &deciphered_dims.nc4_global_dimids[deciphered_dims.timedim_index]););
+        if (rc != NC_NOERR) {
+            fprintf(stderr, "NC4 ERROR inquiring about dimension(%s) for array variable(%s) in write_var, rc=%d\n", deciphered_dims.nc4_local_dimnames[i], fullname, rc);
+            return_code=-2;
+            goto escape;
+        }
+        /* get the current timestep */
+        Func_Timer("inqdimlen", rc = nc_inq_dimlen(ncid, deciphered_dims.nc4_global_dimids[deciphered_dims.timedim_index], &current_timestep););
+        if (rc != NC_NOERR) {
+            fprintf(stderr, "NC4 ERROR error getting current timestep for array variable(%s) in write_var, rc=%d\n", fullname, rc);
+            return_code=-2;
+            goto escape;
+        }
+        if (DEBUG>3) printf("current_timestep==%d\n", current_timestep);
+        /* the next timestep goes after the current.  */
+        /* THK: don't increment.  dims are 1-based, while offsets are 0-based. */
+
+        deciphered_dims.nc4_offsets[deciphered_dims.timedim_index]=current_timestep;
+        for (i=0;i<deciphered_dims.local_dim_count;i++) {
+            if (DEBUG>3) printf("write_var: deciphered_dims.nc4_offsets[%d]=%lu deciphered_dims.nc4_localdims[%d]=%lu\n",
+                    i, deciphered_dims.nc4_offsets[i],
+                    i, deciphered_dims.nc4_localdims[i]);
+        }
+//		Func_Timer("putvars", rc = nc_put_vars(ncid, nc4_varid, deciphered_dims.nc4_offsets, deciphered_dims.nc4_localdims, deciphered_dims.nc4_strides, pvar->data););
+        Func_Timer("putvars", rc = nc_put_vara(ncid, nc4_varid, deciphered_dims.nc4_offsets, deciphered_dims.nc4_localdims, pvar->data););
+        if (rc != NC_NOERR) {
+            fprintf(stderr, "NC4 ERROR putting to array variable(%s) in write_var, rc=%d\n", fullname, rc);
+            return_code=-2;
+            goto escape;
+        }
+
+        /* end writing array with unlimited dimension */
+
+    }
+
+escape:
+    cleanup_deciphered_dims(&deciphered_dims);
+
+    return return_code;
+}
+
+
+
+static int adios_nc4_initialized = 0;
+static void adios_var_to_comm_nc4(
+        enum ADIOS_FLAG host_language_fortran,
+        void *data,
+        MPI_Comm *comm)
+{
+    if (data) {
+        int t = *(int *) data;
+        if (host_language_fortran == adios_flag_yes) {
+            *comm = MPI_Comm_f2c (t);
+        } else {
+            *comm = *(MPI_Comm *) data;
+        }
+    } else {
+        fprintf (stderr, "coordination-communication not provided. "
+                "Using MPI_COMM_WORLD instead\n");
+        *comm = MPI_COMM_WORLD;
+    }
+}
+void adios_nc4_init(
+        const char *parameters,
+        struct adios_method_struct *method)
+{
+    struct adios_nc4_data_struct *md=NULL;
+//    struct adios_nc4_data_struct *md = (struct adios_nc4_data_struct *)method->method_data;
+
+    if (!adios_nc4_initialized) {
+        adios_nc4_initialized = 1;
+
+        MPI_Comm_rank(MPI_COMM_WORLD, &global_rank);
+
+        list_init(&open_file_list, open_file_free);
+    }
+
+
+//    method->method_data = malloc(sizeof(struct adios_nc4_data_struct));
+//    md = (struct adios_nc4_data_struct *)method->method_data;
+//    md->ncid       = -1;
+//    md->root_ncid  = -1;
+//    md->rank       = -1;
+//    md->size       = 0;
+//    md->group_comm = MPI_COMM_NULL;
+}
+
+enum ADIOS_FLAG adios_nc4_should_buffer(
+        struct adios_file_struct *fd,
+        struct adios_method_struct *method)
+{
+    int rc=NC_NOERR;
+
+    struct open_file *of=NULL;
+    struct adios_nc4_data_struct *md=NULL;
+//    struct adios_nc4_data_struct *md = (struct adios_nc4_data_struct *)method->method_data;
+    char *name;
+    MPI_Info info = MPI_INFO_NULL;
+
+    if (DEBUG>3) printf("enter adios_nc4_should_buffer (%s)\n", fd->name);
+
+    of=open_file_find(method->base_path, fd->name);
+    if (of == NULL) {
+        fprintf(stderr, "file(%s, %s) is not open.  FAIL.\n", method->base_path, fd->name);
+        return adios_flag_no;
+    }
+    md=of->md;
+
+
+    if (md->ncid != -1) {
+        // file already open
+        if (DEBUG>3) printf("adios_nc4_should_buffer: file is already open (fname=%s, ncid=%d)\n", fd->name, md->ncid);
+        return adios_flag_no;
+    }
+
+    adios_var_to_comm_nc4(fd->group->adios_host_language_fortran, md->comm, &md->group_comm);
+    if (md->group_comm != MPI_COMM_NULL) {
+        if (DEBUG>3) printf("global_rank(%d): adios_nc4_should_buffer: get rank and size: comm(%p) group_comm(%p)\n", global_rank, md->comm, md->group_comm);
+        MPI_Comm_rank(md->group_comm, &md->rank);
+        MPI_Comm_size(md->group_comm, &md->size);
+        if (DEBUG>3) printf("global_rank(%d): adios_nc4_should_buffer: size(%d) rank(%d)\n", global_rank, md->size, md->rank);
+    } else {
+        md->group_comm=MPI_COMM_SELF;
+    }
+    fd->group->process_id = md->rank;
+    name = malloc(strlen(method->base_path) + strlen(fd->name) + 1);
+    sprintf(name, "%s%s", method->base_path, fd->name);
+
+    int myrank=md->rank;
+
+    // create a new file. If file exists its contents will be overwritten. //
+
+    MPI_Info_create(&info);
+    MPI_Info_set(info,"cb_align","2");
+    MPI_Info_set(info,"romio_ds_write","disable");
+    MPI_Info_set(info,"romio_cb_write","enable");
+
+    switch (fd->mode) {
+        case adios_mode_read:
+        {
+            Func_Timer("nc_open_par", rc = nc_open_par(name, NC_NOWRITE|NC_MPIIO, md->group_comm, info, &md->ncid););
+            if (rc != NC_NOERR) {
+                fprintf (stderr, "ADIOS NC4: could not open file(%s) for reading, rc=%d\n", name, rc);
+                free (name);
+                return adios_flag_no;
+            }
+            break;
+        }
+        case adios_mode_write:
+        case adios_mode_append:
+        {
+            Func_Timer("nc_create_par", rc = nc_create_par(name, NC_NOCLOBBER|NC_MPIIO|NC_NETCDF4, md->group_comm, info, &md->ncid););
+            if (rc == NC_EEXIST) {
+                Func_Timer("nc_open_par", rc = nc_open_par(name, NC_WRITE|NC_MPIIO, md->group_comm, info, &md->ncid););
+                if (rc != NC_NOERR) {
+                    fprintf (stderr, "ADIOS NC4: could not open file(%s) for writing, rc=%d\n", name, rc);
+                    free (name);
+                    return adios_flag_no;
+                }
+            } else if (rc != NC_NOERR) {
+                fprintf (stderr, "ADIOS NC4: cannot create file(%s), rc=%d\n", name, rc);
+                free (name);
+                return adios_flag_no;
+            }
+            break;
+        }
+    }
+
+    md->root_ncid = md->ncid;
+
+    free(name);
+
+    return adios_flag_no;
+}
+
+int adios_nc4_open(
+        struct adios_file_struct *fd,
+        struct adios_method_struct *method,
+        void *comm)
+{
+    struct open_file *of=NULL;
+    struct adios_nc4_data_struct *md=NULL;
+//    struct adios_nc4_data_struct * md = (struct adios_nc4_data_struct *)method->method_data;
+
+    if (DEBUG>3) printf("enter adios_nc4_open (%s)\n", fd->name);
+
+    of=open_file_find(method->base_path, fd->name);
+    if (of == NULL) {
+        md             = malloc(sizeof(struct adios_nc4_data_struct));
+        md->fd         = -1;
+        md->ncid       = -1;
+        md->root_ncid  = -1;
+        md->rank       = -1;
+        md->size       = 0;
+        md->group_comm = MPI_COMM_NULL;
+        md->comm       = comm;
+
+        of=open_file_create(method->base_path, fd->name, md, fd);
+    } else {
+        md=of->md;
+
+        // sanity check
+        if (md->fd == -1) {
+            if (DEBUG>3) printf("open: %s is open but fd==-1.  sanity check failed.  attempting reopen.\n", fd->name);
+            open_file_delete(of->fpath, of->fname);
+        } else {
+            // file already open
+            return adios_flag_no;
+        }
+    }
+
+
+    if (DEBUG>3) printf("open: fname=%s; fd==%p; ncid=%d\n", fd->name, md->fd, md->ncid);
+
+    list_ins_next(&open_file_list, list_tail(&open_file_list), of);
+
+    open_file_printall();
+
+
+    return 1;
+}
+
+void adios_nc4_write(
+        struct adios_file_struct *fd,
+        struct adios_var_struct *v,
+        void *data,
+        struct adios_method_struct *method)
+{
+    struct open_file *of=NULL;
+    struct adios_nc4_data_struct *md=NULL;
+//    struct adios_nc4_data_struct * md = (struct adios_nc4_data_struct *)method->method_data;
+    static int first_write = 1;
+
+    of=open_file_find(method->base_path, fd->name);
+    if (of == NULL) {
+        fprintf(stderr, "file(%s, %s) is not open.  FAIL.\n", method->base_path, fd->name);
+        return;
+    }
+    md=of->md;
+
+    if (fd->mode == adios_mode_write || fd->mode == adios_mode_append) {
+//		if (first_write == 1) {
+//			write_header(fd, md);
+//			first_write = 0;
+//		}
+
+        if (md->rank==0) {
+            if (DEBUG>3) fprintf(stderr, "-------------------------\n");
+            if (DEBUG>3) fprintf(stderr, "write var: %s start!\n", v->name);
+        }
+        write_var(md->ncid,
+                md->root_ncid,
+                fd->group,
+                fd->group->vars,
+                fd->group->attributes,
+                v,
+                fd->group->adios_host_language_fortran,
+                md->rank,md->size);
+    } else {
+        if (DEBUG>3) fprintf(stderr, "entering unknown nc4 mode %d!\n", fd->mode);
+    }
+    if (md->rank==0) {
+        if (DEBUG>3) fprintf(stderr, "write var: %s end!\n", v->name);
+        if (DEBUG>3) fprintf(stderr, "-------------------------\n");
+    }
+}
+
+
+void adios_nc4_read(
+        struct adios_file_struct *fd,
+        struct adios_var_struct *v,
+        void *buffer,
+        uint64_t buffersize,
+        struct adios_method_struct *method)
+{
+    struct open_file *of=NULL;
+    struct adios_nc4_data_struct *md=NULL;
+//    struct adios_nc4_data_struct * md = (struct adios_nc4_data_struct *)method->method_data;
+
+    of=open_file_find(method->base_path, fd->name);
+    if (of == NULL) {
+        fprintf(stderr, "file(%s, %s) is not open.  FAIL.\n", method->base_path, fd->name);
+        return;
+    }
+    md=of->md;
+
+    if(fd->mode == adios_mode_read) {
+        v->data = buffer;
+        v->data_size = buffersize;
+
+        if (v->is_dim == adios_flag_yes) {
+            // this is a dimension variable.  values in the file are unreliable.
+            // assume the caller provided a valid value in 'buffer'.
+            if (DEBUG>3) fprintf(stderr, "------------------------------\n");
+            if (DEBUG>3) fprintf(stderr, "read var: %s! skipping dim var\n", v->name);
+            if (DEBUG>3) fprintf(stderr, "------------------------------\n");
+            return;
+        }
+
+        if (md->rank==0) {
+            if (DEBUG>3) fprintf(stderr, "-------------------------\n");
+            if (DEBUG>3) fprintf(stderr, "read var: %s! start\n", v->name);
+        }
+        read_var(md->ncid,
+                md->root_ncid,
+                fd->group,
+                fd->group->vars,
+                fd->group->attributes,
+                v,
+                fd->group->adios_host_language_fortran,
+                md->rank,
+                md->size);
+        if (md->rank==0) {
+            if (DEBUG>3) fprintf(stderr, "read var: %s! end\n", v->name);
+            if (DEBUG>3) fprintf(stderr, "-------------------------\n");
+        }
+
+    }
+}
+
+void adios_nc4_close(
+        struct adios_file_struct *fd,
+        struct adios_method_struct *method)
+{
+    struct open_file *of=NULL;
+    struct adios_nc4_data_struct *md=NULL;
+//    struct adios_nc4_data_struct * md = (struct adios_nc4_data_struct*)method->method_data;
+    struct adios_attribute_struct * a = fd->group->attributes;
+    int myrank;
+
+    of=open_file_find(method->base_path, fd->name);
+    if (of == NULL) {
+        fprintf(stderr, "file(%s, %s) is not open.  FAIL.\n", method->base_path, fd->name);
+        return;
+    }
+    md=of->md;
+    myrank=md->rank;
+
+    if (fd->mode == adios_mode_read) {
+        struct adios_var_struct * v = fd->group->vars;
+        while (v)
+        {
+            v->data = 0;
+            v = v->next;
+        }
+
+        if (md->rank==0) {
+            if (DEBUG>1) fprintf(stderr, "-------------------------\n");
+            if (DEBUG>1) fprintf(stderr, "reading done, nc4 file is virtually closed;\n");
+            if (DEBUG>1) fprintf(stderr, "-------------------------\n");
+        }
+    } else if (fd->mode == adios_mode_write || fd->mode == adios_mode_append) {
+        if (DEBUG>3) fprintf(stderr, "entering nc4 write attribute mode!\n");
+        while(a) {
+            Func_Timer("write_attribute", write_attribute(md->ncid, md->root_ncid, fd->group->vars, a,
+                    fd->group->adios_host_language_fortran,
+                    md->rank,
+                    md->size););
+            a = a->next;
+        }
+        if (md->rank==0) {
+            if (DEBUG>1) fprintf(stderr, "-------------------------\n");
+            if (DEBUG>1) fprintf(stderr, "writing done, nc4 file is virtually closed;\n");
+            if (DEBUG>1) fprintf(stderr, "-------------------------\n");
+        }
+    }
+
+    Func_Timer("nc_sync", nc_sync(md->ncid););
+    Func_Timer("nc_close", nc_close(md->ncid););
+
+    free(of->md);
+    open_file_delete(method->base_path, fd->name);
+}
+
+void adios_nc4_finalize(
+        int mype,
+        struct adios_method_struct *method)
+{
+//    struct adios_nc4_data_struct * md = (struct adios_nc4_data_struct*)method->method_data;
+//    int myrank=md->rank;
+
+//    if (md) {
+//        Func_Timer("nc_close", nc_close(md->ncid););
+//    }
+//    md->group_comm = MPI_COMM_NULL;
+//    md->ncid = -1;
+//    md->root_ncid = -1;
+//    md->rank = -1;
+//    md->size = 0;
+
+    if (adios_nc4_initialized)
+        adios_nc4_initialized = 0;
+}
+
+/*
+ * Maps bp datatypes to h5 datatypes
+ *
+ * The Mapping is according to HDF5 Reference Manual
+ * (http://hdf.ncsa.uiuc.edu/HDF5/doc1.6/Datatypes.html)
+ */
+int getNC4TypeId(
+        enum ADIOS_DATATYPES type,
+        int *nc4_type_id,
+        enum ADIOS_FLAG fortran_flag)
+{
+    int size, status=0;
+    switch (type)
+    {
+    case adios_byte:
+        *nc4_type_id = NC_BYTE;
+        break;
+    case adios_short:
+        *nc4_type_id = NC_SHORT;
+        break;
+    case adios_integer:
+        *nc4_type_id = NC_INT;
+        break;
+    case adios_long:
+        *nc4_type_id = NC_INT64;
+        break;
+    case adios_string:
+        *nc4_type_id = NC_CHAR;
+        break;
+    case adios_real:
+        *nc4_type_id = NC_FLOAT;
+        break;
+    case adios_double:
+        *nc4_type_id = NC_DOUBLE;
+        break;
+    case adios_long_double:
+        fprintf(stderr, "ERROR in mapping ADIOS Data Types to NC4: long double not supported yet.\n");
+        status = -1;
+        break;
+    case adios_complex:
+    case adios_double_complex:
+        fprintf(stderr, "ERROR in mapping ADIOS Data Types to NC4: complex not supported yet.\n");
+        status = -1;
+        break;
+    case adios_unsigned_byte:
+        *nc4_type_id = NC_UBYTE;
+        break;
+    case adios_unsigned_short:
+        *nc4_type_id = NC_USHORT;
+        break;
+    case adios_unsigned_integer:
+        *nc4_type_id = NC_UINT;
+        break;
+    case adios_unsigned_long:
+        *nc4_type_id = NC_UINT64;
+        break;
+    default:
+        status = -1;
+        break;
+    }
+    return status;
+}
+
+int getTypeSize(
+        enum ADIOS_DATATYPES type,
+        void *val)
+{
+    switch (type)
+    {
+    case adios_byte:
+    case adios_unsigned_byte:
+        return 1;
+
+    case adios_string:
+        return strlen ((char *) val);
+
+    case adios_short:
+    case adios_unsigned_short:
+        return 2;
+
+    case adios_integer:
+    case adios_unsigned_integer:
+        return 4;
+
+    case adios_real:
+        return 4;
+
+    case adios_long:
+    case adios_unsigned_long:
+        return 8;
+
+    case adios_double:
+        return 8;
+
+    case adios_long_double:
+        return 16;
+
+    case adios_complex:
+        return 2 * 4;
+
+    case adios_double_complex:
+        return 2 * 8;
+
+    default:
+        return -1;
+    }
+}
+
+int ncd_gen_name(
+        char *fullname,
+        char *path,
+        char *name)
+{
+    int i;
+    char *new_path = strdup(path);
+
+    if (path[0] == '/') {
+         new_path=new_path+1;
+    }
+
+    for (i = 0; i < strlen(new_path); i++) {
+        if ( new_path[i] == '[' || new_path[i] == ']' || new_path[i] == '/' || new_path[i] == '\\')
+            new_path[i] = '_';
+    }
+    if (*new_path != '\0') {
+        if (new_path[i-1]!='_') {
+            if (strcmp(name,"")) {
+                sprintf (fullname, "%s_%s", new_path, name);
+            } else {
+                strcpy (fullname,new_path);
+                fullname [strlen(fullname)] = '\0';
+            }
+        } else {
+            if (strcmp(name,"")) {
+                sprintf (fullname, "%s%s", new_path, name);
+            } else {
+                strcpy (fullname,new_path);
+                fullname [strlen(fullname)] = '\0';
+            }
+        }
+    } else {
+        strcpy (fullname, name);
+    }
+
+    if (DEBUG>3) printf("fullname==%s\n", fullname);
+    return 0;
+}
diff --git a/src/adios_nssi.c b/src/adios_nssi.c
new file mode 100644
index 0000000..24713b7
--- /dev/null
+++ b/src/adios_nssi.c
@@ -0,0 +1,1564 @@
+/*
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "config.h"
+#include "mpi.h"
+#include "adios.h"
+#include "adios_types.h"
+#include "adios_bp_v1.h"
+#include "adios_transport_hooks.h"
+#include "adios_internals.h"
+#ifdef HAVE_NSSI
+#include "nssi_client.h"
+#include "adios_nssi_args.h"
+#include "adios_nssi_config.h"
+#include "nssi_logger.h"
+#endif
+
+#include "io_timer.h"
+
+
+#define NUM_GP 24
+void adios_nssi_get_write_buffer(
+        struct adios_file_struct *f,
+        struct adios_var_struct *v,
+        uint64_t *size,
+        void **buffer,
+        struct adios_method_struct *method)
+{
+}
+
+///////////////////////////
+// Datatypes
+///////////////////////////
+struct adios_nssi_file_data_struct
+{
+    int      fd;
+    MPI_Comm group_comm;
+    int      size;
+    int      rank;
+
+    void * comm; // temporary until moved from should_buffer to open
+
+    int      svc_index;
+    MPI_Comm collective_op_comm;
+    int      collective_op_size;
+    int      collective_op_rank;
+
+    int8_t use_single_server;
+};
+
+struct adios_nssi_method_data_struct
+{
+    nssi_request start_calc_req;
+    int          has_outstanding_req;
+};
+
+/* Need a struct to encapsulate var offset info.
+ */
+struct var_offset {
+    struct adios_group_struct *ogroup;
+    uint16_t  oid;
+    char      opath[ADIOS_PATH_MAX];
+    char      oname[ADIOS_PATH_MAX];
+    void     *ovalue;
+    uint64_t  osize;
+    uint8_t   is_anonymous;
+};
+
+/* list of variable offsets */
+static List var_offset_list;
+
+/* Need a struct to encapsulate var dim info.
+ */
+struct var_dim {
+    struct adios_group_struct *dgroup;
+    uint16_t  did;
+    char      dpath[ADIOS_PATH_MAX];
+    char      dname[ADIOS_PATH_MAX];
+    void     *dvalue;
+    uint64_t  dsize;
+    uint8_t   is_anonymous;
+};
+
+/* list of variable offsets */
+static List var_dim_list;
+
+/* Need a struct to encapsulate open file info
+ */
+struct open_file {
+    char                           fpath[ADIOS_PATH_MAX];
+    char                           fname[ADIOS_PATH_MAX];
+    struct adios_nssi_file_data_struct *file_data;
+    struct adios_file_struct      *f;
+    nssi_request                   start_calc_req;
+    int                            has_outstanding_req;
+//    List                           outstanding_reqs;
+};
+
+/* list of variable offsets */
+static List open_file_list;
+
+///////////////////////////
+// Global Variables
+///////////////////////////
+static int adios_nssi_initialized = 0;
+
+static int global_rank=-1;
+static int global_size=-1;
+static nssi_service *svcs;
+struct adios_nssi_config nssi_cfg;
+
+//static log_level adios_nssi_debug_level;
+static int DEBUG=0;
+
+
+///////////////////////////
+// Function Declarations
+///////////////////////////
+
+
+///////////////////////////
+// Function Definitions
+///////////////////////////
+
+static struct open_file *open_file_create(const char *path, const char *name, struct adios_nssi_file_data_struct *file_private_data)
+{
+    struct open_file *of=calloc(1,sizeof(struct open_file));
+
+    strcpy(of->fpath, path);
+    strcpy(of->fname, name);
+    of->file_data = file_private_data;
+    of->has_outstanding_req=FALSE;
+//    list_init(&(of->outstanding_reqs), free);
+
+    return(of);
+}
+static void open_file_free(void *of)
+{
+//    list_destroy((List *)&(of->outstanding_reqs));
+    free(of);
+}
+static int open_file_equal(const struct open_file *of1, const struct open_file *of2)
+{
+    if ((strcmp(of1->fpath, of2->fpath) == 0) && (strcmp(of1->fname, of2->fname) == 0)) return TRUE;
+
+    return FALSE;
+}
+static struct open_file *open_file_find(const char *path, const char *name)
+{
+    ListElmt *elmt;
+    struct open_file *of;
+
+    if (DEBUG>3) printf("looking for fpath(%s) fname(%s)\n", path, name);
+
+    elmt = list_head(&open_file_list);
+    while(elmt) {
+        of = list_data(elmt);
+        if (DEBUG>3) printf("comparing to fpath(%s) fname(%s)\n", of->fpath, of->fname);
+        if ((strcmp(path, of->fpath) == 0) && (strcmp(name, of->fname) == 0)) {
+            if (DEBUG>3) printf("fpath(%s) fname(%s) matches search\n", of->fpath, of->fname);
+            return of;
+        }
+        elmt = list_next(elmt);
+    }
+
+    return NULL;
+}
+static struct open_file *open_file_delete(const char *path, const char *name)
+{
+    ListElmt *elmt, *prev;
+    struct open_file *of;
+
+    if (DEBUG>3) printf("trying to delete fpath(%s) fname(%s)\n", path, name);
+
+    prev = elmt = list_head(&open_file_list);
+    while(elmt) {
+        of = list_data(elmt);
+        if (DEBUG>3) printf("comparing to fpath(%s) fname(%s)\n", of->fpath, of->fname);
+        if ((strcmp(path, of->fpath) == 0) && (strcmp(name, of->fname) == 0)) {
+            if (DEBUG>3) printf("fpath(%s) fname(%s) matches search\n", of->fpath, of->fname);
+            if (list_is_head(&open_file_list, elmt)) {
+                list_rem_next(&open_file_list, NULL, &of);
+            } else {
+                list_rem_next(&open_file_list, prev, &of);
+            }
+        }
+        prev = elmt;
+        elmt = list_next(elmt);
+    }
+
+    return NULL;
+}
+static void open_file_printall(void)
+{
+    ListElmt *elmt;
+    struct open_file *of;
+
+    elmt = list_head(&open_file_list);
+    while(elmt) {
+        of = list_data(elmt);
+        if (DEBUG>3) printf("fpath(%s) fname(%s)\n", of->fpath, of->fname);
+        elmt = list_next(elmt);
+    }
+}
+
+static struct var_offset *var_offset_create(const char *path, const char *name, void *value, uint64_t size, uint16_t id, struct adios_group_struct *group)
+{
+    struct var_offset *vo=calloc(1,sizeof(struct var_offset));
+
+    vo->ogroup = group;
+    vo->oid = id;
+    strcpy(vo->opath, path);
+    strcpy(vo->oname, name);
+    vo->ovalue = value;
+    vo->osize  = size;
+
+    return(vo);
+}
+static void var_offset_free(void *vo)
+{
+    free(vo);
+}
+static int var_offset_equal(const struct var_offset *vo1, const struct var_offset *vo2)
+{
+    if ((strcmp(vo1->opath, vo2->opath) == 0) && (strcmp(vo1->oname, vo2->oname) == 0)) return TRUE;
+
+    return FALSE;
+}
+static struct var_offset *var_offset_find(struct adios_group_struct *group, const char *path, const char *name)
+{
+    ListElmt *elmt;
+    struct var_offset *vo;
+
+    if (DEBUG>2) printf("looking for group(%p) opath(%s) oname(%s)\n", group, path, name);
+
+    elmt = list_head(&var_offset_list);
+    while(elmt) {
+        vo = list_data(elmt);
+        if (DEBUG>2) printf("comparing to group(%p) opath(%s) oname(%s)\n", vo->ogroup, vo->opath, vo->oname);
+        if ((group == vo->ogroup) && (strcmp(path, vo->opath) == 0) && (strcmp(name, vo->oname) == 0)) {
+            if (DEBUG>2) printf("group(%p) opath(%s) oname(%s) matches search\n", vo->ogroup, vo->opath, vo->oname);
+            return vo;
+        }
+        elmt = list_next(elmt);
+    }
+
+    return NULL;
+}
+static struct var_offset *var_offset_find_by_id(const uint16_t id)
+{
+    ListElmt *elmt;
+    struct var_offset *vo;
+
+    if (DEBUG>2) printf("looking for oid(%d)\n", id);
+
+    elmt = list_head(&var_offset_list);
+    while(elmt) {
+        vo = list_data(elmt);
+        if (DEBUG>2) printf("comparing to oid(%d)\n", vo->oid);
+        if (vo->oid == id) {
+            if (DEBUG>2) printf("oid(%d) opath(%s) oname(%s) matches search\n", vo->oid, vo->opath, vo->oname);
+            return vo;
+        }
+        elmt = list_next(elmt);
+    }
+
+    return NULL;
+}
+static void var_offset_printall(void)
+{
+    ListElmt *elmt;
+    struct var_offset *vo;
+
+    elmt = list_head(&var_offset_list);
+    while(elmt) {
+        vo = list_data(elmt);
+        if (DEBUG>3) printf("opath(%s) oname(%s)\n", vo->opath, vo->oname);
+        elmt = list_next(elmt);
+    }
+}
+
+static struct var_dim *var_dim_create(const char *path, const char *name, void *value, uint64_t size, uint16_t id, struct adios_group_struct *group)
+{
+    struct var_dim *vd=calloc(1,sizeof(struct var_dim));
+
+    vd->dgroup = group;
+    vd->did = id;
+    strcpy(vd->dpath, path);
+    strcpy(vd->dname, name);
+    vd->dvalue = value;
+    vd->dsize  = size;
+
+    return(vd);
+}
+static void var_dim_free(void *vd)
+{
+    free(vd);
+}
+static int var_dim_equal(const struct var_dim *vd1, const struct var_dim *vd2)
+{
+    if ((strcmp(vd1->dpath, vd2->dpath) == 0) && (strcmp(vd1->dname, vd2->dname) == 0)) return TRUE;
+
+    return FALSE;
+}
+static struct var_dim *var_dim_find(struct adios_group_struct *group, const char *path, const char *name)
+{
+    ListElmt *elmt;
+    struct var_dim *vd;
+
+    if (DEBUG>2) printf("looking for group(%p) dpath(%s) dname(%s)\n", group, path, name);
+
+    elmt = list_head(&var_dim_list);
+    while(elmt) {
+        vd = list_data(elmt);
+        if (DEBUG>2) printf("comparing to group(%p) dpath(%s) dname(%s)\n", vd->dgroup, vd->dpath, vd->dname);
+        if ((group == vd->dgroup) && (strcmp(path, vd->dpath) == 0) && (strcmp(name, vd->dname) == 0)) {
+            if (DEBUG>2) printf(" group(%p) dpath(%s) dname(%s) matches search\n", vd->dgroup, vd->dpath, vd->dname);
+            return vd;
+        }
+        elmt = list_next(elmt);
+    }
+
+    return NULL;
+}
+static struct var_dim *var_dim_find_by_id(const uint16_t id)
+{
+    ListElmt *elmt;
+    struct var_dim *vd;
+
+    if (DEBUG>2) printf("looking for did(%d)\n", id);
+
+    elmt = list_head(&var_dim_list);
+    while(elmt) {
+        vd = list_data(elmt);
+        if (DEBUG>2) printf("comparing to did(%d)\n", vd->did);
+        if (vd->did == id) {
+            if (DEBUG>2) printf("did(%d) dpath(%s) dname(%s) matches search\n", vd->did, vd->dpath, vd->dname);
+            return vd;
+        }
+        elmt = list_next(elmt);
+    }
+
+    return NULL;
+}
+static void var_dim_printall(void)
+{
+    ListElmt *elmt;
+    struct var_dim *vd;
+
+    elmt = list_head(&var_dim_list);
+    while(elmt) {
+        vd = list_data(elmt);
+        if (DEBUG>3) printf("dpath(%s) dname(%s)\n", vd->dpath, vd->dname);
+        elmt = list_next(elmt);
+    }
+}
+
+static void parse_dimension_size(
+        struct adios_group_struct *group,
+        struct adios_var_struct *pvar_root,
+        struct adios_attribute_struct *patt_root,
+        struct adios_dimension_item_struct *dim,
+        size_t *dimsize)
+{
+    struct adios_var_struct *var_linked = NULL;
+    struct adios_attribute_struct *attr_linked;
+    if (dim->id) {
+        var_linked = adios_find_var_by_id (pvar_root , dim->id);
+        if (!var_linked) {
+            attr_linked = adios_find_attribute_by_id (patt_root, dim->id);
+            if (!attr_linked->var) {
+                switch (attr_linked->type) {
+                case adios_unsigned_byte:
+                    *dimsize = *(uint8_t *)attr_linked->value;
+                    break;
+                case adios_byte:
+                    *dimsize = *(int8_t *)attr_linked->value;
+                    break;
+                case adios_unsigned_short:
+                    *dimsize = *(uint16_t *)attr_linked->value;
+                    break;
+                case adios_short:
+                    *dimsize = *(int16_t *)attr_linked->value;
+                    break;
+                case adios_unsigned_integer:
+                    *dimsize = *(uint32_t *)attr_linked->value;
+                    break;
+                case adios_integer:
+                    *dimsize = *(int32_t *)attr_linked->value;
+                    break;
+                case adios_unsigned_long:
+                    *dimsize = *(uint64_t *)attr_linked->value;
+                    break;
+                case adios_long:
+                    *dimsize = *(int64_t *)attr_linked->value;
+                    break;
+                default:
+                    fprintf (stderr, "Invalid datatype for array dimension on "
+                            "var %s: %s\n"
+                            ,attr_linked->name
+                            ,adios_type_to_string_int (var_linked->type)
+                    );
+                    break;
+                }
+            } else {
+                var_linked = attr_linked->var;
+            }
+        }
+        if (var_linked && var_linked->data) {
+            *dimsize = *(int *)var_linked->data;
+        }
+    } else {
+        if (dim->time_index == adios_flag_yes) {
+            *dimsize = 1;
+        } else {
+            *dimsize = dim->rank;
+        }
+    }
+
+    return;
+}
+static void parse_dimension_name(
+        struct adios_group_struct *group,
+        struct adios_var_struct *pvar_root,
+        struct adios_attribute_struct *patt_root,
+        struct adios_dimension_item_struct *dim,
+        char *dimname)
+{
+    struct adios_var_struct *var_linked = NULL;
+    struct adios_attribute_struct *attr_linked;
+    if (dim->id) {
+        var_linked = adios_find_var_by_id (pvar_root , dim->id);
+        if (!var_linked) {
+            attr_linked = adios_find_attribute_by_id (patt_root, dim->id);
+            if (!attr_linked->var) {
+//				strcpy(dimname, attr_linked->name);
+                sprintf(dimname, "%s", attr_linked->name);
+            } else {
+                var_linked = attr_linked->var;
+            }
+        }
+        if (var_linked && var_linked->name) {
+//			strcpy(dimname, var_linked->name);
+            sprintf(dimname, "%s", var_linked->name);
+        }
+    } else {
+        if (dim->time_index == adios_flag_yes) {
+//			strcpy(dimname, group->time_index_name);
+            sprintf(dimname, "%s", group->time_index_name);
+        } else {
+            dimname[0] = '\0';
+        }
+    }
+
+    return;
+}
+
+
+static int gen_offset_list(
+        struct adios_group_struct *group,
+        struct adios_var_struct *pvar_root,
+        struct adios_attribute_struct *patt_root)
+{
+    struct adios_var_struct *v;
+    struct adios_dimension_struct *dims;
+    struct var_info *vi;
+    char offset_name[255];
+    uint64_t *value;
+
+    v = pvar_root;
+    while (v) {
+        dims=v->dimensions;
+        int loffs_idx=0;
+        while (dims) {
+            parse_dimension_name(group, pvar_root, patt_root, &dims->local_offset, offset_name);
+            if (offset_name[0] == '\0') {
+                sprintf(offset_name, "offset_%d", loffs_idx);
+            }
+            if (DEBUG>3) printf("gen: offset_name(%s)\n", offset_name);
+            value=calloc(1,sizeof(uint64_t));
+            parse_dimension_size(group, pvar_root, patt_root, &dims->local_offset, value);
+
+            uint64_t vsize = 4; /* adios_get_var_size(v, group, value); */
+            vi = var_offset_create(v->path, offset_name, value, vsize, dims->local_offset.id, group);
+            list_ins_next(&var_offset_list, list_tail(&var_offset_list), vi);
+
+            loffs_idx++;
+            dims = dims->next;
+        }
+        v = v->next;
+    }
+}
+
+static void create_offset_list_for_var(
+        struct adios_var_struct *v,
+        struct adios_group_struct *group,
+        struct adios_var_struct *pvar_root,
+        struct adios_attribute_struct *patt_root,
+        u_int *offset_count,
+        struct adios_var **offset_values)
+{
+    struct adios_dimension_struct *dims;
+    char offset_name[255];
+
+    *offset_count=0;
+    *offset_values=NULL;
+
+    if ((v) && (v->dimensions)) {
+        int local_offset_count=0;
+        dims=v->dimensions;
+        while (dims) {
+            if (dims->dimension.time_index == adios_flag_yes) {
+                dims = dims->next;
+                continue;
+            }
+            parse_dimension_name(group, pvar_root, patt_root, &dims->local_offset, offset_name);
+            local_offset_count++;
+            dims = dims->next;
+        }
+
+        *offset_count=local_offset_count;
+        *offset_values=calloc(local_offset_count, sizeof(struct adios_var));
+
+        dims=v->dimensions;
+        int loffs_idx=0;
+        while (dims) {
+            if (dims->dimension.time_index == adios_flag_yes) {
+                dims = dims->next;
+                continue;
+            }
+            parse_dimension_name(group, pvar_root, patt_root, &dims->local_offset, offset_name);
+            if (offset_name[0] == '\0') {
+                sprintf(offset_name, "%s_%s_offset_%d", /*v->path*/"", v->name, loffs_idx);
+                (*offset_values)[loffs_idx].is_anonymous=TRUE;
+            }
+            (*offset_values)[loffs_idx].vpath=strdup(v->path);
+            (*offset_values)[loffs_idx].vname=strdup(offset_name);
+//            struct var_offset *vo=var_offset_find("", offset_name);
+//            memcpy(&(args->offsets.offsets_val[loffs_idx].vdata), vo->ovalue, vo->osize);
+//            args->offsets.offsets_val[loffs_idx].vdatasize=vo->osize;
+//            printf("create: offset_name(%s) offset_value(%lu)\n", offset_name, vo->ovalue);
+            uint64_t value=0;
+            parse_dimension_size(group, pvar_root, patt_root, &dims->local_offset, &value);
+            memcpy(&((*offset_values)[loffs_idx].vdata), &value, 4);
+            (*offset_values)[loffs_idx].vdatasize=4;
+            if (DEBUG>3) printf("create: offset_name(%s) offset_value(%lu)\n", offset_name, value);
+
+            loffs_idx++;
+            dims = dims->next;
+        }
+    }
+}
+
+static int gen_dim_list(
+        struct adios_group_struct *group,
+        struct adios_var_struct *pvar_root,
+        struct adios_attribute_struct *patt_root)
+{
+    struct adios_var_struct *v;
+    struct adios_dimension_struct *dims;
+    struct var_info *vi;
+    char dim_name[255];
+    uint64_t *value;
+
+    v = pvar_root;
+    while (v) {
+        dims=v->dimensions;
+        int dim_idx=0;
+        while (dims) {
+            parse_dimension_name(group, pvar_root, patt_root, &dims->dimension, dim_name);
+            if (dim_name[0] == '\0') {
+                sprintf(dim_name, "dim_%d", dim_idx);
+            }
+            if (DEBUG>3) printf("gen: dim_name(%s)\n", dim_name);
+            value=calloc(1,sizeof(uint64_t));
+            parse_dimension_size(group, pvar_root, patt_root, &dims->dimension, value);
+            if (global_rank==0) {
+                if (DEBUG>3) printf(":o(%d)", *value);
+            }
+
+            uint64_t vsize = 4; /* adios_get_var_size(v, group, value); */
+            vi = var_dim_create(v->path, dim_name, value, vsize, dims->dimension.id, group);
+            list_ins_next(&var_dim_list, list_tail(&var_dim_list), vi);
+
+            dim_idx++;
+            dims = dims->next;
+        }
+        v = v->next;
+    }
+}
+
+static void create_dim_list_for_var(
+        struct adios_var_struct *v,
+        struct adios_group_struct *group,
+        struct adios_var_struct *pvar_root,
+        struct adios_attribute_struct *patt_root,
+        u_int *dim_count,
+        struct adios_var **dim_values)
+{
+    struct adios_dimension_struct *dims;
+    char dim_name[255];
+
+    *dim_count=0;
+    *dim_values=NULL;
+
+    if ((v) && (v->dimensions)) {
+        int local_dim_count=0;
+        dims=v->dimensions;
+        while (dims) {
+            if (dims->dimension.time_index == adios_flag_yes) {
+                dims = dims->next;
+                continue;
+            }
+            parse_dimension_name(group, pvar_root, patt_root, &dims->dimension, dim_name);
+            local_dim_count++;
+            dims = dims->next;
+        }
+
+        *dim_count=local_dim_count;
+        *dim_values=calloc(local_dim_count, sizeof(struct adios_var));
+
+        dims=v->dimensions;
+        int dim_idx=0;
+        while (dims) {
+            if (dims->dimension.time_index == adios_flag_yes) {
+                dims = dims->next;
+                continue;
+            }
+            parse_dimension_name(group, pvar_root, patt_root, &dims->dimension, dim_name);
+            if (dim_name[0] == '\0') {
+                sprintf(dim_name, "%s_%s_dim_%d", /*v->path*/"", v->name, dim_idx);
+                (*dim_values)[dim_idx].is_anonymous=TRUE;
+            }
+            (*dim_values)[dim_idx].vpath=strdup(v->path);
+            (*dim_values)[dim_idx].vname=strdup(dim_name);
+//            struct var_dim *vd=var_dim_find("", dim_name);
+//            memcpy(&(args->dims.dims_val[dim_idx].vdata), vd->dvalue, vd->dsize);
+//            args->dims.dims_val[dim_idx].vdatasize=vd->dsize;
+            uint64_t value=0;
+            parse_dimension_size(group, pvar_root, patt_root, &dims->dimension, &value);
+            memcpy(&((*dim_values)[dim_idx].vdata), &value, 4);
+            (*dim_values)[dim_idx].vdatasize=4;
+            if (DEBUG>3) printf("create: dim_name(%s) dvalue(%lu)\n", dim_name, value);
+            if (global_rank==0) {
+                if (DEBUG>3) printf(":o(%d)", value);
+            }
+
+            dim_idx++;
+            dims = dims->next;
+        }
+    }
+}
+
+static int read_var(
+        struct adios_nssi_file_data_struct *file_data,
+        struct adios_group_struct *group,
+        struct adios_var_struct *pvar_root,
+        struct adios_attribute_struct *patt_root,
+        struct adios_var_struct *pvar)
+{
+    int return_code=0;
+    int i, rc;
+
+    adios_read_args args;
+    adios_read_res  res;
+
+    memset(&args, 0, sizeof(adios_read_args));
+    args.fd    = file_data->fd;
+    args.max_read = pvar->data_size;
+    args.vpath = strdup(pvar->path);
+    args.vname = strdup(pvar->name);
+
+
+    if (pvar->dimensions) {
+        args.is_scalar = FALSE;
+    } else {
+        args.is_scalar = TRUE;
+    }
+
+    args.offsets.offsets_len=0;
+    args.offsets.offsets_val=NULL;
+    args.dims.dims_len=0;
+    args.dims.dims_val=NULL;
+    if (pvar->dimensions) {
+        create_offset_list_for_var(
+                 pvar,
+                 group,
+                 group->vars,
+                 group->attributes,
+                 &args.offsets.offsets_len,
+                 &args.offsets.offsets_val);
+        create_dim_list_for_var(
+                 pvar,
+                 group,
+                 group->vars,
+                 group->attributes,
+                 &args.dims.dims_len,
+                 &args.dims.dims_val);
+     }
+
+    Func_Timer("ADIOS_READ_OP",
+            rc = nssi_call_rpc_sync(&svcs[file_data->svc_index],
+            ADIOS_READ_OP,
+            &args,
+            pvar->data,
+            pvar->data_size,
+            &res););
+    if (rc != NSSI_OK) {
+        fprintf(stderr, "NSSI ERROR: ADIOS_READ_OP failed\n");
+        return_code=-2;
+    }
+
+    free(args.vpath);
+    free(args.vname);
+    if (pvar->dimensions) {
+        for (i=0;i<args.offsets.offsets_len;i++) {
+            free(args.offsets.offsets_val[i].vpath);
+            free(args.offsets.offsets_val[i].vname);
+        }
+        free(args.offsets.offsets_val);
+        for (i=0;i<args.dims.dims_len;i++) {
+            free(args.dims.dims_val[i].vpath);
+            free(args.dims.dims_val[i].vname);
+        }
+        free(args.dims.dims_val);
+    }
+
+    return return_code;
+}
+static int write_var(
+        struct adios_nssi_file_data_struct *file_data,
+        struct adios_group_struct *group,
+        struct adios_var_struct *pvar_root,
+        struct adios_attribute_struct *patt_root,
+        struct adios_var_struct *pvar,
+        uint64_t var_size,
+        enum ADIOS_FLAG fortran_flag)
+{
+    int i;
+    int rc;
+    int return_code=0;
+
+    adios_write_args args;
+    adios_write_res  res;
+
+//    var_offset_printall();
+
+    memset(&args, 0, sizeof(adios_write_args));
+    args.fd    = file_data->fd;
+    args.vpath = strdup(pvar->path);
+    args.vname = strdup(pvar->name);
+    args.vsize = var_size;
+    args.atype = pvar->type;
+    if (pvar->dimensions) {
+        args.is_scalar = FALSE;
+    } else {
+        args.is_scalar = TRUE;
+    }
+    args.writer_rank=file_data->rank;
+    args.offsets.offsets_len=0;
+    args.offsets.offsets_val=NULL;
+    args.dims.dims_len=0;
+    args.dims.dims_val=NULL;
+    if (pvar->dimensions) {
+        create_offset_list_for_var(
+                 pvar,
+                 group,
+                 group->vars,
+                 group->attributes,
+                 &args.offsets.offsets_len,
+                 &args.offsets.offsets_val);
+        create_dim_list_for_var(
+                 pvar,
+                 group,
+                 group->vars,
+                 group->attributes,
+                 &args.dims.dims_len,
+                 &args.dims.dims_val);
+     }
+
+    Func_Timer("ADIOS_WRITE_OP",
+            rc = nssi_call_rpc_sync(&svcs[file_data->svc_index],
+            ADIOS_WRITE_OP,
+            &args,
+            pvar->data,
+            var_size,
+            &res););
+    if (rc != NSSI_OK) {
+        fprintf(stderr, "NSSI ERROR: ADIOS_WRITE_OP failed\n");
+        return_code=-2;
+    }
+
+    // looking for alternatives to this barrier.
+    // if variable writes on the staging server are collective (NC4), then clients must stay in sync.
+    // one solution is to cache scalar writes in addition to array writes.
+    MPI_Barrier(file_data->group_comm);
+
+    free(args.vpath);
+    free(args.vname);
+    if (pvar->dimensions) {
+        for (i=0;i<args.offsets.offsets_len;i++) {
+            free(args.offsets.offsets_val[i].vpath);
+            free(args.offsets.offsets_val[i].vname);
+        }
+        free(args.offsets.offsets_val);
+        for (i=0;i<args.dims.dims_len;i++) {
+            free(args.dims.dims_val[i].vpath);
+            free(args.dims.dims_val[i].vname);
+        }
+        free(args.dims.dims_val);
+    }
+
+    return return_code;
+}
+
+
+static void adios_var_to_comm_nssi(
+        enum ADIOS_FLAG host_language_fortran,
+        void *data,
+        MPI_Comm *comm)
+{
+    if (data) {
+        int t = *(int *) data;
+        if (host_language_fortran == adios_flag_yes) {
+            *comm = MPI_Comm_f2c (t);
+        } else {
+            *comm = *(MPI_Comm *) data;
+        }
+    } else {
+        fprintf (stderr, "coordination-communication not provided. "
+                "Using MPI_COMM_WORLD instead\n");
+        *comm = MPI_COMM_WORLD;
+    }
+
+    return;
+}
+
+void adios_nssi_init(
+        const char *parameters,
+        struct adios_method_struct *method)
+{
+    int rc=NSSI_OK;
+    int verbose=5;
+    char logfile[1024];
+    int log_rank;
+    struct adios_nssi_method_data_struct *private;
+
+    if (!adios_nssi_initialized) {
+        adios_nssi_initialized = 1;
+    }
+
+    MPI_Comm_rank(MPI_COMM_WORLD, &global_rank);
+    MPI_Comm_size(MPI_COMM_WORLD, &global_size);
+
+    if (DEBUG>3) printf("rank(%d) enter adios_nssi_init\n", global_rank);
+
+//    MPI_Comm_rank(file_data->group_comm, &log_rank);
+//    sprintf(logfile, "%s.%04d", "adios_nssi_client.log", log_rank);
+//    logger_init((log_level)verbose, logfile);
+
+//    logger_init((log_level)verbose, NULL);
+
+#ifdef HAVE_PORTALS
+    nssi_ptl_init(PTL_IFACE_CLIENT, getpid() + 1000);
+    nssi_rpc_init(NSSI_RPC_PTL, NSSI_RPC_XDR);
+#endif
+#ifdef HAVE_INFINIBAND
+    nssi_ib_init(NULL);
+    rc = nssi_rpc_init(NSSI_RPC_IB, NSSI_RPC_XDR);
+#endif
+
+    /* Register the client operations */
+    NSSI_REGISTER_CLIENT_STUB(ADIOS_OPEN_OP, adios_open_args, void, adios_open_res);
+    NSSI_REGISTER_CLIENT_STUB(ADIOS_GROUP_SIZE_OP, adios_group_size_args, void, void);
+    NSSI_REGISTER_CLIENT_STUB(ADIOS_READ_OP, adios_read_args, void, adios_read_res);
+    NSSI_REGISTER_CLIENT_STUB(ADIOS_WRITE_OP, adios_write_args, void, adios_write_res);
+    NSSI_REGISTER_CLIENT_STUB(ADIOS_END_ITER_OP, adios_end_iter_args, void, void);
+    NSSI_REGISTER_CLIENT_STUB(ADIOS_START_CALC_OP, adios_start_calc_args, void, void);
+    NSSI_REGISTER_CLIENT_STUB(ADIOS_STOP_CALC_OP, adios_stop_calc_args, void, void);
+    NSSI_REGISTER_CLIENT_STUB(ADIOS_CLOSE_OP, adios_close_args, void, void);
+
+    list_init(&open_file_list, open_file_free);
+    list_init(&var_offset_list, var_offset_free);
+    list_init(&var_dim_list, var_dim_free);
+
+    private = malloc(sizeof(struct adios_nssi_method_data_struct));
+    private->has_outstanding_req=FALSE;
+    method->method_data = private;
+
+    parse_nssi_config(getenv("ADIOS_NSSI_CONFIG_FILE"), &nssi_cfg);
+
+    return;
+}
+
+
+enum ADIOS_FLAG adios_nssi_should_buffer(
+        struct adios_file_struct *f,
+        struct adios_method_struct *method)
+{
+    int rc=NSSI_OK;
+
+    adios_group_size_args args;
+
+    struct open_file *of=NULL;
+    struct adios_nssi_file_data_struct *file_data=NULL;
+
+    uint64_t max_data_size=0;
+
+    of=open_file_find(method->base_path, f->name);
+    if (of == NULL) {
+        fprintf(stderr, "file is not open.  FAIL.");
+        return adios_flag_no;
+    }
+    file_data=of->file_data;
+
+    if (DEBUG>3) printf("rank(%d) enter adios_nssi_should_buffer (write_size_bytes=%lu)\n", global_rank, f->write_size_bytes);
+
+    args.fd = file_data->fd;
+    MPI_Reduce(
+            &f->write_size_bytes,
+            &max_data_size,
+            1,
+            MPI_UNSIGNED_LONG,
+            MPI_SUM,
+            0,
+            file_data->collective_op_comm);
+    if (file_data->collective_op_rank == 0) {
+        if (DEBUG > 3) printf("max_data_size==%lu\n", max_data_size);
+        args.data_size = max_data_size*file_data->collective_op_size;
+        args.data_size = max_data_size;
+        if (DEBUG > 3) printf("args.data_size==%lu\n", args.data_size);
+
+        Func_Timer("ADIOS_GROUP_SIZE_OP",
+                rc = nssi_call_rpc_sync(&svcs[file_data->svc_index],
+                        ADIOS_GROUP_SIZE_OP,
+                        &args,
+                        NULL,
+                        0,
+                        NULL););
+        if (rc != NSSI_OK) {
+            fprintf(stderr, "NSSI ERROR: ADIOS_GROUP_SIZE_OP failed\n");
+        }
+    }
+    // this barrier ensures that none of the clients race ahead and
+    // attempt writes before the file is open and prepped on the staging server.
+    MPI_Barrier(file_data->group_comm);
+
+    return adios_flag_no;
+}
+
+int adios_nssi_open(
+        struct adios_file_struct *f,
+        struct adios_method_struct *method,
+        void *comm)
+{
+    int rc=NSSI_OK;
+
+    adios_open_args args;
+    adios_open_res  res;
+
+    struct open_file *of=NULL;
+    struct adios_nssi_file_data_struct *file_data=NULL;
+
+    if (DEBUG>3) printf("rank(%d) enter adios_nssi_open\n", global_rank);
+
+    of=open_file_find(method->base_path, f->name);
+    if (of == NULL) {
+        file_data             = malloc(sizeof(struct adios_nssi_file_data_struct));
+        file_data->fd         = -1;
+        file_data->group_comm = MPI_COMM_NULL;
+        file_data->size       = 0;
+        file_data->rank       = -1;
+
+        file_data->comm = NULL;
+
+        file_data->svc_index=-1;
+        file_data->collective_op_comm=MPI_COMM_NULL;
+        file_data->collective_op_size=0;
+        file_data->collective_op_rank=-1;
+
+        file_data->use_single_server=FALSE;
+
+        of=open_file_create(method->base_path, f->name, file_data);
+    } else {
+        // sanity check
+        if (file_data->fd == -1) {
+            if (DEBUG>3) printf("open: %s is open but fd==-1.  sanity check failed.  attempting reopen.\n", f->name);
+            open_file_delete(of->fpath, of->fname);
+        } else {
+            // file already open
+            return adios_flag_no;
+        }
+    }
+
+    if (DEBUG>3) printf("global_rank(%d): enter adios_nssi_open (%s)\n", global_rank, f->name);
+
+    file_data->comm = comm;
+    if (DEBUG>3) printf("global_rank(%d): adios_nssi_open: setup group_comm\n", global_rank);
+    adios_var_to_comm_nssi(f->group->adios_host_language_fortran, file_data->comm, &file_data->group_comm);
+    if (file_data->group_comm != MPI_COMM_NULL) {
+        if (DEBUG>3) printf("global_rank(%d): adios_nssi_open: get rank and size\n", global_rank);
+        MPI_Comm_rank(file_data->group_comm, &file_data->rank);
+        MPI_Comm_size(file_data->group_comm, &file_data->size);
+        if (DEBUG>3) printf("global_rank(%d): adios_nssi_open: size(%d) rank(%d)\n", global_rank, file_data->size, file_data->rank);
+    } else {
+        file_data->group_comm=MPI_COMM_SELF;
+    }
+    f->group->process_id = file_data->rank;
+
+    if (file_data->size <= nssi_cfg.num_servers) {
+        // there are fewer clients than servers.
+        // assume file-per-process and use a single server for this file.
+        file_data->use_single_server=TRUE;
+        if (file_data->size < global_size) {
+            // a subset of all clients is writing
+            file_data->svc_index = ((global_rank/file_data->size)%nssi_cfg.num_servers);
+        } else {
+            file_data->svc_index = 0;
+        }
+    } else {
+        file_data->use_single_server=FALSE;
+        if ((file_data->size%nssi_cfg.num_servers) > 0) {
+            file_data->svc_index = file_data->rank/((file_data->size/nssi_cfg.num_servers)+1);
+        } else {
+            file_data->svc_index = file_data->rank/(file_data->size/nssi_cfg.num_servers);
+        }
+    }
+
+    /* create a new communicator for just those clients, who share a default service. */
+    if (DEBUG>3) printf("global_rank(%d): adios_nssi_open: before MPI_Comm_split\n", global_rank);
+    MPI_Comm_split(file_data->group_comm, file_data->svc_index, file_data->rank, &file_data->collective_op_comm);
+    if (DEBUG>3) printf("global_rank(%d): adios_nssi_open: after MPI_Comm_split\n", global_rank);
+    /* find my rank in the new communicator */
+    if (DEBUG>3) printf("global_rank(%d): adios_nssi_open: before MPI_Comm_size\n", global_rank);
+    MPI_Comm_size(file_data->collective_op_comm, &file_data->collective_op_size);
+    if (DEBUG>3) printf("global_rank(%d): adios_nssi_open: before MPI_Comm_rank\n", global_rank);
+    MPI_Comm_rank(file_data->collective_op_comm, &file_data->collective_op_rank);
+
+    if (DEBUG>3) printf("global_rank(%d) file_data->rank(%d) file_data->collective_op_rank(%d) default_service(%d)\n", global_rank, file_data->rank, file_data->collective_op_rank, file_data->svc_index);
+
+    svcs=(nssi_service *)calloc(nssi_cfg.num_servers, sizeof(nssi_service));
+    /* !global_rank0 has a preferred server for data transfers.  connect to preferred server.
+     * connect to other servers on-demand.
+     */
+    double GetSvcTime=MPI_Wtime();
+    if (DEBUG>3) printf("get staging-service: file_data->svc_index(%d) nid(%lld) pid(%llu) hostname(%s) port(%d)\n",
+            file_data->svc_index,
+            nssi_cfg.nssi_server_ids[file_data->svc_index].nid,
+            nssi_cfg.nssi_server_ids[file_data->svc_index].pid,
+            nssi_cfg.nssi_server_ids[file_data->svc_index].hostname,
+            nssi_cfg.nssi_server_ids[file_data->svc_index].port);
+    rc = nssi_get_service(nssi_cfg.nssi_server_ids[file_data->svc_index], -1, &svcs[file_data->svc_index]);
+    if (rc != NSSI_OK) {
+        fprintf(stderr, "NSSI ERROR: nssi_get_service failed\n");
+        return;
+    }
+
+
+    gen_offset_list(
+            f->group,
+            f->group->vars,
+            f->group->attributes);
+    gen_dim_list(
+            f->group,
+            f->group->vars,
+            f->group->attributes);
+    var_offset_printall();
+
+    args.fname = malloc(sizeof(char) * (strlen(method->base_path) + strlen(f->name) + 1));
+    sprintf(args.fname, "%s%s", method->base_path, f->name);
+    args.gname = strdup(method->group->name);
+    switch(f->mode) {
+        case adios_mode_read:
+            args.mode = ADIOS_MODE_READ;
+            break;
+        case adios_mode_write:
+            args.mode = ADIOS_MODE_WRITE;
+            break;
+        case adios_mode_append:
+            args.mode = ADIOS_MODE_APPEND;
+            break;
+        case adios_mode_update:
+            args.mode = ADIOS_MODE_UPDATE;
+            break;
+    }
+    args.use_single_server=file_data->use_single_server;
+
+    Func_Timer("ADIOS_OPEN_OP",
+            rc = nssi_call_rpc_sync(&svcs[file_data->svc_index],
+            ADIOS_OPEN_OP,
+            &args,
+            NULL,
+            0,
+            &res););
+    if (rc != NSSI_OK) {
+        fprintf(stderr, "NSSI ERROR: ADIOS_OPEN_OP failed\n");
+    }
+
+    file_data->fd = res.fd;
+
+    list_ins_next(&open_file_list, list_tail(&open_file_list), of);
+
+    free(args.fname);
+    free(args.gname);
+
+    return 1;
+}
+
+void adios_nssi_start_calculation(
+        struct adios_method_struct * method)
+{
+    int rc=NSSI_OK;
+    int myrank;
+
+    adios_start_calc_args args;
+
+    ListElmt *of_elmt;
+    struct open_file *of=NULL;
+    struct adios_nssi_file_data_struct *file_data=NULL;
+
+    if (DEBUG>3) printf("rank(%d) enter adios_nssi_start_calc\n", global_rank);
+
+    of_elmt = list_head(&open_file_list);
+    while(of_elmt) {
+        of = list_data(of_elmt);
+        if (of == NULL) {
+            fprintf(stderr, "file is not open.  FAIL.");
+            return;
+        }
+        file_data=of->file_data;
+        myrank=file_data->rank;
+
+        if (of->has_outstanding_req == FALSE) {
+            if (file_data->collective_op_rank == 0) {
+                args.fd = file_data->fd;
+                Func_Timer("ADIOS_START_CALC_OP",
+                        rc = nssi_call_rpc(&svcs[file_data->svc_index],
+                                ADIOS_START_CALC_OP,
+                                &args,
+                                NULL,
+                                0,
+                                NULL,
+                                &of->start_calc_req););
+                if (rc != NSSI_OK) {
+                    fprintf(stderr, "NSSI ERROR: ADIOS_START_CALC_OP failed\n");
+                } else {
+                    of->has_outstanding_req=TRUE;
+                }
+            }
+        } else {
+            if (DEBUG>3) fprintf(stderr, "rank(%d) has an outstanding ADIOS_START_CALC_OP.  skipping.\n", global_rank);
+        }
+
+        of_elmt = list_next(of_elmt);
+    }
+
+    if (DEBUG>3) printf("rank(%d) exit adios_nssi_start_calc\n", global_rank);
+
+    return;
+}
+
+void adios_nssi_end_iteration(
+        struct adios_method_struct * method)
+{
+    int rc=NSSI_OK;
+    int myrank;
+
+    if (DEBUG>3) printf("rank(%d) enter adios_nssi_end_iter\n", global_rank);
+
+
+//    adios_end_iter_args args;
+//
+//    struct open_file *of=NULL;
+//    struct adios_nssi_file_data_struct *file_data=NULL;
+//
+//    of=open_file_find(method->base_path, f->name);
+//    if (of == NULL) {
+//        fprintf(stderr, "file is not open.  FAIL.");
+//        return;
+//    }
+//    file_data=of->file_data;
+//
+//    myrank=file_data->rank;
+//
+//    if (file_data->collective_op_rank == 0) {
+//        args.fd = file_data->fd;
+//        Func_Timer("ADIOS_END_ITER_OP",
+//                rc = nssi_call_rpc_sync(&svcs[file_data->svc_index],
+//                ADIOS_END_ITER_OP,
+//                &args,
+//                NULL,
+//                0,
+//                NULL););
+//        if (rc != NSSI_OK) {
+//            //log_error(adios_nssi_debug_level, "unable to call remote adios_read");
+//        }
+//    }
+
+    return;
+}
+
+void adios_nssi_stop_calculation(
+        struct adios_method_struct * method)
+{
+    int rc=NSSI_OK;
+    int remote_rc=NSSI_OK;
+    int myrank;
+
+    adios_stop_calc_args args;
+
+    ListElmt *of_elmt;
+    struct open_file *of=NULL;
+    struct adios_nssi_file_data_struct *file_data=NULL;
+
+    if (DEBUG>3) printf("rank(%d) enter adios_nssi_stop_calc\n", global_rank);
+
+
+    of_elmt = list_head(&open_file_list);
+    while(of_elmt) {
+        of = list_data(of_elmt);
+        if (of == NULL) {
+            fprintf(stderr, "file is not open.  FAIL.");
+            return;
+        }
+        file_data=of->file_data;
+        myrank=file_data->rank;
+
+        if (of->has_outstanding_req == TRUE) {
+            // wait for any async writes to finish
+            if (file_data->collective_op_rank == 0) {
+                Func_Timer("ADIOS_START_CALC_OP nssi_wait",
+                        rc=nssi_wait(&of->start_calc_req, &remote_rc););
+                if (rc != NSSI_OK) {
+                    fprintf(stderr, "NSSI ERROR: unable to wait for remote ADIOS_START_CALC_OP\n");
+                }
+                if (remote_rc != NSSI_OK) {
+                    fprintf(stderr, "NSSI ERROR: ADIOS_START_CALC_OP failed\n");
+                }
+                of->has_outstanding_req = FALSE;
+            }
+        } else {
+            if (DEBUG>3) fprintf(stderr, "rank(%d) has no outstanding ADIOS_START_CALC_OP.  skipping.\n", global_rank);
+        }
+
+        of_elmt = list_next(of_elmt);
+    }
+
+
+    of_elmt = list_head(&open_file_list);
+    while(of_elmt) {
+        of = list_data(of_elmt);
+        if (of == NULL) {
+            fprintf(stderr, "file is not open.  FAIL.");
+            return;
+        }
+        file_data=of->file_data;
+        myrank=file_data->rank;
+
+        if (file_data->collective_op_rank == 0) {
+            args.fd = file_data->fd;
+            Func_Timer("ADIOS_STOP_CALC_OP",
+                    rc = nssi_call_rpc_sync(&svcs[file_data->svc_index],
+                            ADIOS_STOP_CALC_OP,
+                            &args,
+                            NULL,
+                            0,
+                            NULL););
+            if (rc != NSSI_OK) {
+                fprintf(stderr, "NSSI ERROR: ADIOS_STOP_CALC_OP failed\n");
+            }
+        }
+
+        of_elmt = list_next(of_elmt);
+    }
+
+    if (DEBUG>3) printf("rank(%d) exit adios_nssi_stop_calc\n", global_rank);
+
+    return;
+}
+
+void adios_nssi_write(
+        struct adios_file_struct *f,
+        struct adios_var_struct *v,
+        void *data,
+        struct adios_method_struct *method)
+{
+    static int first_write = 1;
+
+    struct open_file *of=NULL;
+    struct adios_nssi_file_data_struct *file_data=NULL;
+
+    if (DEBUG>3) printf("rank(%d) enter adios_nssi_write\n", global_rank);
+
+//    struct var_offset *vo = var_offset_find_by_id(v->id);
+    struct var_offset *vo = var_offset_find(f->group, "/", v->name);
+    if (vo != NULL) {
+        if (DEBUG>2) printf("rank(%d) var(%s, %s) is an offset.  skip write.\n", global_rank, v->path, v->name);
+        return;
+    }
+//    struct var_dim *vd = var_dim_find_by_id(v->id);
+    struct var_dim *vd = var_dim_find(f->group, "/", v->name);
+    if (vd != NULL) {
+        if (DEBUG>2) printf("rank(%d) var(%s, %s) is a dimension.  skip write.\n", global_rank, v->path, v->name);
+        return;
+    }
+
+    of=open_file_find(method->base_path, f->name);
+    if (of == NULL) {
+        fprintf(stderr, "file is not open.  FAIL.");
+        return;
+    }
+    file_data=of->file_data;
+
+    if (f->mode == adios_mode_write || f->mode == adios_mode_append) {
+
+        if (file_data->rank==0) {
+            if (DEBUG>3) fprintf(stderr, "-------------------------\n");
+            if (DEBUG>3) fprintf(stderr, "write var: %s start!\n", v->name);
+        }
+        uint64_t var_size = adios_get_var_size (v, f->group, data);
+        if (DEBUG>2) printf("rank (%d) adios_nssi_write: vpath(%s) vname(%s) vsize(%ld)\n", global_rank, v->path, v->name, var_size);
+        write_var(file_data,
+                f->group,
+                f->group->vars,
+                f->group->attributes,
+                v,
+                var_size,
+                f->group->adios_host_language_fortran);
+    } else {
+        if (DEBUG>3) fprintf(stderr, "entering unknown nc4 mode %d!\n", f->mode);
+    }
+    if (file_data->rank==0) {
+        if (DEBUG>3) fprintf(stderr, "write var: %s end!\n", v->name);
+        if (DEBUG>3) fprintf(stderr, "-------------------------\n");
+    }
+
+    return;
+}
+
+
+void adios_nssi_read(
+        struct adios_file_struct *f,
+        struct adios_var_struct *v,
+        void *buffer,
+        uint64_t buffersize,
+        struct adios_method_struct *method)
+{
+    struct open_file *of=NULL;
+    struct adios_nssi_file_data_struct *file_data=NULL;
+
+    if (DEBUG>3) printf("rank(%d) enter adios_nssi_read\n", global_rank);
+
+    of=open_file_find(method->base_path, f->name);
+    if (of == NULL) {
+        fprintf(stderr, "file is not open.  FAIL.");
+        return;
+    }
+    file_data=of->file_data;
+
+    if(f->mode == adios_mode_read) {
+        v->data = buffer;
+        v->data_size = buffersize;
+
+        if (v->is_dim == adios_flag_yes) {
+            // this is a dimension variable.  values in the file are unreliable.
+            // assume the caller provided a valid value in 'buffer'.
+            if (DEBUG>3) fprintf(stderr, "------------------------------\n");
+            if (DEBUG>3) fprintf(stderr, "read var: %s! skipping dim var\n", v->name);
+            if (DEBUG>3) fprintf(stderr, "------------------------------\n");
+            return;
+        }
+
+        if (file_data->rank==0) {
+            if (DEBUG>3) fprintf(stderr, "-------------------------\n");
+            if (DEBUG>3) fprintf(stderr, "read var: %s! start\n", v->name);
+        }
+        if (DEBUG>3) printf("rank (%d) adios_nssi_read: vname(%s) vsize(%ld)\n", global_rank, v->name, v->data_size);
+        read_var(file_data,
+                f->group,
+                f->group->vars,
+                f->group->attributes,
+                v);
+        if (file_data->rank==0) {
+            if (DEBUG>3) fprintf(stderr, "read var: %s! end\n", v->name);
+            if (DEBUG>3) fprintf(stderr, "-------------------------\n");
+        }
+    }
+
+    return;
+}
+
+void adios_nssi_close(
+        struct adios_file_struct *f,
+        struct adios_method_struct *method)
+{
+    int rc=NSSI_OK;
+    struct adios_attribute_struct * a = f->group->attributes;
+    int myrank;
+
+    adios_start_calc_args start_calc_args;
+    adios_close_args close_args;
+
+    struct open_file *of=NULL;
+    struct adios_nssi_file_data_struct *file_data=NULL;
+
+    if (DEBUG>3) printf("global_rank(%d) enter adios_nssi_close\n", global_rank);
+
+    of=open_file_find(method->base_path, f->name);
+    if (of == NULL) {
+        fprintf(stderr, "file is not open.  FAIL.");
+        return;
+    }
+    file_data=of->file_data;
+    myrank=file_data->rank;
+
+    if (DEBUG>3) printf("myrank(%d) enter adios_nssi_close\n", myrank);
+
+    if (f->mode == adios_mode_read) {
+        struct adios_var_struct * v = f->group->vars;
+        while (v)
+        {
+            v->data = 0;
+            v = v->next;
+        }
+
+        if (file_data->rank==0) {
+            if (DEBUG>1) fprintf(stderr, "-------------------------\n");
+            if (DEBUG>1) fprintf(stderr, "reading done, NSSI file is virtually closed;\n");
+            if (DEBUG>1) fprintf(stderr, "-------------------------\n");
+        }
+    } else if (f->mode == adios_mode_write || f->mode == adios_mode_append) {
+        //fprintf(stderr, "entering nc4 write attribute mode!\n");
+        if (file_data->rank==0) {
+            if (DEBUG>1) fprintf(stderr, "-------------------------\n");
+            if (DEBUG>1) fprintf(stderr, "writing done, NSSI file is virtually closed;\n");
+            if (DEBUG>1) fprintf(stderr, "-------------------------\n");
+        }
+    }
+
+//    if (file_data->collective_op_rank == 0) {
+//        start_calc_args.fd = file_data->fd;
+//        Func_Timer("ADIOS_START_CALC_OP",
+//                rc = nssi_call_rpc_sync(&svcs[file_data->svc_index],
+//                ADIOS_START_CALC_OP,
+//                &start_calc_args,
+//                NULL,
+//                0,
+//                NULL););
+//        if (rc != NSSI_OK) {
+//            //log_error(adios_nssi_debug_level, "unable to call remote adios_read");
+//        }
+//    }
+
+//    // make sure all clients have finsihed I/O before closing
+//    MPI_Barrier(file_data->group_comm);
+    if (file_data->collective_op_rank == 0) {
+        close_args.fname = malloc(sizeof(char) * (strlen(method->base_path) + strlen(f->name) + 1));
+        sprintf(close_args.fname, "%s%s", method->base_path, f->name);
+        close_args.fd = file_data->fd;
+        if (DEBUG>3) printf("rank(%d) sending ADIOS_CLOSE_OP\n", myrank);
+        Func_Timer("ADIOS_CLOSE_OP",
+                rc = nssi_call_rpc_sync(&svcs[file_data->svc_index],
+                ADIOS_CLOSE_OP,
+                &close_args,
+                NULL,
+                0,
+                NULL););
+        if (rc != NSSI_OK) {
+            fprintf(stderr, "NSSI ERROR: ADIOS_CLOSE_OP failed\n");
+        }
+        free(close_args.fname);
+    }
+
+    open_file_delete(method->base_path, f->name);
+
+    file_data->group_comm = MPI_COMM_NULL;
+    file_data->fd = -1;
+    file_data->rank = -1;
+    file_data->size = 0;
+
+    if (DEBUG>3) printf("global_rank(%d) exit adios_nssi_close\n", global_rank);
+
+    return;
+}
+
+void adios_nssi_finalize(
+        int mype,
+        struct adios_method_struct *method)
+{
+    int rc=NSSI_OK;
+    int myrank;
+
+    if (DEBUG>3) printf("rank(%d) enter adios_nssi_finalize\n", global_rank);
+
+//    adios_close_args close_args;
+//
+//    ListElmt *of_elmt;
+////    ListElmt *req_elmt;
+//    struct open_file *of=NULL;
+//    struct adios_nssi_file_data_struct *file_data=NULL;
+////    nssi_request *req;
+//
+//    of_elmt = list_head(&open_file_list);
+//    while(of_elmt) {
+//        of = list_data(of_elmt);
+//        if (of == NULL) {
+//            fprintf(stderr, "file is not open.  FAIL.");
+//            return;
+//        }
+//        file_data=of->file_data;
+//        myrank=file_data->rank;
+//
+////        req_elmt = list_head(&(of->outstanding_reqs));
+////        while(req_elmt) {
+////        	req = list_data(req_elmt);
+////        	if (req == NULL) {
+////        		fprintf(stderr, "file is not open.  FAIL.");
+////        		return;
+////        	}
+////
+////        	req_elmt = list_next(req_elmt);
+////        }
+//
+//        if (file_data->collective_op_rank == 0) {
+//            close_args.fname = malloc(sizeof(char) * (strlen(of->fpath) + strlen(of->fname) + 1));
+//            sprintf(close_args.fname, "%s%s", of->fpath, of->fname);
+//            close_args.fd = file_data->fd;
+//            Func_Timer("ADIOS_CLOSE_OP",
+//                    rc = nssi_call_rpc_sync(&svcs[file_data->svc_index],
+//                    ADIOS_CLOSE_OP,
+//                    &close_args,
+//                    NULL,
+//                    0,
+//                    NULL););
+//            if (rc != NSSI_OK) {
+//                //log_error(adios_nssi_debug_level, "unable to call remote adios_read");
+//            }
+//            free(close_args.fname);
+//        }
+//
+//        file_data->group_comm = MPI_COMM_NULL;
+//        file_data->fd = -1;
+//        file_data->rank = -1;
+//        file_data->size = 0;
+//
+//        of_elmt = list_next(of_elmt);
+//    }
+
+    free_nssi_config(&nssi_cfg);
+
+    if (adios_nssi_initialized)
+        adios_nssi_initialized = 0;
+}
diff --git a/src/adios_nssi_args.x b/src/adios_nssi_args.x
new file mode 100644
index 0000000..d7241ed
--- /dev/null
+++ b/src/adios_nssi_args.x
@@ -0,0 +1,165 @@
+/* -------------------------------------------------------------------------- */
+/**
+ *   @file adios_nessie_args.x
+ *
+ *   @brief XDR argument structures for the adios proxy.
+ *
+ *   @author Todd Kordenbrock (thkorde\@sandia.gov).
+ *
+ */
+
+/* Extra stuff to put at the beginning of the header file */
+#ifdef RPC_HDR
+/*%#include <sys/syslimits.h>  /* ADIOS_PATH_MAX, ... */
+#endif
+
+/* Extra stuff to put at the beginning of the C file */
+#ifdef RPC_XDR
+%#include <adios.h>
+%#include "adios_nssi_args.h"
+#endif
+
+/**
+ * Operation codes for the adios proxy.
+ */
+enum adios_opcode {
+    ADIOS_NULL_OP = 10000,
+    ADIOS_OPEN_OP,
+    ADIOS_GROUP_SIZE_OP,
+    ADIOS_READ_OP,
+    ADIOS_WRITE_OP,
+    ADIOS_END_ITER_OP,
+    ADIOS_START_CALC_OP,
+    ADIOS_STOP_CALC_OP,
+    ADIOS_CLOSE_OP
+};
+
+
+enum extra_errcodes {
+    ADIOS_ENOTSUPP = -99
+};
+
+enum write_type {
+    WRITE_DIRECT,
+    WRITE_AGGREGATE_INDEPENDENT,
+    WRITE_AGGREGATE_COLLECTIVE,
+    WRITE_CACHING_INDEPENDENT,
+    WRITE_CACHING_COLLECTIVE
+};
+
+enum adios_open_mode {
+    ADIOS_MODE_READ,
+    ADIOS_MODE_WRITE,
+    ADIOS_MODE_APPEND,
+    ADIOS_MODE_UPDATE
+
+};
+
+const ADIOS_PATH_MAX = 256;
+const ADIOS_DIM_MAX = 16;
+
+/* ********* ARGUMENTS FOR STUB FUNCTIONS ************* */
+
+/**
+ * Argument structure for adios_open
+ */
+struct adios_open_args {
+    string          gname<ADIOS_PATH_MAX>;
+    string          fname<ADIOS_PATH_MAX>;
+    adios_open_mode mode;
+    int8_t          use_single_server;
+};
+
+/**
+ * Structure for adios_open result
+ */
+struct adios_open_res {
+    int64_t fd;
+};
+
+/**
+ * Argument structure for adios_group_size
+ */
+struct adios_group_size_args {
+    int64_t  fd;
+    uint64_t data_size;
+};
+
+struct adios_var {
+    uint8_t  is_anonymous;
+    uint64_t vdata;
+    uint64_t vdatasize;
+    string   vpath<ADIOS_PATH_MAX>;
+    string   vname<ADIOS_PATH_MAX>;
+};
+
+/**
+ * Marshaled arguments for adios_read
+ */
+struct adios_read_args {
+    int64_t  fd;
+    string   vpath<ADIOS_PATH_MAX>;
+    string   vname<ADIOS_PATH_MAX>;
+    uint64_t max_read;
+    uint16_t is_scalar;
+    struct adios_var offsets<ADIOS_DIM_MAX>;
+    struct adios_var dims<ADIOS_DIM_MAX>;
+};
+
+/**
+ * Marshaled arguments for adios_read result
+ */
+struct adios_read_res {
+    uint64_t bytes_read;
+};
+
+/**
+ * Marshalled argument structure for adios_write
+ */
+struct adios_write_args {
+    int64_t  fd;
+    string   vpath<ADIOS_PATH_MAX>;
+    string   vname<ADIOS_PATH_MAX>;
+    uint64_t vsize;
+    uint64_t atype;
+    uint16_t is_scalar;
+    int64_t  writer_rank;
+    struct adios_var offsets<ADIOS_DIM_MAX>;
+    struct adios_var dims<ADIOS_DIM_MAX>;
+};
+
+/**
+ * Marshaled arguments for adios_write result
+ */
+struct adios_write_res {
+    uint64_t bytes_written;
+};
+
+/**
+ * Marshalled arguments for adios_end_iteration
+ */
+struct adios_end_iter_args {
+    int64_t fd;
+};
+
+/**
+ * Marshalled arguments for adios_start_calculation
+ */
+struct adios_start_calc_args {
+    int64_t fd;
+};
+
+/**
+ * Marshalled arguments for adios_stop_calculation
+ */
+struct adios_stop_calc_args {
+    int64_t fd;
+};
+
+/**
+ * Marshalled arguments for adios_close
+ */
+struct adios_close_args {
+    string  fname<ADIOS_PATH_MAX>;
+    int64_t fd;
+};
diff --git a/src/adios_nssi_config.c b/src/adios_nssi_config.c
new file mode 100644
index 0000000..f2359b4
--- /dev/null
+++ b/src/adios_nssi_config.c
@@ -0,0 +1,380 @@
+/*
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <sys/stat.h> /* struct stat */
+
+// xml parser
+#include <mxml.h>
+
+#ifdef _NOMPI
+    /* Sequential processes can use the library compiled with -D_NOMPI */
+#   include "mpidummy.h"
+#else
+    /* Parallel applications should use MPI to communicate  */
+#   include "mpi.h"
+#endif
+
+#include "nssi_client.h"
+#include "adios_nssi_args.h"
+#include "adios_nssi_config.h"
+
+// this macro makes getting the attributes easier
+// fix the bgp bugs
+#define GET_ATTR(n,attr,var,en)                              \
+if (!strcasecmp (n, attr->name)) {                           \
+    if (!var)                                                \
+    {                                                        \
+        var = attr->value;                                   \
+        continue;                                            \
+    }                                                        \
+    else                                                     \
+    {                                                        \
+        fprintf (stderr, "xml: duplicate attribute %s on %s (ignored)",n,en); \
+        continue;                                            \
+    }                                                        \
+}
+
+
+static int parseGroup(mxml_node_t * node, struct adios_nssi_config *config)
+{
+    mxml_node_t * n;
+    int i;
+    int service_count=0;
+    int service_num=0;
+
+//    printf("enter parseGroup\n");
+
+    for (n = mxmlWalkNext (node, node, MXML_DESCEND)
+        ;n
+        ;n = mxmlWalkNext (n, node, MXML_NO_DESCEND)
+        )
+    {
+        if (n->type != MXML_ELEMENT)
+        {
+            continue;
+        }
+
+        if (!strcasecmp (n->value.element.name, "staging-service"))
+        {
+            service_count++;
+        }
+    }
+
+    config->num_servers=service_count;
+    config->nssi_server_ids=(nssi_remote_pid *)calloc(service_count, sizeof(nssi_remote_pid));
+
+
+    service_num=0;
+    for (n = mxmlWalkNext (node, node, MXML_DESCEND)
+        ;n
+        ;n = mxmlWalkNext (n, node, MXML_NO_DESCEND)
+        )
+    {
+        if (n->type != MXML_ELEMENT)
+        {
+            continue;
+        }
+
+        if (!strcasecmp (n->value.element.name, "staging-service"))
+        {
+            mxml_node_t * n1;   // used for global_bounds
+
+            const char *nid = 0;
+            const char *pid= 0;
+            const char *hostname = 0;
+            const char *port = 0;
+
+            for (i = 0; i < n->value.element.num_attrs; i++)
+            {
+                mxml_attr_t * attr = &n->value.element.attrs [i];
+
+                GET_ATTR("nid",attr,nid,"var")
+                GET_ATTR("pid",attr,pid,"var")
+
+                GET_ATTR("hostname",attr,hostname,"var")
+                GET_ATTR("port",attr,port,"var")
+
+                fprintf (stderr, "config.xml: unknown attribute '%s' on %s "
+                                 "(ignored)\n"
+                        ,attr->name
+                        ,"staging-service"
+                        );
+            }
+
+            config->nssi_server_ids[service_num].nid = (nssi_pid)atoll(nid);
+            config->nssi_server_ids[service_num].pid = (nssi_pid)atoll(pid);
+            config->nssi_server_ids[service_num].hostname[0]='\0';
+            strncpy(config->nssi_server_ids[service_num].hostname, hostname, NSSI_HOSTNAME_LEN);
+    #ifdef HAVE_INFINIBAND
+            config->nssi_server_ids[service_num].addr = inet_addr(config->nssi_server_ids[service_num]->hostname);
+    #endif
+            config->nssi_server_ids[service_num].port = (nssi_pid)atoi(port);
+
+//            log_debug(netcdf_config_debug_level, "service (nid=%lld, pid=%llu, hostname=%s, addr=%d, port=%d)",
+//            		(long long)id->nid, (long long)id->pid, id->hostname, id->addr, id->port);
+
+//            printf("staging-service: service_num(%d) nid(%lld) pid(%llu) hostname(%s) port(%d)\n",
+//                    service_num,
+//                    config->nssi_server_ids[service_num].nid,
+//                    config->nssi_server_ids[service_num].pid,
+//                    config->nssi_server_ids[service_num].hostname,
+//                    config->nssi_server_ids[service_num].port);
+
+            service_num++;
+
+        } else {
+            if (!strncmp (n->value.element.name, "!--", 3)) // a comment
+            {
+                continue;
+            }
+            else
+            {
+                fprintf (stderr, "config.xml: invalid xml element: '%s'\n"
+                        ,n->value.element.name
+                        );
+
+                return 0;
+            }
+        }
+    }
+
+    return 1;
+}
+
+
+int parse_nssi_config(const char *config_file, struct adios_nssi_config *config)
+{
+    FILE * fp = 0;
+    mxml_node_t * doc = NULL;
+    mxml_node_t * node = NULL;
+    mxml_node_t * root = NULL;
+    int saw_staging_group = 0;
+
+    int i;
+
+    char * buffer = NULL;
+//#if HAVE_MPI
+    int buffer_size = 0;
+    int rank;
+    MPI_Comm_rank (MPI_COMM_WORLD, &rank);
+    if (rank == 0)
+    {
+//#endif
+        fp = fopen (config_file, "r");
+        if (!fp)
+        {
+            fprintf (stderr, "missing config file %s\n", config_file);
+
+            return 0;
+        }
+        struct stat s;
+        if (stat (config_file, &s) == 0)
+        {
+            buffer = malloc (s.st_size + 1);
+            buffer [s.st_size] = 0;
+        }
+        if (buffer)
+        {
+            size_t bytes_read = fread (buffer, 1, s.st_size, fp);
+            if (bytes_read != s.st_size)
+            {
+                fprintf (stderr, "error reading config file: %s. Expected %d Got %d\n"
+                        ,config_file, s.st_size, bytes_read );
+
+                return 0;
+            }
+        }
+        else
+        {
+            fprintf (stderr, "error allocating %d for reading config.\n"
+                    ,s.st_size + 1
+                    );
+
+            return 0;
+        }
+        fclose (fp);
+//#if HAVE_MPI
+        buffer_size = s.st_size;
+        MPI_Bcast (&buffer_size, 1, MPI_INT, 0, MPI_COMM_WORLD);
+        MPI_Bcast (buffer, buffer_size, MPI_BYTE, 0, MPI_COMM_WORLD);
+    }
+    else
+    {
+        MPI_Bcast (&buffer_size, 1, MPI_INT, 0, MPI_COMM_WORLD);
+        buffer = malloc (buffer_size + 1);
+        if (!buffer)
+        {
+            fprintf (stderr, "cannot allocate %d bytes to receive config file\n"
+                    ,buffer_size + 1
+                    );
+
+            return 0;
+        }
+        MPI_Bcast (buffer, buffer_size, MPI_BYTE, 0, MPI_COMM_WORLD);
+        buffer [buffer_size] = 0;
+    }
+//#endif
+
+    doc = mxmlLoadString (NULL, buffer, MXML_TEXT_CALLBACK);
+    free (buffer);
+    buffer = NULL;
+
+    if (!doc)
+    {
+        fprintf (stderr, "config.xml: unknown error parsing XML "
+                         "(probably structural)\n"
+                         "Did you remember to start the file with\n"
+                         "<?xml version=\"1.0\"?>\n");
+
+        return 0;
+    }
+
+    root = doc;
+
+    while (root && root->type != MXML_ELEMENT)
+    {
+        root = mxmlWalkNext (root, doc, MXML_DESCEND);
+    }
+
+    while (!strncmp (root->value.element.name, "!--", 3))
+    {
+        root = mxmlWalkNext (root, doc, MXML_NO_DESCEND);
+        root = mxmlWalkNext (root, doc, MXML_NO_DESCEND);
+    }
+
+    if (strcasecmp (root->value.element.name, "nssi-config"))
+    {
+        if (strncmp (root->value.element.name, "?xml", 4))
+        {
+            fprintf (stderr, "config.xml: invalid root xml element: %s\n"
+                    ,root->value.element.name
+                    );
+
+            mxmlRelease (doc);
+
+            return 0;
+        }
+        else
+        {
+            while (!strncmp (root->value.element.name, "!--", 3))
+            {
+                root = mxmlWalkNext (root, doc, MXML_NO_DESCEND);
+            }
+
+            root = mxmlWalkNext (root, doc, MXML_DESCEND);  // skip ver num
+            root = mxmlWalkNext (root, doc, MXML_NO_DESCEND);  // get next
+            while (!strncmp (root->value.element.name, "!--", 3))
+            {
+                root = mxmlWalkNext (root, doc, MXML_NO_DESCEND);
+                root = mxmlWalkNext (root, doc, MXML_NO_DESCEND);
+            }
+        }
+    }
+    else
+    {
+        printf("it is nssi-config\n");
+    }
+
+
+    for (node = mxmlWalkNext (root, doc, MXML_DESCEND_FIRST)
+        ;node
+        ;node = mxmlWalkNext (node, root, MXML_NO_DESCEND)
+        )
+    {
+        if (node->type != MXML_ELEMENT)
+        {
+            continue;
+        }
+
+        if (!strcasecmp (node->value.element.name, "staging-group"))
+        {
+            const char *write_type = 0;
+
+            for (i = 0; i < node->value.element.num_attrs; i++)
+            {
+                mxml_attr_t *attr = &node->value.element.attrs[i];
+
+                GET_ATTR("write-type",attr,write_type,"var")
+
+                fprintf (stderr, "config.xml: unknown attribute '%s' on %s "
+                                 "(ignored)\n"
+                        ,attr->name
+                        ,"staging-service"
+                        );
+            }
+
+            if (!strcmp(write_type, "WRITE_DIRECT")) {
+                config->write_type = WRITE_DIRECT;
+//                log_debug(LOG_ALL, "using %s", write_type);
+            } else if (!strcmp(write_type, "WRITE_AGGREGATE_INDEPENDENT")) {
+                config->write_type = WRITE_AGGREGATE_INDEPENDENT;
+//                log_debug(LOG_ALL, "using %s", write_type);
+            } else if (!strcmp(write_type, "WRITE_AGGREGATE_COLLECTIVE")) {
+                config->write_type = WRITE_AGGREGATE_COLLECTIVE;
+//                log_debug(LOG_ALL, "using %s", write_type);
+            } else if (!strcmp(write_type, "WRITE_CACHING_INDEPENDENT")) {
+                config->write_type = WRITE_CACHING_INDEPENDENT;
+//                log_debug(LOG_ALL, "using %s", write_type);
+            } else if (!strcmp(write_type, "WRITE_CACHING_COLLECTIVE")) {
+                config->write_type = WRITE_CACHING_COLLECTIVE;
+//                log_debug(LOG_ALL, "using %s", write_type);
+            }
+
+            if (!parseGroup(node, config))
+                break;
+            saw_staging_group = 1;
+        }
+        else
+        {
+            if (!strncmp (node->value.element.name, "!--", 3))
+            {
+                continue;
+            }
+            else
+            {
+                fprintf (stderr, "config.xml: invalid element: %s\n"
+                        ,node->value.element.name
+                );
+
+                break;
+            }
+        }
+    }
+
+    mxmlRelease (doc);
+
+    if (!saw_staging_group)
+    {
+        fprintf (stderr, "config.xml: must define at least 1 staging-group in "
+                         "config.xml\n"
+                );
+
+        return 0;
+    }
+
+//    for (i=0;i<config->num_servers;i++) {
+//        printf("staging-service: service_num(%d) nid(%lld) pid(%llu) hostname(%s) port(%d)\n",
+//                i,
+//                config->nssi_server_ids[i].nid,
+//                config->nssi_server_ids[i].pid,
+//                config->nssi_server_ids[i].hostname,
+//                config->nssi_server_ids[i].port);
+//    }
+
+    return 1;
+}
+
+void free_nssi_config(struct adios_nssi_config *config)
+{
+    if (config->nssi_server_ids) {
+        free(config->nssi_server_ids);
+        config->nssi_server_ids=NULL;
+    }
+}
diff --git a/src/adios_nssi_config.h b/src/adios_nssi_config.h
new file mode 100644
index 0000000..7a09dd3
--- /dev/null
+++ b/src/adios_nssi_config.h
@@ -0,0 +1,31 @@
+/*
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#ifndef ADIOS_NSSI_CONFIG_H
+#define ADIOS_NSSI_CONFIG_H
+
+/**
+ * @brief A structure to represent the configuration of
+ * NSSI core services.
+ */
+struct adios_nssi_config {
+
+    /** @brief Number of available storage servers */
+    int num_servers;
+
+    /** @brief storage service IDs */
+    nssi_remote_pid *nssi_server_ids;
+
+    /** @brief The type of write operation the client wishes the server to perform */
+    enum write_type write_type;
+};
+
+
+int parse_nssi_config(const char *config_file, struct adios_nssi_config *config);
+void free_nssi_config(struct adios_nssi_config *config);
+
+#endif
diff --git a/src/adios_nssi_filter.c b/src/adios_nssi_filter.c
new file mode 100644
index 0000000..d2379bd
--- /dev/null
+++ b/src/adios_nssi_filter.c
@@ -0,0 +1,1446 @@
+/*
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "config.h"
+#include "mpi.h"
+#include "adios.h"
+#include "adios_types.h"
+#include "adios_bp_v1.h"
+#include "adios_transport_hooks.h"
+#include "adios_internals.h"
+#ifdef HAVE_NSSI
+#include "nssi_client.h"
+#include "adios_nssi_args.h"
+#include "adios_nssi_config.h"
+#include "nssi_logger.h"
+#endif
+
+#include "io_timer.h"
+
+
+#define NUM_GP 24
+void adios_nssi_filter_get_write_buffer(
+        struct adios_file_struct *f,
+        struct adios_var_struct *v,
+        uint64_t *size,
+        void **buffer,
+        struct adios_method_struct *method)
+{
+}
+
+///////////////////////////
+// Datatypes
+///////////////////////////
+struct adios_nssi_filter_data_struct
+{
+    char *sm_method;
+    char *sm_parameters;
+
+    int      fd;
+    MPI_Comm group_comm;
+    int      rank;
+    int      size;
+
+    void * comm; // temporary until moved from should_buffer to open
+
+    struct adios_method_struct *submethod;
+};
+
+///* Need a struct to encapsulate var offset info.
+// */
+//struct var_offset {
+//    char      opath[ADIOS_PATH_MAX];
+//    char      oname[ADIOS_PATH_MAX];
+//    void     *ovalue;
+//    uint64_t  osize;
+//};
+//
+///* list of variable offsets */
+//List var_offset_list;
+//
+///* Need a struct to encapsulate var dim info.
+// */
+//struct var_dim {
+//    char      dpath[ADIOS_PATH_MAX];
+//    char      dname[ADIOS_PATH_MAX];
+//    void     *dvalue;
+//    uint64_t  dsize;
+//};
+//
+///* list of variable offsets */
+//List var_dim_list;
+
+/* Need a struct to encapsulate anonymous dim info.
+ */
+struct anonymous_dim {
+    char      adpath[ADIOS_PATH_MAX];
+    char      adpathname[ADIOS_PATH_MAX];
+    void     *advalue;
+    uint64_t  adsize;
+    struct adios_dimension_item_struct *dim;
+};
+
+///* list of anonymous dims */
+//List anonymous_dim_list;
+
+/* Need a struct to encapsulate open file info
+ */
+struct open_file {
+    char                           fpath[ADIOS_PATH_MAX];
+    char                           fname[ADIOS_PATH_MAX];
+    struct adios_nssi_filter_data_struct *md;
+    struct adios_file_struct      *f;
+
+    List anonymous_dim_list;
+};
+
+/* list of variable offsets */
+static List open_file_list;
+
+///////////////////////////
+// Global Variables
+///////////////////////////
+static int adios_nssi_filter_initialized = 0;
+
+static int global_rank=-1;
+struct adios_nssi_config nssi_cfg;
+
+//static log_level adios_nssi_filter_debug_level;
+static int DEBUG=0;
+
+
+extern struct adios_transport_struct * adios_transports;
+//struct adios_method_struct *submethod=NULL;
+struct adios_method_struct *self=NULL;
+
+
+///////////////////////////
+// Function Definitions
+///////////////////////////
+
+struct adios_var_struct *vars_deep_copy(struct adios_var_struct *orig)
+{
+    struct adios_var_struct *new = NULL;
+    struct adios_var_struct *current = NULL;
+
+    if (orig) {
+        new = current = (struct adios_var_struct *)malloc(sizeof(struct adios_var_struct));
+        current->next = NULL;
+        while(orig) {
+            memcpy(current, orig, sizeof(struct adios_var_struct));
+
+            current->name = strdup (orig->name);
+            current->path = strdup (orig->path);
+            current->type = orig->type;
+            current->got_buffer = adios_flag_no;
+
+            current->write_offset = 0;
+
+            current->stats=0;
+            current->bitmap=0;
+
+            if (orig->dimensions) {
+
+                // NCSU Statistics - copy stat to new var struct
+                uint8_t count = adios_get_stat_set_count(orig->type);
+                uint8_t idx = 0;
+                uint64_t characteristic_size;
+                uint8_t c;
+                uint8_t j;
+
+//                printf("vars_deep_copy(): copying %d stat sets\n", count);
+
+                current->bitmap = orig->bitmap;
+                current->stats = malloc (count * sizeof(struct adios_stat_struct *));
+
+                // Set of characteristics will be repeated thrice for complex numbers
+                for (c = 0; c < count; c ++)
+                {
+                    current->stats[c] = calloc(ADIOS_STAT_LENGTH, sizeof (struct adios_stat_struct));
+
+                    j = idx = 0;
+                    while (orig->bitmap >> j)
+                    {
+//                        printf("name(%s) j(%d) ((orig->bitmap >> j) & 1)(%d) orig->stats[%d][%d].data(%p)\n", orig->name, j, ((orig->bitmap >> j) & 1), c, idx, orig->stats[c][idx].data);
+
+                        if ((orig->bitmap >> j) & 1)
+                        {
+                            if (orig->stats[c][idx].data != NULL) {
+                                if (j == adios_statistic_hist)
+                                {
+                                    current->stats[c][idx].data = (struct adios_hist_struct *) malloc (sizeof(struct adios_hist_struct));
+
+                                    struct adios_hist_struct * orig_hist = orig->stats[c][idx].data;
+                                    struct adios_hist_struct * current_hist = current->stats[c][idx].data;
+
+                                    current_hist->min = orig_hist->min;
+                                    current_hist->max = orig_hist->max;
+                                    current_hist->num_breaks = orig_hist->num_breaks;
+
+                                    current_hist->frequencies = malloc ((orig_hist->num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, ""));
+                                    memcpy (current_hist->frequencies, orig_hist->frequencies, (orig_hist->num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, ""));
+                                    current_hist->breaks = malloc ((orig_hist->num_breaks) * adios_get_type_size(adios_double, ""));
+                                    memcpy (current_hist->breaks, orig_hist->breaks, (orig_hist->num_breaks) * adios_get_type_size(adios_double, ""));
+                                }
+                                else
+                                {
+                                    characteristic_size = adios_get_stat_size(orig->stats[c][idx].data, orig->type, j);
+                                    current->stats[c][idx].data = malloc (characteristic_size);
+                                    memcpy (current->stats[c][idx].data, orig->stats[c][idx].data, characteristic_size);
+                                }
+
+                                idx++;
+                            }
+                        }
+                        j++;
+                    }
+                }
+                // NCSU - End of copy, for statistics
+            }
+
+            current->free_data = adios_flag_no;
+            current->data = 0;
+            current->data_size = 0;
+
+            current->next = NULL;
+            orig = orig->next;
+            if (orig) {
+                current->next = (struct adios_var_struct *)malloc(sizeof(struct adios_var_struct));
+                current = current->next;
+            }
+        }
+    }
+
+    return(new);
+}
+
+struct adios_attribute_struct *attrs_deep_copy(
+        struct adios_attribute_struct *orig,
+        struct adios_group_struct *new_group)
+{
+    struct adios_attribute_struct *new = NULL;
+    struct adios_attribute_struct *current = NULL;
+
+    if (orig) {
+        new = current = (struct adios_attribute_struct *)malloc(sizeof(struct adios_attribute_struct));
+        current->next = NULL;
+        while(orig) {
+            memcpy(current, orig, sizeof(struct adios_attribute_struct));
+
+
+            current->name = strdup (orig->name);
+            current->path = strdup (orig->path);
+            current->type = orig->type;
+
+            if (orig->var == 0) {
+                uint64_t size = adios_get_type_size(orig->type, orig->value);
+                current->value=malloc(size);
+                memcpy(current->value, orig->value, size);
+            } else {
+                current->value = 0;
+                current->type = adios_unknown;
+                current->var = adios_find_var_by_id(new_group->vars,
+                                                    orig->var->id);
+            }
+
+            current->next = NULL;
+            orig = orig->next;
+            if (orig) {
+                current->next = (struct adios_attribute_struct *)malloc(sizeof(struct adios_attribute_struct));
+                current = current->next;
+            }
+        }
+    }
+
+    return(new);
+}
+
+struct adios_group_struct *group_deep_copy(struct adios_group_struct *orig)
+{
+    struct adios_group_struct *new = NULL;
+
+    if (orig) {
+        new = (struct adios_group_struct *)malloc(sizeof(struct adios_group_struct));
+        memcpy(new, orig, sizeof(struct adios_group_struct));
+
+        new->vars = vars_deep_copy(orig->vars);
+        new->attributes = attrs_deep_copy(orig->attributes, new);
+    }
+
+    return(new);
+}
+
+
+
+struct adios_method_struct *init_submethod(
+        const char * method,
+        const char * parameters)
+{
+    int64_t group_id;
+    struct adios_group_struct * g;
+    struct adios_method_struct * new_method;
+    int requires_group_comm = 0;
+
+    new_method = (struct adios_method_struct *)
+                           malloc (sizeof (struct adios_method_struct));
+
+    new_method->m = ADIOS_METHOD_UNKNOWN;
+    new_method->base_path = strdup(self->base_path);
+    new_method->method = strdup (method);
+    new_method->parameters = strdup (parameters);
+    new_method->iterations = self->iterations;
+    new_method->priority = self->priority;
+    new_method->method_data = 0;
+    new_method->group = 0;
+
+    if (adios_parse_method (method, &new_method->m, &requires_group_comm))
+    {
+        if (   new_method->m != ADIOS_METHOD_UNKNOWN
+            && new_method->m != ADIOS_METHOD_NULL
+            && adios_transports [new_method->m].adios_init_fn
+           )
+        {
+            adios_transports[new_method->m].adios_init_fn
+                                       (parameters, new_method);
+        }
+    }
+    else
+    {
+        fprintf (stderr, "config.xml: invalid transport: %s\n", method);
+
+        free (new_method->method);
+        free (new_method->parameters);
+        free (new_method);
+
+        return NULL;
+    }
+
+    return new_method;
+}
+
+
+static struct anonymous_dim *anonymous_dim_create(const char *path, const char *pathname, void *value, uint64_t size, struct adios_dimension_item_struct *dim)
+{
+    struct anonymous_dim *ad=calloc(1,sizeof(struct anonymous_dim));
+
+    strcpy(ad->adpath, path);
+    strcpy(ad->adpathname, pathname);
+    ad->advalue = value;
+    ad->adsize  = size;
+    ad->dim     = dim;
+
+    return(ad);
+}
+static void anonymous_dim_free(void *ad)
+{
+    free(ad);
+}
+static int anonymous_dim_equal(const struct anonymous_dim *ad1, const struct anonymous_dim *ad2)
+{
+    if (strcmp(ad1->adpathname, ad2->adpathname) == 0) return TRUE;
+
+    return FALSE;
+}
+static struct anonymous_dim *anonymous_dim_find(List *ad_list, const char *pathname)
+{
+    ListElmt *elmt;
+    struct anonymous_dim *ad;
+
+    if (DEBUG>3) printf("looking for adpathname(%s)\n", pathname);
+
+    elmt = list_head(ad_list);
+    while(elmt) {
+        ad = list_data(elmt);
+        if (DEBUG>3) printf("comparing to adpathname(%s)\n", ad->adpathname);
+        if (strcmp(pathname, ad->adpathname) == 0) {
+            if (DEBUG>3) printf("adpathname(%s) matches search\n", ad->adpathname);
+            return ad;
+        }
+        elmt = list_next(elmt);
+    }
+
+    return NULL;
+}
+static void anonymous_dim_printall(List *ad_list)
+{
+    ListElmt *elmt;
+    struct anonymous_dim *ad;
+
+    elmt = list_head(ad_list);
+    while(elmt) {
+        ad = list_data(elmt);
+        if (DEBUG>3) printf("adpathname(%s)\n", ad->adpathname);
+        elmt = list_next(elmt);
+    }
+}
+
+static struct open_file *open_file_create(
+        const char *path,
+        const char *name,
+        struct adios_nssi_filter_data_struct *method_private_data,
+        struct adios_file_struct *f)
+{
+    struct open_file *of=calloc(1,sizeof(struct open_file));
+
+    strcpy(of->fpath, path);
+    strcpy(of->fname, name);
+    of->md = method_private_data;
+    of->f = f;
+
+    list_init(&of->anonymous_dim_list, anonymous_dim_free);
+
+
+    return(of);
+}
+static void open_file_free(void *of)
+{
+    list_destroy(&((struct open_file *)of)->anonymous_dim_list);
+    free(of);
+}
+static int open_file_equal(const struct open_file *of1, const struct open_file *of2)
+{
+    if ((strcmp(of1->fpath, of2->fpath) == 0) && (strcmp(of1->fname, of2->fname) == 0)) return TRUE;
+
+    return FALSE;
+}
+static struct open_file *open_file_find(const char *path, const char *name)
+{
+    ListElmt *elmt;
+    struct open_file *of;
+
+    if (DEBUG>3) printf("looking for fpath(%s) fname(%s)\n", path, name);
+
+    elmt = list_head(&open_file_list);
+    while(elmt) {
+        of = list_data(elmt);
+        if (DEBUG>3) printf("comparing to fpath(%s) fname(%s)\n", of->fpath, of->fname);
+        if ((strcmp(path, of->fpath) == 0) && (strcmp(name, of->fname) == 0)) {
+            if (DEBUG>3) printf("fpath(%s) fname(%s) matches search\n", of->fpath, of->fname);
+            return of;
+        }
+        elmt = list_next(elmt);
+    }
+
+    return NULL;
+}
+static struct open_file *open_file_delete(const char *path, const char *name)
+{
+    ListElmt *elmt, *prev;
+    struct open_file *of;
+
+    if (DEBUG>3) printf("trying to delete fpath(%s) fname(%s)\n", path, name);
+
+    prev = elmt = list_head(&open_file_list);
+    while(elmt) {
+        of = list_data(elmt);
+        if (DEBUG>3) printf("comparing to fpath(%s) fname(%s)\n", of->fpath, of->fname);
+        if ((strcmp(path, of->fpath) == 0) && (strcmp(name, of->fname) == 0)) {
+            if (DEBUG>3) printf("fpath(%s) fname(%s) matches search\n", of->fpath, of->fname);
+            if (list_is_head(&open_file_list, elmt)) {
+                list_rem_next(&open_file_list, NULL, &of);
+            } else {
+                list_rem_next(&open_file_list, prev, &of);
+            }
+        }
+        prev = elmt;
+        elmt = list_next(elmt);
+    }
+
+    return NULL;
+}
+static void open_file_printall(void)
+{
+    ListElmt *elmt;
+    struct open_file *of;
+
+    elmt = list_head(&open_file_list);
+    while(elmt) {
+        of = list_data(elmt);
+        if (DEBUG>3) printf("fpath(%s) fname(%s)\n", of->fpath, of->fname);
+        elmt = list_next(elmt);
+    }
+}
+
+//static struct var_offset *var_offset_create(const char *path, const char *name, void *value, uint64_t size)
+//{
+//    struct var_offset *vo=calloc(1,sizeof(struct var_offset));
+//
+//    strcpy(vo->opath, path);
+//    strcpy(vo->oname, name);
+//    vo->ovalue = value;
+//    vo->osize  = size;
+//
+//    return(vo);
+//}
+//static void var_offset_free(void *vo)
+//{
+//    free(vo);
+//}
+//static int var_offset_equal(const struct var_offset *vo1, const struct var_offset *vo2)
+//{
+//    if ((strcmp(vo1->opath, vo2->opath) == 0) && (strcmp(vo1->oname, vo2->oname) == 0)) return TRUE;
+//
+//    return FALSE;
+//}
+//static struct var_offset *var_offset_find(const char *path, const char *name)
+//{
+//    ListElmt *elmt;
+//    struct var_offset *vo;
+//
+//    if (DEBUG>3) printf("looking for opath(%s) oname(%s)\n", path, name);
+//
+//    elmt = list_head(&var_offset_list);
+//    while(elmt) {
+//        vo = list_data(elmt);
+//        if (DEBUG>3) printf("comparing to opath(%s) oname(%s)\n", vo->opath, vo->oname);
+//        if ((strcmp(path, vo->opath) == 0) && (strcmp(name, vo->oname) == 0)) {
+//            if (DEBUG>3) printf("opath(%s) oname(%s) matches search\n", vo->opath, vo->oname);
+//            return vo;
+//        }
+//        elmt = list_next(elmt);
+//    }
+//
+//    return NULL;
+//}
+//static void var_offset_printall(void)
+//{
+//    ListElmt *elmt;
+//    struct var_offset *vo;
+//
+//    elmt = list_head(&var_offset_list);
+//    while(elmt) {
+//        vo = list_data(elmt);
+//        if (DEBUG>3) printf("opath(%s) oname(%s)\n", vo->opath, vo->oname);
+//        elmt = list_next(elmt);
+//    }
+//}
+//
+//static struct var_dim *var_dim_create(const char *path, const char *name, void *value, uint64_t size)
+//{
+//    struct var_dim *vd=calloc(1,sizeof(struct var_dim));
+//
+//    strcpy(vd->dpath, path);
+//    strcpy(vd->dname, name);
+//    vd->dvalue = value;
+//    vd->dsize  = size;
+//
+//    return(vd);
+//}
+//static void var_dim_free(void *vd)
+//{
+//    free(vd);
+//}
+//static int var_dim_equal(const struct var_dim *vd1, const struct var_dim *vd2)
+//{
+//    if ((strcmp(vd1->dpath, vd2->dpath) == 0) && (strcmp(vd1->dname, vd2->dname) == 0)) return TRUE;
+//
+//    return FALSE;
+//}
+//static struct var_dim *var_dim_find(const char *path, const char *name)
+//{
+//    ListElmt *elmt;
+//    struct var_dim *vd;
+//
+//    if (DEBUG>3) printf("looking for opath(%s) oname(%s)\n", path, name);
+//
+//    elmt = list_head(&var_dim_list);
+//    while(elmt) {
+//        vd = list_data(elmt);
+//        if (DEBUG>3) printf("comparing to opath(%s) oname(%s)\n", vd->dpath, vd->dname);
+//        if ((strcmp(path, vd->dpath) == 0) && (strcmp(name, vd->dname) == 0)) {
+//            if (DEBUG>3) printf("opath(%s) oname(%s) matches search\n", vd->dpath, vd->dname);
+//            return vd;
+//        }
+//        elmt = list_next(elmt);
+//    }
+//
+//    return NULL;
+//}
+//static void var_dim_printall(void)
+//{
+//    ListElmt *elmt;
+//    struct var_dim *vd;
+//
+//    elmt = list_head(&var_dim_list);
+//    while(elmt) {
+//        vd = list_data(elmt);
+//        if (DEBUG>3) printf("dpath(%s) dname(%s)\n", vd->dpath, vd->dname);
+//        elmt = list_next(elmt);
+//    }
+//}
+
+static void parse_dimension_size(
+        struct adios_group_struct *group,
+        struct adios_var_struct *pvar_root,
+        struct adios_attribute_struct *patt_root,
+        struct adios_dimension_item_struct *dim,
+        size_t *dimsize)
+{
+    struct adios_var_struct *var_linked = NULL;
+    struct adios_attribute_struct *attr_linked;
+    if (dim->id) {
+        var_linked = adios_find_var_by_id (pvar_root , dim->id);
+        if (!var_linked) {
+            attr_linked = adios_find_attribute_by_id (patt_root, dim->id);
+            if (!attr_linked->var) {
+                switch (attr_linked->type) {
+                case adios_unsigned_byte:
+                    *dimsize = *(uint8_t *)attr_linked->value;
+                    break;
+                case adios_byte:
+                    *dimsize = *(int8_t *)attr_linked->value;
+                    break;
+                case adios_unsigned_short:
+                    *dimsize = *(uint16_t *)attr_linked->value;
+                    break;
+                case adios_short:
+                    *dimsize = *(int16_t *)attr_linked->value;
+                    break;
+                case adios_unsigned_integer:
+                    *dimsize = *(uint32_t *)attr_linked->value;
+                    break;
+                case adios_integer:
+                    *dimsize = *(int32_t *)attr_linked->value;
+                    break;
+                case adios_unsigned_long:
+                    *dimsize = *(uint64_t *)attr_linked->value;
+                    break;
+                case adios_long:
+                    *dimsize = *(int64_t *)attr_linked->value;
+                    break;
+                default:
+                    fprintf (stderr, "Invalid datatype for array dimension on "
+                            "var %s: %s\n"
+                            ,attr_linked->name
+                            ,adios_type_to_string_int (var_linked->type)
+                    );
+                    break;
+                }
+            } else {
+                var_linked = attr_linked->var;
+            }
+        }
+        if (var_linked && var_linked->data) {
+            *dimsize = *(int *)var_linked->data;
+        }
+    } else {
+        if (dim->time_index == adios_flag_yes) {
+            *dimsize = 1;
+        } else {
+            *dimsize = dim->rank;
+        }
+    }
+
+    return;
+}
+static void parse_dimension_name(
+        struct adios_group_struct *group,
+        struct adios_var_struct *pvar_root,
+        struct adios_attribute_struct *patt_root,
+        struct adios_dimension_item_struct *dim,
+        char *dimname)
+{
+    struct adios_var_struct *var_linked = NULL;
+    struct adios_attribute_struct *attr_linked;
+    if (dim->id) {
+        var_linked = adios_find_var_by_id (pvar_root , dim->id);
+        if (!var_linked) {
+            attr_linked = adios_find_attribute_by_id (patt_root, dim->id);
+            if (!attr_linked->var) {
+//				strcpy(dimname, attr_linked->name);
+                sprintf(dimname, "%s", attr_linked->name);
+            } else {
+                var_linked = attr_linked->var;
+            }
+        }
+        if (var_linked && var_linked->name) {
+//			strcpy(dimname, var_linked->name);
+            sprintf(dimname, "%s", var_linked->name);
+        }
+    } else {
+        if (dim->time_index == adios_flag_yes) {
+//			strcpy(dimname, group->time_index_name);
+            sprintf(dimname, "%s", group->time_index_name);
+        } else {
+            dimname[0] = '\0';
+        }
+    }
+
+    return;
+}
+static int is_anonymous_dimension(
+        struct adios_var_struct *pvar_root,
+        struct adios_attribute_struct *patt_root,
+        struct adios_dimension_item_struct *dim)
+{
+    int rc=FALSE;
+    struct adios_var_struct       *var_linked = NULL;
+    struct adios_attribute_struct *attr_linked = NULL;
+
+    if (dim->id) {
+        var_linked = adios_find_var_by_id (pvar_root , dim->id);
+        if (!var_linked) {
+            attr_linked = adios_find_attribute_by_id (patt_root, dim->id);
+            if (!attr_linked->var) {
+                rc=FALSE;
+            } else {
+                var_linked = attr_linked->var;
+            }
+        }
+        if (var_linked && var_linked->name) {
+            rc=FALSE;
+        } else {
+            rc=TRUE;
+        }
+    } else {
+        if (dim->time_index == adios_flag_yes) {
+            rc=FALSE;
+        } else {
+            rc=TRUE;
+        }
+    }
+
+    return rc;
+}
+
+
+static int gen_anonymous_dim_list(
+        struct open_file *of,
+        struct adios_group_struct *group,
+        struct adios_var_struct *pvar_root,
+        struct adios_attribute_struct *patt_root)
+{
+    struct adios_var_struct *v;
+    struct adios_dimension_struct *dims;
+    struct anonymous_dim *ad;
+    char ad_name[255];
+    uint64_t *value;
+
+    v = pvar_root;
+    while (v) {
+        dims=v->dimensions;
+        int ad_idx=0;
+        uint64_t vsize = 8;
+
+        while (dims) {
+            if (is_anonymous_dimension(pvar_root, patt_root, &dims->dimension) == TRUE) {
+                sprintf(ad_name, "%s_%s_dim_%d", /*v->path*/"", v->name, ad_idx);
+                if (DEBUG>3) printf("gen: dim_name(%s)\n", ad_name);
+
+                value=calloc(1,sizeof(uint64_t));
+                parse_dimension_size(group, pvar_root, patt_root, &dims->dimension, value);
+
+                ad = anonymous_dim_create(v->path, ad_name, value, vsize, &dims->dimension);
+                list_ins_next(&of->anonymous_dim_list, list_tail(&of->anonymous_dim_list), ad);
+            }
+
+            if (is_anonymous_dimension(pvar_root, patt_root, &dims->global_dimension) == TRUE) {
+                sprintf(ad_name, "%s_%s_global_%d", /*v->path*/"", v->name, ad_idx);
+                if (DEBUG>3) printf("gen: gdim_name(%s)\n", ad_name);
+
+                value=calloc(1,sizeof(uint64_t));
+                parse_dimension_size(group, pvar_root, patt_root, &dims->global_dimension, value);
+
+                ad = anonymous_dim_create(v->path, ad_name, value, vsize, &dims->global_dimension);
+                list_ins_next(&of->anonymous_dim_list, list_tail(&of->anonymous_dim_list), ad);
+            }
+
+            if (is_anonymous_dimension(pvar_root, patt_root, &dims->local_offset) == TRUE) {
+                sprintf(ad_name, "%s_%s_offset_%d", /*v->path*/"", v->name, ad_idx);
+                if (DEBUG>3) printf("gen: ad_name(%s)\n", ad_name);
+
+                value=calloc(1,sizeof(uint64_t));
+                parse_dimension_size(group, pvar_root, patt_root, &dims->local_offset, value);
+
+                ad = anonymous_dim_create(v->path, ad_name, value, vsize, &dims->local_offset);
+                list_ins_next(&of->anonymous_dim_list, list_tail(&of->anonymous_dim_list), ad);
+            }
+
+            ad_idx++;
+            dims = dims->next;
+        }
+        v = v->next;
+    }
+}
+
+static void adios_var_to_comm_nssi(
+        enum ADIOS_FLAG host_language_fortran,
+        void *data,
+        MPI_Comm *comm)
+{
+    if (data) {
+        int t = *(int *) data;
+        if (host_language_fortran == adios_flag_yes) {
+            *comm = MPI_Comm_f2c (t);
+        } else {
+            *comm = *(MPI_Comm *) data;
+        }
+    } else {
+        fprintf (stderr, "coordination-communication not provided. "
+                "Using MPI_COMM_WORLD instead\n");
+        *comm = MPI_COMM_WORLD;
+    }
+
+    return;
+}
+
+void adios_nssi_filter_init(
+        const char *parameters,
+        struct adios_method_struct *method)
+{
+    int rc=NSSI_OK;
+    int verbose=5;
+    char logfile[1024];
+    int log_rank;
+
+    struct adios_nssi_filter_data_struct *self_md=NULL;
+
+    if (!adios_nssi_filter_initialized) {
+        adios_nssi_filter_initialized = 1;
+    }
+
+    MPI_Comm_rank(MPI_COMM_WORLD, &global_rank);
+
+    if (DEBUG>3) printf("rank(%d) enter adios_nssi_filter_init\n", global_rank);
+
+//    MPI_Comm_rank(md->group_comm, &log_rank);
+//    sprintf(logfile, "%s.%04d", "adios_nssi_filter_client.log", log_rank);
+//    logger_init((log_level)verbose, logfile);
+
+//    logger_init((log_level)verbose, NULL);
+
+    if (self == NULL) {
+        self=method;
+        self_md=calloc(1, sizeof(struct adios_nssi_filter_data_struct));
+        self->method_data=self_md;
+    } else {
+        self_md=(struct adios_nssi_filter_data_struct *)self->method_data;
+    }
+
+    /*
+     * initialize sub_method
+     */
+    char *sm_method=NULL;
+    char *sm_parameters=NULL;
+
+    if (DEBUG>3) printf("parameters=%s\n", parameters);
+
+    char *pkey=NULL;
+    char *pkey_str="submethod=\"";
+    char *pvalue=NULL;
+    int   pvalue_len=0;
+    pkey=strstr(parameters, pkey_str);
+    if (pkey != NULL) {
+        pvalue=pkey+strlen(pkey_str);
+        char *quote_pos=strchr(pvalue, '"');
+        pvalue_len=quote_pos-pvalue+1;
+        sm_method=(char *)malloc(pvalue_len+1);
+        strncpy(sm_method, pvalue, pvalue_len);
+        sm_method[pvalue_len-1]='\0';
+    }
+
+    if (DEBUG>3) printf("sm_method=%s\n", sm_method);
+
+    if (sm_method != NULL) {
+        pkey=NULL;
+        pkey_str="subparameters=\"";
+        pvalue=NULL;
+        pvalue_len=0;
+        pkey=strstr(parameters, pkey_str);
+        if (pkey != NULL) {
+            pvalue=pkey+strlen(pkey_str);
+            char *quote_pos=strchr(pvalue, '"');
+            pvalue_len=quote_pos-pvalue+1;
+            sm_parameters=(char *)malloc(pvalue_len+1);
+            strncpy(sm_parameters, pvalue, pvalue_len);
+            sm_parameters[pvalue_len-1]='\0';
+        }
+    }
+
+    if (DEBUG>3) printf("sm_parameters=%s\n", sm_parameters);
+
+    if (sm_parameters == NULL) {
+        sm_parameters="";
+    }
+
+    self_md->sm_method = strdup(sm_method);
+    self_md->sm_parameters = strdup(sm_parameters);
+
+
+    list_init(&open_file_list, open_file_free);
+//    list_init(&var_offset_list, var_offset_free);
+//    list_init(&var_dim_list, var_dim_free);
+
+    return;
+}
+
+
+enum ADIOS_FLAG adios_nssi_filter_should_buffer(
+        struct adios_file_struct *f,
+        struct adios_method_struct *method)
+{
+    int rc=NSSI_OK;
+
+    struct open_file *of=NULL;
+    struct adios_nssi_filter_data_struct *md=NULL;
+
+    enum ADIOS_FLAG sm_should_buffer=adios_flag_no;
+    enum ADIOS_FLAG old_shared_buffer=adios_flag_no;
+
+    if (DEBUG>3) printf("rank(%d) enter adios_nssi_filter_should_buffer\n", global_rank);
+
+    if (DEBUG>3) {
+        struct adios_var_struct *v=f->group->vars;
+        while(v) {
+            printf("adios_nssi_filter_should_buffer: fname(%s) vname(%s)\n", f->name, v->name);
+            v=v->next;
+        }
+    }
+
+    of=open_file_find(method->base_path, f->name);
+    if (of == NULL) {
+        fprintf(stderr, "nssi_filter_should_buffer: file(%s, %s) is not open.  FAIL.", method->base_path, f->name);
+        return adios_flag_no;
+    }
+    md=of->md;
+
+    /*
+     * call sub_method
+     */
+    if (   md->submethod->m != ADIOS_METHOD_UNKNOWN
+        && md->submethod->m != ADIOS_METHOD_NULL
+        && adios_transports[md->submethod->m].adios_should_buffer_fn
+       )
+    {
+        sm_should_buffer = adios_transports[md->submethod->m].adios_should_buffer_fn
+                                                                (f, md->submethod);
+    }
+
+    if (DEBUG>3) printf("sm_should_buffer==%d\n", sm_should_buffer);
+    return sm_should_buffer;
+}
+
+int adios_nssi_filter_open(
+        struct adios_file_struct *f,
+        struct adios_method_struct *method,
+        void *comm)
+{
+    int rc=NSSI_OK;
+
+    struct open_file *of=NULL;
+    struct adios_nssi_filter_data_struct *md=NULL;
+
+    if (DEBUG>3) printf("global_rank(%d): enter adios_nssi_filter_open (%s)\n", global_rank, f->name);
+
+    of=open_file_find(method->base_path, f->name);
+    if (of == NULL) {
+        struct adios_nssi_filter_data_struct *self_md=(struct adios_nssi_filter_data_struct *)self->method_data;;
+
+        md             = malloc(sizeof(struct adios_nssi_filter_data_struct));
+        md->fd         = -1;
+        md->rank       = -1;
+        md->size       = 0;
+        md->group_comm = MPI_COMM_NULL;
+        md->comm       = comm;
+
+        md->submethod = init_submethod(self_md->sm_method, self_md->sm_parameters);
+        md->submethod->group = group_deep_copy(f->group);
+        f->group = md->submethod->group;
+
+        of=open_file_create(method->base_path, f->name, md, f);
+    } else {
+        md=of->md;
+
+        // sanity check
+        if (md->fd == -1) {
+            if (DEBUG>3) printf("open: %s is open but fd==-1.  sanity check failed.  attempting reopen.\n", f->name);
+            open_file_delete(of->fpath, of->fname);
+        } else {
+            // file already open
+            return adios_flag_no;
+        }
+    }
+
+    if (DEBUG>3) printf("global_rank(%d): adios_nssi_filter_open: setup group_comm\n", global_rank);
+    adios_var_to_comm_nssi(f->group->adios_host_language_fortran, md->comm, &md->group_comm);
+    if (md->group_comm != MPI_COMM_NULL) {
+        if (DEBUG>3) printf("global_rank(%d): adios_nssi_filter_open: get rank and size: comm(%p) group_comm(%p)\n", global_rank, md->comm, md->group_comm);
+        MPI_Comm_rank(md->group_comm, &md->rank);
+        MPI_Comm_size(md->group_comm, &md->size);
+        if (DEBUG>3) printf("global_rank(%d): adios_nssi_filter_open: size(%d) rank(%d)\n", global_rank, md->size, md->rank);
+    } else {
+        md->group_comm=MPI_COMM_SELF;
+    }
+    f->group->process_id = md->rank;
+
+
+    gen_anonymous_dim_list(
+            of,
+            f->group,
+            f->group->vars,
+            f->group->attributes);
+
+
+//    gen_offset_list(
+//            f->group,
+//            f->group->vars,
+//            f->group->attributes);
+//    gen_dim_list(
+//            f->group,
+//            f->group->vars,
+//            f->group->attributes);
+//    var_offset_printall();
+
+
+    /*
+     * call sub_method
+     */
+    if (   md->submethod->m != ADIOS_METHOD_UNKNOWN
+        && md->submethod->m != ADIOS_METHOD_NULL
+        && adios_transports[md->submethod->m].adios_open_fn
+       )
+    {
+        adios_transports[md->submethod->m].adios_open_fn
+                                   (f, md->submethod, comm);
+    }
+
+
+    list_ins_next(&open_file_list, list_tail(&open_file_list), of);
+
+    return 1;
+}
+
+void adios_nssi_filter_start_calculation(
+        struct adios_method_struct * method)
+{
+    int rc=NSSI_OK;
+    int myrank;
+
+    ListElmt *elmt;
+    struct open_file *of;
+    struct adios_nssi_filter_data_struct *md=NULL;
+
+    if (DEBUG>3) printf("rank(%d) enter adios_nssi_filter_start_calc\n", global_rank);
+
+    elmt = list_head(&open_file_list);
+    while(elmt) {
+        of = list_data(elmt);
+        md = of->md;
+
+        /*
+         * call sub_method
+         */
+        if (   md->submethod->m != ADIOS_METHOD_UNKNOWN
+            && md->submethod->m != ADIOS_METHOD_NULL
+            && adios_transports[md->submethod->m].adios_start_calculation_fn
+           )
+        {
+            adios_transports[md->submethod->m].adios_start_calculation_fn
+                                       (md->submethod);
+        }
+
+        elmt = list_next(elmt);
+    }
+
+    if (DEBUG>3) printf("rank(%d) exit adios_nssi_filter_start_calc\n", global_rank);
+
+    return;
+}
+
+void adios_nssi_filter_end_iteration(
+        struct adios_method_struct * method)
+{
+    int rc=NSSI_OK;
+    int myrank;
+
+    ListElmt *elmt;
+    struct open_file *of;
+    struct adios_nssi_filter_data_struct *md=NULL;
+
+    if (DEBUG>3) printf("rank(%d) enter adios_nssi_filter_end_iteration\n", global_rank);
+
+    elmt = list_head(&open_file_list);
+    while(elmt) {
+        of = list_data(elmt);
+        md = of->md;
+
+        /*
+         * call sub_method
+         */
+        if (   md->submethod->m != ADIOS_METHOD_UNKNOWN
+            && md->submethod->m != ADIOS_METHOD_NULL
+            && adios_transports[md->submethod->m].adios_end_iteration_fn
+        )
+        {
+            adios_transports[md->submethod->m].adios_end_iteration_fn
+                                        (md->submethod);
+        }
+
+        elmt = list_next(elmt);
+    }
+
+    if (DEBUG>3) printf("rank(%d) exit adios_nssi_filter_end_iteration\n", global_rank);
+
+    return;
+}
+
+void adios_nssi_filter_stop_calculation(
+        struct adios_method_struct * method)
+{
+    int rc=NSSI_OK;
+    int remote_rc=NSSI_OK;
+    int myrank;
+
+    ListElmt *elmt;
+    struct open_file *of;
+    struct adios_nssi_filter_data_struct *md=NULL;
+
+    if (DEBUG>3) printf("rank(%d) enter adios_nssi_filter_stop_calc\n", global_rank);
+
+    elmt = list_head(&open_file_list);
+    while(elmt) {
+        of = list_data(elmt);
+        md = of->md;
+
+        /*
+         * call sub_method
+         */
+        if (   md->submethod->m != ADIOS_METHOD_UNKNOWN
+            && md->submethod->m != ADIOS_METHOD_NULL
+            && adios_transports[md->submethod->m].adios_stop_calculation_fn
+        )
+        {
+            adios_transports[md->submethod->m].adios_stop_calculation_fn
+                                        (md->submethod);
+        }
+
+        elmt = list_next(elmt);
+    }
+
+    if (DEBUG>3) printf("rank(%d) exit adios_nssi_filter_stop_calc\n", global_rank);
+
+    return;
+}
+
+void adios_nssi_filter_write(
+        struct adios_file_struct *f,
+        struct adios_var_struct *v,
+        void *data,
+        struct adios_method_struct *method)
+{
+    static int first_write = 1;
+
+    struct open_file *of=NULL;
+    struct adios_nssi_filter_data_struct *md=NULL;
+
+    if (DEBUG>3) printf("rank(%d) enter adios_nssi_filter_write - var(%s, %s)\n", global_rank, v->path, v->name);
+
+    of=open_file_find(method->base_path, f->name);
+    if (of == NULL) {
+        fprintf(stderr, "nssi_filter_write: file(%s, %s) is not open.  FAIL.", method->base_path, f->name);
+        return;
+    }
+    md=of->md;
+
+    /*
+     * call sub_method
+     */
+    if (   md->submethod->m != ADIOS_METHOD_UNKNOWN
+        && md->submethod->m != ADIOS_METHOD_NULL
+        && adios_transports[md->submethod->m].adios_write_fn
+       )
+    {
+        adios_transports[md->submethod->m].adios_write_fn
+                                   (f, v, data, md->submethod);
+    }
+
+
+//    if (f->mode == adios_mode_write || f->mode == adios_mode_append) {
+//
+//        if (md->rank==0) {
+//            if (DEBUG>3) fprintf(stderr, "-------------------------\n");
+//            if (DEBUG>3) fprintf(stderr, "write var: %s start!\n", v->name);
+//        }
+//        uint64_t var_size = adios_get_var_size (v, f->group, data);
+//        if (DEBUG>3) printf("vname(%s) vsize(%ld)\n", v->name, var_size);
+//        write_var(md->fd,
+//                f->group,
+//                f->group->vars,
+//                f->group->attributes,
+//                v,
+//                var_size,
+//                f->group->adios_host_language_fortran,
+//                md->rank,
+//                md->size,
+//                md->group_comm);
+//    } else {
+//        if (DEBUG>3) fprintf(stderr, "entering unknown nc4 mode %d!\n", f->mode);
+//    }
+//    if (md->rank==0) {
+//        if (DEBUG>3) fprintf(stderr, "write var: %s end!\n", v->name);
+//        if (DEBUG>3) fprintf(stderr, "-------------------------\n");
+//    }
+
+    return;
+}
+
+
+void adios_nssi_filter_read(
+        struct adios_file_struct *f,
+        struct adios_var_struct *v,
+        void *buffer,
+        uint64_t buffersize,
+        struct adios_method_struct *method)
+{
+    struct open_file *of=NULL;
+    struct adios_nssi_filter_data_struct *md=NULL;
+
+    if (DEBUG>3) printf("rank(%d) enter adios_nssi_filter_read\n", global_rank);
+
+    of=open_file_find(method->base_path, f->name);
+    if (of == NULL) {
+        fprintf(stderr, "nssi_filter_read: file(%s, %s) is not open.  FAIL.", method->base_path, f->name);
+        return;
+    }
+    md=of->md;
+
+    /*
+     * call sub_method
+     */
+    if (   md->submethod->m != ADIOS_METHOD_UNKNOWN
+        && md->submethod->m != ADIOS_METHOD_NULL
+        && adios_transports[md->submethod->m].adios_read_fn
+       )
+    {
+        adios_transports[md->submethod->m].adios_read_fn
+                                   (f, v, buffer, buffersize, md->submethod);
+    }
+
+
+//    if(f->mode == adios_mode_read) {
+//        v->data = buffer;
+//        v->data_size = buffersize;
+//
+//        if (md->rank==0) {
+//            if (DEBUG>3) fprintf(stderr, "-------------------------\n");
+//            if (DEBUG>3) fprintf(stderr, "read var: %s! start\n", v->name);
+//        }
+//        read_var(md->fd,
+//                v,
+//                md->rank,
+//                md->size,
+//                md->group_comm);
+//        if (md->rank==0) {
+//            if (DEBUG>3) fprintf(stderr, "read var: %s! end\n", v->name);
+//            if (DEBUG>3) fprintf(stderr, "-------------------------\n");
+//        }
+//    }
+
+    return;
+}
+
+void adios_nssi_filter_close(
+        struct adios_file_struct *f,
+        struct adios_method_struct *method)
+{
+    int rc=NSSI_OK;
+    struct adios_attribute_struct * a = f->group->attributes;
+    int myrank;
+
+    struct open_file *of=NULL;
+    struct adios_nssi_filter_data_struct *md=NULL;
+
+    if (DEBUG>3) printf("global_rank(%d) enter adios_nssi_filter_close\n", global_rank);
+
+    of=open_file_find(method->base_path, f->name);
+    if (of == NULL) {
+        fprintf(stderr, "nssi_filter_close: file(%s, %s) is not open.  FAIL.", method->base_path, f->name);
+        return;
+    }
+    md=of->md;
+    myrank=md->rank;
+
+    if (DEBUG>3) printf("myrank(%d) enter adios_nssi_filter_close\n", myrank);
+
+    /*
+     * call sub_method
+     */
+    if (   md->submethod->m != ADIOS_METHOD_UNKNOWN
+        && md->submethod->m != ADIOS_METHOD_NULL
+        && adios_transports[md->submethod->m].adios_close_fn
+       )
+    {
+        adios_transports[md->submethod->m].adios_close_fn
+                                   (f, md->submethod);
+    }
+
+    if (f->mode == adios_mode_read) {
+        struct adios_var_struct * v = f->group->vars;
+        while (v)
+        {
+            v->data = 0;
+            v = v->next;
+        }
+
+        if (md->rank==0) {
+            if (DEBUG>1) fprintf(stderr, "-------------------------\n");
+            if (DEBUG>1) fprintf(stderr, "reading done, NSSI_FILTER file is virtually closed;\n");
+            if (DEBUG>1) fprintf(stderr, "-------------------------\n");
+        }
+    } else if (f->mode == adios_mode_write || f->mode == adios_mode_append) {
+        //fprintf(stderr, "entering nc4 write attribute mode!\n");
+        if (md->rank==0) {
+            if (DEBUG>1) fprintf(stderr, "-------------------------\n");
+            if (DEBUG>1) fprintf(stderr, "writing done, NSSI_FILTER file is virtually closed;\n");
+            if (DEBUG>1) fprintf(stderr, "-------------------------\n");
+        }
+    }
+
+//    struct adios_group_struct *group_clone=f->group;
+//    if (group_clone) {
+//        while (group_clone->vars)
+//        {
+//            struct adios_var_struct *vars = group_clone->vars->next;
+//            free (group_clone->vars);
+//            group_clone->vars = vars;
+//        }
+//
+//        while (group_clone->attributes)
+//        {
+//            struct adios_attribute_struct * attributes = group_clone->attributes->next;
+//            free (group_clone->attributes);
+//            group_clone->attributes = attributes;
+//        }
+//
+//        free(group_clone);
+//        f->group=NULL;
+//    }
+
+    open_file_delete(method->base_path, f->name);
+    free(md);
+    of=NULL;
+    md=NULL;
+
+    if (DEBUG>3) printf("global_rank(%d) exit adios_nssi_filter_close\n", global_rank);
+
+    return;
+}
+
+void adios_nssi_filter_finalize(
+        int mype,
+        struct adios_method_struct *method)
+{
+    int rc=NSSI_OK;
+    int myrank;
+
+    ListElmt *elmt;
+    struct open_file *of;
+    struct adios_nssi_filter_data_struct *md=NULL;
+
+    if (DEBUG>3) printf("rank(%d) enter adios_nssi_filter_finalize\n", global_rank);
+
+    elmt = list_head(&open_file_list);
+    while(elmt) {
+        of = list_data(elmt);
+        md = of->md;
+
+        /*
+         * call sub_method
+         */
+        if (   md->submethod->m != ADIOS_METHOD_UNKNOWN
+            && md->submethod->m != ADIOS_METHOD_NULL
+            && adios_transports[md->submethod->m].adios_finalize_fn
+        )
+        {
+            adios_transports[md->submethod->m].adios_finalize_fn
+                                        (mype, md->submethod);
+        }
+
+        elmt = list_next(elmt);
+    }
+
+    free_nssi_config(&nssi_cfg);
+
+    if (adios_nssi_filter_initialized) {
+        adios_nssi_filter_initialized = 0;
+        self=NULL;
+    }
+
+    if (DEBUG>3) printf("rank(%d) exit adios_nssi_filter_finalize\n", global_rank);
+}
+
+
+int adios_nssi_filter_is_anon_dim(
+        int fd,
+        const char *dimname)
+{
+    struct adios_file_struct *f=(struct adios_file_struct *)fd;
+    int myrank;
+
+    struct open_file *of=NULL;
+    struct adios_nssi_filter_data_struct *md=NULL;
+
+    if (DEBUG>3) printf("global_rank(%d) enter BACKDOOR adios_nssi_filter_is_anon_dim\n", global_rank);
+
+    if ((!adios_nssi_filter_initialized) || (self == NULL)) {
+        return FALSE;
+    }
+
+    of=open_file_find(self->base_path, f->name);
+    if (of == NULL) {
+        fprintf(stderr, "nssi_filter_is_anon: file(%s, %s) is not open.  FAIL.", self->base_path, f->name);
+        return FALSE;
+    }
+    md=of->md;
+    myrank=md->rank;
+
+    if (anonymous_dim_find(&of->anonymous_dim_list, dimname) != NULL) {
+        return TRUE;
+    }
+    return FALSE;
+}
+void adios_nssi_filter_set_anon_dim(
+        int fd,
+        const char *dimname,
+        const uint64_t dimvalue)
+{
+    struct adios_file_struct *f=(struct adios_file_struct *)fd;
+    int myrank;
+
+    struct open_file *of=NULL;
+    struct adios_nssi_filter_data_struct *md=NULL;
+
+    if (DEBUG>3) printf("global_rank(%d) enter BACKDOOR adios_nssi_filter_set_anon_dim\n", global_rank);
+
+    if ((!adios_nssi_filter_initialized) || (self == NULL)) {
+        return;
+    }
+
+    of=open_file_find(self->base_path, f->name);
+    if (of == NULL) {
+        fprintf(stderr, "nssi_filter_set_anon: file(%s, %s) is not open.  FAIL.", self->base_path, f->name);
+        return;
+    }
+    md=of->md;
+    myrank=md->rank;
+
+    struct anonymous_dim *ad=anonymous_dim_find(&of->anonymous_dim_list, dimname);
+    if (ad == NULL) {
+        fprintf(stderr, "couldn't find anonymous dimension (%s)\n", dimname);
+        return;
+    }
+    ad->dim->rank=dimvalue;
+
+    return;
+}
diff --git a/src/adios_phdf5.c b/src/adios_phdf5.c
new file mode 100644
index 0000000..f5efa7e
--- /dev/null
+++ b/src/adios_phdf5.c
@@ -0,0 +1,1195 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+#include "mpi.h"
+#include "adios.h"
+#include "adios_types.h"
+#include "adios_bp_v1.h"
+#include "adios_transport_hooks.h"
+#include "adios_internals.h"
+#ifdef PHDF5 
+#include "hdf5.h"
+#endif
+
+#define NUM_GP 24
+void adios_phdf5_end_iteration (struct adios_method_struct * method)
+{
+}
+
+void adios_phdf5_start_calculation (struct adios_method_struct * method)
+{
+}
+
+void adios_phdf5_stop_calculation (struct adios_method_struct * method)
+{
+}
+void adios_phdf5_get_write_buffer (struct adios_file_struct * fd
+                                ,struct adios_var_struct * v
+                                ,uint64_t * size
+                                ,void ** buffer
+                                ,struct adios_method_struct * method
+                                )
+{
+}
+
+
+#ifndef PHDF5
+void adios_phdf5_init(const char *parameters
+                     ,struct adios_method_struct * method
+                     ){}
+void adios_phdf5_finalize (int mype, struct adios_method_struct * method){}
+enum ADIOS_FLAG adios_phdf5_should_buffer (struct adios_file_struct * fd
+                            ,struct adios_method_struct * method
+                            ){ return adios_flag_unknown; }
+int adios_phdf5_open(struct adios_file_struct *fd
+                    ,struct adios_method_struct * method
+                    ,void * comm
+                    ){ return -1; }
+void adios_phdf5_close (struct adios_file_struct * fd
+                     ,struct adios_method_struct * method
+                     ){}
+void adios_phdf5_write (struct adios_file_struct * fd
+                       ,struct adios_var_struct * v
+                       ,void * data
+                       ,struct adios_method_struct * method
+                       ){}
+void adios_phdf5_read (struct adios_file_struct * fd
+                    ,struct adios_var_struct * v, void * buffer
+                    ,uint64_t buffersize
+                    ,struct adios_method_struct * method
+                    ){}
+#else
+
+///////////////////////////
+// Function Declarations
+///////////////////////////
+int adios_getsize(enum ADIOS_DATATYPES type, void * val);
+
+// adios_flag determine whether it is dataset or group
+
+void hw_gopen (hid_t root_id, char * path, hid_t * grp_id, int * level,enum ADIOS_FLAG grpflag);
+void hw_gclose ( hid_t * grp_ids, int level, enum ADIOS_FLAG grpflag);
+
+int getH5TypeId ( enum ADIOS_DATATYPES type, hid_t* h5_type_id, enum ADIOS_FLAG);
+hsize_t parse_dimension(struct adios_var_struct *pvar_root
+                       ,struct adios_attribute_struct *patt_root 
+                       ,struct adios_dimension_item_struct * dim); 
+int hw_var (hid_t root_id
+           ,struct adios_var_struct *pvar_root
+           ,struct adios_attribute_struct *patt
+           ,struct adios_var_struct *pvar
+           ,enum ADIOS_FLAG fortran_flag 
+           ,int myrank, int nproc);
+int hr_var (hid_t root_id
+           ,struct adios_var_struct *pvar_root
+           ,struct adios_attribute_struct *patt_root
+           ,struct adios_var_struct *pvar
+           ,enum ADIOS_FLAG fortran_flag
+           ,int myrank, int nproc);
+           
+int hw_attribute ( hid_t root_id
+                  ,struct adios_var_struct *pvar_root
+                  ,struct adios_attribute_struct *pvar
+                  ,enum ADIOS_FLAG fortran_flag 
+                  ,int myrank, int nproc);
+
+struct adios_phdf5_data_struct
+{
+  hid_t fh;
+  hid_t root_id;
+  hid_t dxpl_id;
+  MPI_Comm group_comm;
+  int rank;
+  int size;
+
+  void * comm; // temporary until moved from should_buffer to open
+};
+int adios_phdf5_initialized = 0;
+static void adios_var_to_comm_phdf5 (enum ADIOS_FLAG host_language_fortran
+                                    ,void * data
+                                    ,MPI_Comm * comm
+                                    )
+{
+    if (data)
+    {
+        int t = *(int *) data;
+        if (host_language_fortran == adios_flag_yes)
+        {
+            *comm = MPI_Comm_f2c (t);
+        }
+        else
+        {
+            *comm = *(MPI_Comm *) data;
+        }
+    }
+    else
+    {
+        fprintf (stderr, "coordination-communication not provided. "
+                         "Using MPI_COMM_WORLD instead\n"
+                );
+        *comm = MPI_COMM_WORLD;
+    }
+}
+void adios_phdf5_init(const char *parameters
+                     ,struct adios_method_struct * method
+                     )
+{
+    struct adios_phdf5_data_struct * md = (struct adios_phdf5_data_struct *)
+                                                    method->method_data;
+    if (!adios_phdf5_initialized)
+    {
+        adios_phdf5_initialized = 1;
+    }
+    method->method_data = malloc (sizeof (struct adios_phdf5_data_struct));
+    md = (struct adios_phdf5_data_struct *) method->method_data;
+    md->fh = 0;
+    md->root_id = 0;
+    md->rank = -1;
+    md->size = 0;
+    md->group_comm = MPI_COMM_NULL;
+}
+enum ADIOS_FLAG adios_phdf5_should_buffer (struct adios_file_struct * fd
+                            ,struct adios_method_struct * method
+                            )
+{
+    struct adios_phdf5_data_struct * md = (struct adios_phdf5_data_struct *)
+                                                      method->method_data;
+    char * name;
+    MPI_Info info = MPI_INFO_NULL;
+    hid_t fapl_id;
+    fapl_id = H5P_DEFAULT;
+    adios_var_to_comm_phdf5 (fd->group->adios_host_language_fortran
+                      ,md->comm
+                      ,&md->group_comm
+                      );
+    // no shared buffer 
+    //fd->shared_buffer = adios_flag_no;
+    if (md->group_comm != MPI_COMM_NULL)
+    {
+        MPI_Comm_rank (md->group_comm, &md->rank);
+        MPI_Comm_size (md->group_comm, &md->size);
+    }
+    else 
+       md->group_comm=MPI_COMM_SELF;
+    fd->group->process_id = md->rank;
+    name = malloc (strlen (method->base_path) + strlen (fd->name) + 1);
+    sprintf(name, "%s%s", method->base_path, fd->name);
+
+    H5Eset_auto ( NULL, NULL);
+
+    fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+    H5Pset_fapl_mpio(fapl_id,md->group_comm,info);
+
+    // create a new file. If file exists its contents will be overwritten. //
+
+    switch (fd->mode) {
+        case adios_mode_read:
+        {
+            md->fh = H5Fopen (name, H5F_ACC_RDONLY, fapl_id);
+            if (md->fh <= 0)
+            {
+                fprintf (stderr, "ADIOS PHDF5: file not found: %s\n", fd->name);
+                free (name);
+                return adios_flag_no;
+            } 
+            break;
+        }
+        case adios_mode_write:
+        case adios_mode_append:
+            md->fh = H5Fcreate (name, H5F_ACC_EXCL, H5P_DEFAULT, fapl_id);
+            if (md->fh < 0)
+            {
+                md->fh = H5Fopen (name, H5F_ACC_RDWR, fapl_id);
+                //md->fh = H5Fcreate (name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+            }
+            if (md->fh < 0)
+            {
+                fprintf (stderr, "ADIOS PHDF5: file not create/append: %s\n", fd->name);
+                free (name);
+                return adios_flag_no;
+            } 
+            break;
+    }
+
+    md->root_id = H5Gopen(md->fh,"/");
+    if(md->root_id < 0)
+        md->root_id = H5Gcreate(md->fh,"/",0);
+    H5Pclose(fapl_id);
+    free (name); 
+    return adios_flag_no;
+}
+ 
+int adios_phdf5_open(struct adios_file_struct *fd
+                    ,struct adios_method_struct * method, void * comm
+                    )
+{
+    struct adios_phdf5_data_struct * md = (struct adios_phdf5_data_struct *)
+                                                    method->method_data;
+
+    md->comm = comm;
+
+    return 1;
+}
+
+void adios_phdf5_write (struct adios_file_struct * fd
+                       ,struct adios_var_struct * v
+                       ,void * data
+                       ,struct adios_method_struct * method
+                       )
+{
+    struct adios_phdf5_data_struct * md = (struct adios_phdf5_data_struct *)
+                                                       method->method_data;
+    if (fd->mode == adios_mode_write || fd->mode == adios_mode_append)
+    {
+        if (md->rank==0) {
+            fprintf(stderr, "-------------------------\n");
+            fprintf(stderr, "write var: %s start!\n", v->name);
+        }
+        hw_var (md->root_id, fd->group->vars, fd->group->attributes
+                 ,v, fd->group->adios_host_language_fortran,md->rank,md->size);
+    }
+    else
+    {
+       //fprintf(stderr, "entering unknown phdf5 mode %d!\n", fd->mode);
+    }
+    if (md->rank==0) {
+        fprintf(stderr, "write var: %s end!\n", v->name);
+        //fprintf(stderr, "-------------------------\n");
+    }
+}
+
+
+void adios_phdf5_read (struct adios_file_struct * fd
+                      ,struct adios_var_struct * v
+                      ,void * buffer
+                      ,uint64_t buffersize
+                      ,struct adios_method_struct * method
+                      )
+{
+    struct adios_phdf5_data_struct * md = (struct adios_phdf5_data_struct *)
+                                                       method->method_data;
+    if(fd->mode == adios_mode_read)
+    {
+       v->data = buffer;
+       v->data_size = buffersize;
+       
+       if (md->rank==0) {
+           fprintf(stderr, "-------------------------\n");
+           fprintf(stderr, "read var: %s! start\n", v->name);
+       }
+       hr_var (md->root_id
+              ,fd->group->vars
+              ,fd->group->attributes
+              ,v
+              ,fd->group->adios_host_language_fortran
+              ,md->rank
+              ,md->size);
+       v->data = 0;
+       if (md->rank==0) {
+           fprintf(stderr, "read var: %s! end\n", v->name);
+           //fprintf(stderr, "-------------------------\n");
+       }
+       
+    }
+}
+
+static void adios_phdf5_do_read (struct adios_file_struct * fd
+                              ,struct adios_method_struct * method
+                              )
+{
+// This function is not useful for phdf5 since adios_read/write do real read/write 
+}
+
+void adios_phdf5_close (struct adios_file_struct * fd
+                     ,struct adios_method_struct * method
+                     )
+{
+    struct adios_phdf5_data_struct * md = (struct adios_phdf5_data_struct*)
+                                                  method->method_data;
+      
+    struct adios_attribute_struct * a = fd->group->attributes;
+
+    if (fd->mode == adios_mode_read) {
+        if (md->rank==0) {
+           fprintf(stderr, "-------------------------\n");
+           fprintf(stderr, "reading done, phdf5 file is closed;\n");
+           fprintf(stderr, "-------------------------\n");
+        }
+    }
+    else if (fd->mode == adios_mode_write || fd->mode == adios_mode_append)
+    {
+        //fprintf(stderr, "entering phdf5 write attribute mode!\n");
+        while(a)
+        {
+            hw_attribute ( md->root_id, fd->group->vars, a
+                          ,fd->group->adios_host_language_fortran
+                          ,md->rank
+                          ,md->size);
+            a = a->next;
+        }
+        if (md->rank==0) {
+           fprintf(stderr, "-------------------------\n");
+           fprintf(stderr, "writing done, phdf5 file is closed;\n");
+           fprintf(stderr, "-------------------------\n");
+        }
+    }
+
+    if (md && md->fh && md->root_id) {
+        H5Gclose (md->root_id);
+    }
+    H5Fclose (md->fh);
+    md->group_comm = MPI_COMM_NULL;
+    md->fh = 0;
+    md->rank = -1;
+    md->size = 0;
+}
+
+void adios_phdf5_finalize (int mype, struct adios_method_struct * method)
+{
+    // nothing to do here
+    if (adios_phdf5_initialized)
+        adios_phdf5_initialized = 0;
+}
+
+int hw_attribute ( hid_t root_id
+		,struct adios_var_struct *pvar_root
+		,struct adios_attribute_struct *patt
+		,enum ADIOS_FLAG fortran_flag
+		,int myrank
+                ,int nproc) {
+
+    H5Eset_auto ( NULL, NULL);
+    int i, rank = 0, level;
+    char * name;
+    herr_t  status; 
+    hid_t   h5_plist_id, h5_type_id, h5_dataspace_id;
+    hid_t h5_attribute_id, h5_memspace_id, grp_ids[NUM_GP];
+    hsize_t * h5_globaldims, * h5_localdims, * h5_offsets, * h5_strides; 
+    struct adios_dimension_struct * dims;
+    struct adios_var_struct * var_linked;
+     
+    h5_plist_id = H5Pcreate(H5P_DATASET_XFER);
+    h5_plist_id=H5P_DEFAULT;  
+ 
+    H5Pset_dxpl_mpio(h5_plist_id, H5FD_MPIO_COLLECTIVE); 
+    hw_gopen (root_id, patt->path,grp_ids, &level, adios_flag_yes);
+    int err_code = 0;
+    //printf("patt->type=%d patt->name : %s\n", patt->type, patt->name);
+    if (patt->type == -1) {
+        var_linked = patt->var;
+        if (!var_linked || (var_linked && !var_linked->data)) {
+                fprintf (stderr, "PHDF5 ERROR: invalid data in var_linked"
+                        " (in attribute write): %s(%d)\n"
+                        ,var_linked->name, var_linked->id);
+                err_code = -2;  
+                H5Pclose(h5_plist_id);
+                hw_gclose (grp_ids,level, adios_flag_yes);
+                return err_code;
+        }
+        else
+            dims = var_linked->dimensions;
+        getH5TypeId (var_linked->type, &h5_type_id, fortran_flag);
+        // Scalar variable as attribute
+        if (!dims) {
+            h5_dataspace_id = H5Screate ( H5S_SCALAR);
+            if (h5_dataspace_id > 0) {
+                h5_attribute_id = H5Aopen_name ( grp_ids[level], patt->name);
+                if (h5_attribute_id < 0) {
+                    h5_attribute_id = H5Acreate ( grp_ids[level], patt->name
+                                          ,h5_type_id,h5_dataspace_id,0);
+                }
+                if (h5_attribute_id > 0) {
+                        if (myrank == 0)	
+                            H5Awrite ( h5_attribute_id, h5_type_id, var_linked->data);
+                }
+                H5Aclose (h5_attribute_id);
+                H5Sclose (h5_dataspace_id);
+            }
+            else {
+                fprintf (stderr, "PHDF5 ERROR in h5_dataspace_id in hw_attribute\n");  
+                err_code = -2;
+            }
+         }
+         else {
+             while (dims) {
+                ++rank;
+                dims = dims->next;
+             }
+            
+             h5_localdims = (hsize_t *) malloc (rank * sizeof(hsize_t));
+             dims = var_linked->dimensions;
+             for ( i = 0; i < rank; i++) {
+                 if ( dims->dimension.rank == 0 && dims->dimension.id) { 
+                     var_linked = adios_find_var_by_id (pvar_root , dims->dimension.id);
+                     if ( var_linked) {
+                         h5_localdims [i] = *(int *)var_linked->data;
+                     }
+                 }
+                 else
+                     h5_localdims [i] = dims->dimension.rank;
+             }
+             h5_dataspace_id = H5Screate_simple(rank,h5_localdims, NULL);
+             h5_attribute_id = H5Aopen_name ( grp_ids[level], patt->name);
+             if (h5_attribute_id < 0) {
+                 h5_attribute_id = H5Acreate ( grp_ids[level], patt->name
+                                          ,h5_type_id,h5_dataspace_id,0);
+                 if (h5_attribute_id < 0) {
+                     fprintf (stderr, "PHDF5 ERROR: getting negative attribute_id "
+                                      "in hw_attribute: %s\n", patt->name);
+                     err_code = -2; 
+                  }
+             }
+             if (h5_attribute_id > 0) {
+                 if (myrank == 0 && var_linked->data)
+                     H5Awrite ( h5_attribute_id, h5_type_id, var_linked->data);
+                 H5Aclose ( h5_attribute_id);
+             }
+             H5Sclose ( h5_dataspace_id);
+             free (h5_localdims);
+        }
+    }
+    if (patt->type > 0)
+    {
+        getH5TypeId (patt->type, &h5_type_id, fortran_flag);
+        if (h5_type_id > 0) {
+            switch (patt->type) {
+            case adios_string:
+                h5_dataspace_id = H5Screate ( H5S_SCALAR);
+                H5Tset_size ( h5_type_id, (strlen((char *)patt->value)+1));
+                h5_attribute_id = H5Aopen_name ( grp_ids[level], patt->name);
+                if (h5_attribute_id < 0) { 
+                    h5_attribute_id = H5Acreate ( grp_ids[level], patt->name 
+                                        ,h5_type_id, h5_dataspace_id, 0);
+                    if (h5_attribute_id > 0) { 
+                       if (myrank == 0)	
+                          H5Awrite(h5_attribute_id, h5_type_id, patt->value);
+                     }
+                }
+                H5Aclose(h5_attribute_id);
+                H5Sclose (h5_dataspace_id); 
+                break; 
+            case adios_integer: 
+            case adios_long: 
+                break; 
+            default: 
+                break;
+           }
+        }
+    }
+    H5Pclose (h5_plist_id); 
+    hw_gclose (grp_ids,level, adios_flag_yes);
+    return err_code;
+} 
+int hr_var (hid_t root_id
+           ,struct adios_var_struct *pvar_root
+           ,struct adios_attribute_struct *patt_root
+           ,struct adios_var_struct *pvar
+           ,enum ADIOS_FLAG fortran_flag
+           ,int myrank
+           ,int nproc) {
+
+    H5Eset_auto ( NULL, NULL);
+    int i, rank = 0, level, err_code = -2;
+    char * name;
+    herr_t  status; 
+    hid_t   h5_plist_id, h5_type_id, h5_dataspace_id, h5_dataset_id, h5_memspace_id, grp_ids[NUM_GP];
+    struct adios_dimension_struct * dims = pvar->dimensions;
+
+    h5_plist_id = H5Pcreate(H5P_DATASET_XFER);
+    h5_plist_id = H5P_DEFAULT;
+    H5Pset_dxpl_mpio(h5_plist_id, H5FD_MPIO_INDEPENDENT);
+    H5Pclose (h5_plist_id);
+    getH5TypeId (pvar->type, &h5_type_id, fortran_flag);
+    if (h5_type_id <=0 )
+    {
+        fprintf (stderr, "ERROR in getH5TypeId in hr_var!\n");
+        return -2;
+    }
+
+    //name = (char *) malloc (strlen(pvar->path)+strlen(pvar->name)-1);
+    //sprintf (name, "%s", pvar->path);
+    
+    //if (pvar->path[strlen(pvar->path)-1]=='/')
+    //    sprintf (name, "%s%s", name, pvar->name);
+    //else
+    //    sprintf (name, "%s/%s", name, pvar->name);
+
+    if (pvar->path)
+        hw_gopen (root_id, pvar->path, grp_ids, &level, adios_flag_yes);
+    //printf("root_id=%d, grd_ids[%d]=%d\n", root_id, level, grp_ids[level]); 
+    // variable is scalar only need to read by every processor 
+
+    if (!dims) {
+       
+        h5_dataspace_id = H5Screate(H5S_SCALAR);
+        h5_dataset_id = H5Dopen (grp_ids[level], pvar->name);
+        if ( h5_dataset_id > 0) {
+            H5Dread (h5_dataset_id, h5_type_id, H5S_ALL
+                          ,H5S_ALL, h5_plist_id, pvar->data
+                          );
+            H5Dclose (h5_dataset_id);
+            err_code = 0;
+        }
+        else
+            fprintf (stderr, "PHDF5 ERROR: can not open dataset: %s in hr_var\n", pvar->name);
+        H5Sclose (h5_dataspace_id);
+        H5Tclose (h5_type_id);
+        hw_gclose (grp_ids,level, adios_flag_yes);
+        return err_code; 
+    }
+// variable is dataset
+    while (dims) {
+        ++rank;
+        dims = dims->next;
+    }
+    dims = pvar->dimensions;
+
+    if ( dims->global_dimension.rank
+        || (dims->global_dimension.rank == 0  && dims->global_dimension.id)) {
+
+        hsize_t * h5_globaldims, * h5_localdims, * h5_offsets, * h5_strides; 
+        hsize_t h5_gbstrides[2],h5_gbglobaldims[2], h5_gblocaldims[2], h5_gboffsets[2], *h5_gbdims;
+        char name[256];
+        if(myrank==0)printf("\tenter global writing!\n");
+        h5_gbdims = (hsize_t *)malloc(rank * 3 * sizeof(hsize_t));
+        h5_strides = (hsize_t *) malloc (rank * sizeof(hsize_t));
+
+        h5_gbstrides [0] = 1;
+        h5_gbstrides [1] = 1;
+        h5_gbglobaldims [0] = nproc;
+        h5_gbglobaldims [1] = rank * 3;
+        h5_gboffsets [0] = myrank;
+        h5_gboffsets [1] = 0;
+        h5_gblocaldims [0] = 1; 
+        h5_gblocaldims [1] = rank * 3;
+
+        // get the global/local/offset arrays
+        for (i = 0; i < rank; i++) {
+            h5_strides [i] = 1;
+            //dims = dims->next;
+        } // end of for
+
+        // save global-bounds information into the hdf5 files
+        h5_dataspace_id = H5Screate_simple (2, h5_gbglobaldims, NULL);
+        h5_memspace_id = H5Screate_simple (2, h5_gblocaldims, NULL);
+        H5Sselect_hyperslab (h5_dataspace_id, H5S_SELECT_SET
+                            ,h5_gboffsets, h5_gbstrides, h5_gblocaldims,0);
+        sprintf(name, "_%s_gbdims", pvar->name);
+         
+        h5_dataset_id  = H5Dopen ( grp_ids[level], name);
+        if (h5_dataset_id > 0) {
+            H5Dread (h5_dataset_id, H5T_STD_I64LE, h5_memspace_id
+                    ,h5_dataspace_id, h5_plist_id, h5_gbdims);
+            H5Dclose (h5_dataset_id);
+        }
+        h5_globaldims= h5_gbdims;
+        h5_localdims = h5_gbdims+rank;
+        h5_offsets = h5_gbdims+rank*2;
+
+        for (i=0;i<rank;i++) {
+            if(myrank==0) 
+                printf("\tDIMS var:%s dim[%d]:  %d %d %d\n",pvar->name
+                         ,i, h5_globaldims[i], h5_localdims[i], h5_offsets[i]);
+        }
+        H5Sclose(h5_dataspace_id); 
+        H5Sclose(h5_memspace_id);
+          
+        //free(h5_gbdims);
+        //free (h5_strides); 
+        //return 0;
+        
+        h5_dataspace_id = H5Screate_simple (rank, h5_globaldims, NULL);
+        err_code = -2;
+        if (h5_dataspace_id > 0) {
+            H5Sselect_hyperslab (h5_dataspace_id, H5S_SELECT_SET
+                                ,h5_offsets, h5_strides, h5_localdims, 0
+                                );
+            h5_memspace_id = H5Screate_simple (rank, h5_localdims, NULL);
+            if (h5_memspace_id > 0) {
+                h5_dataset_id  = H5Dopen ( grp_ids[level], pvar->name);
+                if (h5_dataset_id > 0) {
+                    H5Dread (h5_dataset_id, h5_type_id, h5_memspace_id
+                            ,h5_dataspace_id, h5_plist_id, pvar->data
+                            );
+                    H5Dclose (h5_dataset_id);
+                    err_code = 0;
+                }
+                else
+                    fprintf (stderr, "PHDF5 ERROR: dataset %s does not existed!\n"\
+                        ,pvar->name);
+                
+                H5Sclose (h5_memspace_id); 
+            }
+            else
+                fprintf (stderr, "PHDF5 ERROR: out of memory, cannot create local space in hr_var: %s\n"\
+                        ,pvar->name);
+            H5Sclose (h5_dataspace_id);
+        }
+        else
+            fprintf (stderr, "PHDF5 ERROR: out of memory, cannot create global space in hr_var: %s\n"\
+                    ,pvar->name);
+         
+        free(h5_gbdims);
+        free (h5_strides); 
+    }  // end of writing dataset with global-bounds
+
+    else {
+        hsize_t *h5_localdims;
+        h5_localdims = (hsize_t *) malloc (rank * sizeof(hsize_t));
+        for (i = 0; i < rank; i++) {
+            h5_localdims [i] = parse_dimension(pvar_root, patt_root, &dims->dimension);
+            //printf("\t var name: %s, dims[%d] = %d\n",pvar->name, i, h5_localdims [i]);
+            dims=dims->next;
+        }
+        h5_dataspace_id = H5Screate_simple (rank, h5_localdims, NULL);
+        if ( h5_dataspace_id > 0) {
+            h5_dataset_id  = H5Dopen ( grp_ids[level], pvar->name);
+            if ( h5_dataset_id > 0) {
+                H5Dread (h5_dataset_id, h5_type_id, H5S_ALL
+                        ,H5S_ALL, h5_plist_id, pvar->data
+                        );
+                H5Dclose (h5_dataset_id);
+                err_code = 0;
+            }
+            else
+                fprintf ( stderr, "PHDF5 ERROR:  cannot create dataset id for var: %s\n", pvar->name);
+            status = H5Sclose (h5_dataspace_id);
+        }
+        else
+            fprintf (stderr, "PHDF5 ERROR: cannot create dataset space %s for var!\n", pvar->name);
+        free (h5_localdims);
+    }
+    hw_gclose(grp_ids, level, adios_flag_yes);
+    H5Tclose (h5_type_id);
+    H5Pclose (h5_plist_id);
+    return err_code;
+}
+
+int hw_var (hid_t root_id
+           ,struct adios_var_struct *pvar_root
+           ,struct adios_attribute_struct *patt_root
+           ,struct adios_var_struct *pvar
+           ,enum ADIOS_FLAG fortran_flag
+           ,int myrank
+           ,int nproc) {
+
+    H5Eset_auto ( NULL, NULL);
+    int i, rank = 0, level;
+    char * name;
+    herr_t  status; 
+    hid_t   h5_plist_id, h5_type_id, h5_dataspace_id, h5_dataset_id, h5_memspace_id, grp_ids[NUM_GP];
+    struct adios_dimension_struct * dims = pvar->dimensions;
+     
+    h5_plist_id = H5Pcreate(H5P_DATASET_XFER);
+    h5_plist_id=H5P_DEFAULT;   
+    //fprintf (stderr, "H5Pset_dxpl_mpio not found on ewok so commented out\n");
+    H5Pset_dxpl_mpio(h5_plist_id, H5FD_MPIO_INDEPENDENT); 
+
+    getH5TypeId (pvar->type, &h5_type_id, fortran_flag);
+    if ( h5_type_id <= 0) {
+       fprintf (stderr, "PHDF5 ERROR in getH5TypeId in hw_var\n");  
+       return -2;
+    }
+/*//////////////////////////////////////////////////////////////////////////
+// This is for the HDF5/1.8.1
+    name = ( char *) malloc ( strlen (pvar->path) + strlen (pvar->name) -1);
+    if ( pvar->path[strlen(pvar->path)-1]=='/')
+        sprintf ( name, "%s%s", pvar->path, pvar->name);
+    else
+        sprintf ( name, "%s/%s", pvar->path, pvar->name);
+*/////////////////////////////////////////////////////////////////////////////
+    //for(i=0;i<nproc;i++)
+    {
+    if (pvar->path)
+        hw_gopen (root_id, pvar->path, grp_ids, &level, adios_flag_yes);
+    }
+    // printf("root_id=%d, grp_id=%d\n", root_id, grp_ids[level]);
+
+    if (!dims) {
+        h5_dataspace_id = H5Screate(H5S_SCALAR);
+        h5_dataset_id = H5Dopen (grp_ids[level], pvar->name);
+        if (h5_dataset_id <= 0) {
+            h5_dataset_id = H5Dcreate (grp_ids[level], pvar->name, h5_type_id
+                                      ,h5_dataspace_id, H5P_DEFAULT
+                                      );
+            if (h5_dataset_id <= 0) 
+                fprintf (stderr, "PHDF5 ERROR: can not create scalar %s in hw_var!\n", pvar->name); 
+        }
+        if (h5_dataset_id>0 ) {
+            status = -1;
+            if ( myrank==1)
+                status = H5Dwrite (h5_dataset_id, h5_type_id, H5S_ALL
+                                  ,H5S_ALL, h5_plist_id, pvar->data
+                                  );
+            //printf("groupid=%d level=%d datasetid=%d\n",grp_ids[level],level,h5_dataset_id);
+            //printf("write dataset: name=%s/%s status=%d myrank=%d\n"
+            //         , pvar->path,pvar->name,status, myrank);
+            H5Dclose (h5_dataset_id); 
+        }
+        H5Sclose (h5_dataspace_id); 
+        H5Tclose (h5_type_id);
+        H5Pclose (h5_plist_id);
+        hw_gclose (grp_ids,level, adios_flag_yes);
+        return 0;
+    }// end of scalar read
+
+    while (dims) {
+        ++rank;
+        dims = dims->next;
+    }
+    dims = pvar->dimensions;
+    hsize_t * h5_globaldims, * h5_localdims, * h5_offsets, * h5_strides, * h5_gbdims; 
+    if ( dims->dimension.rank 
+        || (dims->dimension.rank == 0  && dims->dimension.id)) {
+
+        hsize_t h5_gbstrides[2], h5_gbglobaldims[2], h5_gblocaldims[2], h5_gboffsets[2];
+        char name[256];
+        if(myrank==0)printf("\tenter global reading!\n");
+
+        h5_gbstrides [0] = 1;
+        h5_gbstrides [1] = 1;
+        h5_gbglobaldims [0] = nproc;
+        h5_gbglobaldims [1] = rank * 3;
+        h5_gboffsets [0] = myrank;
+        h5_gboffsets [1] = 0;
+        h5_gblocaldims [0] = 1; 
+        h5_gblocaldims [1] = rank * 3;
+
+        h5_gbdims = (hsize_t *) malloc (rank * 3 * sizeof(hsize_t));
+        h5_strides = (hsize_t *) malloc (rank * sizeof(hsize_t));
+
+        h5_globaldims = h5_gbdims;
+        h5_localdims = h5_gbdims + rank;
+        h5_offsets = h5_gbdims + 2 * rank;
+ 
+        // get the global/local/offset arrays       
+        for ( i = 0; i < rank; i++) {
+             h5_strides [i] = 1;
+             h5_globaldims[i] = parse_dimension (pvar_root, patt_root, &dims->global_dimension);
+             h5_localdims[i] = parse_dimension (pvar_root, patt_root, &dims->dimension);
+             h5_offsets[i] = parse_dimension (pvar_root, patt_root, &dims->local_offset);
+             if (dims)
+                 dims = dims -> next;
+             if (myrank==0) {
+                 printf("\t%s[%d]: g(%d):l(%d):o(%d)\n"
+                       ,pvar->name,i
+                       ,h5_globaldims[i]
+                       ,h5_localdims[i]
+                       ,h5_offsets[i]);
+             }
+        }
+        sprintf(name, "_%s_gbdims", pvar->name);
+        // save the global bounds information into hdf5 file
+
+        h5_dataspace_id = H5Screate_simple (2, h5_gbglobaldims, NULL);
+        h5_memspace_id = H5Screate_simple (2, h5_gblocaldims, NULL);
+
+        H5Sselect_hyperslab (h5_dataspace_id, H5S_SELECT_SET
+                            ,h5_gboffsets, h5_gbstrides, h5_gblocaldims,0);
+    
+        h5_dataset_id  = H5Dopen ( grp_ids[level], name);
+        if (h5_dataset_id < 0) {
+             h5_dataset_id = H5Dcreate (grp_ids[level]
+                                       ,name
+                                       ,H5T_STD_I64LE
+                                       ,h5_dataspace_id
+                                       ,H5P_DEFAULT);
+        }
+        if (h5_dataset_id > 0) {
+            H5Dwrite (h5_dataset_id, H5T_STD_I64LE, h5_memspace_id
+                     ,h5_dataspace_id, h5_plist_id, h5_gbdims);
+            H5Dclose (h5_dataset_id);
+        }
+        H5Sclose(h5_dataspace_id); 
+        H5Sclose(h5_memspace_id);
+          
+        h5_dataspace_id = H5Screate_simple (rank, h5_globaldims, NULL);
+        if ( h5_dataspace_id < 0 && rank ==2) { 
+            fprintf (stderr, "PHDF5 ERROR: cannot create dataspace for var: %s %d %d %d\n"\
+                    ,pvar->name, rank, h5_globaldims[0], h5_globaldims[1]);
+            return -1; 
+         } 
+
+         status = H5Sselect_hyperslab (h5_dataspace_id, H5S_SELECT_SET
+                                  ,h5_offsets, h5_strides, h5_localdims, 0 
+                                  );
+
+         h5_dataset_id  = H5Dopen ( grp_ids[level], pvar->name);
+         if ( h5_dataset_id < 0) { 
+             h5_dataset_id = H5Dcreate (grp_ids[level]
+                                       ,pvar->name
+                                       ,h5_type_id
+                                       ,h5_dataspace_id
+                                       ,H5P_DEFAULT);
+             if ( h5_dataset_id < 0) {
+                fprintf (stderr, "PHDF5 ERROR: can not create dataset: %s!\n"
+                       , pvar->name); 
+                return -2; 
+            } 
+        } 
+        h5_memspace_id = H5Screate_simple (rank, h5_localdims, NULL);
+        if ( h5_memspace_id < 0) { 
+            fprintf ( stderr, "PHDF5 ERROR: can not create h5_dataset for"
+                      " var: %s\n"
+                     ,pvar->name);
+            return -1; 
+         } 
+         status = H5Dwrite (h5_dataset_id, h5_type_id, h5_memspace_id 
+                           ,h5_dataspace_id, h5_plist_id, pvar->data
+                           );
+        status = H5Dclose (h5_dataset_id);
+        status = H5Sclose (h5_dataspace_id);
+        status = H5Sclose (h5_memspace_id);
+        free (h5_gbdims);  
+        free (h5_strides);  
+    }
+    else {
+        h5_localdims = (hsize_t *) malloc (rank * sizeof(hsize_t));
+        hid_t h5p_dset_id;
+        enum ADIOS_FLAG is_timeindex = adios_flag_no;
+        int  srank, dimindex = 0;
+        for ( i = 0; i < rank; i++) {
+            h5_localdims [i] = parse_dimension(pvar_root, patt_root, &dims->dimension);
+            if ( dims->dimension.time_index == adios_flag_yes) {
+                  is_timeindex = adios_flag_yes;
+                  dimindex = i;
+            }
+            dims = dims -> next;
+        }
+        h5_dataset_id  = H5Dopen (grp_ids[level], pvar->name);
+        if (is_timeindex== adios_flag_no) {
+            h5_dataspace_id = H5Screate_simple (rank, h5_localdims, NULL);
+        }
+        else {
+            if (h5_dataset_id > 0) {
+                h5_globaldims = (hsize_t *) malloc (rank * sizeof(hsize_t));
+                h5_offsets = (hsize_t *) malloc (rank * sizeof(hsize_t));
+                h5_strides = (hsize_t *) malloc (rank * sizeof(hsize_t));
+                for (i=0;i<rank;i++) {
+                    h5_offsets [i] = 0; 
+                    h5_strides [i] = 1; 
+                }
+                h5_dataspace_id = H5Dget_space(h5_dataset_id);
+                srank = H5Sget_simple_extent_ndims (h5_dataspace_id);
+                //fprintf(stderr, "var %s has time index %d %d \n"
+                //       ,pvar->name, h5_offsets[1], h5_globaldims[1]); 
+                H5Sget_simple_extent_dims (h5_dataspace_id, h5_globaldims, NULL);
+                h5_offsets [dimindex] = h5_globaldims [dimindex];
+                h5_globaldims [dimindex] = h5_globaldims [dimindex] + 1;
+                H5Dextend (h5_dataset_id, h5_globaldims);
+                h5_dataspace_id = H5Dget_space(h5_dataset_id);
+                H5Sselect_hyperslab (h5_dataspace_id, H5S_SELECT_SET
+                                ,h5_offsets, h5_strides, h5_localdims, 0
+                                );
+                h5_memspace_id = H5Screate_simple (rank, h5_localdims, NULL);
+                //H5Sset_extent_simple (h5_dataspace_id, rank, h5_globaldims, NULL);
+                //H5Sget_simple_extent_dims (h5_dataspace_id, h5_offsets, h5_globaldims);
+                fprintf(stderr, "var %s has time index %d %d \n"
+                       ,pvar->name, h5_offsets[1], h5_globaldims[1]); 
+            }
+            else {
+                h5p_dset_id = H5Pcreate(H5P_DATASET_CREATE);
+                H5Pset_chunk(h5p_dset_id, rank, h5_localdims);
+                h5_dataspace_id = H5Screate_simple (rank, h5_localdims, NULL);
+                h5_memspace_id = h5_dataspace_id;
+            }
+        }
+       
+        if ( h5_dataspace_id < 0) { 
+            fprintf ( stderr, "PHDF5 ERROR: can not create memspace "
+                              "for var: %s\n", pvar->name);
+            return -1; 
+        } 
+        if ( h5_dataset_id < 0) {
+            if (is_timeindex == adios_flag_yes) {
+                h5_dataset_id = H5Dcreate (grp_ids[level]
+                                      ,pvar->name
+                                      ,h5_type_id
+                                      ,h5_dataspace_id
+                                      ,h5p_dset_id);
+            } 
+            else {
+                h5_dataset_id = H5Dcreate (grp_ids[level]
+                                      ,pvar->name
+                                      ,h5_type_id
+                                      ,h5_dataspace_id
+                                      ,H5P_DEFAULT);
+            } 
+            if ( h5_dataset_id < 0) {
+                fprintf ( stderr, "PHDF5 ERROR: can not create dataset: %s!\n", pvar->name); 
+                return -2;
+            } 
+        } 
+        if (myrank==0) 
+        {
+            if (is_timeindex == adios_flag_yes) {
+               printf("dataspace: %d, memspace: %d\n",h5_memspace_id, h5_dataspace_id); 
+               H5Dwrite (h5_dataset_id, h5_type_id,h5_memspace_id 
+                        ,h5_dataspace_id, h5_plist_id, pvar->data
+                        );
+            }
+            else {
+               H5Dwrite (h5_dataset_id, h5_type_id, H5S_ALL
+                        ,H5S_ALL, h5_plist_id, pvar->data
+                        );
+            }
+        } 
+        H5Dclose (h5_dataset_id);
+        H5Sclose (h5_dataspace_id);
+        H5Sclose (h5_memspace_id);
+        free (h5_localdims);  
+    }
+    hw_gclose(grp_ids, level, adios_flag_yes);
+    H5Tclose (h5_type_id);
+    H5Pclose (h5_plist_id);
+    return 0;
+}
+
+/*
+ * Maps bp datatypes to h5 datatypes 
+ *
+ * The Mapping is according to HDF5 Reference Manual
+ * (http://hdf.ncsa.uiuc.edu/HDF5/doc1.6/Datatypes.html)
+ */
+int getH5TypeId(enum ADIOS_DATATYPES type, hid_t* h5_type_id \
+               ,enum ADIOS_FLAG fortran_flag) {
+    int size, status=0;
+    switch (type)
+    {
+        case adios_byte:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_CHAR);
+            break;
+        case adios_short:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_SHORT);
+            break;
+        case adios_integer:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_INT32);
+            break;
+        case adios_long:
+                *h5_type_id = H5Tcopy(H5T_NATIVE_INT64);
+            break;
+        case adios_string:
+            if (fortran_flag == adios_flag_yes)
+                *h5_type_id = H5Tcopy(H5T_FORTRAN_S1);
+            else if (fortran_flag == adios_flag_no)
+                *h5_type_id = H5Tcopy(H5T_C_S1_g);
+            break;
+        case adios_real:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_FLOAT);
+            break;
+        case adios_double:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_DOUBLE);
+            break;
+        case adios_long_double:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_LDOUBLE);
+            break;
+        case adios_complex:
+        case adios_double_complex:
+            fprintf(stderr, "ERROR in mapping ADIOS Data Types to HDF5: complex not supported yet.\n");
+            status = -1;
+            break;
+        case adios_unsigned_byte:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_UCHAR);
+            break;
+        case adios_unsigned_short:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_USHORT);
+            break;
+        case adios_unsigned_integer:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_UINT32);
+	    break;
+        case adios_unsigned_long:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_UINT64);
+	    break;
+        default:
+            status = -1;
+            break;
+    }
+    return status;
+}
+
+int adios_getsize(enum ADIOS_DATATYPES type, void *val) {
+
+    switch (type)
+    {
+        case adios_byte:
+            return 1;
+
+        case adios_string:
+            return strlen ((char *) val);
+
+        case adios_short:
+        case adios_unsigned_short:
+            return 2;
+
+        case adios_integer:
+        case adios_unsigned_integer:
+        case adios_long:
+        case adios_unsigned_long:
+            return 4;
+
+        case adios_real:
+            return 4;
+
+        case adios_double:
+            return 8;
+
+        case adios_long_double:
+            return 16;
+
+        case adios_complex:
+            return 2 * 4;
+
+        case adios_double_complex:
+            return 2 * 8;
+
+        default:
+            return -1;
+    }
+}
+
+// close group/dataset
+// adios_flag_yes      group
+// adios_flag_no       dataset
+
+void hw_gclose (hid_t * grp_id, int level, enum ADIOS_FLAG flag) {
+     int i;
+     if (flag == adios_flag_unknown) {
+         fprintf (stderr, "Unknown flag in hw_gclose!\n");
+         return;
+     }
+     for ( i = 1; i <= level; i++) {
+         if (i == level && flag == adios_flag_no)
+             H5Dclose(grp_id[i]); 
+         else
+             H5Gclose(grp_id[i]); 
+
+     }
+}
+
+// open group/dataset
+// adios_flag_yes      group
+// adios_flag_no       dataset
+// adios_flag_unknown 
+
+void hw_gopen (hid_t root_id, char * path, hid_t * grp_id, int * level, enum ADIOS_FLAG flag) {
+
+    if (flag == adios_flag_unknown) {
+        fprintf (stderr, "Unknown flag in hw_gclose!\n");
+        return;
+    }
+    int i, idx = 0, len = 0;
+    char * pch, ** grp_name, * tmpstr;
+    tmpstr= (char *)malloc(strlen(path)+1);
+    strcpy (tmpstr, path);
+    pch = strtok(tmpstr,"/");
+    grp_name = (char **) malloc(NUM_GP);
+    while ( pch!=NULL && *pch!=' ') {
+	len = strlen(pch);
+	grp_name[idx]  = (char *)malloc(len+1);
+	grp_name[idx][0]='\0';
+	strcat(grp_name[idx],pch);
+	pch=strtok(NULL,"/");
+	idx=idx+1;
+    }
+    *level = idx;
+    grp_id [0] = root_id; 
+    len = strlen(path);
+    for ( i = 0; i < *level; i++) {
+        grp_id [i + 1] = H5Gopen (grp_id [i],grp_name [i]);
+        if (grp_id [i + 1] < 0) {
+            if ((i+1) == *level && (flag == adios_flag_no)) {
+                MPI_Barrier(MPI_COMM_WORLD);
+                grp_id [i + 1] = H5Dopen (grp_id [i],grp_name [i]);
+                MPI_Barrier(MPI_COMM_WORLD);
+            }
+            else {
+                MPI_Barrier(MPI_COMM_WORLD);
+                grp_id [i + 1] = H5Gcreate (grp_id [i], grp_name [i], 0);
+                MPI_Barrier(MPI_COMM_WORLD);
+//                printf("creat grp:name[%d]=%s id=%d level=%d\n", i,grp_name[i],grp_id[i+1],*level);
+            }
+        }
+        if (grp_id [i + 1] < 0) { 
+            fprintf (stderr, "PHDF5 ERROR: create group %s failed!\n", grp_name[i]);
+            return; 
+        }
+    }
+    for ( i = 0; i < *level; i++)
+        if ( grp_name[i])
+            free (grp_name[i]); 
+    free (grp_name);
+    free (tmpstr);
+}
+hsize_t parse_dimension(struct adios_var_struct *pvar_root,
+                        struct adios_attribute_struct *patt_root, 
+                        struct adios_dimension_item_struct * dim) {
+    hsize_t dimsize;
+    struct adios_var_struct *var_linked = NULL;
+    struct adios_attribute_struct *attr_linked;
+    if ( dim->id) {
+        var_linked = adios_find_var_by_id (pvar_root , dim->id);
+        if (!var_linked) {
+            attr_linked = adios_find_attribute_by_id ( patt_root, dim->id);
+            if (!attr_linked->var) {
+                switch (attr_linked->type) {
+                case adios_unsigned_byte:
+                    dimsize = *(uint8_t *)attr_linked->value;
+                    break;
+                case adios_byte:
+                    dimsize = *(int8_t *)attr_linked->value;
+                    break;
+                case adios_unsigned_short:
+                    dimsize = *(uint16_t *)attr_linked->value;
+                    break;
+                case adios_short:
+                    dimsize = *(int16_t *)attr_linked->value;
+                    break;
+                case adios_unsigned_integer:
+                    dimsize = *(uint32_t *)attr_linked->value;
+                    break;
+                case adios_integer:
+                    dimsize = *(int32_t *)attr_linked->value;
+                    break;
+                case adios_unsigned_long:
+                    dimsize = *(uint64_t *)attr_linked->value;
+                    break;
+                case adios_long:
+                    dimsize = *(int64_t *)attr_linked->value;
+                    break;
+                default:
+                    fprintf (stderr, "Invalid datatype for array dimension on "
+                             "var %s: %s\n"
+                            ,attr_linked->name
+                            ,adios_type_to_string_int (var_linked->type)
+                            );
+                    break;
+                }
+            }
+            else {
+                var_linked = attr_linked->var;
+            }
+        }
+        if ( var_linked && var_linked->data){
+            dimsize = *(int *)var_linked->data;
+        }
+
+    }
+    else {
+        if (dim->time_index == adios_flag_yes)
+            dimsize = 1;
+        else
+            dimsize = dim->rank;
+    }
+    return dimsize; 
+}
+#endif
diff --git a/src/adios_posix.c b/src/adios_posix.c
new file mode 100644
index 0000000..8df9081
--- /dev/null
+++ b/src/adios_posix.c
@@ -0,0 +1,1394 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <sys/types.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <stdint.h>
+
+// see if we have MPI or other tools
+#include "config.h"
+
+// mpi
+#if HAVE_MPI
+#include "mpi.h"
+#endif
+
+// xml parser
+#include <mxml.h>
+
+#include "adios.h"
+#include "adios_transport_hooks.h"
+#include "adios_bp_v1.h"
+#include "adios_internals.h"
+#include "buffer.h"
+
+#if defined(__APPLE__) 
+#    define O_LARGEFILE 0
+#endif
+
+static int adios_posix_initialized = 0;
+
+struct adios_POSIX_data_struct
+{
+    // our file bits
+    struct adios_bp_buffer_struct_v1 b;
+
+    // old index structs we read in and have to be merged in
+    struct adios_index_process_group_struct_v1 * old_pg_root;
+    struct adios_index_var_struct_v1 * old_vars_root;
+    struct adios_index_attribute_struct_v1 * old_attrs_root;
+
+    uint64_t vars_start;
+    uint64_t vars_header_size;
+#ifdef HAVE_MPI
+    // Metadata file handle
+    int mf;
+    MPI_Comm group_comm;
+    int rank;
+    int size;
+#endif
+};
+
+#ifdef HAVE_MPI
+static void adios_var_to_comm (const char * comm_name
+                              ,enum ADIOS_FLAG host_language_fortran
+                              ,void * data
+                              ,MPI_Comm * comm
+                              )
+{
+    if (data)
+    {
+        int t = *(int *) data;
+
+        if (!comm_name)
+        {
+            if (!t)
+            {
+                fprintf (stderr, "communicator not provided and none "
+                                 "listed in XML.  Defaulting to "
+                                 "MPI_COMM_SELF\n"
+                        );
+
+                *comm = MPI_COMM_SELF;
+            }
+            else
+            {
+                if (host_language_fortran == adios_flag_yes)
+                {
+                    *comm = MPI_Comm_f2c (t);
+                }
+                else
+                {
+                    *comm = *(MPI_Comm *) data;
+                }
+            }
+        }
+        else
+        {
+            if (!strcmp (comm_name, ""))
+            {
+                if (!t)
+                {
+                    fprintf (stderr, "communicator not provided and none "
+                                     "listed in XML.  Defaulting to "
+                                     "MPI_COMM_SELF\n"
+                            );
+
+                    *comm = MPI_COMM_SELF;
+                }
+                else
+                {
+                    if (host_language_fortran == adios_flag_yes)
+                    {
+                        *comm = MPI_Comm_f2c (t);
+                    }
+                    else
+                    {
+                        *comm = *(MPI_Comm *) data;
+                    }
+                }
+            }
+            else
+            {
+                if (!t)
+                {
+                    fprintf (stderr, "communicator not provided but one "
+                                     "listed in XML.  Defaulting to "
+                                     "MPI_COMM_WORLD\n"
+                            );
+
+                    *comm = MPI_COMM_WORLD;
+                }
+                else
+                {
+                    if (host_language_fortran == adios_flag_yes)
+                    {
+                        *comm = MPI_Comm_f2c (t);
+                    }
+                    else
+                    {
+                        *comm = *(MPI_Comm *) data;
+                    }
+                }
+            }
+        }
+    }
+    else
+    {
+        fprintf (stderr, "coordination-communication not provided. "
+                         "Using MPI_COMM_SELF instead\n"
+                );
+
+        *comm = MPI_COMM_SELF;
+    }
+}
+#endif
+
+void adios_posix_init (const char * parameters
+                      ,struct adios_method_struct * method
+                      )
+{
+    struct adios_POSIX_data_struct * p = 0;
+
+    if (!adios_posix_initialized)
+    {
+        adios_posix_initialized = 1;
+    }
+
+    method->method_data = malloc (sizeof (struct adios_POSIX_data_struct));
+    p = (struct adios_POSIX_data_struct *) method->method_data;
+    adios_buffer_struct_init (&p->b);
+    p->old_pg_root = 0;
+    p->old_vars_root = 0;
+    p->old_attrs_root = 0;
+    p->vars_start = 0;
+    p->vars_header_size = 0;
+#ifdef HAVE_MPI
+    p->mf = 0;
+    p->group_comm = MPI_COMM_NULL;
+    p->rank = 0;
+    p->size = 0;
+#endif
+}
+
+int adios_posix_open (struct adios_file_struct * fd
+                     ,struct adios_method_struct * method, void * comm
+                     )
+{
+    char * subfile_name;
+    char * mdfile_name;
+    int rank;
+    char * name_with_rank, rank_string[16];
+    struct adios_POSIX_data_struct * p = (struct adios_POSIX_data_struct *)
+                                                          method->method_data;
+#ifdef HAVE_MPI
+    // Need to figure out new the new fd->name, such as restart.bp.0, restart.bp.1....
+    adios_var_to_comm (fd->group->group_comm
+                      ,fd->group->adios_host_language_fortran
+                      ,comm
+                      ,&p->group_comm
+                      );
+
+    if (p->group_comm == MPI_COMM_NULL)
+    {
+        p->group_comm = MPI_COMM_SELF;
+    }
+
+    // if communicator is not MPI_COMM_NULL/MPI_COMM_SELF, subfiles will be generated in a dir.
+    if (p->group_comm != MPI_COMM_SELF)
+    {
+        char * n = strrchr (fd->name, '/');
+        if (!n)
+        {
+            n = fd->name;
+        }
+        else
+        {
+            n++;
+        }
+
+        MPI_Comm_rank (p->group_comm, &p->rank);
+        MPI_Comm_size (p->group_comm, &p->size);
+
+        sprintf (rank_string, "%d", p->rank);
+        // fd->name + '.' + MPI rank + '\0'
+        name_with_rank = malloc (strlen (n) + strlen (rank_string) + 2);
+        sprintf (name_with_rank, "%s.%s",  n, rank_string);
+
+        // e.g., subfile_name is restart.bp.dir/restart.bp.0
+        subfile_name = malloc (strlen (fd->name)
+                              + 5
+                              + strlen (method->base_path)
+                              + strlen (name_with_rank)
+                              + 1
+                              );
+        sprintf (subfile_name, "%s%s%s%s"
+                             , fd->name
+                             , ".dir/"
+                             , method->base_path
+                             , name_with_rank
+                             );
+
+        mdfile_name = malloc (strlen (method->base_path)
+                             + strlen (fd->name)
+                             + 1
+                             );
+        sprintf (mdfile_name, "%s%s"
+                            , method->base_path
+                            , fd->name
+                            );
+
+        free (name_with_rank);
+    }
+    else
+#endif
+    {
+        // if the communicator is MPI_COMM_SELF, there won't be metadata file generated.
+        // The actually subfile name is the one supplied by the user
+        subfile_name = malloc (strlen (method->base_path) + strlen (fd->name) + 1);
+        sprintf (subfile_name, "%s%s", method->base_path, fd->name);
+        mdfile_name = 0;
+    }
+
+    fd->subfile_name = strdup (subfile_name);
+
+    struct stat s;
+    if (stat (subfile_name, &s) == 0)
+        p->b.file_size = s.st_size;
+
+    switch (fd->mode)
+    {
+        case adios_mode_read:
+        {
+            p->b.f = open (subfile_name, O_RDONLY | O_LARGEFILE);
+            if (p->b.f == -1)
+            {
+                fprintf (stderr, "ADIOS POSIX: file not found: %s\n", fd->name);
+
+                free (subfile_name);
+
+                return 0;
+            }
+            fd->base_offset = 0;
+            fd->pg_start_in_file = 0;
+
+            break;
+        }
+
+        case adios_mode_write:
+        {
+#ifdef HAVE_MPI
+            // create dir to keep all the subfiles
+            if (p->group_comm != MPI_COMM_SELF)
+            {
+                if (p->rank == 0)
+                {
+                    char * dir_name = malloc (strlen (fd->name) + 4 + 1);
+                    sprintf (dir_name, "%s%s"
+                                     , fd->name
+                                     , ".dir"
+                                     ) ;
+
+                    mkdir (dir_name, S_IRWXU | S_IRWXG);
+                    free (dir_name);
+                }
+
+                MPI_Barrier (p->group_comm);
+            }
+#endif
+            p->b.f = open (subfile_name, O_WRONLY | O_CREAT | O_TRUNC | O_LARGEFILE
+                                       ,  S_IRUSR | S_IWUSR
+                                        | S_IRGRP | S_IWGRP
+                                        | S_IROTH | S_IWOTH
+                            );
+            if (p->b.f == -1)
+            {
+                fprintf (stderr, "adios_posix_open failed for "
+                                 "base_path %s, subfile name %s\n"
+                        ,method->base_path, subfile_name
+                        );
+
+                free (subfile_name);
+                free (mdfile_name);
+
+                return 0;
+            }
+
+#ifdef HAVE_MPI
+            // open metadata file
+            if (p->group_comm != MPI_COMM_SELF)
+            {
+                if (p->rank == 0)
+                {
+                    p->mf = open (mdfile_name, O_WRONLY | O_CREAT | O_TRUNC | O_LARGEFILE
+                                  ,  S_IRUSR | S_IWUSR
+                                   | S_IRGRP | S_IWGRP
+                                   | S_IROTH | S_IWOTH
+                             );
+                    if (p->mf == -1)
+                    {
+                        fprintf (stderr, "adios_posix_open failed for "
+                                         "base_path %s, metadata file name %s\n"
+                                ,method->base_path, mdfile_name
+                                );
+
+                        free (subfile_name);
+                        free (mdfile_name);
+
+                        return 0;
+                    }
+                }
+            }
+#endif
+            fd->base_offset = 0;
+            fd->pg_start_in_file = 0;
+
+            break;
+        }
+
+        case adios_mode_append:
+        {
+            int old_file = 1;
+#ifdef HAVE_MPI
+            if (p->group_comm != MPI_COMM_SELF)
+            {
+                if (p->rank == 0)
+                {
+                    char * dir_name = malloc (strlen (fd->name) + 4 + 1);
+                    sprintf (dir_name, "%s%s"
+                                     , fd->name
+                                     , ".dir"
+                                     ) ;
+
+                    mkdir (dir_name, S_IRWXU | S_IRWXG);
+                    free (dir_name);
+                }
+
+                MPI_Barrier (p->group_comm);
+            }
+#endif
+            p->b.f = open (subfile_name, O_RDWR | O_LARGEFILE);
+            if (p->b.f == -1)
+            {
+                old_file = 0;
+                p->b.f = open (subfile_name,  O_WRONLY | O_CREAT | O_LARGEFILE
+                                ,  S_IRUSR | S_IWUSR
+                                 | S_IRGRP | S_IWGRP
+                                 | S_IROTH | S_IWOTH
+                                );
+                if (p->b.f == -1)
+                {
+                    fprintf (stderr, "adios_posix_open failed for "
+                                     "base_path %s, name %s\n"
+                            ,method->base_path, fd->name
+                            );
+
+                    free (subfile_name);
+                    free (mdfile_name);
+
+                    return 0;
+                }
+            }
+#ifdef HAVE_MPI
+            // open metadata file
+            if (p->group_comm != MPI_COMM_SELF)
+            {
+                if (p->rank == 0)
+                {
+                    p->mf = open (mdfile_name, O_WRONLY | O_TRUNC | O_LARGEFILE
+                                              , S_IRUSR | S_IWUSR
+                                              | S_IRGRP | S_IWGRP
+                                              | S_IROTH | S_IWOTH
+                                 );
+                    if (p->mf == -1)
+                    {
+                        p->mf = open (mdfile_name, O_WRONLY| O_CREAT | O_LARGEFILE
+                                                 , S_IRUSR | S_IWUSR
+                                                 | S_IRGRP | S_IWGRP
+                                             | S_IROTH | S_IWOTH
+                                     );
+                        if (p->mf == -1)
+                        {
+                            fprintf (stderr, "adios_posix_open failed for "
+                                             "base_path %s, name %s\n"
+                                    ,method->base_path, fd->name
+                                    );
+
+                            free (subfile_name);
+                            free (mdfile_name);
+
+                            return 0;
+                        }
+                    }
+                }
+            }
+#endif
+            if (old_file)
+            {
+                // now we have to read the old stuff so we can merge it
+                // in at the end and set the base_offset for the old index
+                // start
+                uint32_t version;
+                adios_posix_read_version (&p->b);
+                adios_parse_version (&p->b, &version);
+
+                switch (version & ADIOS_VERSION_NUM_MASK)
+                {
+                    case 1:
+                        // read the old stuff and set the base offset
+                        adios_posix_read_index_offsets (&p->b);
+                        adios_parse_index_offsets_v1 (&p->b);
+
+                        adios_posix_read_process_group_index (&p->b);
+                        adios_parse_process_group_index_v1 (&p->b
+                                                           ,&p->old_pg_root
+                                                           );
+
+                        // find the largest time index so we can append properly
+                        struct adios_index_process_group_struct_v1 * pg;
+                        uint32_t max_time_index = 0;
+                        pg = p->old_pg_root;
+                        while (pg)
+                        {
+                            if (pg->time_index > max_time_index)
+                                max_time_index = pg->time_index;
+                            pg = pg->next;
+                        }
+                        fd->group->time_index = ++max_time_index;
+
+                        adios_posix_read_vars_index (&p->b);
+                        adios_parse_vars_index_v1 (&p->b, &p->old_vars_root);
+
+                        adios_posix_read_attributes_index (&p->b);
+                        adios_parse_attributes_index_v1 (&p->b
+                                                        ,&p->old_attrs_root
+                                                        );
+
+                        fd->base_offset = p->b.end_of_pgs;
+                        fd->pg_start_in_file = p->b.end_of_pgs;
+                        break;
+
+                    default:
+                        fprintf (stderr, "Unknown bp version: %d.  "
+                                         "Cannot append\n"
+                                ,version
+                                );
+
+                        free (subfile_name);
+                        free (mdfile_name);
+
+                        return 0;
+                }
+            }
+
+            break;
+        }
+
+        default:
+        {
+            fprintf (stderr, "Unknown file mode: %d\n", fd->mode);
+
+            free (subfile_name);
+            free (mdfile_name);
+
+            return 0;
+        }
+    }
+
+    free (subfile_name);
+    free (mdfile_name);
+
+    return 1;
+}
+
+enum ADIOS_FLAG adios_posix_should_buffer (struct adios_file_struct * fd
+                                          ,struct adios_method_struct * method
+                                          )
+{
+    struct adios_POSIX_data_struct * p = (struct adios_POSIX_data_struct *)
+                                                          method->method_data;
+
+    if (fd->shared_buffer == adios_flag_no && fd->mode != adios_mode_read)
+    {
+        // write the process group header
+        adios_write_process_group_header_v1 (fd, fd->write_size_bytes);
+
+        lseek (p->b.f, fd->base_offset, SEEK_SET);
+        ssize_t s = write (p->b.f, fd->buffer, fd->bytes_written);
+        if (s != fd->bytes_written)
+        {
+            fprintf (stderr, "POSIX method tried to write %llu, "
+                             "only wrote %llu\n"
+                    ,fd->bytes_written
+                    ,s
+                    );
+        }
+        fd->base_offset += s;
+        fd->offset = 0;
+        fd->bytes_written = 0;
+        adios_shared_buffer_free (&p->b);
+
+        // setup for writing vars
+        adios_write_open_vars_v1 (fd);
+        p->vars_start = lseek (p->b.f, fd->offset, SEEK_CUR);  // save loc
+        p->vars_header_size = p->vars_start - fd->base_offset;  // the size
+        p->vars_start -= fd->offset; // adjust to start of header
+        fd->base_offset += fd->offset;  // add the size of the vars header
+        fd->offset = 0;
+        fd->bytes_written = 0;
+        adios_shared_buffer_free (&p->b);
+    }
+
+    return fd->shared_buffer;   // buffer if there is space
+}
+
+void adios_posix_write (struct adios_file_struct * fd
+                       ,struct adios_var_struct * v
+                       ,void * data
+                       ,struct adios_method_struct * method
+                       )
+{
+    struct adios_POSIX_data_struct * p = (struct adios_POSIX_data_struct *)
+                                                          method->method_data;
+
+    if (v->got_buffer == adios_flag_yes)
+    {
+        if (data != v->data)  // if the user didn't give back the same thing
+        {
+            if (v->free_data == adios_flag_yes)
+            {
+                free (v->data);
+                adios_method_buffer_free (v->data_size);
+            }
+        }
+        else
+        {
+            // we already saved all of the info, so we're ok.
+            return;
+        }
+    }
+
+    if (fd->shared_buffer == adios_flag_no)
+    {
+        // var payload sent for sizing information
+        adios_write_var_header_v1 (fd, v);
+        ssize_t s = write (p->b.f, fd->buffer, fd->bytes_written);
+        if (s != fd->bytes_written)
+        {
+            fprintf (stderr, "POSIX method tried to write %llu, "
+                             "only wrote %llu\n"
+                    ,fd->bytes_written
+                    ,s
+                    );
+        }
+        fd->base_offset += s;
+        fd->offset = 0;
+        fd->bytes_written = 0;
+        adios_shared_buffer_free (&p->b);
+
+        // write payload
+        // adios_write_var_payload_v1 (fd, v);
+        uint64_t var_size = adios_get_var_size (v, fd->group, v->data);
+        if (fd->base_offset + var_size > fd->pg_start_in_file + fd->write_size_bytes)
+            fprintf (stderr, "adios_posix_write exceeds pg bound. File is corrupted. "
+                             "Need to enlarge group size. \n"); 
+
+        int32_t to_write;
+        uint64_t bytes_written = 0;
+        if (var_size > INT32_MAX)
+        {
+            to_write = INT32_MAX;
+        }
+        else
+        {
+            to_write = (int32_t) fd->bytes_written;
+        }
+
+        while (bytes_written < var_size)
+        {
+            bytes_written += write (p->b.f, v->data + bytes_written, to_write);
+            if (var_size > bytes_written)
+            {
+                if (var_size - bytes_written > INT32_MAX)
+                {
+                    to_write = INT32_MAX;
+                }
+                else
+                {
+                    to_write = var_size - bytes_written;
+                }
+            }
+        }
+
+//        s = write (p->b.f, v->data, var_size);
+        s = bytes_written;
+        if (s != var_size)
+        {
+            fprintf (stderr, "POSIX method tried to write %llu, "
+                             "only wrote %llu\n"
+                    ,var_size
+                    ,s
+                    );
+        }
+        fd->base_offset += s;
+        fd->offset = 0;
+        fd->bytes_written = 0;
+        adios_shared_buffer_free (&p->b);
+    }
+}
+
+void adios_posix_get_write_buffer (struct adios_file_struct * fd
+                                  ,struct adios_var_struct * v
+                                  ,uint64_t * size
+                                  ,void ** buffer
+                                  ,struct adios_method_struct * method
+                                  )
+{
+    uint64_t mem_allowed;
+
+    if (*size == 0)
+    {
+        *buffer = 0;
+
+        return;
+    }
+
+    if (v->data && v->free_data)
+    {
+        adios_method_buffer_free (v->data_size);
+        free (v->data);
+    }
+
+    mem_allowed = adios_method_buffer_alloc (*size);
+    if (mem_allowed == *size)
+    {
+        *buffer = malloc (*size);
+        if (!*buffer)
+        {
+            adios_method_buffer_free (mem_allowed);
+            fprintf (stderr, "Out of memory allocating %llu bytes for %s\n"
+                    ,*size, v->name
+                    );
+            v->got_buffer = adios_flag_no;
+            v->free_data = adios_flag_no;
+            v->data_size = 0;
+            v->data = 0;
+            *size = 0;
+            *buffer = 0;
+        }
+        else
+        {
+            v->got_buffer = adios_flag_yes;
+            v->free_data = adios_flag_yes;
+            v->data_size = mem_allowed;
+            v->data = *buffer;
+        }
+    }
+    else
+    {
+        adios_method_buffer_free (mem_allowed);
+        fprintf (stderr, "OVERFLOW: Cannot allocate requested buffer of %llu "
+                         "bytes for %s\n"
+                ,*size
+                ,v->name
+                );
+        *size = 0;
+        *buffer = 0;
+    }
+}
+
+void adios_posix_read (struct adios_file_struct * fd
+                      ,struct adios_var_struct * v
+                      ,void * buffer
+                      ,uint64_t buffer_size
+                      ,struct adios_method_struct * method
+                      )
+{
+    v->data = buffer;
+    v->data_size = buffer_size;
+}
+
+static void adios_posix_do_write (struct adios_file_struct * fd
+                                 ,struct adios_method_struct * method
+                                 ,char * buffer
+                                 ,uint64_t buffer_size
+                                 )
+{
+    struct adios_POSIX_data_struct * p = (struct adios_POSIX_data_struct *)
+                                                          method->method_data;
+    int32_t to_write;
+    uint64_t bytes_written = 0;
+
+    if (fd->shared_buffer == adios_flag_yes)
+    {
+        lseek (p->b.f, p->b.end_of_pgs, SEEK_SET);
+        if (p->b.end_of_pgs + fd->bytes_written > fd->pg_start_in_file + fd->write_size_bytes)
+            fprintf (stderr, "adios_posix_write exceeds pg bound. File is corrupted. "
+                             "Need to enlarge group size. \n");
+
+        if (fd->bytes_written > INT32_MAX)
+        {
+            to_write = INT32_MAX;
+        }
+        else
+        {
+            to_write = (int32_t) fd->bytes_written;
+        }
+
+        while (bytes_written < fd->bytes_written)
+        {
+            write (p->b.f, fd->buffer, to_write);
+            bytes_written += to_write;
+            if (fd->bytes_written > bytes_written)
+            {
+                if (fd->bytes_written - bytes_written > INT32_MAX)
+                {
+                    to_write = INT32_MAX;
+                }
+                else
+                {
+                    to_write = fd->bytes_written - bytes_written;
+                }
+            }
+        }
+    }
+
+    // index location calculation:
+    // for buffered, base_offset = 0, fd->offset = write loc
+    // for unbuffered, base_offset = write loc, fd->offset = 0
+    // for append buffered, base_offset = start, fd->offset = size
+    lseek (p->b.f, fd->base_offset + fd->offset, SEEK_SET);
+    write (p->b.f, buffer, buffer_size);
+}
+
+static void adios_posix_do_read (struct adios_file_struct * fd
+                                ,struct adios_method_struct * method
+                                )
+{
+    struct adios_POSIX_data_struct * p = (struct adios_POSIX_data_struct *)
+                                                          method->method_data;
+    struct adios_var_struct * v = fd->group->vars;
+
+    struct adios_parse_buffer_struct data;
+
+    data.vars = v;
+    data.buffer = 0;
+    data.buffer_len = 0;
+
+    uint32_t version = 0;
+
+    adios_posix_read_version (&p->b);
+    adios_parse_version (&p->b, &version);
+
+    switch (version & ADIOS_VERSION_NUM_MASK)
+    {
+        case 1:
+        {
+            struct adios_index_process_group_struct_v1 * pg_root = 0;
+            struct adios_index_process_group_struct_v1 * pg_root_temp = 0;
+            struct adios_index_var_struct_v1 * vars_root = 0;
+            struct adios_index_attribute_struct_v1 * attrs_root = 0;
+
+            adios_posix_read_index_offsets (&p->b);
+            adios_parse_index_offsets_v1 (&p->b);
+
+            adios_posix_read_process_group_index (&p->b);
+            adios_parse_process_group_index_v1 (&p->b, &pg_root);
+#if 1
+            adios_posix_read_vars_index (&p->b);
+            adios_parse_vars_index_v1 (&p->b, &vars_root);
+
+            adios_posix_read_attributes_index (&p->b);
+            adios_parse_attributes_index_v1 (&p->b, &attrs_root);
+#endif
+
+            // the three section headers
+            struct adios_process_group_header_struct_v1 pg_header;
+            struct adios_vars_header_struct_v1 vars_header;
+            struct adios_attributes_header_struct_v1 attrs_header;
+
+            struct adios_var_header_struct_v1 var_header;
+            struct adios_var_payload_struct_v1 var_payload;
+            struct adios_attribute_struct_v1 attribute;
+
+            int i;
+
+            pg_root_temp = pg_root;
+            while (pg_root_temp && pg_root_temp->next)
+                pg_root_temp = pg_root_temp->next;
+
+            p->b.read_pg_offset = pg_root_temp->offset_in_file;
+            if (pg_root_temp->next)
+            {
+                p->b.read_pg_size =   pg_root_temp->next->offset_in_file
+                                    - pg_root_temp->offset_in_file;
+            }
+            else
+            {
+                p->b.read_pg_size =   p->b.pg_index_offset
+                                    - pg_root_temp->offset_in_file;
+            }
+
+            adios_posix_read_process_group (&p->b);
+            adios_parse_process_group_header_v1 (&p->b, &pg_header);
+
+            adios_parse_vars_header_v1 (&p->b, &vars_header);
+
+            for (i = 0; i < vars_header.count; i++)
+            {
+                memset (&var_payload, 0
+                       ,sizeof (struct adios_var_payload_struct_v1)
+                       );
+                adios_parse_var_data_header_v1 (&p->b, &var_header);
+
+                struct adios_var_struct * v1 = v;
+                while (v1)
+                {
+                    if (   strcasecmp (var_header.name, v1->name)
+                        || strcasecmp (var_header.path, v1->path)
+                       )
+                    {
+                        v1 = v1->next;
+                    }
+                    else
+                        break;
+                }
+
+                if (v1)
+                {
+                    var_payload.payload = v1->data;
+                    adios_parse_var_data_payload_v1 (&p->b, &var_header
+                                                    ,&var_payload
+                                                    ,v1->data_size
+                                                    );
+                }
+                else
+                {
+                    adios_parse_var_data_payload_v1 (&p->b, &var_header
+                                                    ,NULL, 0
+                                                    );
+                }
+
+                adios_clear_var_header_v1 (&var_header);
+            }
+
+#if 1
+            adios_parse_attributes_header_v1 (&p->b, &attrs_header);
+
+            for (i = 0; i < attrs_header.count; i++)
+            {
+                adios_parse_attribute_v1 (&p->b, &attribute);
+                adios_clear_attribute_v1 (&attribute);
+            }
+#endif
+            adios_clear_process_group_header_v1 (&pg_header);
+            adios_clear_index_v1 (pg_root, vars_root, attrs_root);
+            break;
+        }
+
+        default:
+            fprintf (stderr, "POSIX read: file version unknown: %u\n"
+                    ,version
+                    );
+            return;
+    }
+
+    adios_buffer_struct_clear (&p->b);
+}
+
+void adios_posix_close (struct adios_file_struct * fd
+                       ,struct adios_method_struct * method
+                       )
+{
+    struct adios_POSIX_data_struct * p = (struct adios_POSIX_data_struct *)
+                                                          method->method_data;
+    struct adios_attribute_struct * a = fd->group->attributes;
+
+    struct adios_index_process_group_struct_v1 * new_pg_root = 0;
+    struct adios_index_var_struct_v1 * new_vars_root = 0;
+    struct adios_index_attribute_struct_v1 * new_attrs_root = 0;
+
+    switch (fd->mode)
+    {
+        case adios_mode_write:
+        {
+            if (fd->shared_buffer == adios_flag_no)
+            {
+                off_t new_off;
+                // set it up so that it will start at 0, but have correct sizes
+                new_off = lseek (p->b.f, 0, SEEK_CUR);
+                fd->offset = fd->base_offset - p->vars_start;
+                fd->vars_start = 0;
+                fd->buffer_size = 0;
+                adios_write_close_vars_v1 (fd);
+                // fd->vars_start gets updated with the size written
+                fd->offset = lseek (p->b.f, p->vars_start, SEEK_SET);
+                ssize_t s = write (p->b.f, fd->buffer, p->vars_header_size);
+                if (s != fd->vars_start)
+                {
+                    fprintf (stderr, "POSIX method tried to write %llu, "
+                                     "only wrote %llu\n"
+                            ,fd->vars_start
+                            ,s
+                            );
+                }
+                fd->offset = 0;
+                fd->bytes_written = 0;
+                adios_shared_buffer_free (&p->b);
+
+                new_off = lseek (p->b.f, new_off, SEEK_SET);  // go back to end
+                adios_write_open_attributes_v1 (fd);
+                p->vars_start = lseek (p->b.f, fd->offset, SEEK_CUR); // save loc
+                p->vars_header_size = p->vars_start - fd->base_offset;
+                p->vars_start -= fd->offset; // adjust to start of header
+                fd->base_offset += fd->offset;  // add size of header
+                fd->offset = 0;
+                fd->bytes_written = 0;
+
+                while (a)
+                {
+                    adios_write_attribute_v1 (fd, a);
+                    if (fd->base_offset + fd->bytes_written > fd->pg_start_in_file + fd->write_size_bytes)
+                        fprintf (stderr, "adios_posix_write exceeds pg bound. File is corrupted. "
+                                         "Need to enlarge group size. \n");
+                    ssize_t s = write (p->b.f, fd->buffer, fd->bytes_written);
+                    if (s != fd->bytes_written)
+                    {
+                        fprintf (stderr, "POSIX method tried to write %llu, "
+                                         "only wrote %llu\n"
+                                ,fd->bytes_written
+                                ,s
+                                );
+                    }
+                    fd->base_offset += s;
+                    fd->offset = 0;
+                    fd->bytes_written = 0;
+                    adios_shared_buffer_free (&p->b);
+
+                    a = a->next;
+                }
+
+                // set it up so that it will start at 0, but have correct sizes
+                fd->offset = fd->base_offset - p->vars_start;
+                fd->vars_start = 0;
+                fd->buffer_size = 0;
+                adios_write_close_attributes_v1 (fd);
+                fd->offset = lseek (p->b.f, p->vars_start, SEEK_SET);
+                // fd->vars_start gets updated with the size written
+                s = write (p->b.f, fd->buffer, p->vars_header_size);
+                if (s != p->vars_header_size)
+                {
+                    fprintf (stderr, "POSIX method tried to write %llu, "
+                                     "only wrote %llu\n"
+                            ,p->vars_header_size
+                            ,s
+                            );
+                }
+                fd->offset = 0;
+                fd->bytes_written = 0;
+            }
+
+            // buffering or not, write the index
+            char * buffer = 0;
+            uint64_t buffer_size = 0;
+            uint64_t buffer_offset = 0;
+            uint64_t index_start = fd->base_offset + fd->offset;
+
+            // build index
+            adios_build_index_v1 (fd, &p->old_pg_root, &p->old_vars_root
+                                 ,&p->old_attrs_root
+                                 );
+            // if collective, gather the indexes from the rest and call
+            // adios_merge_index_v1 (&new_pg_root, &new_vars_root, pg, vars);
+            adios_write_index_v1 (&buffer, &buffer_size, &buffer_offset
+                                 ,index_start, p->old_pg_root, p->old_vars_root
+                                 ,p->old_attrs_root
+                                 );
+            adios_write_version_v1 (&buffer, &buffer_size, &buffer_offset);
+            adios_posix_do_write (fd, method, buffer, buffer_offset);
+#ifdef HAVE_MPI
+            if (p->group_comm != MPI_COMM_SELF)
+            {
+                if (p->rank == 0)
+                {
+                    int * index_sizes = malloc (4 * p->size);
+                    int * index_offsets = malloc (4 * p->size);
+                    char * recv_buffer = 0;
+                    int i;
+                    uint32_t size = 0, total_size = 0;
+
+                    MPI_Gather (&size, 1, MPI_INT
+                               ,index_sizes, 1, MPI_INT
+                               ,0, p->group_comm
+                               );
+
+                    for (i = 0; i < p->size; i++)
+                    {
+                        index_offsets [i] = total_size;
+                        total_size += index_sizes [i];
+                    }
+
+                    recv_buffer = malloc (total_size);
+                    MPI_Gatherv (&size, 0, MPI_BYTE
+                                ,recv_buffer, index_sizes, index_offsets
+                                ,MPI_BYTE, 0, p->group_comm
+                                );
+
+                    char * buffer_save = p->b.buff;
+                    uint64_t buffer_size_save = p->b.length;
+                    uint64_t offset_save = p->b.offset;
+
+                    for (i = 1; i < p->size; i++)
+                    {
+                        p->b.buff = recv_buffer + index_offsets [i];
+                        p->b.length = index_sizes [i];
+                        p->b.offset = 0;
+
+                        adios_parse_process_group_index_v1 (&p->b
+                                                           ,&new_pg_root
+                                                           );
+                        adios_parse_vars_index_v1 (&p->b, &new_vars_root);
+                        adios_parse_attributes_index_v1 (&p->b
+                                                        ,&new_attrs_root
+                                                        );
+
+                        adios_merge_index_v1 (&p->old_pg_root
+                                             ,&p->old_vars_root
+                                             ,&p->old_attrs_root
+                                             ,new_pg_root, new_vars_root
+                                             ,new_attrs_root
+                                             );
+                        new_pg_root = 0;
+                        new_vars_root = 0;
+                        new_attrs_root = 0;
+                    }
+
+                    p->b.buff = buffer_save;
+                    p->b.length = buffer_size_save;
+                    p->b.offset = offset_save;
+
+                    free (recv_buffer);
+                    free (index_sizes);
+                    free (index_offsets);
+
+                    char * global_index_buffer = 0;
+                    uint64_t global_index_buffer_size = 0;
+                    uint64_t global_index_buffer_offset = 0;
+                    uint64_t global_index_start = 0;
+                    uint16_t flag = 0;
+
+                    adios_write_index_v1 (&global_index_buffer, &global_index_buffer_size
+                                         ,&global_index_buffer_offset, global_index_start
+                                         ,p->old_pg_root, p->old_vars_root, p->old_attrs_root
+                                         );
+
+                    flag |= ADIOS_VERSION_HAVE_SUBFILE;
+
+                    adios_write_version_flag_v1 (&global_index_buffer
+                                                ,&global_index_buffer_size
+                                                ,&global_index_buffer_offset
+                                                ,flag
+                                                );
+                    ssize_t s = write (p->mf, global_index_buffer, global_index_buffer_offset);
+                    if (s != global_index_buffer_offset)
+                    {
+                        fprintf (stderr, "POSIX method tried to write %llu, "
+                                         "only wrote %llu\n"
+                                         ,fd->bytes_written
+                                         ,s
+                                );
+                    }
+
+                    close (p->mf);
+                }
+                else
+                {
+                    MPI_Gather (&buffer_size, 1, MPI_INT
+                               ,0, 0, MPI_INT
+                               ,0, p->group_comm
+                               );
+
+                    MPI_Gatherv (buffer, buffer_size, MPI_BYTE
+                                ,0, 0, 0, MPI_BYTE
+                                ,0, p->group_comm
+                                );
+                }
+            }
+#endif
+            free (buffer);
+
+            adios_clear_index_v1 (new_pg_root, new_vars_root, new_attrs_root);
+
+            break;
+        }
+
+        case adios_mode_append:
+        {
+            if (fd->shared_buffer == adios_flag_no)
+            {
+                off_t new_off;
+                // set it up so that it will start at 0, but have correct sizes
+                new_off = lseek (p->b.f, 0, SEEK_CUR);
+                fd->offset = fd->base_offset - p->vars_start;
+                fd->vars_start = 0;
+                fd->buffer_size = 0;
+                adios_write_close_vars_v1 (fd);
+                // fd->vars_start gets updated with the size written
+                fd->offset = lseek (p->b.f, p->vars_start, SEEK_SET);
+                ssize_t s = write (p->b.f, fd->buffer, p->vars_header_size);
+                if (s != fd->vars_start)
+                {
+                    fprintf (stderr, "POSIX method tried to write %llu, "
+                                     "only wrote %llu\n"
+                            ,fd->vars_start
+                            ,s
+                            );
+                }
+                fd->offset = 0;
+                fd->bytes_written = 0;
+                adios_shared_buffer_free (&p->b);
+
+                new_off = lseek (p->b.f, new_off, SEEK_SET);  // go back to end
+                adios_write_open_attributes_v1 (fd);
+                p->vars_start = lseek (p->b.f, fd->offset, SEEK_CUR); // save loc
+                p->vars_header_size = p->vars_start - fd->base_offset;
+                p->vars_start -= fd->offset; // adjust to start of header
+                fd->base_offset += fd->offset;  // add size of header
+                fd->offset = 0;
+                fd->bytes_written = 0;
+
+                while (a)
+                {
+                    adios_write_attribute_v1 (fd, a);
+                    ssize_t s = write (p->b.f, fd->buffer, fd->bytes_written);
+                    if (s != fd->bytes_written)
+                    {
+                        fprintf (stderr, "POSIX method tried to write %llu, "
+                                         "only wrote %llu\n"
+                                ,fd->bytes_written
+                                ,s
+                                );
+                    }
+                    fd->base_offset += s;
+                    fd->offset = 0;
+                    fd->bytes_written = 0;
+                    adios_shared_buffer_free (&p->b);
+
+                    a = a->next;
+                }
+
+                // set it up so that it will start at 0, but have correct sizes
+                fd->offset = fd->base_offset - p->vars_start;
+                fd->vars_start = 0;
+                fd->buffer_size = 0;
+                adios_write_close_attributes_v1 (fd);
+                fd->offset = lseek (p->b.f, p->vars_start, SEEK_SET);
+                // fd->vars_start gets updated with the size written
+                s = write (p->b.f, fd->buffer, p->vars_header_size);
+                if (s != p->vars_header_size)
+                {
+                    fprintf (stderr, "POSIX method tried to write %llu, "
+                                     "only wrote %llu\n"
+                            ,p->vars_header_size
+                            ,s
+                            );
+                }
+                fd->offset = 0;
+                fd->bytes_written = 0;
+            }
+
+            char * buffer = 0;
+            uint64_t buffer_size = 0;
+            uint64_t buffer_offset = 0;
+            uint64_t index_start = fd->base_offset + fd->offset;
+
+            // build index
+            adios_build_index_v1 (fd, &p->old_pg_root, &p->old_vars_root
+                                 ,&p->old_attrs_root
+                                 );
+            adios_write_index_v1 (&buffer, &buffer_size, &buffer_offset
+                                 ,index_start, p->old_pg_root, p->old_vars_root
+                                 ,p->old_attrs_root
+                                 );
+#ifdef HAVE_MPI
+            if (p->group_comm != MPI_COMM_SELF)
+            {
+                if (p->rank == 0)
+                {
+                    int * index_sizes = malloc (4 * p->size);
+                    int * index_offsets = malloc (4 * p->size);
+                    char * recv_buffer = 0;
+                    int i;
+                    uint32_t size = 0, total_size = 0;
+
+                    MPI_Gather (&size, 1, MPI_INT
+                               ,index_sizes, 1, MPI_INT
+                               ,0, p->group_comm
+                               );
+
+                    for (i = 0; i < p->size; i++)
+                    {
+                        index_offsets [i] = total_size;
+                        total_size += index_sizes [i];
+                    }
+
+                    recv_buffer = malloc (total_size);
+                    MPI_Gatherv (&size, 0, MPI_BYTE
+                                ,recv_buffer, index_sizes, index_offsets
+                                ,MPI_BYTE, 0, p->group_comm
+                                );
+
+                    char * buffer_save = p->b.buff;
+                    uint64_t buffer_size_save = p->b.length;
+                    uint64_t offset_save = p->b.offset;
+
+                    for (i = 1; i < p->size; i++)
+                    {
+                        p->b.buff = recv_buffer + index_offsets [i];
+                        p->b.length = index_sizes [i];
+                        p->b.offset = 0;
+
+                        adios_parse_process_group_index_v1 (&p->b
+                                                           ,&new_pg_root
+                                                           );
+                        adios_parse_vars_index_v1 (&p->b, &new_vars_root);
+                        adios_parse_attributes_index_v1 (&p->b
+                                                        ,&new_attrs_root
+                                                        );
+
+                        adios_merge_index_v1 (&p->old_pg_root
+                                             ,&p->old_vars_root
+                                             ,&p->old_attrs_root
+                                             ,new_pg_root, new_vars_root
+                                             ,new_attrs_root
+                                             );
+                    
+                        new_pg_root = 0;
+                        new_vars_root = 0;
+                        new_attrs_root = 0;
+                    }
+
+                    adios_sort_index_v1 (&p->old_pg_root
+                                        ,&p->old_vars_root
+                                        ,&p->old_attrs_root
+                                        );
+
+                    p->b.buff = buffer_save;
+                    p->b.length = buffer_size_save;
+                    p->b.offset = offset_save;
+
+                    free (recv_buffer);
+                    free (index_sizes);
+                    free (index_offsets);
+
+                    char * global_index_buffer = 0;
+                    uint64_t global_index_buffer_size = 0;
+                    uint64_t global_index_buffer_offset = 0;
+                    uint64_t global_index_start = 0;
+                    uint16_t flag = 0;
+
+                    adios_write_index_v1 (&global_index_buffer, &global_index_buffer_size
+                                         ,&global_index_buffer_offset, global_index_start
+                                         ,p->old_pg_root, p->old_vars_root, p->old_attrs_root
+                                         );
+
+                    flag |= ADIOS_VERSION_HAVE_SUBFILE;
+
+                    adios_write_version_flag_v1 (&global_index_buffer
+                                                ,&global_index_buffer_size
+                                                ,&global_index_buffer_offset
+                                                ,flag
+                                                );
+
+                    ssize_t s = write (p->mf, global_index_buffer, global_index_buffer_offset);
+                    if (s != global_index_buffer_offset)
+                    {
+                        fprintf (stderr, "POSIX method tried to write %llu, "
+                                         "only wrote %llu, Mode: a\n"
+                                         ,global_index_buffer_offset
+                                         ,s
+                                );
+                    }
+
+                    close (p->mf);
+
+                    free (global_index_buffer);
+                }
+                else
+                {
+                    MPI_Gather (&buffer_size, 1, MPI_INT
+                               ,0, 0, MPI_INT
+                               ,0, p->group_comm
+                               );
+
+                    MPI_Gatherv (buffer, buffer_size, MPI_BYTE
+                                ,0, 0, 0, MPI_BYTE
+                                ,0, p->group_comm
+                                );
+                }
+            }
+#endif
+            adios_write_version_v1 (&buffer, &buffer_size, &buffer_offset);
+            adios_posix_do_write (fd, method, buffer, buffer_offset);
+
+            free (buffer);
+
+            break;
+        }
+
+        case adios_mode_read:
+        {
+            // read the index to find the place to start reading
+            adios_posix_do_read (fd, method);
+            struct adios_var_struct * v = fd->group->vars;
+            while (v)
+            {
+                v->data = 0;
+                v = v->next;
+            }
+
+            break;
+        }
+
+        default:
+        {
+            fprintf (stderr, "Unknown file mode: %d\n", fd->mode);
+
+            return;
+        }
+    }
+
+    adios_posix_close_internal (&p->b);
+    adios_clear_index_v1 (p->old_pg_root, p->old_vars_root, p->old_attrs_root);
+    p->old_pg_root = 0;
+    p->old_vars_root = 0;
+    p->old_attrs_root = 0;
+}
+
+void adios_posix_finalize (int mype, struct adios_method_struct * method)
+{
+// nothing to do here
+    if (adios_posix_initialized)
+        adios_posix_initialized = 0;
+}
+
+void adios_posix_end_iteration (struct adios_method_struct * method)
+{
+}
+
+void adios_posix_start_calculation (struct adios_method_struct * method)
+{
+}
+
+void adios_posix_stop_calculation (struct adios_method_struct * method)
+{
+}
diff --git a/src/adios_posix1.c b/src/adios_posix1.c
new file mode 100644
index 0000000..574c59a
--- /dev/null
+++ b/src/adios_posix1.c
@@ -0,0 +1,888 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <sys/types.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <stdint.h>
+
+// see if we have MPI or other tools
+#include "config.h"
+
+// mpi
+#if HAVE_MPI
+#include "mpi.h"
+#endif
+
+// xml parser
+#include <mxml.h>
+
+#include "adios.h"
+#include "adios_transport_hooks.h"
+#include "adios_bp_v1.h"
+#include "adios_internals.h"
+#include "buffer.h"
+
+static int adios_posix1_initialized = 0;
+
+struct adios_POSIX1_data_struct
+{
+    // our file bits
+    struct adios_bp_buffer_struct_v1 b;
+
+    // old index structs we read in and have to be merged in
+    struct adios_index_process_group_struct_v1 * old_pg_root;
+    struct adios_index_var_struct_v1 * old_vars_root;
+    struct adios_index_attribute_struct_v1 * old_attrs_root;
+
+    uint64_t vars_start;
+    uint64_t vars_header_size;
+};
+
+void adios_posix1_init (const char * parameters
+                      ,struct adios_method_struct * method
+                      )
+{
+    struct adios_POSIX1_data_struct * p = 0;
+
+    if (!adios_posix1_initialized)
+    {
+        adios_posix1_initialized = 1;
+    }
+    method->method_data = malloc (sizeof (struct adios_POSIX1_data_struct));
+    p = (struct adios_POSIX1_data_struct *) method->method_data;
+    adios_buffer_struct_init (&p->b);
+    p->old_pg_root = 0;
+    p->old_vars_root = 0;
+    p->old_attrs_root = 0;
+    p->vars_start = 0;
+    p->vars_header_size = 0;
+}
+
+int adios_posix1_open (struct adios_file_struct * fd
+                     ,struct adios_method_struct * method, void * comm
+                     )
+{
+    char * name;
+    struct adios_POSIX1_data_struct * p = (struct adios_POSIX1_data_struct *)
+                                                          method->method_data;
+
+    // figure out the actual name of the file.
+    name = malloc (strlen (method->base_path) + strlen (fd->name) + 1);
+    sprintf (name, "%s%s", method->base_path, fd->name);
+    struct stat s;
+    if (stat (name, &s) == 0)
+        p->b.file_size = s.st_size;
+
+    switch (fd->mode)
+    {
+        case adios_mode_read:
+        {
+            p->b.f = open (name, O_RDONLY | O_LARGEFILE);
+            if (p->b.f == -1)
+            {
+                fprintf (stderr, "ADIOS POSIX1: file not found: %s\n", fd->name);
+
+                free (name);
+
+                return 0;
+            }
+            fd->base_offset = 0;
+            fd->pg_start_in_file = 0;
+
+            break;
+        }
+
+        case adios_mode_write:
+        {
+            p->b.f = open (name, O_WRONLY | O_CREAT | O_TRUNC | O_LARGEFILE
+                            ,  S_IRUSR | S_IWUSR
+                             | S_IRGRP | S_IWGRP
+                             | S_IROTH | S_IWOTH
+                            );
+            if (p->b.f == -1)
+            {
+                fprintf (stderr, "adios_posix1_open failed for "
+                                 "base_path %s, name %s\n"
+                        ,method->base_path, fd->name
+                        );
+
+                free (name);
+
+                return 0;
+            }
+            fd->base_offset = 0;
+            fd->pg_start_in_file = 0;
+
+            break;
+        }
+
+        case adios_mode_append:
+        {
+            int old_file = 1;
+            p->b.f = open (name, O_RDWR | O_LARGEFILE);
+            if (p->b.f == -1)
+            {
+                old_file = 0;
+                p->b.f = open (name,  O_WRONLY | O_CREAT | O_LARGEFILE
+                                ,  S_IRUSR | S_IWUSR
+                                 | S_IRGRP | S_IWGRP
+                                 | S_IROTH | S_IWOTH
+                                );
+                if (p->b.f == -1)
+                {
+                    fprintf (stderr, "adios_posix1_open failed for "
+                                     "base_path %s, name %s\n"
+                            ,method->base_path, fd->name
+                            );
+
+                    free (name);
+
+                    return 0;
+                }
+            }
+
+            if (old_file)
+            {
+                // now we have to read the old stuff so we can merge it
+                // in at the end and set the base_offset for the old index
+                // start
+                uint32_t version;
+                adios_posix_read_version (&p->b);
+                adios_parse_version (&p->b, &version);
+
+                switch (version & ADIOS_VERSION_NUM_MASK)
+                {
+                    case 1:
+                        // read the old stuff and set the base offset
+                        adios_posix_read_index_offsets (&p->b);
+                        adios_parse_index_offsets_v1 (&p->b);
+
+                        adios_posix_read_process_group_index (&p->b);
+                        adios_parse_process_group_index_v1 (&p->b
+                                                           ,&p->old_pg_root
+                                                           );
+
+                        // find the largest time index so we can append properly
+                        struct adios_index_process_group_struct_v1 * pg;
+                        uint32_t max_time_index = 0;
+                        pg = p->old_pg_root;
+                        while (pg)
+                        {
+                            if (pg->time_index > max_time_index)
+                                max_time_index = pg->time_index;
+                            pg = pg->next;
+                        }
+                        fd->group->time_index = ++max_time_index;
+
+                        adios_posix_read_vars_index (&p->b);
+                        adios_parse_vars_index_v1 (&p->b, &p->old_vars_root);
+
+                        adios_posix_read_attributes_index (&p->b);
+                        adios_parse_attributes_index_v1 (&p->b
+                                                        ,&p->old_attrs_root
+                                                        );
+
+                        fd->base_offset = p->b.end_of_pgs;
+                        fd->pg_start_in_file = p->b.end_of_pgs;
+                        break;
+
+                    default:
+                        fprintf (stderr, "Unknown bp version: %d.  "
+                                         "Cannot append\n"
+                                ,version
+                                );
+
+                        free (name);
+
+                        return 0;
+                }
+            }
+
+            break;
+        }
+
+        default:
+        {
+            fprintf (stderr, "Unknown file mode: %d\n", fd->mode);
+
+            free (name);
+
+            return 0;
+        }
+    }
+
+    free (name);
+
+    return 1;
+}
+
+enum ADIOS_FLAG adios_posix1_should_buffer (struct adios_file_struct * fd
+                                          ,struct adios_method_struct * method
+                                          )
+{
+    struct adios_POSIX1_data_struct * p = (struct adios_POSIX1_data_struct *)
+                                                          method->method_data;
+
+    if (fd->shared_buffer == adios_flag_no && fd->mode != adios_mode_read)
+    {
+        // write the process group header
+        adios_write_process_group_header_v1 (fd, fd->write_size_bytes);
+
+        lseek (p->b.f, fd->base_offset, SEEK_SET);
+        ssize_t s = write (p->b.f, fd->buffer, fd->bytes_written);
+        if (s != fd->bytes_written)
+        {
+            fprintf (stderr, "POSIX1 method tried to write %llu, "
+                             "only wrote %llu\n"
+                    ,fd->bytes_written
+                    ,s
+                    );
+        }
+        fd->base_offset += s;
+        fd->offset = 0;
+        fd->bytes_written = 0;
+        adios_shared_buffer_free (&p->b);
+
+        // setup for writing vars
+        adios_write_open_vars_v1 (fd);
+        p->vars_start = lseek (p->b.f, fd->offset, SEEK_CUR);  // save loc
+        p->vars_header_size = p->vars_start - fd->base_offset;  // the size
+        p->vars_start -= fd->offset; // adjust to start of header
+        fd->base_offset += fd->offset;  // add the size of the vars header
+        fd->offset = 0;
+        fd->bytes_written = 0;
+        adios_shared_buffer_free (&p->b);
+    }
+
+    return fd->shared_buffer;   // buffer if there is space
+}
+
+void adios_posix1_write (struct adios_file_struct * fd
+                       ,struct adios_var_struct * v
+                       ,void * data
+                       ,struct adios_method_struct * method
+                       )
+{
+    struct adios_POSIX1_data_struct * p = (struct adios_POSIX1_data_struct *)
+                                                          method->method_data;
+
+    if (v->got_buffer == adios_flag_yes)
+    {
+        if (data != v->data)  // if the user didn't give back the same thing
+        {
+            if (v->free_data == adios_flag_yes)
+            {
+                free (v->data);
+                adios_method_buffer_free (v->data_size);
+            }
+        }
+        else
+        {
+            // we already saved all of the info, so we're ok.
+            return;
+        }
+    }
+
+    if (fd->shared_buffer == adios_flag_no)
+    {
+        // var payload sent for sizing information
+        adios_write_var_header_v1 (fd, v);
+        ssize_t s = write (p->b.f, fd->buffer, fd->bytes_written);
+        if (s != fd->bytes_written)
+        {
+            fprintf (stderr, "POSIX1 method tried to write %llu, "
+                             "only wrote %llu\n"
+                    ,fd->bytes_written
+                    ,s
+                    );
+        }
+        fd->base_offset += s;
+        fd->offset = 0;
+        fd->bytes_written = 0;
+        adios_shared_buffer_free (&p->b);
+
+        // write payload
+        // adios_write_var_payload_v1 (fd, v);
+        uint64_t var_size = adios_get_var_size (v, fd->group, v->data);
+        if (fd->base_offset + var_size > fd->pg_start_in_file + fd->write_size_bytes)
+            fprintf (stderr, "adios_posix1_write exceeds pg bound. File is corrupted. "
+                             "Need to enlarge group size. \n"); 
+
+        int32_t to_write;
+        uint64_t bytes_written = 0;
+        if (var_size > INT32_MAX)
+        {
+            to_write = INT32_MAX;
+        }
+        else
+        {
+            to_write = (int32_t) fd->bytes_written;
+        }
+
+        while (bytes_written < var_size)
+        {
+            bytes_written += write (p->b.f, v->data + bytes_written, to_write);
+            if (var_size > bytes_written)
+            {
+                if (var_size - bytes_written > INT32_MAX)
+                {
+                    to_write = INT32_MAX;
+                }
+                else
+                {
+                    to_write = var_size - bytes_written;
+                }
+            }
+        }
+
+//        s = write (p->b.f, v->data, var_size);
+        s = bytes_written;
+        if (s != var_size)
+        {
+            fprintf (stderr, "POSIX1 method tried to write %llu, "
+                             "only wrote %llu\n"
+                    ,var_size
+                    ,s
+                    );
+        }
+        fd->base_offset += s;
+        fd->offset = 0;
+        fd->bytes_written = 0;
+        adios_shared_buffer_free (&p->b);
+    }
+}
+
+void adios_posix1_get_write_buffer (struct adios_file_struct * fd
+                                  ,struct adios_var_struct * v
+                                  ,uint64_t * size
+                                  ,void ** buffer
+                                  ,struct adios_method_struct * method
+                                  )
+{
+    uint64_t mem_allowed;
+
+    if (*size == 0)
+    {
+        *buffer = 0;
+
+        return;
+    }
+
+    if (v->data && v->free_data)
+    {
+        adios_method_buffer_free (v->data_size);
+        free (v->data);
+    }
+
+    mem_allowed = adios_method_buffer_alloc (*size);
+    if (mem_allowed == *size)
+    {
+        *buffer = malloc (*size);
+        if (!*buffer)
+        {
+            adios_method_buffer_free (mem_allowed);
+            fprintf (stderr, "Out of memory allocating %llu bytes for %s\n"
+                    ,*size, v->name
+                    );
+            v->got_buffer = adios_flag_no;
+            v->free_data = adios_flag_no;
+            v->data_size = 0;
+            v->data = 0;
+            *size = 0;
+            *buffer = 0;
+        }
+        else
+        {
+            v->got_buffer = adios_flag_yes;
+            v->free_data = adios_flag_yes;
+            v->data_size = mem_allowed;
+            v->data = *buffer;
+        }
+    }
+    else
+    {
+        adios_method_buffer_free (mem_allowed);
+        fprintf (stderr, "OVERFLOW: Cannot allocate requested buffer of %llu "
+                         "bytes for %s\n"
+                ,*size
+                ,v->name
+                );
+        *size = 0;
+        *buffer = 0;
+    }
+}
+
+void adios_posix1_read (struct adios_file_struct * fd
+                      ,struct adios_var_struct * v
+                      ,void * buffer
+                      ,uint64_t buffer_size
+                      ,struct adios_method_struct * method
+                      )
+{
+    v->data = buffer;
+    v->data_size = buffer_size;
+}
+
+static void adios_posix1_do_write (struct adios_file_struct * fd
+                                 ,struct adios_method_struct * method
+                                 ,char * buffer
+                                 ,uint64_t buffer_size
+                                 )
+{
+    struct adios_POSIX1_data_struct * p = (struct adios_POSIX1_data_struct *)
+                                                          method->method_data;
+    int32_t to_write;
+    uint64_t bytes_written = 0;
+
+    if (fd->shared_buffer == adios_flag_yes)
+    {
+        lseek (p->b.f, p->b.end_of_pgs, SEEK_SET);
+        if (p->b.end_of_pgs + fd->bytes_written > fd->pg_start_in_file + fd->write_size_bytes)
+            fprintf (stderr, "adios_posix1_write exceeds pg bound. File is corrupted. "
+                             "Need to enlarge group size. \n");
+
+        if (fd->bytes_written > INT32_MAX)
+        {
+            to_write = INT32_MAX;
+        }
+        else
+        {
+            to_write = (int32_t) fd->bytes_written;
+        }
+
+        while (bytes_written < fd->bytes_written)
+        {
+            write (p->b.f, fd->buffer, to_write);
+            bytes_written += to_write;
+            if (fd->bytes_written > bytes_written)
+            {
+                if (fd->bytes_written - bytes_written > INT32_MAX)
+                {
+                    to_write = INT32_MAX;
+                }
+                else
+                {
+                    to_write = fd->bytes_written - bytes_written;
+                }
+            }
+        }
+    }
+
+    // index location calculation:
+    // for buffered, base_offset = 0, fd->offset = write loc
+    // for unbuffered, base_offset = write loc, fd->offset = 0
+    // for append buffered, base_offset = start, fd->offset = size
+    lseek (p->b.f, fd->base_offset + fd->offset, SEEK_SET);
+    write (p->b.f, buffer, buffer_size);
+}
+
+static void adios_posix1_do_read (struct adios_file_struct * fd
+                                ,struct adios_method_struct * method
+                                )
+{
+    struct adios_POSIX1_data_struct * p = (struct adios_POSIX1_data_struct *)
+                                                          method->method_data;
+    struct adios_var_struct * v = fd->group->vars;
+
+    struct adios_parse_buffer_struct data;
+
+    data.vars = v;
+    data.buffer = 0;
+    data.buffer_len = 0;
+
+    uint32_t version = 0;
+
+    adios_posix_read_version (&p->b);
+    adios_parse_version (&p->b, &version);
+
+    switch (version & ADIOS_VERSION_NUM_MASK)
+    {
+        case 1:
+        {
+            struct adios_index_process_group_struct_v1 * pg_root = 0;
+            struct adios_index_process_group_struct_v1 * pg_root_temp = 0;
+            struct adios_index_var_struct_v1 * vars_root = 0;
+            struct adios_index_attribute_struct_v1 * attrs_root = 0;
+
+            adios_posix_read_index_offsets (&p->b);
+            adios_parse_index_offsets_v1 (&p->b);
+
+            adios_posix_read_process_group_index (&p->b);
+            adios_parse_process_group_index_v1 (&p->b, &pg_root);
+#if 1
+            adios_posix_read_vars_index (&p->b);
+            adios_parse_vars_index_v1 (&p->b, &vars_root);
+
+            adios_posix_read_attributes_index (&p->b);
+            adios_parse_attributes_index_v1 (&p->b, &attrs_root);
+#endif
+
+            // the three section headers
+            struct adios_process_group_header_struct_v1 pg_header;
+            struct adios_vars_header_struct_v1 vars_header;
+            struct adios_attributes_header_struct_v1 attrs_header;
+
+            struct adios_var_header_struct_v1 var_header;
+            struct adios_var_payload_struct_v1 var_payload;
+            struct adios_attribute_struct_v1 attribute;
+
+            int i;
+
+            pg_root_temp = pg_root;
+            while (pg_root_temp && pg_root_temp->next)
+                pg_root_temp = pg_root_temp->next;
+
+            p->b.read_pg_offset = pg_root_temp->offset_in_file;
+            if (pg_root_temp->next)
+            {
+                p->b.read_pg_size =   pg_root_temp->next->offset_in_file
+                                    - pg_root_temp->offset_in_file;
+            }
+            else
+            {
+                p->b.read_pg_size =   p->b.pg_index_offset
+                                    - pg_root_temp->offset_in_file;
+            }
+
+            adios_posix_read_process_group (&p->b);
+            adios_parse_process_group_header_v1 (&p->b, &pg_header);
+
+            adios_parse_vars_header_v1 (&p->b, &vars_header);
+
+            for (i = 0; i < vars_header.count; i++)
+            {
+                memset (&var_payload, 0
+                       ,sizeof (struct adios_var_payload_struct_v1)
+                       );
+                adios_parse_var_data_header_v1 (&p->b, &var_header);
+
+                struct adios_var_struct * v1 = v;
+                while (v1)
+                {
+                    if (   strcasecmp (var_header.name, v1->name)
+                        || strcasecmp (var_header.path, v1->path)
+                       )
+                    {
+                        v1 = v1->next;
+                    }
+                    else
+                        break;
+                }
+
+                if (v1)
+                {
+                    var_payload.payload = v1->data;
+                    adios_parse_var_data_payload_v1 (&p->b, &var_header
+                                                    ,&var_payload
+                                                    ,v1->data_size
+                                                    );
+                }
+                else
+                {
+                    adios_parse_var_data_payload_v1 (&p->b, &var_header
+                                                    ,NULL, 0
+                                                    );
+                }
+
+                adios_clear_var_header_v1 (&var_header);
+            }
+
+#if 1
+            adios_parse_attributes_header_v1 (&p->b, &attrs_header);
+
+            for (i = 0; i < attrs_header.count; i++)
+            {
+                adios_parse_attribute_v1 (&p->b, &attribute);
+                adios_clear_attribute_v1 (&attribute);
+            }
+#endif
+            adios_clear_process_group_header_v1 (&pg_header);
+            adios_clear_index_v1 (pg_root, vars_root, attrs_root);
+            break;
+        }
+
+        default:
+            fprintf (stderr, "POSIX1 read: file version unknown: %u\n"
+                    ,version
+                    );
+            return;
+    }
+
+    adios_buffer_struct_clear (&p->b);
+}
+
+void adios_posix1_close (struct adios_file_struct * fd
+                       ,struct adios_method_struct * method
+                       )
+{
+    struct adios_POSIX1_data_struct * p = (struct adios_POSIX1_data_struct *)
+                                                          method->method_data;
+    struct adios_attribute_struct * a = fd->group->attributes;
+
+    struct adios_index_process_group_struct_v1 * new_pg_root = 0;
+    struct adios_index_var_struct_v1 * new_vars_root = 0;
+    struct adios_index_attribute_struct_v1 * new_attrs_root = 0;
+
+    switch (fd->mode)
+    {
+        case adios_mode_write:
+        {
+            if (fd->shared_buffer == adios_flag_no)
+            {
+                off_t new_off;
+                // set it up so that it will start at 0, but have correct sizes
+                new_off = lseek (p->b.f, 0, SEEK_CUR);
+                fd->offset = fd->base_offset - p->vars_start;
+                fd->vars_start = 0;
+                fd->buffer_size = 0;
+                adios_write_close_vars_v1 (fd);
+                // fd->vars_start gets updated with the size written
+                fd->offset = lseek (p->b.f, p->vars_start, SEEK_SET);
+                ssize_t s = write (p->b.f, fd->buffer, p->vars_header_size);
+                if (s != fd->vars_start)
+                {
+                    fprintf (stderr, "POSIX1 method tried to write %llu, "
+                                     "only wrote %llu\n"
+                            ,fd->vars_start
+                            ,s
+                            );
+                }
+                fd->offset = 0;
+                fd->bytes_written = 0;
+                adios_shared_buffer_free (&p->b);
+
+                new_off = lseek (p->b.f, new_off, SEEK_SET);  // go back to end
+                adios_write_open_attributes_v1 (fd);
+                p->vars_start = lseek (p->b.f, fd->offset, SEEK_CUR); // save loc
+                p->vars_header_size = p->vars_start - fd->base_offset;
+                p->vars_start -= fd->offset; // adjust to start of header
+                fd->base_offset += fd->offset;  // add size of header
+                fd->offset = 0;
+                fd->bytes_written = 0;
+
+                while (a)
+                {
+                    adios_write_attribute_v1 (fd, a);
+                    if (fd->base_offset + fd->bytes_written > fd->pg_start_in_file + fd->write_size_bytes)
+                        fprintf (stderr, "adios_posix1_write exceeds pg bound. File is corrupted. "
+                                         "Need to enlarge group size. \n");
+                    ssize_t s = write (p->b.f, fd->buffer, fd->bytes_written);
+                    if (s != fd->bytes_written)
+                    {
+                        fprintf (stderr, "POSIX1 method tried to write %llu, "
+                                         "only wrote %llu\n"
+                                ,fd->bytes_written
+                                ,s
+                                );
+                    }
+                    fd->base_offset += s;
+                    fd->offset = 0;
+                    fd->bytes_written = 0;
+                    adios_shared_buffer_free (&p->b);
+
+                    a = a->next;
+                }
+
+                // set it up so that it will start at 0, but have correct sizes
+                fd->offset = fd->base_offset - p->vars_start;
+                fd->vars_start = 0;
+                fd->buffer_size = 0;
+                adios_write_close_attributes_v1 (fd);
+                fd->offset = lseek (p->b.f, p->vars_start, SEEK_SET);
+                // fd->vars_start gets updated with the size written
+                s = write (p->b.f, fd->buffer, p->vars_header_size);
+                if (s != p->vars_header_size)
+                {
+                    fprintf (stderr, "POSIX1 method tried to write %llu, "
+                                     "only wrote %llu\n"
+                            ,p->vars_header_size
+                            ,s
+                            );
+                }
+                fd->offset = 0;
+                fd->bytes_written = 0;
+            }
+
+            // buffering or not, write the index
+            char * buffer = 0;
+            uint64_t buffer_size = 0;
+            uint64_t buffer_offset = 0;
+            uint64_t index_start = fd->base_offset + fd->offset;
+
+            // build index
+            adios_build_index_v1 (fd, &new_pg_root, &new_vars_root
+                                 ,&new_attrs_root
+                                 );
+            // if collective, gather the indexes from the rest and call
+            // adios_merge_index_v1 (&new_pg_root, &new_vars_root, pg, vars);
+            adios_write_index_v1 (&buffer, &buffer_size, &buffer_offset
+                                 ,index_start, new_pg_root, new_vars_root
+                                 ,new_attrs_root
+                                 );
+            adios_write_version_v1 (&buffer, &buffer_size, &buffer_offset);
+            adios_posix1_do_write (fd, method, buffer, buffer_offset);
+
+            free (buffer);
+
+            adios_clear_index_v1 (new_pg_root, new_vars_root, new_attrs_root);
+
+            break;
+        }
+
+        case adios_mode_append:
+        {
+            if (fd->shared_buffer == adios_flag_no)
+            {
+                off_t new_off;
+                // set it up so that it will start at 0, but have correct sizes
+                new_off = lseek (p->b.f, 0, SEEK_CUR);
+                fd->offset = fd->base_offset - p->vars_start;
+                fd->vars_start = 0;
+                fd->buffer_size = 0;
+                adios_write_close_vars_v1 (fd);
+                // fd->vars_start gets updated with the size written
+                fd->offset = lseek (p->b.f, p->vars_start, SEEK_SET);
+                ssize_t s = write (p->b.f, fd->buffer, p->vars_header_size);
+                if (s != fd->vars_start)
+                {
+                    fprintf (stderr, "POSIX1 method tried to write %llu, "
+                                     "only wrote %llu\n"
+                            ,fd->vars_start
+                            ,s
+                            );
+                }
+                fd->offset = 0;
+                fd->bytes_written = 0;
+                adios_shared_buffer_free (&p->b);
+
+                new_off = lseek (p->b.f, new_off, SEEK_SET);  // go back to end
+                adios_write_open_attributes_v1 (fd);
+                p->vars_start = lseek (p->b.f, fd->offset, SEEK_CUR); // save loc
+                p->vars_header_size = p->vars_start - fd->base_offset;
+                p->vars_start -= fd->offset; // adjust to start of header
+                fd->base_offset += fd->offset;  // add size of header
+                fd->offset = 0;
+                fd->bytes_written = 0;
+
+                while (a)
+                {
+                    adios_write_attribute_v1 (fd, a);
+                    ssize_t s = write (p->b.f, fd->buffer, fd->bytes_written);
+                    if (s != fd->bytes_written)
+                    {
+                        fprintf (stderr, "POSIX1 method tried to write %llu, "
+                                         "only wrote %llu\n"
+                                ,fd->bytes_written
+                                ,s
+                                );
+                    }
+                    fd->base_offset += s;
+                    fd->offset = 0;
+                    fd->bytes_written = 0;
+                    adios_shared_buffer_free (&p->b);
+
+                    a = a->next;
+                }
+
+                // set it up so that it will start at 0, but have correct sizes
+                fd->offset = fd->base_offset - p->vars_start;
+                fd->vars_start = 0;
+                fd->buffer_size = 0;
+                adios_write_close_attributes_v1 (fd);
+                fd->offset = lseek (p->b.f, p->vars_start, SEEK_SET);
+                // fd->vars_start gets updated with the size written
+                s = write (p->b.f, fd->buffer, p->vars_header_size);
+                if (s != p->vars_header_size)
+                {
+                    fprintf (stderr, "POSIX1 method tried to write %llu, "
+                                     "only wrote %llu\n"
+                            ,p->vars_header_size
+                            ,s
+                            );
+                }
+                fd->offset = 0;
+                fd->bytes_written = 0;
+            }
+
+            char * buffer = 0;
+            uint64_t buffer_size = 0;
+            uint64_t buffer_offset = 0;
+            uint64_t index_start = fd->base_offset + fd->offset;
+
+            // build index
+            adios_build_index_v1 (fd, &new_pg_root, &new_vars_root
+                                 ,&new_attrs_root
+                                 );
+            // merge in old indicies
+            adios_merge_index_v1 (&p->old_pg_root, &p->old_vars_root
+                                 ,&p->old_attrs_root
+                                 ,new_pg_root, new_vars_root, new_attrs_root
+                                 );
+            adios_write_index_v1 (&buffer, &buffer_size, &buffer_offset
+                                 ,index_start, p->old_pg_root, p->old_vars_root
+                                 ,p->old_attrs_root
+                                 );
+            adios_write_version_v1 (&buffer, &buffer_size, &buffer_offset);
+            adios_posix1_do_write (fd, method, buffer, buffer_offset);
+
+            free (buffer);
+
+            break;
+        }
+
+        case adios_mode_read:
+        {
+            // read the index to find the place to start reading
+            adios_posix1_do_read (fd, method);
+            struct adios_var_struct * v = fd->group->vars;
+            while (v)
+            {
+                v->data = 0;
+                v = v->next;
+            }
+
+            break;
+        }
+
+        default:
+        {
+            fprintf (stderr, "Unknown file mode: %d\n", fd->mode);
+
+            return;
+        }
+    }
+
+    adios_posix_close_internal (&p->b);
+    adios_clear_index_v1 (p->old_pg_root, p->old_vars_root, p->old_attrs_root);
+    p->old_pg_root = 0;
+    p->old_vars_root = 0;
+    p->old_attrs_root = 0;
+}
+
+void adios_posix1_finalize (int mype, struct adios_method_struct * method)
+{
+// nothing to do here
+    if (adios_posix1_initialized)
+        adios_posix1_initialized = 0;
+}
+
+void adios_posix1_end_iteration (struct adios_method_struct * method)
+{
+}
+
+void adios_posix1_start_calculation (struct adios_method_struct * method)
+{
+}
+
+void adios_posix1_stop_calculation (struct adios_method_struct * method)
+{
+}
diff --git a/src/adios_read.c b/src/adios_read.c
new file mode 100644
index 0000000..71c6b96
--- /dev/null
+++ b/src/adios_read.c
@@ -0,0 +1,135 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "adios.h"
+#include "bp_utils.h"
+#include "bp_types.h"
+#include "adios_read.h"
+#include "common_read.h"
+#include "adios_error.h"
+#include "futils.h"
+#define BYTE_ALIGN 8
+
+#ifdef DMALLOC
+#include "dmalloc.h"
+#endif
+
+const char *adios_errmsg ()
+{
+    return adios_get_last_errmsg();
+}
+
+int adios_set_read_method (enum ADIOS_READ_METHOD method)
+{
+    return common_read_set_read_method (method);
+} 
+
+int adios_read_init(MPI_Comm comm)
+{
+    return common_read_init (comm);
+}
+
+int adios_read_finalize()
+{
+    return common_read_finalize();
+}
+
+ADIOS_FILE * adios_fopen (const char * fname, MPI_Comm comm)
+{
+    return common_read_fopen (fname, comm);
+}
+
+int adios_fclose (ADIOS_FILE *fp) 
+{
+    return common_read_fclose (fp);
+}
+
+
+ADIOS_GROUP * adios_gopen (ADIOS_FILE *fp, const char * grpname)
+{
+    return common_read_gopen (fp, grpname);
+}
+
+ADIOS_GROUP * adios_gopen_byid (ADIOS_FILE *fp, int grpid)
+{
+    return common_read_gopen_byid (fp, grpid);
+}
+                   
+int adios_gclose (ADIOS_GROUP *gp)
+{
+    return common_read_gclose (gp);
+}
+
+
+int adios_get_attr (ADIOS_GROUP * gp, const char * attrname, enum ADIOS_DATATYPES * type,
+                    int * size, void ** data)
+{
+    return common_read_get_attr (gp, attrname, type, size, data);
+}
+
+int adios_get_attr_byid (ADIOS_GROUP * gp, int attrid, 
+                    enum ADIOS_DATATYPES * type, int * size, void ** data)
+{
+    return common_read_get_attr_byid (gp, attrid, type, size, data);
+}
+
+
+ADIOS_VARINFO * adios_inq_var (ADIOS_GROUP *gp, const char * varname) 
+{
+    return common_read_inq_var (gp, varname);
+}
+
+ADIOS_VARINFO * adios_inq_var_byid (ADIOS_GROUP *gp, int varid)
+{
+    return common_read_inq_var_byid (gp, varid);
+}
+
+void adios_free_varinfo (ADIOS_VARINFO *vp)
+{
+    common_read_free_varinfo (vp);
+}
+
+int64_t adios_read_var (ADIOS_GROUP * gp, const char * varname,
+                        const uint64_t * start, const uint64_t * count,
+                        void * data)
+{
+    return common_read_read_var (gp, varname, start, count, data);
+}
+
+int64_t adios_read_var_byid (ADIOS_GROUP    * gp,
+                             int              varid,
+                             const uint64_t  * start,
+                             const uint64_t  * count,
+                             void           * data)
+{
+    return common_read_read_var_byid (gp, varid, start, count, data);
+}
+
+const char * adios_type_to_string (enum ADIOS_DATATYPES type)
+{
+    return common_read_type_to_string (type);
+}
+
+int adios_type_size(enum ADIOS_DATATYPES type, void *data)
+{
+    return common_read_type_size(type, data);
+}
+
+
+void adios_print_groupinfo (ADIOS_GROUP *gp) 
+{
+    common_read_print_groupinfo(gp);
+}
+
+
+void adios_print_fileinfo (ADIOS_FILE *fp) 
+{
+    common_read_print_fileinfo(fp);
+}
+
diff --git a/src/adios_read.h b/src/adios_read.h
new file mode 100644
index 0000000..20ad78b
--- /dev/null
+++ b/src/adios_read.h
@@ -0,0 +1,245 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/*
+ *   Read C API for ADIOS BP format files 
+ */
+#ifndef __ADIOS_READ_H__
+#define __ADIOS_READ_H__
+
+#include "adios_types.h"
+
+#ifdef _NOMPI
+    /* Sequential processes can use the library compiled with -D_NOMPI */
+#   include "mpidummy.h"
+#else
+    /* Parallel applications should use MPI to communicate file info and slices of data */
+#   include "mpi.h"
+#endif
+
+#include <stdint.h>
+
+/*************************/
+/* Types used in the API */
+/*************************/
+
+typedef struct {
+        uint64_t fh;                /* File handler                                                       */
+        int      groups_count;      /* Number of adios groups in file                                     */
+        int      vars_count;        /* Number of variables in all groups                                  */
+        int      attrs_count;       /* Number of attributes in all groups                                 */
+        int      tidx_start;        /* First timestep in file, usually 1                                  */
+        int      ntimesteps;        /* Number of timesteps in file. There is always at least one timestep */
+        int      version;           /* ADIOS BP version of file format                                    */
+        uint64_t file_size;         /* Size of file in bytes                                              */
+        int      endianness;        /* 0: little endian, 1: big endian (you do not need to care)          */
+        char     ** group_namelist; /* Names of the adios groups in the file (cf. groups_count)           */
+        void     * internal_data;   /* Data for internal use                                              */
+} ADIOS_FILE;
+
+typedef struct {
+        uint64_t gh;                /* Group handler                                           */
+        int      grpid;             /* group index (0..ADIOS_FILE.groups_count-1)              */
+        int      vars_count;        /* Number of variables in this adios group                 */
+        char     ** var_namelist;   /* Variable names in a char* array                         */
+        int      attrs_count;       /* Number of attributes in this adios group                */
+        char     ** attr_namelist;  /* Attribute names in a char* array                        */
+        ADIOS_FILE * fp;            /* pointer to the parent ADIOS_FILE struct                 */
+} ADIOS_GROUP;
+
+/* NCSU - Added more statistics to be returned to the end user */
+typedef struct {
+        int        grpid;           /* group index (0..ADIOS_FILE.groups_count-1)                     */
+        int        varid;           /* variable index (0..ADIOS_GROUP.var_count-1)                    */
+        enum ADIOS_DATATYPES type;  /* type of variable                                               */
+        int        ndim;            /* number of dimensions, 0 for scalars                            */
+        uint64_t * dims;            /* size of each dimension                                         */
+        int        timedim;         /* -1: variable has no timesteps in file, >=0: which dimension is time     */
+        void     * value;           /* value of a scalar variable, NULL for array.                    */
+        void     * gmin;            /* minimum value in an array variable, = value for a scalar       */
+        void     * gmax;            /* maximum value of an array variable (over all timesteps)        */
+        double   * gavg;            /* average value of an array variable (over all timesteps)        */
+        double   * gstd_dev;        /* standard deviation value of an array variable (over all timesteps)        */
+        void     ** mins;           /* minimum per each timestep (array of timestep elements)         */
+        void     ** maxs;           /* maximum per each timestep (array of timestep elements)         */
+        double   ** avgs;           /* average per each timestep (array of timestep elements)         */
+        double   ** std_devs;       /* standard deviation per each timestep (array of timestep elements)         */
+		struct ADIOS_HIST			/* Histogram */
+		{
+			uint32_t num_breaks;
+			double max;
+			double min;
+			double *breaks;
+			uint32_t **frequenciess;
+			uint32_t *gfrequencies;
+		} *hist;
+} ADIOS_VARINFO;
+
+/* The list of the available read methods */
+enum ADIOS_READ_METHOD {
+         ADIOS_READ_METHOD_BP     = 0    /* Read from ADIOS BP file (written by POSIX, MPI etc methods) */
+        ,ADIOS_READ_METHOD_HDF5   = 1    /* Read from HDF5 file (written by PHDF5 method)               */
+        ,ADIOS_READ_METHOD_DART   = 2    /* Read from memory written by DART method                     */
+        ,ADIOS_READ_METHOD_DIMES  = 3    /* Read from memory written by DIMES method                    */
+};
+
+#ifndef __INCLUDED_FROM_FORTRAN_API__
+
+/** Functions that return a pointer to some data structures (fopen, gopen), return NULL
+    on error and set adios_errno to a non-zero value and writes an error string.  
+    You have direct access to that string so you can print it. 
+    Do not write anything into it, please. 
+    Only the last error message is always available. 
+*/
+extern int adios_errno;
+const char *adios_errmsg();
+
+/** Set the reading method for the next adios_fopen.
+ *  IN:  method   read method to use
+ *  RETURN:       0 if accepted, <0 on error
+ *  It is optional to use it before calling adios_fopen. Default is ADIOS_READ_METHOD_BP.
+ */
+int adios_set_read_method (enum ADIOS_READ_METHOD method);
+
+/** Initialize and finalize the read method.
+ *  This is needed for the DART method only and only if multiple fopen()...fclose() cycles
+ *  are used. In such a case, init/finalize will perform the connection/disconnection to 
+ *  the DART server once. 
+ *  For other methods, these functions do nothing. 
+ */
+int adios_read_init(MPI_Comm comm);
+int adios_read_finalize();
+
+/** Open an adios file.
+ *  IN:  fname    pathname of file to be opened
+ *       comm     the MPI communicator of all processes that want to read data from the file
+ *                 if compile with -D_NOMPI, pass any integer here. 
+ *  RETURN:       pointer to an ADIOS_FILE struct, NULL on error (sets adios_errno)
+ */
+ADIOS_FILE * adios_fopen (const char * fname, MPI_Comm comm);
+
+/** Close an adios file.
+ *  It will free the content of the underlying data structures and the fp pointer itself.
+ *  IN:   fp       pointer to an ADIOS_FILE struct 
+ *  RETURN: 0 OK, !=0 on error (also sets adios_errno)
+ */
+int adios_fclose (ADIOS_FILE *fp);
+
+/** This function can be called if user places
+ *  the wrong sequences of dims for a var
+ */
+void adios_reset_dimension_order (ADIOS_FILE *fp, int is_fortran);
+
+
+/** Open an adios group. Usually there is one adios group in a file, 
+ *  but there can be more than one. 
+ *  IN:  fp       pointer to an (opened) ADIOS_FILE struct
+ *       grpname  name of the group
+ *  RETURN:       pointer to an ADIOS_GROUP struct, NULL on error (sets adios_errno)
+ */
+ADIOS_GROUP * adios_gopen (ADIOS_FILE *fp, const char * grpname);
+
+/** Open a group by index 
+ *       grpid    index of group (0..fp->groups_count-1)
+ *                in fp->group_namelist of ADIOS_FILE struct
+ */
+ADIOS_GROUP * adios_gopen_byid (ADIOS_FILE *fp, int grpid);
+
+/** Close an adios group. 
+ *  To free the data structures allocated at gopen, you need to call this function
+ *  IN:  gp       pointer to an (opened) ADIOS_GROUP struct
+ *  RETURN: 0 OK, !=0 on error (also sets adios_errno)
+ */
+int adios_gclose (ADIOS_GROUP *gp);
+
+
+/** Inquiry about one variable in a group.
+ *  This function does not read anything from the file but processes info
+ *  already in memory after fopen and gopen.
+ *  It allocates memory for the ADIOS_VARINFO struct and content, so 
+ *  you need to free resources later with adios_free_varinfo().
+ *
+ *  IN:  gp       pointer to an (opened) ADIOS_GROUP struct
+ *       varname  name of the variable
+ *  RETURN:       pointer to and ADIOS_VARINFO struct, NULL on error (sets adios_errno)
+ */
+ADIOS_VARINFO * adios_inq_var (ADIOS_GROUP *gp, const char * varname);
+
+/* NCSU - Timeseries analysis functions */
+double adios_stat_cor (ADIOS_VARINFO * vix, ADIOS_VARINFO * viy, char * characteristic, uint32_t time_start, uint32_t time_end, uint32_t lag);
+double adios_stat_cov (ADIOS_VARINFO * vix, ADIOS_VARINFO * viy, char * characteristic, uint32_t time_start, uint32_t time_end, uint32_t lag);
+/** Inquiry a variable by index
+ *       varid    index of variable (0..gp->vars_count-1)
+ *                in gp->vars_namelist of ADIOS_GROUP struct
+ */
+ADIOS_VARINFO * adios_inq_var_byid (ADIOS_GROUP *gp, int varid);
+
+/** Free memory used by an ADIOS_VARINFO struct */
+void adios_free_varinfo (ADIOS_VARINFO *cp);
+
+/** Read a variable (slice) from the file.
+ *  You need to allocate the memory for the data. 
+ *  IN:  gp        pointer to an (opened) ADIOS_GROUP struct
+ *       varname   name of the variable
+ *       start     array of offsets to start reading in each dimension
+ *       count     number of data elements to read in each dimension
+ *  OUT: data      data of the variable
+ *  RETURN: the number of bytes read, <0 on error, sets adios_errno too
+ */
+int64_t adios_read_var (ADIOS_GROUP    * gp, 
+                        const char     * varname, 
+                        const uint64_t * start,
+                        const uint64_t * count, 
+                        void           * data);
+
+/** Read a variable by index 
+ *       varid    index of variable (0..gp->vars_count-1)
+ *                in gp->vars_namelist of ADIOS_GROUP struct
+ */
+int64_t adios_read_var_byid (ADIOS_GROUP * gp, int varid,
+                             const uint64_t * start, const uint64_t * count, 
+                             void * data);
+
+/** Get an attribute in a group.
+ *  This function does not read anything from the file but processes info
+ *  already in memory after fopen and gopen.
+ *  The memory for the data is allocated within the library.
+ *  You can use free() to free the memory after use. 
+ *
+ *  IN:  gp       pointer to an (opened) ADIOS_GROUP struct
+ *       attrname name of the attribute
+ *  OUT: type     adios type of attribute (see enum ADIOS_DATATYPES in adios_types.h)
+ *       size     memory size of value (n+1 for a string of n characters)
+ *       data     pointer to the value. You need to cast it afterward according to the type. 
+ *  RETURN: 0 OK, error: set and return adios_errno
+ */
+int adios_get_attr (ADIOS_GROUP           * gp,
+                    const char            * attrname,
+                    enum ADIOS_DATATYPES  * type,
+                    int                   * size,
+                    void                 ** data);
+
+/** Convenience function to get an attribute by name 
+ *       attrid   index of attribute (0..gp->attrs_count-1)
+ *                in gp->attr_namelist of ADIOS_GROUP struct
+ */
+int adios_get_attr_byid (ADIOS_GROUP * gp, int attrid, enum ADIOS_DATATYPES * type, 
+                         int * size, void ** data); 
+
+/** Return the name of an adios type */
+const char * adios_type_to_string (enum ADIOS_DATATYPES type);
+
+/** Return the memory size of one data element of an adios type.
+ *  If the type is adios_string, and the second argument is
+ *  the string itself, it returns strlen(data)+1.
+ *  For other types, it does not care about data and returns
+ *  the size occupied by one element. 
+ */
+int adios_type_size(enum ADIOS_DATATYPES type, void *data);
+
+#endif  /*__INCLUDED_FROM_FORTRAN_API__*/
+#endif  /*__ADIOS_READ_H__*/
diff --git a/src/adios_read_hooks.c b/src/adios_read_hooks.c
new file mode 100644
index 0000000..30c98ce
--- /dev/null
+++ b/src/adios_read_hooks.c
@@ -0,0 +1,60 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include "config.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "adios_read_hooks.h"
+
+#define MATCH_STRING_TO_METHOD(b,d,r) \
+if (!strcasecmp (buf,b)) \
+{*method=d;*requires_group_comm=r;return 1;}
+
+#define ASSIGN_FNS(a,b) \
+(*t) [b].adios_init_fn = adios_read_##a##_init; \
+(*t) [b].adios_finalize_fn = adios_read_##a##_finalize; \
+(*t) [b].adios_fopen_fn = adios_read_##a##_fopen; \
+(*t) [b].adios_fclose_fn = adios_read_##a##_fclose; \
+(*t) [b].adios_gopen_fn = adios_read_##a##_gopen; \
+(*t) [b].adios_gopen_byid_fn = adios_read_##a##_gopen_byid; \
+(*t) [b].adios_gclose_fn = adios_read_##a##_gclose; \
+(*t) [b].adios_inq_var_fn = adios_read_##a##_inq_var; \
+(*t) [b].adios_inq_var_byid_fn = adios_read_##a##_inq_var_byid; \
+(*t) [b].adios_read_var_fn = adios_read_##a##_read_var; \
+(*t) [b].adios_read_var_byid_fn = adios_read_##a##_read_var_byid; \
+(*t) [b].adios_get_attr_fn = adios_read_##a##_get_attr; \
+(*t) [b].adios_get_attr_byid_fn = adios_read_##a##_get_attr_byid; 
+
+void adios_read_hooks_init (struct adios_read_hooks_struct ** t)
+{
+    static int did_init = 0;
+    // we need to init only once in the lifetime of an application
+    // called from common_read.c/common_read_fopen()
+    if (!did_init) {
+        *t = (struct adios_read_hooks_struct *)
+               calloc (ADIOS_READ_METHOD_COUNT, sizeof (struct adios_read_hooks_struct));
+
+        ASSIGN_FNS(bp,ADIOS_READ_METHOD_BP)
+
+#if HAVE_DART
+        ASSIGN_FNS(dart,ADIOS_READ_METHOD_DART)
+#endif
+
+#if HAVE_DIMES
+        ASSIGN_FNS(dimes,ADIOS_READ_METHOD_DIMES)
+#endif
+
+#if HAVE_PHDF5
+        //ASSIGN_FNS(hdf5,ADIOS_READ_METHOD_HDF5)
+#endif
+
+        //printf("%s: adios_read_hooks = %x\n",__func__,*t);
+        did_init = 1;
+    }
+
+}
+
diff --git a/src/adios_read_hooks.h b/src/adios_read_hooks.h
new file mode 100644
index 0000000..86910a4
--- /dev/null
+++ b/src/adios_read_hooks.h
@@ -0,0 +1,89 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#ifndef ADIOS_READ_HOOKS_H
+#define ADIOS_READ_HOOKS_H
+
+#include "config.h"
+#include <stdint.h>
+#include <string.h>
+#include "adios_read.h"
+
+#define FORWARD_DECLARE(a) \
+int adios_read_##a##_init (MPI_Comm comm); \
+int adios_read_##a##_finalize (); \
+int adios_read_##a##_fclose (ADIOS_FILE *fp); \
+ADIOS_FILE * adios_read_##a##_fopen (const char * fname, MPI_Comm comm); \
+int adios_read_##a##_fclose (ADIOS_FILE *fp); \
+ADIOS_GROUP * adios_read_##a##_gopen (ADIOS_FILE *fp, const char * grpname); \
+ADIOS_GROUP * adios_read_##a##_gopen_byid (ADIOS_FILE *fp, int grpid); \
+int adios_read_##a##_gclose (ADIOS_GROUP *gp); \
+ADIOS_VARINFO * adios_read_##a##_inq_var (ADIOS_GROUP *gp, const char * varname); \
+ADIOS_VARINFO * adios_read_##a##_inq_var_byid (ADIOS_GROUP *gp, int varid); \
+int64_t adios_read_##a##_read_var (ADIOS_GROUP * gp, const char * varname, const uint64_t * start, const uint64_t * count, void * data); \
+int64_t adios_read_##a##_read_var_byid (ADIOS_GROUP * gp, int varid, const uint64_t * start, const uint64_t * count, void * data); \
+int adios_read_##a##_get_attr (ADIOS_GROUP * gp, const char * attrname, enum ADIOS_DATATYPES * type, int * size, void ** data); \
+int adios_read_##a##_get_attr_byid (ADIOS_GROUP * gp, int attrid, enum ADIOS_DATATYPES * type, int * size, void ** data); \
+void adios_read_##a##_reset_dimension_order (ADIOS_FILE *fp, int is_fortran); \
+
+//////////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////////
+//// SETUP YOUR NEW READ METHODS BELOW (FOLLOW THE PATTERN):                  ////
+//// 1. Add an entry to the adios_read.h/ADIOS_READ_METHOD                    ////
+//// 2. Update the ADIOS_METHOD_COUNT                                         ////
+//// 2. Add a FOWARD_DECLARE line (assuming standard naming)                  ////
+//////////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////////
+
+#define ADIOS_READ_METHOD_COUNT 4
+
+// forward declare the functions (or dummies for internals use)
+FORWARD_DECLARE(bp)
+FORWARD_DECLARE(hdf5)
+#if HAVE_DART
+FORWARD_DECLARE(dart)
+#endif
+#if HAVE_DIMES
+FORWARD_DECLARE(dimes)
+#endif
+
+
+typedef int (* ADIOS_INIT_FN) (MPI_Comm comm); 
+typedef int (* ADIOS_FINALIZE_FN) (); 
+typedef ADIOS_FILE * (* ADIOS_FOPEN_FN) (const char * fname, MPI_Comm comm); 
+typedef int (* ADIOS_FCLOSE_FN) (ADIOS_FILE *fp); 
+typedef ADIOS_GROUP * (* ADIOS_GOPEN_FN) (ADIOS_FILE *fp, const char * grpname); 
+typedef ADIOS_GROUP * (* ADIOS_GOPEN_BYID_FN) (ADIOS_FILE *fp, int grpid); 
+typedef int (* ADIOS_GCLOSE_FN) (ADIOS_GROUP *gp); 
+typedef ADIOS_VARINFO * (* ADIOS_INQ_VAR_FN) (ADIOS_GROUP *gp, const char * varname); 
+typedef ADIOS_VARINFO * (* ADIOS_INQ_VAR_BYID_FN) (ADIOS_GROUP *gp, int varid); 
+typedef int64_t (* ADIOS_READ_VAR_FN) (ADIOS_GROUP * gp, const char * varname, const uint64_t * start, const uint64_t * count, void * data); 
+typedef int64_t (* ADIOS_READ_VAR_BYID_FN) (ADIOS_GROUP * gp, int varid, const uint64_t * start, const uint64_t * count, void * data); 
+typedef int (* ADIOS_GET_ATTR_FN) (ADIOS_GROUP * gp, const char * attrname, enum ADIOS_DATATYPES * type, int * size, void ** data); 
+typedef int (* ADIOS_GET_ATTR_BYID_FN) (ADIOS_GROUP * gp, int attrid, enum ADIOS_DATATYPES * type, int * size, void ** data); 
+typedef void (* ADIOS_RESET_DIMENSION_ORDER_FN) (); 
+
+struct adios_read_hooks_struct
+{   
+    ADIOS_INIT_FN           adios_init_fn;
+    ADIOS_FINALIZE_FN       adios_finalize_fn;
+    ADIOS_FOPEN_FN          adios_fopen_fn;
+    ADIOS_FCLOSE_FN         adios_fclose_fn;
+    ADIOS_GOPEN_FN          adios_gopen_fn;
+    ADIOS_GOPEN_BYID_FN     adios_gopen_byid_fn;
+    ADIOS_GCLOSE_FN         adios_gclose_fn;
+    ADIOS_INQ_VAR_FN        adios_inq_var_fn;
+    ADIOS_INQ_VAR_BYID_FN   adios_inq_var_byid_fn;
+    ADIOS_READ_VAR_FN       adios_read_var_fn;
+    ADIOS_READ_VAR_BYID_FN  adios_read_var_byid_fn;
+    ADIOS_GET_ATTR_FN       adios_get_attr_fn;
+    ADIOS_GET_ATTR_BYID_FN  adios_get_attr_byid_fn;
+    ADIOS_RESET_DIMENSION_ORDER_FN adios_reset_dimension_order_fn;
+};
+
+#undef FORWARD_DECLARE
+#endif
diff --git a/src/adios_socket.c b/src/adios_socket.c
new file mode 100644
index 0000000..50b9e45
--- /dev/null
+++ b/src/adios_socket.c
@@ -0,0 +1,171 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include "adios_socket.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <netdb.h>
+#include <arpa/inet.h>
+#include <string.h>
+
+#include <ctype.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+
+/* PUBLIC FUNCTIONS */
+
+
+int adios_create_socket(int *socketid)
+{
+  *socketid = socket( AF_INET, SOCK_STREAM, 0 );
+  if ( *socketid == -1 ) return 1;
+
+  return 0;
+}
+
+int adios_close_socket(int socketid)
+{
+  return close(socketid);
+}
+
+
+int adios_set_socket_address(char *hostname,int port,struct sockaddr_in *address)
+{
+  struct hostent *hp;
+  unsigned int addr;
+  
+  if (isalpha(hostname[0]))
+  {   /* host address is a name */
+      hp = gethostbyname(hostname);
+  }
+  else  
+  { /* Convert nnn.nnn address to a usable one */
+      addr = inet_addr(hostname);
+      hp = gethostbyaddr((char *)&addr,4,AF_INET);
+  }
+  if (hp == NULL ) 
+  {
+      return 1;
+  }
+
+  memset(address,0,sizeof(address));
+  memcpy(&(address->sin_addr),hp->h_addr,hp->h_length);
+  address->sin_family = hp->h_addrtype;
+  address->sin_port = htons(port);
+
+  return 0;
+}
+
+int adios_bind_socket(int socketid,struct sockaddr_in *address)
+{
+  if(bind(socketid, (struct sockaddr *) address, sizeof(*address))!=0)
+    return 1;
+  return 0;
+}
+
+int adios_connect_socket(int socketid,struct sockaddr_in *address)
+{
+  if (connect(socketid,(struct sockaddr*)address,sizeof(*address))== -1) 
+    return 1;
+  
+  return 0;
+}
+
+int adios_socket_start_listen(int socketid)
+{
+  if(listen(socketid,5)!=0)
+  {
+      return 1;
+  }
+  return 0;
+}
+
+int adios_socket_accept(int socketid,int *connected)
+{
+  *connected=accept(socketid,NULL,0);
+  if(*connected==-1)
+  {
+      return 1;
+  }
+  return 0;
+}
+   
+
+int adios_blocking_read_request(int socketid,char *buffer,int maxlength)
+{
+  char cChar;
+  int num = 0,ret;
+  
+  ret = recv( socketid, &cChar, 1 , 0 );
+  if(ret<=0) return ret;
+  buffer[num] = cChar;
+  num++;
+  
+  while(cChar!='\0'&&num<=maxlength)
+  {
+      ret = recv( socketid, &cChar, 1 , 0 );
+      buffer[num] = cChar;
+      num++;
+      if(ret<=0) return ret;
+  }
+
+  return num;
+}
+
+int adios_read_block(int socketid,char *buffer,int maxlength)
+{
+  int ret;
+  
+  ret = recv( socketid, buffer, maxlength , 0 );
+  return ret;
+}
+
+
+int adios_blocking_write_request(int socketid,char *buffer,int length)
+{
+  if(send( socketid, buffer , length , 0 )==-1)
+    return 1;
+  
+  return 0;
+}
+
+int adios_get_own_hostname(char *host)
+{
+  struct hostent *pMyHost;
+  char buffer[255];
+  
+  if(gethostname ( buffer , 255 )!=0 ) return 1;
+  pMyHost = gethostbyname ( buffer );
+  if(pMyHost ==  NULL) return 1;
+  strcpy( host , pMyHost->h_name );
+  
+  return 0;
+}
+
+int adios_get_remote_hostname(int socket,char *remotehost)
+{
+  struct sockaddr_in name;
+  socklen_t namelen = sizeof (name);
+  struct hostent *pHost;
+  char buffer[255];
+  unsigned int addr;
+
+  getpeername(socket, (struct sockaddr *)&name, &namelen);
+  strcpy(buffer,inet_ntoa(name.sin_addr));
+  addr = inet_addr(buffer);
+  pHost = gethostbyaddr((char *)&addr,4,AF_INET);
+  strcpy(remotehost,pHost->h_name);
+  
+  return 0;
+}
+
+
diff --git a/src/adios_socket.h b/src/adios_socket.h
new file mode 100644
index 0000000..eac6795
--- /dev/null
+++ b/src/adios_socket.h
@@ -0,0 +1,48 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+
+/** Get host:port info from some file.
+    Input: 
+      env_var_name    environment variable name that contains the path to a file to be checked
+      filename        name of file to be looked for if not named in the env var.
+      path,           first path to look for 'filename'
+      alternate_path  alternate path to look for 'filename'
+      default_port    value to be returned in 'port' if port info is not found
+
+    Output: 
+      host            host name, string will be allocated
+      port            port value
+
+    Host will be NULL if information is not found 
+    port will be default_port if that part of info is not found
+ */
+
+
+/// Socket functions
+
+int adios_create_socket(int *socketid);
+int adios_close_socket(int socketid);
+int adios_set_socket_address(char *hostname,int port,struct sockaddr_in *address);
+int adios_bind_socket(int socketid,struct sockaddr_in *address);
+int adios_connect_socket(int socketid,struct sockaddr_in *address);
+int adios_socket_start_listen(int socketid);
+int adios_socket_accept(int socketid,int *connected);
+int adios_blocking_read_request(int socketid,char *buffer,int maxlength);
+
+/** Read message in one block that fits into buffer. 
+Much faster than adios_BlockingReadRequest that is used for short message exchange only.
+*/
+int adios_read_block(int socketid,char *buffer,int maxlength);
+
+int adios_blocking_write_request(int socketid,char *buffer,int length);
+int adios_get_own_hostname(char *host);
+int adios_get_remote_hostname(int socket,char *remotehost);
diff --git a/src/adios_transport_hooks.c b/src/adios_transport_hooks.c
new file mode 100644
index 0000000..b4b4702
--- /dev/null
+++ b/src/adios_transport_hooks.c
@@ -0,0 +1,157 @@
+/*
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include "config.h"
+
+#ifdef _NOMPI
+    /* Sequential processes can use the library compiled with -D_NOMPI */
+#   define ADIOS_EMPTY_TRANSPORTS
+#else
+    /* Parallel applications should use MPI to communicate file info and slices of data */
+#endif
+
+#include "adios.h"
+#include "adios_transport_hooks.h"
+#include "adios_bp_v1.h"
+#include "adios_internals.h"
+
+#define MATCH_STRING_TO_METHOD(b,d,r) \
+if (!strcasecmp (buf,b)) \
+{*method=d;*requires_group_comm=r;return 1;}
+
+#define ASSIGN_FNS(a,b) \
+(*t) [b].adios_init_fn = adios_##a##_init; \
+(*t) [b].adios_open_fn = adios_##a##_open; \
+(*t) [b].adios_should_buffer_fn = adios_##a##_should_buffer; \
+(*t) [b].adios_write_fn = adios_##a##_write; \
+(*t) [b].adios_get_write_buffer_fn = adios_##a##_get_write_buffer; \
+(*t) [b].adios_read_fn = adios_##a##_read; \
+(*t) [b].adios_close_fn = adios_##a##_close; \
+(*t) [b].adios_finalize_fn = adios_##a##_finalize; \
+(*t) [b].adios_end_iteration_fn = adios_##a##_end_iteration; \
+(*t) [b].adios_start_calculation_fn = adios_##a##_start_calculation; \
+(*t) [b].adios_stop_calculation_fn = adios_##a##_stop_calculation;
+
+void adios_init_transports (struct adios_transport_struct ** t)
+{
+    *t = (struct adios_transport_struct *)
+           calloc (ADIOS_METHOD_COUNT, sizeof (struct adios_transport_struct));
+
+#ifndef NO_RESEARCH_TRANSPORTS
+    ASSIGN_FNS(adaptive,ADIOS_METHOD_ADAPTIVE)
+#endif
+
+#if HAVE_MPI
+    ASSIGN_FNS(mpi,ADIOS_METHOD_MPI)
+    ASSIGN_FNS(mpi_lustre,ADIOS_METHOD_MPI_LUSTRE)
+    ASSIGN_FNS(mpi_amr,ADIOS_METHOD_MPI_AMR)
+#ifndef NO_RESEARCH_TRANSPORTS
+    ASSIGN_FNS(mpi_stripe,ADIOS_METHOD_MPI_STRIPE)
+    ASSIGN_FNS(mpi_cio,ADIOS_METHOD_MPI_CIO)
+    ASSIGN_FNS(mpi_stagger,ADIOS_METHOD_MPI_STAGGER)
+    ASSIGN_FNS(mpi_aggregate,ADIOS_METHOD_MPI_AGG)
+    ASSIGN_FNS(mpi_amr1,ADIOS_METHOD_MPI_AMR1)
+#endif
+#endif
+
+#if NO_DATATAP == 0
+    ASSIGN_FNS(datatap,ADIOS_METHOD_DATATAP)
+#endif
+
+    ASSIGN_FNS(posix,ADIOS_METHOD_POSIX)
+    ASSIGN_FNS(posix1,ADIOS_METHOD_POSIX1)
+
+#if HAVE_DART
+    ASSIGN_FNS(dart,ADIOS_METHOD_DART)
+#endif
+
+#if HAVE_DIMES
+ASSIGN_FNS(dimes,ADIOS_METHOD_DIMES)
+#endif
+
+#if HAVE_PHDF5
+    ASSIGN_FNS(phdf5,ADIOS_METHOD_PHDF5)
+#endif
+
+#if HAVE_NC4PAR
+    ASSIGN_FNS(nc4,ADIOS_METHOD_NC4)
+#endif
+
+#if HAVE_NSSI
+    ASSIGN_FNS(nssi,ADIOS_METHOD_NSSI_STAGING)
+    ASSIGN_FNS(nssi_filter,ADIOS_METHOD_NSSI_FILTER)
+#endif
+
+#ifndef NO_RESEARCH_TRANSPORTS
+    ASSIGN_FNS(provenance,ADIOS_METHOD_PROVENANCE)
+#endif
+}
+
+int adios_parse_method (const char * buf, enum ADIOS_IO_METHOD * method
+                       ,int * requires_group_comm
+                       )
+{
+    // add the string<->ID mapping here (also add ID in adios_internals.h)
+    // use a '1' for requires a communicator or '0' if not as the last param
+#ifndef NO_RESEARCH_TRANSPORTS
+    MATCH_STRING_TO_METHOD("ADAPTIVE",ADIOS_METHOD_ADAPTIVE,1)
+#endif
+
+#if HAVE_MPI
+    MATCH_STRING_TO_METHOD("MPI",ADIOS_METHOD_MPI,1)
+    MATCH_STRING_TO_METHOD("MPI_LUSTRE",ADIOS_METHOD_MPI_LUSTRE,1)
+    MATCH_STRING_TO_METHOD("MPI_AMR",ADIOS_METHOD_MPI_AMR,1)
+#ifndef NO_RESEARCH_TRANSPORTS
+    MATCH_STRING_TO_METHOD("MPI_STRIPE",ADIOS_METHOD_MPI_STRIPE,1)
+    MATCH_STRING_TO_METHOD("MPI_CIO",ADIOS_METHOD_MPI_CIO,1)
+    MATCH_STRING_TO_METHOD("MPI_STAGGER",ADIOS_METHOD_MPI_STAGGER,1)
+    MATCH_STRING_TO_METHOD("MPI_AGGREGATE",ADIOS_METHOD_MPI_AGG,1)
+    MATCH_STRING_TO_METHOD("MPI_AMR1",ADIOS_METHOD_MPI_AMR1,1)
+#endif
+#endif
+
+#if NO_DATATAP == 0
+    MATCH_STRING_TO_METHOD("DATATAP",ADIOS_METHOD_DATATAP,0)
+    MATCH_STRING_TO_METHOD("PBIO",ADIOS_METHOD_DATATAP,0)
+#endif
+
+    MATCH_STRING_TO_METHOD("POSIX",ADIOS_METHOD_POSIX,0)
+    MATCH_STRING_TO_METHOD("POSIX1",ADIOS_METHOD_POSIX1,0)
+    MATCH_STRING_TO_METHOD("FB",ADIOS_METHOD_POSIX,0)
+
+#if HAVE_DART
+    MATCH_STRING_TO_METHOD("DART",ADIOS_METHOD_DART,1)
+#endif
+
+#if HAVE_DIMES
+    MATCH_STRING_TO_METHOD("DIMES",ADIOS_METHOD_DIMES,1)
+#endif
+
+#if HAVE_PHDF5
+    MATCH_STRING_TO_METHOD("PHDF5",ADIOS_METHOD_PHDF5,1)
+#endif
+
+#if HAVE_NC4PAR
+    MATCH_STRING_TO_METHOD("NC4",ADIOS_METHOD_NC4,1)
+#endif
+
+#if HAVE_NSSI
+    MATCH_STRING_TO_METHOD("NSSI",ADIOS_METHOD_NSSI_STAGING,1)
+    MATCH_STRING_TO_METHOD("NSSI_FILTER",ADIOS_METHOD_NSSI_FILTER,1)
+#endif
+
+#ifndef NO_RESEARCH_TRANSPORTS
+    MATCH_STRING_TO_METHOD("PROVENANCE",ADIOS_METHOD_PROVENANCE,1)
+#endif
+
+    MATCH_STRING_TO_METHOD("NULL",ADIOS_METHOD_NULL,0)
+
+    *method = ADIOS_METHOD_UNKNOWN;
+    *requires_group_comm = 0;
+
+    return 0;
+}
diff --git a/src/adios_transport_hooks.h b/src/adios_transport_hooks.h
new file mode 100644
index 0000000..798c903
--- /dev/null
+++ b/src/adios_transport_hooks.h
@@ -0,0 +1,158 @@
+/*
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#ifndef ADIOS_TRANSPORT_HOOKS_H
+#define ADIOS_TRANSPORT_HOOKS_H
+
+#include "config.h"
+#include <stdint.h>
+#include <string.h>
+
+// this is defined in the lint program to get empty implementations
+#ifdef ADIOS_EMPTY_TRANSPORTS
+#define FORWARD_DECLARE(a) \
+void adios_##a##_init (const char * parameters \
+                      ,struct adios_method_struct * method \
+                      ) {} \
+int adios_##a##_open (struct adios_file_struct * fd \
+                     ,struct adios_method_struct * method, void * comm \
+                     ) {return 0;} \
+enum ADIOS_FLAG adios_##a##_should_buffer (struct adios_file_struct * fd \
+                                          ,struct adios_method_struct * method \
+                                          ) {return 0;} \
+void adios_##a##_write (struct adios_file_struct * fd \
+                       ,struct adios_var_struct * v \
+                       ,void * data \
+                       ,struct adios_method_struct * method \
+                       ) {} \
+void adios_##a##_get_write_buffer (struct adios_file_struct * fd \
+                                  ,struct adios_var_struct * v \
+                                  ,uint64_t * size \
+                                  ,void ** buffer \
+                                  ,struct adios_method_struct * method \
+                                  ) {} \
+void adios_##a##_read (struct adios_file_struct * fd \
+                      ,struct adios_var_struct * v \
+                      ,void * buffer \
+                      ,uint64_t buffer_size \
+                      ,struct adios_method_struct * method \
+                      ) {} \
+void adios_##a##_close (struct adios_file_struct * fd \
+                       ,struct adios_method_struct * method \
+                       ) {} \
+void adios_##a##_finalize (int mype, struct adios_method_struct * method) {} \
+void adios_##a##_end_iteration (struct adios_method_struct * method) {} \
+void adios_##a##_start_calculation (struct adios_method_struct * method) {} \
+void adios_##a##_stop_calculation (struct adios_method_struct * method) {}
+#else
+#define FORWARD_DECLARE(a) \
+void adios_##a##_init (const char * parameters \
+                      ,struct adios_method_struct * method \
+                      ); \
+int adios_##a##_open (struct adios_file_struct * fd \
+                     ,struct adios_method_struct * method, void * comm \
+                     ); \
+enum ADIOS_FLAG adios_##a##_should_buffer (struct adios_file_struct * fd \
+                                          ,struct adios_method_struct * method \
+                                          ); \
+void adios_##a##_write (struct adios_file_struct * fd \
+                       ,struct adios_var_struct * v \
+                       ,void * data \
+                       ,struct adios_method_struct * method \
+                       ); \
+void adios_##a##_get_write_buffer (struct adios_file_struct * fd \
+                                  ,struct adios_var_struct * v \
+                                  ,uint64_t * size \
+                                  ,void ** buffer \
+                                  ,struct adios_method_struct * method \
+                                  ); \
+void adios_##a##_read (struct adios_file_struct * fd \
+                      ,struct adios_var_struct * v \
+                      ,void * buffer \
+                      ,uint64_t buffer_size \
+                      ,struct adios_method_struct * method \
+                      ); \
+void adios_##a##_close (struct adios_file_struct * fd \
+                       ,struct adios_method_struct * method \
+                       ); \
+void adios_##a##_finalize (int mype, struct adios_method_struct * method); \
+void adios_##a##_end_iteration (struct adios_method_struct * method); \
+void adios_##a##_start_calculation (struct adios_method_struct * method); \
+void adios_##a##_stop_calculation (struct adios_method_struct * method);
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+//// SETUP YOUR NEW TRANSPORT METHODS BELOW (FOLLOW THE PATTERN):          ////
+//// 1. Add an entry to the ADIOS_IO_METHOD updating the ADIOS_METHOD_COUNT////
+//// 2. Add a FOWARD_DECLARE line (assuming standard naming)               ////
+//// 3. Add an entry to ADIOS_PARSE_METHOD_SETUP for the string and ID     ////
+//// 4. Add an entry to ADIOS_INIT_TRANSPORTS_SETUP for name to ID         ////
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+
+struct adios_method_struct;
+struct adios_file_struct;
+struct adios_var_struct;
+// the list of the methods that have been integrated
+// VTK and POSIX_ASCII are placeholders reserved for future use
+enum ADIOS_IO_METHOD {ADIOS_METHOD_UNKNOWN     = -2
+              ,ADIOS_METHOD_NULL        = -1
+              ,ADIOS_METHOD_MPI         = 0
+              ,ADIOS_METHOD_DATATAP     = 1
+              ,ADIOS_METHOD_POSIX       = 2
+              ,ADIOS_METHOD_DART        = 3
+              ,ADIOS_METHOD_VTK         = 4
+              ,ADIOS_METHOD_POSIX_ASCII = 5
+              ,ADIOS_METHOD_MPI_CIO     = 6
+              ,ADIOS_METHOD_PHDF5       = 7
+              ,ADIOS_METHOD_PROVENANCE  = 8
+              ,ADIOS_METHOD_MPI_STRIPE  = 9
+              ,ADIOS_METHOD_MPI_LUSTRE  = 10
+              ,ADIOS_METHOD_MPI_STAGGER = 11
+              ,ADIOS_METHOD_MPI_AGG     = 12
+              ,ADIOS_METHOD_ADAPTIVE    = 13
+              ,ADIOS_METHOD_POSIX1      = 14
+              ,ADIOS_METHOD_NC4         = 15
+              ,ADIOS_METHOD_MPI_AMR     = 16
+              ,ADIOS_METHOD_MPI_AMR1    = 17
+              ,ADIOS_METHOD_NSSI_STAGING = 18
+              ,ADIOS_METHOD_NSSI_FILTER  = 19
+              ,ADIOS_METHOD_DIMES        = 20
+              ,ADIOS_METHOD_COUNT        = 21
+};
+
+// forward declare the functions (or dummies for internals use)
+FORWARD_DECLARE(mpi)
+     FORWARD_DECLARE(mpi_lustre)
+     FORWARD_DECLARE(mpi_cio)
+     FORWARD_DECLARE(mpi_stripe)
+     FORWARD_DECLARE(mpi_stagger)
+     FORWARD_DECLARE(mpi_aggregate)
+     FORWARD_DECLARE(mpi_amr)
+     FORWARD_DECLARE(mpi_amr1)
+     FORWARD_DECLARE(datatap)
+     FORWARD_DECLARE(posix)
+     FORWARD_DECLARE(posix1)
+     FORWARD_DECLARE(provenance)
+     FORWARD_DECLARE(phdf5)
+     FORWARD_DECLARE(nc4)
+     FORWARD_DECLARE(nssi)
+     FORWARD_DECLARE(nssi_filter)
+     FORWARD_DECLARE(adaptive)
+
+#if HAVE_DART
+FORWARD_DECLARE(dart)
+#endif
+
+#if HAVE_DIMES
+FORWARD_DECLARE(dimes)
+#endif
+
+
+#undef FORWARD_DECLARE
+#endif
diff --git a/src/adios_types.h b/src/adios_types.h
new file mode 100644
index 0000000..c60e4ad
--- /dev/null
+++ b/src/adios_types.h
@@ -0,0 +1,43 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#ifndef ADIOS_TYPES_H
+#define ADIOS_TYPES_H
+
+/* global defines needed for the type creation/setup functions */
+enum ADIOS_DATATYPES {adios_unknown = -1             /* (size) */
+
+                     ,adios_byte = 0                 /* (1) */
+                     ,adios_short = 1                /* (2) */
+                     ,adios_integer = 2              /* (4) */
+                     ,adios_long = 4                 /* (8) */
+
+                     ,adios_unsigned_byte = 50       /* (1) */
+                     ,adios_unsigned_short = 51      /* (2) */
+                     ,adios_unsigned_integer = 52    /* (4) */
+                     ,adios_unsigned_long = 54       /* (8) */
+
+                     ,adios_real = 5                 /* (4) */
+                     ,adios_double = 6               /* (8) */
+                     ,adios_long_double = 7          /* (16) */
+
+                     ,adios_string = 9               /* (?) */
+                     ,adios_complex = 10             /* (8) */
+                     ,adios_double_complex = 11      /* (16) */
+                     };
+
+enum ADIOS_FLAG {adios_flag_unknown = 0
+                ,adios_flag_yes = 1
+                ,adios_flag_no = 2
+                };
+
+enum ADIOS_BUFFER_ALLOC_WHEN {ADIOS_BUFFER_ALLOC_UNKNOWN
+                             ,ADIOS_BUFFER_ALLOC_NOW
+                             ,ADIOS_BUFFER_ALLOC_LATER
+                             };
+
+#endif
diff --git a/src/adiosf.c b/src/adiosf.c
new file mode 100644
index 0000000..94ca1ab
--- /dev/null
+++ b/src/adiosf.c
@@ -0,0 +1,487 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include "../config.h"
+#include <string.h>
+#include <unistd.h>
+#include <stdint.h>
+
+#include "common_adios.h"
+#include "adios_internals.h"
+#include "adios_internals_mxml.h"
+#include "adios_transport_hooks.h"
+#include "futils.h"
+#include "globals.h"
+
+#ifdef __cplusplus
+extern "C"  /* prevent C++ name mangling */
+#endif
+
+extern int adios_errno;
+
+///////////////////////////////////////////////////////////////////////////////
+void FC_FUNC_(adios_set_application_id, adios_SET_APPLICATION_ID) (int *id, int * err)
+{
+    globals_adios_set_application_id (*id);
+    if (err != 0) *err = 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void FC_FUNC_(adios_init, adios_INIT) (const char * config, int * err, int config_size)
+{
+    char * buf1 = 0;
+
+    buf1 = futils_fstr_to_cstr (config, config_size);
+    if (buf1 != 0) {
+        *err = common_adios_init (buf1);
+        free (buf1);
+    } else {
+        *err = -adios_errno;
+    }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void FC_FUNC_(adios_init_noxml, adios_INIT_LOCAL) (int * err)
+{
+    *err = common_adios_init_noxml ();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void FC_FUNC_(adios_finalize, adios_FINALIZE) (int * mype, int * err)
+{
+    *err = common_adios_finalize (*mype);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void FC_FUNC_(adios_allocate_buffer, adios_ALLOCATE_BUFFER) (int *sizeMB, int * err)
+{
+    //FIX
+    *err = common_adios_allocate_buffer (1 /*NOW*/, *sizeMB);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void FC_FUNC_(adios_open, adios_OPEN) 
+    (int64_t * fd, const char * group_name, const char * name
+    ,const char * mode, void * comm, int * err
+    ,int group_name_size, int name_size, int mode_size
+    )
+{
+    char * buf1 = 0;
+    char * buf2 = 0;
+    char * buf3 = 0;
+
+    buf1 = futils_fstr_to_cstr (group_name, group_name_size);
+    buf2 = futils_fstr_to_cstr (name, name_size);
+    buf3 = futils_fstr_to_cstr (mode, mode_size);
+
+    if (buf1 != 0 && buf2 != 0 && buf3 != 0) {
+        *err = common_adios_open (fd, buf1, buf2, buf3, comm);
+        free (buf1);
+        free (buf2);
+        free (buf3);
+    } else {
+        *err = -adios_errno;
+    }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void FC_FUNC_(adios_group_size, adios_GROUP_SIZE) 
+    (int64_t * fd_p, int64_t * data_size
+    ,int64_t * total_size, int * err
+    )
+{
+    *err = common_adios_group_size (*fd_p, (uint64_t) *data_size
+                            ,(uint64_t *) total_size
+                            );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+#include "stdio.h"
+/* This Fortran api function is a bit different from the C api funcion, but
+ * they call the same common_adios_write().
+ * Difference: if the variable is string type then we need to convert
+ * the void * var to a C string (add \0 to the end)
+ * We rely on the assumption/fact that Fortran compilers pass on the 
+ * length of a character array in an extra integer argument, even if
+ * the C function declares a void* array in the argument list. 
+ */
+void FC_FUNC_(adios_write, adios_WRITE) 
+    (int64_t * fd_p, const char * name, void * var, int * err
+    ,int name_size, int var_size
+    )
+{
+    struct adios_file_struct * fd = (struct adios_file_struct *) *fd_p;
+    if (!fd)
+    {
+        fprintf (stderr, "Invalid handle passed to adios_write\n");
+        *err = 1;
+        return;
+    }
+
+    struct adios_var_struct * v = fd->group->vars;
+    struct adios_method_list_struct * m = fd->group->methods;
+
+    if (m && m->next == NULL && m->method->m == ADIOS_METHOD_NULL)
+    {
+        // nothing to do so just return
+        *err = 0;
+        return;
+    }
+
+    char * buf1 = 0;
+    buf1 = futils_fstr_to_cstr (name, name_size);
+
+    //printf("  -- adios_write: name=[%s] var size = %d\n", buf1, var_size);
+
+    if (!buf1) {
+        *err = -adios_errno;
+        return;
+    }
+
+    v = adios_find_var_by_name (v, buf1, fd->group->all_unique_var_names);
+
+    if (!v)
+    {
+        fprintf (stderr, "Bad var name (ignored): '%s'\n", buf1);
+        *err = 1;
+        free (buf1);
+        return;
+    }
+
+    if (fd->mode == adios_mode_read)
+    {
+        if (   strcasecmp (buf1, fd->group->group_comm)
+            && v->is_dim != adios_flag_yes
+           )
+        {
+            fprintf (stderr, "write attempted on %s in %s.  This was opened for read\n" ,buf1 , fd->name);
+            *err = 1;
+            free (buf1);
+            return;
+        }
+    }
+
+    if (!var)
+    {
+        fprintf (stderr, "Invalid data: %s\n", buf1);
+        *err = 1;
+        free (buf1);
+        return;
+    }
+
+    if (v->data)
+    {
+        free (v->data);
+        v->data = 0;
+    }
+
+    if (v->dimensions)
+    {
+        v->data = var;
+    }
+    else
+    {
+        uint64_t element_size = adios_get_type_size (v->type, var);
+
+        switch (v->type)
+        {
+            case adios_byte:
+            case adios_short:
+            case adios_integer:
+            case adios_long:
+            case adios_unsigned_byte:
+            case adios_unsigned_short:
+            case adios_unsigned_integer:
+            case adios_unsigned_long:
+            case adios_real:
+            case adios_double:
+            case adios_long_double:
+            case adios_complex:
+            case adios_double_complex:
+                v->data = malloc (element_size);
+                if (!v->data)
+                {
+                    fprintf (stderr, "cannot allocate %llu bytes to copy "
+                                     "scalar %s\n"
+                            ,element_size
+                            ,v->name
+                            );
+
+                    *err = 1;
+                    free (buf1);
+                    return;
+                }
+
+                memcpy ((char *) v->data, var, element_size);
+                break;
+            case adios_string:
+                v->data = futils_fstr_to_cstr (var, var_size);
+                if (!v->data)
+                {
+                    fprintf (stderr, "cannot allocate %llu bytes to copy "
+                                     "scalar %s\n"
+                            ,element_size
+                            ,v->name
+                            );
+
+                    *err = 1;
+                    free (buf1);
+                    return;
+                }
+                break;
+
+            default:
+                v->data = 0;
+                break;
+        }
+    }
+
+    *err = common_adios_write (fd, v, var);
+    if (fd->mode == adios_mode_write || fd->mode == adios_mode_append)
+    {
+        adios_copy_var_written (&fd->group->vars_written, v, fd);
+    }
+
+    free (buf1);
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+void FC_FUNC_(adios_get_write_buffer, adios_GET_WRITE_BUFFER) 
+    (int64_t * fd_p, const char * name
+    ,int64_t * size
+    ,void ** buffer, int * err, int name_size
+    )
+{
+    char * buf1 = 0;
+
+    buf1 = futils_fstr_to_cstr (name, name_size);
+
+    if (buf1 != 0) {
+        *err = common_adios_get_write_buffer (*fd_p, buf1, (uint64_t *) size, buffer);
+        free (buf1);
+    } else {
+        *err = -adios_errno;
+    }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void FC_FUNC_(adios_read, adios_READ) 
+    (int64_t * fd_p, const char * name, void * buffer
+    ,int64_t * buffer_size, int * err, int name_size
+    )
+{
+    char * buf1 = 0;
+
+    buf1 = futils_fstr_to_cstr (name, name_size);
+
+    if (buf1 != 0) {
+        *err = common_adios_read (*fd_p, buf1, buffer, *buffer_size);
+        free (buf1);
+    } else {
+        *err = -adios_errno;
+    }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void FC_FUNC_(adios_set_path, adios_SET_PATH) 
+    (int64_t * fd_p, const char * path, int * err, int path_size)
+{
+    char * buf1 = 0;
+
+    buf1 = futils_fstr_to_cstr (path, path_size);
+
+    if (buf1 != 0) {
+        *err = common_adios_set_path (*fd_p, buf1);
+        free (buf1);
+    } else {
+        *err = -adios_errno;
+    }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void FC_FUNC_(adios_set_path_var, adios_SET_PATH_VAR) 
+    (int64_t * fd_p, const char * path, const char * name, int * err, int path_size, int name_size)
+{
+    char * buf1 = 0;
+    char * buf2 = 0;
+
+    buf1 = futils_fstr_to_cstr (path, path_size);
+    buf2 = futils_fstr_to_cstr (name, name_size);
+
+    if (buf1 != 0 && buf2 != 0) {
+        *err = common_adios_set_path_var (*fd_p, buf1, buf2);
+        free (buf1);
+        free (buf2);
+    } else {
+        *err = -adios_errno;
+    }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// hint that we reached the end of an iteration (for asynchronous pacing)
+void FC_FUNC_(adios_end_iteration, adios_END_ITERATION) (int * err)
+{
+    *err = common_adios_end_iteration ();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// hint to start communicating
+void FC_FUNC_(adios_start_calculation, adios_START_CALCULATION) (int * err)
+{
+    *err = common_adios_start_calculation ();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// hint to stop communicating
+void FC_FUNC_(adios_stop_calculation, adios_STOP_CALCULATION) (int * err)
+{
+    *err = common_adios_stop_calculation ();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void FC_FUNC_(adios_close, adios_CLOSE) (int64_t * fd_p, int * err)
+{
+    *err = common_adios_close (*fd_p);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// Methods normally only called by the XML parser
+//////////////////////////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////////////////////////
+// adios_common_declare_group is in adios_internals.c
+// group a list of vars into a composite group
+void FC_FUNC_(adios_declare_group, adios_DECLARE_GROUP) 
+    (int64_t * id, const char * name
+    ,const char * time_index, int * err
+    ,int name_size, int time_index_size
+    )
+{
+    char * buf1 = 0;
+    char * buf2 = 0;
+
+    buf1 = futils_fstr_to_cstr (name, name_size);
+    buf2 = futils_fstr_to_cstr (time_index, time_index_size);
+
+    if (buf1 != 0 && buf2 != 0) {
+        *err = adios_common_declare_group (id, buf1, adios_flag_yes, "", "", buf2);
+        free (buf1);
+        free (buf2);
+        if (*err == 1) {
+            struct adios_group_struct * g = (struct adios_group_struct *) *id;
+            g->all_unique_var_names = adios_flag_no;
+        }
+    } else {
+        *err = -adios_errno;
+    }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// adios_common_define_var is in adios_internals.c
+// declare a single var as an entry in a group
+void FC_FUNC_(adios_define_var, adios_DEFINE_VAR) 
+    (int64_t * group_id, const char * name
+    ,const char * path, int * type
+    ,const char * dimensions
+    ,const char * global_dimensions
+    ,const char * local_offsets, int * err
+    ,int name_size, int path_size, int dimensions_size
+    ,int global_dimensions_size, int local_offsets_size
+    )
+{
+    char * buf1 = 0;
+    char * buf2 = 0;
+    char * buf3 = 0;
+    char * buf4 = 0;
+    char * buf5 = 0;
+
+    buf1 = futils_fstr_to_cstr (name, name_size);
+    buf2 = futils_fstr_to_cstr (path, path_size);
+    buf3 = futils_fstr_to_cstr (dimensions, dimensions_size);
+    buf4 = futils_fstr_to_cstr (global_dimensions, global_dimensions_size);
+    buf5 = futils_fstr_to_cstr (local_offsets, local_offsets_size);
+
+    if (buf1 != 0 && buf2 != 0) {
+        *err = adios_common_define_var (*group_id, buf1, buf2
+                                       ,(enum ADIOS_DATATYPES) *type
+                                       ,buf3, buf4, buf5
+                                       );
+
+        free (buf1);
+        free (buf2);
+        free (buf3);
+        free (buf4);
+        free (buf5);
+    } else {
+        *err = -adios_errno;
+    }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// adios_common_define_attribute is in adios_internals.c
+void FC_FUNC_(adios_define_attribute, adios_DEFINE_ATTRIBUTE) 
+    (int64_t * group, const char * name
+    ,const char * path, int * type, const char * value
+    ,const char * var, int * err
+    ,int name_size, int path_size, int value_size
+    ,int var_size
+    )
+{
+    char * buf1 = 0;
+    char * buf2 = 0;
+    char * buf3 = 0;
+    char * buf4 = 0;
+
+    buf1 = futils_fstr_to_cstr (name, name_size);
+    buf2 = futils_fstr_to_cstr (path, path_size);
+    buf3 = futils_fstr_to_cstr (value, value_size);
+    buf4 = futils_fstr_to_cstr (var, var_size);
+
+    if (buf1 != 0 && buf2 != 0 && buf3 != 0 && buf4 != 0) {
+        *err = adios_common_define_attribute (*group, buf1, buf2
+                                             ,(enum ADIOS_DATATYPES) *type, buf3
+                                             ,buf4
+                                             );
+
+        free (buf1);
+        free (buf2);
+        free (buf3);
+        free (buf4);
+    } else {
+        *err = -adios_errno;
+    }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// adios_common_select_method is in adios_internals_mxml.c
+void FC_FUNC_(adios_select_method, adios_SELECT_METHOD) 
+    (int64_t * group, const char * method
+    ,const char * parameters, const char * base_path
+    ,int * err, int method_size, int parameters_size
+    ,int base_path_size
+    )
+{
+    char * buf1 = 0;
+    char * buf2 = 0;
+    char * buf3 = 0;
+    buf1 = futils_fstr_to_cstr (method, method_size);
+    buf2 = futils_fstr_to_cstr (parameters, parameters_size);
+    buf3 = futils_fstr_to_cstr (base_path, base_path_size);
+
+    if (buf1 != 0 && buf2 != 0 && buf3 != 0) {
+        struct adios_group_struct * g = (struct adios_group_struct *) (* group);
+        *err = adios_common_select_method (0, buf1, buf2, g->name, buf3, 0);
+
+        free (buf1);
+        free (buf2);
+        free (buf3);
+    } else {
+        *err = -adios_errno;
+    }
+}
diff --git a/src/adiosf_read.c b/src/adiosf_read.c
new file mode 100644
index 0000000..f564354
--- /dev/null
+++ b/src/adiosf_read.c
@@ -0,0 +1,431 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include "../config.h"
+#include <stdlib.h>
+#include <string.h>
+#define __INCLUDED_FROM_FORTRAN_API__
+#include "bp_utils.h"
+#include "bp_types.h"
+#include "common_read.h"
+#include "adios_read.h"
+#include "adios_error.h"
+#include "futils.h"
+#define BYTE_ALIGN 8
+
+#ifdef DMALLOC
+#include "dmalloc.h"
+#endif
+
+#ifdef __cplusplus
+extern "C"  /* prevent C++ name mangling */
+#endif
+
+extern int adios_errno;
+
+/*********************/
+/* FORTRAN INTERFACE */
+/*********************/
+void FC_FUNC_(adios_errmsg, adios_errmsg) (char *msg, int msg_len)
+{
+    futils_cstr_to_fstr( adios_get_last_errmsg(), (char *)msg, msg_len);
+}
+
+void FC_FUNC_(adios_read_init, ADIOS_READ_INIT) (int * fcomm, int * err)
+{
+    MPI_Comm comm = MPI_Comm_f2c (*((int *) fcomm));
+    futils_called_from_fortran_set();
+    *err = common_read_init(comm);
+    if (*err)
+        fprintf(stderr, "Error: %s\n", adios_get_last_errmsg());
+}
+
+void FC_FUNC_(adios_read_finalize, ADIOS_READ_FINALIZE) (int * err)
+{
+    *err = common_read_finalize ();
+    futils_called_from_fortran_unset();
+    if (*err)
+        fprintf(stderr, "Error: %s\n", adios_get_last_errmsg());
+}
+
+void FC_FUNC_(adios_set_read_method, ADIOS_SET_READ_METHOD) (int *fmethod, int *err)
+{
+    enum ADIOS_READ_METHOD method = (enum ADIOS_READ_METHOD) *fmethod;
+    *err = common_read_set_read_method (method);
+    if (*err)
+        fprintf(stderr, "Error: %s\n", adios_get_last_errmsg());
+}
+
+void FC_FUNC_(adios_fopen, ADIOS_FOPEN)
+        (int64_t * fp,
+         char    * fname,
+         void    * fcomm,
+         int     * groups_count,
+         int     * err,
+         int       fname_len)
+{
+    ADIOS_FILE *afp;
+    char *namestr;
+    MPI_Comm comm = MPI_Comm_f2c (*((int *) fcomm));
+    futils_called_from_fortran_set();
+
+    namestr = futils_fstr_to_cstr(fname, fname_len);
+    if (namestr != NULL) {
+        afp = common_read_fopen (namestr,comm);
+        if (afp != NULL) {
+            *groups_count = afp->groups_count;
+        } else {
+            *groups_count = 0;
+        }
+        *fp = (int64_t) afp;
+        free(namestr);
+    } else {
+        *fp = (int64_t) NULL;
+    }
+    *err = -adios_errno;
+    if (*err)
+        fprintf(stderr, "Error: %s\n", adios_get_last_errmsg());
+}
+
+void FC_FUNC_(adios_reset_dimension_order, ADIOS_RESET_DIMENSION_ORDER)
+        (int64_t * fp,
+         int * flag)
+{
+    ADIOS_FILE *afp = (ADIOS_FILE *) *fp;
+    common_read_reset_dimension_order(afp, *flag);
+}
+
+void FC_FUNC_(adios_fclose, ADIOS_FCLOSE) (int64_t * fp, int * err)
+{
+    ADIOS_FILE *afp = (ADIOS_FILE *) *fp;
+    *err = common_read_fclose (afp);
+    futils_called_from_fortran_unset();
+    if (*err)
+        fprintf(stderr, "Error: %s\n", adios_get_last_errmsg());
+}
+
+void FC_FUNC_(adios_inq_file, ADIOS_INQ_FILE) 
+        (int64_t * fp,
+         int     * vars_count,
+         int     * attrs_count,
+         int     * tstart,
+         int     * ntsteps,
+         void    * gnamelist,
+         int     * err,
+         int       gnamelist_len)
+{
+    ADIOS_FILE *afp = (ADIOS_FILE *) *fp;
+    int i;
+    if (afp != NULL) {
+        *vars_count = afp->vars_count;
+        *attrs_count = afp->attrs_count;
+        *tstart = afp->tidx_start;
+        *ntsteps = afp->ntimesteps;
+        *err = 0;
+        for (i=0;i<afp->groups_count;i++) {
+            futils_cstr_to_fstr( afp->group_namelist[i], (char *)gnamelist+i*gnamelist_len, gnamelist_len);
+        }
+    } else {
+        *vars_count = 0;
+        *attrs_count = 0;
+        *tstart = 0;
+        *ntsteps = 0;
+        *err = 1;
+    }
+}
+
+void FC_FUNC_(adios_gopen, ADIOS_GOPEN) 
+        (int64_t * fp,
+         int64_t * gp,
+         char    * grpname,
+         int     * vars_count, 
+         int     * attrs_count, 
+         int     * err,
+         int       grpname_len)
+{
+    char *namestr;
+    ADIOS_GROUP *agp;
+    ADIOS_FILE *afp = (ADIOS_FILE *) *fp;
+
+    namestr = futils_fstr_to_cstr(grpname, grpname_len);
+    if (namestr != NULL) {
+        agp = common_read_gopen (afp, namestr);
+        if (agp != NULL) {
+            *vars_count = agp->vars_count;
+            *attrs_count = agp->attrs_count;
+        } else {
+            *vars_count = 0;
+            *attrs_count = 0;
+        }
+        *gp = (int64_t)agp;
+        free(namestr);
+    } else {
+        *gp = (int64_t) NULL;
+    }
+    *err = -adios_errno;
+    if (*err)
+        fprintf(stderr, "Error: %s\n", adios_get_last_errmsg());
+}
+
+void FC_FUNC_(adios_gclose, ADIOS_GCLOSE) (int64_t * gp, int * err)
+{
+    ADIOS_GROUP *agp = (ADIOS_GROUP *) *gp;
+    *err=common_read_gclose(agp);
+    if (*err)
+        fprintf(stderr, "Error: %s\n", adios_get_last_errmsg());
+}
+
+void FC_FUNC_(adios_inq_group, ADIOS_INQ_GROUP)
+        (int64_t * gp, 
+         void    * vnamelist, 
+         void    * anamelist,
+         int     * err, 
+         int       vnamelist_len, 
+         int       anamelist_len) 
+{
+    ADIOS_GROUP *agp = (ADIOS_GROUP *) *gp;
+    int i;
+    if (agp != NULL) {
+        for (i=0;i<agp->vars_count;i++) {
+            futils_cstr_to_fstr( agp->var_namelist[i], (char *)vnamelist+i*vnamelist_len, vnamelist_len);
+        } 
+        for (i=0;i<agp->attrs_count;i++) {
+            futils_cstr_to_fstr( agp->attr_namelist[i], (char *)anamelist+i*anamelist_len, anamelist_len);
+        } 
+        *err = 0;
+    } else {
+        *err = 1;
+    }
+}
+
+void FC_FUNC_(adios_inq_var, ADIOS_INQ_VAR) 
+        (int64_t  * gp, 
+         char     * varname,
+         int      * type,
+         int      * ndim,
+         uint64_t * dims,
+         int      * timedim,
+         int      * err,
+         int        varname_len)
+{
+    char *varstr;
+    int  i;
+    ADIOS_GROUP *agp = (ADIOS_GROUP *) *gp;
+    ADIOS_VARINFO *vi = NULL;
+
+    varstr = futils_fstr_to_cstr(varname, varname_len);
+    if (varstr != NULL) {
+        vi = common_read_inq_var (agp, varstr);
+    }
+    if (vi != NULL) {
+        *type = vi->type;
+        *ndim = vi->ndim;
+        *timedim = vi->timedim;
+        for (i=0;i<vi->ndim;i++)
+            dims[i] = vi->dims[i];
+        common_read_free_varinfo(vi);
+    } else {
+        *type = adios_unknown;
+        *ndim = 0;
+        *timedim = -1;
+    }
+    *err = -adios_errno;
+    if (*err < 0)
+        fprintf(stderr, "Error: %s\n", adios_get_last_errmsg());
+}
+
+void FC_FUNC_(adios_read_var, ADIOS_READ_VAR) 
+        (int64_t  * gp,
+         char     * varname,
+         uint64_t * start,
+         uint64_t * count,
+         void     * data,
+         int64_t  * read_bytes,
+         int varname_len)
+{
+    ADIOS_GROUP *agp = (ADIOS_GROUP *) *gp;
+    char *varstr;
+    int i;
+    varstr = futils_fstr_to_cstr(varname, varname_len);
+    if (varstr != NULL) {
+        *read_bytes = common_read_read_var (agp, varstr, start, count, data);
+        free(varstr);
+    } else {
+        *read_bytes = -adios_errno;
+    }
+    if (*read_bytes < 0)
+        fprintf(stderr, "Error: %s\n", adios_get_last_errmsg());
+}
+
+/* Specific function for each data type */
+void FC_FUNC_(adios_read_var_int1, ADIOS_READ_VAR_INT1) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); }
+void FC_FUNC_(adios_read_var_int2, ADIOS_READ_VAR_INT2) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); }
+void FC_FUNC_(adios_read_var_int4, ADIOS_READ_VAR_INT4) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); }
+void FC_FUNC_(adios_read_var_int8, ADIOS_READ_VAR_INT8) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); }
+void FC_FUNC_(adios_read_var_real4, ADIOS_READ_VAR_REAL4) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); }
+void FC_FUNC_(adios_read_var_real8, ADIOS_READ_VAR_REAL8) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); }
+void FC_FUNC_(adios_read_var_char, ADIOS_READ_VAR_CHAR) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); }
+void FC_FUNC_(adios_read_var_complex8, ADIOS_READ_VAR_COMPLEX8) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); }
+void FC_FUNC_(adios_read_var_complex16, ADIOS_READ_VAR_COMPLEX16) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); }
+void FC_FUNC_(adios_read_var_logical1, ADIOS_READ_VAR_LOGICAL1) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); }
+void FC_FUNC_(adios_read_var_logical2, ADIOS_READ_VAR_LOGICAL2) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); }
+void FC_FUNC_(adios_read_var_logical4, ADIOS_READ_VAR_LOGICAL4) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); }
+void FC_FUNC_(adios_read_var_logical8, ADIOS_READ_VAR_LOGICAL8) (int64_t * gp, char * varname, uint64_t * start, uint64_t * count, void * data, int64_t * read_bytes, int varname_len) { FC_FUNC_(adios_read_var, ADIOS_READ_VAR) (gp, varname, start, count, data, read_bytes, varname_len); }
+
+void FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) 
+        (int64_t * gp,
+         char    * varname,
+         void    * value,
+         void    * gmin,
+         void    * gmax,
+		 double    * gavg,
+		 double    * gstd_dev,
+         void    ** mins,
+         void    ** maxs,
+         double    ** avgs,
+         double    ** std_devs,
+         int     * err,
+         int       varname_len)
+{
+    ADIOS_GROUP *agp = (ADIOS_GROUP *) *gp;
+    ADIOS_VARINFO *vi = NULL;
+    char *varstr;
+    int i, size, ntime;
+
+    varstr = futils_fstr_to_cstr(varname, varname_len);
+    if (varstr != NULL) {
+        vi = common_read_inq_var (agp, varstr);
+    }
+    if (vi != NULL) {
+        size = bp_get_type_size(vi->type, vi->value);
+        if (vi->type == adios_string) size++;
+        if (vi->timedim > -1)
+            ntime = agp->fp->ntimesteps;
+        else 
+            ntime = 1;
+        if (vi->value) memcpy(value, vi->value, size);
+
+		if (vi->type == adios_complex || vi->type == adios_double_complex)
+		{
+			int c;
+			double * v_gmin = (double *) vi->gmin;
+			double * v_gmax = (double *) vi->gmax;
+			double ** v_mins = (double **) vi->mins;
+			double ** v_maxs = (double **) vi->maxs;
+
+			for (c = 0; c < 3; c ++)
+			{
+        		if (v_gmin[c]) memcpy(((double *) gmin) + c * size, &v_gmin[c], size);
+        		if (v_mins && v_mins[c]) memcpy(((double **) mins)[c], v_mins[c], ntime * size);
+
+        		if (v_gmax[c]) memcpy(((double *) gmax) + c * size, &v_gmax[c], size);
+        		if (v_maxs && v_maxs[c]) memcpy(((double **) maxs)[c], v_maxs[c], ntime * size);
+
+				if (vi->gavg && vi->gavg[c]) memcpy(&gavg[c], &vi->gavg[c], sizeof(double));
+        		if (vi->avgs && vi->avgs[c]) memcpy(avgs[c], vi->avgs[c], ntime * sizeof(double));
+
+				if (vi->gstd_dev && vi->gstd_dev[c]) memcpy(&gstd_dev[c], &vi->gstd_dev[c], sizeof(double));
+        		if (vi->std_devs && vi->std_devs[c]) memcpy(std_devs[c], vi->std_devs[c], ntime * sizeof(double));
+			}
+		}
+		else
+		{
+        	if (vi->gmin) memcpy((char *) gmin, (char *) vi->gmin, size);
+        	if (vi->gmax) memcpy((char *) gmax, (char *) vi->gmax, size);
+			if (vi->gavg) memcpy(gavg, vi->gavg, sizeof(double));
+			if (vi->gstd_dev) memcpy(gstd_dev, vi->gstd_dev, sizeof(double));
+        	if (vi->mins) memcpy((char *) mins, (char *) vi->mins, ntime * size);
+        	if (vi->maxs) memcpy((char *) maxs, (char *) vi->maxs, ntime * size);
+        	if (vi->avgs) memcpy(avgs, vi->avgs, ntime * sizeof(double));
+        	if (vi->std_devs) memcpy(std_devs, vi->std_devs, ntime * sizeof(double));
+		}
+        common_read_free_varinfo(vi);
+    }
+    *err = -adios_errno;
+    if (*err < 0)
+        fprintf(stderr, "Error: %s\n", adios_get_last_errmsg());
+}
+
+/* Specific function for each data type */
+void FC_FUNC_(adios_get_statistics_int1, ADIOS_GET_STATISTICS_INT1) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); }
+void FC_FUNC_(adios_get_statistics_int2, ADIOS_GET_STATISTICS_INT2) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); }
+void FC_FUNC_(adios_get_statistics_int4, ADIOS_GET_STATISTICS_INT4) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); }
+void FC_FUNC_(adios_get_statistics_int8, ADIOS_GET_STATISTICS_INT8) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); }
+void FC_FUNC_(adios_get_statistics_real4, ADIOS_GET_STATISTICS_REAL4) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); }
+void FC_FUNC_(adios_get_statistics_real8, ADIOS_GET_STATISTICS_REAL8) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); }
+void FC_FUNC_(adios_get_statistics_complex8, ADIOS_GET_STATISTICS_COMPLEX8) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); }
+void FC_FUNC_(adios_get_statistics_complex16, ADIOS_GET_STATISTICS_COMPLEX16) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); }
+void FC_FUNC_(adios_get_statistics_char, ADIOS_GET_STATISTICS_CHAR) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); }
+void FC_FUNC_(adios_get_statistics_logical1, ADIOS_GET_STATISTICS_LOGICAL1) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); }
+void FC_FUNC_(adios_get_statistics_logical2, ADIOS_GET_STATISTICS_LOGICAL2) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); }
+void FC_FUNC_(adios_get_statistics_logical4, ADIOS_GET_STATISTICS_LOGICAL4) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); }
+void FC_FUNC_(adios_get_statistics_logical8, ADIOS_GET_STATISTICS_LOGICAL8) (int64_t * gp, char * varname, void * value, void * gmin, void * gmax, void * gavg, void * gstd_dev, void * mins, void * maxs, void * avgs, void * std_devs, int * err, int varname_len) { FC_FUNC_(adios_get_statistics, ADIOS_GET_STATISTICS) (gp, varname, value, gmin, gmax, gavg, gstd_dev, mins, maxs, avgs, std_devs, err, varname_len); }
+
+void FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) 
+        (int64_t * gp,
+         char    * attrname,
+         void    * attr,
+         int     * err,
+         int       attrname_len)
+{
+    ADIOS_GROUP *agp = (ADIOS_GROUP *) *gp;
+    char *attrstr;
+    int i;
+    void *data;
+    int size;
+    enum ADIOS_DATATYPES type;
+    attrstr = futils_fstr_to_cstr(attrname, attrname_len);
+    if (attrstr != NULL) {
+        *err = common_read_get_attr (agp, attrstr, &type, &size, &data);
+        if (data) {
+            memcpy(attr, data, size);
+            free(data);
+        }
+    } else {
+        *err = -adios_errno;
+    }
+    if (*err < 0)
+        fprintf(stderr, "Error: %s\n", adios_get_last_errmsg());
+}
+
+void FC_FUNC_(adios_inq_attr, ADIOS_INQ_ATTR) 
+        (int64_t * gp,
+         char    * attrname,
+         int     * type,
+         int     * size,
+         int     * err,
+         int       attrname_len)
+{
+    ADIOS_GROUP *agp = (ADIOS_GROUP *) *gp;
+    char *attrstr;
+    int i;
+    void *data;
+    attrstr = futils_fstr_to_cstr(attrname, attrname_len);
+    if (attrstr != NULL) {
+        *err = common_read_get_attr (agp, attrstr, (enum ADIOS_DATATYPES *)type, size, &data);
+        free(data);
+    } else {
+        *err = -adios_errno;
+    }
+    if (*err < 0)
+        fprintf(stderr, "Error: %s\n", adios_get_last_errmsg());
+}
+
+/* Specific function for each data type */
+void FC_FUNC_(adios_get_attr_int1, ADIOS_GET_ATTR_INT1) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); }
+void FC_FUNC_(adios_get_attr_int2, ADIOS_GET_ATTR_INT2) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); }
+void FC_FUNC_(adios_get_attr_int4, ADIOS_GET_ATTR_INT4) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); }
+void FC_FUNC_(adios_get_attr_int8, ADIOS_GET_ATTR_INT8) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); }
+void FC_FUNC_(adios_get_attr_real4, ADIOS_GET_ATTR_REAL4) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); }
+void FC_FUNC_(adios_get_attr_real8, ADIOS_GET_ATTR_REAL8) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); }
+void FC_FUNC_(adios_get_attr_complex8, ADIOS_GET_ATTR_COMPLEX8) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); }
+void FC_FUNC_(adios_get_attr_complex16, ADIOS_GET_ATTR_COMPLEX16) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); }
+void FC_FUNC_(adios_get_attr_char, ADIOS_GET_ATTR_CHAR) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); }
+void FC_FUNC_(adios_get_attr_logical1, ADIOS_GET_ATTR_LOGICAL1) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); }
+void FC_FUNC_(adios_get_attr_logical2, ADIOS_GET_ATTR_LOGICAL2) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); }
+void FC_FUNC_(adios_get_attr_logical4, ADIOS_GET_ATTR_LOGICAL4) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); }
+void FC_FUNC_(adios_get_attr_logical8, ADIOS_GET_ATTR_LOGICAL8) (int64_t * gp, char * attrname, void * attr, int * err, int attrname_len) { FC_FUNC_(adios_get_attr, ADIOS_GET_ATTR) (gp, attrname, attr, err, attrname_len); }
diff --git a/src/aggregation.cpp b/src/aggregation.cpp
new file mode 100644
index 0000000..c18d0f6
--- /dev/null
+++ b/src/aggregation.cpp
@@ -0,0 +1,1120 @@
+/*
+ * aggregation.cpp
+ *
+ *  Created on: Mar 9, 2009
+ *      Author: thkorde
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <assert.h>
+
+#include <nssi_server.h>
+
+#include <algorithm>
+#include <map>
+#include <list>
+
+using namespace std;
+
+#include "aggregation.h"
+
+
+struct ltstr
+{
+  bool operator()(const char* s1, const char* s2) const
+  {
+    return strcmp(s1, s2) < 0;
+  }
+};
+
+
+
+typedef struct {
+    int ahead_count;
+    int behind_count;
+    int same_count;
+    int no_match_count;
+} chunk_location_count_t;
+
+typedef list<aggregation_chunk_details_t *> chunk_details_t;
+typedef list<aggregation_chunk_details_t *>::iterator chunk_details_iterator_t;
+
+typedef struct {
+    aggregation_chunk_details_t *details;
+    chunk_details_t              component_chunks;
+} aggregation_chunk_t;
+
+typedef list<aggregation_chunk_t *> chunks_t;
+typedef list<aggregation_chunk_t *>::iterator chunks_iterator_t;
+
+
+typedef struct {
+    char      var_path[ADIOS_PATH_MAX];
+    char      var_name[ADIOS_PATH_MAX];
+    chunks_t *chunks;
+    int       chunks_received;
+} per_var_details_t;
+
+typedef map<const char *, per_var_details_t *, ltstr> var_map_t;
+typedef map<const char *, per_var_details_t *, ltstr>::iterator var_map_iterator_t;
+typedef pair<const char *, per_var_details_t *> var_map_pair_t;
+
+typedef struct {
+    int        fd;
+    var_map_t  vars;
+    write_type type; /* direct, aggregate independent, aggregate collective */
+} file_details_t;
+
+static map<int, file_details_t *> open_file_map;
+typedef map<int, file_details_t *>::iterator open_file_map_iterator_t;
+typedef pair<int, file_details_t *> open_file_map_pair_t;
+
+
+
+static int DEBUG=0;
+
+
+
+
+bool compare_chunks_for_aggregation(const aggregation_chunk_t* c1, const aggregation_chunk_t* c2)
+{
+    aggregation_chunk_details_t *details1=c1->details;
+    aggregation_chunk_details_t *details2=c2->details;
+
+    for (int i=0;i<details1->ndims;i++) {
+        if (details1->count[i] < details2->count[i]) {
+            return true;
+        } else if (details1->count[i] > details2->count[i]) {
+            return false;
+        }
+    }
+    for (int i=0;i<details1->ndims;i++) {
+        if (details1->offset[i] < details2->offset[i]) {
+            return true;
+        } else if (details1->offset[i] > details2->offset[i]) {
+            return false;
+        }
+    }
+    return false;
+}
+
+bool compare_chunks_for_caching(const aggregation_chunk_t* c1, const aggregation_chunk_t* c2)
+{
+    aggregation_chunk_details_t *details1=c1->details;
+    aggregation_chunk_details_t *details2=c2->details;
+
+    for (int i=0;i<details1->ndims;i++) {
+        if (details1->offset[i] < details2->offset[i]) {
+            return true;
+        } else if (details1->offset[i] > details2->offset[i]) {
+            return false;
+        }
+    }
+    return false;
+}
+
+file_details_t *new_open_file(const int fd)
+{
+    file_details_t *details=NULL;
+
+    details = new file_details_t;
+    details->fd = fd;
+
+    return details;
+}
+
+int use_aggregation(const int fd)
+{
+    file_details_t *details=NULL;
+
+    details = open_file_map[fd];
+    if ((details->type == WRITE_AGGREGATE_INDEPENDENT) ||
+        (details->type == WRITE_AGGREGATE_COLLECTIVE)) {
+        return TRUE;
+    }
+
+    return FALSE;
+}
+
+int use_caching(const int fd)
+{
+    file_details_t *details=NULL;
+
+    details = open_file_map[fd];
+    if ((details->type == WRITE_CACHING_INDEPENDENT) ||
+        (details->type == WRITE_CACHING_COLLECTIVE)) {
+        return TRUE;
+    }
+
+    return FALSE;
+}
+
+int use_collective(const int fd)
+{
+    file_details_t *details=NULL;
+
+    details = open_file_map[fd];
+    if ((details->type == WRITE_AGGREGATE_COLLECTIVE) ||
+        (details->type == WRITE_CACHING_COLLECTIVE)) {
+        return TRUE;
+    }
+
+    return FALSE;
+}
+
+int use_independent(const int fd)
+{
+    file_details_t *details=NULL;
+
+    details = open_file_map[fd];
+    if ((details->type == WRITE_AGGREGATE_INDEPENDENT) ||
+        (details->type == WRITE_CACHING_INDEPENDENT)) {
+        return TRUE;
+    }
+
+    return FALSE;
+}
+
+int use_direct(const int fd)
+{
+    file_details_t *details=NULL;
+
+    details = open_file_map[fd];
+    if (details->type == WRITE_DIRECT) {
+        return TRUE;
+    }
+
+    return FALSE;
+}
+
+int getTypeSize(
+        enum ADIOS_DATATYPES type,
+        void *val)
+{
+    switch (type)
+    {
+    case adios_byte:
+    case adios_unsigned_byte:
+        return 1;
+
+    case adios_string:
+        return strlen ((char *) val);
+
+    case adios_short:
+    case adios_unsigned_short:
+        return 2;
+
+    case adios_integer:
+    case adios_unsigned_integer:
+        return 4;
+
+    case adios_real:
+        return 4;
+
+    case adios_long:
+    case adios_unsigned_long:
+        return 8;
+
+    case adios_double:
+        return 8;
+
+    case adios_long_double:
+        return 16;
+
+    case adios_complex:
+        return 2 * 4;
+
+    case adios_double_complex:
+        return 2 * 8;
+
+    default:
+        return -1;
+    }
+}
+
+void add_file(const int fd,
+            const write_type write_type)
+{
+    file_details_t *details=NULL;
+
+    details = open_file_map[fd];
+    if (details == NULL) {
+        details=new_open_file(fd);
+        open_file_map[fd]=details;
+    }
+
+    details->type = write_type;
+}
+
+void add_chunk(aggregation_chunk_details_t *chunk_details)
+{
+    file_details_t  *file_details=NULL;
+
+    if (DEBUG > 3) printf("adding chunk: fd(%d) var_name(%s)\n", chunk_details->fd, chunk_details->var_name);
+
+    chunk_details->atype_size = getTypeSize(chunk_details->atype, chunk_details->buf);
+    if ((chunk_details->len > 0) && (chunk_details->num_elements > 0)) {
+        if ((chunk_details->len/chunk_details->num_elements) != chunk_details->atype_size) {
+            printf("datatype size conflict: (%lu/%d)==%lu is not equal to %d\n",
+                    chunk_details->len, chunk_details->num_elements, chunk_details->len/chunk_details->num_elements, chunk_details->atype_size);
+            print_chunk(chunk_details);
+        }
+    }
+
+    file_details = open_file_map[chunk_details->fd];
+    if (file_details == NULL) {
+        printf("failed to add chunk.  cannot aggregate.\n");
+        return;
+    }
+    per_var_details_t *var_details = file_details->vars[chunk_details->var_name];
+    if (var_details == NULL) {
+//        if (DEBUG > 3) printf("var_details don't exist for %s\n", chunk_details->var_name);
+        var_details=new per_var_details_t;
+        strcpy(var_details->var_path, chunk_details->var_path);
+        strcpy(var_details->var_name, chunk_details->var_name);
+        var_details->chunks = new chunks_t;
+        var_details->chunks_received=0;
+        file_details->vars[chunk_details->var_name]=var_details;
+    } else {
+//        if (DEBUG > 3) printf("var_details already exist for %s\n", chunk_details->var_name);
+    }
+    aggregation_chunk_t *chunk=new aggregation_chunk_t;
+    chunk->details = chunk_details;
+    var_details->chunks->push_back(chunk);
+    var_details->chunks_received++;
+
+    return;
+}
+
+void destroy_chunk(aggregation_chunk_details_t *details)
+{
+    free(details->offset);
+    free(details->count);
+    for (int i=0;i<details->ndims;i++) {
+        free(details->offset_path[i]);
+        free(details->offset_name[i]);
+        free(details->count_path[i]);
+        free(details->count_name[i]);
+    }
+    free(details->offset_path);
+    free(details->offset_name);
+    free(details->count_path);
+    free(details->count_name);
+//    if (DEBUG > 3) printf("freeing details->buf(%p)\n", details->buf);
+    free(details->buf);
+    delete details;
+}
+
+void cleanup_aggregation_chunks(const int fd)
+{
+    file_details_t  *details=NULL;
+    var_map_iterator_t var_iter;
+    per_var_details_t *var_details=NULL;
+    aggregation_chunk_t *chunk=NULL;
+    chunks_iterator_t chunks_iter;
+    chunk_details_iterator_t component_iter;
+
+//    if (DEBUG > 3) printf("entered cleanup_aggregation_chunks\n");
+//    if (DEBUG > 3) printf("cleaning up - fd(%d)\n", fd);
+
+    details = open_file_map[fd];
+    if (details == NULL) {
+        return;
+    }
+//    var_iter = details->vars.begin();
+//    for (; var_iter != details->vars.end(); ++var_iter) {
+//        var_details = var_iter->second;
+//        if (var_details != NULL) {
+//            if (DEBUG > 3) printf("var_details first(%p) second(%s)\n", var_iter->first, var_details->var_name);
+//        } else {
+//            if (DEBUG > 3) printf("var_details is NULL\n");
+//        }
+//    }
+    var_iter = details->vars.begin();
+    for (; var_iter != details->vars.end();) {
+        var_details = var_iter->second;
+        if (var_details != NULL) {
+//            cleanup_aggregation_chunks(fd, var_details->var_name);
+            chunks_iter = var_details->chunks->begin();
+            for (;chunks_iter != var_details->chunks->end(); ++chunks_iter) {
+                chunk = *chunks_iter;
+                component_iter = chunk->component_chunks.begin();
+                for (;component_iter != chunk->component_chunks.end(); ++component_iter) {
+//                    if (DEBUG > 3) printf("cleanup - destroying component\n");
+                    destroy_chunk(*component_iter);
+                }
+                chunk->component_chunks.clear();
+//                if (DEBUG > 3) printf("cleanup - destroying details\n");
+                destroy_chunk(chunk->details);
+                delete chunk;
+            }
+            var_details->chunks->clear();
+            var_details->chunks_received=0;
+            delete var_details;
+        } else {
+//            if (DEBUG > 3) printf("cannot cleanup - var_details is NULL\n");
+        }
+        details->vars.erase(var_iter++);
+    }
+//    details->vars.clear();
+
+    for(var_map_iterator_t vars_iter=details->vars.begin(); vars_iter!=details->vars.end(); ++vars_iter) {
+        per_var_details_t *pvd=vars_iter->second;
+        if (pvd != NULL) {
+            if (DEBUG > 3) printf("var_details first(%p) second(%s)\n", vars_iter->first, vars_iter->second->var_name);
+        } else {
+            if (DEBUG > 3) printf("var_details is NULL\n");
+        }
+    }
+}
+
+void cleanup_aggregation_chunks(const int fd, const char *var_name)
+{
+    file_details_t  *details=NULL;
+    aggregation_chunk_t *chunk=NULL;
+    chunks_iterator_t chunks_iter;
+    chunk_details_iterator_t component_iter;
+    var_map_iterator_t vars_iter;
+
+//    if (DEBUG > 3) printf("cleaning up - fd(%d) var_name(%s)\n", fd, var_name);
+
+    // for each variable, iterate over the chunks and destroy them
+
+    details = open_file_map[fd];
+
+    per_var_details_t *var_details = details->vars[var_name];
+    if (var_details != NULL) {
+        chunks_iter = var_details->chunks->begin();
+        for (;chunks_iter != var_details->chunks->end(); ++chunks_iter) {
+            chunk = *chunks_iter;
+            component_iter = chunk->component_chunks.begin();
+            for (;component_iter != chunk->component_chunks.end(); ++component_iter) {
+//                if (DEBUG > 3) printf("cleanup - destroying component\n");
+                destroy_chunk(*component_iter);
+            }
+            chunk->component_chunks.clear();
+//            if (DEBUG > 3) printf("cleanup - destroying details\n");
+            destroy_chunk(chunk->details);
+            delete chunk;
+        }
+        var_details->chunks->clear();
+        var_details->chunks_received=0;
+        delete var_details;
+    } else {
+//        if (DEBUG > 3) printf("cleanup failed - var_details is NULL (%s)\n", var_name);
+    }
+
+    var_map_iterator_t iter=details->vars.find(var_name);
+    if (iter != details->vars.end()) {
+//        if (DEBUG > 3) printf("erasing var_details with iter\n");
+        details->vars.erase(iter);
+    } else {
+//        if (DEBUG > 3) printf("cannot erase var_details with iter.  var_details not found.\n");
+    }
+
+}
+
+static void recursive_print_chunk(aggregation_chunk_details_t *details, int offset, int *index, int current_dim)
+{
+    int my_offset=0;
+    char tmp_str[20];
+    char out_str[1024];
+    int remaining=1023;
+
+    if (current_dim < details->ndims-1) {
+        for (int i=0;i<details->count[current_dim];i++) {
+            my_offset = index[current_dim];
+            for (int i=current_dim+1;i<details->ndims;i++) {
+                my_offset *= details->count[i];
+            }
+
+            index[current_dim+1]=0;
+            recursive_print_chunk(details, offset+my_offset, index, current_dim+1);
+            index[current_dim] += details->atype_size;
+        }
+        //if (DEBUG > 3) printf("-----------------------------\n");
+    } else {
+        if (details->buf == NULL) {
+            if (DEBUG > 3) printf("details->buf == NULL\n");
+        } else {
+            out_str[0]='\0';
+            for (int i=0;i<details->count[current_dim];i++) {
+                my_offset = offset+index[current_dim];
+
+//                if (i==0) if (DEBUG > 3) printf("[%d][%d][%d] (my_offset==%d)\n", index[0], index[1], index[2], my_offset);
+                if ((details->atype == adios_byte) || (details->atype == adios_unsigned_byte)) {
+                    sprintf(tmp_str, "%c, ", *(char *)(((char *)details->buf) + my_offset));
+                }
+                else if (details->atype == adios_short || details->atype == adios_unsigned_short) {
+                    sprintf(tmp_str, "%hx, ", *(short *)(((char *)details->buf) + my_offset));
+                }
+                else if (details->atype == adios_integer || details->atype == adios_unsigned_integer) {
+                    sprintf(tmp_str, "%x, ", *(int *)(((char *)details->buf) + my_offset));
+                }
+                else if (details->atype == adios_long || details->atype == adios_unsigned_long) {
+                    sprintf(tmp_str, "%lx, ", *(int *)(((char *)details->buf) + my_offset));
+                }
+                else if (details->atype == adios_real) {
+                    sprintf(tmp_str, "%f, ", *(float *)(((char *)details->buf) + my_offset));
+                }
+                else if (details->atype == adios_double) {
+                    sprintf(tmp_str, "%f, ", *(double *)(((char *)details->buf) + my_offset));
+                }
+                strncat(out_str, tmp_str, remaining);
+                remaining -= strlen(out_str);
+
+                index[current_dim] += details->atype_size;
+            }
+//            if (DEBUG > 3) printf("[%d][%d][%d] (my_offset==%d)\n", index[0], index[1], index[2], my_offset);
+            if (DEBUG > 3) printf("%s\n", out_str);
+        }
+    }
+}
+
+void print_chunk(aggregation_chunk_details_t *details)
+{
+    int *index=(int *)calloc(details->ndims, sizeof(int));
+    char tmp_str[20];
+    char out_str[1024];
+    int remaining=1023;
+
+    if (DEBUG > 3) printf("+++++++++++++++++++++++++++++\n");
+
+    if (DEBUG > 3) printf("fd==%d\n", details->fd);
+    if (DEBUG > 3) printf("var_path==%s\n", details->var_path);
+    if (DEBUG > 3) printf("var_name==%s\n", details->var_name);
+    if (DEBUG > 3) printf("ndims==%d\n", details->ndims);
+    if (DEBUG > 3) printf("len==%ld\n", details->len);
+    if (DEBUG > 3) printf("num_elements==%d\n", details->num_elements);
+    out_str[0]='\0';
+    remaining=1023;
+    for (int i=0;(i<details->ndims) && (remaining>0);i++) {
+        sprintf(tmp_str, "%ld,", details->offset[i]);
+        strncat(out_str, tmp_str, remaining);
+        remaining -= strlen(tmp_str);
+    }
+    if (DEBUG > 3) printf("offset[]==%s\n", out_str);
+    out_str[0]='\0';
+    remaining=1023;
+    for (int i=0;(i<details->ndims) && (remaining>0);i++) {
+        sprintf(tmp_str, "%ld,", details->count[i]);
+        strncat(out_str, tmp_str, remaining);
+        remaining -= strlen(tmp_str);
+    }
+    if (DEBUG > 3) printf("count[]==%s\n", out_str);
+    if (DEBUG > 3) printf("buf==%p\n", details->buf);
+
+//    int offset=0;
+//    int current_dim=0;
+//    recursive_print_chunk(details, offset, index, current_dim);
+    if (DEBUG > 3) printf("+++++++++++++++++++++++++++++\n");
+
+    free(index);
+}
+
+void print_chunk(aggregation_chunk_t *c)
+{
+    if (c->details == NULL) {
+        if (DEBUG > 3) printf("chunk has no details.  perhaps it was aggregated into another chunk.\n");
+        return;
+    }
+    print_chunk(c->details);
+}
+
+static void recursive_copy_chunk(aggregation_chunk_details_t *src,
+                                 aggregation_chunk_details_t *dst,
+                                 int src_offset,
+                                 int dst_offset,
+                                 int *src_index,
+                                 int *dst_index,
+                                 int current_dim)
+{
+    int my_src_offset=0;
+    int my_dst_offset=0;
+
+    if (current_dim < src->ndims-1) {
+        for (int i=0;i<src->count[current_dim];i++) {
+            my_src_offset = src_index[current_dim];
+            my_dst_offset = dst_index[current_dim];
+//            if (DEBUG > 3) printf("join_offset(%d) offset_diff[%d](%d)\n",
+//                    join_offset, current_dim, src->offset[current_dim] - dst->offset[current_dim]);
+            my_dst_offset += ((src->offset[current_dim] - dst->offset[current_dim]) * src->atype_size);
+            for (int j=current_dim+1;j<src->ndims;j++) {
+                my_src_offset *= src->count[j];
+                my_dst_offset *= dst->count[j];
+            }
+
+            src_index[current_dim+1]=0;
+            dst_index[current_dim+1]=0;
+            recursive_copy_chunk(src, dst, src_offset+my_src_offset, dst_offset+my_dst_offset,
+                                 src_index, dst_index, current_dim+1);
+            src_index[current_dim] += src->atype_size;
+            dst_index[current_dim] += dst->atype_size;
+        }
+    } else {
+        dst_offset += ((src->offset[current_dim] - dst->offset[current_dim]) * src->atype_size);
+        memcpy(((char *)dst->buf) + dst_offset,
+               ((char *)src->buf) + src_offset,
+               src->count[current_dim]*src->atype_size);
+    }
+}
+
+static void recursive_aggregate_chunks(aggregation_chunk_t *src1,
+                                       aggregation_chunk_t *src2,
+                                       aggregation_chunk_t *dst)
+{
+    int *src_index=(int *)calloc(src1->details->ndims, sizeof(int));
+    int *dst_index=(int *)calloc(dst->details->ndims, sizeof(int));
+    int src_offset=0;
+    int dst_offset=0;
+    int current_dim=0;
+
+    memset(src_index, 0, src1->details->ndims*sizeof(int));
+    memset(dst_index, 0, dst->details->ndims*sizeof(int));
+    recursive_copy_chunk(src1->details, dst->details, src_offset, dst_offset, src_index, dst_index, current_dim);
+    memset(src_index, 0, src2->details->ndims*sizeof(int));
+    memset(dst_index, 0, dst->details->ndims*sizeof(int));
+    recursive_copy_chunk(src2->details, dst->details, src_offset, dst_offset, src_index, dst_index, current_dim);
+
+    free(src_index);
+    free(dst_index);
+}
+
+static void copy_chunk(aggregation_chunk_details_t *src,
+                       aggregation_chunk_details_t *dst)
+{
+    int *src_index=(int *)calloc(src->ndims, sizeof(int));
+    int *dst_index=(int *)calloc(dst->ndims, sizeof(int));
+    int src_offset=0;
+    int dst_offset=0;
+    int current_dim=0;
+
+    memset(src_index, 0, src->ndims*sizeof(int));
+    memset(dst_index, 0, dst->ndims*sizeof(int));
+    recursive_copy_chunk(src, dst, src_offset, dst_offset, src_index, dst_index, current_dim);
+
+    free(src_index);
+    free(dst_index);
+}
+
+aggregation_chunk_t *aggregate_chunks(aggregation_chunk_t *c1,
+                                      aggregation_chunk_t *c2,
+                                      int join_dim)
+{
+    aggregation_chunk_t *out=new aggregation_chunk_t;
+
+    //if (DEBUG > 3) printf("entered aggregate_chunks\n");
+
+    assert(c1->details->ndims == c2->details->ndims);
+    assert(out != NULL);
+
+    out->details = new aggregation_chunk_details_t;
+
+    out->details->fd           = c1->details->fd;
+    strcpy(out->details->var_path, c1->details->var_path);
+    strcpy(out->details->var_name, c1->details->var_name);
+    out->details->ndims        = c1->details->ndims;
+//    out->details->buf          = calloc(c1->details->len+c2->details->len, c1->details->atype_size);
+    out->details->buf          = NULL;
+    out->details->atype        = c1->details->atype;
+    out->details->len          = c1->details->len+c2->details->len;
+    out->details->atype     = c1->details->atype;
+    out->details->num_elements = c1->details->num_elements+c2->details->num_elements;
+    out->details->atype_size   = c1->details->atype_size;
+    out->details->offset_path  = (char **)calloc(c1->details->ndims, sizeof(char *));
+    out->details->offset_name  = (char **)calloc(c1->details->ndims, sizeof(char *));
+    out->details->offset       = (uint64_t *)calloc(c1->details->ndims, sizeof(uint64_t));
+    out->details->count_path   = (char **)calloc(c1->details->ndims, sizeof(char *));
+    out->details->count_name   = (char **)calloc(c1->details->ndims, sizeof(char *));
+    out->details->count        = (uint64_t *)calloc(c1->details->ndims, sizeof(uint64_t));
+
+    for (int i=0;i<c1->details->ndims;i++) {
+        out->details->offset_path[i]  = strdup(c1->details->offset_path[i]);
+        out->details->offset_name[i]  = strdup(c1->details->offset_name[i]);
+        out->details->count_path[i]   = strdup(c1->details->count_path[i]);
+        out->details->count_name[i]   = strdup(c1->details->count_name[i]);
+    }
+    memcpy(out->details->offset, c1->details->offset, c1->details->ndims*sizeof(uint64_t));
+    memcpy(out->details->count, c1->details->count, c1->details->ndims*sizeof(uint64_t));
+    out->details->count[join_dim] += c2->details->count[join_dim];
+
+//    recursive_aggregate_chunks(c1, c2, out);
+
+    if (c1->component_chunks.size() > 0) {
+        out->component_chunks.merge(c1->component_chunks);
+        c1->component_chunks.clear();
+        destroy_chunk(c1->details);
+    } else {
+        out->component_chunks.push_back(c1->details);
+    }
+    c1->details = NULL;
+    if (c2->component_chunks.size() > 0) {
+        out->component_chunks.merge(c2->component_chunks);
+        c2->component_chunks.clear();
+        destroy_chunk(c2->details);
+    } else {
+        out->component_chunks.push_back(c2->details);
+    }
+    c2->details = NULL;
+
+    assert(out != NULL);
+
+    //if (DEBUG > 3) printf("finished\n");
+
+    return(out);
+}
+
+/*
+ * Aggregate a particular variable in the file.
+ *
+ * Aggregation rules:
+ *  - dimension count must be equal
+ *  - strides must be equal
+ *  - counts on matching faces must be equal
+ *  -
+ *
+ */
+int try_aggregation(const int fd, const char *var_name)
+{
+    int aggregation_success=FALSE;
+
+    file_details_t  *file_details=NULL;
+    per_var_details_t *var_details=NULL;
+    aggregation_chunk_t *base_chunk=NULL;
+    aggregation_chunk_t *candidate_chunk=NULL;
+    aggregation_chunk_t *new_chunk=NULL;
+    chunks_iterator_t base_iter, candidate_iter;
+    int *offset_diff;
+    chunk_location_count_t chunk_location_count;
+    int dim_with_movement=-1;
+
+    chunks_t agg_chunks;
+
+    int failed=FALSE;
+
+    file_details = open_file_map[fd];
+    if (file_details == NULL) {
+//        if (DEBUG > 3) printf("agg failed for %s: file_details==NULL\n", var_name);
+        return(aggregation_success);
+    }
+    var_details = file_details->vars[var_name];
+    if (var_details == NULL) {
+//        if (DEBUG > 3) printf("agg failed for %s: var_details==NULL\n", var_name);
+        return(aggregation_success);
+    }
+    if (var_details->chunks->size() < 2) {
+//        if (DEBUG > 3) printf("returning with chunk count(%d)\n", var_details->chunks->size());
+        return(aggregation_success);
+    }
+    if (DEBUG > 3) printf("chunk count(%d)\n", var_details->chunks->size());
+
+
+    if (DEBUG > 3) printf("trying aggregation - fd(%d) var_name(%s)\n", fd, var_name);
+
+    var_details->chunks->sort(compare_chunks_for_aggregation);
+
+    if (DEBUG > 4) {
+        printf("*****************\n");
+        printf("start aggregation (begin list)\n");
+        printf("*****************\n");
+        int chunk_count;
+        aggregation_chunk_details_t **chunks = get_chunks(fd, var_name, &chunk_count);
+        for (int i=0;i<chunk_count;i++) {
+            print_chunk(chunks[i]);
+        }
+        free(chunks);
+        printf("*****************\n");
+        printf("start aggregation (end list)\n");
+        printf("*****************\n");
+    }
+
+    int success_this_pass=TRUE;
+    while (success_this_pass==TRUE) {
+        success_this_pass=FALSE;
+
+//        if (DEBUG > 3) printf("top: while loop\n");
+
+
+        base_iter = var_details->chunks->begin();
+        base_chunk = *base_iter;
+        offset_diff=new int[base_chunk->details->ndims];
+        for (;base_iter != var_details->chunks->end(); ++base_iter) {
+//            if (DEBUG > 3) printf("top: base_iter loop\n");
+
+            base_chunk = *base_iter;
+
+            //if (base_chunk != NULL)      print_chunk(base_chunk);
+
+            // look for a chunk that can be aggregated to the base chunk
+            candidate_iter = base_iter;
+            candidate_iter++;
+            for (;candidate_iter != var_details->chunks->end(); ++candidate_iter) {
+//                if (DEBUG > 3) printf("top: candidate_iter loop\n");
+
+                candidate_chunk = *candidate_iter;
+
+                //if (candidate_chunk != NULL) print_chunk(candidate_chunk);
+
+                failed=FALSE;
+
+                if (base_chunk->details->ndims != candidate_chunk->details->ndims) {
+                    continue;
+                }
+//                if (candidate_chunk->details->offset[0] != base_chunk->details->offset[0]) {
+//                    continue;
+//                }
+                for (int i=0; i<base_chunk->details->ndims; i++) {
+                    offset_diff[i] = candidate_chunk->details->offset[i] - base_chunk->details->offset[i];
+                }
+                if (failed) continue;
+
+                chunk_location_count.ahead_count=0;
+                chunk_location_count.behind_count=0;
+                chunk_location_count.same_count=0;
+                chunk_location_count.no_match_count=0;
+                int agg_dims=base_chunk->details->ndims; /* the number of dimensions to aggregate */
+                for (int i=0; i<agg_dims; i++) {
+                    if ((offset_diff[i] < 0) && (-offset_diff[i] == candidate_chunk->details->count[i])) {
+                        // the candidate is "behind/below" and touching the base chunk in this dimension
+                        chunk_location_count.behind_count++;
+                        dim_with_movement=i;
+                    } else if ((offset_diff[i] > 0) && (offset_diff[i] == base_chunk->details->count[i])) {
+                        // the candidate is "ahead of/above" and touching the base chunk in this dimension
+                        chunk_location_count.ahead_count++;
+                        dim_with_movement=i;
+                    } else if (offset_diff[i] == 0) {
+                        // the candidate is "equal to" the base chunk in this dimension
+                        chunk_location_count.same_count++;
+                    } else {
+                        // the candidate and the base chunk don't match in this dimension
+                        chunk_location_count.no_match_count++;
+                    }
+                }
+
+#ifdef DEBUG
+                /*
+                 * These tests can be interesting, but are not required to get the job done.
+                 */
+                if (chunk_location_count.no_match_count > 0) {
+                    // no matching face found.  can't aggregate.
+                    continue;
+                }
+
+                if (chunk_location_count.same_count == base_chunk->ndims) {
+                    // base and candidate have same offset.  bad?  can't aggregate.
+                    continue;
+                }
+
+                if (chunk_location_count.ahead_count > 1) {
+                    // movement in more than one direction
+                    continue;
+                }
+                if (chunk_location_count.behind_count > 1) {
+                    // movement in more than one direction
+                    continue;
+                }
+                if ((chunk_location_count.ahead_count > 0)  &&
+                        (chunk_location_count.behind_count > 0)) {
+                    // movement in more than one direction
+                    continue;
+                }
+
+                if ((chunk_location_count.ahead_count == 0)  &&
+                        (chunk_location_count.behind_count == 0)) {
+                    // possible movement, but the chunks don't touch
+                    continue;
+                }
+#endif
+
+                // check that the matching faces have the same dimensions
+                for (int i=0; i<base_chunk->details->ndims; i++) {
+                    if ((i != dim_with_movement) &&
+                        (base_chunk->details->count[i] != candidate_chunk->details->count[i])) {
+                        failed=TRUE;
+                        break;
+                    }
+                }
+                if (failed) continue;
+
+                /*
+                 * Do NOT uncomment these print_chunk() lines in production code.
+                 * They are *very* slow even if the debug level is set low and
+                 * nothing is being logged.
+                 */
+//                netcdf_debug_level=LOG_ALL;
+//                if (DEBUG > 3) printf("*****************\n");
+//                if (DEBUG > 3) printf("base chunk\n");
+//                if (DEBUG > 3) printf("*****************\n");
+//                if (base_chunk != NULL)      print_chunk(base_chunk);
+//                if (DEBUG > 3) printf("*****************\n");
+//                if (DEBUG > 3) printf("candidate chunk\n");
+//                if (DEBUG > 3) printf("*****************\n");
+//                if (candidate_chunk != NULL) print_chunk(candidate_chunk);
+//                netcdf_debug_level=old;
+
+                if ((chunk_location_count.ahead_count == 1)  &&
+                        (chunk_location_count.behind_count == 0) &&
+                        (chunk_location_count.same_count == agg_dims-1)) {
+                    // aggregation is base + candidate
+                    new_chunk = aggregate_chunks(base_chunk, candidate_chunk, dim_with_movement);
+                } else if ((chunk_location_count.ahead_count == 0)  &&
+                        (chunk_location_count.behind_count == 1) &&
+                        (chunk_location_count.same_count == agg_dims-1)) {
+                    // aggregation is candidate + base
+                    new_chunk = aggregate_chunks(candidate_chunk, base_chunk, dim_with_movement);
+                } else {
+                    // chunks aren't aligned
+                    //if (DEBUG > 3) printf("**********\nchunks are not aligned\n**********\n");
+                    continue;
+                }
+
+                assert(new_chunk != NULL);
+
+                /*
+                 * Do NOT uncomment these print_chunk() lines in production code.
+                 * They are *very* slow even if the debug level is set low and
+                 * nothing is being logged.
+                 */
+//                netcdf_debug_level=LOG_ALL;
+//                if (DEBUG > 3) printf("*****************\n");
+//                if (DEBUG > 3) printf("new chunk\n");
+//                if (DEBUG > 3) printf("*****************\n");
+//                if (new_chunk != NULL)       print_chunk(new_chunk);
+//                netcdf_debug_level=old;
+
+                var_details->chunks->remove(base_chunk);
+                var_details->chunks->remove(candidate_chunk);
+                delete base_chunk;
+                delete candidate_chunk;
+
+                agg_chunks.push_back(new_chunk);
+
+                aggregation_success = TRUE;
+                success_this_pass = TRUE;
+
+                break;
+            }
+            if (success_this_pass == TRUE) break;
+        }
+        chunks_iterator_t agg_iter = agg_chunks.begin();
+        for (;agg_iter != agg_chunks.end();agg_iter++) {
+            var_details->chunks->push_back(*agg_iter);
+        }
+        agg_chunks.clear();
+
+        delete[] offset_diff;
+    }
+
+    if (DEBUG > 4) {
+        printf("*****************\n");
+        printf("end aggregation (begin list)\n");
+        printf("*****************\n");
+        int chunk_count;
+        aggregation_chunk_details_t **chunks = get_chunks(fd, var_name, &chunk_count);
+        for (int i=0;i<chunk_count;i++) {
+            print_chunk(chunks[i]);
+        }
+        free(chunks);
+        printf("*****************\n");
+        printf("end aggregation (end list)\n");
+        printf("*****************\n");
+    }
+
+//    netcdf_debug_level=LOG_ALL;
+    chunks_iterator_t dst_iter=var_details->chunks->begin();
+    for(;dst_iter != var_details->chunks->end();dst_iter++) {
+        chunk_details_iterator_t component_iter=(*dst_iter)->component_chunks.begin();
+        if (((*dst_iter)->details->buf == NULL) && ((*dst_iter)->details->len > 0)) {
+            (*dst_iter)->details->buf = (char *)malloc((*dst_iter)->details->len);
+//            if (DEBUG > 3) printf("allocated dst_iter->details->buf(%p), len(%ld)\n",
+//                    (*dst_iter)->details->buf,
+//                    (*dst_iter)->details->len);
+        } else {
+//            if (DEBUG > 3) printf("did not allocate dst_iter->details->buf(%p)\n", (*dst_iter)->details->buf);
+        }
+        for(;component_iter != (*dst_iter)->component_chunks.end();component_iter++) {
+            //if (DEBUG > 3) printf("copying component\n");
+            copy_chunk(*component_iter, (*dst_iter)->details);
+            //if (DEBUG > 3) printf("destroying component\n");
+            destroy_chunk(*component_iter);
+        }
+        (*dst_iter)->component_chunks.clear();
+    }
+//    netcdf_debug_level=old;
+
+//    netcdf_debug_level=LOG_ALL;
+    //if (DEBUG > 3) printf("*****************\n");
+    //if (DEBUG > 3) printf("chunks after aggregation\n");
+    //if (DEBUG > 3) printf("*****************\n");
+//    base_iter = var_details->chunks->begin();
+//    for (;base_iter != var_details->chunks->end(); ++base_iter) {
+//        base_chunk = *base_iter;
+//        if (base_chunk != NULL)
+//            print_chunk(base_chunk);
+//    }
+//    netcdf_debug_level=old;
+
+    return(aggregation_success);
+}
+
+/*
+ * Aggregate all variables in the file.
+ *
+ */
+int try_aggregation(const int fd)
+{
+    int aggregation_success=FALSE;
+
+    file_details_t    *file_details=NULL;
+    var_map_iterator_t var_iter;
+    per_var_details_t *var_details=NULL;
+
+    if (DEBUG > 3) printf("entered try_aggregation - fd(%d)\n", fd);
+
+    file_details = open_file_map[fd];
+    if (file_details == NULL) {
+        return(aggregation_success);
+    }
+    var_iter = file_details->vars.begin();
+    for (; var_iter != file_details->vars.end(); var_iter++) {
+        var_details = var_iter->second;
+        if (var_details == NULL) {
+//            if (DEBUG > 3) printf("var_details==NULL.  continuing\n");
+            continue;
+        } else {
+//            if (DEBUG > 3) printf("aggregating var_name(%s)\n", var_details->var_name);
+            while(try_aggregation(fd, var_details->var_name) == TRUE);
+        }
+    }
+
+    aggregation_success = TRUE;
+
+    return(aggregation_success);
+}
+
+int aggregate_data_ready_to_write(const int fd, const char *var_name)
+{
+//    file_details_t *details = open_file_map[fd];
+//    int chunks_needed=0;
+
+//    if (details->num_participants > 0) {
+//        chunks_needed = details->num_participants;
+//    } else {
+//        chunks_needed = details->participants->size();
+//    }
+//
+//    if (details->vars[var_name]->chunks_received == chunks_needed) {
+//        return TRUE;
+//    }
+
+    return FALSE;
+}
+
+int cache_data_ready_to_write(const int fd, const char *var_name)
+{
+//    file_details_t *details = open_file_map[fd];
+//    int chunks_needed=0;
+
+//    if (details->num_participants > 0) {
+//        chunks_needed = details->num_participants;
+//    } else {
+//        chunks_needed = details->participants->size();
+//    }
+//
+//    if (details->vars[var_name]->chunks_received == chunks_needed) {
+//        return TRUE;
+//    }
+
+    return FALSE;
+}
+
+aggregation_chunk_details_t **get_chunks(const int fd, const char *var_name, int *chunk_count)
+{
+    file_details_t *details=NULL;
+    per_var_details_t *var_details=NULL;
+    aggregation_chunk_details_t **chunks=NULL;
+    chunks_iterator_t iter;
+
+    if (DEBUG > 3) printf("entered get_chunks - fd(%d) var_name(%s)\n", fd, var_name);
+
+    *chunk_count=0;
+
+    details = open_file_map[fd];
+    if (details == NULL) {
+        return(NULL);
+    }
+    var_details = details->vars[var_name];
+    if (var_details == NULL) {
+        return(NULL);
+    }
+
+    *chunk_count = details->vars[var_name]->chunks->size();
+
+    if (DEBUG > 3) printf("found %d chunks to return\n", *chunk_count);
+
+    if (*chunk_count == 0) {
+        return(NULL);
+    }
+    chunks = (aggregation_chunk_details_t **)malloc(*chunk_count*sizeof(aggregation_chunk_details_t *));
+
+    var_details->chunks->sort(compare_chunks_for_caching);
+
+    iter = var_details->chunks->begin();
+    for (int i=0;iter != var_details->chunks->end(); ++iter,i++) {
+        chunks[i] = (*iter)->details;
+//        print_chunk(chunks[i]);
+    }
+
+    //if (DEBUG > 3) printf("finished\n");
+
+    return(chunks);
+}
+
+aggregation_chunk_details_t **get_chunks(const int fd, int *chunk_count)
+{
+    file_details_t  *details=NULL;
+    var_map_iterator_t var_iter;
+    per_var_details_t *var_details=NULL;
+    aggregation_chunk_details_t **chunks=NULL;
+    chunks_iterator_t chunks_iter;
+
+    if (DEBUG > 3) printf("entered get_chunks - fd(%d)\n", fd);
+
+    *chunk_count=0;
+
+    details = open_file_map[fd];
+    if (details == NULL) {
+        return(NULL);
+    }
+    var_iter = details->vars.begin();
+    for (; var_iter != details->vars.end(); ++var_iter) {
+        var_details = var_iter->second;
+        *chunk_count += var_details->chunks->size();
+    }
+
+    if (DEBUG > 3) printf("found %d chunks to return\n", *chunk_count);
+
+    if (*chunk_count == 0) {
+        return(NULL);
+    }
+    chunks = (aggregation_chunk_details_t **)malloc(*chunk_count*sizeof(aggregation_chunk_details_t *));
+
+    int i=0;
+    var_iter = details->vars.begin();
+    for (; var_iter != details->vars.end(); var_iter++) {
+        var_details = var_iter->second;
+        var_details->chunks->sort(compare_chunks_for_caching);
+        chunks_iter = var_details->chunks->begin();
+        for (;chunks_iter != var_details->chunks->end(); ++chunks_iter,i++) {
+            chunks[i] = (*chunks_iter)->details;
+//            print_chunk(chunks[i]);
+        }
+    }
+
+    //if (DEBUG > 3) printf("finished\n");
+
+    return(chunks);
+}
diff --git a/src/aggregation.h b/src/aggregation.h
new file mode 100644
index 0000000..4c25a2c
--- /dev/null
+++ b/src/aggregation.h
@@ -0,0 +1,58 @@
+/*
+ * aggregation.h
+ *
+ *  Created on: Mar 9, 2009
+ *      Author: thkorde
+ */
+
+#ifndef AGGREGATION_H_
+#define AGGREGATION_H_
+
+//#include "adios.h"
+#include "adios_types.h"
+//#include "adios_internals.h"
+
+#include "adios_nssi_args.h"
+
+struct aggregation_chunk_details_t {
+    int  fd;
+    char var_path[ADIOS_PATH_MAX];
+    char var_name[ADIOS_PATH_MAX];
+    int  ndims;
+
+    void     *buf;          /* the data */
+    uint64_t  len;          /* length of buf in bytes */
+    int       num_elements; /* number of datatype elements in buf (len/atype_size) */
+
+    enum ADIOS_DATATYPES atype; /* adios type of data in buf*/
+    int                  atype_size;
+
+    char    **offset_path;
+    char    **offset_name;
+    uint64_t *offset;     /* starting corner (eg. 0,0,0 is the origin of a cube) */
+    char    **count_path;
+    char    **count_name;
+    uint64_t *count;      /* num elements in each dimension (eg. 3,3,3 is a cube of size 3) */
+};
+typedef struct aggregation_chunk_details_t aggregation_chunk_details_t;
+
+int use_aggregation(const int fd);
+int use_caching(const int fd);
+int use_collective(const int fd);
+int use_independent(const int fd);
+int use_direct(const int fd);
+void add_file(const int fd, const write_type write_type);
+void add_chunk(aggregation_chunk_details_t *chunk);
+void cleanup_aggregation_chunks(const int fd);
+void cleanup_aggregation_chunks(const int fd, const char *var_name);
+int try_aggregation(const int fd);
+int try_aggregation(const int fd, const char *var_name);
+int aggregate_data_ready_to_write(const int fd, const char *var_name);
+int cache_data_ready_to_write(const int fd, const char *var_name);
+aggregation_chunk_details_t **get_chunks(const int fd, int *chunk_count);
+aggregation_chunk_details_t **get_chunks(const int fd, const char *var_name, int *chunk_count);
+void print_chunk(aggregation_chunk_details_t *c);
+
+
+
+#endif /* AGGREGATION_H_ */
diff --git a/src/bp_types.h b/src/bp_types.h
new file mode 100644
index 0000000..3bacf82
--- /dev/null
+++ b/src/bp_types.h
@@ -0,0 +1,90 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#ifndef __BP_TYPES_H__
+#define __BP_TYPES_H__
+
+#include "adios_bp_v1.h"
+#include "adios_types.h"
+
+#define BP_MAX_RANK 32
+#define BP_MAX_NDIMS (BP_MAX_RANK+1)
+
+struct bp_index_pg_struct_v1
+{   
+    char * group_name;
+    enum ADIOS_FLAG adios_host_language_fortran;
+    uint32_t process_id; 
+    char * time_index_name;
+    uint32_t time_index;
+    uint64_t offset_in_file;
+
+    struct bp_index_pg_struct_v1 * next;
+};
+
+struct bp_minifooter {
+	uint64_t time_steps;  /* = fh->tidx_stop - fh->tidx_start + 1 */
+	uint64_t pgs_count;
+	uint64_t pgs_length;
+	uint16_t vars_count;
+	uint64_t vars_length;
+	uint16_t attrs_count;
+	uint64_t attrs_length;
+	uint64_t pgs_index_offset;
+	uint64_t vars_index_offset;
+	uint64_t attrs_index_offset;
+	uint32_t version;
+	uint32_t change_endianness; // = enum ADIOS_FLAG, 0: unknown!, adios_flag_yes or adios_flag_no
+	uint64_t file_size;
+} __attribute__((__packed__));
+
+struct BP_FILE {
+    MPI_File mpi_fh;
+    MPI_Comm comm;
+    struct adios_bp_buffer_struct_v1 * b;
+    struct bp_index_pg_struct_v1 * pgs_root;
+    struct adios_index_var_struct_v1 * vars_root;
+    struct adios_index_attribute_struct_v1 * attrs_root;
+    struct bp_minifooter mfooter; 
+    struct BP_GROUP_VAR * gvar_h;
+    struct BP_GROUP_ATTR * gattr_h;
+    uint32_t tidx_start;
+    uint32_t tidx_stop;
+};
+
+struct BP_GROUP_VAR {
+	uint16_t group_count;
+	uint16_t group_id; 
+	char ** namelist;
+	uint32_t *** time_index; 
+	uint64_t * pg_offsets;
+	char ** var_namelist;
+	uint16_t * var_counts_per_group;
+	uint64_t ** var_offsets;
+};
+
+struct BP_GROUP_ATTR {
+        uint16_t group_count;
+        uint16_t group_id;
+        char ** namelist;
+        char ** attr_namelist;
+        uint16_t * attr_counts_per_group;
+        uint64_t ** attr_offsets;
+};
+
+struct BP_GROUP {
+	uint16_t group_id;
+	uint16_t vars_offset;
+	uint16_t vars_count;
+        uint16_t attrs_offset;
+        uint16_t attrs_count;
+	struct BP_FILE * fh;
+	struct adios_index_var_struct_v1 * vars_root;  /* pointer into the list of BP_FILE.vars_root */
+        struct adios_index_attribute_struct_v1 * attrs_root;
+};
+
+#endif
diff --git a/src/bp_utils.c b/src/bp_utils.c
new file mode 100644
index 0000000..f70dc44
--- /dev/null
+++ b/src/bp_utils.c
@@ -0,0 +1,1706 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <sys/types.h>
+#include <string.h>
+#include "adios.h"
+#include "bp_utils.h"
+#include "adios_bp_v1.h"
+#include "adios_error.h"
+#include "adios_endianness.h"
+#define BYTE_ALIGN 8
+#define MINIFOOTER_SIZE 28
+
+
+#ifdef DMALLOC
+#include "dmalloc.h"
+#endif
+
+#define BUFREAD8(b,var)  var = (uint8_t) *(b->buff + b->offset); \
+                         b->offset += 1;
+
+#define BUFREAD16(b,var) var = *(uint16_t *) (b->buff + b->offset); \
+                         if (b->change_endianness == adios_flag_yes) \
+                             swap_16(var); \
+                         b->offset += 2;
+
+#define BUFREAD32(b,var) var = *(uint32_t *) (b->buff + b->offset); \
+                         if (b->change_endianness == adios_flag_yes) \
+                             swap_32(var); \
+                         b->offset += 4;
+
+#define BUFREAD64(b,var) var = *(uint64_t *) (b->buff + b->offset); \
+                         if (b->change_endianness == adios_flag_yes) \
+                             swap_64(var); \
+                         b->offset += 8;
+
+/* prototypes */
+void * bp_read_data_from_buffer(struct adios_bp_buffer_struct_v1 *b, enum ADIOS_DATATYPES type);
+int bp_parse_characteristics (struct adios_bp_buffer_struct_v1 * b, struct adios_index_var_struct_v1 ** root, uint64_t j);
+
+
+
+void bp_alloc_aligned (struct adios_bp_buffer_struct_v1 * b, uint64_t size)
+{
+        
+    b->allocated_buff_ptr =  malloc (size + BYTE_ALIGN - 1);
+    if (!b->allocated_buff_ptr)
+    {
+        error( err_no_memory, "Cannot allocate %llu bytes\n", size);
+
+        b->buff = NULL;
+        b->length = 0;
+
+        return;
+    }
+    uint64_t p = (uint64_t) b->allocated_buff_ptr;
+    b->buff = (char *) ((p + BYTE_ALIGN - 1) & ~(BYTE_ALIGN - 1));
+    b->length = size;
+}
+
+void bp_realloc_aligned (struct adios_bp_buffer_struct_v1 * b
+                            ,uint64_t size
+                            )
+{
+    b->allocated_buff_ptr = realloc (b->allocated_buff_ptr
+                                    ,size + BYTE_ALIGN - 1
+                                    );
+    if (!b->allocated_buff_ptr)
+    {
+        error( err_no_memory, "Cannot allocate %llu bytes\n", size);
+
+        b->buff = NULL;
+        b->length = 0;
+
+        return;
+    }
+    uint64_t p = (uint64_t) b->allocated_buff_ptr;
+    b->buff = (char *) ((p + BYTE_ALIGN - 1) & ~(BYTE_ALIGN - 1));
+    b->length = size;
+}
+
+int bp_read_open (const char * filename,
+          MPI_Comm comm,
+          struct BP_FILE * fh)
+{
+    int  err;
+    int  rank;
+
+    MPI_Comm_rank (comm, &rank);
+
+    // variable definition 
+    MPI_Offset  file_size;
+
+    // open a file by the multiple processors within the same
+    // communicator
+    err = MPI_File_open (comm, (char *) filename, MPI_MODE_RDONLY, 
+            MPI_INFO_NULL, &(fh->mpi_fh));
+    if (err != MPI_SUCCESS) {
+        char e [MPI_MAX_ERROR_STRING];
+        int len = 0;
+        memset (e, 0, MPI_MAX_ERROR_STRING);
+        MPI_Error_string (err, e, &len);
+        error(err_MPI_open_error, "MPI open failed for %s: '%s'\n", filename, e);
+        return adios_flag_no;
+    }
+
+    MPI_File_get_size (fh->mpi_fh, &file_size);
+    fh->b->file_size = file_size;
+    fh->mfooter.file_size = file_size;
+     
+    return 0;
+}
+
+int bp_read_minifooter (struct BP_FILE * bp_struct)
+{
+    struct adios_bp_buffer_struct_v1 * b = bp_struct->b;
+    struct bp_minifooter * mh = &bp_struct->mfooter;
+    uint64_t attrs_end = b->file_size - MINIFOOTER_SIZE;
+    uint32_t test = 1;
+    int r;
+
+    MPI_Status status;
+
+    if (!b->buff) {
+        bp_alloc_aligned (b, MINIFOOTER_SIZE);
+        if (!b->buff) {
+            error (err_no_memory, "could not allocate %d bytes\n", MINIFOOTER_SIZE);
+            return 1;
+        }
+        memset (b->buff, 0, MINIFOOTER_SIZE);
+        b->offset = 0;
+    }
+    MPI_File_seek (bp_struct->mpi_fh, (MPI_Offset) attrs_end, MPI_SEEK_SET);
+    MPI_File_read (bp_struct->mpi_fh, b->buff, MINIFOOTER_SIZE, MPI_BYTE, &status);
+    
+    /*memset (&mh->pgs_index_offset, 0, MINIFOOTER_SIZE);
+    memcpy (&mh->pgs_index_offset, b->buff, MINIFOOTER_SIZE);*/
+    
+    /* get version id. Needs the bp->offset be pointing to the last 4 bytes of the buffer,
+       It also sets b->change_endianness */
+    /* Note that b is not sent over to processes, only the minifooter and then b->buff (the footer) */
+    b->offset = MINIFOOTER_SIZE - 4;
+    adios_parse_version (b, &mh->version);
+    mh->change_endianness = b->change_endianness;
+    b->offset = 0; // reset offset to beginning 
+
+    BUFREAD64(b, b->pg_index_offset)
+    mh->pgs_index_offset = b->pg_index_offset;
+
+    BUFREAD64(b, b->vars_index_offset)
+    mh->vars_index_offset = b->vars_index_offset;
+
+    BUFREAD64(b, b->attrs_index_offset)
+    mh->attrs_index_offset = b->attrs_index_offset;
+
+    b->end_of_pgs = b->pg_index_offset;
+    b->pg_size = b->vars_index_offset - b->pg_index_offset;
+    b->vars_size = b->attrs_index_offset - b->vars_index_offset;
+    b->attrs_size = attrs_end - b->attrs_index_offset;
+
+    /* Read the whole footer */
+    /* FIXME: including the last 28 bytes read already above and it seems that is not processed anymore */
+    /* It will be sent to all processes */
+    uint64_t footer_size = mh->file_size - mh->pgs_index_offset;
+    bp_realloc_aligned (b, footer_size);
+    MPI_File_seek (bp_struct->mpi_fh,
+                        (MPI_Offset)  mh->pgs_index_offset,
+                        MPI_SEEK_SET);
+    MPI_File_read (bp_struct->mpi_fh, b->buff, footer_size,
+            MPI_BYTE, &status);
+
+    MPI_Get_count (&status, MPI_BYTE, &r);
+
+    // reset the pointer to the beginning of buffer
+    b->offset = 0;    
+    return 0;
+}
+
+/****************/
+/* Parse GROUPS */
+/****************/
+int bp_parse_pgs (struct BP_FILE * fh)
+{
+    struct bp_index_pg_struct_v1 ** root = &(fh->pgs_root); // need the pointer to it to malloc below
+    struct adios_bp_buffer_struct_v1 * b = fh->b;
+    struct bp_minifooter * mh = &(fh->mfooter);
+    uint64_t i;
+
+    /* Note that at this point, many variables of b->* is unset (init'ed to 0).
+       It's the minifooter which holds accurate information.
+       b holds the footer data from the file */
+
+    b->offset = 0;
+    b->change_endianness = (enum ADIOS_FLAG) mh->change_endianness;
+
+    BUFREAD64(b, mh->pgs_count)
+    BUFREAD64(b, mh->pgs_length)
+
+    int j;
+    uint64_t group_count = 0;
+    char ** namelist;
+    char fortran_flag;
+
+    namelist = (char **) malloc(sizeof(char *)*mh->pgs_count);
+    uint16_t * grpidlist = (uint16_t *) malloc(sizeof(uint16_t)*mh->pgs_count);
+
+    uint32_t tidx_start, tidx_stop; /* Determine first and last timestep in file */
+
+    for (i = 0; i < mh->pgs_count; i++) {
+        uint16_t length_of_group;
+        namelist[i] = 0;    
+        // validate remaining length
+        BUFREAD16(b, length_of_group)
+
+        if (!*root)
+        {
+            *root = (struct bp_index_pg_struct_v1 *)
+                malloc (sizeof(struct bp_index_pg_struct_v1));
+            memset (*root, 0, sizeof(struct bp_index_pg_struct_v1));
+            (*root)->next = 0;
+        }
+        uint16_t length_of_name;
+
+        BUFREAD16(b, length_of_name)
+        (*root)->group_name = (char *) malloc (length_of_name + 1);
+        (*root)->group_name [length_of_name] = '\0';
+        memcpy ((*root)->group_name, b->buff + b->offset, length_of_name);
+        b->offset += length_of_name;
+        
+        
+        if ( group_count == 0 ) { 
+            namelist[group_count] = (char *) malloc (length_of_name + 1);
+            strcpy (namelist[group_count], (*root)->group_name);
+            ++group_count;
+            grpidlist[i] = group_count-1;
+        }
+        else {
+            for (j=0; j<group_count; j++) {
+                if (!strcmp(namelist[j], (*root)->group_name)) {
+                    break;
+                }
+            }
+            if (j==group_count) {
+                namelist[group_count] = (char *) malloc (length_of_name + 1);
+                strcpy (namelist[group_count], (*root)->group_name);
+                ++group_count;
+                grpidlist[i] = group_count - 1;
+            }
+            else 
+                grpidlist[i] = j;
+                    
+        }
+            
+        BUFREAD8(b, fortran_flag)
+        (*root)->adios_host_language_fortran =
+            (fortran_flag == 'y' ? adios_flag_yes : adios_flag_no);
+
+        BUFREAD32(b, (*root)->process_id)
+
+        BUFREAD16(b, length_of_name)
+        (*root)->time_index_name = (char *) malloc (length_of_name + 1);
+        (*root)->time_index_name [length_of_name] = '\0';
+        memcpy ((*root)->time_index_name, b->buff + b->offset, length_of_name);
+        b->offset += length_of_name;
+
+        BUFREAD32(b, (*root)->time_index)
+
+        BUFREAD64(b, (*root)->offset_in_file)
+
+        if (i == 0)
+            tidx_start = (*root)->time_index;
+        if (i == mh->pgs_count-1) {
+            tidx_stop = (*root)->time_index;
+            mh->time_steps = tidx_stop - tidx_start + 1;
+        }
+
+        root = &(*root)->next;
+    }
+
+    /*
+    root = &(fh->pgs_root);
+    for (i = 0; i < mh->pgs_count; i++) {
+        printf("%d\tpg pid=%d addr=%x next=%x\n",i, (*root)->process_id, *root, (*root)->next);
+        root = &(*root)->next;
+    }
+    */
+
+    uint64_t * pg_offsets = 0; 
+    uint32_t * pg_pids = 0; 
+    uint32_t *** time_index = 0;
+    pg_offsets = (uint64_t *) 
+        malloc (sizeof(uint64_t)*mh->pgs_count);
+    pg_pids = (uint32_t *)
+        malloc (sizeof(uint32_t)*mh->pgs_count);
+    // time_index[0]: record which pg to start from per timestep per group
+    // time_index[1]: record the # of pgs per timesteps per group 
+    time_index = (uint32_t ***) malloc (sizeof(uint32_t **)*2);
+
+    for (j=0;j<2;j++) {
+        time_index[j] = (uint32_t **) 
+            malloc (sizeof(uint32_t*)*group_count);
+        //printf ("### time_index[%d]=%x  group_count=%d  #pgs=%d #ts=%d\n", j, time_index[j], group_count, mh->pgs_count,  mh->time_steps);
+        for (i=0;i<group_count;i++) {
+            if (mh->pgs_count < mh->time_steps) {
+                /* FIXME: when can this happen? 
+                   pgs = time_steps * number of writers, if there is 1 group only
+                */
+                time_index[j][i] = (uint32_t *) 
+                    malloc (sizeof(uint32_t)*mh->pgs_count);
+            } else {
+                time_index[j][i] = (uint32_t *) 
+                    malloc (sizeof(uint32_t)*mh->time_steps);
+            }
+        }
+    }
+
+    root = &(fh->pgs_root);
+    uint64_t grpid = grpidlist[0];
+    uint32_t pg_time_count = 0, first_pg;
+    uint32_t time_id = tidx_start;
+    first_pg = 0; /* The first pg for a given timestep and group */
+    for (i = 0; i < mh->pgs_count; i++) {
+        pg_pids [i] = (*root)->process_id;
+        pg_offsets [i] = (*root)->offset_in_file;
+        //printf ("### root->time_index=%d,  time_id=%d\n", (*root)->time_index, time_id);
+        if ((*root)->time_index == time_id) {
+            /* processing still the same timestep */
+            if (grpid == grpidlist[i]) {
+                /* processing still the same group */
+                /* FIXME: is this the order in the file? time..groups or group..times? */
+                pg_time_count += 1;
+            } else {
+                /* changing group: pg_time_count is for the current group the number of pgs of the same time */
+                time_index [0][grpid][time_id-tidx_start] = first_pg;
+                time_index [1][grpid][time_id-tidx_start] = pg_time_count;
+                //printf ("#-- time_index[0][%d][%d]=%d\n", grpid, time_id-tidx_start, first_pg);
+                //printf ("#   time_index[1][%d][%d]=%d\n", grpid, time_id-tidx_start, pg_time_count);
+                grpid = grpidlist [i];    
+                pg_time_count = 1;
+                first_pg = i; // new group starts from this pg
+            }
+        }    
+        else {
+            /* change in timestep */
+            if (group_count == 1) {
+                /* single group in file (the most frequent case) */
+                time_index [0][grpid][time_id-tidx_start] = first_pg;
+                time_index [1][grpid][time_id-tidx_start] = pg_time_count;
+                //printf ("### time_index[0][%d][%d]=%d\n", grpid, time_id-tidx_start, first_pg);
+                //printf ("    time_index[1][%d][%d]=%d\n", grpid, time_id-tidx_start, pg_time_count);
+                first_pg = i;
+            }
+            else {    
+                if (grpid == grpidlist[i]) {
+                    pg_time_count += 1;
+                } else {
+                    time_index [0][grpid][time_id-tidx_start] = first_pg;
+                    time_index [1][grpid][time_id-tidx_start] = pg_time_count;
+                    //printf ("#.. time_index[0][%d][%d]=%d\n", grpid, time_id-tidx_start, first_pg);
+                    //printf ("    time_index[1][%d][%d]=%d\n", grpid, time_id-tidx_start, pg_time_count);
+                    grpid = grpidlist [i];    
+                    first_pg = i;
+                }
+            }
+            time_id = (*root)->time_index;
+            pg_time_count = 1;
+        }
+        root = &(*root)->next;
+    }
+    /* set last grp/time count to complete the above procedure */
+    time_index [0][grpid][time_id-tidx_start] = first_pg;
+    time_index [1][grpid][time_id-tidx_start] = pg_time_count;
+    //printf ("#   time_index[0][%d][%d]=%d\n", grpid, time_id-tidx_start, first_pg);
+    //printf ("    time_index[1][%d][%d]=%d\n", grpid, time_id-tidx_start, pg_time_count);
+
+
+    /* Copy group_count strings from namelist and then free up namelist */
+    char ** grp_namelist;
+ 
+    grp_namelist = (char **) malloc (sizeof(char*) * group_count);
+    for (i=0;i<group_count;i++) {
+        //grp_namelist[i] = (char *) malloc (strlen(namelist[i])+1);
+        //strcpy(grp_namelist[i],namelist[i]);
+        grp_namelist[i] = namelist[i];
+    }
+    free(namelist);
+    
+    // here we need:
+    //        grp_namelist [ngroup]
+    //    time_index   [2][ngroup][nprocess]
+    //    pg_offsets   [npgs]
+
+    free (pg_pids);
+
+    fh->gvar_h = (struct BP_GROUP_VAR *) malloc (sizeof(struct BP_GROUP_VAR));
+    fh->gvar_h->group_count = group_count;
+    fh->gvar_h->pg_offsets = pg_offsets;
+    fh->gvar_h->namelist = grp_namelist; 
+    fh->gvar_h->time_index = time_index; 
+    fh->gvar_h->group_id = 0;
+    fh->gvar_h->var_offsets = 0;
+    fh->gvar_h->var_namelist = 0;
+    fh->gvar_h->var_counts_per_group = 0;
+
+    fh->gattr_h = (struct BP_GROUP_ATTR *) malloc (sizeof(struct BP_GROUP_ATTR));
+    fh->gattr_h->group_count = group_count;
+    fh->gattr_h->namelist = grp_namelist;
+    fh->gattr_h->group_id = 0;
+    fh->gattr_h->attr_offsets = 0;
+    fh->gattr_h->attr_namelist = 0;
+    fh->gattr_h->attr_counts_per_group = 0;
+
+    fh->tidx_start = tidx_start; 
+    fh->tidx_stop= tidx_stop; 
+
+    free(grpidlist);
+    return 0;
+}
+
+
+/********************/
+/* Parse ATTRIBUTES */
+/********************/
+int bp_parse_attrs (struct BP_FILE * fh)
+{
+    struct adios_bp_buffer_struct_v1 * b = fh->b;
+    struct adios_index_attribute_struct_v1 ** attrs_root = &(fh->attrs_root);
+    struct bp_minifooter * mh = &(fh->mfooter);
+    struct adios_index_attribute_struct_v1 ** root;
+    int i;
+
+    if (b->length - b->offset < VARS_MINIHEADER_SIZE) {
+        fprintf (stderr, "adios_parse_attrs_index_v1 requires a buffer "
+                "of at least %d bytes.  Only %llu were provided\n"
+                ,VARS_MINIHEADER_SIZE
+                ,b->length - b->offset
+            );
+
+        return 1;
+    }
+
+    root = attrs_root;
+
+    BUFREAD16(b, mh->attrs_count)
+    BUFREAD64(b, mh->attrs_length)
+
+    for (i = 0; i < mh->attrs_count; i++) {
+        if (!*root)
+        {
+            *root = (struct adios_index_attribute_struct_v1 *)
+                      malloc (sizeof (struct adios_index_attribute_struct_v1));
+            (*root)->next = 0;
+        }
+        uint8_t flag;
+        uint32_t attr_entry_length;
+        uint16_t len;
+        uint64_t characteristics_sets_count;
+        int type_size;
+
+        BUFREAD32(b, attr_entry_length)
+        BUFREAD16(b, (*root)->id)
+
+        BUFREAD16(b, len)
+        (*root)->group_name = (char *) malloc (len + 1);
+        (*root)->group_name [len] = '\0';
+        strncpy ((*root)->group_name, b->buff + b->offset, len);
+        b->offset += len;
+
+        BUFREAD16(b, len)
+        (*root)->attr_name = (char *) malloc (len + 1);
+        (*root)->attr_name [len] = '\0';
+        strncpy ((*root)->attr_name, b->buff + b->offset, len);
+        b->offset += len;
+
+        BUFREAD16(b, len)
+        (*root)->attr_path = (char *) malloc (len + 1);
+        (*root)->attr_path [len] = '\0';
+        strncpy ((*root)->attr_path, b->buff + b->offset, len);
+        b->offset += len;
+
+        BUFREAD8(b, flag)
+        (*root)->type = (enum ADIOS_DATATYPES) flag;
+
+        type_size = bp_get_type_size ((*root)->type, "");
+        
+        if (type_size == -1)
+        {
+            //type_size = 4;
+            (*root)->type = adios_unknown;
+        }
+        
+
+        BUFREAD64(b, characteristics_sets_count)
+        (*root)->characteristics_count = characteristics_sets_count;
+        (*root)->characteristics_allocated = characteristics_sets_count;
+
+        // validate remaining length: offsets_count * (8 + 2 * (size of type))
+        uint64_t j;
+        (*root)->characteristics = malloc (characteristics_sets_count
+                       * sizeof (struct adios_index_characteristic_struct_v1)
+                      );
+        memset ((*root)->characteristics, 0
+               ,  characteristics_sets_count
+                * sizeof (struct adios_index_characteristic_struct_v1)
+               );
+
+        for (j = 0; j < characteristics_sets_count; j++)
+        {
+            uint8_t characteristic_set_count;
+            uint32_t characteristic_set_length;
+            uint8_t item = 0;
+
+            BUFREAD8(b, characteristic_set_count)
+            BUFREAD32(b, characteristic_set_length)
+
+            while (item < characteristic_set_count)
+            {
+                uint8_t flag;
+                enum ADIOS_CHARACTERISTICS c;
+
+                BUFREAD8(b, flag)
+                c = (enum ADIOS_CHARACTERISTICS) flag;
+
+                switch (c)
+                {
+                    case adios_characteristic_value:
+                        (*root)->characteristics [j].value = bp_read_data_from_buffer(b, (*root)->type);
+                        break;
+
+                    case adios_characteristic_offset:
+                        BUFREAD64(b, (*root)->characteristics [j].offset)
+                        break;
+
+                    case adios_characteristic_payload_offset:
+                        BUFREAD64(b, (*root)->characteristics [j].payload_offset)
+                        break;
+
+                    case adios_characteristic_file_name:
+                        (*root)->characteristics [j].file_name = bp_read_data_from_buffer(b, adios_string);
+                        break;
+
+                    case adios_characteristic_time_index:
+                        BUFREAD32(b, (*root)->characteristics [j].time_index)
+                        break;
+                    case adios_characteristic_var_id:
+                        BUFREAD16(b, (*root)->characteristics [j].var_id)
+                        break;
+                }
+                item++;
+            }
+            /* Old BP files do not have time_index characteristics, so we
+               set it here automatically: j div # of pgs per timestep
+               Assumed that in old BP files, all pgs write each variable in each timestep.*/
+            if ((*root)->characteristics [j].time_index == 0) {
+                (*root)->characteristics [j].time_index = 
+                     j / (mh->pgs_count / (fh->tidx_stop - fh->tidx_start + 1)) + 1;
+                /*printf("OldBP: attr %s time_index set to %d\n", 
+                        (*root)->attr_name,
+                        (*root)->characteristics [j].time_index);*/
+            }
+        }
+
+        root = &(*root)->next;
+    }
+
+    root = attrs_root;
+    uint16_t * attr_counts_per_group;
+    uint16_t *  attr_gids;
+    uint64_t ** attr_offsets;
+    char ** attr_namelist;
+    int grpid, j,cnt;
+
+    attr_counts_per_group = (uint16_t *)
+        malloc (sizeof(uint16_t) * fh->gattr_h->group_count);
+    memset (attr_counts_per_group, 0, fh->gattr_h->group_count * sizeof(uint16_t));
+    attr_gids = (uint16_t *) malloc (sizeof(uint16_t ) * mh->attrs_count);
+    attr_namelist = (char **)malloc (sizeof(char*) * mh->attrs_count);
+
+    attr_offsets = (uint64_t **) malloc (sizeof(uint64_t *) * mh->attrs_count);
+    memset (attr_offsets, 0, mh->attrs_count * sizeof(uint64_t *));
+
+    for (i = 0; i < mh->attrs_count; i++) {
+        struct adios_index_characteristic_dims_struct_v1 * pdims;
+        for (grpid = 0; grpid < fh->gattr_h->group_count; grpid++) {
+            if (!strcmp((*root)->group_name, fh->gattr_h->namelist[grpid])) {
+                attr_counts_per_group [grpid]++;
+                attr_gids [i] = grpid;
+                break;
+            }
+        }
+        // Full name of attributes: concatenate attr_path and attr_name
+        // Always have / in the beginning of the full name
+        if (strcmp ((*root)->attr_path,"/")) {
+            attr_namelist [i] = (char *) malloc ( strlen((*root)->attr_name)
+                    +strlen((*root)->attr_path) + 1 + 1
+                    );
+            strcpy(attr_namelist[i], (*root)->attr_path);
+        }
+        else {
+            attr_namelist [i] = (char *) malloc ( strlen((*root)->attr_name)+1+1);
+                        attr_namelist[i][0] = '\0';
+        }
+        strcat(attr_namelist[i], "/");
+        strcat(attr_namelist[i], (*root)->attr_name);
+
+        attr_offsets[i] = (uint64_t *) malloc (
+                sizeof(uint64_t)*(*root)->characteristics_count);
+        for (j=0;j < (*root)->characteristics_count;j++) {
+            attr_offsets[i][j] = (*root)->characteristics [j].offset;
+        }
+
+        pdims = &(*root)->characteristics [0].dims;
+        cnt = pdims->count;
+        root = &(*root)->next;
+    }
+    //here is the asssumption that attr_gids is linearly increased
+    free(attr_gids);
+
+    fh->gattr_h->attr_namelist = attr_namelist;
+    fh->gattr_h->attr_counts_per_group = attr_counts_per_group;
+    fh->gattr_h->attr_offsets = attr_offsets;
+
+    return 0;
+}
+
+/*******************/
+/* Parse VARIABLES */
+/*******************/
+int bp_parse_vars (struct BP_FILE * fh)
+{
+    struct adios_bp_buffer_struct_v1 * b = fh->b;
+    struct adios_index_var_struct_v1 ** vars_root = &(fh->vars_root);
+    struct bp_minifooter * mh = &(fh->mfooter);
+
+    struct adios_index_var_struct_v1 ** root;
+
+    if (b->length - b->offset < VARS_MINIHEADER_SIZE) {
+        fprintf (stderr, "adios_parse_vars_index_v1 requires a buffer "
+                "of at least %d bytes.  Only %llu were provided\n"
+                ,VARS_MINIHEADER_SIZE
+                ,b->length - b->offset
+            );
+
+        return 1;
+    }
+
+    root = vars_root;
+
+    BUFREAD16(b, mh->vars_count)
+    BUFREAD64(b, mh->vars_length)
+
+    // validate remaining length    
+    int i;
+    for (i = 0; i < mh->vars_count; i++) {
+        if (!*root) {
+            *root = (struct adios_index_var_struct_v1 *)
+                malloc (sizeof (struct adios_index_var_struct_v1));
+            (*root)->next = 0;
+        }
+        uint8_t flag;
+        uint32_t var_entry_length;
+        uint16_t len;
+        uint64_t characteristics_sets_count;
+        int type_size;
+
+        BUFREAD32(b, var_entry_length)
+        BUFREAD16(b, (*root)->id)
+
+        BUFREAD16(b, len)
+        (*root)->group_name = (char *) malloc (len + 1);
+        (*root)->group_name [len] = '\0';
+        strncpy ((*root)->group_name, b->buff + b->offset, len);
+        b->offset += len;
+
+        BUFREAD16(b, len)
+        (*root)->var_name = (char *) malloc (len + 1);
+        (*root)->var_name [len] = '\0';
+        strncpy ((*root)->var_name, b->buff + b->offset, len);
+        b->offset += len;
+
+        BUFREAD16(b, len)
+        (*root)->var_path = (char *) malloc (len + 1);
+        (*root)->var_path [len] = '\0';
+        strncpy ((*root)->var_path, b->buff + b->offset, len);
+        b->offset += len;
+
+        BUFREAD8(b, flag)
+        (*root)->type = (enum ADIOS_DATATYPES) flag;
+        type_size = bp_get_type_size ((*root)->type, "");
+
+        BUFREAD64(b, characteristics_sets_count)
+        (*root)->characteristics_count = characteristics_sets_count;
+        (*root)->characteristics_allocated = characteristics_sets_count;
+
+        // validate remaining length: offsets_count * 
+        // (8 + 2 * (size of type))
+        (*root)->characteristics = malloc (characteristics_sets_count
+            * sizeof (struct adios_index_characteristic_struct_v1)
+            );
+        memset ((*root)->characteristics, 0
+            ,  characteristics_sets_count
+            * sizeof (struct adios_index_characteristic_struct_v1)
+               );
+
+        uint64_t j;
+        for (j = 0; j < characteristics_sets_count; j++)
+        {
+            uint8_t characteristic_set_count;
+            uint32_t characteristic_set_length;
+            uint8_t item = 0;
+
+            BUFREAD8(b, characteristic_set_count)
+            BUFREAD32(b, characteristic_set_length)
+                
+            while (item < characteristic_set_count) {
+                bp_parse_characteristics (b, root, j);
+                item++;
+            }
+
+            /* Old BP files do not have time_index characteristics, so we
+               set it here automatically: j div # of pgs per timestep
+               Assumed that in old BP files, all pgs write each variable in each timestep.*/
+            if ((*root)->characteristics [j].time_index == 0) {
+                (*root)->characteristics [j].time_index = 
+                     j / (mh->pgs_count / (fh->tidx_stop - fh->tidx_start + 1)) + 1;
+                /*printf("OldBP: var %s time_index set to %d\n",
+                        (*root)->var_name, 
+                        (*root)->characteristics [j].time_index);*/
+            }
+        }
+        root = &(*root)->next;
+    }
+    
+    root = vars_root;
+    uint16_t * var_counts_per_group;
+    uint16_t *  var_gids;
+    uint64_t ** var_offsets;
+    char ** var_namelist;
+    int grpid, j,cnt;
+
+    var_counts_per_group = (uint16_t *) 
+        malloc (sizeof(uint16_t)*fh->gvar_h->group_count);
+    memset ( var_counts_per_group, 0, fh->gvar_h->group_count*sizeof(uint16_t));
+    var_gids = (uint16_t *) malloc (sizeof(uint16_t )*mh->vars_count);
+    var_namelist = (char **)malloc(sizeof(char*)*mh->vars_count);
+
+    var_offsets = (uint64_t **) malloc (sizeof(uint64_t *)*mh->vars_count);
+    memset ( var_offsets, 0, mh->vars_count*sizeof(uint64_t *));
+
+    for (i = 0; i < mh->vars_count; i++) {
+        struct adios_index_characteristic_dims_struct_v1 * pdims;
+        for (grpid=0;grpid<fh->gvar_h->group_count;grpid++) {
+            if (!strcmp((*root)->group_name,fh->gvar_h->namelist[grpid])) {
+                var_counts_per_group [grpid]++;
+                var_gids [i] = grpid;
+                break;
+            }
+        }
+        // Full name of variable: concatenate var_path and var_name
+        // Always have / in the beginning of the full name
+        if (strcmp ((*root)->var_path,"/")) {
+            var_namelist [i] = (char *) malloc ( strlen((*root)->var_name)
+                    +strlen((*root)->var_path) + 1 + 1   // extra / and ending \0
+                    );
+            strcpy(var_namelist[i], (*root)->var_path);
+        }
+        else {
+            var_namelist [i] = (char *) malloc ( strlen((*root)->var_name)+1+1);
+            var_namelist[i][0] = '\0';
+        }
+        strcat(var_namelist[i], "/");
+        strcat(var_namelist[i], (*root)->var_name);
+
+        var_offsets[i] = (uint64_t *) malloc (
+                sizeof(uint64_t)*(*root)->characteristics_count);
+        for (j=0;j < (*root)->characteristics_count;j++) {
+            var_offsets[i][j] = (*root)->characteristics [j].offset;
+        }
+
+        pdims = &(*root)->characteristics [0].dims;
+        cnt = pdims->count;
+        root = &(*root)->next;
+    }
+
+    //here is the asssumption that var_gids is linearly increased
+    free( var_gids);
+    fh->gvar_h->var_namelist = var_namelist;
+    fh->gvar_h->var_counts_per_group=var_counts_per_group;
+    fh->gvar_h->var_offsets = var_offsets;
+    return 0;
+}
+
+int bp_parse_characteristics (struct adios_bp_buffer_struct_v1 * b,
+                    struct adios_index_var_struct_v1 ** root,
+                  uint64_t j)
+{
+    uint8_t flag;
+    enum ADIOS_CHARACTERISTICS c;
+
+    BUFREAD8(b, flag)
+    c = (enum ADIOS_CHARACTERISTICS) flag;
+
+    switch (c) {
+
+        case adios_characteristic_value:
+            (*root)->characteristics [j].value = bp_read_data_from_buffer(b, (*root)->type);
+            break;
+
+		// NCSU - Adding in backward compatibility
+		case adios_characteristic_max:
+		{
+			if (!((*root)->characteristics [j].stats))
+			{
+				(*root)->characteristics [j].stats = malloc (sizeof(struct adios_index_characteristics_stat_struct *));
+				(*root)->characteristics [j].stats[0] = malloc (2 * sizeof(struct adios_index_characteristics_stat_struct));
+				(*root)->characteristics [j].bitmap = 0;
+			}
+			(*root)->characteristics [j].bitmap |= (1 << adios_statistic_max);
+			(*root)->characteristics [j].stats[0][adios_statistic_max].data = bp_read_data_from_buffer(b, (*root)->type);
+			break;
+		}
+
+        // NCSU - Adding in backward compatibility
+        case adios_characteristic_min:
+        {
+            if (!((*root)->characteristics [j].stats))
+            {
+                (*root)->characteristics [j].stats = malloc (sizeof(struct adios_index_characteristics_stat_struct *));
+                (*root)->characteristics [j].stats[0] = malloc (2 * sizeof(struct adios_index_characteristics_stat_struct));
+                (*root)->characteristics [j].bitmap = 0;
+            }
+            (*root)->characteristics [j].bitmap |= (1 << adios_statistic_min);
+            (*root)->characteristics [j].stats[0][adios_statistic_min].data = bp_read_data_from_buffer(b, (*root)->type);
+			break;
+        }
+
+		// NCSU - Parse the statistical information based in the bitmap
+        case adios_characteristic_stat:
+		{
+			uint8_t i, c, idx; 
+			uint8_t count = adios_get_stat_set_count ((*root)->type);
+			uint16_t characteristic_size;
+
+			(*root)->characteristics [j].stats = malloc (count * sizeof(struct adios_index_characteristics_stat_struct *));
+
+			for (c = 0; c < count; c ++)
+			{
+				i = idx = 0;
+				(*root)->characteristics [j].stats[c] = malloc (ADIOS_STAT_LENGTH * sizeof(struct adios_index_characteristics_stat_struct));
+
+				while ((*root)->characteristics[j].bitmap >> i)
+				{
+					(*root)->characteristics [j].stats[c][i].data = 0;
+					if (((*root)->characteristics[j].bitmap >> i) & 1)
+					{
+						if (i == adios_statistic_hist)
+						{
+							uint32_t bi;
+							
+							(*root)->characteristics [j].stats[c][idx].data = malloc (sizeof(struct adios_index_characteristics_hist_struct));
+							struct adios_index_characteristics_hist_struct * hist = (*root)->characteristics [j].stats[c][idx].data; 
+
+            				BUFREAD32(b, hist->num_breaks)
+            				hist->min = * (double *) bp_read_data_from_buffer(b, adios_double);
+            				hist->max = * (double *) bp_read_data_from_buffer(b, adios_double);
+
+            				hist->frequencies = malloc((hist->num_breaks + 1) * adios_get_type_size(adios_unsigned_integer, ""));
+            				for (bi = 0; bi <= hist->num_breaks; bi ++) {
+            				    BUFREAD32(b, hist->frequencies[bi])
+            				}
+
+            				hist->breaks = malloc(hist->num_breaks * adios_get_type_size(adios_double, ""));
+            				for (bi = 0; bi < hist->num_breaks; bi ++) {
+            				    hist->breaks[bi] = * (double *) bp_read_data_from_buffer(b, adios_double);
+            				}
+						}
+						else
+						{
+							characteristic_size = adios_get_stat_size((*root)->characteristics [j].stats[c][idx].data
+                                                                                                 ,(*root)->type
+                                                                                                 ,(enum ADIOS_STAT)i
+                                                                                                 );
+							(*root)->characteristics [j].stats[c][idx].data = malloc (characteristic_size);
+
+							void * data = (*root)->characteristics [j].stats[c][idx].data;
+			            	memcpy (data, (b->buff + b->offset), characteristic_size);
+            				b->offset += characteristic_size;
+
+            				if(b->change_endianness == adios_flag_yes) 
+                        		swap_ptr(data, characteristic_size * 8);
+						}
+						idx ++;
+					}
+					i ++;
+				}	
+			}	
+			break;
+		}
+
+		// NCSU - Statistics. Read the bitmap
+		case adios_characteristic_bitmap:
+			BUFREAD32(b, (*root)->characteristics [j].bitmap);
+			break;
+
+        case adios_characteristic_offset: 
+            BUFREAD64(b, (*root)->characteristics [j].offset)
+            break;
+
+        case adios_characteristic_payload_offset: 
+            BUFREAD64(b, (*root)->characteristics [j].payload_offset)
+            break;
+
+        case adios_characteristic_file_name:
+            (*root)->characteristics [j].file_name = bp_read_data_from_buffer(b, adios_string);
+            break;
+
+        case adios_characteristic_time_index:
+            BUFREAD32(b, (*root)->characteristics [j].time_index)
+            break;
+
+        case adios_characteristic_dimensions:
+        {
+            uint16_t dims_length, di, dims_num;
+            BUFREAD8(b, (*root)->characteristics [j].dims.count)
+            BUFREAD16(b, dims_length);
+
+            (*root)->characteristics [j].dims.dims = (uint64_t *) malloc (dims_length);
+
+            dims_num = dims_length / 8;
+            for (di = 0; di < dims_num; di ++) {
+                BUFREAD64(b, ((*root)->characteristics [j].dims.dims)[di]);
+            }
+            break;
+        }
+
+        default:
+            fprintf (stderr, "Unknown characteristic:%d. skipped.\n", c);
+            break;
+    }
+    return 0;
+}
+
+void * bp_read_data_from_buffer(struct adios_bp_buffer_struct_v1 *b, enum ADIOS_DATATYPES type)
+{
+    int16_t data_size;
+    void * data = 0;
+
+    if (type == adios_string) {
+        BUFREAD16(b, data_size)
+        data = malloc (data_size + 1);
+    } else {
+        data_size = bp_get_type_size (type, "");
+        data = malloc (data_size);
+    }
+
+    if (!data) {
+        fprintf (stderr, "bp_read_data_from_buffer: cannot allocate %d bytes\n",data_size);
+        return 0;
+    }
+
+    switch (type)
+    {
+        case adios_byte:
+        case adios_short:
+        case adios_integer:
+        case adios_long:
+        case adios_unsigned_byte:
+        case adios_unsigned_short:
+        case adios_unsigned_integer:
+        case adios_unsigned_long:
+        case adios_real:
+        case adios_double:
+        case adios_long_double:
+            memcpy (data, (b->buff + b->offset), data_size);
+            b->offset += data_size;
+            if(b->change_endianness == adios_flag_yes) {
+                switch (data_size) {
+                    case 2:
+                        swap_16_ptr(data);
+                        break;
+                    case 4:
+                        swap_32_ptr(data);
+                        break;
+                    case 8:
+                        swap_64_ptr(data);
+                        break;
+                    case 16:
+                        swap_128_ptr(data);
+                        break;
+                }
+            }
+            break;
+
+        case adios_complex:
+            memcpy (data, (b->buff + b->offset), data_size);
+            if(b->change_endianness == adios_flag_yes) {
+                swap_32_ptr(data); // swap REAL part 4 bytes
+                swap_32_ptr( ((char *)data) + 4); // swap IMG part 4 bytes
+            }
+            b->offset += data_size;
+            break;
+
+        case adios_double_complex:
+            memcpy (data, (b->buff + b->offset), data_size);
+            if(b->change_endianness == adios_flag_yes) {
+                swap_64_ptr(data); // swap REAL part 8 bytes
+                swap_64_ptr( ((char *)data) + 8); // swap IMG part 8 bytes
+            }
+            b->offset += data_size;
+            break;
+
+        case adios_string:
+            memcpy (data, (b->buff + b->offset), data_size);
+            b->offset += data_size;
+            ((char *) data) [data_size] = '\0';
+            break;
+
+        default:
+            free (data);
+            data = 0;
+            break;
+    }
+    return data;
+}
+
+/*
+void bp_grouping ( struct BP_FILE * fh_p,
+           uint64_t * gh_p)
+{
+    struct BP_FILE * fh = (struct BP_FILE *) fh_p;
+    struct bp_index_pg_struct_v1 * pg_root = fh->pgs_root;
+    struct bp_minifooter * mh = &fh->mfooter;    
+    int i, j; 
+    uint32_t time_id;
+    uint64_t pg_time_count = 0;
+    uint64_t * pg_offsets = (uint64_t *) 
+        malloc (sizeof(uint64_t)*mh->pgs_count);
+    uint32_t * pg_pids = (uint32_t *) 
+        malloc (sizeof(uint32_t)*mh->pgs_count);
+    uint64_t * time_index = (uint64_t *) 
+        malloc (sizeof(uint64_t)*mh->time_steps);
+    time_id = pg_root->time_index;
+
+    uint16_t group_count = 0;
+     
+    for (i = 0; i < mh->pgs_count; i++) {
+        pg_pids [i] = pg_root->process_id;
+        pg_offsets [i] = pg_root->offset_in_file;
+        if (pg_root->time_index == time_id) {
+            pg_time_count += 1;
+        }    
+        else {
+            time_index [time_id-1] = pg_time_count;
+            time_id = pg_root->time_index;
+            pg_time_count = 1;
+        }
+    
+        pg_root = pg_root->next;
+    }
+
+    pg_root = fh->pgs_root;
+
+    time_index [time_id-1] = pg_time_count;
+    time_id = 0;
+    for (i = 0; i < mh->time_steps; i++) {
+        if (i > 0) 
+            time_id += time_index[i-1];
+
+    }
+    struct adios_index_var_struct_v1 * vars = fh->vars_root;
+    int vars_cnt = 0;
+    while (vars) {
+        if (!strcmp(vars->group_name, pg_root->group_name)) {
+             printf ("%s %s %d %d %d %d\n",vars->var_name,
+                vars->group_name,
+                vars->characteristics_count,
+                vars->characteristics->dims.count,
+                vars->characteristics->var_id,
+                vars->id
+                );
+            ++vars_cnt;    
+        }
+        vars = vars->next;    
+    }
+     printf("cnt=%d \n",vars_cnt);
+
+    return;
+}
+*/
+/*
+int bp_read_pgs (struct BP_FILE * bp_struct)
+{
+        struct adios_bp_buffer_struct_v1 * b = bp_struct->b;
+    int r = 0;
+    MPI_Status status;
+    // init buffer for pg reading
+    bp_realloc_aligned (b, b->pg_size);
+    b->offset = 0;
+
+    if (sizeof (char *) == 4) { 
+        MPI_File_seek (bp_struct->mpi_fh, 
+                (MPI_Offset) b->pg_index_offset, 
+                MPI_SEEK_SET);
+
+        MPI_File_read (bp_struct->mpi_fh, b->buff, 
+                b->pg_size, MPI_BYTE, &status);
+        MPI_Get_count (&status, MPI_BYTE, &r);
+    }
+    else { 
+        MPI_File_seek (bp_struct->mpi_fh, 
+                (MPI_Offset) b->pg_index_offset, 
+                MPI_SEEK_SET);
+
+        MPI_File_read (bp_struct->mpi_fh, b->buff, 
+                b->pg_size, MPI_BYTE, &status);
+        MPI_Get_count (&status, MPI_BYTE, &r);
+    }
+    if (r != b->pg_size)
+        fprintf (stderr, "could not read %llu bytes. read only: %llu\n",
+                b->pg_size, r);
+
+    return 0;
+}
+*/
+/*
+int bp_read_vars (struct BP_FILE * bp_struct)
+{
+        struct adios_bp_buffer_struct_v1 * b = bp_struct->b;
+    int r = 0;
+    MPI_Status status;
+
+    //init buffer for vars reading
+    bp_realloc_aligned (b, b->vars_size);
+    b->offset = 0;
+
+    if (sizeof (char *) == 4) { 
+        MPI_File_seek (bp_struct->mpi_fh, 
+                (MPI_Offset) b->vars_index_offset, 
+                MPI_SEEK_SET);
+
+        MPI_File_read (bp_struct->mpi_fh, b->buff, 
+                b->vars_size, MPI_BYTE, &status);
+        MPI_Get_count (&status, MPI_BYTE, &r);
+    }
+    else { 
+        MPI_File_seek (bp_struct->mpi_fh,
+                (MPI_Offset) b->vars_index_offset, 
+                MPI_SEEK_SET);
+
+        MPI_File_read (bp_struct->mpi_fh, b->buff, 
+                b->vars_size, MPI_BYTE, &status);
+        MPI_Get_count (&status, MPI_BYTE, &r);
+    }
+    if (r != b->vars_size)
+        fprintf (stderr, "could not read %llu bytes. read only: %llu\n",
+                b->vars_size, r);
+
+    return 0;
+}
+*/
+/*
+void print_pg_index (struct bp_index_pg_struct_v1 * pg_root,
+        struct bp_minifooter * mh)
+{
+    int i, j; 
+    uint32_t time_id;
+    uint64_t pg_time_count = 0;
+    uint64_t * pg_offsets = (uint64_t *) 
+        malloc (sizeof(uint64_t)*mh->pgs_count);
+    uint32_t * pg_pids = (uint32_t *) 
+        malloc (sizeof(uint32_t)*mh->pgs_count);
+    uint64_t * time_index = (uint64_t *) 
+        malloc (sizeof(uint64_t)*mh->time_steps);
+    time_id = pg_root->time_index;
+    for (i = 0; i < mh->pgs_count; i++)
+    {
+        pg_pids [i] = pg_root->process_id;
+        pg_offsets [i] = pg_root->offset_in_file;
+        if (pg_root->time_index == time_id)
+        {
+            pg_time_count += 1;
+        }    
+        else {
+            time_index [time_id-1] = pg_time_count;
+            time_id = pg_root->time_index;
+            pg_time_count = 1;
+        }    
+        pg_root = pg_root->next;
+    }
+
+    time_index [time_id-1] = pg_time_count;
+    time_id = 0;
+    for (i = 0; i < mh->time_steps; i++) {
+        if (i > 0) 
+            time_id += time_index[i-1];
+    }
+}
+
+void print_vars_index_top (struct adios_index_var_struct_v1 * vars_root)
+{
+    printf("Variables (group) :\n");    
+    while (vars_root) {
+        if (!strcmp (vars_root->var_path, "/")) {
+            printf ("\t %s", 
+                vars_root->var_name
+                );
+        }
+        else {
+            printf ("\t %s/%s",
+                vars_root->var_path,
+                vars_root->var_name
+                );
+        }
+        
+        int j, cnt;
+        struct adios_index_characteristic_dims_struct_v1 * pdims;
+        pdims = &vars_root->characteristics [0].dims;
+        cnt = pdims->count;
+        if (cnt != 0) {
+            printf (" (");
+            for (j = 0; j < cnt; j++) { 
+                if (j>0)
+                    printf (", ");
+                if (pdims->dims [j*3 + 1] != 0) {
+                    printf ("%llu", pdims->dims [j*3 + 1]);
+                }
+                else {
+                    printf ("%llu", pdims->dims [j*3 + 0]);
+                }
+            }
+            printf (")");
+        }
+        printf("\n");
+        vars_root = vars_root->next;
+    }
+}
+
+void print_vars_index (struct adios_index_var_struct_v1 * vars_root)
+{
+    while (vars_root) {
+        if (!strcmp (vars_root->var_path, "/")) {
+            printf ("Var (Group) [ID]: /%s (%s) [%d]\n", vars_root->var_name
+                   ,vars_root->group_name, vars_root->id
+                   );
+        }
+        else {
+            printf ("Var (Group) [ID]: %s/%s (%s) [%d]\n", vars_root->var_path
+                   ,vars_root->var_name, vars_root->group_name, vars_root->id
+                   );
+        }
+        printf ("\tVars Characteristics: %llu\n"
+               ,vars_root->characteristics_count
+               );
+        uint64_t i;
+        for (i = 0; i < vars_root->characteristics_count; i++) {
+            printf ("\t\tOffset(%llu)", vars_root->characteristics [i].offset);
+            if (vars_root->characteristics [i].min)
+            {
+                printf ("\t\tMin(%s)", value_to_string (vars_root->type
+                                           ,vars_root->characteristics [i].min
+                                           )
+                       );
+            }
+            if (vars_root->characteristics [i].max)
+            {
+                printf ("\t\tMax(%s)", value_to_string (vars_root->type
+                                           ,vars_root->characteristics [i].max
+                                           )
+                       );
+            }
+            if (vars_root->characteristics [i].value)
+            {
+                printf ("\t\tValue(%s)", value_to_string (vars_root->type
+                                         ,vars_root->characteristics [i].value
+                                         )
+                       );
+            }
+            if (vars_root->characteristics [i].dims.count != 0) {
+                int j;
+
+                printf ("\t\tDims (l:g:o): (");
+                for (j = 0; j < vars_root->characteristics [i].dims.count; j++)
+                {
+                    if (j != 0)
+                        printf (",");
+                    if (  vars_root->characteristics [i].dims.dims [j * 3 + 1]
+                        != 0
+                       )
+                    {
+                        printf ("%llu:%llu:%llu"
+                         ,vars_root->characteristics [i].dims.dims [j * 3 + 0]
+                         ,vars_root->characteristics [i].dims.dims [j * 3 + 1]
+                         ,vars_root->characteristics [i].dims.dims [j * 3 + 2]
+                               );
+                    }
+                    else
+                    {
+                        printf ("%llu"
+                         ,vars_root->characteristics [i].dims.dims [j * 3 + 0]
+                               );
+                    }
+                }
+                printf (")");
+            }
+            printf ("\n");
+        }
+
+        vars_root = vars_root->next;
+    }
+}
+*/
+
+/* Return 1 if a < b wrt the given type, otherwise 0 */
+int adios_lt(int type, void *a, void *b)
+{
+    double ar, ai, br, bi;
+    long double ar2, ai2, br2, bi2;
+    switch (type)
+    {
+        case adios_unsigned_byte:
+            return *((uint8_t *) a) < *((uint8_t *) b);
+        case adios_byte:
+            return *((int8_t *) a) < *((int8_t *) b);
+        case adios_short:
+            return *((int16_t *) a) < *((int16_t *) b);
+        case adios_unsigned_short:
+            return *((uint16_t *) a) < *((uint16_t *) b);
+        case adios_integer:
+            return *((int32_t *) a) < *((int32_t *) b);
+        case adios_unsigned_integer:
+            return *((uint32_t *) a) < *((uint32_t *) b);
+        case adios_long:
+            return *((int64_t *) a) < *((int64_t *) b);
+        case adios_unsigned_long:
+            return *((uint64_t *) a) < *((uint64_t *) b);
+        case adios_real:
+            return *((float *) a) < *((float *) b);
+        case adios_double:
+            return *((double *) a) < *((double *) b);
+        case adios_long_double:
+            return *((long double *) a) < *((long double *) b);
+        case adios_string:
+            return ( strcmp( (char *) a, (char *) b) < 0);
+        case adios_complex:
+            ar = (double) ((float *) a)[0];
+            ai = (double) ((float *) a)[1];
+            br = (double) ((float *) b)[0];
+            bi = (double) ((float *) b)[1];
+            return ( ar*ar+ai*ai < br*br+bi*bi );
+        case adios_double_complex:
+            ar2 = (long double) ((double *) a)[0];
+            ai2 = (long double) ((double *) a)[1];
+            br2 = (long double) ((double *) b)[0];
+            bi2 = (long double) ((double *) b)[1];
+            return ( ar2*ar2+ai2*ai2 < br2*br2+bi2*bi2 );
+        default:
+            return 1;
+    }
+
+    return 0;
+}
+
+const char * bp_value_to_string (enum ADIOS_DATATYPES type, void * data)
+{
+    static char s [100];
+    s [0] = 0;
+
+
+    switch (type)
+    {
+        case adios_unsigned_byte:
+            sprintf (s, "%u", *(((uint8_t *) data)));
+            break;
+
+        case adios_byte:
+            sprintf (s, "%d", *(((int8_t *) data)));
+            break;
+
+        case adios_short:
+            sprintf (s, "%hd", *(((int16_t *) data)));
+            break;
+
+        case adios_unsigned_short:
+            sprintf (s, "%uh", *(((uint16_t *) data)));
+            break;
+
+        case adios_integer:
+            sprintf (s, "%d", *(((int32_t *) data)));
+            break;
+
+        case adios_unsigned_integer:
+            sprintf (s, "%u", *(((uint32_t *) data)));
+            break;
+
+        case adios_long:
+            sprintf (s, "%lld", *(((int64_t *) data)));
+            break;
+
+        case adios_unsigned_long:
+            sprintf (s, "%llu", *(((uint64_t *) data)));
+            break;
+
+        case adios_real:
+            sprintf (s, "%f", *(((float *) data)));
+            break;
+
+        case adios_double:
+            sprintf (s, "%le", *(((double *) data)));
+            break;
+
+        case adios_long_double:
+            sprintf (s, "%Le", *(((long double *) data)));
+            break;
+
+        case adios_string:
+            sprintf (s, "%s", ((char *) data));
+            break;
+
+        case adios_complex:
+            sprintf (s, "(%f %f)", *(((float *) data) + 0)
+                                 , *(((float *) data) + 1)
+                    );
+            break;
+
+        case adios_double_complex:
+            sprintf (s, "(%lf %lf)", *(((double *) data) + 0)
+                                   , *(((double *) data) + 1)
+                    );
+            break;
+    }
+
+    return s;
+}
+
+/*
+void print_var_header (struct adios_var_header_struct_v1 * var_header)
+{
+    int i = 0;
+    printf ("\t\tVar Name (ID): %s (%d)\n", var_header->name, var_header->id);
+    printf ("\t\tVar Path: %s\n", var_header->path);
+    printf ("\t\tIs Dimension: %c\n"
+           ,(var_header->is_dim == adios_flag_yes ? 'Y' : 'N')
+           );
+}
+*/
+
+/* Change endianness of each element in an array */
+/* input: array, size in bytes(!), size of one element */
+void change_endianness( void *data, uint64_t slice_size, enum ADIOS_DATATYPES type) 
+{
+    int size_of_type = bp_get_type_size(type, "");
+    uint64_t n = slice_size / size_of_type;
+    uint64_t i;
+    char *ptr = (char *) data;
+
+    if (slice_size % size_of_type != 0) {
+        fprintf(stderr, "Adios error in bp_utils.c:change_endianness(): "
+                    "An array's endianness is to be converted but the size of array "
+                    "is not dividable by the size of the elements: "
+                    "size = %lld, element size = %d\n", slice_size, size_of_type);
+    }
+
+    switch (type)
+    {
+        case adios_byte:
+        case adios_short:
+        case adios_integer:
+        case adios_long:
+        case adios_unsigned_byte:
+        case adios_unsigned_short:
+        case adios_unsigned_integer:
+        case adios_unsigned_long:
+        case adios_real:
+        case adios_double:
+        case adios_long_double:
+            switch (size_of_type) {
+                /* case 1: nothing to do */
+                case 2:
+                    for (i=0; i < n; i++) {
+                        swap_16_ptr(ptr);
+                        ptr += size_of_type;
+                    }
+                    break;
+                case 4:
+                    for (i=0; i < n; i++) {
+                        swap_32_ptr(ptr);
+                        ptr += size_of_type;
+                    }
+                    break;
+                case 8:
+                    for (i=0; i < n; i++) {
+                        swap_64_ptr(ptr);
+                        ptr += size_of_type;
+                    }
+                    break;
+                case 16:
+                    for (i=0; i < n; i++) {
+                        swap_128_ptr(ptr);
+                        ptr += size_of_type;
+                    }
+                    break;
+            }
+            break;
+
+        case adios_complex:
+            for (i=0; i < n; i++) {
+                swap_32_ptr(ptr);   // swap REAL part 4 bytes 
+                swap_32_ptr(ptr+4); // swap IMG part 4 bytes
+                ptr += size_of_type;
+            }
+            break;
+
+        case adios_double_complex:
+            for (i=0; i < n; i++) {
+                swap_64_ptr(ptr);   // swap REAL part 8 bytes 
+                swap_64_ptr(ptr+8); // swap IMG part 8 bytes
+                ptr += size_of_type;
+            }
+            break;
+
+        case adios_string:
+        default:
+            /* nothing to do */
+            break;
+    }
+}
+
+void copy_data (void *dst, void *src,
+        int idim,
+        int ndim,
+        uint64_t* size_in_dset, 
+        uint64_t* ldims, 
+        const uint64_t * readsize, 
+        uint64_t dst_stride, 
+        uint64_t src_stride,
+        uint64_t dst_offset, 
+        uint64_t src_offset,
+        uint64_t ele_num,
+        int      size_of_type
+        )
+{
+    unsigned int i, j;
+    uint64_t dst_offset_new=0; 
+    uint64_t src_offset_new=0;
+    uint64_t src_step, dst_step;
+    if (ndim-1==idim) {
+        for (i=0;i<size_in_dset[idim];i++) {
+            memcpy ((char *)dst + (i*dst_stride+dst_offset)*size_of_type,
+                    (char *)src + (i*src_stride+src_offset)*size_of_type,
+                    ele_num*size_of_type);
+        }
+        return;
+    }
+
+    for (i = 0; i<size_in_dset[idim];i++) {
+        // get the different step granularity 
+        // for each different reading pattern broke
+        src_step = 1;
+        dst_step = 1;
+        for (j = idim+1; j <= ndim-1;j++) {
+            src_step *= ldims[j];
+            dst_step *= readsize[j];
+        }
+        src_offset_new =src_offset + i * src_stride * src_step;
+        dst_offset_new = dst_offset + i * dst_stride * dst_step;
+        copy_data ( dst, src, idim+1, ndim, size_in_dset,
+                ldims,readsize, 
+                dst_stride, src_stride,
+                dst_offset_new, src_offset_new,
+                ele_num, size_of_type);
+    }
+}
+
+/** Return the memory size of one data element of an adios type.
+ *  If the type is adios_string, and the second argument is
+ *  the string itself, it returns strlen(var)+1.
+ *  For other types, it does not care about var and returns
+ *  the size occupied by one element. 
+ *
+ *  Note that adios_internals:adios_get_type_size returns
+ *  strlen(var) for strings. 
+ */ 
+int bp_get_type_size (enum ADIOS_DATATYPES type, void * var)
+{
+    switch (type)
+    {
+        case adios_byte:
+        case adios_unsigned_byte:
+            return 1;
+
+        case adios_string:
+            if (!var)
+                return 1;
+            else
+                return strlen ((char *) var) + 1;
+
+        case adios_short:
+        case adios_unsigned_short:
+            return 2;
+
+        case adios_integer:
+        case adios_unsigned_integer:
+            return 4;
+
+        case adios_long:
+        case adios_unsigned_long:
+            return 8;
+
+        case adios_real:
+            return 4;
+
+        case adios_double:
+            return 8;
+
+        case adios_long_double:
+            return 16;
+
+        case adios_complex:
+            return 2 * 4;
+
+        case adios_double_complex:
+            return 2 * 8;
+
+        default:
+            return -1;
+    }
+}
+
+double bp_value_to_double (enum ADIOS_DATATYPES type, void * data)
+{
+	switch (type)
+    {
+        case adios_string:
+            return 0;
+
+        case adios_complex:
+			return * ((float *) data);
+		
+        case adios_double_complex:
+			return * ((double *) data);
+
+        case adios_double:
+			return * ((double *) data);
+
+        case adios_long_double:
+			return * ((long double *) data);
+
+		case adios_unsigned_byte:
+            return * ((uint8_t *) data);
+
+        case adios_byte:
+            return * ((int8_t *) data);
+
+        case adios_short:
+            return * ((int16_t *) data);
+
+        case adios_unsigned_short:
+            return * ((uint16_t *) data);
+
+        case adios_integer:
+            return * ((int32_t *) data);
+
+        case adios_unsigned_integer:
+            return * ((uint32_t *) data);
+
+        case adios_long:
+            return * ((int64_t *) data);
+
+        case adios_unsigned_long:
+            return * ((uint64_t *) data);
+
+        case adios_real:
+            return * ((float *) data);
+    }
+}
+
+void alloc_namelist (char ***namelist, int length)
+{
+        int j;
+
+        *namelist = (char **) malloc(length*sizeof(char*));
+        for (j=0;j<length;j++)
+                (*namelist)[j] = (char *) malloc(255);
+
+        return;
+}
+
+void free_namelist (char **namelist, int length)
+{
+        int i;
+        if (namelist) {
+                for (i=0;i<length;i++) {
+                        if(namelist[i])
+                                free(namelist[i]);
+                }
+                free(namelist);
+        }
+        return;
+}
diff --git a/src/bp_utils.h b/src/bp_utils.h
new file mode 100644
index 0000000..8e6aa3b
--- /dev/null
+++ b/src/bp_utils.h
@@ -0,0 +1,67 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#ifndef __BP_UTILS_H__
+#define __BP_UTILS_H__
+
+#include <stdio.h>
+#include <sys/types.h>
+#ifdef _NOMPI
+#   include "mpidummy.h"
+#else
+#   include "mpi.h"
+#endif
+#include "bp_types.h"
+#define VARS_MINIHEADER_SIZE 10
+
+void bp_alloc_aligned (struct adios_bp_buffer_struct_v1 * b, uint64_t size);
+void bp_realloc_aligned (struct adios_bp_buffer_struct_v1 * b, uint64_t size);
+int bp_parse_characteristics (struct adios_bp_buffer_struct_v1 * b,
+		  	      struct adios_index_var_struct_v1 ** root,
+			      uint64_t j);
+int bp_get_characteristics_data (void ** ptr_data,
+				 void * buffer,
+				 int data_size,
+				 enum ADIOS_DATATYPES type);
+int bp_read_close (struct adios_bp_buffer_struct_v1 * b);
+int bp_read_open (const char * filename,
+	 	  MPI_Comm comm, 
+		  struct BP_FILE * fh);
+
+int bp_read_minifooter (struct BP_FILE * bp_struct);
+int bp_parse_pgs (struct BP_FILE * fh);
+int bp_parse_attrs (struct BP_FILE * fh);
+int bp_parse_vars (struct BP_FILE * fh);
+
+const char * bp_value_to_string (enum ADIOS_DATATYPES type, void * data);
+int bp_get_type_size (enum ADIOS_DATATYPES type, void * var);
+void change_endianness( void *data, uint64_t slice_size, enum ADIOS_DATATYPES type);
+
+void print_process_group_index (
+                         struct adios_index_process_group_struct_v1 * pg_root
+                         );
+
+void copy_data (void *dst, void *src,
+        int idim,
+        int ndim,
+        uint64_t* size_in_dset,
+        uint64_t* ldims,
+        const uint64_t * readsize,
+        uint64_t dst_stride,
+        uint64_t src_stride,
+        uint64_t dst_offset,
+        uint64_t src_offset,
+        uint64_t ele_num,
+                int      size_of_type
+                );
+
+/* Return 1 if a < b wrt. the given type, otherwise 0 */
+int adios_lt(int type, void *a, void *b);
+double bp_value_to_double(enum ADIOS_DATATYPES type, void * data);
+void alloc_namelist (char ***namelist, int length);
+void free_namelist (char **namelist, int length);
+#endif
diff --git a/src/buffer.c b/src/buffer.c
new file mode 100644
index 0000000..3a54f6f
--- /dev/null
+++ b/src/buffer.c
@@ -0,0 +1,162 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <unistd.h>   /* _SC_PAGE_SIZE, _SC_AVPHYS_PAGES */
+
+#if defined(__APPLE__)
+#	include <mach/mach.h>
+#endif
+
+#include "buffer.h"
+
+// buffer sizing may be problematic.  To get a more accurate picture, check:
+// http://chandrashekar.info/vault/linux-system-programs.html
+static uint64_t adios_buffer_size_requested = 0;
+static uint64_t adios_buffer_size_max = 0;
+static uint64_t adios_buffer_size_remaining = 0;
+static int adios_buffer_alloc_percentage = 0;  // 1 = yes, 0 = no
+static enum ADIOS_BUFFER_ALLOC_WHEN adios_buffer_alloc_when = ADIOS_BUFFER_ALLOC_UNKNOWN;
+
+void      adios_buffer_size_requested_set (uint64_t v)  { adios_buffer_size_requested = v; }
+uint64_t  adios_buffer_size_requested_get (void)        { return adios_buffer_size_requested; }
+void      adios_buffer_size_max_set (uint64_t v)        { adios_buffer_size_max = v; }
+void      adios_buffer_size_remaining_set (uint64_t v)  { adios_buffer_size_remaining = v; }
+void      adios_buffer_alloc_percentage_set (int v)     { adios_buffer_alloc_percentage = v; }
+void      adios_buffer_alloc_when_set (enum ADIOS_BUFFER_ALLOC_WHEN v)   { adios_buffer_alloc_when = v; }
+enum ADIOS_BUFFER_ALLOC_WHEN adios_buffer_alloc_when_get (void)   { return adios_buffer_alloc_when; }
+
+#if defined (__APPLE__)
+// See e.g. http://www.opensource.apple.com/source/system_cmds/system_cmds-496/vm_stat.tproj/vm_stat.c
+// for the code for the vm_stat command.
+// http://www.opensource.apple.com/source/xnu/xnu-792.6.61/osfmk/man/host_statistics.html?txt
+// describes the host_statistics function
+// Added by  Dorian Krause <dorian.krause at usi.ch>
+static inline size_t adios_get_avphys_pages ()
+{
+    // Since we are only interested in the number of free pages
+    // it is fine to work with the "older" host_statistics()
+    // instead of host_statistics64(). The advantage is that the
+    // first function is also provided on older (e.g., Mac OS X 10.5)
+    // systems
+    vm_statistics_data_t   host_info;
+    mach_msg_type_number_t host_info_outCnt;
+
+    // See mach/host_info.h
+    host_info_outCnt = HOST_VM_INFO_COUNT;
+    if (host_statistics(mach_host_self(),
+                        HOST_VM_INFO,
+                        (host_info_t)&host_info,
+                        &host_info_outCnt) != KERN_SUCCESS ) {
+        fprintf (stderr, "adios_get_avphys_pages (): host_statistics failed.\n");
+        return 0;   // Best we can do
+    }
+
+    // on Mac OSX 10.4 (Tiger), there is no speculative page counting
+    // VM_PAGE_QUERY_PAGE_SPECULATIVE is defined in 10.5's mach/vm_statistics.h (included in mach.h)
+#   if defined (VM_PAGE_QUERY_PAGE_SPECULATIVE)
+    return host_info.free_count - host_info.speculative_count;
+#   else
+    return host_info.free_count;
+#   endif
+}
+#else
+// See e.g. http://chandrashekar.info/vault/linux-system-programs.html
+static inline size_t adios_get_avphys_pages ()
+{
+    return sysconf (_SC_AVPHYS_PAGES);
+}
+#endif
+
+int adios_set_buffer_size ()
+{
+    if (!adios_buffer_size_max) // not called before
+    {
+        long pagesize;
+        long pages;
+
+        pagesize = sysconf (_SC_PAGE_SIZE);
+        pages =  adios_get_avphys_pages ();
+	
+        if (adios_buffer_alloc_percentage)
+        {
+            adios_buffer_size_max =   (pages * pagesize / 100.0)
+                                    * adios_buffer_size_requested;
+        }
+        else
+        {
+            if (pagesize * pages >= adios_buffer_size_requested)
+            {
+                // sufficient memory, do nothing
+                adios_buffer_size_max = adios_buffer_size_requested;
+            }
+            else
+            {
+                fprintf (stderr, "adios_allocate_buffer (): insufficient memory: "
+                                 "%llu requested, %llu available.  Using "
+                                 "available.\n"
+                        ,adios_buffer_size_requested
+                        ,(uint64_t)(((uint64_t) pagesize) * pages)
+                        );
+                 adios_buffer_size_max = (uint64_t)((uint64_t) pagesize) * pages;
+           }
+        }
+
+        adios_buffer_size_remaining = adios_buffer_size_max;
+
+        return 1;
+    }
+    else
+    {
+        fprintf (stderr, "adios_allocate_buffer already called. "
+                         "No changes made.\n"
+                );
+
+        return 0;
+    }
+}
+
+uint64_t adios_method_buffer_alloc (uint64_t size)
+{
+    if (adios_buffer_size_remaining >= size)
+    {
+        adios_buffer_size_remaining -= size;
+
+        return size;
+    }
+    else
+    {
+        uint64_t remaining = adios_buffer_size_remaining;
+
+        adios_buffer_size_remaining = 0;
+
+        return remaining;
+    }
+}
+
+int adios_method_buffer_free (uint64_t size)
+{
+    if (size + adios_buffer_size_remaining > adios_buffer_size_max)
+    {
+        fprintf (stderr, "ERROR: attempt to return more bytes to buffer "
+                         "pool than were originally available\n"
+                );
+
+        adios_buffer_size_remaining = adios_buffer_size_max;
+
+        return 0;
+    }
+    else
+    {
+        adios_buffer_size_remaining += size;
+
+        return 1;
+    }
+}
+
diff --git a/src/buffer.h b/src/buffer.h
new file mode 100644
index 0000000..c302538
--- /dev/null
+++ b/src/buffer.h
@@ -0,0 +1,26 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#ifndef ADIOS_BUFFER_H
+#define ADIOS_BUFFER_H
+
+#include "adios_types.h"
+
+void      adios_buffer_size_requested_set (uint64_t v);
+uint64_t  adios_buffer_size_requested_get (void);
+void      adios_buffer_size_max_set (uint64_t v);
+void      adios_buffer_size_remaining_set (uint64_t v);
+void      adios_buffer_alloc_percentage_set (int v);
+void      adios_buffer_alloc_when_set (enum ADIOS_BUFFER_ALLOC_WHEN v);
+
+enum ADIOS_BUFFER_ALLOC_WHEN adios_buffer_alloc_when_get (void);
+
+int adios_set_buffer_size (void);
+uint64_t adios_method_buffer_alloc (uint64_t size);
+int adios_method_buffer_free (uint64_t size);
+
+#endif
diff --git a/src/common_adios.c b/src/common_adios.c
new file mode 100644
index 0000000..80f1853
--- /dev/null
+++ b/src/common_adios.c
@@ -0,0 +1,712 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdint.h>
+
+// xml parser
+#include <mxml.h>
+
+#include "common_adios.h"
+#include "adios_transport_hooks.h"
+#include "adios_bp_v1.h"
+#include "adios_internals.h"
+#include "adios_internals_mxml.h"
+#include "buffer.h"
+
+extern struct adios_transport_struct * adios_transports;
+
+///////////////////////////////////////////////////////////////////////////////
+int common_adios_init (const char * config)
+{
+    // parse the config file
+    return adios_parse_config (config);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// all XML file pieces will be provided by another series of calls
+int common_adios_init_noxml ()
+{
+    return adios_local_config ();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int common_adios_finalize (int mype)
+{
+    struct adios_method_list_struct * m;
+
+    for (m = adios_get_methods (); m; m = m->next)
+    {
+        if (   m->method->m != ADIOS_METHOD_UNKNOWN
+            && m->method->m != ADIOS_METHOD_NULL
+            && adios_transports [m->method->m].adios_finalize_fn
+           )
+        {
+            adios_transports [m->method->m].adios_finalize_fn (mype, m->method);
+        }
+    }
+
+    adios_cleanup ();
+
+    return 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int common_adios_allocate_buffer (enum ADIOS_BUFFER_ALLOC_WHEN adios_buffer_alloc_when
+                                 ,uint64_t buffer_size)
+{
+    adios_buffer_size_requested_set (buffer_size * 1024 * 1024);
+    adios_buffer_alloc_when_set (adios_buffer_alloc_when);
+
+    return adios_set_buffer_size ();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int common_adios_open (int64_t * fd, const char * group_name
+                ,const char * name, const char * file_mode, void * comm
+               )
+{
+    int64_t group_id = 0;
+    struct adios_file_struct * fd_p = (struct adios_file_struct *)
+                                  malloc (sizeof (struct adios_file_struct));
+    struct adios_group_struct * g = 0;
+    struct adios_method_list_struct * methods = 0;
+    enum ADIOS_METHOD_MODE mode;
+
+    adios_common_get_group (&group_id, group_name);
+    g = (struct adios_group_struct *) group_id;
+    methods = g->methods;
+
+    if (!strcasecmp (file_mode, "r"))
+        mode = adios_mode_read;
+    else
+        if (!strcasecmp (file_mode, "w"))
+            mode = adios_mode_write;
+        else
+            if (!strcasecmp (file_mode, "a"))
+                mode = adios_mode_append;
+            else
+                if (!strcasecmp (file_mode, "u"))
+                    mode = adios_mode_update;
+                else
+                {
+                    fprintf (stderr, "adios_open: unknown file mode: %s\n"
+                            ,file_mode
+                            );
+
+                    *fd = 0;
+
+                    return 1;
+                }
+
+    fd_p->name = strdup (name);
+    fd_p->subfile_name = 0;
+    fd_p->group = g;
+    fd_p->mode = mode;
+    fd_p->data_size = 0;
+    fd_p->buffer = 0;
+    fd_p->offset = 0;
+    fd_p->bytes_written = 0;
+    fd_p->buffer_size = 0;
+    fd_p->vars_start = 0;
+    fd_p->vars_written = 0;
+    fd_p->write_size_bytes = 0;
+    fd_p->base_offset = 0;
+    fd_p->pg_start_in_file = 0;
+
+    if (mode != adios_mode_read)
+        g->time_index++;
+
+    while (methods)
+    {
+        if (   methods->method->m != ADIOS_METHOD_UNKNOWN
+            && methods->method->m != ADIOS_METHOD_NULL
+            && adios_transports [methods->method->m].adios_open_fn
+           )
+        {
+            adios_transports [methods->method->m].adios_open_fn
+                                                 (fd_p, methods->method, comm);
+        }
+
+        methods = methods->next;
+    }
+
+    *fd = (int64_t) fd_p;
+
+    return 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int common_adios_group_size (int64_t fd_p
+                     ,uint64_t data_size
+                     ,uint64_t * total_size
+                     )
+{
+    struct adios_file_struct * fd = (struct adios_file_struct *) fd_p;
+    if (!fd)
+    {
+        fprintf (stderr, "Invalid handle passed to adios_group_size\n");
+
+        return 1;
+    }
+    struct adios_method_list_struct * m = fd->group->methods;
+    if (m && m->next == NULL && m->method->m == ADIOS_METHOD_NULL)
+    {
+        // nothing to do so just return
+        fd->shared_buffer = adios_flag_no;
+        fd->write_size_bytes = 0;
+        fd->buffer = 0;
+        *total_size = 0;
+        return 0;
+    }
+
+    fd->write_size_bytes = data_size;
+
+    uint64_t overhead = adios_calc_overhead_v1 (fd);
+
+    *total_size = data_size + overhead;
+
+    // try to reserve a buffer using the adios_method_buffer_alloc
+    // if it does not give the correct amount, overflow.  Make sure
+    // the amount given is big enough for the first part of the file.
+
+    fd->write_size_bytes += overhead;
+
+    uint64_t allocated = adios_method_buffer_alloc (fd->write_size_bytes);
+    if (allocated != fd->write_size_bytes)
+    {
+        fd->shared_buffer = adios_flag_no;
+
+        fprintf (stderr, "adios_group_size (%s): Not buffering. "
+                         "needs: %llu available: %llu.\n"
+                ,fd->group->name, fd->write_size_bytes, allocated
+                );
+    }
+    else
+    {
+        fd->shared_buffer = adios_flag_yes;
+    }
+
+    // call each transport method to coordinate the write and handle
+    // if an overflow is detected.
+    // now tell each transport attached that it is being written
+    while (m)
+    {
+        enum ADIOS_FLAG should_buffer = adios_flag_yes;
+        if (   m->method->m != ADIOS_METHOD_UNKNOWN
+            && m->method->m != ADIOS_METHOD_NULL
+            && adios_transports [m->method->m].adios_should_buffer_fn
+           )
+        {
+            should_buffer = adios_transports [m->method->m].
+                                            adios_should_buffer_fn (fd
+                                                                   ,m->method
+                                                                   );
+        }
+
+        if (should_buffer == adios_flag_no)     // can't write directly since
+            fd->shared_buffer = adios_flag_no;  // some might want to share
+
+        m = m->next;
+    }
+
+    if (fd->shared_buffer == adios_flag_no)
+    {
+        adios_method_buffer_free (allocated);
+        fd->buffer = 0;
+        fd->offset = 0;
+        fd->bytes_written = 0;
+    }
+    else
+    {
+        fd->buffer = malloc (fd->write_size_bytes);
+        fd->buffer_size = fd->write_size_bytes;
+        fd->offset = 0;
+        fd->bytes_written = 0;
+        if (!fd->buffer)
+        {
+            fprintf (stderr, "Cannot allocate %llu bytes for buffered output.\n",
+                    fd->write_size_bytes);
+
+            return 1;
+        }
+        else
+        {
+            // write the process group header
+            adios_write_process_group_header_v1 (fd, *total_size);
+
+            // setup for writing vars
+            adios_write_open_vars_v1 (fd);
+        }
+    }
+
+    // each var will be added to the buffer by the adios_write calls
+    // attributes will be added by adios_close
+
+    return 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/* common_adios_write is just a partial implementation. It expects filled out
+ * structures. This is because C and Fortran implementations of adios_write are 
+ * different for some part and this is the common part.
+ */
+int common_adios_write (struct adios_file_struct * fd, struct adios_var_struct * v, void * var)
+{
+    struct adios_method_list_struct * m = fd->group->methods;
+
+    if (fd->shared_buffer == adios_flag_yes)
+    {
+        // var payload sent for sizing information
+        adios_write_var_header_v1 (fd, v);
+
+        // write payload
+        adios_write_var_payload_v1 (fd, v);
+    }
+
+    // now tell each transport attached that it is being written
+    while (m)
+    {
+        if (   m->method->m != ADIOS_METHOD_UNKNOWN
+            && m->method->m != ADIOS_METHOD_NULL
+            && adios_transports [m->method->m].adios_write_fn
+           )
+        {
+            adios_transports [m->method->m].adios_write_fn
+                                   (fd, v, var, m->method);
+        }
+
+        m = m->next;
+    }
+
+    if (v->dimensions)
+    {
+        v->data = 0;
+    }
+
+    return 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int common_adios_get_write_buffer (int64_t fd_p, const char * name
+                           ,uint64_t * size
+                           ,void ** buffer
+                           )
+{
+    struct adios_file_struct * fd = (struct adios_file_struct *) fd_p;
+    if (!fd)
+    {
+        fprintf (stderr, "Invalid handle passed to adios_get_write_buffer\n");
+
+        return 1;
+    }
+    struct adios_var_struct * v = fd->group->vars;
+    struct adios_method_list_struct * m = fd->group->methods;
+
+    v = adios_find_var_by_name (v, name, fd->group->all_unique_var_names);
+
+    if (!v)
+    {
+        fprintf (stderr
+                ,"Bad var name (ignored): '%s' (%c%c%c)\n"
+                ,name, name[0], name[1], name[2]
+                );
+
+        return 1;
+    }
+
+    if (fd->mode == adios_mode_read)
+    {
+        fprintf (stderr, "write attempted on %s in %s.  This was opened for"
+                         " read\n"
+                ,name , fd->name
+                );
+
+        return 1;
+    }
+
+    // since we are only getting one buffer, get it from the first
+    // transport method that can provide it.
+    while (m)
+    {
+        if (   m->method->m != ADIOS_METHOD_UNKNOWN
+            && m->method->m != ADIOS_METHOD_NULL
+            && adios_transports [m->method->m].adios_get_write_buffer_fn
+           )
+        {
+            adios_transports [m->method->m].adios_get_write_buffer_fn
+                                (fd, v, size, buffer, m->method);
+            m = 0;
+        }
+        else
+            m = m->next;
+    }
+
+    return 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int common_adios_read (int64_t fd_p, const char * name, void * buffer
+               ,uint64_t buffer_size
+               )
+{
+    struct adios_file_struct * fd = (struct adios_file_struct *) fd_p;
+    if (!fd)
+    {
+        fprintf (stderr, "Invalid handle passed to adios_read\n");
+
+        return 1;
+    }
+    struct adios_var_struct * v;
+    struct adios_method_list_struct * m = fd->group->methods;
+
+    if (m && m->next == NULL && m->method->m == ADIOS_METHOD_NULL)
+    {
+        // nothing to do so just return
+        return 0;
+    }
+
+    if (!(fd->mode == adios_mode_read))
+    {
+        fprintf (stderr, "read attempted on %s which was opened for write\n"
+                ,fd->name
+                );
+
+        return 1;
+    }
+
+    v = adios_find_var_by_name (fd->group->vars, name
+                               ,fd->group->all_unique_var_names
+                               );
+    if (v)
+    {
+        // since can only read from one place into the buffer,
+        // read from the first transport method that can
+        while (m)
+        {
+            if (   m->method->m != ADIOS_METHOD_UNKNOWN
+                && m->method->m != ADIOS_METHOD_NULL
+                && adios_transports [m->method->m].adios_read_fn
+               )
+            {
+                adios_transports [m->method->m].adios_read_fn
+                                     (fd, v, buffer, buffer_size, m->method);
+                m = 0;
+            }
+            else
+                m = m->next;
+	}
+    }
+    else
+    {
+        fprintf (stderr, "var %s in file %s not found on read\n"
+                ,name, fd->name
+                );
+
+        return 1;
+    }
+
+    return 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int common_adios_set_path (int64_t fd_p, const char * path)
+{
+    struct adios_file_struct * fd = (struct adios_file_struct *) fd_p;
+    if (!fd)
+    {
+        fprintf (stderr, "Invalid handle passed to adios_set_path\n");
+
+        return 1;
+    }
+    struct adios_group_struct * t = fd->group;
+    struct adios_var_struct * v = t->vars;
+    struct adios_attribute_struct * a = t->attributes;
+
+    while (v)
+    {
+        if (v->path)
+        {
+            free (v->path);
+        }
+
+        v->path = strdup (path);
+
+        v = v->next;
+    }
+
+    while (a)
+    {
+        if (a->path)
+        {
+            free (a->path);
+        }
+
+        a->path = strdup (path);
+
+        a = a->next;
+    }
+
+    return 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int common_adios_set_path_var (int64_t fd_p, const char * path
+                       ,const char * name
+                       )
+{
+    struct adios_file_struct * fd = (struct adios_file_struct *) fd_p;
+    if (!fd)
+    {
+        fprintf (stderr, "Invalid handle passed to adios_set_path_var\n");
+
+        return 1;
+    }
+    struct adios_group_struct * t = fd->group;
+    struct adios_var_struct * v = t->vars;
+
+    // check for vars and then attributes
+    v = adios_find_var_by_name (t->vars, name, fd->group->all_unique_var_names);
+
+    if (v)
+    {
+        if (v->path)
+        {
+            free (v->path);
+        }
+
+        v->path = strdup (path);
+    }
+    else
+    {
+        fprintf (stderr, "adios_set_path_var (path=%s, var=%s): var not found\n"
+                ,path, name
+                );
+
+        return 1;
+    }
+
+    return 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// hint that we reached the end of an iteration (for asynchronous pacing)
+int common_adios_end_iteration ()
+{
+    struct adios_method_list_struct * m;
+
+    for (m = adios_get_methods (); m; m = m->next)
+    {
+        if (   m->method->m != ADIOS_METHOD_UNKNOWN
+            && m->method->m != ADIOS_METHOD_NULL
+            && adios_transports [m->method->m].adios_end_iteration_fn
+           )
+        {
+            adios_transports [m->method->m].adios_end_iteration_fn
+                                                (m->method);
+        }
+    }
+
+    return 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// hint to start communicating
+int common_adios_start_calculation ()
+{
+    struct adios_method_list_struct * m;
+
+    for (m = adios_get_methods (); m; m = m->next)
+    {
+        if (   m->method->m != ADIOS_METHOD_UNKNOWN
+            && m->method->m != ADIOS_METHOD_NULL
+            && adios_transports [m->method->m].adios_start_calculation_fn
+           )
+        {
+            adios_transports [m->method->m].adios_start_calculation_fn
+                                                  (m->method);
+        }
+    }
+
+    return 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// hint to stop communicating
+int common_adios_stop_calculation ()
+{
+    struct adios_method_list_struct * m;
+
+    for (m = adios_get_methods (); m; m = m->next)
+    {
+        if (   m->method->m != ADIOS_METHOD_UNKNOWN
+            && m->method->m != ADIOS_METHOD_NULL
+            && adios_transports [m->method->m].adios_stop_calculation_fn
+           )
+        {
+            adios_transports [m->method->m].adios_stop_calculation_fn
+                                                   (m->method);
+        }
+    }
+
+    return 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+int common_adios_close (int64_t fd_p)
+{
+    struct adios_file_struct * fd = (struct adios_file_struct *) fd_p;
+    if (!fd)
+    {
+        fprintf (stderr, "Invalid handle passed to adios_close\n");
+
+        return 1;
+    }
+    struct adios_method_list_struct * m = fd->group->methods;
+    if (m && m->next == NULL && m->method->m == ADIOS_METHOD_NULL)
+    {
+        // nothing to do so just return
+        return 0;
+    }
+
+    struct adios_attribute_struct * a = fd->group->attributes;
+    struct adios_var_struct * v = fd->group->vars;
+
+    if (fd->shared_buffer == adios_flag_yes)
+    {
+        adios_write_close_vars_v1 (fd);
+
+        adios_write_open_attributes_v1 (fd);
+
+        while (a)
+        {
+            adios_write_attribute_v1 (fd, a);
+
+            a = a->next;
+        }
+
+        adios_write_close_attributes_v1 (fd);
+    }
+
+    // in order to get the index assembled, we need to do it in the
+    // transport once we have collected all of the pieces
+
+    // now tell all of the transports to write the buffer during close
+    for (;m; m = m->next)
+    {
+        if (   m->method->m != ADIOS_METHOD_UNKNOWN
+            && m->method->m != ADIOS_METHOD_NULL
+            && adios_transports [m->method->m].adios_close_fn
+           )
+        {
+            adios_transports [m->method->m].adios_close_fn
+                                 (fd, m->method);
+        }
+    }
+
+    if (fd->shared_buffer == adios_flag_yes)
+    {
+        adios_method_buffer_free (fd->write_size_bytes);
+        free (fd->buffer);
+        fd->buffer_size = 0;
+        fd->buffer = 0;
+        fd->offset = 0;
+    }
+
+    while (v)
+    {
+        v->write_offset = 0;
+        if (v->data)
+        {
+            free (v->data);
+            v->data = 0;
+        }
+
+        v = v->next;
+    }
+
+    while (fd->group->vars_written)
+    {
+        if (fd->group->vars_written->name)
+            free (fd->group->vars_written->name);
+        if (fd->group->vars_written->path)
+            free (fd->group->vars_written->path);
+
+        while (fd->group->vars_written->dimensions)
+        {
+            struct adios_dimension_struct * dimensions
+                            = fd->group->vars_written->dimensions->next;
+
+            free (fd->group->vars_written->dimensions);
+            fd->group->vars_written->dimensions = dimensions;
+        }
+
+		// NCSU - Clear stat
+        if (fd->group->vars_written->stats)
+		{
+            uint8_t j = 0, idx = 0;
+            uint8_t c = 0, count = adios_get_stat_set_count(fd->group->vars_written->type);
+
+            for (c = 0; c < count; c ++)
+            {
+                while (fd->group->vars_written->bitmap >> j)
+                {
+                    if ((fd->group->vars_written->bitmap >> j) & 1)
+                    {
+                        if (j == adios_statistic_hist)
+                        {
+                            struct adios_hist_struct * hist = (struct adios_hist_struct *) (fd->group->vars_written->stats[c][idx].data);
+                            free (hist->breaks);
+                            free (hist->frequencies);
+                            free (hist);
+                        }
+                        else
+                            free (fd->group->vars_written->stats[c][idx].data);
+
+                        idx ++;
+                    }
+                    j ++;
+                }
+                free (fd->group->vars_written->stats[c]);
+            }
+            free (fd->group->vars_written->stats);
+		}
+        if (fd->group->vars_written->data)
+            free (fd->group->vars_written->data);
+
+        v = fd->group->vars_written->next;
+        free (fd->group->vars_written);
+        fd->group->vars_written = v;
+    }
+
+    if (fd->name)
+    {
+        free (fd->name);
+        fd->name = 0;
+    }
+    if (fd->subfile_name)
+    {
+        free (fd->subfile_name);
+        fd->subfile_name = 0;
+    }
+
+    free ((void *) fd_p);
+
+    return 0;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// Methods normally only called by the XML parser
+//////////////////////////////////////////////////////////////////////////////
+
+// adios_common_declare_group is in adios_internals.c
+// adios_common_define_var is in adios_internals.c
+// adios_common_define_attribute is in adios_internals.c
+// adios_common_select_method is in adios_internals.c
diff --git a/src/common_adios.h b/src/common_adios.h
new file mode 100644
index 0000000..cc123c3
--- /dev/null
+++ b/src/common_adios.h
@@ -0,0 +1,96 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#ifndef COMMON_ADIOS_H
+#define COMMON_ADIOS_H
+
+#include <stdint.h>
+#include "adios_types.h"
+#include "adios_internals.h"
+
+/* Write functions for ADIOS
+ *
+ * Used by the write C api (adios.c) and Fortran api (adiosf.c)
+ */
+
+// Global setup using the XML file
+int common_adios_init (const char * config);
+
+// setup, but all XML file pieces will be provided by another series of calls
+// yet to be worked out
+// TODO
+int common_adios_init_noxml (void);
+
+int common_adios_finalize (int mype);
+
+int common_adios_allocate_buffer (enum ADIOS_BUFFER_ALLOC_WHEN adios_buffer_alloc_when
+                                 ,uint64_t buffer_size);
+
+// end user calls for each I/O operation
+// modes = "r" = "read", "w" = "write", "a" = "append", "u" = "update"
+int common_adios_open (int64_t * fd, const char * group_name, const char * name
+               ,const char * mode, void * comm
+               );
+
+int common_adios_group_size (int64_t fd_p, uint64_t data_size
+                     ,uint64_t * total_size
+                     );
+
+//int common_adios_write (int64_t fd_p, const char * name, void * var);
+int common_adios_write (struct adios_file_struct * fd, struct adios_var_struct * v, void * var);
+
+int common_adios_get_write_buffer (int64_t fd_p, const char * name
+                           ,uint64_t * size
+                           ,void ** buffer
+                           );
+
+int common_adios_read (int64_t fd_p, const char * name, void * buffer
+               ,uint64_t buffer_size
+               );
+
+int common_adios_set_path (int64_t fd_p, const char * path);
+
+int common_adios_set_path_var (int64_t fd_p, const char * path, const char * name);
+
+int common_adios_end_iteration (void);
+
+int common_adios_start_calculation (void);
+
+int common_adios_stop_calculation (void);
+
+int common_adios_close (int64_t fd_p);
+
+// Generally internal use called when parsing the XML file
+int common_adios_declare_group (int64_t * id, const char * name
+                        ,const char * coordination_comm
+                        ,const char * coordination_var
+                        ,const char * time_index
+                        );
+
+int common_adios_define_var (int64_t group_id, const char * name
+                     ,const char * path, int type
+                     ,const char * dimensions
+                     ,const char * global_dimensions
+                     ,const char * local_offsets
+                     );
+
+int common_adios_define_attribute (int64_t group, const char * name
+                           ,const char * path, enum ADIOS_DATATYPES type
+                           ,const char * value, const char * var
+                           );
+
+int common_adios_select_method (int priority, const char * method
+                        ,const char * parameters, const char * type
+                        ,const char * base_path, int iters
+                        );
+
+int common_adios_select_method (int priority, const char * method
+                        ,const char * parameters, const char * type
+                        ,const char * base_path, int iters
+                        );
+
+#endif
diff --git a/src/common_read.c b/src/common_read.c
new file mode 100644
index 0000000..93c19d2
--- /dev/null
+++ b/src/common_read.c
@@ -0,0 +1,361 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "adios.h"
+#include "common_read.h"
+#include "adios_read.h"
+#include "adios_error.h"
+#include "adios_read_hooks.h"
+#include "futils.h"
+#define BYTE_ALIGN 8
+
+#ifdef DMALLOC
+#include "dmalloc.h"
+#endif
+
+
+/* Note: MATLAB reloads the mex64 files each time, so all static variables get the original value.
+   Therefore static variables cannot be used to pass info between two Matlab/ADIOS calls */
+static struct adios_read_hooks_struct * adios_read_hooks = 0;
+static enum ADIOS_READ_METHOD selected_method = ADIOS_READ_METHOD_BP;
+
+struct common_read_internals_struct {
+    enum ADIOS_READ_METHOD method;
+    struct adios_read_hooks_struct * read_hooks; /* Save adios_read_hooks for each fopen for Matlab */
+};
+
+
+int common_read_set_read_method(enum ADIOS_READ_METHOD method)
+{
+    int retval = 0;
+    if ((int)method < 0 || (int)method >= ADIOS_READ_METHOD_COUNT) {
+        error(err_invalid_read_method, "Invalid read method (=%d) passed to adios_set_read_method().", (int)method);
+        retval = -err_invalid_read_method;
+    } else {
+        selected_method = method;
+    }
+    return retval;
+}
+
+
+int common_read_init(MPI_Comm comm)
+{
+    adios_read_hooks_init (&adios_read_hooks); // init the adios_read_hooks_struct if not yet initialized    
+    return adios_read_hooks[selected_method].adios_init_fn (comm);
+}
+
+int common_read_finalize()
+{
+    return adios_read_hooks[selected_method].adios_finalize_fn ();
+}
+
+ADIOS_FILE * common_read_fopen (const char * fname, MPI_Comm comm)
+{
+    ADIOS_FILE * fp;
+    struct common_read_internals_struct * internals = 
+            (struct common_read_internals_struct *) calloc(1,sizeof(struct common_read_internals_struct));
+
+    adios_errno = 0;
+    adios_read_hooks_init (&adios_read_hooks); // init the adios_read_hooks_struct if not yet initialized    
+
+    internals->method = selected_method;
+    internals->read_hooks = adios_read_hooks;
+
+    fp = adios_read_hooks[internals->method].adios_fopen_fn (fname, comm);
+
+
+    // save the method in fp->internal_data
+    if (fp)
+        fp->internal_data = (void *)internals;
+    return fp;
+}
+
+int common_read_fclose (ADIOS_FILE *fp) 
+{
+    struct common_read_internals_struct * internals;
+    int retval;
+    
+    adios_errno = 0;
+    if (fp) {
+        internals = (struct common_read_internals_struct *) fp->internal_data;
+        retval = internals->read_hooks[internals->method].adios_fclose_fn (fp);
+    } else {
+        error( err_invalid_file_pointer, "Invalid file pointer at adios_fclose()");
+        retval = -err_invalid_file_pointer;
+    }
+    return retval;
+}
+
+void common_read_reset_dimension_order (ADIOS_FILE *fp, int is_fortran)
+{
+    struct common_read_internals_struct * internals;
+
+    adios_errno = 0;
+    if (fp) {
+        internals = (struct common_read_internals_struct *) fp->internal_data;
+        internals->read_hooks[internals->method].adios_reset_dimension_order_fn (fp);
+    } else {
+        error( err_invalid_file_pointer, "Invalid file pointer at adios_reset_dimension_order()");
+    }
+}
+
+ADIOS_GROUP * common_read_gopen (ADIOS_FILE *fp, const char * grpname)
+{
+    struct common_read_internals_struct * internals;
+    ADIOS_GROUP * retval;
+    
+    adios_errno = 0;
+    if (fp) {
+        internals = (struct common_read_internals_struct *) fp->internal_data;
+        retval = internals->read_hooks[internals->method].adios_gopen_fn (fp, grpname);
+    } else {
+        error( err_invalid_file_pointer, "Invalid file pointer at adios_gopen()");
+        retval = NULL;
+    }
+    return retval;
+}
+
+ADIOS_GROUP * common_read_gopen_byid (ADIOS_FILE *fp, int grpid)
+{
+    struct common_read_internals_struct * internals;
+    ADIOS_GROUP * retval;
+    
+    adios_errno = 0;
+    if (fp) {
+        internals = (struct common_read_internals_struct *) fp->internal_data;
+        retval = internals->read_hooks[internals->method].adios_gopen_byid_fn (fp, grpid);
+    } else {
+        error( err_invalid_file_pointer, "Invalid file pointer at adios_gopen()");
+        retval = NULL;
+    }
+    //printf("%s: gp=%x, gp->fp=%x, gp->gh=%x\n",__func__, retval, retval->fp, retval->gh);
+    return retval;
+}
+                   
+int common_read_gclose (ADIOS_GROUP *gp)
+{
+    struct common_read_internals_struct * internals;
+    int retval;
+    
+    adios_errno = 0;
+    if (gp) {
+        //printf("%s: gp=%x, gp->fp=%x, gp->gh=%x\n",__func__, gp, gp->fp, gp->gh);
+        internals = (struct common_read_internals_struct *) gp->fp->internal_data;
+        retval = internals->read_hooks[internals->method].adios_gclose_fn (gp);
+    } else {
+        error(err_invalid_group_struct, "Null pointer passed as group to adios_gclose()");
+        retval = -err_invalid_group_struct;
+    }
+    return retval;
+}
+
+int common_read_get_attr (ADIOS_GROUP * gp, const char * attrname, enum ADIOS_DATATYPES * type,
+                    int * size, void ** data)
+{
+    struct common_read_internals_struct * internals;
+    int retval;
+    
+    adios_errno = 0;
+    if (gp) {
+        internals = (struct common_read_internals_struct *) gp->fp->internal_data;
+        retval = internals->read_hooks[internals->method].adios_get_attr_fn (gp, attrname, type, size, data);
+    } else {
+        error(err_invalid_group_struct, "Null pointer passed as group to adios_get_attr()");
+        retval = -err_invalid_group_struct;
+    }
+    return retval;
+}
+
+int common_read_get_attr_byid (ADIOS_GROUP * gp, int attrid, 
+                    enum ADIOS_DATATYPES * type, int * size, void ** data)
+{
+    struct common_read_internals_struct * internals;
+    int retval;
+    
+    adios_errno = 0;
+    if (gp) {
+        internals = (struct common_read_internals_struct *) gp->fp->internal_data;
+        retval = internals->read_hooks[internals->method].adios_get_attr_byid_fn (gp, attrid, type, size, data);
+    } else {
+        error(err_invalid_group_struct, "Null pointer passed as group to adios_get_attr_byid()");
+        retval = -err_invalid_group_struct;
+    }
+    return retval;
+}
+
+ADIOS_VARINFO * common_read_inq_var (ADIOS_GROUP *gp, const char * varname) 
+{
+    struct common_read_internals_struct * internals;
+    ADIOS_VARINFO * retval;
+    
+    adios_errno = 0;
+    if (gp) {
+        internals = (struct common_read_internals_struct *) gp->fp->internal_data;
+        retval = internals->read_hooks[internals->method].adios_inq_var_fn (gp, varname);
+    } else {
+        error(err_invalid_group_struct, "Null pointer passed as group to adios_inq_var_byid()");
+        retval = NULL;
+    }
+    return retval;
+}
+
+ADIOS_VARINFO * common_read_inq_var_byid (ADIOS_GROUP *gp, int varid)
+{
+    struct common_read_internals_struct * internals;
+    ADIOS_VARINFO * retval;
+    
+    adios_errno = 0;
+    if (gp) {
+        internals = (struct common_read_internals_struct *) gp->fp->internal_data;
+        retval = internals->read_hooks[internals->method].adios_inq_var_byid_fn (gp, varid);
+    } else {
+        error(err_invalid_group_struct, "Null pointer passed as group to adios_inq_var_byid()");
+        retval = NULL;
+    }
+    return retval;
+}
+
+void common_read_free_varinfo (ADIOS_VARINFO *vp)
+{
+    if (vp) {
+        if (vp->dims)   free(vp->dims);
+        if (vp->value)  free(vp->value);
+        if (vp->gmin && vp->gmin != vp->value)   free(vp->gmin);
+        if (vp->gmax && vp->gmax != vp->value)   free(vp->gmax);
+        //if (vp->mins)   free(vp->mins);
+        //if (vp->maxs)   free(vp->maxs);
+        free(vp);
+    }
+}
+
+
+int64_t common_read_read_var (ADIOS_GROUP * gp, const char * varname,
+                        const uint64_t * start, const uint64_t * count,
+                        void * data)
+{
+    struct common_read_internals_struct * internals;
+    int64_t retval;
+    
+    adios_errno = 0;
+    if (gp) {
+        internals = (struct common_read_internals_struct *) gp->fp->internal_data;
+        retval = internals->read_hooks[internals->method].adios_read_var_fn (gp, varname, start, count, data);
+    } else {
+        error(err_invalid_group_struct, "Null pointer passed as group to adios_read_var()");
+        retval = -err_invalid_group_struct;
+    }
+    return retval;
+}
+
+int64_t common_read_read_var_byid (ADIOS_GROUP    * gp,
+                             int              varid,
+                             const uint64_t  * start,
+                             const uint64_t  * count,
+                             void           * data)
+{
+    struct common_read_internals_struct * internals;
+    int64_t retval;
+    
+    adios_errno = 0;
+    if (gp) {
+        internals = (struct common_read_internals_struct *) gp->fp->internal_data;
+        retval = internals->read_hooks[internals->method].adios_read_var_byid_fn (gp, varid, start, count, data);
+    } else {
+        error(err_invalid_group_struct, "Null pointer passed as group to adios_read_var_byid()");
+        retval = -err_invalid_group_struct;
+    }
+    return retval;
+}
+
+const char * common_read_type_to_string (enum ADIOS_DATATYPES type)
+{
+    switch (type)
+    {
+        case adios_unsigned_byte:    return "unsigned byte";
+        case adios_unsigned_short:   return "unsigned short";
+        case adios_unsigned_integer: return "unsigned integer";
+        case adios_unsigned_long:    return "unsigned long long";
+
+        case adios_byte:             return "byte";
+        case adios_short:            return "short";
+        case adios_integer:          return "integer";
+        case adios_long:             return "long long";
+
+        case adios_real:             return "real";
+        case adios_double:           return "double";
+        case adios_long_double:      return "long double";
+
+        case adios_string:           return "string";
+        case adios_complex:          return "complex";
+        case adios_double_complex:   return "double complex";
+
+        default:
+        {
+            static char buf [50];
+            sprintf (buf, "(unknown: %d)", type);
+            return buf;
+        }
+    }
+}
+
+int common_read_type_size(enum ADIOS_DATATYPES type, void *data)
+{
+    return bp_get_type_size(type, data);
+}
+
+
+void common_read_print_groupinfo (ADIOS_GROUP *gp) 
+{
+    int i;
+    printf ("---------------------------\n");
+    printf ("     var information\n");
+    printf ("---------------------------\n");
+    printf ("    var id\tname\n");
+    if (gp->var_namelist) {
+        for (i=0; i<gp->vars_count; i++)
+            printf("\t%d)\t%s\n", i, gp->var_namelist[i]);
+    }
+    printf ("---------------------------\n");
+    printf ("     attribute information\n");
+    printf ("---------------------------\n");
+    printf ("    attr id\tname\n");
+    if (gp->attr_namelist) {
+        for (i=0; i<gp->attrs_count; i++)
+            printf("\t%d)\t%s\n", i, gp->attr_namelist[i]);
+    }
+    return;
+}
+
+
+void common_read_print_fileinfo (ADIOS_FILE *fp) 
+{
+    int i;
+    printf ("---------------------------\n");
+    printf ("     group information\n");
+    printf ("---------------------------\n");
+    printf ("\t# of groups:\t%d\n"
+        "\t# of variables:\t%d\n"
+        "\t# of attributes:%d\n"
+        "\t# of timesteps:\t%d starting from %d\n",
+        fp->groups_count,
+        fp->vars_count,
+        fp->attrs_count,
+        fp->ntimesteps,
+        fp->tidx_start);
+    printf ("\t----------------\n");
+    printf ("\tgroup id\tname\n");
+    if (fp->group_namelist) {
+        for (i=0; i<fp->groups_count; i++)
+            printf("\t  %d)\t%s\n", i, fp->group_namelist[i]);
+    }
+    return;
+}
+
+
diff --git a/src/common_read.h b/src/common_read.h
new file mode 100644
index 0000000..f9b44e3
--- /dev/null
+++ b/src/common_read.h
@@ -0,0 +1,60 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/*
+ *   Internal read API for C and Fortran read APIs
+ */
+#ifndef __COMMON_READ_H__
+#define __COMMON_READ_H__
+
+#include "adios_types.h"
+#include "adios_read.h"  /* C API's struct's are used here */
+
+#ifdef _NOMPI
+    /* Sequential processes can use the library compiled with -D_NOMPI */
+#   include "mpidummy.h"
+#else
+    /* Parallel applications should use MPI to communicate file info and slices of data */
+#   include "mpi.h"
+#endif
+
+#include <stdint.h>
+
+int common_read_set_read_method (enum ADIOS_READ_METHOD method);
+ADIOS_FILE * common_read_fopen (const char * fname, MPI_Comm comm);
+int common_read_fclose (ADIOS_FILE *fp);
+void common_read_reset_dimension_order (ADIOS_FILE *fp, int is_fortran);
+ADIOS_GROUP * common_read_gopen (ADIOS_FILE *fp, const char * grpname);
+ADIOS_GROUP * common_read_gopen_byid (ADIOS_FILE *fp, int grpid);
+int common_read_gclose (ADIOS_GROUP *gp);
+ADIOS_VARINFO * common_read_inq_var (ADIOS_GROUP *gp, const char * varname);
+ADIOS_VARINFO * common_read_inq_var_byid (ADIOS_GROUP *gp, int varid);
+void common_read_free_varinfo (ADIOS_VARINFO *cp);
+int64_t common_read_read_var (ADIOS_GROUP    * gp, 
+                        const char     * varname, 
+                        const uint64_t * start,
+                        const uint64_t * count, 
+                        void           * data);
+
+int64_t common_read_read_var_byid (ADIOS_GROUP * gp, int varid,
+                             const uint64_t * start, const uint64_t * count, 
+                             void * data);
+int common_read_get_attr (ADIOS_GROUP           * gp,
+                    const char            * attrname,
+                    enum ADIOS_DATATYPES  * type,
+                    int                   * size,
+                    void                 ** data);
+
+int common_read_get_attr_byid (ADIOS_GROUP * gp, int attrid, enum ADIOS_DATATYPES * type, 
+                         int * size, void ** data); 
+
+const char * common_read_type_to_string (enum ADIOS_DATATYPES type);
+int common_read_type_size(enum ADIOS_DATATYPES type, void *data);
+
+void common_read_print_groupinfo (ADIOS_GROUP *gp);
+void common_read_print_fileinfo (ADIOS_FILE *fp);
+#endif
diff --git a/src/futils.c b/src/futils.c
new file mode 100644
index 0000000..75519a8
--- /dev/null
+++ b/src/futils.c
@@ -0,0 +1,51 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "futils.h"
+#include "bp_utils.h" // error()
+#include "adios_error.h" // err_no_memory
+
+#ifdef DMALLOC
+#include "dmalloc.h"
+#endif
+
+static int called_from_fortran = 0; // set to 1 when called from Fortran API
+void futils_called_from_fortran_set(void) {called_from_fortran = 1;}
+void futils_called_from_fortran_unset(void) {called_from_fortran = 0;}
+int futils_is_called_from_fortran(void) {return called_from_fortran;}
+
+/** Copy a C string into a Fortran CHARACTER array */
+void futils_cstr_to_fstr(const char *cs, char *fs, int flen) 
+{
+    int clen = strlen(cs);
+    if (clen > flen)
+        clen = flen;
+    strncpy(fs, cs, clen);           /* does not copy the '\0' */
+    memset(fs+clen, ' ', flen-clen); /* right pad with spaces the CHARACTER array */
+}
+
+/** Trim a Fortran string and allocate a C string and copy content to it and add '\0' 
+ *  Need to free() the string later.
+ */
+char * futils_fstr_to_cstr(const char * fs, int flen)
+{
+    char *cs;
+    int clen = flen;
+    while (clen > 0 && fs[clen-1] == ' ')
+        clen--;
+    cs = (char*) malloc ((size_t) (clen + 1));
+    if (cs == NULL) {
+        error( err_no_memory, "ERROR: Cannot allocate %d bytes for a C string in ADIOS API", clen+1);
+        return NULL;
+    }
+    strncpy (cs, fs, clen);
+    cs[clen] = '\0';
+    return cs;
+}
+
diff --git a/src/futils.h b/src/futils.h
new file mode 100644
index 0000000..49ec137
--- /dev/null
+++ b/src/futils.h
@@ -0,0 +1,28 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#ifndef _FUTILS_H_
+#define _FUTILS_H_
+
+/** Copy a C string into a Fortran CHARACTER array (of max length flen).
+    Fortran array must already be allocated in Fortran */
+void futils_cstr_to_fstr(const char *cs, char *fs, int flen);
+
+/** Trim a Fortran string and allocate a C string and copy content to it and add '\0' 
+ *  Need to free() the string later.
+ */
+char * futils_fstr_to_cstr(const char * fs, int flen);
+
+/* Indicate to ADIOS that we are calling from Fortran. 
+   It is used in the read API to know what ordering of dimensions the caller expects.
+*/
+void futils_called_from_fortran_set(void);
+void futils_called_from_fortran_unset(void);
+/* Read API asks if the caller is Fortran by this function call */
+int futils_is_called_from_fortran(void);
+
+#endif
diff --git a/src/globals.c b/src/globals.c
new file mode 100644
index 0000000..ec56ab7
--- /dev/null
+++ b/src/globals.c
@@ -0,0 +1,139 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/*
+ *   Functions, constants globally for both the Write and Read API
+ */
+
+#include "globals.h"
+
+static int globals_adios_appid = -1;
+static int globals_adios_was_set = 0;
+void globals_adios_set_application_id (int id)
+{
+    globals_adios_appid = id;
+    globals_adios_was_set = 1;
+}
+
+int globals_adios_get_application_id (int *was_set) 
+{
+    *was_set = globals_adios_was_set;
+    return globals_adios_appid;
+}
+
+#ifdef HAVE_DART
+enum DART_CONNECTION { dart_disconnected = 0, 
+                       dart_connected_from_reader = 1,
+                       dart_connected_from_writer = 2,
+                       dart_connected_from_both = 3
+                     };
+static enum DART_CONNECTION globals_adios_connected_to_dart = dart_disconnected;
+
+void globals_adios_set_dart_connected_from_reader()
+{ 
+    if (globals_adios_connected_to_dart == dart_disconnected)
+        globals_adios_connected_to_dart = dart_connected_from_reader;
+    else if (globals_adios_connected_to_dart == dart_connected_from_writer)
+        globals_adios_connected_to_dart = dart_connected_from_both;
+}
+void globals_adios_set_dart_disconnected_from_reader()
+{ 
+    if (globals_adios_connected_to_dart == dart_connected_from_reader)
+        globals_adios_connected_to_dart = dart_disconnected;
+    else if (globals_adios_connected_to_dart == dart_connected_from_both)
+        globals_adios_connected_to_dart = dart_connected_from_writer;
+}
+void globals_adios_set_dart_connected_from_writer()
+{
+    if (globals_adios_connected_to_dart == dart_disconnected)
+        globals_adios_connected_to_dart = dart_connected_from_writer;
+    else if (globals_adios_connected_to_dart == dart_connected_from_reader)
+        globals_adios_connected_to_dart = dart_connected_from_both;
+}
+void globals_adios_set_dart_disconnected_from_writer()
+{ 
+    if (globals_adios_connected_to_dart == dart_connected_from_writer)
+        globals_adios_connected_to_dart = dart_disconnected;
+    else if (globals_adios_connected_to_dart == dart_connected_from_both)
+        globals_adios_connected_to_dart = dart_connected_from_reader;
+}
+int  globals_adios_is_dart_connected()
+{ 
+    return (globals_adios_connected_to_dart != dart_disconnected);
+}
+int  globals_adios_is_dart_connected_from_reader()
+{ 
+    return (globals_adios_connected_to_dart == dart_connected_from_reader || 
+            globals_adios_connected_to_dart == dart_connected_from_both);
+}
+int  globals_adios_is_dart_connected_from_writer()
+{ 
+    return (globals_adios_connected_to_dart == dart_connected_from_writer || 
+            globals_adios_connected_to_dart == dart_connected_from_both);
+}
+int  globals_adios_is_dart_connected_from_both()
+{
+    return (globals_adios_connected_to_dart == dart_connected_from_both);
+}
+#endif
+
+#ifdef HAVE_DIMES
+enum DIMES_CONNECTION { dimes_disconnected = 0,
+                        dimes_connected_from_reader = 1,
+                        dimes_connected_from_writer = 2,
+                        dimes_connected_from_both = 3
+                     };
+static enum DIMES_CONNECTION globals_adios_connected_to_dimes = dimes_disconnected;
+
+void globals_adios_set_dimes_connected_from_reader()
+{
+    if (globals_adios_connected_to_dimes == dimes_disconnected)
+        globals_adios_connected_to_dimes = dimes_connected_from_reader;
+    else if (globals_adios_connected_to_dimes == dimes_connected_from_writer)
+        globals_adios_connected_to_dimes = dimes_connected_from_both;
+}
+void globals_adios_set_dimes_disconnected_from_reader()
+{
+    if (globals_adios_connected_to_dimes == dimes_connected_from_reader)
+        globals_adios_connected_to_dimes = dimes_disconnected;
+    else if (globals_adios_connected_to_dimes == dimes_connected_from_both)
+        globals_adios_connected_to_dimes = dimes_connected_from_writer;
+}
+void globals_adios_set_dimes_connected_from_writer()
+{
+    if (globals_adios_connected_to_dimes == dimes_disconnected)
+        globals_adios_connected_to_dimes = dimes_connected_from_writer;
+    else if (globals_adios_connected_to_dimes == dimes_connected_from_reader)
+        globals_adios_connected_to_dimes = dimes_connected_from_both;
+}
+void globals_adios_set_dimes_disconnected_from_writer()
+{
+    if (globals_adios_connected_to_dimes == dimes_connected_from_writer)
+        globals_adios_connected_to_dimes = dimes_disconnected;
+    else if (globals_adios_connected_to_dimes == dimes_connected_from_both)
+        globals_adios_connected_to_dimes = dimes_connected_from_reader;
+}
+int  globals_adios_is_dimes_connected()
+{
+    return (globals_adios_connected_to_dimes != dimes_disconnected);
+}
+int  globals_adios_is_dimes_connected_from_reader()
+{
+    return (globals_adios_connected_to_dimes == dimes_connected_from_reader ||
+            globals_adios_connected_to_dimes == dimes_connected_from_both);
+}
+int  globals_adios_is_dimes_connected_from_writer()
+{
+    return (globals_adios_connected_to_dimes == dimes_connected_from_writer ||
+            globals_adios_connected_to_dimes == dimes_connected_from_both);
+}
+int  globals_adios_is_dimes_connected_from_both()
+{
+    return (globals_adios_connected_to_dimes == dimes_connected_from_both);
+}
+#endif
+
diff --git a/src/globals.h b/src/globals.h
new file mode 100644
index 0000000..593a047
--- /dev/null
+++ b/src/globals.h
@@ -0,0 +1,55 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/*
+ *   Functions, constants globally for both the Write and Read API
+ */
+#ifndef __GLOBALS_H__
+#define __GLOBALS_H__
+
+#include "../config.h"
+
+/** Set an application ID for this program. 
+ *  This function is necessary for methods who needs a unique ID from each participating applications.
+ *  Currently, this is the DART method for code coupling of independent applications.
+ *
+ *  This function is called from the applicatin through adios_set_application_id()
+ */
+void globals_adios_set_application_id (int id);
+
+
+/** Get the application ID set by the application itself.
+  * Returns the ID set by the application, -1 if it was not set.
+  * It also returns a boolean was_set, 0 if it was not set, 1 otherwise.
+  */
+int globals_adios_get_application_id (int *was_set);
+
+
+/* Note: would be nice a <string, int> map for arbitrary globals */
+#ifdef HAVE_DART
+void globals_adios_set_dart_connected_from_reader();
+void globals_adios_set_dart_disconnected_from_reader();
+void globals_adios_set_dart_connected_from_writer();
+void globals_adios_set_dart_disconnected_from_writer();
+int  globals_adios_is_dart_connected(); // from any
+int  globals_adios_is_dart_connected_from_reader();
+int  globals_adios_is_dart_connected_from_writer();
+int  globals_adios_is_dart_connected_from_both();
+#endif /* HAVE_DART */
+
+#ifdef HAVE_DIMES
+void globals_adios_set_dimes_connected_from_reader();
+void globals_adios_set_dimes_disconnected_from_reader();
+void globals_adios_set_dimes_connected_from_writer();
+void globals_adios_set_dimes_disconnected_from_writer();
+int  globals_adios_is_dimes_connected(); // from any
+int  globals_adios_is_dimes_connected_from_reader();
+int  globals_adios_is_dimes_connected_from_writer();
+int  globals_adios_is_dimes_connected_from_both();
+#endif
+
+#endif  /*__GLOBALS_H__*/
diff --git a/src/io_timer.h b/src/io_timer.h
new file mode 100644
index 0000000..da41182
--- /dev/null
+++ b/src/io_timer.h
@@ -0,0 +1,27 @@
+/*
+ * io_timer.h
+ *
+ *  Created on: Apr 20, 2009
+ *      Author: thkorde
+ */
+
+#ifndef IO_TIMER_H_
+#define IO_TIMER_H_
+
+#if defined(USE_TIMERS)
+#define Start_Timer(timer) { timer = MPI_Wtime(); }
+#define Stop_Timer(name, timer)  { timer = MPI_Wtime() - timer; printf("(%d) %s Time = %10.8f\n", __LINE__, name, timer); }
+#define Func_Timer(name, f) { if (global_rank==0) { double callTime; Start_Timer(callTime); f; Stop_Timer(name, callTime); } else { f; } }
+#else
+#define Start_Timer(timer)  {}
+#define Stop_Timer(name, timer)   {}
+#define Func_Timer(name, f) { f; }
+#endif
+
+#if defined(USE_TIMERS) && defined(USE_TIMER_BARRIERS)
+#define Timer_Barrier(comm) { MPI_Barrier(comm); }
+#else
+#define Timer_Barrier(comm) {}
+#endif
+
+#endif /* IO_TIMER_H_ */
diff --git a/src/mpidummy.c b/src/mpidummy.c
new file mode 100644
index 0000000..aa30c76
--- /dev/null
+++ b/src/mpidummy.c
@@ -0,0 +1,101 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/*
+   A dummy MPI implementation for the BP READ API, to have an MPI-free version of the API
+*/
+
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+//#define _LARGEFILE64_SOURCE
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "mpidummy.h"
+
+#if defined(__APPLE__) || defined(__WIN32__) 
+#    define lseek64 lseek
+#    define open64  open
+#endif
+
+static char mpierrmsg[MPI_MAX_ERROR_STRING];
+
+int MPI_Init(int *argc, char ***argv) 
+{ 
+    mpierrmsg[0] = '\0'; 
+    return MPI_SUCCESS; 
+}
+
+int MPI_Barrier(MPI_Comm comm) { return MPI_SUCCESS; }
+int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm) { return MPI_SUCCESS; }
+
+int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm) { *newcomm = comm; return MPI_SUCCESS; }
+int MPI_Comm_rank(MPI_Comm comm, int *rank) { *rank = 0; return MPI_SUCCESS; }
+int MPI_Comm_size(MPI_Comm comm, int *size) { *size = 1; return MPI_SUCCESS; }
+MPI_Comm MPI_Comm_f2c(MPI_Fint comm) { return comm; }
+
+
+int MPI_File_open(MPI_Comm comm, char *filename, int amode, MPI_Info info, MPI_File *fh) 
+{
+    *fh = open64 (filename, amode);
+    if (*fh == -1) {
+        snprintf(mpierrmsg, MPI_MAX_ERROR_STRING, "File not found: %s", filename);
+        return -1;
+    }
+    return MPI_SUCCESS;
+}
+
+int MPI_File_close(MPI_File *fh) { return close(*fh); }
+
+int MPI_File_get_size(MPI_File fh, MPI_Offset *size) {
+    uint64_t curpos = lseek64(fh, 0, SEEK_CUR); // get the current seek pos
+    uint64_t endpos = lseek64(fh, 0, SEEK_END); // go to end, returned is the size in bytes
+    lseek64(fh, curpos, SEEK_SET);             // go back where we were
+    *size = (MPI_Offset) endpos;
+    //printf("MPI_File_get_size: fh=%d, size=%lld\n", fh, *size);
+    return MPI_SUCCESS;
+}
+
+int MPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status)
+{
+    // FIXME: int count can read only 2GB (*datatype size) array at max
+    uint64_t bytes_to_read = count * datatype;  // datatype should hold the size of the type, not an id
+    uint64_t bytes_read;
+    bytes_read = read (fh, buf, bytes_to_read);
+    if (bytes_read != bytes_to_read) {
+        snprintf(mpierrmsg, MPI_MAX_ERROR_STRING, "could not read %llu bytes. read only: %llu\n", bytes_to_read, bytes_read);
+        return -2;
+    }
+    *status = bytes_read;
+    //printf("MPI_File_read: fh=%d, count=%d, typesize=%d, bytes read=%lld\n", fh, count, datatype, *status);
+    return MPI_SUCCESS;
+}
+
+int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence)
+{
+    uint64_t off = (uint64_t) offset;
+    lseek64 (fh, off, whence);
+    //printf("MPI_File_seek: fh=%d, offset=%lld, whence=%d\n", fh, off, whence);
+    return MPI_SUCCESS;
+}
+
+int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count) 
+{ 
+    *count = (int) *status;
+    return MPI_SUCCESS;
+}
+
+int MPI_Error_string(int errorcode, char *string, int *resultlen)
+{
+    //sprintf(string, "Dummy lib does not know error strings. Code=%d\n",errorcode); 
+    strcpy(string, mpierrmsg);
+    *resultlen = strlen(string);
+    return MPI_SUCCESS;
+}
+
+
diff --git a/src/mpidummy.h b/src/mpidummy.h
new file mode 100644
index 0000000..741bcfc
--- /dev/null
+++ b/src/mpidummy.h
@@ -0,0 +1,62 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#ifndef __MPI_DUMMY_H__
+#define __MPI_DUMMY_H__
+
+/*
+   A dummy MPI 'implementation' for the BP READ API, to have an MPI-free version of the API
+*/
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <stdio.h>
+
+typedef int MPI_Comm;
+typedef uint64_t MPI_Status;
+typedef int MPI_File;
+typedef int MPI_Info;
+typedef int MPI_Datatype;  /* Store the byte size of a type in such vars */
+typedef uint64_t MPI_Offset;
+typedef int MPI_Fint;
+
+#define MPI_SUCCESS                 0
+#define MPI_MAX_ERROR_STRING        512
+#define MPI_MODE_RDONLY             O_RDONLY
+#define MPI_SEEK_SET                SEEK_SET
+#define MPI_SEEK_CUR                SEEK_CUR
+#define MPI_SEEK_END                SEEK_END
+#define MPI_BYTE                    1          /* I need the size of the type here */
+#define MPI_INFO_NULL               NULL
+
+#define MPI_COMM_WORLD              1
+
+#define MPI_INT                     1
+
+int MPI_Init(int *argc, char ***argv);
+
+int MPI_Barrier(MPI_Comm comm);
+int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm);
+
+int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm);
+int MPI_Comm_rank(MPI_Comm comm, int *rank);
+int MPI_Comm_size(MPI_Comm comm, int *size);
+MPI_Comm MPI_Comm_f2c(MPI_Fint comm);
+
+int MPI_File_open(MPI_Comm comm, char *filename, int amode, MPI_Info info, MPI_File *fh);
+int MPI_File_close(MPI_File *fh);
+int MPI_File_get_size(MPI_File fh, MPI_Offset *size);
+int MPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status);
+int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence);
+
+int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count);
+int MPI_Error_string(int errorcode, char *string, int *resultlen);
+
+
+#endif
diff --git a/src/nssi_staging_server.cpp b/src/nssi_staging_server.cpp
new file mode 100644
index 0000000..55c391f
--- /dev/null
+++ b/src/nssi_staging_server.cpp
@@ -0,0 +1,827 @@
+/**  @file main.c
+ *
+ *   @brief Driver for the LWFS name server.
+ *
+ *   @author Ron Oldfield (raoldfi\@sandia.gov).
+ *   $Revision: 1264 $.
+ *   $Date: 2007-02-27 15:30:26 -0700 (Tue, 27 Feb 2007) $.
+ */
+
+
+#ifndef __STDC_CONSTANT_MACROS
+#define __STDC_CONSTANT_MACROS
+#endif
+
+#include "config.h"
+
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/mman.h>
+
+#include "adios.h"
+
+#ifdef HAVE_NSSI
+#ifdef HAVE_PORTALS
+#include "nssi_ptls.h"
+#endif
+#ifdef HAVE_INFINIBAND
+#include "nssi_ib.h"
+#endif
+#include "nssi_server.h"
+#include "nssi_logger.h"
+
+#include "adios_nssi_args.h"
+#include "adios_nssi_config.h"
+#endif
+
+#include "io_timer.h"
+#include "aggregation.h"
+
+#include <mpi.h>
+#include <algorithm>
+#include <map>
+
+using namespace std;
+
+
+
+#ifdef __LIBCATAMOUNT__
+#define ntohs(value) 0
+#endif
+
+
+/* Need a struct to encapsulate open file info.
+ */
+struct open_file {
+    char    ofname[ADIOS_PATH_MAX];
+    int64_t ofdesc;
+
+    open_file(const char *name) {
+        strcpy(ofname, name);
+        ofdesc=-1;
+    }
+    open_file(const char *name, const int64_t desc) {
+        strcpy(ofname, name);
+        ofdesc=desc;
+    }
+};
+/* Need a comparison operator to pass into the open_file_map
+ */
+struct open_file_lt
+{
+    bool operator()(const struct open_file &of1, const struct open_file &of2) const
+    {
+//        log_debug(rpc_debug_level, "cqp1.qp_num == %u", cqp1.qp_num);
+//        log_debug(rpc_debug_level, "cqp2.qp_num == %u", cqp2.qp_num);
+
+        if (strcmp(of1.ofname, of2.ofname) <0) return TRUE;
+
+        return FALSE;
+    }
+};
+
+/* Map of open files */
+static map<struct open_file, int64_t, open_file_lt> open_file_map;
+typedef map<struct open_file, int64_t, open_file_lt>::iterator open_file_map_iterator_t;
+typedef pair<struct open_file, int64_t> open_file_map_pair_t;
+static pthread_mutex_t open_file_map_mutex=PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+static pthread_cond_t  open_file_map_cond =PTHREAD_COND_INITIALIZER;
+
+
+static int global_rank=-1;
+static int DEBUG=0;
+
+
+/* -------------------- PRIVATE FUNCTIONS ---------- */
+void open_file_add(char *fname, int64_t fd)
+{
+    open_file_map[fname]=fd;
+}
+
+int64_t open_file_get(char *fname)
+{
+    open_file of(fname);
+    int64_t fd=-1;
+
+    open_file_map_iterator_t iter=open_file_map.find(of);
+    if (iter != open_file_map.end()) {
+        fd=iter->second;
+    }
+
+    return(fd);
+}
+void open_file_del(char *fname)
+{
+    open_file_map_iterator_t iter;
+    open_file of(fname);
+
+    open_file_map.erase(of);
+}
+
+
+
+int grank, gsize;
+
+MPI_Comm comm_self=MPI_COMM_SELF;
+MPI_Comm comm_world=MPI_COMM_WORLD;
+
+
+/**
+ * The next 3 utility functions are lifted from IOR.
+ */
+/******************************************************************************/
+/*
+ * Extract key/value pair from hint string.
+ */
+
+void
+ExtractHint(char * settingVal,
+            char * valueVal,
+            char * hintString)
+{
+    char * settingPtr,
+         * valuePtr,
+         * tmpPtr1,
+         * tmpPtr2;
+
+    settingPtr = (char *)strtok(hintString, "=");
+    valuePtr = (char *)strtok(NULL, " \t\r\n");
+    tmpPtr1 = settingPtr;
+    tmpPtr2 = (char *)strstr(settingPtr, "MPIIO_HINT__");
+    if (tmpPtr1 == tmpPtr2) {
+        settingPtr += strlen("MPIIO_HINT__");
+    }
+    strcpy(settingVal, settingPtr);
+    strcpy(valueVal, valuePtr);
+} /* ExtractHint() */
+
+
+/******************************************************************************/
+/*
+ * Set hints for MPIIO, HDF5, or NCMPI.
+ */
+#define MAX_HINT_STR 1024
+void
+SetHints(MPI_Info * mpiHints, char * hintsFileName)
+{
+    char           hintString[MAX_HINT_STR],
+                   settingVal[MAX_HINT_STR],
+                   valueVal[MAX_HINT_STR];
+    extern char ** environ;
+    int            i;
+    FILE         * fd;
+
+    /*
+     * This routine checks for hints from the environment and/or from the
+     * hints files.  The hints are of the form:
+     * 'MPIIO_HINT__<hint>=<value>', <hint> is the full name of the hint
+     * to be set, and <value> is the hint value.
+     * E.g., 'setenv MPIIO_HINT__panfs_concurrent_write 1'
+     * or 'MPIIO_HINT__panfs_concurrent_write=1' in the hints file.
+     */
+    MPI_Info_create(mpiHints);
+
+    /* get hints from environment */
+    for (i = 0; environ[i] != NULL; i++) {
+        /* if this is an IOR_HINT, pass the hint to the info object */
+        if (strncmp(environ[i], "MPIIO_HINT", strlen("MPIIO_HINT")) == 0) {
+            strcpy(hintString, environ[i]);
+            ExtractHint(settingVal, valueVal, hintString);
+            MPI_Info_set(*mpiHints, settingVal, valueVal);
+        }
+    }
+
+    /* get hints from hints file */
+    if (strcmp(hintsFileName, "") != 0) {
+
+        /* open the hint file */
+        fd = fopen(hintsFileName, "r");
+        if (fd == NULL) {
+            printf("cannot open hints file\n");
+        } else {
+            /* iterate over hints file */
+            while(fgets(hintString, MAX_HINT_STR, fd) != NULL) {
+                if (strncmp(hintString, "MPIIO_HINT", strlen("MPIIO_HINT")) == 0) {
+                    ExtractHint(settingVal, valueVal, hintString);
+                    MPI_Info_set(*mpiHints, settingVal, valueVal);
+                }
+            }
+            /* close the hints files */
+            if (fclose(fd) != 0) printf("cannot close hints file\n");
+        }
+    }
+} /* SetHints() */
+
+
+/******************************************************************************/
+/*
+ * Show all hints (key/value pairs) in an MPI_Info object.
+ */
+
+void ShowHints(MPI_Info * mpiHints)
+{
+    char key[MPI_MAX_INFO_VAL],
+         value[MPI_MAX_INFO_VAL];
+    int  flag,
+         i,
+         nkeys;
+
+    MPI_Info_get_nkeys(*mpiHints, &nkeys);
+
+    for (i = 0; i < nkeys; i++) {
+        MPI_Info_get_nthkey(*mpiHints, i, key);
+        MPI_Info_get(*mpiHints, key, MPI_MAX_INFO_VAL-1, value, &flag);
+        printf("mpiHint[%d]: %s = %s\n", i, key, value);
+    }
+} /* ShowHints() */
+
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int adios_nssi_filter_is_anon_dim(
+        int fd,
+        const char *dimname);
+extern void adios_nssi_filter_set_anon_dim(
+        int fd,
+        const char *dimname,
+        const uint64_t dimvalue);
+
+#ifdef __cplusplus
+}
+#endif
+
+void agg_and_write(const int64_t fd)
+{
+    if (DEBUG>2) printf("myrank(%d): enter agg_and_write(fd=%ld)\n", grank, fd);
+
+    Func_Timer("try_aggregation", try_aggregation(fd););  // aggregate all varids in this file
+
+    int chunk_count=0;
+    aggregation_chunk_details_t **chunks = get_chunks(fd, &chunk_count);
+
+    for (int j=0;j<chunk_count;j++) {
+        aggregation_chunk_details_t *chunk = chunks[j];
+
+        // write all offsets for clients rank to update adios internals
+        for(int i=0;i<chunk->ndims;i++) {
+            uint64_t value=0;
+            if (DEBUG>3) printf("writing myrank(%d) chunk(%d) vpath(%s) vname(%s) opath(%s) oname(%s) odata(%lu)\n",
+                    grank, j, chunk->var_path, chunk->var_name, chunk->offset_path[i], chunk->offset_name[i], chunk->offset[i]);
+            if (adios_nssi_filter_is_anon_dim(chunk->fd, chunk->offset_name[i]) == TRUE) {
+                adios_nssi_filter_set_anon_dim(chunk->fd, chunk->offset_name[i], chunk->offset[i]);
+            } else {
+                if (DEBUG>2) printf("server_rank(%d) writing aggregated offset vname(%s)\n", global_rank, chunk->offset_name[i]);
+                Func_Timer("adios_set_path_var", adios_set_path_var(chunk->fd, chunk->offset_path[i], chunk->offset_name[i]););
+                Func_Timer("adios_write", adios_write(chunk->fd, chunk->offset_name[i], &(chunk->offset[i])););
+            }
+        }
+        for(int i=0;i<chunk->ndims;i++) {
+            uint64_t value=0;
+            if (DEBUG>3) printf("writing myrank(%d) chunk(%d) vpath(%s) vname(%s) dpath(%s) dname(%s) ddata(%lu)\n",
+                    grank, j, chunk->var_path, chunk->var_name, chunk->count_path[i], chunk->count_name[i], chunk->count[i]);
+            if (adios_nssi_filter_is_anon_dim(chunk->fd, chunk->count_name[i]) == TRUE) {
+                adios_nssi_filter_set_anon_dim(chunk->fd, chunk->count_name[i], chunk->count[i]);
+            } else {
+                if (DEBUG>2) printf("server_rank(%d) writing aggregated dim vname(%s)\n", global_rank, chunk->count_name[i]);
+                Func_Timer("adios_set_path_var", adios_set_path_var(chunk->fd, chunk->count_path[i], chunk->count_name[i]););
+                Func_Timer("adios_write", adios_write(chunk->fd, chunk->count_name[i], &(chunk->count[i])););
+            }
+        }
+
+        if (DEBUG>3) printf("writing myrank(%d) vname(%s)\n", grank, chunk->var_name);
+        if (DEBUG>2) printf("server_rank(%d) writing aggregated array vname(%s)\n", global_rank, chunk->var_name);
+        Func_Timer("adios_set_path_var", adios_set_path_var(chunk->fd, chunk->var_path, chunk->var_name););
+        Func_Timer("adios_write", adios_write(chunk->fd, chunk->var_name, chunk->buf););
+
+//        cleanup_aggregation_chunks(fd, chunk->var_name);
+    }
+
+    cleanup_aggregation_chunks(fd);
+
+    if (DEBUG>2) printf("myrank(%d): exit agg_and_write(fd=%ld)\n", grank, fd);
+
+    return;
+}
+
+/* -------------------- SERVER-SIDE STUBS ---------- */
+
+
+/**
+ * @brief Open a netcdf dataset.
+ *
+ * Open an ADIOS dataset.
+ */
+int nssi_staging_open_stub(
+        const unsigned long request_id,
+        const nssi_remote_pid *caller,
+        const adios_open_args *args,
+        const nssi_rma *data_addr,
+        const nssi_rma *res_addr)
+{
+    int rc = 0;
+    char omode[2];
+    adios_open_res res;  /* this is what we send back to the client */
+    MPI_Info mpiHints = MPI_INFO_NULL;
+
+    int64_t fd;
+
+    memset(&res, 0, sizeof(res));
+
+    if (DEBUG>2) printf("myrank(%d): enter nssi_staging_open_stub(%s, %d)\n", grank, args->fname, args->mode);
+
+//    SetHints(&mpiHints, "");
+//    ShowHints(&mpiHints);
+
+    fd = open_file_get(args->fname);
+    if (DEBUG>3) printf("myrank(%d): nssi_staging_open_stub(%s, %d) open_file_get()==%d\n", grank, args->fname, args->mode, fd);
+    if (fd == -1) {
+        omode[0]='\0';
+        omode[1]='\0';
+        switch(args->mode) {
+        case ADIOS_MODE_READ:
+            omode[0]='r';
+            break;
+        case ADIOS_MODE_WRITE:
+            omode[0]='w';
+            break;
+        case ADIOS_MODE_APPEND:
+            omode[0]='a';
+            break;
+        case ADIOS_MODE_UPDATE:
+            omode[0]='u';
+            break;
+        default:
+            break;
+        }
+
+        if (DEBUG>3) printf("start adios_open\n");
+        if (args->use_single_server==TRUE) {
+            if (DEBUG>3) printf("adios_open: using MPI_COMM_SELF\n");
+            Func_Timer("adios_open", rc = adios_open(&fd, args->gname, args->fname, omode, &comm_self););
+        } else {
+            if (DEBUG>3) printf("adios_open: using MPI_COMM_WORLD\n");
+            Func_Timer("adios_open", rc = adios_open(&fd, args->gname, args->fname, omode, &comm_world););
+        }
+        if (rc != 0) {
+            printf("Error opening file \"%s\": %d\n", args->fname, rc);
+            goto cleanup;
+        }
+        if (DEBUG>3) printf("end adios_open\n");
+
+        open_file_add(args->fname, fd);
+
+        add_file(fd, WRITE_CACHING_COLLECTIVE);
+    }
+
+    if (DEBUG>2) printf("myrank(%d): exit nssi_staging_open_stub(%s, %d): fd=%ld, fd=%p\n", grank, args->fname, args->mode, fd, fd);
+
+    res.fd=fd;
+
+cleanup:
+    /* send the ncid and return code back to client */
+    rc = nssi_send_result(caller, request_id, rc, &res, res_addr);
+
+    return rc;
+}
+
+int nssi_staging_group_size_stub(
+        const unsigned long request_id,
+        const nssi_remote_pid *caller,
+        const adios_group_size_args *args,
+        const nssi_rma *data_addr,
+        const nssi_rma *res_addr)
+{
+    int rc = 0;
+    uint64_t total_size=0;
+
+    if (DEBUG>2) printf("myrank(%d): enter nssi_staging_group_size_stub(fd=%ld, pg_size=%ld)\n", grank, args->fd, args->data_size);
+
+    Func_Timer("adios_group_size", rc = adios_group_size(args->fd, args->data_size, &total_size););
+    if (rc != 0) {
+        printf("adios_group_size failed: %d\n", rc);
+    }
+
+    /* send result to client */
+    rc = nssi_send_result(caller, request_id, rc, NULL, res_addr);
+
+    if (DEBUG>2) printf("myrank(%d): exit nssi_staging_group_size_stub(%ld)\n", grank, args->fd);
+
+    return rc;
+}
+
+int nssi_staging_close_stub(
+        const unsigned long request_id,
+        const nssi_remote_pid *caller,
+        const adios_close_args *args,
+        const nssi_rma *data_addr,
+        const nssi_rma *res_addr)
+{
+    int rc = 0;
+
+    if (DEBUG>2) printf("myrank(%d): enter nssi_staging_close_stub(%ld, %s)\n", grank, args->fd, args->fname);
+
+    agg_and_write(args->fd);
+
+    Func_Timer("adios_close", adios_close(args->fd););
+
+    open_file_del(args->fname);
+
+    /* send result to client */
+    rc = nssi_send_result(caller, request_id, rc, NULL, res_addr);
+
+    if (DEBUG>2) printf("myrank(%d): exit nssi_staging_close_stub(%ld, %s)\n", grank, args->fd, args->fname);
+
+    return rc;
+}
+
+int nssi_staging_read_stub(
+        const unsigned long request_id,
+        const nssi_remote_pid *caller,
+        const adios_read_args *args,
+        const nssi_rma *data_addr,
+        const nssi_rma *res_addr)
+{
+    int rc = 0;
+    adios_read_res res;
+    char vpathname[ADIOS_PATH_MAX];
+    int pathlen;
+    char *v=NULL;
+
+    if (DEBUG>2) printf("myrank(%d): enter nssi_staging_read_stub(%ld)\n", grank, args->fd);
+
+//    pathlen=strlen(args->vpath);
+//    if (args->vpath[pathlen-1]=='/') {
+//        sprintf(vpathname, "%s%s", args->vpath, args->vname);
+//    } else {
+//        sprintf(vpathname, "%s/%s", args->vpath, args->vname);
+//    }
+
+
+    for (int i=0;i<args->offsets.offsets_len;i++) {
+        uint64_t *odata=(uint64_t *)malloc(sizeof(uint8_t));
+        *odata = args->offsets.offsets_val[i].vdata;
+        Func_Timer("adios_set_path_var", adios_set_path_var(args->fd, args->offsets.offsets_val[i].vpath, args->offsets.offsets_val[i].vname););
+        Func_Timer("adios_read", adios_read(args->fd, args->offsets.offsets_val[i].vname, odata, 8););
+    }
+    for (int i=0;i<args->dims.dims_len;i++) {
+        uint64_t *ddata=(uint64_t *)malloc(sizeof(uint8_t));
+        *ddata = args->dims.dims_val[i].vdata;
+        Func_Timer("adios_set_path_var", adios_set_path_var(args->fd, args->dims.dims_val[i].vpath, args->dims.dims_val[i].vname););
+        Func_Timer("adios_read", adios_read(args->fd, args->dims.dims_val[i].vname, ddata, 8););
+    }
+
+    v=(char *)calloc(args->max_read, 1);
+
+    Func_Timer("adios_set_path_var", adios_set_path_var(args->fd, args->vpath, args->vname););
+    Func_Timer("adios_read", adios_read(args->fd, args->vname, v, args->max_read););
+
+    res.bytes_read=args->max_read;
+
+    Func_Timer("nssi_put_data", rc = nssi_put_data(caller, v, res.bytes_read, data_addr, -1););
+    if (rc != NSSI_OK) {
+        printf("Could not put var data on client\n");
+        goto cleanup;
+    }
+
+cleanup:
+    /* send result to client */
+    rc = nssi_send_result(caller, request_id, rc, &res, res_addr);
+
+    if (DEBUG>2) printf("myrank(%d): exit nssi_staging_read_stub(%ld)\n", grank, args->fd);
+
+    return rc;
+}
+
+int nssi_staging_write_stub(
+        const unsigned long request_id,
+        const nssi_remote_pid *caller,
+        const adios_write_args *args,
+        const nssi_rma *data_addr,
+        const nssi_rma *res_addr)
+{
+    int rc = 0;
+    adios_write_res res;
+    char vpathname[ADIOS_PATH_MAX];
+    int pathlen;
+    char *v=NULL;
+    int i=0;
+
+    if (DEBUG>2) printf("myrank(%d): enter nssi_staging_write_stub(fd=%ld, vsize=%ld)\n", grank, args->fd, args->vsize);
+
+//    pathlen=strlen(args->vpath);
+//    if (args->vpath[pathlen-1]=='/') {
+//        sprintf(vpathname, "%s%s", args->vpath, args->vname);
+//    } else {
+//        sprintf(vpathname, "%s/%s", args->vpath, args->vname);
+//    }
+
+    v=(char *)malloc(args->vsize);
+
+    Func_Timer("nssi_get_data", rc = nssi_get_data(caller, v, args->vsize, data_addr););
+    if (rc != NSSI_OK) {
+        printf("Could not get var data on client\n");
+        goto cleanup;
+    }
+
+    if (DEBUG>3) printf("server_rank(%d) vname(%s) vsize(%ld) is_scalar(%d) writer_rank(%ld)\n", global_rank, args->vname, args->vsize, args->is_scalar, args->writer_rank);
+
+    if (!args->is_scalar) {
+        if (DEBUG>2) printf("server_rank(%d) caching non-scalar vname(%s) vsize(%ld)\n", global_rank, args->vname, args->vsize);
+        if (DEBUG>3) printf("allocated v(%p), len(%ld)\n", v, args->vsize);
+        aggregation_chunk_details_t *chunk=NULL;
+        chunk = new aggregation_chunk_details_t;
+        chunk->fd = args->fd;
+        strcpy(chunk->var_path, args->vpath);
+        strcpy(chunk->var_name, args->vname);
+        chunk->ndims = args->offsets.offsets_len;
+        chunk->buf = v;
+        chunk->atype = (enum ADIOS_DATATYPES)args->atype;
+        chunk->len   = args->vsize;
+        chunk->num_elements = 1;
+        for (int i=0;i<args->dims.dims_len;i++) {
+            chunk->num_elements *= args->dims.dims_val[i].vdata;
+        }
+        chunk->offset_path = (char **)calloc(args->offsets.offsets_len, sizeof(char *));
+        chunk->offset_name = (char **)calloc(args->offsets.offsets_len, sizeof(char *));
+        chunk->offset = (uint64_t *)calloc(args->offsets.offsets_len, sizeof(uint64_t));
+        for (int i=0;i<args->offsets.offsets_len;i++) {
+            chunk->offset_path[i] = strdup(args->offsets.offsets_val[i].vpath);
+            chunk->offset_name[i] = strdup(args->offsets.offsets_val[i].vname);
+            chunk->offset[i] = args->offsets.offsets_val[i].vdata;
+        }
+        chunk->count_path = (char **)calloc(args->dims.dims_len, sizeof(char *));
+        chunk->count_name = (char **)calloc(args->dims.dims_len, sizeof(char *));
+        chunk->count  = (uint64_t *)calloc(args->dims.dims_len, sizeof(uint64_t));;
+        for (int i=0;i<args->dims.dims_len;i++) {
+            chunk->count_path[i] = strdup(args->dims.dims_val[i].vpath);
+            chunk->count_name[i] = strdup(args->dims.dims_val[i].vname);
+            chunk->count[i] = args->dims.dims_val[i].vdata;
+        }
+        add_chunk(chunk);
+
+    } else {
+        if (DEBUG>2) printf("server_rank(%d) writing scalar vname(%s) vsize(%ld)\n", global_rank, args->vname, args->vsize);
+        Func_Timer("adios_set_path_var", adios_set_path_var(args->fd, args->vpath, args->vname););
+        Func_Timer("adios_write", adios_write(args->fd, args->vname, v););
+
+        free(v);
+    }
+
+    res.bytes_written=args->vsize;
+
+cleanup:
+
+    /* send result to client */
+    rc = nssi_send_result(caller, request_id, rc, &res, res_addr);
+
+    if (DEBUG>2) printf("myrank(%d): exit nssi_staging_write_stub(fd=%ld, vsize=%ld)\n", grank, args->fd, args->vsize);
+
+    return rc;
+}
+
+int nssi_staging_start_calc_stub(
+        const unsigned long request_id,
+        const nssi_remote_pid *caller,
+        const adios_start_calc_args *args,
+        const nssi_rma *data_addr,
+        const nssi_rma *res_addr)
+{
+    int rc = 0;
+
+    if (DEBUG>2) printf("myrank(%d): enter nssi_staging_start_calc_stub(%ld)\n", grank, args->fd);
+
+    agg_and_write(args->fd);
+
+    /* send result to client */
+    rc = nssi_send_result(caller, request_id, rc, NULL, res_addr);
+
+    if (DEBUG>2) printf("myrank(%d): exit nssi_staging_start_calc_stub(%ld)\n", grank, args->fd);
+
+    return rc;
+}
+
+int nssi_staging_stop_calc_stub(
+        const unsigned long request_id,
+        const nssi_remote_pid *caller,
+        const adios_stop_calc_args *args,
+        const nssi_rma *data_addr,
+        const nssi_rma *res_addr)
+{
+    int rc = 0;
+
+    if (DEBUG>2) printf("myrank(%d): enter nssi_staging_stop_calc_stub(%ld)\n", grank, args->fd);
+
+
+    /* send result to client */
+    rc = nssi_send_result(caller, request_id, rc, NULL, res_addr);
+
+    if (DEBUG>2) printf("myrank(%d): exit nssi_staging_stop_calc_stub(%ld)\n", grank, args->fd);
+
+    return rc;
+}
+
+int nssi_staging_end_iter_stub(
+        const unsigned long request_id,
+        const nssi_remote_pid *caller,
+        const adios_end_iter_args *args,
+        const nssi_rma *data_addr,
+        const nssi_rma *res_addr)
+{
+    int rc = 0;
+
+    if (DEBUG>2) printf("myrank(%d): enter nssi_staging_end_iter_stub(%ld)\n", grank, args->fd);
+
+
+    /* send result to client */
+    rc = nssi_send_result(caller, request_id, rc, NULL, res_addr);
+
+    if (DEBUG>2) printf("myrank(%d): exit nssi_staging_end_iter_stub(%ld)\n", grank, args->fd);
+
+    return rc;
+}
+
+/* -------- END SERVER-SIDE STUBS -------------- */
+
+int nssi_staging_server_init(const char *adios_config_file)
+{
+    int rc=NSSI_OK;
+
+    if (DEBUG>3) printf("start adios_init(%s)\n", adios_config_file);
+    rc = adios_init(adios_config_file);
+    if (rc != 1) {
+        printf("adios_init() failed: %d\n", rc);
+        return(-1);
+    }
+    if (DEBUG>3) printf("end adios_init(%s)\n", adios_config_file);
+
+
+    /* register server stubs */
+    NSSI_REGISTER_SERVER_STUB(ADIOS_OPEN_OP, nssi_staging_open_stub, adios_open_args, adios_open_res);
+    NSSI_REGISTER_SERVER_STUB(ADIOS_GROUP_SIZE_OP, nssi_staging_group_size_stub, adios_group_size_args, void);
+    NSSI_REGISTER_SERVER_STUB(ADIOS_READ_OP, nssi_staging_read_stub, adios_read_args, adios_read_res);
+    NSSI_REGISTER_SERVER_STUB(ADIOS_WRITE_OP, nssi_staging_write_stub, adios_write_args, adios_write_res);
+    NSSI_REGISTER_SERVER_STUB(ADIOS_END_ITER_OP, nssi_staging_end_iter_stub, adios_end_iter_args, void);
+    NSSI_REGISTER_SERVER_STUB(ADIOS_START_CALC_OP, nssi_staging_start_calc_stub, adios_start_calc_args, void);
+    NSSI_REGISTER_SERVER_STUB(ADIOS_STOP_CALC_OP, nssi_staging_stop_calc_stub, adios_stop_calc_args, void);
+    NSSI_REGISTER_SERVER_STUB(ADIOS_CLOSE_OP, nssi_staging_close_stub, adios_close_args, void);
+
+    return 0;
+}
+
+
+
+static void generate_contact_info(nssi_remote_pid *myid)
+{
+    nssi_remote_pid *all_pids=NULL;
+    int rank, np;
+    char contact_path[1024];
+
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+    //printf("rank (%d)\n", rank);
+
+    if (rank==0) {
+        MPI_Comm_size(MPI_COMM_WORLD, &np);
+        all_pids=(nssi_remote_pid *)malloc(np*sizeof(nssi_remote_pid));
+    }
+    MPI_Gather(myid, sizeof(nssi_remote_pid), MPI_BYTE,
+               all_pids, sizeof(nssi_remote_pid), MPI_BYTE,
+               0, MPI_COMM_WORLD);
+    if (rank==0) {
+        char *contact_file=getenv("ADIOS_NSSI_CONTACT_INFO");
+        if (contact_file==NULL) {
+            printf("ADIOS_NSSI_CONTACT_INFO env var is undefined.\n");
+            free(all_pids);
+            return;
+        }
+//        sprintf(contact_path, "%s.%04d", contact_file, rank);
+        sprintf(contact_path, "%s", contact_file);
+        if (DEBUG>3) printf("creating contact file (%s)\n", contact_path);
+        FILE *f=fopen(contact_path, "w");
+        if (f==NULL) {
+            perror("fopen");
+        }
+        for (int i=0;i<np;i++) {
+            fprintf(f, "%u@%u@%s@%u\n",
+                    all_pids[i].nid, all_pids[i].pid,
+                    all_pids[i].hostname, (unsigned int)ntohs(all_pids[i].port));
+        }
+//        fprintf(f, "%u@%u@%s@%u\n",
+//                myid->nid, myid->pid,
+//                myid->hostname, (unsigned int)ntohs(myid->port));
+        fclose(f);
+        free(all_pids);
+    }
+    MPI_Barrier(MPI_COMM_WORLD);
+}
+
+
+/**
+ * @brief The LWFS xfer-server.
+ */
+int main(int argc, char **argv)
+{
+    int rc = NSSI_OK;
+
+    nssi_service nssi_svc;
+//    log_level debug_level;
+    char logfile[1024];
+    int rank, np;
+
+    MPI_Init(&argc, &argv);
+    MPI_Comm_rank(MPI_COMM_WORLD, &global_rank);
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+    MPI_Comm_size(MPI_COMM_WORLD, &np);
+    grank=rank;
+    gsize=np;
+
+    /* options that can be overriden by the command-line */
+    bool daemon_flag = false;
+    int verbose = 5;  /* default debug_level */
+    int num_threads = 0;
+    int server_pid = 128;   /* process ID of the server */
+    int server_port = 7728; /* TCP port of the server */
+
+    memset(&nssi_svc, 0, sizeof(nssi_service));
+
+    /* initialize and enable logging */
+//    if (args_info.logfile_arg != NULL) {
+//        sprintf(logfile, "%s.%04d", "nssi_staging_server.log", rank);
+//        logger_init((log_level)verbose, logfile);
+//    } else {
+//        logger_init((log_level)verbose, NULL);
+//    }
+//    netcdf_debug_level=(log_level)(log_level)args_info.verbose_arg;
+//    debug_level = (log_level)args_info.verbose_arg;
+
+//    logger_init((log_level)verbose, NULL);
+
+    if (daemon_flag) {
+        nssi_daemonize();
+    }
+
+#ifdef HAVE_PORTALS
+    nssi_ptl_init(PTL_IFACE_SERVER, server_pid);
+    rc = nssi_rpc_init(NSSI_RPC_PTL, NSSI_RPC_XDR);
+    if (rc != NSSI_OK) {
+        printf("could not init rpc: %s\n",
+                nssi_err_str(rc));
+        return rc;
+    }
+    nssi_remote_pid myid;
+    memset(&myid, 0, sizeof(nssi_remote_pid));
+    nssi_ptl_get_id(&myid);
+    generate_contact_info(&myid);
+#endif
+#ifdef HAVE_INFINIBAND
+    memset(&nssi_svc.req_addr.match_id, 0, sizeof(nssi_remote_pid));
+    strcpy(nssi_svc.req_addr.match_id.hostname, args_info.server_addr_arg);
+    nssi_svc.req_addr.match_id.port = args_info.server_port_arg;
+
+    nssi_ib_init(&nssi_svc);
+    rc = nssi_rpc_init(NSSI_RPC_IB, NSSI_RPC_XDR);
+    if (rc != NSSI_OK) {
+        printf("could not init rpc: %s\n",
+                nssi_err_str(rc));
+        return rc;
+    }
+    generate_contact_info(&nssi_svc.req_addr.match_id);
+#endif
+
+    if (DEBUG>3) printf("Initialize staging service\n");
+
+    /* initialize the lwfs service */
+    rc = nssi_service_init(0, NSSI_SHORT_REQUEST_SIZE, &nssi_svc);
+    if (rc != NSSI_OK) {
+        printf("could not init nssi_svc: %s\n",
+                nssi_err_str(rc));
+        return -1;
+    }
+
+    /* initialize staging service */
+    rc = nssi_staging_server_init(argv[1]);
+
+    /* start processing requests */
+    nssi_svc.max_reqs = -1;
+    rc = nssi_service_start(&nssi_svc, num_threads);
+    if (rc != NSSI_OK) {
+        printf("exited nssi_svc: %s\n",
+                nssi_err_str(rc));
+    }
+
+    adios_finalize(rank);
+
+    /* shutdown the nssi_svc */
+    if (DEBUG>3) printf("shutting down service library\n");
+    nssi_service_fini(&nssi_svc);
+
+    nssi_rpc_fini();
+
+    MPI_Finalize();
+
+    return rc;
+}
diff --git a/src/read_bp.c b/src/read_bp.c
new file mode 100644
index 0000000..c8e05ac
--- /dev/null
+++ b/src/read_bp.c
@@ -0,0 +1,3057 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+
+/****************************/
+/* Read method for BP files */
+/****************************/
+
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include "adios.h"
+#include "bp_utils.h"
+#include "bp_types.h"
+#include "adios_types.h"
+#include "adios_read.h"
+#include "adios_read_hooks.h"
+#include "adios_error.h"
+#include "futils.h"
+
+#ifdef DMALLOC
+#include "dmalloc.h"
+#endif
+
+/* Return 0: if file is little endian, 1 if file is big endian 
+ * We know if it is different from the current system, so here
+ * we determine the current endianness and report accordingly.
+ */
+static int adios_read_bp_get_endianness( uint32_t change_endianness )
+{
+   int LE = 0;
+   int BE = !LE;
+   int i = 1;
+   char *p = (char *) &i;
+   int current_endianness;
+   if (p[0] == 1) // Lowest address contains the least significant byte
+       current_endianness = LE;
+   else
+       current_endianness = BE;
+    if (change_endianness == adios_flag_yes)
+        return !current_endianness;
+    else
+        return current_endianness;
+}
+
+int adios_read_bp_init (MPI_Comm comm) { return 0; }
+int adios_read_bp_finalize () { return 0; }
+
+ADIOS_FILE * adios_read_bp_fopen (const char * fname, MPI_Comm comm)
+{
+    int i, rank;    
+    struct BP_FILE * fh;
+    ADIOS_FILE * fp;
+    uint64_t header_size;
+
+    adios_errno = 0;
+    fh = (struct BP_FILE *) malloc (sizeof (struct BP_FILE));
+    if (!fh) {
+        error( err_no_memory, "Cannot allocate memory for file info.");
+        return NULL;
+    }
+    fh->comm =  comm;
+    fh->gvar_h = 0;
+    fh->pgs_root = 0;
+    fh->vars_root = 0;
+    fh->attrs_root = 0;
+    fh->b = malloc (sizeof (struct adios_bp_buffer_struct_v1));
+    if (!fh->b) {
+        error( err_no_memory, "Cannot allocate memory for file info.");
+        return NULL;
+    }
+    fp = (ADIOS_FILE *) malloc (sizeof (ADIOS_FILE));
+    if (!fp) {
+        error( err_no_memory, "Cannot allocate memory for file info.");
+        return NULL;
+    }
+
+    adios_buffer_struct_init (fh->b);
+    MPI_Comm_rank (comm, &rank);
+    if (bp_read_open (fname, comm, fh))
+        return NULL;
+
+    /* Only rank=0 process reads the footer and it broadcasts to all other processes */
+    if ( rank == 0 ) {
+        if (bp_read_minifooter (fh))
+            return NULL;
+    }
+    MPI_Bcast (&fh->mfooter, sizeof(struct bp_minifooter),MPI_BYTE, 0, comm);
+    
+    header_size = fh->mfooter.file_size-fh->mfooter.pgs_index_offset;
+
+    if ( rank != 0) {
+        if (!fh->b->buff) {
+            bp_alloc_aligned (fh->b, header_size);
+            if (!fh->b->buff)
+                return NULL;
+            memset (fh->b->buff, 0, header_size);
+            fh->b->offset = 0;
+        }
+    }
+    MPI_Barrier(comm);
+    MPI_Bcast (fh->b->buff, fh->mfooter.file_size-fh->mfooter.pgs_index_offset, MPI_BYTE, 0 , comm);
+
+    /* Everyone parses the index on its own */
+    bp_parse_pgs (fh);
+    bp_parse_vars (fh);
+    bp_parse_attrs (fh);
+
+    /* fill out ADIOS_FILE struct */
+    fp->fh = (uint64_t) fh;
+    fp->groups_count = fh->gvar_h->group_count;
+    fp->vars_count = fh->mfooter.vars_count;
+    fp->attrs_count = fh->mfooter.attrs_count;
+    fp->tidx_start = fh->tidx_start;
+    fp->ntimesteps = fh->tidx_stop - fh->tidx_start + 1;
+    fp->file_size = fh->mfooter.file_size;
+    fp->version = fh->mfooter.version;
+    fp->endianness = adios_read_bp_get_endianness(fh->mfooter.change_endianness);
+    alloc_namelist (&fp->group_namelist,fp->groups_count); 
+    for (i=0;i<fp->groups_count;i++) {
+        if (!fp->group_namelist[i]) {
+            error(err_no_memory, "Could not allocate buffer for %d strings in adios_fopen()", fp->groups_count);
+            adios_read_bp_fclose(fp);
+            return NULL;
+        }
+        else  {
+            strcpy(fp->group_namelist[i],fh->gvar_h->namelist[i]);
+        }
+    }
+    return fp;
+}
+
+/* This function can be called if user places 
+   the wrong sequences of dims for a var 
+*/   
+void adios_read_bp_reset_dimension_order (ADIOS_FILE *fp, int is_fortran)
+{
+    struct BP_FILE * fh = (struct BP_FILE *)(fp->fh);
+    struct bp_index_pg_struct_v1 ** root = &(fh->pgs_root);
+    struct bp_minifooter * mh = &(fh->mfooter);
+    uint64_t i;
+
+    for (i = 0; i < mh->pgs_count; i++) {
+        is_fortran ? ((*root)->adios_host_language_fortran = adios_flag_yes) 
+               : ((*root)->adios_host_language_fortran = adios_flag_no);
+        root = &(*root)->next;
+    }
+}
+
+int adios_read_bp_fclose (ADIOS_FILE *fp) 
+{
+    struct BP_FILE * fh = (struct BP_FILE *) fp->fh;
+    struct BP_GROUP_VAR * gh = fh->gvar_h;
+    struct BP_GROUP_ATTR * ah = fh->gattr_h;
+    struct adios_index_var_struct_v1 * vars_root = fh->vars_root, *vr;
+    struct adios_index_attribute_struct_v1 * attrs_root = fh->attrs_root, *ar;
+    struct bp_index_pg_struct_v1 * pgs_root = fh->pgs_root, *pr;
+    int i,j;
+    MPI_File mpi_fh = fh->mpi_fh;
+
+    adios_errno = 0;
+    if (fh->mpi_fh) 
+        MPI_File_close (&mpi_fh);
+    if (fh->b) {
+        adios_posix_close_internal (fh->b);
+        free(fh->b);
+    }
+
+    /* Free variable structures */
+    /* alloc in bp_utils.c: bp_parse_vars() */
+    while (vars_root) {
+        vr = vars_root;
+        vars_root = vars_root->next;
+        for (j = 0; j < vr->characteristics_count; j++) {
+            // alloc in bp_utils.c:bp_parse_characteristics() <- bp_get_characteristics_data()
+            if (vr->characteristics[j].dims.dims)
+                free (vr->characteristics[j].dims.dims);
+            if (vr->characteristics[j].value)
+                free (vr->characteristics[j].value);
+            // NCSU - Clearing up statistics
+            if (vr->characteristics[j].stats)
+            {
+                uint8_t k = 0, idx = 0;
+                uint8_t i = 0, count = adios_get_stat_set_count(vr->type);
+
+                while (vr->characteristics[j].bitmap >> k)
+                {
+                    if ((vr->characteristics[j].bitmap >> k) & 1)
+                    {
+                        for (i = 0; i < count; i ++)
+                        {
+                            if (k == adios_statistic_hist)
+                            {
+                                struct adios_index_characteristics_hist_struct * hist = (struct adios_index_characteristics_hist_struct *) (vr->characteristics [j].stats[i][idx].data);
+                                free (hist->breaks);
+                                free (hist->frequencies);
+                                free (hist);
+                            }
+                            else
+                            free (vr->characteristics[j].stats [i][idx].data);
+                        }
+                        idx ++;
+                    }
+                    k ++;
+                }
+
+                for (i = 0; i < count; i ++)
+                    free (vr->characteristics[j].stats [i]);
+
+                free (vr->characteristics[j].stats);
+                vr->characteristics[j].stats = 0;
+            }
+        }
+        if (vr->characteristics) 
+            free (vr->characteristics);
+        if (vr->group_name) 
+            free (vr->group_name);
+        if (vr->var_name) 
+            free (vr->var_name);
+        if (vr->var_path) 
+            free (vr->var_path);
+        free(vr);
+    }
+
+    /* Free attributes structures */
+    /* alloc in bp_utils.c bp_parse_attrs() */
+    while (attrs_root) {
+        ar = attrs_root;
+        attrs_root = attrs_root->next;
+        for (j = 0; j < ar->characteristics_count; j++) {
+            if (ar->characteristics[j].value)
+                free (ar->characteristics[j].value);
+        }
+        if (ar->characteristics) 
+            free (ar->characteristics);
+        if (ar->group_name) 
+            free (ar->group_name);
+        if (ar->attr_name) 
+            free (ar->attr_name);
+        if (ar->attr_path) 
+            free (ar->attr_path);
+        free(ar);
+    }
+
+
+    /* Free process group structures */
+    /* alloc in bp_utils.c bp_parse_pgs() first loop */
+    //printf ("pgs: %d\n", fh->mfooter.pgs_count);
+    while (pgs_root) {
+        pr = pgs_root;
+        pgs_root = pgs_root->next;
+        //printf("%d\tpg pid=%d addr=%x next=%x\n",i, pr->process_id, pr, pr->next);
+        if (pr->group_name)
+            free(pr->group_name);
+        if (pr->time_index_name)
+            free(pr->time_index_name);
+        free(pr);
+    }
+
+    /* Free variable structures in BP_GROUP_VAR */
+    if (gh) {
+        for (j=0;j<2;j++) { 
+            for (i=0;i<gh->group_count;i++) {
+                if (gh->time_index[j][i])
+                    free(gh->time_index[j][i]);
+            }
+            if (gh->time_index[j])
+                free(gh->time_index[j]);
+        }
+        free (gh->time_index);
+    
+        for (i=0;i<gh->group_count;i++) { 
+            if (gh->namelist[i])
+                free(gh->namelist[i]);
+        }
+        if (gh->namelist)
+            free (gh->namelist);
+
+        for (i=0;i<fh->mfooter.vars_count;i++) {
+            if (gh->var_namelist[i])
+                free(gh->var_namelist[i]);
+            if (gh->var_offsets[i]) 
+                free(gh->var_offsets[i]);
+        }
+        if (gh->var_namelist)
+            free (gh->var_namelist);
+
+        if (gh->var_offsets) 
+            free(gh->var_offsets);
+
+        if (gh->var_counts_per_group)
+            free(gh->var_counts_per_group);
+
+        if (gh->pg_offsets)
+            free (gh->pg_offsets);
+
+        free (gh);
+    }
+
+    /* Free attribute structures in BP_GROUP_ATTR */
+    if (ah) {
+        for (i = 0; i < fh->mfooter.attrs_count; i++) {
+            if (ah->attr_offsets[i]) 
+                free(ah->attr_offsets[i]);
+            if (ah->attr_namelist[i]) 
+                free(ah->attr_namelist[i]);
+        }
+        if (ah->attr_offsets)
+            free(ah->attr_offsets);
+        if (ah->attr_namelist)
+            free(ah->attr_namelist);
+        if (ah->attr_counts_per_group) 
+            free(ah->attr_counts_per_group);
+
+        free(ah);
+    }
+        
+    if (fh)
+        free (fh);    
+
+    free_namelist ((fp->group_namelist),fp->groups_count);
+    free(fp);
+    return 0;
+}
+
+
+ADIOS_GROUP * adios_read_bp_gopen (ADIOS_FILE *fp, const char * grpname)
+{
+    struct BP_FILE * fh = (struct BP_FILE *) fp->fh;
+    int grpid; 
+
+    adios_errno = 0;
+    for (grpid=0;grpid<(fh->gvar_h->group_count);grpid++) {
+        if (!strcmp(fh->gvar_h->namelist[grpid], grpname))
+            break; 
+    }
+    if (grpid >= fh->gvar_h->group_count) {
+        error( err_invalid_group, "Invalid group name %s", grpname);
+        return NULL;
+    }
+    return adios_read_bp_gopen_byid(fp, grpid);
+}
+
+ADIOS_GROUP * adios_read_bp_gopen_byid (ADIOS_FILE *fp, int grpid)
+{
+    struct BP_FILE * fh = (struct BP_FILE *) fp->fh;
+    struct BP_GROUP * gh;
+    ADIOS_GROUP * gp;
+    int i, offset;
+
+    adios_errno = 0;
+    if (grpid < 0 || grpid >= fh->gvar_h->group_count) {
+        error( err_invalid_group, "Invalid group index %d", grpid);
+        return NULL;
+    }
+
+    gh = (struct BP_GROUP *) malloc(sizeof(struct BP_GROUP));
+    if (!gh) {
+        error( err_no_memory, "Could not allocate memory for group info");
+        return NULL;
+    }
+
+    gp = (ADIOS_GROUP *) malloc(sizeof(ADIOS_GROUP));
+    if (!gp) {
+        error( err_no_memory, "Could not allocate memory for group info");
+        free(gh);
+        return NULL;
+    }
+
+    /* set offset index of variables (which is a long list of all vars in all groups) in this group */
+    offset = 0;
+    for (i=0; i<grpid; i++)
+        offset += fh->gvar_h->var_counts_per_group[i];
+
+    /* gh->vars_root will point to the list of vars in this group */
+    gh->vars_root = fh->vars_root; 
+    for (i=0; i<offset; i++)
+        gh->vars_root = gh->vars_root->next;
+
+    gh->group_id = grpid;
+    gh->vars_offset = offset;
+    gh->vars_count = fh->gvar_h->var_counts_per_group[grpid];
+
+    /* set offset of attributes in this group */
+    offset = 0;
+    for(i=0;i<grpid;i++)
+        offset += fh->gattr_h->attr_counts_per_group[i];
+
+    /* gh->attrs_root will point to the list of vars in this group */
+    gh->attrs_root = fh->attrs_root; 
+    for (i=0; i<offset; i++)
+        gh->attrs_root = gh->attrs_root->next;
+
+    gh->attrs_offset = offset;
+    gh->attrs_count = fh->gattr_h->attr_counts_per_group[grpid];
+
+    gh->fh = fh; 
+
+    /* fill out ADIOS_GROUP struct */
+    gp->grpid = grpid;
+    gp->gh = (uint64_t) gh;
+    gp->fp = fp;
+    gp->vars_count = gh->vars_count;
+    gp->attrs_count = gh->attrs_count;
+    
+    offset = gh->vars_offset;
+    alloc_namelist (&(gp->var_namelist), gp->vars_count);
+    for (i=0;i<gp->vars_count;i++) {
+        if (!gp->var_namelist[i]) { 
+            error(err_no_memory, "Could not allocate buffer for %d strings in adios_gopen()", gp->vars_count);
+            adios_read_bp_gclose(gp);
+            return NULL;
+        }
+        else
+            strcpy(gp->var_namelist[i], gh->fh->gvar_h->var_namelist[i+offset]);
+    }
+
+    offset = gh->attrs_offset;
+    alloc_namelist (&(gp->attr_namelist), gp->attrs_count);
+    for (i=0;i<gp->attrs_count;i++) {
+        if (!gp->attr_namelist[i]) {
+            error(err_no_memory, "Could not allocate buffer for %d strings in adios_gopen()", gp->vars_count);
+            adios_read_bp_gclose(gp);
+            return NULL;
+        }
+        else {
+            strcpy(gp->attr_namelist[i], gh->fh->gattr_h->attr_namelist[i+offset]);
+        }
+    }
+
+    return gp;
+}
+                   
+int adios_read_bp_gclose (ADIOS_GROUP *gp)
+{
+    struct BP_GROUP * gh = (struct BP_GROUP *) gp->gh;
+
+    adios_errno = 0;
+    if (!gh) {
+        error (err_invalid_group_struct, "group handle is NULL!");
+        return  err_invalid_group_struct;
+    }
+    else
+        free (gh);
+
+    free_namelist ((gp->var_namelist),gp->vars_count);
+    free_namelist ((gp->attr_namelist),gp->attrs_count);
+    free(gp);
+    return 0;
+}
+
+
+
+int adios_read_bp_get_attr (ADIOS_GROUP * gp, const char * attrname, enum ADIOS_DATATYPES * type,
+                    int * size, void ** data)
+{
+    // Find the attribute: full path is stored with a starting / 
+    // Like in HDF5, we need to match names given with or without the starting /
+    // startpos is 0 or 1 to indicate if the argument has starting / or not
+    int attrid;
+    int vstartpos = 0, fstartpos = 0; 
+    struct BP_GROUP * gh = (struct BP_GROUP *)gp->gh;
+    int offset;
+
+    adios_errno = 0;
+    if (!gp) {
+        error(err_invalid_group_struct, "Null pointer passed as group to adios_get_attr()");
+        return adios_errno;
+    }
+    if (!attrname) {
+        error(err_invalid_attrname, "Null pointer passed as attribute name to adios_get_attr()!");
+        return adios_errno;
+    }
+
+    offset = gh->attrs_offset;
+
+    if (attrname[0] == '/') 
+        vstartpos = 1;
+    for (attrid=0; attrid<(gp->attrs_count);attrid++) {
+        //if (gp->attr_namelist[attrid][0] == '/') 
+        if (gh->fh->gattr_h->attr_namelist[attrid+offset][0] == '/') 
+            fstartpos = 1;
+        //if (!strcmp(gp->attr_namelist[attrid]+fstartpos, attrname+vstartpos))
+        if (!strcmp(gh->fh->gattr_h->attr_namelist[attrid+offset]+fstartpos, attrname+vstartpos))
+            break; 
+    }
+    if (attrid >= gp->attrs_count) {
+        error( err_invalid_attrname, "Invalid attribute name %s", attrname);
+        return adios_errno;
+    }
+
+    return adios_read_bp_get_attr_byid(gp, attrid, type, size, data);
+}
+
+int adios_read_bp_get_attr_byid (ADIOS_GROUP * gp, int attrid, 
+                    enum ADIOS_DATATYPES * type, int * size, void ** data)
+{
+    int    i, offset, count;
+    struct BP_GROUP * gh;
+    struct BP_FILE * fh;
+    struct adios_index_attribute_struct_v1 * attr_root;
+    struct adios_index_var_struct_v1 * var_root;
+    int    file_is_fortran;
+
+    adios_errno = 0;
+    if (!gp) {
+        error(err_invalid_group_struct, "Null pointer passed as group to adios_get_attr()");
+        return adios_errno;
+    }
+    gh = (struct BP_GROUP *) gp->gh;
+    if (!gh) {
+        error(err_invalid_group_struct, "Invalid ADIOS_GROUP struct: .gh group handle is NULL!");
+        return adios_errno;
+    }
+    fh = gh->fh;
+    if (!fh) {
+        error(err_invalid_group_struct, "Invalid ADIOS_GROUP struct: .gh->fh file handle is NULL!");
+        return adios_errno;
+    }
+    if (attrid < 0 || attrid >= gh->attrs_count) {
+        error(err_invalid_attrid, "Invalid attribute id %d (allowed 0..%d)", attrid, gh->attrs_count);
+        return adios_errno;
+    }
+
+    attr_root = gh->attrs_root; /* need to traverse the attribute list of the group */
+    for (i = 0; i < attrid && attr_root; i++)
+        attr_root = attr_root->next;
+    if (i != attrid) {
+        error (err_corrupted_attribute, "Attribute id=%d is valid but was not found in internal data structures!",attrid);
+        return adios_errno; 
+    }
+
+    file_is_fortran = (fh->pgs_root->adios_host_language_fortran == adios_flag_yes);
+
+    if (attr_root->characteristics[0].value) {
+        /* Attribute has its own value */
+        *size = bp_get_type_size (attr_root->type, attr_root->characteristics[0].value);
+        *type = attr_root->type;
+        *data = (void *) malloc (*size);  
+        if (*data)
+            memcpy(*data, attr_root->characteristics[0].value, *size);
+    }
+    else if (attr_root->characteristics[0].var_id) {
+        /* Attribute is a reference to a variable */
+        /* FIXME: var ids are not unique in BP. If a group of variables are written several
+           times under different path using adios_set_path(), the id of a variable is always
+           the same (should be different). As a temporary fix, we look first for a matching
+           id plus path between an attribute and a variable. If not found, then we look for
+           a match on the ids only.*/
+        var_root = gh->vars_root; 
+        while (var_root) {
+            if (var_root->id == attr_root->characteristics[0].var_id && 
+                !strcmp(var_root->var_path, attr_root->attr_path))
+                break;
+            var_root = var_root->next;
+        }
+        if (!var_root) {
+            var_root = gh->vars_root; 
+            while (var_root) {
+                if (var_root->id == attr_root->characteristics[0].var_id)
+                    break;
+                var_root = var_root->next;
+            }
+        }
+
+        if (!var_root) {
+            error (err_invalid_attribute_reference, 
+                   "Attribute %s/%s in group %s is a reference to variable ID %d, which is not found", 
+                   attr_root->attr_path, attr_root->attr_name, attr_root->group_name,
+                   attr_root->characteristics[0].var_id);
+            return adios_errno;
+        }
+
+        /* default values in case of error */
+        *data = NULL;
+        *size = 0;
+        *type = attr_root->type;
+
+        /* FIXME: variable and attribute type may not match, then a conversion is needed. */
+        /* Cases:
+                1. attr has no type, var is byte array     ==> string
+                2. attr has no type, var is not byte array ==> var type
+                3. attr is string, var is byte array       ==> string
+                4. attr type == var type                   ==> var type 
+                5. attr type != var type                   ==> attr type and conversion needed 
+        */
+        /* Error check: attr cannot reference an array in general */
+        if (var_root->characteristics[0].dims.count > 0) {
+            if ( (var_root->type == adios_byte || var_root->type == adios_unsigned_byte) &&
+                 (attr_root->type == adios_unknown || attr_root->type == adios_string) &&
+                 (var_root->characteristics[0].dims.count == 1)) {
+                 ; // this conversions are allowed
+            } else {
+                error(err_invalid_attribute_reference, 
+                    "Attribute %s/%s in group %s, typeid=%d is a reference to an %d-dimensional array variable "
+                    "%s/%s of type %s, which is not supported in ADIOS",
+                    attr_root->attr_path, attr_root->attr_name, attr_root->group_name, attr_root->type,
+                    var_root->characteristics[0].dims.count,
+                    var_root->var_path, var_root->var_name, common_read_type_to_string(var_root->type));
+                return adios_errno;
+            }
+        }
+
+        if ( (attr_root->type == adios_unknown || attr_root->type == adios_string) &&
+             (var_root->type == adios_byte || var_root->type == adios_unsigned_byte) &&
+             (var_root->characteristics[0].dims.count == 1) ) {
+            /* 1D byte arrays are converted to string */
+            /* 1. read in variable */
+            char varname[512];
+            char *tmpdata;
+            uint64_t start, count;
+            int status;
+            start = 0; 
+            count = var_root->characteristics[0].dims.dims[0];
+            snprintf(varname, 512, "%s/%s", var_root->var_path, var_root->var_name);
+            tmpdata = (char *) malloc (count+1);
+            if (tmpdata == NULL) {
+                error(err_no_memory, 
+                      "Cannot allocate memory of %lld bytes for reading in data for attribute %s/%s of group %s.",
+                      count, attr_root->attr_path, attr_root->attr_name, attr_root->group_name);
+                return adios_errno;
+            }
+
+            status = adios_read_bp_read_var (gp, varname, &start, &count, tmpdata);
+            
+            if (status < 0) {
+                char *msg = strdup(adios_get_last_errmsg());
+                error((enum ADIOS_ERRCODES) status, 
+                      "Cannot read data of variable %s/%s for attribute %s/%s of group %s: %s",
+                      var_root->var_path, var_root->var_name, 
+                      attr_root->attr_path, attr_root->attr_name, attr_root->group_name,
+                      msg);
+                free(tmpdata);
+                free(msg);
+                return status;
+            }
+
+            *type = adios_string;
+            if (file_is_fortran) {
+                /* Fortran byte array to C string */
+                *data = futils_fstr_to_cstr( tmpdata, (int)count); /* FIXME: supports only 2GB strings... */
+                *size = strlen( (char *)data );
+                free(tmpdata);
+            } else {
+                /* C array to C string */
+                tmpdata[count] = '\0';
+                *size = count+1;
+                *data = tmpdata;
+            }
+        } else {
+            /* other types are inherited */
+            *type = var_root->type;
+            *size = bp_get_type_size (var_root->type, var_root->characteristics[0].value);
+            *data = (void *) malloc (*size);  
+            if (*data)
+                memcpy(*data, var_root->characteristics[0].value, *size);
+        }
+    }
+
+    return 0;
+}
+
+
+/* Reverse the order in an array in place.
+   use swapping from Fortran/column-major order to ADIOS-read-api/C/row-major order and back
+*/
+static void swap_order(int n, uint64_t *array, int *timedim)
+{
+    int i;
+    uint64_t tmp;
+    for (i=0; i<n/2; i++) {
+        tmp = array[i];
+        array[i] = array[n-1-i];
+        array[n-1-i] = tmp;
+    }
+    if (*timedim > -1)
+        *timedim = (n-1) - *timedim; // swap the time dimension too
+}
+
+/* Look up variable id based on variable name.
+   Return index 0..gp->vars_count-1 if found, -1 otherwise
+*/
+static int adios_read_bp_find_var(ADIOS_GROUP *gp, const char *varname)
+{
+    // Find the variable: full path is stored with a starting / 
+    // Like in HDF5, we need to match names given with or without the starting /
+    // startpos is 0 or 1 to indicate if the argument has starting / or not
+    int varid;
+    int vstartpos = 0, fstartpos; 
+    struct BP_GROUP * gh = (struct BP_GROUP *)gp->gh;
+    int offset;
+
+    adios_errno = 0;
+    if (!gp) {
+        error(err_invalid_group_struct, "Null pointer passed as group");
+        return -1;
+    }
+    if (!varname) {
+        error(err_invalid_varname, "Null pointer passed as variable name!");
+        return -1;
+    }
+
+    /* Search in gp->fh->gvar_h->var_namelist instead of gp->var_namelist, because that
+       one comes back from the user. One idiot (who writes this comment) sorted the
+       list in place after gopen and before inq_var.
+    */
+    offset = gh->vars_offset;
+
+    if (varname[0] == '/') 
+        vstartpos = 1;
+    for (varid=0; varid<(gp->vars_count);varid++) {
+        fstartpos = 0;
+        /* if (gp->var_namelist[varid][0] == '/') */
+        fstartpos = 0;
+        if (gh->fh->gvar_h->var_namelist[varid+offset][0] == '/')
+            fstartpos = 1;
+        /*if (!strcmp(gp->var_namelist[varid]+fstartpos, varname+vstartpos))*/
+        if (!strcmp(gh->fh->gvar_h->var_namelist[varid+offset]+fstartpos, varname+vstartpos))
+            break; 
+    }
+    if (varid >= gp->vars_count) {
+        error(err_invalid_varname, "Invalid variable name %s", varname);
+        return -1;
+    }
+    return varid;
+}
+
+// NCSU - For custom memory allocation 
+#define CALLOC(var, num, sz, comment)\
+{\
+    var = calloc (num, sz); \
+    if (!var)    {\
+        error_at_line ( err_no_memory, __FILE__, __LINE__, "Could not allocate memory for ", comment, " in common_read_get_characteristics"); \
+        return; \
+    }\
+}
+
+#define MALLOC(var,sz,comment)\
+{\
+    var = malloc (sz); \
+    if (!var)    {\
+        error_at_line ( err_no_memory, __FILE__, __LINE__, "Could not allocate memory for ", comment, " in common_read_get_characteristics"); \
+        return; \
+    }\
+}\
+
+// NCSU - Reading the statistics
+/** Get value and statistics, allocate space for them too */
+static void adios_read_bp_get_characteristics (struct adios_index_var_struct_v1 * var_root, ADIOS_VARINFO *vi)
+{
+    int i, j, c, count = 1;
+    int size, sum_size, sum_type;
+
+    vi->value = NULL;
+
+    vi->gmin = vi->gmax = NULL;
+    vi->gavg = NULL;
+    vi->mins = vi->maxs = NULL;
+    vi->avgs = NULL;
+    vi->gstd_dev = NULL;
+    vi->std_devs = NULL;
+    vi->hist = NULL;
+
+    // set value for scalars
+    if (var_root->characteristics [0].value) {
+        size = bp_get_type_size(var_root->type, var_root->characteristics [0].value);
+        vi->value = (void *) malloc (size);
+        
+        if (vi->value)
+           memcpy(vi->value, var_root->characteristics [0].value, size);
+        else {
+            error_at_line( err_no_memory, __FILE__, __LINE__, "Could not allocate memory for value in common_read_get_characteristics");
+            return;
+        }
+    } else {
+        vi->value = NULL;
+    }
+
+    int npgs = var_root->characteristics_count, timestep, ntimes = -1;
+    uint64_t gcnt = 0, * cnts;
+
+    double *gsum = NULL, *gsum_square = NULL;
+    double **sums = NULL, **sum_squares = NULL;
+
+    int16_t map[32];
+    memset (map, -1, sizeof(map));
+
+    // Bitmap shows which statistical information has been calculated
+    i = j = 0;
+    while (var_root->characteristics[0].bitmap >> j)
+    {
+        if ((var_root->characteristics[0].bitmap >> j) & 1)
+            map [j] = i ++;
+        j ++;
+     }
+
+    if(vi->timedim >= 0)
+    {    
+        ntimes = vi->dims[0];
+
+        if (map[adios_statistic_min] != -1)
+        {
+            MALLOC(vi->mins, ntimes * sizeof(void *), "minimum per timestep");
+            for (i = 0; i < ntimes; i++)
+                vi->mins[i] = 0;
+        }
+
+        if (map[adios_statistic_max] != -1)
+        {
+            MALLOC(vi->maxs, ntimes * sizeof(void *), "maximum per timestep");
+            for (i = 0; i < ntimes; i++)
+                vi->maxs[i] = 0;
+        }
+
+        if (map[adios_statistic_sum] != -1)
+        {
+            MALLOC(sums, ntimes * sizeof(double *), "summation per timestep");
+            MALLOC(vi->avgs, ntimes * sizeof(double *), "average per timestep");
+
+            for (i = 0; i < ntimes; i++)
+                sums[i] = vi->avgs[i] = 0;
+
+            CALLOC(cnts, ntimes, sizeof(uint64_t), "count of elements per timestep");
+        }
+
+        if (map[adios_statistic_sum_square] != -1)
+        {
+            MALLOC(sum_squares, ntimes * sizeof(double *), "summation per timestep");
+            MALLOC(vi->std_devs, ntimes * sizeof(double *), "standard deviation per timestep");
+
+            for (i = 0; i < ntimes; i++)
+                vi->std_devs[i] = sum_squares[i] = 0;
+        }
+    }
+
+    if (map[adios_statistic_hist] != -1 && (var_root->characteristics[0].stats[0][map[adios_statistic_hist]].data))
+    {
+        struct adios_index_characteristics_stat_struct * stats = var_root->characteristics[0].stats[0];
+        struct adios_index_characteristics_hist_struct * hist = stats[map[adios_statistic_hist]].data;
+        int num_breaks = hist->num_breaks;
+
+        MALLOC(vi->hist, sizeof(struct ADIOS_HIST), "histogram");
+        MALLOC(vi->hist->breaks, num_breaks * sizeof(double), "break points of histogram");    
+        MALLOC(vi->hist->gfrequencies, (num_breaks + 1) * sizeof(uint32_t), "global frequencies of histogram");
+
+        vi->hist->num_breaks = hist->num_breaks;
+        vi->hist->min = hist->min;
+        vi->hist->max = hist->max;
+
+        memcpy(vi->hist->breaks, hist->breaks, num_breaks * sizeof(double));
+        CALLOC(vi->hist->gfrequencies, (num_breaks + 1), bp_get_type_size(adios_unsigned_integer, ""), "global frequency");
+
+        if (ntimes > 0)
+        {
+            MALLOC(vi->hist->frequenciess, (ntimes * sizeof(int32_t *)), "frequencies for timesteps");
+            for(i = 0; i < ntimes; i++)
+                CALLOC(vi->hist->frequenciess[i], (num_breaks + 1), bp_get_type_size(adios_unsigned_integer, ""), "frequency at timestep");
+        }
+    }
+
+    size = bp_get_type_size (var_root->type, "");    
+    sum_size = bp_get_type_size (adios_double, "");
+
+    if (var_root->type == adios_complex || var_root->type == adios_double_complex)
+    {
+        int type;
+        count = 3;
+        timestep = 0;
+
+        if (var_root->type == adios_complex)
+            type = adios_double;
+        else
+            type = adios_long_double;
+
+        // Only a double precision returned for all complex values
+        size = bp_get_type_size (adios_double, "");    
+
+           for (i=0; i<var_root->characteristics_count; i++)
+        {
+            if (ntimes > 0)
+                timestep = var_root->characteristics[i].time_index - 1;
+
+            if (!var_root->characteristics[i].stats)
+                continue;
+
+            struct adios_index_characteristics_stat_struct ** stats = var_root->characteristics[i].stats;
+
+            if ((map[adios_statistic_finite] != -1) && (* ((uint8_t *) stats[0][map[adios_statistic_finite]].data) == 0))
+                continue;
+
+            if (map[adios_statistic_min] != -1 && stats[0][map[adios_statistic_min]].data)
+            {
+                double data[3];
+                for (c = 0; c < count; c ++)
+                    data[c] = bp_value_to_double(type, stats[c][map[adios_statistic_min]].data);
+
+                if(!vi->gmin) {
+                    MALLOC (vi->gmin, count * size, "global minimum")
+                    for (c = 0; c < count; c ++)
+                           ((double * ) vi->gmin)[c] = data[c]; 
+
+                } else {
+                    for (c = 0; c < count; c ++)
+                        if (data[c] < ((double *) vi->gmin)[c])
+                               ((double * ) vi->gmin)[c] = data[c]; 
+                }
+
+                if (ntimes > 0) {
+                    if(!vi->mins[timestep]) {
+                        MALLOC (vi->mins[timestep], count * size, "minimum per timestep")
+                        for (c = 0; c < count; c ++)
+                               ((double **) vi->mins)[timestep][c] = data[c]; 
+
+                    } else {
+                        for (c = 0; c < count; c ++)
+                            if (data[c] < ((double **) vi->mins)[timestep][c])
+                                   ((double **) vi->mins)[timestep][c] = data[c]; 
+                    }
+                }
+            }
+
+            if (map[adios_statistic_max] != -1 && stats[0][map[adios_statistic_max]].data)
+            {
+                double data[3];
+                for (c = 0; c < count; c ++)
+                    data[c] = bp_value_to_double(type, stats[c][map[adios_statistic_max]].data);
+
+                if(!vi->gmax) {
+                    MALLOC (vi->gmax, count * size, "global minimum")
+                    for (c = 0; c < count; c ++)
+                        ((double * ) vi->gmax)[c] = data[c];
+
+                } else {
+                    for (c = 0; c < count; c ++)
+                        if (data[c] > ((double *) vi->gmax)[c])
+                            ((double * ) vi->gmax)[c] = data[c];
+                }
+
+                if (ntimes > 0) {
+                    if(!vi->maxs[timestep]) {
+                        MALLOC (vi->maxs[timestep], count * size, "minimum per timestep")
+                        for (c = 0; c < count; c ++)
+                            ((double **) vi->maxs)[timestep][c] = data[c];
+
+                    } else {
+                        for (c = 0; c < count; c ++)
+                            if (data[c] > ((double **) vi->maxs)[timestep][c])
+                                ((double **) vi->maxs)[timestep][c] = data[c];
+                    }
+                }
+            }
+
+            if (map[adios_statistic_sum] != -1 && stats[0][map[adios_statistic_sum]].data)
+            {    
+                double data[3];
+                for (c = 0; c < count; c ++)
+                    data[c] = bp_value_to_double(type, stats[c][map[adios_statistic_sum]].data);
+
+                if(!gsum) {
+                    MALLOC(gsum, count * sum_size, "global summation")
+                    for (c = 0; c < count; c ++)
+                           gsum[c] = data[c];
+
+                } else {
+                    for (c = 0; c < count; c ++)
+                        gsum[c] = gsum[c] + data[c];
+                }
+
+                if (ntimes > 0) {
+                    if(!sums[timestep]) {
+                        MALLOC(sums[timestep], count * sum_size, "summation per timestep")
+                        for (c = 0; c < count; c ++)
+                            sums[timestep][c] = data[c];
+
+                    } else {
+                        for (c = 0; c < count; c ++)
+                            sums[timestep][c] = sums[timestep][c] + data[c];
+                    }
+                }
+            }
+
+            if (map[adios_statistic_sum_square] != -1 && stats[0][map[adios_statistic_sum_square]].data)
+            {
+                double data[3];
+                for (c = 0; c < count; c ++)
+                    data[c] = bp_value_to_double(type, stats[c][map[adios_statistic_sum_square]].data);
+
+                if(!gsum_square) {
+                    MALLOC(gsum_square, count * sum_size, "global summation of squares")
+                    for (c = 0; c < count; c ++)
+                        gsum_square[c] = data[c];
+
+                } else {
+                    for (c = 0; c < count; c ++)
+                           gsum_square[c] = gsum_square[c] + data[c]; 
+                }
+
+                if (ntimes > 0) {
+                    if(!sum_squares[timestep]) {
+                        MALLOC(sum_squares[timestep], count * sum_size, "summation of square per timestep")
+                        for (c = 0; c < count; c ++)
+                            sum_squares[timestep][c] = data[c];
+
+                    } else {
+                        for (c = 0; c < count; c ++)
+                            sum_squares[timestep][c] = sum_squares[timestep][c] + data[c]; 
+                    }
+                }
+            }
+
+            if (map[adios_statistic_cnt] != -1 && stats[0][map[adios_statistic_cnt]].data)
+            {
+                if (ntimes > 0)
+                    cnts[timestep] += * ((uint32_t *) stats[0][map[adios_statistic_cnt]].data);
+                gcnt += * (uint32_t *) stats[0][map[adios_statistic_cnt]].data;
+            }
+        }
+
+        if(ntimes > 0 && vi->gmin && (map[adios_statistic_sum] != -1) && (map[adios_statistic_sum_square] != -1)) {
+            // min, max, summation exists only for arrays
+            // Calculate average / timestep
+
+            for(timestep = 0; timestep < ntimes; timestep ++) {
+                MALLOC(vi->avgs[timestep], count * sum_size, "average per timestep")
+                for (c = 0; c < count; c ++)
+                    vi->avgs[timestep][c] = sums[timestep][c] / cnts[timestep];
+
+                MALLOC(vi->std_devs[timestep], count * sum_size, "standard deviation per timestep")
+                for (c = 0; c < count; c ++)
+                    vi->std_devs[timestep][c] = sqrt((sum_squares[timestep][c] / cnts[timestep]) - (vi->avgs[timestep][c] * vi->avgs[timestep][c]));
+
+                free (sums[timestep]);
+                free (sum_squares[timestep]);
+            }
+        }
+
+        // Calculate global average
+        if(vi->gmin && gsum && (map[adios_statistic_sum] != -1) && (map[adios_statistic_sum_square] != -1)) {
+            MALLOC(vi->gavg, count * sum_size, "global average")
+
+            if(gcnt > 0)
+                for (c = 0; c < count; c ++)
+                    vi->gavg[c] = gsum[c] / gcnt;
+            else
+                for (c = 0; c < count; c ++)
+                    vi->gavg[c] = gsum[c];
+
+            MALLOC(vi->gstd_dev, count * sum_size, "global average")
+            if(vi->gavg && gcnt > 0)
+                for (c = 0; c < count; c ++)
+                    vi->gstd_dev[c] = sqrt(gsum_square[c] / gcnt - (vi->gavg[c] * vi->gavg[c]));
+            else
+                for (c = 0; c < count; c ++)
+                    vi->gstd_dev[c] = 0;
+        }
+    }
+    else
+    {
+        timestep = 0;
+           for (i=0; i<var_root->characteristics_count; i++)
+        {
+            if (ntimes > 0)
+                timestep = var_root->characteristics[i].time_index - 1;
+                //timestep = i / (npgs / ntimes);
+
+            if (!var_root->characteristics[i].stats)
+                continue;
+
+            struct adios_index_characteristics_stat_struct * stats = var_root->characteristics[i].stats[0];
+            struct adios_index_characteristics_hist_struct * hist = stats[map[adios_statistic_hist]].data;
+
+            if (map[adios_statistic_finite] != -1 && (* ((uint8_t *) stats[map[adios_statistic_finite]].data) == 0))
+                continue;
+
+            if (map[adios_statistic_min] != -1 && stats[map[adios_statistic_min]].data)
+            {
+                if(!vi->gmin) {
+                    MALLOC (vi->gmin, size, "global minimum")
+                       memcpy(vi->gmin, stats[map[adios_statistic_min]].data, size);
+
+                } else if (adios_lt(var_root->type, stats[map[adios_statistic_min]].data, vi->gmin)){
+                       memcpy(vi->gmin, stats[map[adios_statistic_min]].data, size);
+                }
+
+                if (ntimes > 0) {
+                    if(!vi->mins[timestep]) {
+                        MALLOC (vi->mins[timestep], size, "minimum per timestep")
+                        memcpy(vi->mins[timestep], stats[map[adios_statistic_min]].data, size);
+
+                    } else if (adios_lt(var_root->type, stats[map[adios_statistic_min]].data, vi->mins[timestep])) {
+                        memcpy(vi->mins[timestep], stats[map[adios_statistic_min]].data, size);
+                    }
+                }
+            }
+
+            if (map[adios_statistic_max] != -1 && stats[map[adios_statistic_max]].data)
+            {
+                if(!vi->gmax) {
+                    MALLOC (vi->gmax, size, "global maximum")
+                    memcpy(vi->gmax, stats[map[adios_statistic_max]].data, size);
+
+                } else if (adios_lt(var_root->type, vi->gmax, stats[map[adios_statistic_max]].data))
+                       memcpy(vi->gmax, stats[map[adios_statistic_max]].data, size);
+                
+                if (ntimes > 0) {
+                    if(!vi->maxs[timestep]) {
+                        MALLOC (vi->maxs[timestep], size, "maximum per timestep")
+                        memcpy(vi->maxs[timestep], stats[map[adios_statistic_max]].data, size);
+
+                    } else if (adios_lt(var_root->type, vi->maxs[timestep], stats[map[adios_statistic_max]].data)) {
+                        memcpy(vi->maxs[timestep], stats[map[adios_statistic_max]].data, size);    
+                    }
+                }
+            }
+    
+            if (map[adios_statistic_sum] != -1 && stats[map[adios_statistic_sum]].data)
+            {    
+                if(!gsum) {
+                    MALLOC(gsum, sum_size, "global summation")
+                       memcpy(gsum, stats[map[adios_statistic_sum]].data, sum_size);
+
+                } else {
+                    *gsum = *gsum + * ((double *) stats[map[adios_statistic_sum]].data);
+                }
+
+                if (ntimes > 0) {
+                    if(!sums[timestep]) {
+                        MALLOC(sums[timestep], sum_size, "summation per timestep")
+                        memcpy(sums[timestep], stats[map[adios_statistic_sum]].data, sum_size);
+
+                    } else {
+                        *sums[timestep] = *sums[timestep] + * ((double *) stats[map[adios_statistic_sum]].data);
+                    }
+                }
+            }
+
+            if (map[adios_statistic_sum_square] != -1 && stats[map[adios_statistic_sum_square]].data)
+            {
+                if(!gsum_square) {
+                    MALLOC(gsum_square, sum_size, "global summation of squares")
+                    memcpy(gsum_square, stats[map[adios_statistic_sum_square]].data, sum_size);
+
+                } else {
+                       *gsum_square = *gsum_square + * ((double *) stats[map[adios_statistic_sum_square]].data);
+                }
+
+                if (ntimes > 0) {
+                    if(!sum_squares[timestep]) {
+                        MALLOC(sum_squares[timestep], sum_size, "summation of square per timestep")
+                        memcpy(sum_squares[timestep], stats[map[adios_statistic_sum_square]].data, sum_size);
+
+                    } else {
+                        *sum_squares[timestep] = *sum_squares[timestep] + * ((double *) stats[map[adios_statistic_sum_square]].data);
+                    }
+                }
+            }
+
+            if(map[adios_statistic_hist] != -1 && stats[map[adios_statistic_hist]].data)
+            {
+                for(j = 0; j <= vi->hist->num_breaks; j++)
+                {    
+                    uint32_t freq = hist->frequencies[j];
+                    vi->hist->gfrequencies[j] += freq;
+                    if (ntimes > 0)
+                        vi->hist->frequenciess[timestep][j] += freq;
+                }
+            }
+
+            if (map[adios_statistic_cnt] != -1 && stats[map[adios_statistic_cnt]].data)
+            {
+                if (ntimes > 0)
+                    cnts[timestep] += * (uint32_t *) stats[map[adios_statistic_cnt]].data;
+                gcnt += * (uint32_t *) stats[map[adios_statistic_cnt]].data;
+            }
+        }
+
+        if(ntimes > 0 && vi->gmin && (map[adios_statistic_sum] != -1) && (map[adios_statistic_sum_square] != -1)) {
+            // min, max, summation exists only for arrays
+            // Calculate average / timestep
+
+            for(timestep = 0; timestep < ntimes; timestep ++) {
+                MALLOC(vi->avgs[timestep], sum_size, "average per timestep")
+                *(vi->avgs[timestep]) = *(sums[timestep]) / cnts[timestep];
+
+                MALLOC(vi->std_devs[timestep], sum_size, "standard deviation per timestep")
+                *(vi->std_devs[timestep]) = sqrt(*(sum_squares[timestep]) / cnts[timestep] - ((*(vi->avgs[timestep]) * (*(vi->avgs[timestep])))));
+
+                free (sums[timestep]);
+                free (sum_squares[timestep]);
+            }
+        }
+
+        // Calculate global average
+        if(vi->gmin && gsum && (map[adios_statistic_sum] != -1) && (map[adios_statistic_sum_square] != -1)) {
+            MALLOC(vi->gavg, sum_size, "global average")
+            if(gcnt > 0)
+                *vi->gavg = *gsum / gcnt;
+            else
+                vi->gavg = gsum;
+
+            MALLOC(vi->gstd_dev, sum_size, "global average")
+            if(vi->gavg && gcnt > 0)
+                *vi->gstd_dev = sqrt(*gsum_square / gcnt - ((*(vi->gavg)) * (*(vi->gavg))));
+            else
+                *vi->gstd_dev = 0;
+        }
+    }
+
+    if (!vi->value && vi->gmin) {
+        vi->value = vi->gmin; // arrays have no value but we assign here the minimum
+    }
+
+    if(!vi->gmin) {
+        vi->gmin = vi->value; // scalars have value but not min
+    }
+    if(!vi->gmax) {
+        vi->gmax = vi->value; // scalars have value but not max
+    }
+
+    if (sums && gsum) {
+        free (sums);
+        free (gsum);
+    }
+
+    if (sum_squares && gsum_square) {
+        free (sum_squares);
+        free (gsum_square);
+    }    
+}
+
+/* get local and global dimensions and offsets from a variable characteristics 
+   return: 1 = it is a global array, 0 = local array
+*/
+static int adios_read_bp_get_dimensioncharacteristics(struct adios_index_characteristic_struct_v1 *ch, 
+                                               uint64_t *ldims, uint64_t *gdims, uint64_t *offsets)
+{
+    int is_global=0; // global array or just an array written by one process?
+    int ndim = ch->dims.count;
+    int k;
+
+    for (k=0; k < ndim; k++) {
+        ldims[k]   = ch->dims.dims[k*3];
+        gdims[k]   = ch->dims.dims[k*3+1];
+        offsets[k] = ch->dims.dims[k*3+2];
+        is_global = is_global || gdims[k];
+    }
+    return is_global;
+}
+
+static void adios_read_bp_get_dimensions (struct adios_index_var_struct_v1 *var_root, int ntsteps, int file_is_fortran,
+                                  int *ndim, uint64_t **dims, int *timedim)
+{
+    int i, k;
+    int is_global; // global array or just an array written by one process?
+    uint64_t ldims[32];
+    uint64_t gdims[32];
+    uint64_t offsets[32];
+
+    /* Get dimension information */    
+    *ndim = var_root->characteristics [0].dims.count; 
+    *dims = NULL;
+    *timedim = -1;
+    if (*ndim == 0) {
+        /* done with this scalar variable */
+        return ;
+    }
+
+    *dims = (uint64_t *) malloc (sizeof(uint64_t) * (*ndim));
+    memset(*dims,0,sizeof(uint64_t)*(*ndim));
+
+    is_global = adios_read_bp_get_dimensioncharacteristics( &(var_root->characteristics[0]),
+                                                    ldims, gdims, offsets);
+
+    if (!is_global) {
+        /* local array */
+        for (i=0; i < *ndim; i++) {
+            /* size of time dimension is always registered as 1 for an array */
+            if (ldims[i] == 1 && var_root->characteristics_count > 1) {
+                *timedim = i;
+                (*dims)[i] = ntsteps;
+            } else {
+                (*dims)[i] = ldims[i];
+            }
+            gdims[i] = ldims[i];
+        }         
+    }         
+    else {
+        /* global array:
+           time dimension: ldims=1, gdims=0
+           in C array, it can only be the first dim
+           in Fortran array, it can only be the last dim
+           (always the slowest changing dim)
+        */
+        if (ldims[0] == 1 && gdims[*ndim-1] == 0) {
+            /* first dimension is the time (C array)
+             * ldims[0] = 1 but gdims does not contain time info and 
+             * gdims[0] is 1st data dimension and 
+             * gdims is shorter by one value than ldims in case of C.
+             * Therefore, gdims[*ndim-1] = 0 if there is a time dimension. 
+             */
+            *timedim = 0;
+            // error check
+            if (file_is_fortran && *ndim > 1) {
+                fprintf(stderr,"ADIOS Error: this is a BP file with Fortran ordering but we found"
+                        "an array to have time dimension in the first dimension. l:g:o = (");
+                for (i=0; i < *ndim; i++) {
+                    fprintf(stderr,"%llu:%llu:%llu%s", ldims[i], gdims[i], offsets[i], (i<*ndim-1 ? ", " : "") );
+                }
+                fprintf(stderr, ")\n");
+            }
+            (*dims)[0] = ntsteps;
+            for (i=1; i < *ndim; i++) 
+                 (*dims)[i]=gdims[i-1];
+        }
+        else if (ldims[*ndim-1] == 1 && gdims[*ndim-1] == 0) {
+            // last dimension is the time (Fortran array)
+            *timedim = *ndim - 1;
+            if (!file_is_fortran && *ndim > 1) {
+                fprintf(stderr,"ADIOS Error: this is a BP file with C array ordering but we found"
+                        "an array to have time dimension in the last dimension. l:g:o = (");
+                for (i=0; i < *ndim; i++) {
+                    fprintf(stderr,"%llu:%llu:%llu%s", ldims[i], gdims[i], offsets[i], (i<*ndim-1 ? ", " : "") );
+                }
+                fprintf(stderr, ")\n");
+            }
+            for (i=0; i < *ndim-1; i++) 
+                 (*dims)[i]=gdims[i];
+             (*dims)[*timedim] = ntsteps;
+        } else {
+            // no time dimenstion
+            for (i=0; i < *ndim; i++) 
+                 (*dims)[i]=gdims[i];
+        }
+    }
+}
+
+ADIOS_VARINFO * adios_read_bp_inq_var (ADIOS_GROUP *gp, const char * varname) 
+{
+    int varid = adios_read_bp_find_var(gp, varname);
+    if (varid < 0)
+        return NULL;
+    return adios_read_bp_inq_var_byid(gp, varid);
+}
+
+ADIOS_VARINFO * adios_read_bp_inq_var_byid (ADIOS_GROUP *gp, int varid)
+{
+    struct BP_GROUP      * gh;
+    struct BP_FILE       * fh;
+    ADIOS_VARINFO * vi;
+    int file_is_fortran;
+    struct adios_index_var_struct_v1 * var_root;
+    int i,k;
+
+    adios_errno = 0;
+    if (!gp) {
+        error(err_invalid_group_struct, "Null pointer passed as group to adios_inq_var()");
+        return NULL;
+    }
+    gh = (struct BP_GROUP *) gp->gh;
+    if (!gh) {
+        error(err_invalid_group_struct, "Invalid ADIOS_GROUP struct: .gh group handle is NULL!");
+        return NULL;
+    }
+    fh = gh->fh;
+    if (!fh) {
+        error(err_invalid_group_struct, "Invalid ADIOS_GROUP struct: .gh->fh file handle is NULL!");
+        return NULL;
+    }
+    if (varid < 0 || varid >= gh->vars_count) {
+        error(err_invalid_varid, "Invalid variable id %d (allowed 0..%d)", varid, gh->vars_count);
+        return NULL;
+    }
+    vi = (ADIOS_VARINFO *) malloc(sizeof(ADIOS_VARINFO));
+    if (!vi) {
+        error( err_no_memory, "Could not allocate memory for variable info");
+        return NULL;
+    }
+
+
+    file_is_fortran = (fh->pgs_root->adios_host_language_fortran == adios_flag_yes);
+    
+    var_root = gh->vars_root; /* first variable of this group. Need to traverse the list */
+    for (i=0; i<varid && var_root; i++) {
+        var_root = var_root->next;
+    }
+
+    if (i!=varid) {
+        error (err_corrupted_variable, "Variable id=%d is valid but was not found in internal data structures!",varid);
+        return NULL; 
+    }
+
+
+    vi->varid = varid;
+
+    vi->type = var_root->type;
+    if (!var_root->characteristics_count) {
+        error(err_corrupted_variable, "Variable %s does not have information on dimensions", 
+              gp->var_namelist[varid]);
+        free(vi);
+        return NULL;
+    }
+
+    /* Get value or min/max */
+
+    adios_read_bp_get_dimensions (var_root, fh->tidx_stop - fh->tidx_start + 1, file_is_fortran, 
+                          &(vi->ndim), &(vi->dims), &(vi->timedim));
+    
+    if (file_is_fortran != futils_is_called_from_fortran()) {
+        /* If this is a Fortran written file and this is called from C code,  
+           or this is a C written file and this is called from Fortran code ==>
+           We need to reverse the order of the dimensions */
+        swap_order(vi->ndim, vi->dims, &(vi->timedim));
+        /*printf("File was written from %s and read now from %s, so we swap order of dimensions\n",
+                (file_is_fortran ? "Fortran" : "C"), (futils_is_called_from_fortran() ? "Fortran" : "C"));*/
+    }
+    
+    adios_read_bp_get_characteristics (var_root, vi);
+
+    return vi;
+}
+
+void adios_read_bp_free_varinfo (ADIOS_VARINFO *vp)
+{
+    if (vp) {
+        if (vp->dims)   free(vp->dims);
+        if (vp->value)  free(vp->value);
+        if (vp->gmin && vp->gmin != vp->value)   free(vp->gmin);
+        if (vp->gmax && vp->gmax != vp->value)   free(vp->gmax);
+        //if (vp->mins)   free(vp->mins);
+        //if (vp->maxs)   free(vp->maxs);
+        free(vp);
+    }
+}
+
+#define MPI_FILE_READ_OPS                           \
+        bp_realloc_aligned(fh->b, slice_size);      \
+        fh->b->offset = 0;                          \
+                                                    \
+        MPI_File_seek (fh->mpi_fh                   \
+                      ,(MPI_Offset)slice_offset     \
+                      ,MPI_SEEK_SET                 \
+                      );                            \
+                                                    \
+        MPI_File_read (fh->mpi_fh                   \
+                      ,fh->b->buff                  \
+                      ,slice_size                   \
+                      ,MPI_BYTE                     \
+                      ,&status                      \
+                      );                            \
+        fh->b->offset = 0;                          \
+
+//We also need to be able to read old .bp which doesn't have 'payload_offset'
+#define MPI_FILE_READ_OPS1                                                                  \
+        MPI_File_seek (fh->mpi_fh                                                           \
+                      ,(MPI_Offset) var_root->characteristics[start_idx + idx].offset       \
+                      ,MPI_SEEK_SET);                                                       \
+        MPI_File_read (fh->mpi_fh, fh->b->buff, 8, MPI_BYTE, &status);                      \
+        tmpcount= *((uint64_t*)fh->b->buff);                                                \
+                                                                                            \
+        bp_realloc_aligned(fh->b, tmpcount + 8);                                            \
+        fh->b->offset = 0;                                                                  \
+                                                                                            \
+        MPI_File_seek (fh->mpi_fh                                                           \
+                      ,(MPI_Offset) (var_root->characteristics[start_idx + idx].offset)     \
+                      ,MPI_SEEK_SET);                                                       \
+        MPI_File_read (fh->mpi_fh, fh->b->buff, tmpcount + 8, MPI_BYTE, &status);           \
+        fh->b->offset = 0;                                                                  \
+        adios_parse_var_data_header_v1 (fh->b, &var_header);                                \
+
+
+// To read subfiles
+#define MPI_FILE_READ_OPS2                                                                 \
+        bp_realloc_aligned(fh->b, slice_size);                                             \
+        fh->b->offset = 0;                                                                 \
+                                                                                           \
+        MPI_File sfh;                                                                      \
+        int err;                                                                           \
+        err = MPI_File_open (fh->comm                                                      \
+                      ,var_root->characteristics[start_idx + idx].file_name                \
+                      ,MPI_MODE_RDONLY                                                     \
+                      ,(MPI_Info)MPI_INFO_NULL                                             \
+                      ,&sfh                                                                \
+                      );                                                                   \
+       if (err != MPI_SUCCESS)                                                             \
+       {                                                                                   \
+           fprintf (stderr, "can not open file\n");                                        \
+           return -1;                                                                      \
+       }                                                                                   \
+                                                                                           \
+        MPI_File_seek (sfh                                                                 \
+                      ,(MPI_Offset)slice_offset                                            \
+                      ,MPI_SEEK_SET                                                        \
+                      );                                                                   \
+        MPI_File_read (sfh                                                                 \
+                      ,fh->b->buff                                                         \
+                      ,slice_size                                                          \
+                      ,MPI_BYTE                                                            \
+                      ,&status                                                             \
+                      );                                                                   \
+        MPI_File_close (&sfh);                                                             \
+        fh->b->offset = 0;                                                                 \
+
+
+int64_t adios_read_bp_read_var (ADIOS_GROUP * gp, const char * varname,
+                        const uint64_t * start, const uint64_t * count,
+                        void * data)
+{
+    struct BP_GROUP      * gh;
+    struct BP_FILE       * fh;
+    int varid, has_subfile;
+
+    adios_errno = 0;
+    if (!gp) {
+        error(err_invalid_group_struct, "Null pointer passed as group to adios_read_var()");
+        return -adios_errno;
+    }
+
+    gh = (struct BP_GROUP *) gp->gh;
+    if (!gh) {
+        error(err_invalid_group_struct, "Invalid ADIOS_GROUP struct: .gh group handle is NULL!");
+        return -adios_errno;
+    }
+
+    fh = gh->fh;
+    if (!fh) {
+        error(err_invalid_group_struct, "Invalid ADIOS_GROUP struct: .gh->fh file handle is NULL!");
+        return -adios_errno;
+    }
+
+    varid = adios_read_bp_find_var(gp, varname);
+    if (varid < 0 || varid >= gh->vars_count) {
+        error(err_invalid_varid, "Invalid variable id %d (allowed 0..%d)", varid, gh->vars_count);
+        return -adios_errno;
+    }
+
+    return adios_read_bp_read_var_byid(gp, varid, start, count, data);
+}
+
+// The purpose of keeping this function is to be able
+// to read in old BP files. Can be deleted later on.
+int64_t adios_read_bp_read_var_byid1 (ADIOS_GROUP    * gp,
+                             int              varid,
+                             const uint64_t  * start,
+                             const uint64_t  * count,
+                             void           * data)
+{
+    struct BP_GROUP      * gh;
+    struct BP_FILE       * fh;
+    int file_is_fortran;
+    struct adios_index_var_struct_v1 * var_root;
+    struct adios_var_header_struct_v1 var_header;
+    struct adios_var_payload_struct_v1 var_payload;
+    int    i,j,k, idx, timestep;
+    int    start_time, stop_time;
+    int    pgoffset, pgcount, next_pgoffset,start_idx, stop_idx;
+    int    ndim, ndim_notime;  
+    uint64_t size;
+    uint64_t *dims;
+    uint64_t ldims[32];
+    uint64_t gdims[32];
+    uint64_t offsets[32];
+    uint64_t datasize, nloop, dset_stride,var_stride, total_size=0, items_read;
+    uint64_t count_notime[32], start_notime[32];
+    MPI_Status status;
+    int timedim = -1, temp_timedim, timedim_c;
+    int rank;
+    int is_global = 0;
+    int size_of_type;
+    uint64_t slice_offset;
+    uint64_t slice_size;
+    uint64_t tmpcount = 0;
+    uint64_t datatimeoffset = 0; // offset in data to write a given timestep
+
+    adios_errno = 0;
+    if (!gp) {
+        error(err_invalid_group_struct, "Null pointer passed as group to adios_read_var()");
+        return -adios_errno;
+    }
+    gh = (struct BP_GROUP *) gp->gh;
+    if (!gh) {
+        error(err_invalid_group_struct, "Invalid ADIOS_GROUP struct: .gh group handle is NULL!");
+        return -adios_errno;
+    }
+    fh = gh->fh;
+    if (!fh) {
+        error(err_invalid_group_struct, "Invalid ADIOS_GROUP struct: .gh->fh file handle is NULL!");
+        return -adios_errno;
+    }
+    if (varid < 0 || varid >= gh->vars_count) {
+        error(err_invalid_varid, "Invalid variable id %d (allowed 0..%d)", varid, gh->vars_count);
+        return -adios_errno;
+    }
+    
+    file_is_fortran = (fh->pgs_root->adios_host_language_fortran == adios_flag_yes);
+    
+    var_root = gh->vars_root; /* first variable of this group. Need to traverse the list */
+    for (i=0; i<varid && var_root; i++) {
+        var_root = var_root->next;
+    }
+
+    if (i!=varid) {
+        error (err_corrupted_variable, "Variable id=%d is valid but was not found in internal data structures!",varid);
+        return -adios_errno; 
+    }
+
+    /* Get dimensions and flip if caller != writer language */
+    adios_read_bp_get_dimensions (var_root, fh->tidx_stop - fh->tidx_start + 1, file_is_fortran, 
+                          &ndim, &dims, &timedim);
+
+    /* Here the cases in which .bp written from Fortran and C are considered separately.
+       1) bp written from Fortran */
+    if (file_is_fortran)
+    {
+        /* Get the timesteps we need to read */
+        if (timedim > -1) 
+        {
+            if (timedim != ndim - 1)
+            {
+                error(err_no_data_at_timestep,"Variable (id=%d) has wrong time dimension index",
+                      varid);
+                return -adios_errno;
+            }
+            if (futils_is_called_from_fortran())
+            {
+                start_time = start[timedim] + fh->tidx_start;
+                stop_time = start_time + count[timedim] - 1;
+            }
+            else
+            {
+                start_time = start[0] + fh->tidx_start;
+                stop_time = start_time + count[0] - 1;
+            }
+        }
+        else 
+        {
+            /* timeless variable, but we still need to handle the case that
+               var is not written in the first few timesteps. 
+               This happens in Pixie3D.  */
+            for (i = 0; i < fh->mfooter.time_steps; i++)
+            {
+                pgoffset = fh->gvar_h->time_index[0][gh->group_id][i];
+                if (i < fh->mfooter.time_steps - 1)
+                    next_pgoffset = fh->gvar_h->time_index[0][gh->group_id][i + 1];
+                else
+                    next_pgoffset = -1;
+
+                if (fh->gvar_h->pg_offsets[pgoffset] < var_root->characteristics[0].offset
+                && (i == fh->mfooter.time_steps - 1 
+                   ||fh->gvar_h->pg_offsets[next_pgoffset] > var_root->characteristics[0].offset)
+                )
+                {
+                    start_time = fh->tidx_start + i;
+                    stop_time = start_time;
+                    break;
+                }
+            }
+        }
+
+        /* flip dims and timedim to C order */
+        swap_order(ndim, dims, &timedim);
+
+        /* Take out the time dimension from start[] and count[] */
+        /* if we have time dimension */
+        if (timedim > -1)
+        {
+            j = 0;
+            if (futils_is_called_from_fortran())
+                temp_timedim = ndim - 1;
+            else
+                temp_timedim = 0;
+
+            for (i = 0; i < temp_timedim; i++)
+            {
+                count_notime[j] = count[i];
+                start_notime[j] = start[i];
+                j++;
+            }
+            i++; // skip timedim
+            for (; i < ndim; i++)
+            {
+                count_notime[j] = count[i];
+                start_notime[j] = start[i];
+                j++;
+            }
+            ndim_notime = ndim-1;
+        }
+        else
+        /* if we don't have time dimension */
+        {
+            for (i = 0; i < ndim; i++)
+            {
+                count_notime[i] = count[i];
+                start_notime[i] = start[i];
+            }
+            ndim_notime = ndim;
+        }
+    }
+    /* 2) .bp written by C */
+    else
+    {
+        /* Get the timesteps we need to read */
+        if (timedim > -1) 
+        {
+            /* timedim has to be the 1st dimension. To be extended to handle 
+               the cases timedim at any dimension */
+            if (timedim != 0)
+            {
+                error(err_no_data_at_timestep,"Variable (id=%d) has wrong time dimension",
+                      varid);
+                return -adios_errno;
+            }
+
+            if (futils_is_called_from_fortran())
+            {
+                start_time = start[ndim - 1] + fh->tidx_start;
+                stop_time = start_time + count[ndim -1] - 1;
+            }
+            else
+            {
+                start_time = start[0] + fh->tidx_start;
+                stop_time = start_time + count[0] - 1;
+            }
+
+            start_time = start[timedim] + fh->tidx_start;
+            stop_time = start_time + count[timedim] - 1;
+        }
+        else 
+        {
+            /* timeless variable */
+            start_time = fh->tidx_start;
+            stop_time = fh->tidx_start;
+        }
+
+        /* No need to flip dims, timedim as they are already in C order. */
+        //swap_order(ndim, dims, &timedim);
+
+        /* Take out the time dimension from start[] and count[] */
+        if (timedim == -1) /* timeless variable */ 
+        {
+            for (i = 0; i < ndim; i++) 
+            {
+                count_notime[i] = count[i];
+                start_notime[i] = start[i];
+            }
+            ndim_notime = ndim;
+        }
+        /* if we have time dimension */
+        else
+        {
+            j = 0;
+            if (futils_is_called_from_fortran())
+                temp_timedim = ndim - 1;
+            else
+                temp_timedim = 0;
+
+            for (i = 0; i < temp_timedim; i++)
+            {
+                count_notime[j] = count[i];
+                start_notime[j] = start[i];
+                j++;
+            }
+            i++; // skip timedim
+            for (; i < ndim; i++)
+            {
+                count_notime[j] = count[i];
+                start_notime[j] = start[i];
+                j++;
+            }
+            ndim_notime = ndim - 1;
+        }
+    }
+
+    /* Fortran reader was reported of Fortran dimension order so it gives counts and starts in that order.
+       We need to swap them here to read correctly in C order */
+    if ( futils_is_called_from_fortran()) {
+        swap_order(ndim_notime, count_notime, &timedim);
+        swap_order(ndim_notime, start_notime, &timedim);
+    }
+    
+    /* items_read = how many data elements are we going to read in total (per timestep) */
+    items_read = 1;
+    for (i = 0; i < ndim_notime; i++)
+        items_read *= count_notime[i];
+    
+    MPI_Comm_rank(gh->fh->comm, &rank);
+
+    size_of_type = bp_get_type_size (var_root->type, var_root->characteristics [0].value);
+
+    /* For each timestep, do reading separately (they are stored in different sets of process groups */
+    for (timestep = start_time; timestep <= stop_time; timestep++) {
+
+        // pgoffset = the starting offset for the given time step
+        // pgcount  = number of process groups of that time step
+        pgoffset = fh->gvar_h->time_index[0][gh->group_id][timestep - fh->tidx_start];
+        pgcount = fh->gvar_h->time_index[1][gh->group_id][timestep - fh->tidx_start];
+
+        start_idx = -1;
+        for (i=0;i<var_root->characteristics_count;i++) {
+            if (   (  var_root->characteristics[i].offset > fh->gvar_h->pg_offsets[pgoffset])
+                && (  (pgoffset + pgcount == fh->mfooter.pgs_count) 
+                    ||(  var_root->characteristics[i].offset < fh->gvar_h->pg_offsets[pgoffset + 1]))
+               ) 
+            {
+                start_idx = i;
+                break;
+            }
+        }
+/*
+printf ("var_root->characteristics_count = %d\n", var_root->characteristics_count);
+printf ("pg offset 0 = %lld\n", fh->gvar_h->pg_offsets[pgoffset]);
+printf ("pg offset 1 = %lld\n", fh->gvar_h->pg_offsets[pgoffset + 1]);
+printf ("var offset 3 = %lld\n", var_root->characteristics[3].offset);
+printf ("var offset 2 = %lld\n", var_root->characteristics[2].offset);
+printf ("var offset 1 = %lld\n", var_root->characteristics[1].offset);
+printf ("pgcount = %lld\n", pgcount);
+*/
+        for (i=var_root->characteristics_count-1;i>-1;i--) {
+            if (   (  var_root->characteristics[i].offset > fh->gvar_h->pg_offsets[pgoffset])
+                && (  (pgoffset + pgcount == fh->mfooter.pgs_count)
+                    ||(  var_root->characteristics[i].offset < fh->gvar_h->pg_offsets[pgoffset + pgcount]))
+               )
+            {
+                stop_idx = i;
+                break;
+            }
+        }
+
+        if (start_idx<0) {
+            error(err_no_data_at_timestep,"Variable (id=%d) has no data at %d time step",
+                varid, timestep);
+            return -adios_errno;
+        }
+
+        if (ndim_notime == 0) {
+            /* READ A SCALAR VARIABLE */
+
+            slice_size = size_of_type;
+            idx = 0; // macros below need it
+
+            if (var_root->type == adios_string) {
+                // strings are stored without \0 in file
+                // size_of_type here includes \0 so decrease by one
+                size_of_type--;
+            }
+
+            if (var_root->characteristics[start_idx+idx].payload_offset > 0) {
+                slice_offset = var_root->characteristics[start_idx+idx].payload_offset;
+                MPI_FILE_READ_OPS
+            } else {
+                slice_offset = 0;
+                MPI_FILE_READ_OPS1
+            }
+
+            memcpy((char *)data+total_size, fh->b->buff + fh->b->offset, size_of_type);
+            if (fh->mfooter.change_endianness == adios_flag_yes) {
+                change_endianness((char *)data+total_size, size_of_type, var_root->type);
+            }
+
+            if (var_root->type == adios_string) {
+                // add \0 to the end of string
+                // size_of_type here is the length of string
+                // FIXME: how would this work for strings written over time?
+                ((char*)data+total_size)[size_of_type] = '\0';
+            }
+
+            total_size += size_of_type;
+            continue;
+        }
+
+        /* READ AN ARRAY VARIABLE */
+        //int * idx_table = (int *) malloc (sizeof(int) * pgcount);
+        //int * idx_table = (int *) malloc (sizeof(int) * (var_root->characteristics_count - start_idx));
+        int * idx_table = (int *) malloc (sizeof(int) * (stop_idx - start_idx + 1));
+
+        uint64_t write_offset = 0;
+        int npg = 0;
+        tmpcount = 0;
+        if (pgcount > var_root->characteristics_count)
+            pgcount = var_root->characteristics_count;
+
+        // loop over the list of pgs to read from one-by-one
+        for (idx = 0; idx < stop_idx - start_idx + 1; idx++) {
+            int flag;
+            datasize = 1;
+            nloop = 1;
+            var_stride = 1;
+            dset_stride = 1;
+            idx_table[idx] = 1;
+            uint64_t payload_size = size_of_type;
+    
+            /* Each pg can have a different sized array, so we need the actual dimensions from it */
+            is_global = adios_read_bp_get_dimensioncharacteristics( &(var_root->characteristics[start_idx + idx]),
+                                                            ldims, gdims, offsets);
+            if (!is_global) {
+                // we use gdims below, which is 0 for a local array; set to ldims here
+                for (j = 0; j< ndim; j++) {
+                    gdims[j]=ldims[j];
+                }
+            }
+
+            /* Again, a Fortran written file has the dimensions in Fortran order we need to swap here */
+            //if (file_is_fortran != futils_is_called_from_fortran()) {
+            if (file_is_fortran ) {
+                i=-1;
+                swap_order(ndim, gdims,   &(i)); // i is dummy 
+                swap_order(ndim, ldims,   &(i));
+                swap_order(ndim, offsets, &(i));
+            }
+            
+            /* take out the time dimension */
+            /* For C, gdims and offset are one size shorter because the timedim part is missing,
+               so we take it out only for fortran files
+            */
+            if (timedim > -1) {
+                for (i = timedim; i < ndim-1; i++) {
+                    ldims[i] = ldims[i+1];
+                    if (file_is_fortran) {
+                        gdims[i] = gdims[i+1];
+                        offsets[i] = offsets[i+1];
+                    }
+                }
+            }
+            /*
+            printf("ldims   = "); for (j = 0; j<ndim; j++) printf("%d ",ldims[j]); printf("\n");
+            printf("gdims   = "); for (j = 0; j<ndim; j++) printf("%d ",gdims[j]); printf("\n");
+            printf("offsets = "); for (j = 0; j<ndim; j++) printf("%d ",offsets[j]); printf("\n");
+            printf("count_notime   = "); for (j = 0; j<ndim_notime; j++) printf("%d ",count_notime[j]); printf("\n");
+            printf("start_notime   = "); for (j = 0; j<ndim_notime; j++) printf("%d ",start_notime[j]); printf("\n");
+            */
+            for (j = 0; j < ndim_notime; j++) {
+    
+                payload_size *= ldims [j];
+    
+                if ( (count_notime[j] > gdims[j]) 
+                  || (start_notime[j] > gdims[j]) 
+                  || (start_notime[j] + count_notime[j] > gdims[j])){
+                    error( err_out_of_bound, "Error: Variable (id=%d) out of bound ("
+                        "the data in dimension %d to read is %llu elements from index %llu"
+                        " but the actual data is [0,%llu])",
+                        varid, j+1, count_notime[j], start_notime[j], gdims[j] - 1);
+                    return -adios_errno;
+                }
+    
+                /* check if there is any data in this pg and this dimension to read in */
+                flag = (offsets[j] >= start_notime[j] 
+                        && offsets[j] < start_notime[j] + count_notime[j])
+                    || (offsets[j] < start_notime[j]
+                        && offsets[j] + ldims[j] > start_notime[j] + count_notime[j]) 
+                    || (offsets[j] + ldims[j] > start_notime[j] 
+                        && offsets[j] + ldims[j] <= start_notime[j] + count_notime[j]);
+                idx_table [idx] = idx_table[idx] && flag;
+            }
+            
+            if ( !idx_table[idx] ) {
+                continue;
+            }
+            ++npg;
+
+            /* determined how many (fastest changing) dimensions can we read in in one read */
+            int hole_break; 
+            for (i = ndim_notime - 1; i > -1; i--) {
+                if (offsets[i] == start_notime[i] && ldims[i] == count_notime[i]) {
+                    datasize *= ldims[i];
+                }
+                else
+                    break;
+            }
+    
+            hole_break = i;
+            slice_offset = 0;
+            slice_size = 0;
+
+            if (hole_break == -1) {
+                /* The complete read happens to be exactly one pg, and the entire pg */
+                /* This means we enter this only once, and npg=1 at the end */
+                /* This is a rare case. FIXME: cannot eliminate this? */
+                slice_size = payload_size;
+
+                if (var_root->characteristics[start_idx + idx].payload_offset > 0) {
+                    slice_offset = var_root->characteristics[start_idx + idx].payload_offset;
+                    MPI_FILE_READ_OPS
+                } else {
+                    slice_offset = 0;
+                    MPI_FILE_READ_OPS1
+                }
+    
+                memcpy( (char *)data, fh->b->buff + fh->b->offset, slice_size);
+                if (fh->mfooter.change_endianness == adios_flag_yes) {
+                    change_endianness(data, slice_size, var_root->type);
+                }
+            }
+            else if (hole_break == 0) 
+            {
+                /* The slowest changing dimensions should not be read completely but
+                   we still need to read only one block */
+                int isize;
+                uint64_t size_in_dset = 0;
+                uint64_t offset_in_dset = 0;
+                uint64_t offset_in_var = 0;
+    
+                isize = offsets[0] + ldims[0];
+                if (start_notime[0] >= offsets[0]) {
+                    // head is in
+                    if (start_notime[0]<isize) {
+                        if (start_notime[0] + count_notime[0] > isize)
+                            size_in_dset = isize - start_notime[0];
+                        else
+                            size_in_dset = count_notime[0];
+                        offset_in_dset = start_notime[0] - offsets[0];
+                        offset_in_var = 0;
+                    }
+                }
+                else {
+                    // middle is in
+                    if (isize < start_notime[0] + count_notime[0])
+                        size_in_dset = ldims[0];
+                    else
+                    // tail is in
+                        size_in_dset = count_notime[0] + start_notime[0] - offsets[0];
+                    offset_in_dset = 0;
+                    offset_in_var = offsets[0] - start_notime[0];
+                }
+    
+                slice_size = size_in_dset * datasize * size_of_type;
+                write_offset = offset_in_var * datasize * size_of_type;
+
+                if (var_root->characteristics[start_idx + idx].payload_offset > 0) {
+                    slice_offset = var_root->characteristics[start_idx + idx].payload_offset 
+                                 + offset_in_dset * datasize * size_of_type;
+                    MPI_FILE_READ_OPS
+                } else {
+                    slice_offset = 0;
+                    MPI_FILE_READ_OPS1
+                }
+    
+                memcpy ((char *)data + write_offset, fh->b->buff + fh->b->offset, slice_size);
+                if (fh->mfooter.change_endianness == adios_flag_yes) {
+                    change_endianness((char *)data + write_offset, slice_size, var_root->type);
+                }
+    
+                //write_offset +=  slice_size;
+            }
+            else 
+            {
+
+                uint64_t stride_offset = 0;
+                int isize;
+                uint64_t size_in_dset[10];
+                uint64_t offset_in_dset[10];
+                uint64_t offset_in_var[10];
+                memset(size_in_dset, 0 , 10 * 8);
+                memset(offset_in_dset, 0 , 10 * 8);
+                memset(offset_in_var, 0 , 10 * 8);
+                int hit = 0;
+                for ( i = 0; i < ndim_notime ; i++) {
+                    isize = offsets[i] + ldims[i];
+                    if (start_notime[i] >= offsets[i]) {
+                        // head is in
+                        if (start_notime[i]<isize) {
+                            if (start_notime[i] + count_notime[i] > isize)
+                                size_in_dset[i] = isize - start_notime[i];
+                            else
+                                size_in_dset[i] = count_notime[i];
+                            offset_in_dset[i] = start_notime[i] - offsets[i];
+                            offset_in_var[i] = 0;
+                            hit = 1 + hit * 10;
+                        }
+                        else
+                            hit = -1;
+                    }
+                    else {
+                        // middle is in
+                        if (isize < start_notime[i] + count_notime[i]) {
+                            size_in_dset[i] = ldims[i];
+                            hit = 2 + hit * 10;
+                        }
+                        else {
+                            // tail is in
+                            size_in_dset[i] = count_notime[i] + start_notime[i] - offsets[i];
+                            hit = 3 + hit * 10;
+                        }
+                        offset_in_dset[i] = 0;
+                        offset_in_var[i] = offsets[i] - start_notime[i];
+                    }
+                }
+    
+                datasize = 1;
+                var_stride = 1;
+    
+                for ( i = ndim_notime-1; i >= hole_break; i--) {
+                    datasize *= size_in_dset[i];
+                    dset_stride *= ldims[i];
+                    var_stride *= count_notime[i];
+                }
+    
+                uint64_t start_in_payload = 0, end_in_payload = 0, s = 1;
+                for (i = ndim_notime - 1; i > -1; i--) {
+                    start_in_payload += s * offset_in_dset[i] * size_of_type;
+                    end_in_payload += s * (offset_in_dset[i] + size_in_dset[i] - 1) * size_of_type;
+                    s *= ldims[i];
+                }
+    
+                slice_size = end_in_payload - start_in_payload + 1 * size_of_type;
+    
+                if (var_root->characteristics[start_idx + idx].payload_offset > 0) {
+                    slice_offset =  var_root->characteristics[start_idx + idx].payload_offset
+                                  + start_in_payload;
+                    MPI_FILE_READ_OPS
+    
+                    for ( i = 0; i < ndim_notime ; i++) {
+                        offset_in_dset[i] = 0;
+                    }
+                } else {
+                    slice_offset =  start_in_payload;
+                    MPI_FILE_READ_OPS1
+                }
+
+                uint64_t var_offset = 0;
+                uint64_t dset_offset = 0;
+                for ( i = 0; i < hole_break; i++) {
+                    nloop *= size_in_dset[i];
+                }
+    
+                for ( i = 0; i < ndim_notime ; i++) {
+                    var_offset = offset_in_var[i] + var_offset * count_notime[i];
+                    dset_offset = offset_in_dset[i] + dset_offset * ldims[i];
+                }
+
+                copy_data (data
+                          ,fh->b->buff + fh->b->offset
+                          ,0
+                          ,hole_break
+                          ,size_in_dset
+                          ,ldims
+                          ,count_notime
+                          ,var_stride
+                          ,dset_stride
+                          ,var_offset
+                          ,dset_offset
+                          ,datasize
+                          ,size_of_type 
+                          );
+
+            }
+        }  // end for (idx ... loop over pgs
+    
+        free (idx_table);
+
+        total_size += items_read * size_of_type;
+        // shift target pointer for next read in
+        data = (char *)data + (items_read * size_of_type);
+
+    } // end for (timestep ... loop over timesteps
+
+    free (dims);
+
+    return total_size;
+}
+
+// Search for the start var index.
+static int get_var_start_index (struct adios_index_var_struct_v1 * v, int t)
+{
+    int i = 0;
+
+    while (i < v->characteristics_count) {
+        if (v->characteristics[i].time_index == t) {
+            return i;
+        }
+
+        i++;
+    }
+
+    return -1;
+}
+
+// Search for the stop var index
+static int get_var_stop_index (struct adios_index_var_struct_v1 * v, int t)
+{
+    int i = v->characteristics_count - 1;
+
+    while (i > -1) {
+        if (v->characteristics[i].time_index == t) {
+            return i;
+        }
+
+        i--;      
+    }
+
+    return -1;
+}
+
+int64_t adios_read_bp_read_var_byid2 (ADIOS_GROUP    * gp,
+                                      int            varid,
+                                      const uint64_t * start,
+                                      const uint64_t * count,
+                                      void           * data)
+{
+    struct BP_GROUP      * gh;
+    struct BP_FILE       * fh;
+    struct adios_index_var_struct_v1 * var_root;
+    struct adios_var_header_struct_v1 var_header;
+    struct adios_var_payload_struct_v1 var_payload;
+    int    i,j,k, idx, t;
+    int    start_time, stop_time;
+    int    start_idx, stop_idx;
+    int    ndim, ndim_notime, has_subfile, file_is_fortran;
+    uint64_t size, * dims;
+    uint64_t ldims[32], gdims[32], offsets[32];
+    uint64_t datasize, nloop, dset_stride,var_stride, total_size=0, items_read;
+    uint64_t count_notime[32], start_notime[32];
+    int timedim = -1, temp_timedim, is_global = 0, size_of_type;
+    uint64_t slice_offset, slice_size, tmpcount = 0;
+    uint64_t datatimeoffset = 0; // offset in data to write a given timestep
+    MPI_Status status;
+
+    gh = (struct BP_GROUP *) gp->gh;
+    fh = gh->fh;
+
+    file_is_fortran = (fh->pgs_root->adios_host_language_fortran == adios_flag_yes);
+    has_subfile = fh->mfooter.version & ADIOS_VERSION_HAVE_SUBFILE;
+
+    var_root = gh->vars_root; /* first variable of this group. Need to traverse the list */
+    for (i = 0; i< varid && var_root; i++) {
+        var_root = var_root->next;
+    }
+
+    if (i!=varid) {
+        error (err_corrupted_variable, 
+               "Variable id=%d is valid but was not found in internal data structures!",
+               varid);
+        return -adios_errno; 
+    }
+
+    /* Get dimensions and flip if caller != writer language */
+    adios_read_bp_get_dimensions (var_root, fh->tidx_stop - fh->tidx_start + 1, file_is_fortran, 
+                          &ndim, &dims, &timedim);
+
+    /* In a Fortran written files, dimensions are in reversed order for C */
+    //if ( file_is_fortran != futils_is_called_from_fortran() ) 
+    if (file_is_fortran) 
+        swap_order(ndim, dims, &timedim);
+
+    /* Take out the time dimension from start[] and count[] */
+    if (timedim == -1) {
+        /* For timeless var, we still search from fh->tidx_start to fh->tidx_stop
+           to handle the situation that some variables are dumped out in selected timesteps
+        */
+        start_time = fh->tidx_start;
+        stop_time = fh->tidx_stop;
+
+        for (i = 0; i < ndim; i++) {
+             count_notime[i] = count[i];
+             start_notime[i] = start[i];
+        }
+        ndim_notime = ndim;
+    } else {
+        j = 0;
+        if (futils_is_called_from_fortran())
+            temp_timedim = ndim - 1;
+        else
+            temp_timedim = 0;
+
+        start_time = start[temp_timedim] + fh->tidx_start;
+        stop_time = start_time + count[temp_timedim] - 1;
+
+        for (i = 0; i < temp_timedim; i++) {
+             count_notime[j] = count[i];
+             start_notime[j] = start[i];
+             j++;
+        }
+        i++; // skip timedim
+        for (; i < ndim; i++) {
+             count_notime[j] = count[i];
+             start_notime[j] = start[i];
+             j++;
+        }
+        ndim_notime = ndim-1;
+    }
+
+    /* Fortran reader was reported of Fortran dimension order so it gives counts and starts in that order.
+       We need to swap them here to read correctly in C order */
+    if ( futils_is_called_from_fortran()) {
+        swap_order(ndim_notime, count_notime, &timedim);
+        swap_order(ndim_notime, start_notime, &timedim);
+    }
+    
+    /* items_read = how many data elements are we going to read in total (per timestep) */
+    items_read = 1;
+    for (i = 0; i < ndim_notime; i++)
+        items_read *= count_notime[i];
+    
+    size_of_type = bp_get_type_size (var_root->type, var_root->characteristics [0].value);
+
+    /* For each timestep, do reading separately (they are stored in different sets of process groups */
+    for (t = start_time; t <= stop_time; t++) {
+        start_idx = get_var_start_index(var_root, t);
+        stop_idx = get_var_stop_index(var_root, t);
+
+        if (start_idx < 0 || stop_idx < 0) {
+            error(err_no_data_at_timestep,"Variable (id=%d) has no data at %d time step",
+                varid, t);
+//            return -adios_errno;
+            continue;
+        }
+
+        if (ndim_notime == 0) {
+            /* READ A SCALAR VARIABLE */
+            slice_size = size_of_type;
+            idx = 0; // macros below need it
+
+            if (var_root->type == adios_string) {
+                // strings are stored without \0 in file
+                // size_of_type here includes \0 so decrease by one
+                size_of_type--;
+            }
+
+            if (var_root->characteristics[start_idx+idx].payload_offset > 0) {
+                slice_offset = var_root->characteristics[start_idx+idx].payload_offset;
+                if (!has_subfile) {
+                    MPI_FILE_READ_OPS
+                } else {
+                    MPI_FILE_READ_OPS2
+                }
+            } else {
+                slice_offset = 0;
+                MPI_FILE_READ_OPS1
+            }
+
+            memcpy((char *)data+total_size, fh->b->buff + fh->b->offset, size_of_type);
+            if (fh->mfooter.change_endianness == adios_flag_yes) {
+                change_endianness((char *)data+total_size, size_of_type, var_root->type);
+            }
+
+            if (var_root->type == adios_string) {
+                // add \0 to the end of string
+                // size_of_type here is the length of string
+                // FIXME: how would this work for strings written over time?
+                ((char*)data+total_size)[size_of_type] = '\0';
+            }
+
+            total_size += size_of_type;
+            
+            if (timedim == -1)
+                break;
+            else
+                continue;
+        }
+
+         /* READ AN ARRAY VARIABLE */
+        int * idx_table = (int *) malloc (sizeof(int) * (stop_idx - start_idx + 1));
+
+        uint64_t write_offset = 0;
+        int npg = 0;
+        tmpcount = 0;
+        // loop over the list of pgs to read from one-by-one
+        for (idx = 0; idx < stop_idx - start_idx + 1; idx++) {
+            int flag;
+            datasize = 1;
+            nloop = 1;
+            var_stride = 1;
+            dset_stride = 1;
+            idx_table[idx] = 1;
+            uint64_t payload_size = size_of_type;
+    
+            /* Each pg can have a different sized array, so we need the actual dimensions from it */
+            is_global = adios_read_bp_get_dimensioncharacteristics( &(var_root->characteristics[start_idx + idx]),
+                                                            ldims, gdims, offsets);
+            if (!is_global) {
+                // we use gdims below, which is 0 for a local array; set to ldims here
+                for (j = 0; j< ndim; j++) {
+                    gdims[j]=ldims[j];
+                }
+            }
+
+            /* Again, a Fortran written file has the dimensions in Fortran order we need to swap here */
+            //if (file_is_fortran != futils_is_called_from_fortran()) {
+            if (file_is_fortran) {
+                i=-1;
+                swap_order(ndim, gdims,   &(i)); // i is dummy 
+                swap_order(ndim, ldims,   &(i));
+                swap_order(ndim, offsets, &(i));
+            }
+            
+            /* take out the time dimension */
+            /* For C, gdims and offset are one size shorter because the timedim part is missing,
+               so we take it out only for fortran files
+            */
+            if (timedim > -1) {
+                for (i = timedim; i < ndim-1; i++) {
+                    ldims[i] = ldims[i+1];
+                    if (file_is_fortran) {
+                        gdims[i] = gdims[i+1];
+                        offsets[i] = offsets[i+1];
+                    }
+                }
+            }
+
+            /*
+            printf("ldims   = "); for (j = 0; j<ndim; j++) printf("%d ",ldims[j]); printf("\n");
+            printf("gdims   = "); for (j = 0; j<ndim; j++) printf("%d ",gdims[j]); printf("\n");
+            printf("offsets = "); for (j = 0; j<ndim; j++) printf("%d ",offsets[j]); printf("\n");
+            printf("count_notime   = "); for (j = 0; j<ndim_notime; j++) printf("%d ",count_notime[j]); printf("\n");
+            printf("start_notime   = "); for (j = 0; j<ndim_notime; j++) printf("%d ",start_notime[j]); printf("\n");
+            */
+                
+            for (j = 0; j < ndim_notime; j++) {
+    
+                payload_size *= ldims [j];
+    
+                if ( (count_notime[j] > gdims[j]) 
+                  || (start_notime[j] > gdims[j]) 
+                  || (start_notime[j] + count_notime[j] > gdims[j])){
+                    error( err_out_of_bound, "Error: Variable (id=%d) out of bound ("
+                        "the data in dimension %d to read is %llu elements from index %llu"
+                        " but the actual data is [0,%llu])",
+                        varid, j+1, count_notime[j], start_notime[j], gdims[j] - 1);
+                    return -adios_errno;
+                }
+    
+                /* check if there is any data in this pg and this dimension to read in */
+                flag = (offsets[j] >= start_notime[j] 
+                        && offsets[j] < start_notime[j] + count_notime[j])
+                    || (offsets[j] < start_notime[j]
+                        && offsets[j] + ldims[j] > start_notime[j] + count_notime[j]) 
+                    || (offsets[j] + ldims[j] > start_notime[j] 
+                        && offsets[j] + ldims[j] <= start_notime[j] + count_notime[j]);
+                idx_table [idx] = idx_table[idx] && flag;
+            }
+            
+            if ( !idx_table[idx] ) {
+                continue;
+            }
+            ++npg;
+    
+            /* determined how many (fastest changing) dimensions can we read in in one read */
+            int hole_break; 
+            for (i = ndim_notime - 1; i > -1; i--) {
+                if (offsets[i] == start_notime[i] && ldims[i] == count_notime[i]) {
+                    datasize *= ldims[i];
+                }
+                else
+                    break;
+            }
+    
+            hole_break = i;
+            slice_offset = 0;
+            slice_size = 0;
+
+            if (hole_break == -1) {
+                /* The complete read happens to be exactly one pg, and the entire pg */
+                /* This means we enter this only once, and npg=1 at the end */
+                /* This is a rare case. FIXME: cannot eliminate this? */
+                slice_size = payload_size;
+    
+                if (var_root->characteristics[start_idx + idx].payload_offset > 0) {
+                    slice_offset = var_root->characteristics[start_idx + idx].payload_offset;
+                    if (!has_subfile) {
+                        MPI_FILE_READ_OPS
+                    } else {
+                        MPI_FILE_READ_OPS2
+                    }
+                } else {
+                    slice_offset = 0;
+                    MPI_FILE_READ_OPS1
+                }
+    
+                memcpy( (char *)data, fh->b->buff + fh->b->offset, slice_size);
+                if (fh->mfooter.change_endianness == adios_flag_yes) {
+                    change_endianness(data, slice_size, var_root->type);
+                }
+            }
+            else if (hole_break == 0) 
+            {
+                /* The slowest changing dimensions should not be read completely but
+                   we still need to read only one block */
+                int isize;
+                uint64_t size_in_dset = 0;
+                uint64_t offset_in_dset = 0;
+    
+                isize = offsets[0] + ldims[0];
+                if (start_notime[0] >= offsets[0]) {
+                    // head is in
+                    if (start_notime[0]<isize) {
+                        if (start_notime[0] + count_notime[0] > isize)
+                            size_in_dset = isize - start_notime[0];
+                        else
+                            size_in_dset = count_notime[0];
+                        offset_in_dset = start_notime[0] - offsets[0];
+                    }
+                }
+                else {
+                    // middle is in
+                    if (isize < start_notime[0] + count_notime[0])
+                        size_in_dset = ldims[0];
+                    else
+                    // tail is in
+                        size_in_dset = count_notime[0] + start_notime[0] - offsets[0];
+                    offset_in_dset = 0;
+                }
+    
+                slice_size = size_in_dset * datasize * size_of_type;
+    
+                if (var_root->characteristics[start_idx + idx].payload_offset > 0) {
+                    slice_offset = var_root->characteristics[start_idx + idx].payload_offset 
+                                 + offset_in_dset * datasize * size_of_type;
+                    if (!has_subfile) {
+                        MPI_FILE_READ_OPS
+                    } else {
+                        MPI_FILE_READ_OPS2
+                    }
+
+                } else {
+                    slice_offset = 0;
+                    MPI_FILE_READ_OPS1
+                }
+    
+                memcpy ((char *)data + write_offset, fh->b->buff + fh->b->offset, slice_size);
+                if (fh->mfooter.change_endianness == adios_flag_yes) {
+                    change_endianness((char *)data + write_offset, slice_size, var_root->type);
+                }
+    
+                write_offset +=  slice_size;
+            }
+            else 
+            {
+
+                uint64_t stride_offset = 0;
+                int isize;
+                uint64_t size_in_dset[10];
+                uint64_t offset_in_dset[10];
+                uint64_t offset_in_var[10];
+                memset(size_in_dset, 0 , 10 * 8);
+                memset(offset_in_dset, 0 , 10 * 8);
+                memset(offset_in_var, 0 , 10 * 8);
+                int hit = 0;
+                for ( i = 0; i < ndim_notime ; i++) {
+                    isize = offsets[i] + ldims[i];
+                    if (start_notime[i] >= offsets[i]) {
+                        // head is in
+                        if (start_notime[i]<isize) {
+                            if (start_notime[i] + count_notime[i] > isize)
+                                size_in_dset[i] = isize - start_notime[i];
+                            else
+                                size_in_dset[i] = count_notime[i];
+                            offset_in_dset[i] = start_notime[i] - offsets[i];
+                            offset_in_var[i] = 0;
+                            hit = 1 + hit * 10;
+                        }
+                        else
+                            hit = -1;
+                    }
+                    else {
+                        // middle is in
+                        if (isize < start_notime[i] + count_notime[i]) {
+                            size_in_dset[i] = ldims[i];
+                            hit = 2 + hit * 10;
+                        }
+                        else {
+                            // tail is in
+                            size_in_dset[i] = count_notime[i] + start_notime[i] - offsets[i];
+                            hit = 3 + hit * 10;
+                        }
+                        offset_in_dset[i] = 0;
+                        offset_in_var[i] = offsets[i] - start_notime[i];
+                    }
+                }
+    
+                datasize = 1;
+                var_stride = 1;
+    
+                for ( i = ndim_notime-1; i >= hole_break; i--) {
+                    datasize *= size_in_dset[i];
+                    dset_stride *= ldims[i];
+                    var_stride *= count_notime[i];
+                }
+    
+                uint64_t start_in_payload = 0, end_in_payload = 0, s = 1;
+                for (i = ndim_notime - 1; i > -1; i--) {
+                    start_in_payload += s * offset_in_dset[i] * size_of_type;
+                    end_in_payload += s * (offset_in_dset[i] + size_in_dset[i] - 1) * size_of_type;
+                    s *= ldims[i];
+                }
+    
+                slice_size = end_in_payload - start_in_payload + 1 * size_of_type;
+    
+                if (var_root->characteristics[start_idx + idx].payload_offset > 0) {
+                    slice_offset =  var_root->characteristics[start_idx + idx].payload_offset
+                                  + start_in_payload;
+                    if (!has_subfile) {
+                        MPI_FILE_READ_OPS
+                    } else {
+                        MPI_FILE_READ_OPS2
+                    }
+ 
+                    for ( i = 0; i < ndim_notime ; i++) {
+                        offset_in_dset[i] = 0;
+                    }
+                } else {
+                    slice_offset =  start_in_payload;
+                    MPI_FILE_READ_OPS1
+                }
+    
+                uint64_t var_offset = 0;
+                uint64_t dset_offset = 0;
+                for ( i = 0; i < hole_break; i++) {
+                    nloop *= size_in_dset[i];
+                }
+    
+                for ( i = 0; i < ndim_notime ; i++) {
+                    var_offset = offset_in_var[i] + var_offset * count_notime[i];
+                    dset_offset = offset_in_dset[i] + dset_offset * ldims[i];
+                }
+    
+                copy_data (data
+                          ,fh->b->buff + fh->b->offset
+                          ,0
+                          ,hole_break
+                          ,size_in_dset
+                          ,ldims
+                          ,count_notime
+                          ,var_stride
+                          ,dset_stride
+                          ,var_offset
+                          ,dset_offset
+                          ,datasize
+                          ,size_of_type 
+                          );
+            }
+        }  // end for (idx ... loop over pgs
+    
+        free (idx_table);
+    
+        total_size += items_read * size_of_type;
+        // shift target pointer for next read in
+        data = (char *)data + (items_read * size_of_type);
+
+        if (timedim == -1)
+            break;
+    } // end for (timestep ... loop over timesteps
+
+    free (dims);
+
+    return total_size;
+}
+
+int64_t adios_read_bp_read_var_byid (ADIOS_GROUP    * gp,
+                                     int            varid,
+                                     const uint64_t  * start,
+                                     const uint64_t  * count,
+                                     void            * data)
+{
+    struct BP_GROUP      * gh;
+    struct BP_FILE       * fh;
+    int has_time_index_characteristic;
+
+    adios_errno = 0;
+    if (!gp) {
+        error(err_invalid_group_struct, "Null pointer passed as group to adios_read_var()");
+        return -adios_errno;
+    }
+
+    gh = (struct BP_GROUP *) gp->gh;
+    if (!gh) {
+        error(err_invalid_group_struct, "Invalid ADIOS_GROUP struct: .gh group handle is NULL!");
+        return -adios_errno;
+    }
+
+    fh = gh->fh;
+    if (!fh) {
+        error(err_invalid_group_struct, "Invalid ADIOS_GROUP struct: .gh->fh file handle is NULL!");
+        return -adios_errno;
+    }
+
+    has_time_index_characteristic = fh->mfooter.version & ADIOS_VERSION_HAVE_TIME_INDEX_CHARACTERISTIC;
+    if (!has_time_index_characteristic) {
+        // read older file format. Can be deleted later on.
+        return adios_read_bp_read_var_byid1(gp, varid, start, count, data);
+    } else {
+        return adios_read_bp_read_var_byid2(gp, varid, start, count, data);
+    }
+}
+
+// NCSU - Timer series analysis, correlation
+double adios_stat_cor (ADIOS_VARINFO * vix, ADIOS_VARINFO * viy, char * characteristic, uint32_t time_start, uint32_t time_end, uint32_t lag)
+{
+    int i,j;
+
+    double avg_x = 0.0, avg_y = 0.0, avg_lag = 0.0;
+    double var_x = 0.0, var_y = 0.0, var_lag = 0.0;
+    double cov = 0;
+
+    if (vix == NULL)
+    {
+        fprintf(stderr, "Variable not defined\n");
+        return 0;
+    }
+
+    // If the vix and viy are not time series objects, return.
+    if ((vix->timedim < 0) && (viy->timedim < 0))
+    {             
+        fprintf(stderr, "Covariance must involve timeseries data\n");
+        return 0;
+    }                                                                    
+
+    uint32_t min = vix->dims[0] - 1;
+    if (viy && (min > viy->dims[0] - 1))
+        min = viy->dims[0] - 1;         
+    
+    if(time_start == 0 && time_end == 0) 
+    { //global covariance
+        if(viy == NULL) {
+            fprintf(stderr, "Must have two variables for global covariance\n");
+            return 0;
+        }                                                                          
+
+        // Assign vix to viy, and calculate covariance
+        viy = vix;
+        time_start = 0;
+        time_end = min;
+    }
+    // Check the bounds of time
+    if (    (time_start >= 0) && (time_start <= min)
+            &&      (time_end >= 0)   && (time_end <= min)
+            &&  (time_start <= time_end))
+    {
+        if(viy == NULL) //user must want to run covariance against itself
+        {
+            if(! (time_end+lag) > min)
+            {                                                                        
+                fprintf(stderr, "Must leave enough timesteps for lag\n");
+                return 0;
+            }
+
+            if (strcmp(characteristic, "average") == 0 || strcmp(characteristic, "avg") == 0)
+            {
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    avg_x += bp_value_to_double (adios_double, vix->avgs[i]) / (time_end - time_start + 1);
+                    avg_lag += bp_value_to_double (adios_double, vix->avgs[i + lag]) / (time_end - time_start + 1);
+                }
+
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    double val_x = bp_value_to_double (adios_double, vix->avgs[i]); 
+                    double val_lag = bp_value_to_double (adios_double, vix->avgs[i + lag]); 
+                    var_x += (val_x - avg_x) * (val_x - avg_x) / (time_end - time_start + 1); 
+                    var_lag += (val_lag - avg_lag) * (val_lag - avg_lag) / (time_end - time_start + 1);
+                    cov += (val_x - avg_x) * (val_lag - avg_lag) / (time_end - time_start + 1);
+                }
+            }
+            else if (strcmp(characteristic, "standard deviation") == 0 || strcmp(characteristic, "std_dev") == 0)
+            {
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    avg_x += bp_value_to_double (adios_double, vix->std_devs[i]) / (time_end - time_start + 1);
+                    avg_lag += bp_value_to_double (adios_double, vix->std_devs[i + lag]) / (time_end - time_start + 1);
+                }
+
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    double val_x = bp_value_to_double (adios_double, vix->std_devs[i]);
+                    double val_lag = bp_value_to_double (adios_double, vix->std_devs[i + lag]);
+                    var_x += (val_x - avg_x) * (val_x - avg_x) / (time_end - time_start + 1);
+                    var_lag += (val_lag - avg_lag) * (val_lag - avg_lag) / (time_end - time_start + 1);
+                    cov += (val_x - avg_x) * (val_lag - avg_lag) / (time_end - time_start + 1);
+                }
+            }
+            else if (strcmp(characteristic, "minimum") == 0 || strcmp(characteristic, "min") == 0)
+            {
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    avg_x += bp_value_to_double (vix->type, vix->mins[i]) / (time_end - time_start + 1);
+                    avg_lag += bp_value_to_double (vix->type, vix->mins[i + lag]) / (time_end - time_start + 1);
+                }
+
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    double val_x = bp_value_to_double (vix->type, vix->mins[i]); 
+                    double val_lag = bp_value_to_double (vix->type, vix->mins[i + lag]); 
+                    var_x += (val_x - avg_x) * (val_x - avg_x) / (time_end - time_start + 1); 
+                    var_lag += (val_lag - avg_lag) * (val_lag - avg_lag) / (time_end - time_start + 1);
+                    cov += (val_x - avg_x) * (val_lag - avg_lag) / (time_end - time_start + 1);
+                }
+            }
+            else if (strcmp(characteristic, "maximum") == 0 || strcmp(characteristic, "max") == 0)
+            {
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    avg_x += bp_value_to_double (vix->type, vix->maxs[i]) / (time_end - time_start + 1);
+                    avg_lag += bp_value_to_double (vix->type, vix->maxs[i]) / (time_end - time_start + 1);
+                }
+
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    double val_x = bp_value_to_double (vix->type, vix->maxs[i]); 
+                    double val_lag = bp_value_to_double (vix->type, vix->maxs[i + lag]); 
+                    var_x += (val_x - avg_x) * (val_x - avg_x) / (time_end - time_start + 1); 
+                    var_lag += (val_lag - avg_lag) * (val_lag - avg_lag) / (time_end - time_start + 1);
+                    cov += (val_x - avg_x) * (val_lag - avg_lag) / (time_end - time_start + 1);
+                }
+            }
+            else
+            {
+                fprintf (stderr, "Unknown characteristic\n");
+                return 0;
+            }
+            return cov / (sqrt (var_x) * sqrt (var_lag));
+        }
+        else
+        {
+            if (strcmp(characteristic, "average") == 0 || strcmp(characteristic, "avg") == 0)
+            {
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    avg_x += bp_value_to_double(adios_double, vix->avgs[i]) / (time_end - time_start + 1);
+                    avg_y += bp_value_to_double(adios_double, viy->avgs[i]) / (time_end - time_start + 1);
+                }
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    double val_x = bp_value_to_double (adios_double, vix->avgs[i]); 
+                    double val_y = bp_value_to_double (adios_double, viy->avgs[i]); 
+                    var_x += (val_x - avg_x) * (val_x - avg_x) / (time_end - time_start + 1); 
+                    var_y += (val_y - avg_y) * (val_y - avg_y) / (time_end - time_start + 1);
+                    cov += (val_x - avg_x) * (val_y - avg_y) / (time_end - time_start + 1);
+                }
+            }
+            else if (strcmp(characteristic, "standard deviation") == 0 || strcmp(characteristic, "std_dev") == 0)
+            {
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    avg_x += bp_value_to_double(adios_double, vix->std_devs[i]) / (time_end - time_start + 1);
+                    avg_y += bp_value_to_double(adios_double, viy->std_devs[i]) / (time_end - time_start + 1);
+                }
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    double val_x = bp_value_to_double (adios_double, vix->std_devs[i]);
+                    double val_y = bp_value_to_double (adios_double, viy->std_devs[i]);
+                    var_x += (val_x - avg_x) * (val_x - avg_x) / (time_end - time_start + 1);
+                    var_y += (val_y - avg_y) * (val_y - avg_y) / (time_end - time_start + 1);
+                    cov += (val_x - avg_x) * (val_y - avg_y) / (time_end - time_start + 1);
+                }
+            }
+            else if (strcmp(characteristic, "minimum") == 0 || strcmp(characteristic, "min") == 0)
+            {
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    avg_x += bp_value_to_double(vix->type, vix->mins[i]) / (time_end - time_start + 1);
+                    avg_y += bp_value_to_double(viy->type, viy->mins[i]) / (time_end - time_start + 1);
+                }
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    double val_x = bp_value_to_double (vix->type, vix->mins[i]); 
+                    double val_y = bp_value_to_double (viy->type, viy->mins[i]); 
+                    var_x += (val_x - avg_x) * (val_x - avg_x) / (time_end - time_start + 1); 
+                    var_y += (val_y - avg_y) * (val_y - avg_y) / (time_end - time_start + 1);
+                    cov += (val_x - avg_x) * (val_y - avg_y) / (time_end - time_start + 1);
+                }
+            }
+            else if (strcmp(characteristic, "maximum") == 0 || strcmp(characteristic, "max") == 0)
+            {
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    avg_x += bp_value_to_double(vix->type, vix->maxs[i]) / (time_end - time_start + 1);
+                    avg_y += bp_value_to_double(vix->type, viy->maxs[i]) / (time_end - time_start + 1);
+                }
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    double val_x = bp_value_to_double (vix->type, vix->maxs[i]); 
+                    double val_y = bp_value_to_double (viy->type, viy->maxs[i]); 
+                    var_x += (val_x - avg_x) * (val_x - avg_x) / (time_end - time_start + 1); 
+                    var_y += (val_y - avg_y) * (val_y - avg_y) / (time_end - time_start + 1);
+                    cov += (val_x - avg_x) * (val_y - avg_y) / (time_end - time_start + 1);
+                }
+            }
+            else
+            {
+                fprintf (stderr, "Unknown characteristic\n");
+                return 0;
+            }
+            return cov / (sqrt (var_x) * sqrt (var_y));
+        }
+    }
+    else
+    {
+        fprintf (stderr, "Time values out of bounds\n");
+        return 0;
+    }
+}
+
+// NCSU - Time series analysis, covariance
+//covariance(x,y) = sum(i=1,..N) [(x_1 - x_mean)(y_i - y_mean)]/N
+double adios_stat_cov (ADIOS_VARINFO * vix, ADIOS_VARINFO * viy, char * characteristic, uint32_t time_start, uint32_t time_end, uint32_t lag)
+{
+    int i,j;
+
+    double avg_x = 0.0, avg_y = 0.0, avg_lag = 0.0;
+    double cov = 0;
+
+    if (vix == NULL)
+    {
+        fprintf(stderr, "Variable not defined\n");
+        return 0;
+    }
+
+    // If the vix and viy are not time series objects, return.
+    if ((vix->timedim < 0) && (viy->timedim < 0))
+    {             
+        fprintf(stderr, "Covariance must involve timeseries data\n");
+        return 0;
+    }                                                                    
+
+    uint32_t min = vix->dims[0] - 1;
+    if (viy && (min > viy->dims[0] - 1))
+        min = viy->dims[0] - 1;         
+    
+    if(time_start == 0 && time_end == 0) 
+    { //global covariance
+        if(viy == NULL) {
+            fprintf(stderr, "Must have two variables for global covariance\n");
+            return 0;
+        }                                                                          
+
+        // Assign vix to viy, and calculate covariance
+        viy = vix;
+        time_start = 0;
+        time_end = min;
+    }
+    // Check the bounds of time
+    if (    (time_start >= 0) && (time_start <= min)
+            &&      (time_end >= 0)   && (time_end <= min)
+            &&  (time_start <= time_end))
+    {
+        if(viy == NULL) //user must want to run covariance against itself
+        {
+            if(! (time_end+lag) > min)
+            {                                                                        
+                fprintf(stderr, "Must leave enough timesteps for lag\n");
+                return 0;
+            }
+
+            if (strcmp(characteristic, "average") == 0 || strcmp(characteristic, "avg") == 0)
+            {
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    avg_x += bp_value_to_double (adios_double, vix->avgs[i]) / (time_end - time_start + 1);
+                    avg_lag += bp_value_to_double (adios_double, vix->avgs[i + lag]) / (time_end - time_start + 1);
+                }
+
+                for (i = time_start; i <= time_end; i ++)
+                    cov += (bp_value_to_double (adios_double, vix->avgs[i]) - avg_x) * (bp_value_to_double (adios_double, vix->avgs[i+lag]) - avg_lag) / (time_end - time_start + 1);
+            }
+            else if (strcmp(characteristic, "standard deviation") == 0 || strcmp(characteristic, "std_dev") == 0)
+            {
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    avg_x += bp_value_to_double (adios_double, vix->std_devs[i]) / (time_end - time_start + 1);
+                    avg_lag += bp_value_to_double (adios_double, vix->std_devs[i + lag]) / (time_end - time_start + 1);
+                }
+
+                for (i = time_start; i <= time_end; i ++)
+                    cov += (bp_value_to_double (adios_double, vix->std_devs[i]) - avg_x) * (bp_value_to_double (adios_double, vix->std_devs[i+lag]) - avg_lag) / (time_end - time_start + 1);
+            }
+            else if (strcmp(characteristic, "minimum") == 0 || strcmp(characteristic, "min") == 0)
+            {
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    avg_x += bp_value_to_double (vix->type, vix->mins[i]) / (time_end - time_start + 1);
+                    avg_lag += bp_value_to_double (vix->type, vix->mins[i + lag]) / (time_end - time_start + 1);
+                }
+
+                for (i = time_start; i <= time_end; i ++)
+                    cov += (bp_value_to_double (vix->type, vix->mins[i]) - avg_x) * (bp_value_to_double (vix->type, vix->mins[i+lag]) - avg_lag) / (time_end - time_start + 1);
+            }
+            else if (strcmp(characteristic, "maximum") == 0 || strcmp(characteristic, "max") == 0)
+            {
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    avg_x += bp_value_to_double (vix->type, vix->maxs[i]) / (time_end - time_start + 1);
+                    avg_lag += bp_value_to_double (vix->type, vix->maxs[i + lag]) / (time_end - time_start + 1);
+                }
+
+                for (i = time_start; i <= time_end; i ++)
+                    cov += (bp_value_to_double (vix->type, vix->maxs[i]) - avg_x) * (bp_value_to_double (vix->type, vix->maxs[i+lag]) - avg_lag) / (time_end - time_start + 1);
+            }
+            else
+            {
+                fprintf (stderr, "Unknown characteristic\n");
+                return 0;
+            }
+        }
+        else
+        {
+            if (strcmp(characteristic, "average") == 0 || strcmp(characteristic, "avg") == 0)
+            {
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    avg_x += bp_value_to_double(adios_double, vix->avgs[i]) / (time_end - time_start + 1);
+                    avg_y += bp_value_to_double(adios_double, viy->avgs[i]) / (time_end - time_start + 1);
+                }
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    cov += (bp_value_to_double(adios_double, vix->avgs[i]) - avg_x) * (bp_value_to_double(adios_double, viy->avgs[i]) - avg_y) / (time_end - time_start + 1);
+                }
+            }
+            else if (strcmp(characteristic, "standard deviation") == 0 || strcmp(characteristic, "std_dev") == 0)
+            {
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    avg_x += bp_value_to_double(adios_double, vix->std_devs[i]) / (time_end - time_start + 1);
+                    avg_y += bp_value_to_double(adios_double, viy->std_devs[i]) / (time_end - time_start + 1);
+                }
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    cov += (bp_value_to_double(adios_double, vix->std_devs[i]) - avg_x) * (bp_value_to_double(adios_double, viy->std_devs[i]) - avg_y) / (time_end - time_start + 1);
+                }
+            }
+            else if (strcmp(characteristic, "minimum") == 0 || strcmp(characteristic, "min") == 0)
+            {
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    avg_x += bp_value_to_double(vix->type, vix->mins[i]) / (time_end - time_start + 1);
+                    avg_y += bp_value_to_double(viy->type, viy->mins[i]) / (time_end - time_start + 1);
+                }
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    cov += (bp_value_to_double(vix->type, vix->mins[i]) - avg_x) * (bp_value_to_double(viy->type, viy->mins[i]) - avg_y) / (time_end - time_start + 1);
+                }
+            }
+            else if (strcmp(characteristic, "maximum") == 0 || strcmp(characteristic, "max") == 0)
+            {
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    avg_x += bp_value_to_double(vix->type, vix->maxs[i]) / (time_end - time_start + 1);
+                    avg_y += bp_value_to_double(vix->type, viy->maxs[i]) / (time_end - time_start + 1);
+                }
+                for (i = time_start; i <= time_end; i ++)
+                {
+                    cov += (bp_value_to_double(vix->type, vix->maxs[i]) - avg_x) * (bp_value_to_double(viy->type, viy->maxs[i]) - avg_y) / (time_end - time_start + 1);
+                }
+            }
+            else
+            {
+                fprintf (stderr, "Unknown characteristic\n");
+                return 0;
+            }
+        }
+    }
+    else
+    {
+        fprintf (stderr, "Time values out of bounds\n");
+    }
+    return cov;
+}
diff --git a/src/read_dart.c b/src/read_dart.c
new file mode 100644
index 0000000..c7b1bbf
--- /dev/null
+++ b/src/read_dart.c
@@ -0,0 +1,434 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+
+/**************************************************/
+/* Read method for DART memory-to-memory coupling */
+/**************************************************/
+
+#include <stdlib.h>
+#include <string.h>
+//#include <errno.h>  /* ENOMEM */
+#include "adios.h"
+#include "bp_utils.h"
+#include "bp_types.h"
+#include "adios_types.h"
+#include "adios_read.h"
+#include "adios_read_hooks.h"
+#include "adios_error.h"
+#include "futils.h"
+#include "globals.h"
+
+#include "dart.h"
+
+#ifdef DMALLOC
+#include "dmalloc.h"
+#endif
+
+#if 1
+#   define DBG_PRINTF printf
+#else
+#   define DBG_PRINTF(a,...) 
+#endif
+
+#define MAXDARTNAMELEN 128
+
+/*#define DART_DO_VERSIONING   define it at configure as -DDART_DO_VERSIONING in CFLAGS */
+static int number_of_fopens = 0;  /* for versioning, works only if one file is fopened (in a loop) in the application */
+
+struct adios_read_dart_data_struct {
+    char *fname;               // path of file 
+    int access_version;        // counting the access
+    int disconnect_at_fclose;  // disconnect from DART in fclose()
+    int mpi_rank;              // just for debug prints
+};
+
+// Declarations
+static int adios_read_dart_get (const char * varname, enum ADIOS_DATATYPES vartype, 
+                                struct adios_read_dart_data_struct * ds, 
+                                int * offset, int * readsize, void * data);
+
+/* If init is used, we connect to DART here, otherwise we connect in fopen.
+   If multiple fopen..fclose cycles are used, init/finalize must be used too to
+   avoid multiple connection/disconnection in fopen/fclose.
+*/
+int adios_read_dart_init (MPI_Comm comm) 
+{ 
+    int  nproc, drank, dpeers;
+    int  rank, err;
+    int  appid, was_set;
+    MPI_Comm_rank(comm, &rank);
+    MPI_Comm_size(comm, &nproc);
+
+    /* Connect to DART, but only if we are not yet connected (from Write API) */
+    if (!globals_adios_is_dart_connected()) {
+        appid = globals_adios_get_application_id (&was_set);
+        if (!was_set) 
+            appid = 2;
+        DBG_PRINTF("-- %s, rank %d: connect to dart with nproc=%d and appid=%d\n", __func__, rank, nproc, appid);
+        err = dart_init(nproc, appid);
+        if (err < 0) {
+            error(err_connection_failed, "Failed to connect with DART\n");
+            return -err_connection_failed;
+        }
+
+        //drank = dart_rank(dcg);
+        //dpeers = dart_peers(dcg);
+    }
+    globals_adios_set_dart_connected_from_reader();
+    return 0; 
+}
+
+int adios_read_dart_finalize () 
+{ 
+    // disconnect from DART only if we the reader is connected (the writer not anymore)
+    if (globals_adios_is_dart_connected_from_reader() && 
+        !globals_adios_is_dart_connected_from_both()) 
+    {
+        dart_finalize();
+        DBG_PRINTF("-- %s: disconnected from dart\n", __func__);
+    }
+    globals_adios_set_dart_disconnected_from_reader();
+}
+
+ADIOS_FILE * adios_read_dart_fopen (const char * fname, MPI_Comm comm)
+{
+    ADIOS_FILE * fp;
+    struct adios_read_dart_data_struct * ds;
+    int i;    
+
+    adios_errno = 0;
+
+    ds = (struct adios_read_dart_data_struct *) malloc (sizeof(struct adios_read_dart_data_struct));
+    if (!ds) {
+        error( err_no_memory, "Cannot allocate memory for file info.");
+        return NULL;
+    }
+
+    /* fill out dart method specific struct */
+    ds->fname = strdup(fname);
+#ifdef DART_DO_VERSIONING
+    ds->access_version = number_of_fopens;  /* Read data of separate versions from DataSpaces */
+#else
+    ds->access_version = 0;    /* Data in DataSpaces is always overwritten (read same version) */
+#endif
+    MPI_Comm_rank(comm, &ds->mpi_rank);
+
+    /* if not connected to DART, connect now (and disconnect in fclose) */
+    if (!globals_adios_is_dart_connected_from_reader()) {
+        DBG_PRINTF("-- %s, rank %d: call init first\n", __func__, ds->mpi_rank);
+        if (!adios_read_dart_init(comm)) {
+            return NULL;
+        }
+        ds->disconnect_at_fclose = 1;
+    } else {
+        ds->disconnect_at_fclose = 0;
+    }
+
+    /* Try to get variable with fname. If it does not exists, we get an error, which means
+       the data does not exist. So we return an error just like with real files */
+    int offset[] = {0,0,0}, readsize[3] = {1,1,1};
+    int time_index;
+    int err;
+    enum ADIOS_DATATYPES time_index_type = adios_integer;
+    char dart_fname[MAXDARTNAMELEN];
+    snprintf(dart_fname, MAXDARTNAMELEN, "FILE@%s",fname);
+    DBG_PRINTF("-- %s, rank %d: Get variable %s\n", __func__, ds->mpi_rank, dart_fname);
+    /* We perform dart_lock_on_read here and release it in fclose */
+    DBG_PRINTF("   rank %d: call dcg_lock_on_read(%s)\n", ds->mpi_rank, fname);
+    dart_lock_on_read(fname);
+    DBG_PRINTF("   rank %d: dart_get %s\n", ds->mpi_rank, dart_fname);
+    err = adios_read_dart_get(dart_fname, time_index_type, ds, offset, readsize, &time_index);
+    if (err) {
+        error(err_file_not_found_error, "Data of '%s' does not exist in DataSpaces\n", dart_fname);
+        DBG_PRINTF("   rank %d: call dcg_unlock_on_read(%s)\n", ds->mpi_rank, fname);
+        dart_unlock_on_read(fname);
+        free(ds);
+        return NULL;
+    } else {
+        DBG_PRINTF("-- %s, rank %d: data of '%s' exists, time index = %d\n", __func__, ds->mpi_rank, dart_fname, time_index);
+    }
+
+
+    fp = (ADIOS_FILE *) malloc (sizeof (ADIOS_FILE));
+    if (!fp) {
+        error( err_no_memory, "Cannot allocate memory for file info.");
+        return NULL;
+    }
+
+    /* fill out ADIOS_FILE struct */
+    fp->fh = (uint64_t) ds;
+    fp->groups_count = 1;
+    fp->vars_count = 0;
+    fp->attrs_count = 0;
+    fp->tidx_start = 0;
+    fp->ntimesteps = 1;
+    fp->file_size = 0;
+    fp->version = 1;
+    fp->endianness = 0; /* FIXME: not always Little Endian. Does it matter? */
+    alloc_namelist (&fp->group_namelist,fp->groups_count); 
+    for (i=0;i<fp->groups_count;i++) {
+        if (!fp->group_namelist[i]) {
+            error(err_no_memory, "Could not allocate buffer for %d strings in adios_fopen()", fp->groups_count);
+            adios_read_dart_fclose(fp);
+            return NULL;
+        }
+        else  {
+            strcpy(fp->group_namelist[i],"dart");
+        }
+    }
+    DBG_PRINTF("-- %s, rank %d: done fp=%x, fp->fh=%x\n", __func__, ds->mpi_rank, fp, fp->fh);
+#ifdef DART_DO_VERSIONING
+    number_of_fopens++;
+#endif
+    return fp;
+}
+
+int adios_read_dart_fclose (ADIOS_FILE *fp) 
+{
+    struct adios_read_dart_data_struct * ds = (struct adios_read_dart_data_struct *) fp->fh;
+    int i,j;
+
+    adios_errno = 0;
+
+    DBG_PRINTF("-- %s, rank %d: fp=%x\n", __func__, ds->mpi_rank, fp);
+
+    /* Release read lock locked in fopen */
+    dart_unlock_on_read(ds->fname);
+    
+    /* Disconnect from DART if we connected in fopen() */
+    if (ds && ds->disconnect_at_fclose) {
+        adios_read_dart_finalize();
+    }
+
+    free_namelist ((fp->group_namelist),fp->groups_count);
+    if (ds->fname) { free(ds->fname); ds->fname = 0; }
+    free(ds);
+    free(fp);
+    return 0;
+}
+
+/* This function can be called if user places 
+   the wrong sequences of dims for a var 
+*/
+void adios_read_dart_reset_dimension_order (ADIOS_FILE *fp, int is_fortran)
+{
+    /* unimplemented */
+}
+
+
+ADIOS_GROUP * adios_read_dart_gopen (ADIOS_FILE *fp, const char * grpname)
+{
+    /* DART has no groups, so any grpname is accepted and the same empty stuff is returned */
+    return adios_read_dart_gopen_byid(fp, 0);
+}
+
+ADIOS_GROUP * adios_read_dart_gopen_byid (ADIOS_FILE *fp, int grpid)
+{
+    struct adios_read_dart_data_struct * ds = (struct adios_read_dart_data_struct *) fp->fh;
+    ADIOS_GROUP * gp;
+
+    /* DART has no groups, so any grpid is accepted and the same empty stuff is returned */
+
+    adios_errno = 0;
+    gp = (ADIOS_GROUP *) malloc(sizeof(ADIOS_GROUP));
+    if (!gp) {
+        error( err_no_memory, "Could not allocate memory for group info");
+        return NULL;
+    }
+
+    /* fill out ADIOS_GROUP struct */
+    gp->grpid = grpid;
+    gp->gh = (uint64_t) 0;
+    gp->fp = fp;
+    gp->vars_count = 0;
+    gp->attrs_count = 0;
+    gp->var_namelist = 0;
+    gp->attr_namelist = 0;
+    
+    return gp;
+}
+                   
+int adios_read_dart_gclose (ADIOS_GROUP *gp)
+{
+    struct adios_read_dart_data_struct * ds = (struct adios_read_dart_data_struct *) gp->fp->fh;
+
+    adios_errno = 0;
+
+    free_namelist ((gp->var_namelist),gp->vars_count);
+    free_namelist ((gp->attr_namelist),gp->attrs_count);
+    free(gp);
+    return 0;
+}
+
+
+
+int adios_read_dart_get_attr (ADIOS_GROUP * gp, const char * attrname, enum ADIOS_DATATYPES * type,
+                    int * size, void ** data)
+{
+    /* DART does not support attributes */
+    error(err_invalid_attrname, "DART read method does not support attributes!");
+    *size = 0;
+    *type = adios_unknown;
+    *data = 0;
+    return adios_errno;
+}
+
+int adios_read_dart_get_attr_byid (ADIOS_GROUP * gp, int attrid, 
+                    enum ADIOS_DATATYPES * type, int * size, void ** data)
+{
+    /* DART does not support attributes */
+    error(err_invalid_attrid, "DART read method does not support attributes!");
+    *size = 0;
+    *type = adios_unknown;
+    *data = 0;
+    return adios_errno;
+}
+
+
+ADIOS_VARINFO * adios_read_dart_inq_var (ADIOS_GROUP *gp, const char * varname) 
+{
+    /* DART has no inquiry capability, report somthing dummy */
+    return adios_read_dart_inq_var_byid(gp, 0);
+}
+
+ADIOS_VARINFO * adios_read_dart_inq_var_byid (ADIOS_GROUP *gp, int varid)
+{
+    struct adios_read_dart_data_struct * ds = (struct adios_read_dart_data_struct *) gp->fp->fh;
+    ADIOS_VARINFO * vi;
+    int i,k;
+
+    adios_errno = 0;
+    vi = (ADIOS_VARINFO *) malloc(sizeof(ADIOS_VARINFO));
+    if (!vi) {
+        error( err_no_memory, "Could not allocate memory for variable info.");
+        return NULL;
+    }
+
+    /* DART has no inquiry capability, report somthing dummy */
+    vi->varid = varid;
+    vi->type = adios_unknown;
+    vi->ndim = 0;
+    vi->dims = NULL;
+    vi->timedim = -1;
+    vi->value = NULL;
+    vi->gmin = NULL;
+    vi->gmax = NULL;
+    vi->mins = NULL;
+    vi->maxs = NULL;
+    
+    return vi;
+}
+
+void adios_read_dart_free_varinfo (ADIOS_VARINFO *vp)
+{
+    if (vp) {
+        if (vp->dims)   free(vp->dims);
+        if (vp->value)  free(vp->value);
+        if (vp->gmin && vp->gmin != vp->value)   free(vp->gmin);
+        if (vp->gmax && vp->gmax != vp->value)   free(vp->gmax);
+        if (vp->mins)   free(vp->mins);
+        if (vp->maxs)   free(vp->maxs);
+        free(vp);
+    }
+}
+
+static int adios_read_dart_get (const char * varname, enum ADIOS_DATATYPES vartype, 
+                                struct adios_read_dart_data_struct * ds, 
+                                int * offset, int * readsize, void * data)
+{
+
+    struct obj_data *od;
+    int elemsize = common_read_type_size(vartype, NULL);
+    int err;
+
+    DBG_PRINTF("-- %s, rank %d: get data: varname=%s version=%d, lb=(%d,%d,%d) ub=(%d,%d,%d)}\n",
+        __func__, ds->mpi_rank, varname, ds->access_version, offset[1], offset[0], offset[2],
+        offset[1]+readsize[1]-1, offset[0]+readsize[0]-1, offset[2]+readsize[2]-1);
+
+    err =  dart_get (varname, ds->access_version, elemsize, 
+                     offset[1], offset[0], offset[2],
+                     offset[1]+readsize[1]-1,
+                     offset[0]+readsize[0]-1,
+                     offset[2]+readsize[2]-1,
+                     data
+                    );
+    /*if (err == -ENOMEM) {
+        error(err_no_memory, "Not enough memory for DART to perform dart_get()");  
+        return -err_no_memory;
+    } 
+    else*/ if (err) {
+        error(err_corrupted_variable, "DART failed to read variable %s.", varname);  
+        return -err_corrupted_variable;
+    }
+
+    return 0;
+}
+
+int64_t adios_read_dart_read_var (ADIOS_GROUP * gp, const char * varname,
+                        const uint64_t * start, const uint64_t * count,
+                        void * data)
+{
+    int64_t total_size;
+    int offset[3], readsize[3], Toffset[3], Treadsize[3];
+    struct adios_read_dart_data_struct * ds = (struct adios_read_dart_data_struct *) gp->fp->fh;
+    enum ADIOS_DATATYPES vartype;
+    int elemsize;
+    int err;
+    int i;
+    char dart_name[MAXDARTNAMELEN];
+
+    /* DART uses integers for boundaries */
+    total_size = 1;
+    for (i=0; i<3; i++) {
+        offset[i]    = (int) start[i];
+        Toffset[i]   = 0;
+        readsize[i]  = (int) count[i];
+        Treadsize[i] = 1;
+        total_size   = total_size * count[i];
+    }
+
+    /* Get type information for the variable from DataSpaces:
+       type variable name = TYPE@<filename>/<varname>
+    */
+    snprintf(dart_name, MAXDARTNAMELEN, "TYPE@%s/%s", ds->fname, varname);
+    err = adios_read_dart_get(dart_name, adios_integer, ds, Toffset, Treadsize, &vartype);
+    if (err)
+        return err;
+    DBG_PRINTF("-- %s, rank %d: get type: varname=%s type=%d (%s)}\n",
+        __func__, ds->mpi_rank, dart_name, vartype, common_read_type_to_string(vartype)) ;
+
+    elemsize = common_read_type_size(vartype, NULL);
+    DBG_PRINTF("-- %s, rank %d: get data: varname=%s type=%d (%s) elemsize=%d}\n",
+        __func__, ds->mpi_rank, dart_name, vartype, common_read_type_to_string(vartype), elemsize);
+
+    total_size *= elemsize; 
+
+    DBG_PRINTF("-- %s, rank %d: get data: varname=%s start=(%lld,%lld,%lld) count=(%lld,%lld,%lld)}\n",
+        __func__, ds->mpi_rank, dart_name, start[0], start[1], start[2], count[0], count[1], count[2]);
+    DBG_PRINTF("-- %s, rank %d: get data: varname=%s offset=(%d,%d,%d) readsize=(%d,%d,%d)}\n",
+        __func__, ds->mpi_rank, dart_name, offset[0], offset[1], offset[2], readsize[0], readsize[1], readsize[2]);
+
+    snprintf(dart_name, MAXDARTNAMELEN, "%s/%s", ds->fname, varname);
+    err = adios_read_dart_get(dart_name, vartype, ds, offset, readsize, data);
+    if (err)
+        return err;
+
+    return total_size;
+}
+
+int64_t adios_read_dart_read_var_byid (ADIOS_GROUP    * gp,
+                             int              varid,
+                             const uint64_t  * start,
+                             const uint64_t  * count,
+                             void           * data)
+{
+    error( err_invalid_varid, "DART does not know variable indicies, only variable names can be used.");
+    return -err_invalid_varid;
+}
+
+
diff --git a/src/read_dimes.c b/src/read_dimes.c
new file mode 100644
index 0000000..baad958
--- /dev/null
+++ b/src/read_dimes.c
@@ -0,0 +1,448 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+
+/**************************************************/
+/* Read method for DIMES memory-to-memory coupling */
+/**************************************************/
+
+#include <stdlib.h>
+#include <string.h>
+//#include <errno.h>  /* ENOMEM */
+#include "adios.h"
+#include "bp_utils.h"
+#include "bp_types.h"
+#include "adios_types.h"
+#include "adios_read.h"
+#include "adios_read_hooks.h"
+#include "adios_error.h"
+#include "futils.h"
+#include "globals.h"
+
+#include "dimes.h"
+
+#ifdef DMALLOC
+#include "dmalloc.h"
+#endif
+
+#if 1
+#define DBG_PRINTF printf
+#else
+#define DBG_PRINTF(a,...)
+#endif
+
+#define MAX_DIMES_NAMELEN 128
+
+/*#define DIMES_DO_VERSIONING define it at configure as -DDIMES_DO_VERSIONING in CFLAGS*/
+static int number_of_fopens = 0;/* for versioning, works only if one file is fopened (in a loop) in the application */
+
+struct adios_read_DIMES_data_struct{
+	char *fname; //path of file
+	int access_version; //counting the access
+	int disconnect_at_fclose; //disconnect from DIMES in fclose()
+	int mpi_rank; //for debug prints
+};
+
+static int dimes_sync_id = 0;
+
+//Declarations
+static int adios_read_dimes_get(const char * varname, enum ADIOS_DATATYPES vartype, 
+                                struct adios_read_DIMES_data_struct * ds, 
+                                int * offset, int * readsize, void * data);	
+								
+/*
+	If init is used, we connect to DIMES index srv here,
+	otherwise we connect in fopen. If multiple fopen/fclose cycles
+	are used, init/finalize must be used too to avoid multiple connect/disconnect in fopen/fclose.
+*/
+int adios_read_dimes_init(MPI_Comm comm)
+{
+    int  nproc, drank, dpeers;
+    int  rank, err;
+    int  appid, was_set;
+    MPI_Comm_rank(comm, &rank);
+    MPI_Comm_size(comm, &nproc);
+	
+    /* Connect to DIMES index srv, but only if we are not yet connected (from Write API) */
+    if(!globals_adios_is_dimes_connected()) {
+	appid = globals_adios_get_application_id(&was_set);
+	if(!was_set)
+		appid = 2;
+	DBG_PRINTF("-- %s, rank %d: connect to dimes with nproc=%d and appid=%d\n",
+		__func__,rank,nproc,appid);
+
+	//int num_total_peers = 64+16+1;
+	err = dimes_init(nproc,nproc,appid);
+	if(err < 0){
+		error(err_connection_failed, "Failed to connect with DIMES index srv\n");
+		return -err_connection_failed;
+	}
+   }
+   globals_adios_set_dimes_connected_from_reader();
+   return 0;
+}
+
+int adios_read_dimes_finalize()
+{
+	//disconnect from DIMES index srv only if the reader is connected(the writer not anymore)
+	if(globals_adios_is_dimes_connected_from_reader() &&
+		!globals_adios_is_dimes_connected_from_both() )
+	{
+		dimes_barrier();
+		dimes_finalize();
+		DBG_PRINTF("-- %s: disconnected from dimes index srv\n",__func__);
+	}
+
+	globals_adios_set_dimes_disconnected_from_reader();
+	return 0;
+}
+
+ADIOS_FILE *adios_read_dimes_fopen(const char *fname, MPI_Comm comm)
+{
+	ADIOS_FILE * fp;
+	struct adios_read_DIMES_data_struct *ds;
+	int i;
+		
+	adios_errno = 0;
+	
+	ds = (struct adios_read_DIMES_data_struct *)malloc(sizeof(struct adios_read_DIMES_data_struct));
+	if(!ds){
+		error(err_no_memory, "Cannot allocate memory for file info.");
+		return NULL;
+	}
+	
+	/*fill out dimes method specific struct*/
+	ds->fname = strdup(fname);
+#ifdef DIMES_DO_VERSIONING
+	ds->access_version = number_of_fopens;
+#else
+	ds->access_version = 0;
+#endif
+
+	MPI_Comm_rank(comm, &ds->mpi_rank);
+	
+	/*if not connected to DIMES index srv, connect now*/
+	if(!globals_adios_is_dimes_connected_from_reader()){
+		if(!adios_read_dimes_init(comm))
+			return NULL;
+		ds->disconnect_at_fclose = 1;
+	} else {
+		ds->disconnect_at_fclose = 0;
+	}
+	
+	/*Try to get variable with fname. If it does not exists, we get an error, which means data
+	does not exist. So we return an error just like with real files*/
+	int offset[] = {0,0,0}, readsize[3] = {1,1,1};
+    	int time_index;
+    	int err;
+    	enum ADIOS_DATATYPES time_index_type = adios_integer;
+    	char dimes_fname[MAX_DIMES_NAMELEN];
+    	snprintf(dimes_fname, MAX_DIMES_NAMELEN, "FILE@%s",fname);
+   	DBG_PRINTF("-- %s, rank %d: Get variable %s\n", __func__, ds->mpi_rank, dimes_fname);
+	
+    	err = adios_read_dimes_get(dimes_fname, time_index_type, ds, offset, readsize, &time_index);
+    	if (err) {
+        	error(err_file_not_found_error, "Data of '%s' does not exist in DIMES\n", dimes_fname);
+        	free(ds);
+        	return NULL;
+        } else {
+        	DBG_PRINTF("-- %s, rank %d: data of '%s' exists, time index = %d\n", __func__, ds->mpi_rank, dimes_fname, time_index);
+    	}
+
+    	fp = (ADIOS_FILE *) malloc (sizeof (ADIOS_FILE));
+    	if (!fp) {
+        	error( err_no_memory, "Cannot allocate memory for file info.");
+        	return NULL;
+    	}
+
+    	/* fill out ADIOS_FILE struct */
+    	fp->fh = (uint64_t) ds;
+    	fp->groups_count = 1;
+    	fp->vars_count = 0;
+    	fp->attrs_count = 0;
+    	fp->tidx_start = 0;
+    	fp->ntimesteps = 1;
+    	fp->file_size = 0;
+    	fp->version = 1;
+    	fp->endianness = 0; /* FIXME: not always Little Endian. Does it matter? */
+    	alloc_namelist (&fp->group_namelist,fp->groups_count); 
+    	for (i=0;i<fp->groups_count;i++) {
+        	if (!fp->group_namelist[i]) {
+            		error(err_no_memory, "Could not allocate buffer for %d strings in adios_fopen()", fp->groups_count);
+            		adios_read_dimes_fclose(fp);
+            		return NULL;
+        	}
+        	else  {
+            		strcpy(fp->group_namelist[i],"dimes");
+        	}
+    	}
+    	DBG_PRINTF("-- %s, rank %d: done fp=%x, fp->fh=%x\n", __func__, ds->mpi_rank, fp, fp->fh);
+#ifdef DIMES_DO_VERSIONING
+    	number_of_fopens++;
+#endif
+    	return fp;	
+}
+
+int adios_read_dimes_fclose(ADIOS_FILE *fp)
+{
+	struct adios_read_DIMES_data_struct *ds =(struct adios_read_DIMES_data_struct *)fp->fh;
+	int i,j;
+	
+	adios_errno = 0;
+	
+	DBG_PRINTF("-- %s, rank %d: fp=%x\n", __func__, ds->mpi_rank, fp);
+
+	unsigned int version;	
+#ifdef DIMES_DO_VERSIONING
+	version = number_of_fopens;
+	dimes_sync_id = version;
+#else
+	version = 0;
+	dimes_sync_id++;
+#endif
+	dimes_sync(dimes_sync_id);
+	//dimes_notify(1);	
+
+	/*Disconnect from DIMES index srv if we connected in fopen()*/
+	if(ds && ds->disconnect_at_fclose){
+		adios_read_dimes_finalize();
+	}
+	
+    	free_namelist ((fp->group_namelist),fp->groups_count);
+   	if (ds->fname) { free(ds->fname); ds->fname = 0; }
+   	free(ds);
+    	free(fp);
+    	return 0;
+}
+
+/* This function can be called if user places 
+   the wrong sequences of dims for a var 
+*/
+void adios_read_dimes_reset_dimension_order (ADIOS_FILE *fp, int is_fortran)
+{
+    /* unimplemented */
+}
+
+ADIOS_GROUP * adios_read_dimes_gopen (ADIOS_FILE *fp, const char * grpname)
+{
+    /* DIMES has no groups, so any grpname is accepted and the same empty stuff is returned */
+    return adios_read_dimes_gopen_byid(fp, 0);
+}
+
+ADIOS_GROUP * adios_read_dimes_gopen_byid (ADIOS_FILE *fp, int grpid)
+{
+    struct adios_read_DIMES_data_struct * ds = (struct adios_read_DIMES_data_struct *) fp->fh;
+    ADIOS_GROUP * gp;
+
+    /* DIMES has no groups, so any grpid is accepted and the same empty stuff is returned */
+
+    adios_errno = 0;
+    gp = (ADIOS_GROUP *) malloc(sizeof(ADIOS_GROUP));
+    if (!gp) {
+        error( err_no_memory, "Could not allocate memory for group info");
+        return NULL;
+    }
+
+    /* fill out ADIOS_GROUP struct */
+    gp->grpid = grpid;
+    gp->gh = (uint64_t) 0;
+    gp->fp = fp;
+    gp->vars_count = 0;
+    gp->attrs_count = 0;
+    gp->var_namelist = 0;
+    gp->attr_namelist = 0;
+    
+    return gp;
+}
+
+int adios_read_dimes_gclose (ADIOS_GROUP *gp)
+{
+    struct adios_read_DIMES_data_struct * ds = (struct adios_read_DIMES_data_struct *) gp->fp->fh;
+
+    adios_errno = 0;
+
+    free_namelist ((gp->var_namelist),gp->vars_count);
+    free_namelist ((gp->attr_namelist),gp->attrs_count);
+    free(gp);
+    return 0;
+}
+
+int adios_read_dimes_get_attr (ADIOS_GROUP * gp, const char * attrname, enum ADIOS_DATATYPES * type,
+                    int * size, void ** data)
+{
+    /* DIMES does not support attributes */
+    error(err_invalid_attrname, "DIMES read method does not support attributes!");
+    *size = 0;
+    *type = adios_unknown;
+    *data = 0;
+    return adios_errno;
+}
+
+int adios_read_dimes_get_attr_byid (ADIOS_GROUP * gp, int attrid, 
+                    enum ADIOS_DATATYPES * type, int * size, void ** data)
+{
+    /* DIMES does not support attributes */
+    error(err_invalid_attrid, "DIMES read method does not support attributes!");
+    *size = 0;
+    *type = adios_unknown;
+    *data = 0;
+    return adios_errno;
+}
+
+
+ADIOS_VARINFO * adios_read_dimes_inq_var (ADIOS_GROUP *gp, const char * varname) 
+{
+    /* DIMES has no inquiry capability, report somthing dummy */
+    return adios_read_dimes_inq_var_byid(gp, 0);
+}
+
+ADIOS_VARINFO * adios_read_dimes_inq_var_byid (ADIOS_GROUP *gp, int varid)
+{
+    struct adios_read_DIMES_data_struct * ds = (struct adios_read_DIMES_data_struct *) gp->fp->fh;
+    ADIOS_VARINFO * vi;
+    int i,k;
+
+    adios_errno = 0;
+    vi = (ADIOS_VARINFO *) malloc(sizeof(ADIOS_VARINFO));
+    if (!vi) {
+        error( err_no_memory, "Could not allocate memory for variable info.");
+        return NULL;
+    }
+
+    /* DIMES has no inquiry capability, report somthing dummy */
+    vi->varid = varid;
+    vi->type = adios_unknown;
+    vi->ndim = 0;
+    vi->dims = NULL;
+    vi->timedim = -1;
+    vi->value = NULL;
+    vi->gmin = NULL;
+    vi->gmax = NULL;
+    vi->mins = NULL;
+    vi->maxs = NULL;
+    
+    return vi;
+}
+
+void adios_read_dimes_free_varinfo (ADIOS_VARINFO *vp)
+{
+    if (vp) {
+        if (vp->dims)   free(vp->dims);
+        if (vp->value)  free(vp->value);
+        if (vp->gmin && vp->gmin != vp->value)   free(vp->gmin);
+        if (vp->gmax && vp->gmax != vp->value)   free(vp->gmax);
+        if (vp->mins)   free(vp->mins);
+        if (vp->maxs)   free(vp->maxs);
+        free(vp);
+    }
+}
+
+static int adios_read_dimes_get(const char *varname, enum ADIOS_DATATYPES vartype,
+							struct adios_read_DIMES_data_struct *ds,
+							int *offset, int *readsize, void *data)
+{
+	int elemsize = common_read_type_size(vartype, NULL);
+	int err;
+	
+	int xl,yl,zl,xu,yu,zu;
+	//Flip 1st and 2nd dimension
+	xl = offset[1];
+	yl = offset[0];
+	zl = offset[2];
+	xu = offset[1]+readsize[1]-1;
+	yu = offset[0]+readsize[0]-1;
+	zu = offset[2]+readsize[2]-1;
+
+	/*
+	xl = offset[0];
+	yl = offset[1];
+	zl = offset[2];
+	xu = offset[0]+readsize[0]-1;
+	yu = offset[1]+readsize[1]-1;
+	zu = offset[2]+readsize[2]-1;
+	*/
+
+	DBG_PRINTF("-- %s, rank %d: get data: varname=%s version=%d,lb=(%d,%d,%d) ub=(%d,%d,%d)}\n",
+			__func__, ds->mpi_rank, varname, ds->access_version, xl,yl,zl,xu,yu,zu);
+	
+	if(xl==0 && yl==0 && zl==0 && xu==0 && yu==0 && zu==0){
+		err = dimes_get_scalar(varname,ds->access_version,elemsize,0,0,0,0,0,0,data);
+	} else {
+		err = dimes_get(varname,ds->access_version,elemsize,xl,yl,zl,xu,yu,zu,data);
+	}
+	
+	if(err) {
+		error(err_corrupted_variable,"DIMES failed to read variable %s.", varname);
+		return -err_corrupted_variable;
+	}
+	
+	return 0;	
+}
+
+int64_t adios_read_dimes_read_var (ADIOS_GROUP * gp, const char * varname,
+                        const uint64_t * start, const uint64_t * count,
+                        void * data)
+{
+    int64_t total_size;
+    int offset[3], readsize[3], Toffset[3], Treadsize[3];
+    struct adios_read_DIMES_data_struct * ds = (struct adios_read_DIMES_data_struct *) gp->fp->fh;
+    enum ADIOS_DATATYPES vartype;
+    int elemsize;
+    int err;
+    int i;
+    char dimes_name[MAX_DIMES_NAMELEN];
+
+    /*DIMES uses integers for boundaries */
+    total_size = 1;
+    for (i=0; i<3; i++) {
+        offset[i]    = (int) start[i];
+        Toffset[i]   = 0;
+        readsize[i]  = (int) count[i];
+        Treadsize[i] = 1;
+        total_size   = total_size * count[i];
+    }
+
+    /* Get type information for the variable from DataSpaces:
+       type variable name = TYPE@<filename>/<varname>
+    */
+    snprintf(dimes_name, MAX_DIMES_NAMELEN, "TYPE@%s/%s", ds->fname, varname);
+    err = adios_read_dimes_get(dimes_name, adios_integer, ds, Toffset, Treadsize, &vartype);
+    if (err)
+        return err;
+    DBG_PRINTF("-- %s, rank %d: get type: varname=%s type=%d (%s)}\n",
+        __func__, ds->mpi_rank, dimes_name, vartype, common_read_type_to_string(vartype));
+
+    elemsize = common_read_type_size(vartype, NULL);
+    DBG_PRINTF("-- %s, rank %d: get data: varname=%s type=%d (%s) elemsize=%d}\n",
+        __func__, ds->mpi_rank, dimes_name, vartype, common_read_type_to_string(vartype), elemsize);
+
+    total_size *= elemsize; 
+
+    //Get data
+    snprintf(dimes_name, MAX_DIMES_NAMELEN, "%s/%s", ds->fname, varname);
+    /*
+    DBG_PRINTF("-- %s, rank %d: get data: varname=%s start=(%lld,%lld,%lld) count=(%lld,%lld,%lld)}\n",
+        __func__, ds->mpi_rank, dimes_name, start[0], start[1], start[2], count[0], count[1], count[2]);
+    */
+    DBG_PRINTF("-- %s, rank %d: get data: varname=%s offset=(%d,%d,%d) readsize=(%d,%d,%d)}\n",
+        __func__, ds->mpi_rank, dimes_name, offset[0], offset[1], offset[2], readsize[0], readsize[1], readsize[2]);
+    err = adios_read_dimes_get(dimes_name, vartype, ds, offset, readsize, data);
+    if (err)
+        return err;
+
+    return total_size;
+}
+
+int64_t adios_read_dimes_read_var_byid (ADIOS_GROUP    * gp,
+                             int              varid,
+                             const uint64_t  * start,
+                             const uint64_t  * count,
+                             void           * data)
+{
+    error( err_invalid_varid, "DIMES does not know variable indicies, only variable names can be used.");
+    return -err_invalid_varid;
+}							
diff --git a/tests/C/Makefile.am b/tests/C/Makefile.am
new file mode 100644
index 0000000..f4fe2e0
--- /dev/null
+++ b/tests/C/Makefile.am
@@ -0,0 +1,17 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+noinst_PROGRAMS=adios_test_c
+
+adios_test_c_SOURCES = adios_test_c.c
+adios_test_c_CPPFLAGS = $(ADIOSLIB_CPPFLAGS)
+adios_test_c_CFLAGS = $(ADIOSLIB_CFLAGS)
+adios_test_c_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD)
+adios_test_c_LDFLAGS = $(ADIOSLIB_LDFLAGS) 
+
+CLEANFILES = restart.bp
+CC=$(MPICC)
+
+EXTRA_DIST = config_c.xml
diff --git a/tests/C/Makefile.in b/tests/C/Makefile.in
new file mode 100644
index 0000000..c84aa88
--- /dev/null
+++ b/tests/C/Makefile.in
@@ -0,0 +1,551 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = adios_test_c$(EXEEXT)
+subdir = tests/C
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_adios_test_c_OBJECTS = adios_test_c-adios_test_c.$(OBJEXT)
+adios_test_c_OBJECTS = $(am_adios_test_c_OBJECTS)
+am__DEPENDENCIES_1 =
+adios_test_c_DEPENDENCIES = $(top_builddir)/src/libadios.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(adios_test_c_SOURCES)
+DIST_SOURCES = $(adios_test_c_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+adios_test_c_SOURCES = adios_test_c.c
+adios_test_c_CPPFLAGS = $(ADIOSLIB_CPPFLAGS)
+adios_test_c_CFLAGS = $(ADIOSLIB_CFLAGS)
+adios_test_c_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD)
+adios_test_c_LDFLAGS = $(ADIOSLIB_LDFLAGS) 
+CLEANFILES = restart.bp
+EXTRA_DIST = config_c.xml
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  tests/C/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  tests/C/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+adios_test_c$(EXEEXT): $(adios_test_c_OBJECTS) $(adios_test_c_DEPENDENCIES) 
+	@rm -f adios_test_c$(EXEEXT)
+	$(LINK) $(adios_test_c_LDFLAGS) $(adios_test_c_OBJECTS) $(adios_test_c_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.c.o:
+	$(COMPILE) -c $<
+
+.c.obj:
+	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+	$(LTCOMPILE) -c -o $@ $<
+
+adios_test_c-adios_test_c.o: adios_test_c.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(adios_test_c_CPPFLAGS) $(CPPFLAGS) $(adios_test_c_CFLAGS) $(CFLAGS) -c -o adios_test_c-adios_test_c.o `test -f 'adios_test_c.c' || echo '$(srcdir)/'`adios_test_c.c
+
+adios_test_c-adios_test_c.obj: adios_test_c.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(adios_test_c_CPPFLAGS) $(CPPFLAGS) $(adios_test_c_CFLAGS) $(CFLAGS) -c -o adios_test_c-adios_test_c.obj `if test -f 'adios_test_c.c'; then $(CYGPATH_W) 'adios_test_c.c'; else $(CYGPATH_W) '$(srcdir)/adios_test_c.c'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/C/adios_test_c.c b/tests/C/adios_test_c.c
new file mode 100644
index 0000000..c606c58
--- /dev/null
+++ b/tests/C/adios_test_c.c
@@ -0,0 +1,413 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdint.h>
+#include <assert.h>
+#include <limits.h>
+
+// mpi
+#include "mpi.h"
+
+#include "adios.h"
+
+#include <sys/time.h>
+/* Subtract the `struct timeval' values X and Y,
+   storing the result in RESULT.
+   Return 1 if the difference is negative, otherwise 0.  */
+
+int
+timeval_subtract (result, x, y)
+     struct timeval *result, *x, *y;
+{
+  /* Perform the carry for the later subtraction by updating y. */
+  if (x->tv_usec < y->tv_usec) {
+    int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1;
+    y->tv_usec -= 1000000 * nsec;
+    y->tv_sec += nsec;
+  }
+  if (x->tv_usec - y->tv_usec > 1000000) {
+    int nsec = (x->tv_usec - y->tv_usec) / 1000000;
+    y->tv_usec += 1000000 * nsec;
+    y->tv_sec -= nsec;
+  }
+
+  /* Compute the time remaining to wait.
+     tv_usec is certainly positive. */
+  result->tv_sec = x->tv_sec - y->tv_sec;
+  result->tv_usec = x->tv_usec - y->tv_usec;
+
+  /* Return 1 if result is negative. */
+  return x->tv_sec < y->tv_sec;
+}
+
+#define DO_WRITE 1
+#define DO_READ 0
+#define DO_APPEND 0
+#define MEMORY_THIEF 0
+#define SPLIT_FILES 0
+
+int main (int argc, char ** argv)
+{
+    char * type_name = "restart";
+    char filename [100];
+    int64_t io_handle;  // io handle
+    MPI_Comm comm = MPI_COMM_WORLD;
+    MPI_Comm c1;
+    int rank;
+    int size;
+    struct timeval time_start;
+    struct timeval time_end;
+    struct timeval time_diff;
+    struct timeval time_open;
+    struct timeval time_group_size;
+    struct timeval time_write1;
+    struct timeval time_write2;
+    struct timeval time_close;
+    struct timeval * time_diff_all;
+
+    MPI_Init (&argc, &argv);
+    MPI_Comm_rank (comm, &rank);
+    MPI_Comm_size (comm, &size);
+#if SPLIT_FILES
+    MPI_Comm_split (MPI_COMM_WORLD, rank % 2, rank, &comm);
+    sprintf (filename, "restart%d.bp", rank % 2);
+printf ("rank %d filename: %s\n", rank, filename);
+#else
+    strcpy (filename, "restart.bp");
+#endif
+    if (!adios_init ("config_c.xml"))
+        return -1;
+
+    //uint64_t byte_test_length = 768LL * 1024 * 1024;
+    uint64_t byte_test_length = 512LL * 1024 * 1024;
+    uint64_t memory_thief_length =  1024 * 1024 * 1024  // 1 GB
+                              + 128 * 1024 * 1024   // 128 MB
+                             - byte_test_length;
+if (rank == 0) printf ("Byte_test_length: %llu\n", byte_test_length);
+#if DO_WRITE
+    char * byte_test = 0;
+    byte_test = malloc (byte_test_length + 1);
+    if (byte_test == 0)
+    {
+        fprintf (stderr, "Error allocating memory for write byte_test: %llu\n"
+                ,byte_test_length
+                );
+        exit (-1);
+    }
+    byte_test [byte_test_length] = 0;
+#endif
+#if DO_READ
+    char * r_byte_test = 0;
+    r_byte_test = malloc (byte_test_length + 1);
+    if (byte_test == 0)
+    {
+        fprintf (stderr, "Error allocating memory for read byte_test: %llu\n"
+                ,byte_test_length
+                );
+        exit (-1);
+    }
+    r_byte_test [byte_test_length] = 0;
+#endif
+
+    int var_x1 = 101;
+    int var_x2 = 102;
+
+    int zionsize1 = 10; // fixed size
+    int zionsize2 = 2;  // attr_dim
+    int zionsize3 = 5;  // attr_dim2
+
+    float * zion1;
+    float * zion2;
+    float * zion3;
+
+    zion1 = malloc (zionsize1 * sizeof (float));
+    zion2 = malloc (zionsize2 * zionsize2 * sizeof (float));
+    zion3 = malloc (zionsize2 * zionsize3 * sizeof (float));
+    assert (zion1);
+    assert (zion2);
+    assert (zion3);
+    memset (zion1, 0, zionsize1 * sizeof (float));
+    memset (zion2, 0, zionsize2 * zionsize2 * sizeof (float));
+    memset (zion3, 0, zionsize2 * zionsize3 * sizeof (float));
+    int r_var_x1;
+    int r_var_x2;
+    int r_zsize;
+    float r_z [zionsize1];
+
+    int node = 0;
+
+    uint64_t total;
+    int i;
+    int j;
+
+    zion1 [0] = 10.0;
+    zion1 [1] = 11.0;
+    zion1 [2] = 12.0;
+    zion1 [3] = 13.0;
+    zion1 [4] = 14.0;
+    zion1 [5] = 15.0;
+    zion1 [6] = 16.0;
+    zion1 [7] = 17.0;
+    zion1 [8] = 18.0;
+    zion1 [9] = 19.0;
+
+    for (i = 0; i < 100; i++)
+        for (j = 0; j < 26; j++)
+            byte_test [i * 26 + j] = 'a' + j;
+
+    // allocate a big block of memory to stymie unwanted local caching
+    // that would make the numbers suspect
+#if MEMORY_THIEF
+    char * memory_thief = malloc (1 * 1024 * 1024 * 1024);
+#endif
+
+    //if (rank == 0)
+    time_diff_all = (struct timeval *) malloc (size * sizeof (struct timeval));
+//    else
+//        time_diff_all = 0;
+
+#if DO_WRITE
+//printf ("XXXXXXXXXXXXXXXX do a write XXXXXXXXXXXXXXXXX\n");
+    gettimeofday (&time_start, NULL);
+    adios_open (&io_handle, type_name, filename, "w", &comm);
+    gettimeofday (&time_open, NULL);
+#if 1
+    adios_group_size (io_handle, 4 + byte_test_length, &total);
+    gettimeofday (&time_group_size, NULL);
+#else
+    adios_group_size (io_handle,  4 + 4
+                                + 4 * zionsize1
+                                + 4 + 4 * zionsize2 * zionsize2
+                                + 4 + 4 * zionsize2 * zionsize3
+                                + 4
+                                + 4 + byte_test_length
+                     ,&total, &comm
+                     );
+    gettimeofday (&time_group_size, NULL);
+
+    adios_write (io_handle, "/mype", &var_x1);
+    adios_write (io_handle, "/test/mype", &var_x2);
+
+    adios_write (io_handle, "zion1", zion1);
+
+    adios_write (io_handle, "zionsize2", &zionsize2);
+    adios_write (io_handle, "zion2", zion2);
+
+    adios_write (io_handle, "zionsize3", &zionsize3);
+    adios_write (io_handle, "zion3", zion3);
+
+    adios_write (io_handle, "node-attr", &node);
+
+#endif
+    adios_write (io_handle, "byte_test_length", &byte_test_length);
+    gettimeofday (&time_write1, NULL);
+    adios_write (io_handle, "byte_test", byte_test);
+    gettimeofday (&time_write2, NULL);
+
+    adios_close (io_handle);
+    gettimeofday (&time_end, NULL);
+
+
+    MPI_Barrier (comm);
+
+    timeval_subtract (&time_diff, &time_end, &time_start);
+    MPI_Gather (&time_diff, sizeof (struct timeval), MPI_BYTE
+               ,time_diff_all, sizeof (struct timeval), MPI_BYTE
+               ,0, comm
+               );
+    if (rank == 0)
+    {
+        memcpy (&(time_diff_all [0]), &time_diff, sizeof (struct timeval));
+        int i;
+        int max_sec = 0;
+        int max_usec = 0;
+        int min_sec = INT_MAX;
+        int min_usec = INT_MAX;
+        printf ("Proc\tSec\n");
+        for (i = 0; i < size; i++)
+        {
+            printf ("%06d\t%02d.%06d\n", i, time_diff_all [i].tv_sec
+                   ,time_diff_all [i].tv_usec
+                   );
+
+            if (time_diff_all [i].tv_sec >= max_sec)
+            {
+                if (   time_diff_all [i].tv_usec > max_usec
+                    || time_diff_all [i].tv_sec > max_sec
+                   )
+                {
+                    max_sec = time_diff_all [i].tv_sec;
+                    max_usec = time_diff_all [i].tv_usec;
+                }
+            }
+
+            if (time_diff_all [i].tv_sec <=  min_sec)
+            {
+                if (   time_diff_all [i].tv_usec < min_usec
+                    || time_diff_all [i].tv_sec < min_sec
+                   )
+                {
+                    min_sec = time_diff_all [i].tv_sec;
+                    min_usec = time_diff_all [i].tv_usec;
+                }
+            }
+        }
+
+        printf ("Max time:\t%02d.%06d\n", max_sec, max_usec);
+        printf ("Aggregate GB/sec:\t%f\n", (1.0 * total * size / (1024 * 1024 * 1024)) / (max_sec + (max_usec / 1000000.0)));
+    }
+    timeval_subtract (&time_diff, &time_end, &time_write2);
+    MPI_Gather (&time_diff, sizeof (struct timeval), MPI_BYTE
+               ,time_diff_all, sizeof (struct timeval), MPI_BYTE
+               ,0, comm
+               );
+    if (rank == 0)
+    {
+        memcpy (&(time_diff_all [0]), &time_diff, sizeof (struct timeval));
+        int i;
+        int max_sec = 0;
+        int max_usec = 0;
+        int min_sec = INT_MAX;
+        int min_usec = INT_MAX;
+        for (i = 0; i < size; i++)
+        {
+            if (time_diff_all [i].tv_sec >= max_sec)
+            {
+                if (   time_diff_all [i].tv_usec > max_usec
+                    || time_diff_all [i].tv_sec > max_sec
+                   )
+                {
+                    max_sec = time_diff_all [i].tv_sec;
+                    max_usec = time_diff_all [i].tv_usec;
+                }
+            }
+
+            if (time_diff_all [i].tv_sec <=  min_sec)
+            {
+                if (   time_diff_all [i].tv_usec < min_usec
+                    || time_diff_all [i].tv_sec < min_sec
+                   )
+                {
+                    min_sec = time_diff_all [i].tv_sec;
+                    min_usec = time_diff_all [i].tv_usec;
+                }
+            }
+        }
+
+        printf ("Max write only time:\t%02d.%06d\n", max_sec, max_usec);
+        printf ("Aggregate write only GB/sec:\t%f\n", (1.0 * total * size / (1024 * 1024 * 1024)) / (max_sec + (max_usec / 1000000.0)));
+    }
+
+    MPI_Barrier (comm);
+#endif
+
+#if DO_READ
+printf ("XXXXXXXXXXXXXXXX do a read XXXXXXXXXXXXXXXXX\n");
+
+    adios_open (&io_handle, type_name, filename, "r", &comm);
+    adios_group_size (io_handle, 0, &total);
+    adios_read (io_handle, "/mype", &r_var_x1, 4);
+    adios_read (io_handle, "/test/mype", &r_var_x2, 4);
+    adios_read (io_handle, "zionsize2", &r_zsize, 4);
+    adios_read (io_handle, "zion1", r_z, 4 * 10);
+    adios_read (io_handle, "byte_test", r_byte_test, 26 * 100);
+    adios_close (io_handle);
+
+    MPI_Barrier (comm);
+
+    for (i = 0; i < byte_test_length; i++)
+            if (r_byte_test [i] != byte_test [i])
+            {
+                printf ("byte_test doesn't match %d\n", i);
+                printf ("byte_test:\n%s\n", byte_test);
+                printf ("r_byte_test:\n%s\n", r_byte_test);
+                break;
+            }
+
+    if (   var_x1 != r_var_x1
+        || var_x2 != r_var_x2
+        || r_zsize != zionsize2
+        || r_z [0] != zion1 [0]
+        || r_z [1] != zion1 [1]
+        || r_z [2] != zion1 [2]
+        || r_z [3] != zion1 [3]
+        || r_z [4] != zion1 [4]
+        || r_z [5] != zion1 [5]
+        || r_z [6] != zion1 [6]
+        || r_z [7] != zion1 [7]
+        || r_z [8] != zion1 [8]
+        || r_z [9] != zion1 [9]
+       )
+    {
+        int i;
+        printf ("rank: %d mismatch in reading\n", rank);
+        printf ("r_var_x1: %d (%d)\n", r_var_x1, var_x1);
+        printf ("r_var_x2: %d (%d)\n", r_var_x2, var_x2);
+        printf ("r_zsize: %d (%d)\n", r_zsize, zionsize1);
+        for (i = 0; i < 10; i++)
+            printf ("z_dim [%d]: %f (%f)\n", i, r_z [i], zion1 [i]);
+    }
+    else
+    {
+        printf ("rank: %d read matches write\n", rank);
+    }
+#endif
+
+#if DO_APPEND
+for (int i = 0; i < 3; i++)
+{
+printf ("XXXXXXXXXXXXXXXX do an append XXXXXXXXXXXXXXXXX\n");
+    var_x1 = 11;
+    adios_open (&io_handle, type_name, filename, "a", &comm);
+    adios_group_size (io_handle,  4 + 4
+                                + 4 * zionsize1
+                                + 4 + 4 * zionsize2 * zionsize2
+                                + 4
+                     ,&total
+                     );
+    adios_write (io_handle, "/mype", &var_x1);
+    adios_write (io_handle, "/test/mype", &var_x2);
+
+    adios_write (io_handle, "zion1", zion1);
+
+    adios_write (io_handle, "zionsize2", &zionsize2);
+    adios_write (io_handle, "zion2", zion2);
+
+    adios_write (io_handle, "node-attr", &node);
+
+    adios_close (io_handle);
+
+    printf ("rank: %d append completed\n", rank);
+}
+
+#endif
+
+    MPI_Barrier (comm);
+
+    adios_finalize (node);
+    MPI_Finalize ();
+
+    free (zion1);
+    free (zion2);
+    free (zion3);
+
+#if DO_WRITE
+    free (byte_test);
+#endif
+#if DO_READ
+    free (r_byte_test);
+#endif
+
+#if MEMORY_THIEF
+    free (memory_thief);
+#endif
+
+    return 0;
+}
diff --git a/tests/C/config_c.xml b/tests/C/config_c.xml
new file mode 100644
index 0000000..98980cf
--- /dev/null
+++ b/tests/C/config_c.xml
@@ -0,0 +1,36 @@
+<adios-config host-language="C">
+  <adios-group name="restart" coordination-communicator="comm" time-index="time">
+<!--
+    <var name="mype" path="/" type="integer"/>
+    <var name="mype" path="/test" type="integer"/>
+
+    <var name="zion1" type="real" dimensions="10,time" path="/abc/me"/>
+
+    <var name="zionsize2" type="integer"/>
+    <attribute name="attr_dim" path="/abc/" type="integer" value="2"/>
+    <var name="zion2" type="real" dimensions="zionsize2,attr_dim"/>
+
+    <var name="zionsize3" type="integer"/>
+    <attribute name="attr_dim2" path="/abc" var="zionsize3"/>
+    <var name="zion3" type="real" dimensions="attr_dim,attr_dim2"/>
+
+    <var name="node-attr" type="integer"/>
+    <attribute name="node" path="/" var="node-attr"/>
+
+    <attribute name="units1" path="/abc/me/" value="m/s"/>
+    <attribute name="units2" path="/abc/me" value="m/s"/>
+    <attribute name="timestep1" path="/" value="1"/>
+    <attribute name="timestep2" path="/abc" value="1"/>
+-->
+
+    <var name="byte_test_length" type="integer"/>
+
+    <var name="byte_test" type="byte" dimensions="byte_test_length"/>
+  
+  </adios-group>
+
+  <transport group="restart" method="MPI">max_storage_targets=672;min_stripe_count=1;max_stripe_count=1;files_number=1;overlap_factor=0;split_target_count=1;split_files_count=max</transport>
+
+  <buffer size-MB="1000" allocate-time="now"/>
+
+</adios-config>
diff --git a/tests/Fortran/Makefile.am b/tests/Fortran/Makefile.am
new file mode 100644
index 0000000..e33d947
--- /dev/null
+++ b/tests/Fortran/Makefile.am
@@ -0,0 +1,21 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+noinst_PROGRAMS=adios_test_f
+
+#adios_test_f_SOURCES = adios_test_f.F90 adios_module.F90
+adios_test_f_SOURCES = adios_test_f.F90
+adios_test_f_CPPFLAGS = $(ADIOSLIB_CPPFLAGS)
+adios_test_f_CFLAGS = $(ADIOSLIB_CFLAGS)
+adios_test_f_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+adios_test_f_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD)
+
+FC=$(MPIFC)
+
+FCLINK = \
+	$(LIBTOOL) --mode=link --tag F77 $(FC) \
+	$(AM_FCFLAGS) $(FCFLAGS) $(LDFLAGS) -o $@
+
+EXTRA_DIST = config_fortran.xml
diff --git a/tests/Fortran/Makefile.in b/tests/Fortran/Makefile.in
new file mode 100644
index 0000000..50b7532
--- /dev/null
+++ b/tests/Fortran/Makefile.in
@@ -0,0 +1,553 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = adios_test_f$(EXEEXT)
+subdir = tests/Fortran
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_adios_test_f_OBJECTS = adios_test_f-adios_test_f.$(OBJEXT)
+adios_test_f_OBJECTS = $(am_adios_test_f_OBJECTS)
+am__DEPENDENCIES_1 =
+adios_test_f_DEPENDENCIES = $(top_builddir)/src/libadiosf.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+PPFCCOMPILE = $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)
+LTPPFCCOMPILE = $(LIBTOOL) --mode=compile $(FC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+SOURCES = $(adios_test_f_SOURCES)
+DIST_SOURCES = $(adios_test_f_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = $(MPIFC)
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+
+#adios_test_f_SOURCES = adios_test_f.F90 adios_module.F90
+adios_test_f_SOURCES = adios_test_f.F90
+adios_test_f_CPPFLAGS = $(ADIOSLIB_CPPFLAGS)
+adios_test_f_CFLAGS = $(ADIOSLIB_CFLAGS)
+adios_test_f_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+adios_test_f_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD)
+FCLINK = \
+	$(LIBTOOL) --mode=link --tag F77 $(FC) \
+	$(AM_FCFLAGS) $(FCFLAGS) $(LDFLAGS) -o $@
+
+EXTRA_DIST = config_fortran.xml
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .F90 .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  tests/Fortran/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  tests/Fortran/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+adios_test_f$(EXEEXT): $(adios_test_f_OBJECTS) $(adios_test_f_DEPENDENCIES) 
+	@rm -f adios_test_f$(EXEEXT)
+	$(FCLINK) $(adios_test_f_LDFLAGS) $(adios_test_f_OBJECTS) $(adios_test_f_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.F90.o:
+	$(PPFCCOMPILE) -c -o $@ $<
+
+.F90.obj:
+	$(PPFCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.F90.lo:
+	$(LTPPFCCOMPILE) -c -o $@ $<
+
+adios_test_f-adios_test_f.o: adios_test_f.F90
+	$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(adios_test_f_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o adios_test_f-adios_test_f.o `test -f 'adios_test_f.F90' || echo '$(srcdir)/'`adios_test_f.F90
+
+adios_test_f-adios_test_f.obj: adios_test_f.F90
+	$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(adios_test_f_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o adios_test_f-adios_test_f.obj `if test -f 'adios_test_f.F90'; then $(CYGPATH_W) 'adios_test_f.F90'; else $(CYGPATH_W) '$(srcdir)/adios_test_f.F90'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/Fortran/adios_test_f.F90 b/tests/Fortran/adios_test_f.F90
new file mode 100644
index 0000000..6be4e71
--- /dev/null
+++ b/tests/Fortran/adios_test_f.F90
@@ -0,0 +1,198 @@
+!  
+!  ADIOS is freely available under the terms of the BSD license described
+!  in the COPYING file in the top level directory of this source distribution.
+!
+!  Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+!
+
+program adios_test
+    implicit none
+    include 'mpif.h'
+    character (len=200) :: group
+    character (len=200) :: filename
+    integer :: group_comm
+    integer :: ierr
+    integer :: rank
+
+    ! write vars
+    integer :: small_int
+    integer*8 :: big_int
+    real :: small_real
+    real*8 :: big_real
+    integer :: z_size
+    real :: z_array (2)
+
+    ! read vars
+    integer :: r_small_int
+    integer*8 :: r_big_int
+    real :: r_small_real
+    real*8 :: r_big_real
+    integer :: r_z_size
+    real :: r_z_array (2)
+
+    group = "restart"
+    filename = "restart.bp"
+    small_int = 10
+    big_int = 42949672
+    small_real = 0.3
+    big_real = 0.0000000000004
+    z_size = 2
+    z_array (1) = 11.1
+    z_array (2) = 22.2
+    r_z_size = 2
+
+    call MPI_Init (ierr)
+    call MPI_Comm_dup (MPI_COMM_WORLD, group_comm, ierr)
+    call MPI_Comm_rank (MPI_COMM_WORLD, rank, ierr)
+
+    print '("rank=",i0," group_comm=",i0," ierr=",i0)', rank, group_comm, ierr
+
+    call adios_allocate_buffer (ierr);
+    call adios_init ("config_fortran.xml", ierr)
+    call test_write (group, filename, group_comm, small_int, big_int, small_real, big_real, z_size, z_array)
+
+    call MPI_Barrier (MPI_COMM_WORLD, ierr)
+write (*,*) "write completed"
+
+    call test_read (group, filename, group_comm, r_small_int, r_big_int, r_small_real, r_big_real, r_z_size, r_z_array)
+
+    if (small_int /= r_small_int .or. big_int /= r_big_int .or. &
+     & small_real /= r_small_real .or. big_real /= r_big_real .or.&
+      z_size /= r_z_size) then
+        write (*,*) 'rank ', rank, ' read did not match write'
+    else
+        write (*,*) 'rank ', rank, ' read matched write'
+    endif
+
+    call MPI_Barrier (MPI_COMM_WORLD, ierr)
+
+    call adios_finalize (rank, ierr)
+
+    call MPI_Finalize (ierr)
+end program adios_test
+
+subroutine test_write (group, filename, group_comm, small_int, big_int, small_real, big_real, a_size, a_array)
+    implicit none
+    include 'mpif.h'
+    character (*), intent(in) :: group
+    character (*), intent(in) :: filename
+    integer, intent (in) :: group_comm
+    integer, intent(in) :: small_int
+    integer*8, intent(in) :: big_int
+    real, intent(in) :: small_real
+    real*8, intent(in) :: big_real
+    integer, intent(in) :: a_size
+    real, intent(in) :: a_array (a_size)
+
+    integer :: a_size2
+    real :: a_array2 (a_size, 10)
+
+    integer :: istep1
+    integer :: istep2
+    integer :: istep3
+
+    character(len=5) :: abcstr = 'abc'
+
+    integer*8 :: handle
+    integer*8 :: total_size
+    integer :: err
+    integer*8 :: size
+    integer :: i,j
+
+    a_size2 = 10
+
+    size = 900 * 1024
+
+    istep1 = 11
+    istep2 = 22
+    istep3 = 33
+    do j=1,10
+       do i=1,a_size
+          a_array2(i,j) = 1.0*i + (j-1)*a_size
+       end do
+    end do
+    size = 4 + 8 + 4 + 8 + 4 + 4 + a_size * 4 + a_size * 10 * 4 + 4 + 4 + 4
+
+    call adios_open (handle, group, filename, "w", group_comm, err)
+
+    call adios_group_size (handle, size, total_size, err)
+
+    call adios_write (handle, "small_int", small_int, err)
+    call adios_write (handle, "big_int", big_int, err)
+    call adios_write (handle, "small_real", small_real, err)
+    call adios_write (handle, "big_real", big_real, err)
+    call adios_write (handle, "ze0size", a_size, err)
+    call adios_write (handle, "ze1size", a_size2, err)
+    call adios_write (handle, "zelectron0", a_array, err)
+    call adios_write (handle, "zelectron1", a_array2, err)
+
+    call adios_write (handle, "istep1", istep1, err)
+    call adios_write (handle, "istep2", istep2, err)
+    call adios_write (handle, "istep3", istep3, err)
+
+    ! When writing out a string type variable, we need to add a char(0) 
+    ! ADIOS expects here a C string
+    !call adios_write (handle, "str", trim("abc")//char(0), err)
+    call adios_write (handle, "str_var", abcstr, err)
+    call adios_write (handle, "str_const", "abc", err)
+    call adios_write (handle, "str_arr", abcstr, err)
+
+    call adios_close (handle, err)
+
+end subroutine test_write
+
+subroutine test_read (group, filename, group_comm, small_int, big_int, small_real, big_real, a_size, a_array)
+    implicit none
+    include 'mpif.h'
+    character (*), intent(in) :: group
+    character (*), intent(in) :: filename
+    integer, intent (in) :: group_comm
+    integer, intent(out) :: small_int
+    integer*8, intent(out) :: big_int
+    real, intent(out) :: small_real
+    real*8, intent(out) :: big_real
+    integer, intent(inout) :: a_size
+    real, intent(out) :: a_array (a_size)
+
+    integer*8 :: group_size = 0
+    integer*8 :: total_size
+    integer :: err
+
+    integer :: istep1
+    integer :: istep2
+    integer :: istep3
+
+    integer*8 :: handle
+    integer*8 :: buffer_size
+
+    character (len=40) :: str
+
+    str = '1234567890123456789012345678901234567890'
+
+    istep1 = 11
+    istep2 = 22
+    istep3 = 33
+
+    call adios_open (handle, group, filename, "r", group_comm, err)
+
+    call adios_group_size (handle, group_size, total_size, err)
+    buffer_size = 4
+    call adios_read (handle, "small_int", small_int, buffer_size, err)
+    buffer_size = 8
+    call adios_read (handle, "big_int", big_int, buffer_size, err)
+    buffer_size = 4
+    call adios_read (handle, "small_real", small_real, buffer_size, err)
+    buffer_size = 8
+    call adios_read (handle, "big_real", big_real, buffer_size, err)
+    buffer_size = 4
+    call adios_read (handle, "ze0size", a_size, buffer_size, err)
+    buffer_size = 4 * a_size
+    call adios_read (handle, "zelectron0", a_array, buffer_size, err)
+
+    !call adios_read (handle, "str", str, err)
+
+    call adios_close (handle, err)
+
+    !write (*,*) "read str: ", str
+
+end subroutine test_read
diff --git a/tests/Fortran/config_fortran.xml b/tests/Fortran/config_fortran.xml
new file mode 100644
index 0000000..c8f97d8
--- /dev/null
+++ b/tests/Fortran/config_fortran.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<adios-config host-language="Fortran">
+  <adios-group name="restart" coordination-communicator="group_comm">
+    <var name="small_int" path="/abc/me" type="integer"/>
+    <var name="big_int" path="/abc/me" type="integer*8"/>
+    <var name="small_real" path="/abc/me" type="real"/>
+    <var name="big_real" path="/abc/me" type="double"/>
+
+    <var name="ze0size" type="integer"/>
+    <var name="ze1size" type="integer"/>
+    <var name="zelectron0" type="real" dimensions="ze0size"/>
+    <var name="zelectron1" type="real" dimensions="ze0size,ze1size"/>
+
+    <var name="istep1" type="integer"/>
+    <var name="istep2" type="integer"/>
+    <var name="istep3" type="integer"/>
+
+    <var name="str_var" type="string"/>
+    <attribute name="desc" path="/str_var" value="A character(5)='abc' variable written as string"/>
+    <var name="str_const" type="string"/>
+    <attribute name="desc" path="/str_const/" value="A constant 'abc' string written as string"/>
+    <var name="str_arr" type="byte" dimensions="5"/>
+    <attribute name="desc" path="/str_arr" value="A character(5)='abc' variable written as byte array"/>
+
+    <attribute name="units" path="/abc/me/" value="m/s"/>
+    <attribute name="units1" path="/abc/me" value="m/s"/>
+    <attribute name="timestep1" path="/" var="istep1"/>
+    <attribute name="timestep2" path="/abc" var="istep2"/>
+    <attribute name="timestep3" path="/abc/" var="istep3"/>
+  </adios-group>
+
+  <method method="MPI" group="restart"/>
+
+  <buffer size-MB="5" allocate-time="now"/>
+
+</adios-config>
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..17cd92d
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,8 @@
+SUITEDIR=suite
+if BUILD_WRITE
+if BUILD_FORTRAN
+SUBDIRS=C Fortran genarray bp_read ${SUITEDIR}
+else
+SUBDIRS=C bp_read ${SUITEDIR}
+endif
+endif
diff --git a/tests/Makefile.in b/tests/Makefile.in
new file mode 100644
index 0000000..2d6d63b
--- /dev/null
+++ b/tests/Makefile.in
@@ -0,0 +1,601 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = tests
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = C bp_read suite Fortran genarray
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+SUITEDIR = suite
+ at BUILD_FORTRAN_FALSE@@BUILD_WRITE_TRUE at SUBDIRS = C bp_read ${SUITEDIR}
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE at SUBDIRS = C Fortran genarray bp_read ${SUITEDIR}
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  tests/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/bp_read/Makefile.am b/tests/bp_read/Makefile.am
new file mode 100644
index 0000000..1aedc33
--- /dev/null
+++ b/tests/bp_read/Makefile.am
@@ -0,0 +1,46 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src #-I/ccs/home/sklasky/parallel-netcdf/jaguar/include
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+if BUILD_FORTRAN
+noinst_PROGRAMS=genbp bp_read_f bp_read_c
+else
+noinst_PROGRAMS=genbp bp_read_c
+endif
+
+# read_coords read_phi read_parts_global read_gena read_gena_pncd read_pixie_all
+
+genbp_SOURCES = genbp.c
+genbp_CPPFLAGS = $(ADIOSLIB_CPPFLAGS)
+genbp_CFLAGS = $(ADIOSLIB_CFLAGS)
+genbp_LDADD = $(top_builddir)/src/libadios.a $(top_builddir)/src/libadiosread.a $(ADIOSLIB_LDADD)
+genbp_LDFLAGS = $(ADIOSLIB_LDFLAGS) 
+
+if BUILD_FORTRAN
+bp_read_f_SOURCES = bp_read_f.F90
+bp_read_f_CPPFLAGS = $(ADIOSLIB_CPPFLAGS)
+bp_read_f_CFLAGS = $(ADIOSLIB_CFLAGS)
+bp_read_f_LDADD = $(top_builddir)/src/libadiosreadf.a $(ADIOSREADLIB_LDADD)
+bp_read_f_LDFLAGS = $(ADIOSREADLIB_LDFLAGS) 
+endif
+
+bp_read_c_SOURCES = bp_read_c.c
+bp_read_c_CPPFLAGS = $(ADIOSLIB_CPPFLAGS)
+bp_read_c_CFLAGS = $(ADIOSLIB_CFLAGS)
+bp_read_c_LDADD = $(top_builddir)/src/libadiosread.a $(ADIOSREADLIB_LDADD)
+bp_read_c_LDFLAGS = $(ADIOSREADLIB_LDFLAGS) 
+
+FC=$(MPIFC)
+CC=$(MPICC)
+
+FCLINK = \
+        $(LIBTOOL) --mode=link --tag F77 $(FC) \
+        $(AM_FCFLAGS) $(FCFLAGS) $(LDFLAGS) -o $@
+
+if BUILD_FORTRAN
+CLEANFILES = *.o bp_read_c bp_read_f genbp read_coords read_phi read_parts_global
+else
+CLEANFILES = *.o bp_read_c genbp read_coords read_phi read_parts_global
+endif
+
diff --git a/tests/bp_read/Makefile.in b/tests/bp_read/Makefile.in
new file mode 100644
index 0000000..9356397
--- /dev/null
+++ b/tests/bp_read/Makefile.in
@@ -0,0 +1,616 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+ at BUILD_FORTRAN_FALSE@noinst_PROGRAMS = genbp$(EXEEXT) \
+ at BUILD_FORTRAN_FALSE@	bp_read_c$(EXEEXT)
+ at BUILD_FORTRAN_TRUE@noinst_PROGRAMS = genbp$(EXEEXT) \
+ at BUILD_FORTRAN_TRUE@	bp_read_f$(EXEEXT) bp_read_c$(EXEEXT)
+subdir = tests/bp_read
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_bp_read_c_OBJECTS = bp_read_c-bp_read_c.$(OBJEXT)
+bp_read_c_OBJECTS = $(am_bp_read_c_OBJECTS)
+am__DEPENDENCIES_1 =
+bp_read_c_DEPENDENCIES = $(top_builddir)/src/libadiosread.a \
+	$(am__DEPENDENCIES_1)
+am__bp_read_f_SOURCES_DIST = bp_read_f.F90
+ at BUILD_FORTRAN_TRUE@am_bp_read_f_OBJECTS =  \
+ at BUILD_FORTRAN_TRUE@	bp_read_f-bp_read_f.$(OBJEXT)
+bp_read_f_OBJECTS = $(am_bp_read_f_OBJECTS)
+ at BUILD_FORTRAN_TRUE@bp_read_f_DEPENDENCIES =  \
+ at BUILD_FORTRAN_TRUE@	$(top_builddir)/src/libadiosreadf.a \
+ at BUILD_FORTRAN_TRUE@	$(am__DEPENDENCIES_1)
+am_genbp_OBJECTS = genbp-genbp.$(OBJEXT)
+genbp_OBJECTS = $(am_genbp_OBJECTS)
+genbp_DEPENDENCIES = $(top_builddir)/src/libadios.a \
+	$(top_builddir)/src/libadiosread.a $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+PPFCCOMPILE = $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)
+LTPPFCCOMPILE = $(LIBTOOL) --mode=compile $(FC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(bp_read_c_SOURCES) $(bp_read_f_SOURCES) $(genbp_SOURCES)
+DIST_SOURCES = $(bp_read_c_SOURCES) $(am__bp_read_f_SOURCES_DIST) \
+	$(genbp_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = $(MPIFC)
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src \
+	#-I/ccs/home/sklasky/parallel-netcdf/jaguar/include
+AUTOMAKE_OPTIONS = no-dependencies
+
+# read_coords read_phi read_parts_global read_gena read_gena_pncd read_pixie_all
+genbp_SOURCES = genbp.c
+genbp_CPPFLAGS = $(ADIOSLIB_CPPFLAGS)
+genbp_CFLAGS = $(ADIOSLIB_CFLAGS)
+genbp_LDADD = $(top_builddir)/src/libadios.a $(top_builddir)/src/libadiosread.a $(ADIOSLIB_LDADD)
+genbp_LDFLAGS = $(ADIOSLIB_LDFLAGS) 
+ at BUILD_FORTRAN_TRUE@bp_read_f_SOURCES = bp_read_f.F90
+ at BUILD_FORTRAN_TRUE@bp_read_f_CPPFLAGS = $(ADIOSLIB_CPPFLAGS)
+ at BUILD_FORTRAN_TRUE@bp_read_f_CFLAGS = $(ADIOSLIB_CFLAGS)
+ at BUILD_FORTRAN_TRUE@bp_read_f_LDADD = $(top_builddir)/src/libadiosreadf.a $(ADIOSREADLIB_LDADD)
+ at BUILD_FORTRAN_TRUE@bp_read_f_LDFLAGS = $(ADIOSREADLIB_LDFLAGS) 
+bp_read_c_SOURCES = bp_read_c.c
+bp_read_c_CPPFLAGS = $(ADIOSLIB_CPPFLAGS)
+bp_read_c_CFLAGS = $(ADIOSLIB_CFLAGS)
+bp_read_c_LDADD = $(top_builddir)/src/libadiosread.a $(ADIOSREADLIB_LDADD)
+bp_read_c_LDFLAGS = $(ADIOSREADLIB_LDFLAGS) 
+FCLINK = \
+        $(LIBTOOL) --mode=link --tag F77 $(FC) \
+        $(AM_FCFLAGS) $(FCFLAGS) $(LDFLAGS) -o $@
+
+ at BUILD_FORTRAN_FALSE@CLEANFILES = *.o bp_read_c genbp read_coords read_phi read_parts_global
+ at BUILD_FORTRAN_TRUE@CLEANFILES = *.o bp_read_c bp_read_f genbp read_coords read_phi read_parts_global
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .F90 .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  tests/bp_read/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  tests/bp_read/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+bp_read_c$(EXEEXT): $(bp_read_c_OBJECTS) $(bp_read_c_DEPENDENCIES) 
+	@rm -f bp_read_c$(EXEEXT)
+	$(LINK) $(bp_read_c_LDFLAGS) $(bp_read_c_OBJECTS) $(bp_read_c_LDADD) $(LIBS)
+bp_read_f$(EXEEXT): $(bp_read_f_OBJECTS) $(bp_read_f_DEPENDENCIES) 
+	@rm -f bp_read_f$(EXEEXT)
+	$(FCLINK) $(bp_read_f_LDFLAGS) $(bp_read_f_OBJECTS) $(bp_read_f_LDADD) $(LIBS)
+genbp$(EXEEXT): $(genbp_OBJECTS) $(genbp_DEPENDENCIES) 
+	@rm -f genbp$(EXEEXT)
+	$(LINK) $(genbp_LDFLAGS) $(genbp_OBJECTS) $(genbp_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.F90.o:
+	$(PPFCCOMPILE) -c -o $@ $<
+
+.F90.obj:
+	$(PPFCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.F90.lo:
+	$(LTPPFCCOMPILE) -c -o $@ $<
+
+bp_read_f-bp_read_f.o: bp_read_f.F90
+	$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bp_read_f_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o bp_read_f-bp_read_f.o `test -f 'bp_read_f.F90' || echo '$(srcdir)/'`bp_read_f.F90
+
+bp_read_f-bp_read_f.obj: bp_read_f.F90
+	$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bp_read_f_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o bp_read_f-bp_read_f.obj `if test -f 'bp_read_f.F90'; then $(CYGPATH_W) 'bp_read_f.F90'; else $(CYGPATH_W) '$(srcdir)/bp_read_f.F90'; fi`
+
+.c.o:
+	$(COMPILE) -c $<
+
+.c.obj:
+	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+	$(LTCOMPILE) -c -o $@ $<
+
+bp_read_c-bp_read_c.o: bp_read_c.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bp_read_c_CPPFLAGS) $(CPPFLAGS) $(bp_read_c_CFLAGS) $(CFLAGS) -c -o bp_read_c-bp_read_c.o `test -f 'bp_read_c.c' || echo '$(srcdir)/'`bp_read_c.c
+
+bp_read_c-bp_read_c.obj: bp_read_c.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bp_read_c_CPPFLAGS) $(CPPFLAGS) $(bp_read_c_CFLAGS) $(CFLAGS) -c -o bp_read_c-bp_read_c.obj `if test -f 'bp_read_c.c'; then $(CYGPATH_W) 'bp_read_c.c'; else $(CYGPATH_W) '$(srcdir)/bp_read_c.c'; fi`
+
+genbp-genbp.o: genbp.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(genbp_CPPFLAGS) $(CPPFLAGS) $(genbp_CFLAGS) $(CFLAGS) -c -o genbp-genbp.o `test -f 'genbp.c' || echo '$(srcdir)/'`genbp.c
+
+genbp-genbp.obj: genbp.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(genbp_CPPFLAGS) $(CPPFLAGS) $(genbp_CFLAGS) $(CFLAGS) -c -o genbp-genbp.obj `if test -f 'genbp.c'; then $(CYGPATH_W) 'genbp.c'; else $(CYGPATH_W) '$(srcdir)/genbp.c'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/bp_read/README b/tests/bp_read/README
new file mode 100644
index 0000000..3dcdb6e
--- /dev/null
+++ b/tests/bp_read/README
@@ -0,0 +1,3 @@
+test.py 
+    python routines used to test the correctness of bp read APIs 
+    for both C and Fortran routines
diff --git a/tests/bp_read/bp_read_c.c b/tests/bp_read/bp_read_c.c
new file mode 100644
index 0000000..f35b0a9
--- /dev/null
+++ b/tests/bp_read/bp_read_c.c
@@ -0,0 +1,200 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include "mpi.h"
+#include "adios_read.h"
+
+#define PRINTDIMS(ndim, dims, ivar) if (ndim==0) \
+        printf("\tscalar\n"); \
+    else { \
+        printf("\t%dD variable: [%lld", ndim, dims[0]); \
+        for (ivar=1; ivar<ndim; ivar++) printf(", %lld", dims[ivar]); \
+        printf("]\n"); \
+    }
+
+int main (int argc, char ** argv)
+{
+    char * filename;
+    int    rank, pe_size, rc, version;    
+    struct bp_index_pg_struct_v1 * pg_root = 0;
+    struct bp_index_pg_struct_v1 * pg = 0;
+
+    struct  adios_index_var_struct_v1 * vars_root = 0;
+    struct  adios_index_attribute_struct_v1 * attrs_root = 0;
+    int     ngroup, nvar, nattr, ntstep;
+    int     i,j,k;    
+
+    int     NX = 10, G_NX=30;
+    int     NY = 10, G_NY=30;
+    int     NZ = 10, G_NZ=30;
+    void    * var = NULL;
+    MPI_Comm comm; 
+
+    ADIOS_FILE *fp;
+    ADIOS_GROUP *gp;
+    ADIOS_VARINFO *vi;
+
+    filename = argv[1];
+    if (!filename)
+        filename = "testbp_c.bp";
+
+    comm = MPI_COMM_WORLD;
+    MPI_Init (&argc, &argv);
+    MPI_Comm_rank (comm, &rank);
+    MPI_Comm_size (comm, &pe_size);
+
+    /* Open ADIOS file.
+       The index is read only by rank=0 process which is then broadcasted
+       to all processes.
+    */
+    fp = adios_fopen (filename, comm);
+    if (fp == NULL) {
+        fprintf(stderr, "Error: %s\n", adios_errmsg());
+        exit(adios_errno);
+    }
+
+    if (rank == 0) 
+        adios_print_fileinfo (fp); // function in src/adios_read.c, not exposed in .h files
+
+    /* Open a group in the file.
+       A file has one or more adios groups. They are handled separately.
+    */
+    gp = adios_gopen_byid (fp, 0); // open the first group
+    if (gp == NULL) {
+        int retval = adios_errno;
+        fprintf(stderr, "Error: %s\n", adios_errmsg());
+        adios_fclose(fp);
+        exit(retval);
+    }
+    if (rank == 0) 
+        adios_print_groupinfo (gp); // function in src/adios_read.c, not exposed in .h files
+
+    /* Read a variable
+       Variables should be queried first to get type and size information.
+       Then memory should be allocated for the data slice to be read in.
+       Then the variable can be read.
+    */
+    uint64_t start[3], size[3];
+    const char *type_str;
+    double time;
+
+    /* variable int_1D */
+    vi = adios_inq_var (gp, "int_1D");
+    if (vi == NULL) {
+        int retval = adios_errno;
+        fprintf(stderr, "Error: %s\n", adios_errmsg());
+        adios_fclose(fp);
+        adios_gclose(gp);
+        exit(retval);
+    }
+
+    type_str = adios_type_to_string (vi->type);
+    printf("%s:\n\thas timesteps: %s\n\ttype: %s\n",
+            "int_1D", (vi->timedim > -1 ? "yes" : "no"), type_str);
+    PRINTDIMS(vi->ndim, vi->dims, i)
+    size[0] = 1;
+    start[0] = 0;
+    adios_read_var (gp, "int_1D", start, size, &nvar);
+    printf("\tfirst element value: %d\n",(nvar));
+    free(vi);
+
+
+    /* variable int_2D */
+    vi = adios_inq_var (gp, "int_2D");
+    if (vi == NULL) {
+        int retval = adios_errno;
+        fprintf(stderr, "Error: %s\n", adios_errmsg());
+        adios_fclose(fp);
+        adios_gclose(gp);
+        exit(retval);
+    }
+    
+    type_str = adios_type_to_string (vi->type);
+    printf("%s:\n\thas timesteps: %s\n\ttype: %s\n",
+            "int_2D", (vi->timedim > -1 ? "yes" : "no"), type_str);
+    PRINTDIMS(vi->ndim, vi->dims, i)
+    start[0]=0;
+    start[1]=0;
+    size[0]=10;
+    size[1]=2;
+    var = malloc (sizeof(int) * size[0]*size[1]);
+
+    // time step should be no less than zero
+    // vnamelist[14] is not written at time step 0
+    // so the function returns as error
+    adios_read_var (gp, "int_2D", start, size, var);
+    printf("\tslice (%d:%d, %d:%d) = ", 
+           start[0], start[0]+size[0]-1,
+           start[1], start[1]+size[1]-1);
+    k=0;
+    for (j=0;j<size[0];j++) {
+        printf("\n\t");
+        for (i=0;i<size[1];i++){
+            printf("%d  ",((int*)(var))[k]);
+            k++;
+        }
+    }
+    printf("\n");
+    free(vi);
+    free(var);
+
+
+    /* variable int_3D */
+    vi = adios_inq_var (gp, "int_3D");
+    if (vi == NULL) {
+        int retval = adios_errno;
+        fprintf(stderr, "Error: %s\n", adios_errmsg());
+        adios_fclose(fp);
+        adios_gclose(gp);
+        exit(retval);
+    }
+    
+    type_str = adios_type_to_string (vi->type);
+    printf("%s:\n\thas timesteps: %s\n\ttype: %s\n",
+            "int_3D", (vi->timedim > -1 ? "yes" : "no"), type_str);
+    PRINTDIMS(vi->ndim, vi->dims, i)
+    
+    start[0]=0;
+    start[1]=0;
+    start[2]=0;
+    size[0]=2;
+    size[1]=5;
+    size[2]=3;
+    var = malloc ( sizeof(int) * size[0]*size[1]*size[2]);
+    adios_read_var (gp, "int_3D", start, size, var);
+    printf("\t[%d:%d, %d:%d, %d:%d]", 
+           start[0], start[0]+size[0]-1,
+           start[1], start[1]+size[1]-1,
+           start[2], start[2]+size[2]-1
+           );
+    k=0;
+    for (nvar=0;nvar<size[0];nvar++) {
+        for (j=0;j<size[1];j++) {
+            printf("\n\t");
+            for (i=0;i<size[2];i++){
+                printf("%d  ",((int*)(var))[k]);
+                k++;
+            }
+        }
+        printf("\n");
+    }
+    free(vi);
+    free(var);
+
+    printf("\ndone\n");
+
+        
+    adios_gclose (gp);
+    adios_fclose (fp);
+    MPI_Finalize ();
+
+    return 0;
+}
+
diff --git a/tests/bp_read/bp_read_f.F90 b/tests/bp_read/bp_read_f.F90
new file mode 100644
index 0000000..d57e589
--- /dev/null
+++ b/tests/bp_read/bp_read_f.F90
@@ -0,0 +1,157 @@
+!  
+!  ADIOS is freely available under the terms of the BSD license described
+!  in the COPYING file in the top level directory of this source distribution.
+!
+!  Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+!
+
+program read_bp_f
+    implicit none
+    include "mpif.h"
+
+    integer :: gcnt, vcnt, acnt, tstart, ntsteps, tstop, vrank, vtype, timedim, ierr
+    integer :: comm,i,j,k,l,m
+    integer*8 :: read_bytes
+    integer*8 :: fh, gh
+    integer*8, dimension(10) :: dims, start, readsize
+    integer, dimension(1000) :: var, vartrue
+    !character, dimension(:), allocatable :: varchar
+    !integer, dimension(:), allocatable :: varint
+    !real*8, dimension(:), allocatable :: vardouble
+    character(100000) :: varchar
+    integer, dimension(100000) :: varint
+    real*8, dimension(10000000) :: vardouble
+    integer :: totalsize
+    character (len=100), dimension(5000) :: vnamelist
+    character (len=100), dimension(5000) :: anamelist
+    character (len=100), dimension(5000) :: gnamelist
+
+    integer :: ilom,ihip,jlom,jhip,klom,khip
+    integer, dimension(3) :: vstart, readcount
+    integer,dimension(48) :: bconds  ! all boundary conditions as one array
+    character(20)    :: vname
+    integer          :: one
+    real*8,dimension(102,66,3)  :: b1
+
+    call MPI_Init (ierr)
+    comm = MPI_COMM_WORLD
+
+    varchar = ' '
+    !call adios_fopen (fh, "/lustre/spider/scratch/pnorbert/TRACKP.bp", comm, ierr)
+    !call adios_fopen (fh, "TRACKP_00010.bp", comm, ierr)
+    !call adios_fopen (fh, "g_1x4_5x1.bp", comm, ierr)
+    !call adios_fopen (fh, "pixie3d.bp", comm, ierr)
+    !call adios_fopen (fh, "g_2x2_2x2_t1.bp", comm, ierr)
+    !call adios_fopen (fh, "xgcp.bp", comm, ierr)
+    !call adios_fopen (fh, "pgood.bp", comm, ierr)
+    !call adios_fopen (fh, "xgc.flowdiag.bp", comm, ierr)
+    !call adios_fopen (fh, "xgc.restart.000.03600.bp", comm, ierr)
+    call adios_fopen (fh, "g.bp", comm, gcnt, ierr)
+    !call adios_fopen (fh, "testbp.bp", comm, ierr)
+    !call adios_fopen (fh, "record.bp", comm, ierr)
+    !call adios_fopen (fh, "outxz.bp", comm, ierr)
+
+    call adios_inq_file (fh,vcnt,acnt,tstart,ntsteps,gnamelist,ierr) 
+    tstop = ntsteps+ntsteps-1
+    write (*,'("Number of timesteps : ",i0," starting from ",i0)') ntsteps, tstart
+    write (*,'("Number of groups : ",i0)') gcnt
+
+    do i=1,gcnt 
+        write (*,"(i5, a, a)") i,")  ", trim(gnamelist(i))
+    enddo
+
+    call adios_gopen (fh, gh, gnamelist(1), vcnt, acnt, ierr) 
+    call adios_inq_group(gh, vnamelist, anamelist, ierr)
+
+    write (*,'("Number of variables in group ",a,": ",i0)') trim(gnamelist(1)), vcnt
+    do i=1,vcnt 
+        write (*,"(i5, a, a)") i,")  ", trim(vnamelist(i))
+    enddo
+
+    write (*,'("Number of attributes in group ",a,": ",i0)') trim(gnamelist(1)), acnt
+    do i=1,acnt 
+        write (*,"(i5, a, a)") i,")  ", trim(anamelist(i))
+    enddo
+
+    ! vtype 
+    ! 0 byte 
+    ! 1 short 
+    ! 2 integer
+    ! 4 long 
+    ! 5 real 
+    ! 6 double
+    ! 7 long double
+    ! 9 string
+    ! 10 complex
+    ! 11 double_complex
+    ! 50 unsigned_byte 
+    ! 51 unsigned_short
+    ! 52 unsigned_integer
+    ! 54 unsigned_long
+    !write (*,*) "name    ",  "  ndim    ", "    dims"
+
+    write (*,*)"-----------------------------"
+    do i=1,vcnt 
+        call adios_inq_var (gh, vnamelist(i), vtype, vrank, dims, timedim, ierr)
+        start(1:10)=0
+        readsize(1:10)=1 
+        totalsize=1
+        do j=1,vrank
+            readsize(j) = dims(j)
+            totalsize=totalsize*dims(j)
+        enddo
+        write (*,'(a," ndims=",i0," type=",i0," size=",i0)') trim(vnamelist(i)),vrank,vtype,totalsize
+        if (vtype == 0) then
+            !if(allocated(varchar)) deallocate(varchar)
+            !allocate(varchar(totalsize))
+            !varchar(1)="!"
+            call adios_read_var (gh, vnamelist(i), start, readsize, varchar, read_bytes)
+        else if (vtype == 2) then
+            !write (*,*) "  totalsize = ", totalsize
+            !if (totalsize == 1) totalsize = 10
+            !if(allocated(varint)) then
+            !    write (*,*) "  dealloc varint"
+            !    deallocate(varint)
+            !endif
+            !write (*,*) "  alloc varint, size = ", totalsize
+            !allocate(varint(totalsize))
+            !write (*,*) "  totalsize = ", totalsize
+            !varint(:)=5
+            !print *, varint(1:10)
+            call adios_read_var (gh, vnamelist(i), start, readsize, varint, read_bytes)
+            print *, varint(1)
+        else if (vtype == 6) then
+            !if(allocated(vardouble)) deallocate(vardouble)
+            !allocate(vardouble(totalsize))
+            call adios_read_var (gh, vnamelist(i), start, readsize, vardouble, read_bytes)
+        else
+            write (*,'(a16,": Only integer or double type is handled here")') trim(vnamelist(i))
+        endif
+        if (vrank == 0) then
+            if (vtype == 0) then
+                write(*,'("    = ",a)') varchar(1:1)
+            else if (vtype == 2) then
+                write(*,'("    = ",i0)') varint(1)
+            else if (vtype == 6) then 
+                write(*,'("    = ",d20.10)') vardouble(1)
+            endif
+        else
+            !write (*,*)"-----------------------------"
+            !write (*,'(a30,t32," dimensions = [",i0,$)') vnamelist(i), dims(1)
+            write (*,'("   dimensions = [",i0,$)') dims(1)
+            do j=2,vrank
+                write (*,'(",",i0,$)') dims(j)
+            enddo
+            if (vtype == 0) then
+                write (*,'("] = ",a)') varchar
+            else
+                write (*,'("]")') 
+            endif
+        endif
+    enddo
+
+    call adios_gclose(gh, ierr)
+    call adios_fclose(fh, ierr)
+
+    call MPI_Finalize (ierr)
+end program
diff --git a/tests/bp_read/genbp.c b/tests/bp_read/genbp.c
new file mode 100644
index 0000000..c86db52
--- /dev/null
+++ b/tests/bp_read/genbp.c
@@ -0,0 +1,109 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdint.h>
+#include <assert.h>
+
+// mpi
+#include "mpi.h"
+
+#include "adios.h"
+
+int main (int argc, char ** argv)
+{
+    char * type_name = "testbp";
+    char * filename = "testbp_c.bp";
+    int64_t io_handle;  // io handle
+    MPI_Comm comm = MPI_COMM_WORLD;
+    int rank;
+
+    int dim1 = 10;   // dimension 1
+    int dim2 = 7; 
+    int dim3 = 6;
+    int dim4 = 3;
+    int dim5 = 5;
+    int i,j,k,l,m; // loop counters for dims
+    int time_start = 27; // arbitrary number to put into bp file
+
+
+    int int_1D[dim1];
+    int int_2D[dim1][dim2];
+    int int_3D[dim1][dim2][dim3];
+    int int_4D[dim1][dim2][dim3][dim4];
+    int int_5D[dim1][dim2][dim3][dim4][dim5];
+
+    int node = 0;
+
+    uint64_t total;
+
+    int vi, vj, vk, vt, vl;
+    for (i = 0; i < dim1; i++) {
+        int_1D[i] = i;
+        vi = i*dim2;
+        // 2D arrays
+        for (j = 0; j < dim2; j++) {
+            int_2D[i][j] = vi + j;
+            vj = (vi + j)*dim3;
+            // 3D array
+            for (k = 0; k < dim3; k++) {
+                int_3D[i][j][k] = vj + k;
+                vk = (vj+k)*dim4;
+                // 4D array
+                for (l = 0; l < dim4; l++) {
+                    int_4D[i][j][k][l] = vk + l;
+                    // 5D array
+                    vl = (vk+l)*dim5;
+                    for (m = 0; m < dim5; m++) {
+                        int_5D[i][j][k][l][m] = vl + m;
+                    }
+                }
+            }
+        }
+    }
+
+    MPI_Init (&argc, &argv);
+    MPI_Comm_rank (MPI_COMM_WORLD, &rank);
+    if (!adios_init ("testbp_c.xml"))
+        return -1;
+
+    adios_open (&io_handle, type_name, filename, "w", &comm);
+    adios_group_size (io_handle, 32                             // 4 integers 
+                                + 4 * dim1                      // int_1D
+                                + 4 * dim1 * dim2               // int_2D
+                                + 4 * dim1 * dim2 * dim3        // int_3D
+                                + 4 * dim1 * dim2 * dim3 * dim4 // int_4D
+                                + 4 * dim1 * dim2 * dim3 * dim4 * dim5// int_4D
+                     ,&total
+                     );
+    adios_write (io_handle, "dim1", &dim1);
+    adios_write (io_handle, "dim2", &dim2);
+    adios_write (io_handle, "dim3", &dim3);
+    adios_write (io_handle, "dim4", &dim4);
+    adios_write (io_handle, "dim5", &dim5);
+
+    adios_write (io_handle, "int_1D", int_1D);
+    adios_write (io_handle, "int_2D", int_2D);
+    adios_write (io_handle, "int_3D", int_3D);
+    adios_write (io_handle, "int_4D", int_4D);
+    adios_write (io_handle, "int_5D", int_5D);
+
+    adios_write (io_handle, "time_start", &time_start);
+
+    adios_close (io_handle);
+
+    printf ("rank: %d write completed\n", rank);
+
+    MPI_Barrier (MPI_COMM_WORLD);
+
+    adios_finalize (node);
+    MPI_Finalize ();
+
+    return 0;
+}
diff --git a/tests/genarray/Makefile.am b/tests/genarray/Makefile.am
new file mode 100644
index 0000000..3890591
--- /dev/null
+++ b/tests/genarray/Makefile.am
@@ -0,0 +1,50 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+noinst_PROGRAMS=genarray genarray2D copyarray copyarray2D
+
+genarray_SOURCES = genarray.F90
+genarray_CPPFLAGS = $(ADIOSLIB_CPPFLAGS)
+genarray_CFLAGS = $(ADIOSLIB_CFLAGS)
+genarray_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD)
+genarray_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+
+genarray2D_SOURCES = genarray2D.F90
+genarray2D_CPPFLAGS = $(ADIOSLIB_CPPFLAGS)
+genarray2D_CFLAGS = $(ADIOSLIB_CFLAGS)
+genarray2D_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD)
+genarray2D_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+
+copyarray_SOURCES = copyarray.F90
+copyarray_CPPFLAGS = $(ADIOSLIB_CPPFLAGS)
+copyarray_CFLAGS = $(ADIOSLIB_CFLAGS)
+copyarray_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD)
+copyarray_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+
+copyarray2D_SOURCES = copyarray2D.F90
+copyarray2D_CPPFLAGS = $(ADIOSLIB_CPPFLAGS)
+copyarray2D_CFLAGS = $(ADIOSLIB_CFLAGS)
+copyarray2D_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD)
+copyarray2D_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+
+FC=$(MPIFC)
+
+genarray.F90: gwrite_genarray.fh
+copyarray.F90: gwrite_genarray.fh gread_genarray.fh
+
+gwrite_genarray.fh: genarray3d.xml
+	rm -f gwrite_genarray.fh gread_genarray.fh
+	$(top_builddir)/utils/gpp/gpp.py genarray3d.xml
+gread_genarray.fh: genarray3d.xml
+	rm -f gwrite_genarray.fh gread_genarray.fh
+	$(top_builddir)/utils/gpp/gpp.py genarray3d.xml
+
+FCLINK = \
+	$(LIBTOOL) --mode=link --tag F77 $(FC) \
+	$(AM_FCFLAGS) $(FCFLAGS) $(LDFLAGS) -o $@
+
+CLEANFILES = genarray_comm.mod genarray2d_comm.mod gwrite_genarray.fh gread_genarray.fh
+
+EXTRA_DIST = genarray.xml genarray3d.xml job.ewok job2D.ewok
diff --git a/tests/genarray/Makefile.in b/tests/genarray/Makefile.in
new file mode 100644
index 0000000..72aabf0
--- /dev/null
+++ b/tests/genarray/Makefile.in
@@ -0,0 +1,620 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = genarray$(EXEEXT) genarray2D$(EXEEXT) \
+	copyarray$(EXEEXT) copyarray2D$(EXEEXT)
+subdir = tests/genarray
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_copyarray_OBJECTS = copyarray-copyarray.$(OBJEXT)
+copyarray_OBJECTS = $(am_copyarray_OBJECTS)
+am__DEPENDENCIES_1 =
+copyarray_DEPENDENCIES = $(top_builddir)/src/libadiosf.a \
+	$(am__DEPENDENCIES_1)
+am_copyarray2D_OBJECTS = copyarray2D-copyarray2D.$(OBJEXT)
+copyarray2D_OBJECTS = $(am_copyarray2D_OBJECTS)
+copyarray2D_DEPENDENCIES = $(top_builddir)/src/libadiosf.a \
+	$(am__DEPENDENCIES_1)
+am_genarray_OBJECTS = genarray-genarray.$(OBJEXT)
+genarray_OBJECTS = $(am_genarray_OBJECTS)
+genarray_DEPENDENCIES = $(top_builddir)/src/libadiosf.a \
+	$(am__DEPENDENCIES_1)
+am_genarray2D_OBJECTS = genarray2D-genarray2D.$(OBJEXT)
+genarray2D_OBJECTS = $(am_genarray2D_OBJECTS)
+genarray2D_DEPENDENCIES = $(top_builddir)/src/libadiosf.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+PPFCCOMPILE = $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)
+LTPPFCCOMPILE = $(LIBTOOL) --mode=compile $(FC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+SOURCES = $(copyarray_SOURCES) $(copyarray2D_SOURCES) \
+	$(genarray_SOURCES) $(genarray2D_SOURCES)
+DIST_SOURCES = $(copyarray_SOURCES) $(copyarray2D_SOURCES) \
+	$(genarray_SOURCES) $(genarray2D_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = $(MPIFC)
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+genarray_SOURCES = genarray.F90
+genarray_CPPFLAGS = $(ADIOSLIB_CPPFLAGS)
+genarray_CFLAGS = $(ADIOSLIB_CFLAGS)
+genarray_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD)
+genarray_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+genarray2D_SOURCES = genarray2D.F90
+genarray2D_CPPFLAGS = $(ADIOSLIB_CPPFLAGS)
+genarray2D_CFLAGS = $(ADIOSLIB_CFLAGS)
+genarray2D_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD)
+genarray2D_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+copyarray_SOURCES = copyarray.F90
+copyarray_CPPFLAGS = $(ADIOSLIB_CPPFLAGS)
+copyarray_CFLAGS = $(ADIOSLIB_CFLAGS)
+copyarray_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD)
+copyarray_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+copyarray2D_SOURCES = copyarray2D.F90
+copyarray2D_CPPFLAGS = $(ADIOSLIB_CPPFLAGS)
+copyarray2D_CFLAGS = $(ADIOSLIB_CFLAGS)
+copyarray2D_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD)
+copyarray2D_LDFLAGS = $(ADIOSLIB_LDFLAGS)
+FCLINK = \
+	$(LIBTOOL) --mode=link --tag F77 $(FC) \
+	$(AM_FCFLAGS) $(FCFLAGS) $(LDFLAGS) -o $@
+
+CLEANFILES = genarray_comm.mod genarray2d_comm.mod gwrite_genarray.fh gread_genarray.fh
+EXTRA_DIST = genarray.xml genarray3d.xml job.ewok job2D.ewok
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .F90 .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  tests/genarray/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  tests/genarray/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+copyarray$(EXEEXT): $(copyarray_OBJECTS) $(copyarray_DEPENDENCIES) 
+	@rm -f copyarray$(EXEEXT)
+	$(FCLINK) $(copyarray_LDFLAGS) $(copyarray_OBJECTS) $(copyarray_LDADD) $(LIBS)
+copyarray2D$(EXEEXT): $(copyarray2D_OBJECTS) $(copyarray2D_DEPENDENCIES) 
+	@rm -f copyarray2D$(EXEEXT)
+	$(FCLINK) $(copyarray2D_LDFLAGS) $(copyarray2D_OBJECTS) $(copyarray2D_LDADD) $(LIBS)
+genarray$(EXEEXT): $(genarray_OBJECTS) $(genarray_DEPENDENCIES) 
+	@rm -f genarray$(EXEEXT)
+	$(FCLINK) $(genarray_LDFLAGS) $(genarray_OBJECTS) $(genarray_LDADD) $(LIBS)
+genarray2D$(EXEEXT): $(genarray2D_OBJECTS) $(genarray2D_DEPENDENCIES) 
+	@rm -f genarray2D$(EXEEXT)
+	$(FCLINK) $(genarray2D_LDFLAGS) $(genarray2D_OBJECTS) $(genarray2D_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.F90.o:
+	$(PPFCCOMPILE) -c -o $@ $<
+
+.F90.obj:
+	$(PPFCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.F90.lo:
+	$(LTPPFCCOMPILE) -c -o $@ $<
+
+copyarray-copyarray.o: copyarray.F90
+	$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(copyarray_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o copyarray-copyarray.o `test -f 'copyarray.F90' || echo '$(srcdir)/'`copyarray.F90
+
+copyarray-copyarray.obj: copyarray.F90
+	$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(copyarray_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o copyarray-copyarray.obj `if test -f 'copyarray.F90'; then $(CYGPATH_W) 'copyarray.F90'; else $(CYGPATH_W) '$(srcdir)/copyarray.F90'; fi`
+
+copyarray2D-copyarray2D.o: copyarray2D.F90
+	$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(copyarray2D_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o copyarray2D-copyarray2D.o `test -f 'copyarray2D.F90' || echo '$(srcdir)/'`copyarray2D.F90
+
+copyarray2D-copyarray2D.obj: copyarray2D.F90
+	$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(copyarray2D_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o copyarray2D-copyarray2D.obj `if test -f 'copyarray2D.F90'; then $(CYGPATH_W) 'copyarray2D.F90'; else $(CYGPATH_W) '$(srcdir)/copyarray2D.F90'; fi`
+
+genarray-genarray.o: genarray.F90
+	$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(genarray_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o genarray-genarray.o `test -f 'genarray.F90' || echo '$(srcdir)/'`genarray.F90
+
+genarray-genarray.obj: genarray.F90
+	$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(genarray_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o genarray-genarray.obj `if test -f 'genarray.F90'; then $(CYGPATH_W) 'genarray.F90'; else $(CYGPATH_W) '$(srcdir)/genarray.F90'; fi`
+
+genarray2D-genarray2D.o: genarray2D.F90
+	$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(genarray2D_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o genarray2D-genarray2D.o `test -f 'genarray2D.F90' || echo '$(srcdir)/'`genarray2D.F90
+
+genarray2D-genarray2D.obj: genarray2D.F90
+	$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(genarray2D_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS) -c -o genarray2D-genarray2D.obj `if test -f 'genarray2D.F90'; then $(CYGPATH_W) 'genarray2D.F90'; else $(CYGPATH_W) '$(srcdir)/genarray2D.F90'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-info-am
+
+
+genarray.F90: gwrite_genarray.fh
+copyarray.F90: gwrite_genarray.fh gread_genarray.fh
+
+gwrite_genarray.fh: genarray3d.xml
+	rm -f gwrite_genarray.fh gread_genarray.fh
+	$(top_builddir)/utils/gpp/gpp.py genarray3d.xml
+gread_genarray.fh: genarray3d.xml
+	rm -f gwrite_genarray.fh gread_genarray.fh
+	$(top_builddir)/utils/gpp/gpp.py genarray3d.xml
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/genarray/copyarray.F90 b/tests/genarray/copyarray.F90
new file mode 100644
index 0000000..8268c51
--- /dev/null
+++ b/tests/genarray/copyarray.F90
@@ -0,0 +1,300 @@
+!
+!  ADIOS is freely available under the terms of the BSD license described
+!  in the COPYING file in the top level directory of this source distribution.
+!
+!  Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+!
+
+!
+!  COPYARRAY
+!
+!  Write an ADIOS BP file from many processor for test purposes.
+!
+!  nx * ny * nz     processes write a 3D array, where each process writes an
+!  ndx * ndy * ndz  piece with filling with its rank as integer (4 bytes) value
+!
+!
+! (c) Oak Ridge National Laboratory, 2009
+! Author: Norbert Podhorszki
+!
+module genarray_comm
+    ! arguments
+    character(len=256) :: outputfile, inputfile
+    integer :: npx, npy, npz  ! # of processors in x-y-z direction
+    integer :: ndx, ndy, ndz  ! size of array per processor
+    logical :: common_size    ! .true.  if common local sizes are given as argument
+                              ! .false. if we have to read sizes from a file
+
+    integer :: gndx, gndy, gndz  ! size of the global array
+    integer :: offx,offy,offz    ! offsets of local array in the global array
+
+    real*8, dimension(:,:,:), allocatable :: double_xyz
+
+    ! MPI variables
+    integer :: group_comm
+    integer :: rank, nproc
+    integer :: ierr
+
+    ! ADIOS variables
+    character (len=200) :: group
+    character (len=200) :: filename
+    !character (len=6)   :: nprocstr
+    integer*8 :: handle, total_size, group_size, adios_totalsize, adios_buf_size
+    integer   :: err
+
+    real*8 :: start_time, end_time, total_time,gbs,sz
+    real*8 :: cache_start_time, cache_end_time, cache_total_time
+
+
+end module genarray_comm
+
+
+program genarray
+    use genarray_comm
+    implicit none
+    include 'mpif.h'
+
+    call MPI_Init (ierr)
+    call MPI_Comm_dup (MPI_COMM_WORLD, group_comm, ierr)
+    call MPI_Comm_rank (MPI_COMM_WORLD, rank, ierr)
+    call MPI_Comm_size (group_comm, nproc , ierr)
+
+    call adios_init ("genarray3d.xml", ierr)
+    !call MPI_Barrier (group_comm, ierr)
+
+    call processArgs()
+    if (rank == 0) then
+        print *,"Input file:  "//trim(inputfile)
+        print *,"Output file: "//trim(outputfile)
+        print '(" Process number        : ",i0," x ",i0," x ",i0)', npx,npy,npz
+        if (common_size) then
+            print '(" Array size per process: ",i0," x ",i0," x ",i0)', ndx,ndy,ndz
+        else
+            print *," Array sizes per processes taken from file: "//trim(inputfile)
+        endif
+
+        if (nproc .ne. npx*npy*npz) then
+            print '(" Error: Number of processors ",i0,"does not match ndx*ndy*ndz=",i0)', nproc, npx*npy*npz
+            call exit(1)
+        endif
+    endif
+
+    !write (*,*) 'rank ', rank, "init completed"
+    !write (nprocstr,'(i0)') nproc
+
+    call determineLocalSize()
+    call determineGlobalSize()
+    call determineOffsets()
+    call generateLocalArray()
+
+    call MPI_BARRIER(MPI_COMM_WORLD,err)
+    start_time = MPI_WTIME()
+    call readArray()
+    call MPI_BARRIER(MPI_COMM_WORLD,err)
+    end_time = MPI_WTIME()
+    total_time = end_time - start_time
+
+    sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB
+    gbs = sz/total_time
+
+    !if (rank==0) write(6,*) total_time
+    if (rank==0) write(6,'(a10,d12.2,2x,d12.2,2x,d12.3)') outputfile,sz,total_time,gbs
+
+    call MPI_BARRIER(MPI_COMM_WORLD,err)
+    start_time = MPI_WTIME()
+    call writeArray()
+    call MPI_BARRIER(MPI_COMM_WORLD,err)
+    end_time = MPI_WTIME()
+    total_time = end_time - start_time
+
+    sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB
+    gbs = sz/total_time
+
+    !if (rank==0) write(6,*) total_time
+    if (rank==0) write(6,'(a10,d12.2,2x,d12.2,2x,d12.3)') outputfile,sz,total_time,gbs
+
+    ! Terminate
+    call MPI_Barrier (MPI_COMM_WORLD, ierr)
+    call adios_finalize (rank, ierr)
+    call MPI_Finalize (ierr)
+end program genarray
+
+
+!!***************************
+subroutine determineLocalSize()
+    use genarray_comm
+    implicit none
+    if (common_size) then
+       ! we are done since we know them from argument
+    else
+       ! have to read from file
+       print *, "To be implemented: read sizes from file 1"
+       call exit(2)
+    endif
+end subroutine determineLocalSize
+
+!!***************************
+subroutine determineGlobalSize()
+    use genarray_comm
+    implicit none
+    if (common_size) then
+        gndx = npx * ndx
+        gndy = npy * ndy
+        gndz = npz * ndz
+    else
+       ! have to read from file
+       print *, "To be implemented: read sizes from file 2"
+       call exit(2)
+    endif
+end subroutine determineGlobalSize
+
+!!***************************
+subroutine determineOffsets()
+    use genarray_comm
+    implicit none
+    integer :: posx, posy, posz ! position index in the array
+    if (common_size) then
+        posx = mod(rank, npx)     ! 1st dim easy: 0, npx, 2npx... are in the same X position
+        posy = mod(rank/npx, npy) ! 2nd dim: (0, npx-1) have the same dim (so divide with npx first)
+        posz = rank/(npx*npy)     ! 3rd dim: npx*npy processes belong into one dim
+        offx = posx * ndx
+        offy = posy * ndy
+        offz = posz * ndz
+    else
+       ! have to read from file
+       print *, "To be implemented: read sizes from file 3"
+       call exit(2)
+    endif
+end subroutine determineOffsets
+
+
+!!***************************
+subroutine generateLocalArray()
+    use genarray_comm
+    implicit none
+    integer :: i,j,k
+    allocate( double_xyz(1:ndx, 1:ndy, 1:ndz) )
+!    do k=1,ndz
+!        do j=1,ndy
+!            do i=1,ndx
+!                double_xyz(i,j,k) = 1.0d0*rank
+!            enddo
+!        enddo
+!    enddo
+end subroutine generateLocalArray
+
+
+!!***************************
+subroutine readArray()
+    use genarray_comm
+    implicit none
+    integer*8 adios_handle, adios_groupsize, adios_err
+    include 'mpif.h'
+
+    call MPI_BARRIER(MPI_COMM_WORLD,adios_err)
+    cache_start_time = MPI_WTIME()
+
+    group = "genarray"
+    call adios_open (adios_handle, group, inputfile, "r", group_comm, adios_err)
+#include "gread_genarray.fh"
+    call MPI_BARRIER(MPI_COMM_WORLD,adios_err)
+    cache_end_time = MPI_WTIME()
+    cache_total_time = cache_end_time - cache_start_time
+
+    sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB
+    gbs = sz/cache_total_time
+
+    !if (rank==0) write(6,*) total_time
+    if (rank==0) print '("Reading: ",a10,d12.2,2x,d12.2,2x,d12.3)', inputfile,sz,cache_total_time,gbs
+
+    call adios_close (adios_handle, adios_err)
+
+
+end subroutine readArray
+
+!!***************************
+subroutine writeArray()
+    use genarray_comm
+    implicit none
+    integer*8 adios_handle, adios_groupsize, adios_err
+    include 'mpif.h'
+
+    call MPI_BARRIER(MPI_COMM_WORLD,adios_err)
+    cache_start_time = MPI_WTIME()
+
+    group = "genarray"
+    call adios_open (adios_handle, group, outputfile, "w", group_comm, adios_err)
+#include "gwrite_genarray.fh"
+    call MPI_BARRIER(MPI_COMM_WORLD,adios_err)
+    cache_end_time = MPI_WTIME()
+    cache_total_time = cache_end_time - cache_start_time
+
+    sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB
+    gbs = sz/cache_total_time
+
+    !if (rank==0) write(6,*) total_time
+    if (rank==0) print '("Writing: ",a10,d12.2,2x,d12.2,2x,d12.3)', outputfile,sz,cache_total_time,gbs
+
+    call adios_start_calculation(adios_err)
+    call adios_end_iteration(adios_err)
+    call adios_stop_calculation(adios_err)
+
+    call adios_close (adios_handle, adios_err)
+
+
+end subroutine writeArray
+
+
+!!***************************
+subroutine usage()
+    print *, "Usage: genarray  input output N  M  K nx  ny  nz"
+    print *, "infile: name of input file (file to be copied)"
+    print *, "output: name of output file"
+    print *, "N:      number of processes in X dimension"
+    print *, "M:      number of processes in Y dimension"
+    print *, "K:      number of processes in Z dimension"
+    print *, "nx:     local array size in X dimension per processor"
+    print *, "ny:     local array size in Y dimension per processor"
+    print *, "nz:     local array size in Z dimension per processor"
+end subroutine usage
+
+!!***************************
+subroutine processArgs()
+    use genarray_comm
+
+#ifndef __GFORTRAN__
+#ifndef __GNUC__
+    interface
+         integer function iargc()
+         end function iargc
+    end interface
+#endif
+#endif
+
+    character(len=256) :: npx_str, npy_str, npz_str, ndx_str, ndy_str, ndz_str
+    integer :: numargs
+
+    !! process arguments
+    numargs = iargc()
+    !print *,"Number of arguments:",numargs
+    if ( numargs < 8 ) then
+        call usage()
+        call exit(1)
+    endif
+    call getarg(1, inputfile)
+    call getarg(2, outputfile)
+    call getarg(3, npx_str)
+    call getarg(4, npy_str)
+    call getarg(5, npz_str)
+    call getarg(6, ndx_str)
+    call getarg(7, ndy_str)
+    call getarg(8, ndz_str)
+    read (npx_str,'(i5)') npx
+    read (npy_str,'(i5)') npy
+    read (npz_str,'(i5)') npz
+    read (ndx_str,'(i6)') ndx
+    read (ndy_str,'(i6)') ndy
+    read (ndz_str,'(i6)') ndz
+    common_size = .true.
+
+end subroutine processArgs
diff --git a/tests/genarray/copyarray2D.F90 b/tests/genarray/copyarray2D.F90
new file mode 100644
index 0000000..1b41483
--- /dev/null
+++ b/tests/genarray/copyarray2D.F90
@@ -0,0 +1,374 @@
+!
+!  ADIOS is freely available under the terms of the BSD license described
+!  in the COPYING file in the top level directory of this source distribution.
+!
+!  Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+!
+
+!
+!  COPYARRAY
+!
+!  Write an ADIOS BP file from many processor for test purposes.
+!
+!  nx * ny     processes write a 2D array, where each process writes an
+!  ndx * ndy   piece with filling with some values as integer (4 bytes) value
+!
+!  Block written from rank R:
+!      R*ndx        ... R*ndx
+!      R*ndx+1      ... R*ndx+1
+!      ...          ...
+!      R*ndx+ndy-1      R*ndx+ndy-1
+!
+! E.g 2x2 processes writing 2x2 blocks:
+!     0 0 | 2 2        0 1 | 2 3
+!     1 1 | 3 3        4 5 | 6 7
+!     ----+----   or  -----+----
+!     4 4 | 6 6        8 9 | 10 11
+!     5 5 | 7 7       12 13| 14 15
+!
+! (c) Oak Ridge National Laboratory, 2009
+! Author: Norbert Podhorszki
+!
+module genarray2D_comm
+    ! arguments
+    character(len=256) :: outputfile, inputfile
+    integer :: npx, npy    ! # of processors in x-y direction
+    integer :: ndx, ndy    ! size of array per processor
+    integer :: timesteps   ! number of timesteps to write
+    logical :: common_size ! .true.  if common local sizes are given as argument
+                           ! .false. if we have to read sizes from a file
+
+    integer :: gndx, gndy  ! size of the global array
+    integer :: posx, posy  ! position index in the array
+    integer :: offx, offy  ! offsets of local array in the global array
+
+    integer, dimension(:,:), allocatable :: int_xy
+
+    ! MPI variables
+    integer :: group_comm
+    integer :: rank, nproc
+    integer :: ierr
+
+    ! ADIOS variables
+    character (len=200) :: group
+    character (len=200) :: filename
+    !character (len=6)   :: nprocstr
+    integer*8 :: handle, total_size, group_size, adios_totalsize, adios_buf_size
+    integer   :: err
+
+    real*8 :: start_time, end_time, total_time,gbs,sz
+    real*8 :: cache_start_time, cache_end_time, cache_total_time
+
+end module genarray2D_comm
+
+
+program genarray
+    use genarray2D_comm
+    implicit none
+    include 'mpif.h'
+
+    call MPI_Init (ierr)
+    call MPI_Comm_dup (MPI_COMM_WORLD, group_comm, ierr)
+    call MPI_Comm_rank (MPI_COMM_WORLD, rank, ierr)
+    call MPI_Comm_size (group_comm, nproc , ierr)
+
+    call adios_init ("genarray.xml", ierr)
+    !call MPI_Barrier (group_comm, ierr)
+
+    call processArgs()
+    if (rank == 0) then
+        print *,"Output file: "//trim(outputfile)
+        print '(" Process number        : ",i0," x ",i0)', npx,npy
+        if (common_size) then
+            print '(" Array size per process: ",i0," x ",i0)', ndx,ndy
+        else
+            print *," Array sizes per processes taken from file: "//trim(inputfile)
+        endif
+
+        if (nproc .ne. npx*npy) then
+            print '(" Error: Number of processors ",i0,"does not match ndx*ndy=",i0)', nproc, npx*npy
+            call exit(1)
+        endif
+    endif
+
+    !write (*,*) 'rank ', rank, "init completed"
+    !write (nprocstr,'(i0)') nproc
+
+    call determineLocalSize()
+    call determineGlobalSize()
+    call determineOffsets()
+    call generateLocalArray()
+
+    call MPI_BARRIER(MPI_COMM_WORLD,err)
+    start_time = MPI_WTIME()
+    call readArray()
+    call MPI_BARRIER(MPI_COMM_WORLD,err)
+    end_time = MPI_WTIME()
+    total_time = end_time - start_time
+    sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB
+    gbs = sz/total_time
+
+    !if (rank==0) write(6,*) total_time
+    if (rank==0) write(6,'(a10,d12.2,2x,d12.2,2x,d12.3)') outputfile,sz,total_time,gbs
+
+    call MPI_BARRIER(MPI_COMM_WORLD,err)
+    start_time = MPI_WTIME()
+    call writeArray()
+    call MPI_BARRIER(MPI_COMM_WORLD,err)
+    end_time = MPI_WTIME()
+    total_time = end_time - start_time
+    sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB
+    gbs = sz/total_time
+
+    !if (rank==0) write(6,*) total_time
+    if (rank==0) write(6,'(a10,d12.2,2x,d12.2,2x,d12.3)') outputfile,sz,total_time,gbs
+
+    ! Terminate
+    call MPI_Barrier (MPI_COMM_WORLD, ierr)
+    call adios_finalize (rank, ierr)
+    call MPI_Finalize (ierr)
+end program genarray
+
+
+!!***************************
+subroutine determineLocalSize()
+    use genarray2D_comm
+    implicit none
+    if (common_size) then
+       ! we are done since we know them from argument
+    else
+       ! have to read from file
+       print *, "To be implemented: read sizes from file 1"
+       call exit(2)
+    endif
+end subroutine determineLocalSize
+
+!!***************************
+subroutine determineGlobalSize()
+    use genarray2D_comm
+    implicit none
+    if (common_size) then
+        gndx = npx * ndx
+        gndy = npy * ndy
+    else
+       ! have to read from file
+       print *, "To be implemented: read sizes from file 2"
+       call exit(2)
+    endif
+end subroutine determineGlobalSize
+
+!!***************************
+subroutine determineOffsets()
+    use genarray2D_comm
+    implicit none
+    if (common_size) then
+        posx = mod(rank, npx)     ! 1st dim easy: 0, npx, 2npx... are in the same X position
+        posy = rank/npx           ! 2nd dim: npx processes belong into one dim
+        offx = posx * ndx
+        offy = posy * ndy
+!        print '("rank=",i0," pos: ",i0,",",i0," offset: ",i0,",",i0)',  &
+!                rank, posx, posy, offx, offy
+    else
+       ! have to read from file
+       print *, "To be implemented: read sizes from file 2"
+       call exit(2)
+    endif
+end subroutine determineOffsets
+
+
+!!***************************
+subroutine generateLocalArray()
+    use genarray2D_comm
+    implicit none
+    integer :: i,j,k, startv
+    allocate( int_xy(1:ndx, 1:ndy) )
+!    do j=1,ndy
+!        startv = (offy+j-1)*gndx + offx
+!        do i=1,ndx
+!            !int_xy(i,j) =  startv+i-1
+!            !int_xy(i,j) = rank*ndx+j-1
+!            int_xy(i,j) = rank
+!        enddo
+!    enddo
+end subroutine generateLocalArray
+
+
+!!***************************
+subroutine readArray()
+    use genarray2D_comm
+    implicit none
+    integer :: tstep
+    character(2) :: mode = "r"
+    integer*8 adios_err
+    include 'mpif.h'
+
+    ! Write out data using ADIOS
+    group = "genarray"
+    !  calculate how much we write from this processor
+    group_size = 4 * 9               + &  ! X,Y, nproc, all size_ and offs_ integers
+                 4 * ndx * ndy       + &  ! int_xy
+                 4 * ndx * ndy            ! int_xyt
+
+    adios_totalsize = group_size
+
+    call MPI_BARRIER(MPI_COMM_WORLD,adios_err)
+    cache_start_time = MPI_WTIME()
+
+    call adios_open (handle, group, inputfile, mode, group_comm, err)
+    call adios_group_size (handle, group_size, total_size, err)
+    !print '("rank=",i0," total_size=",i0," err=",i0)', rank, total_size, err
+
+    ! write dimensions and nproc
+    adios_buf_size = 4
+    call adios_read (handle, "X", gndx, adios_buf_size, err)
+    adios_buf_size = 4
+    call adios_read (handle, "Y", gndy, adios_buf_size, err)
+    adios_buf_size = 4
+    call adios_read (handle, "npx", npx, adios_buf_size, err)
+    adios_buf_size = 4
+    call adios_read (handle, "npy", npy, adios_buf_size, err)
+    adios_buf_size = 4
+    call adios_read (handle, "nproc", nproc, adios_buf_size, err)
+
+    adios_buf_size = 4
+    call adios_read (handle, "size_x", ndx, adios_buf_size, err)
+    adios_buf_size = 4
+    call adios_read (handle, "size_y", ndy, adios_buf_size, err)
+    adios_buf_size = 4
+    call adios_read (handle, "offs_x", offx, adios_buf_size, err)
+    adios_buf_size = 4
+    call adios_read (handle, "offs_y", offy, adios_buf_size, err)
+
+    adios_buf_size = 4 * ndx * ndy
+    call adios_read (handle, "int_xy", int_xy, adios_buf_size, err)
+    adios_buf_size = 4 * ndx * ndy
+    call adios_read (handle, "int_xyt", int_xy, adios_buf_size, err)
+
+    call MPI_BARRIER(MPI_COMM_WORLD,adios_err)
+    cache_end_time = MPI_WTIME()
+    cache_total_time = cache_end_time - cache_start_time
+
+    sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB
+    gbs = sz/cache_total_time
+
+    !if (rank==0) write(6,*) total_time
+    if (rank==0) print '("Reading: ",a10,d12.2,2x,d12.2,2x,d12.3)', outputfile,sz,cache_total_time,gbs
+
+    ! start streaming from buffer to disk
+    call adios_close (handle, err)
+    print '("rank=",i0,": write completed")', rank
+end subroutine readArray
+
+!!***************************
+subroutine writeArray()
+    use genarray2D_comm
+    implicit none
+    integer :: tstep
+    character(2) :: mode = "w"
+    integer*8 adios_err
+    include 'mpif.h'
+
+    ! Write out data using ADIOS
+    group = "genarray"
+    !  calculate how much we write from this processor
+    group_size = 4 * 9               + &  ! X,Y, nproc, all size_ and offs_ integers
+                 4 * ndx * ndy       + &  ! int_xy
+                 4 * ndx * ndy            ! int_xyt
+
+    adios_totalsize = group_size
+
+    do tstep=1,timesteps
+        if (tstep > 1) mode = "a"
+        !print '("rank=",i0," group=",A," file=",A," group_size=",i0)', rank, trim(group), &
+        !    trim(outputfile), group_size
+
+        call MPI_BARRIER(MPI_COMM_WORLD,adios_err)
+        cache_start_time = MPI_WTIME()
+
+        call adios_open (handle, group, outputfile, mode, group_comm, err)
+        call adios_group_size (handle, group_size, total_size, err)
+        !print '("rank=",i0," total_size=",i0," err=",i0)', rank, total_size, err
+
+        ! write dimensions and nproc
+        call adios_write (handle, "X", gndx, err)
+        call adios_write (handle, "Y", gndy, err)
+        call adios_write (handle, "npx", npx, err)
+        call adios_write (handle, "npy", npy, err)
+        call adios_write (handle, "nproc", nproc, err)
+
+        call adios_write (handle, "size_x", ndx, err)
+        call adios_write (handle, "size_y", ndy, err)
+        call adios_write (handle, "offs_x", offx, err)
+        call adios_write (handle, "offs_y", offy, err)
+
+        if (tstep == 1) then
+            call adios_write (handle, "int_xy", int_xy, err)
+        endif
+        call adios_write (handle, "int_xyt", int_xy, err)
+
+        call MPI_BARRIER(MPI_COMM_WORLD,adios_err)
+        cache_end_time = MPI_WTIME()
+        cache_total_time = cache_end_time - cache_start_time
+
+        sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB
+        gbs = sz/cache_total_time
+
+        !if (rank==0) write(6,*) total_time
+        if (rank==0) print '("Writing: ",a10,d12.2,2x,d12.2,2x,d12.3)', outputfile,sz,cache_total_time,gbs
+
+        ! start streaming from buffer to disk
+        call adios_close (handle, err)
+!        print '("rank=",i0,": write completed")', rank
+    enddo
+end subroutine writeArray
+
+!!***************************
+subroutine usage()
+    print *, "Usage: genarray input output N  M [nx  ny | infile] timesteps"
+    print *, "input:  name of input file"
+    print *, "output: name of output file"
+    print *, "N:      number of processes in X dimension"
+    print *, "M:      number of processes in Y dimension"
+    print *, "nx:     local array size in X dimension per processor"
+    print *, "ny:     local array size in Y dimension per processor"
+    print *, "timesteps: number of time steps to write"
+end subroutine usage
+
+!!***************************
+subroutine processArgs()
+    use genarray2D_comm
+
+#ifndef __GFORTRAN__
+#ifndef __GNUC__
+    interface
+         integer function iargc()
+         end function iargc
+    end interface
+#endif
+#endif
+
+    character(len=256) :: npx_str, npy_str, ndx_str, ndy_str, time_str
+    integer :: numargs
+
+    !! process arguments
+    numargs = iargc()
+    !print *,"Number of arguments:",numargs
+    if ( numargs < 7 ) then
+        call usage()
+        call exit(1)
+    endif
+    call getarg(1, inputfile)
+    call getarg(2, outputfile)
+    call getarg(3, npx_str)
+    call getarg(4, npy_str)
+    call getarg(5, ndx_str)
+    call getarg(6, ndy_str)
+    call getarg(7, time_str)
+    read (npx_str,'(i5)') npx
+    read (npy_str,'(i5)') npy
+    read (ndx_str,'(i6)') ndx
+    read (ndy_str,'(i6)') ndy
+    read (time_str,'(i6)') timesteps
+    common_size = .true.
+
+end subroutine processArgs
diff --git a/tests/genarray/genarray.F90 b/tests/genarray/genarray.F90
new file mode 100644
index 0000000..d2a5c89
--- /dev/null
+++ b/tests/genarray/genarray.F90
@@ -0,0 +1,270 @@
+!
+!  ADIOS is freely available under the terms of the BSD license described
+!  in the COPYING file in the top level directory of this source distribution.
+!
+!  Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+!
+
+!
+!  GENARRAY
+!
+!  Write an ADIOS BP file from many processor for test purposes.
+!
+!  nx * ny * nz     processes write a 3D array, where each process writes an
+!  ndx * ndy * ndz  piece with filling with its rank as integer (4 bytes) value
+!
+!
+! (c) Oak Ridge National Laboratory, 2009
+! Author: Norbert Podhorszki
+!
+module genarray_comm
+    ! arguments
+    character(len=256) :: outputfile, inputfile
+    integer :: npx, npy, npz  ! # of processors in x-y-z direction
+    integer :: ndx, ndy, ndz  ! size of array per processor
+    logical :: common_size    ! .true.  if common local sizes are given as argument
+                              ! .false. if we have to read sizes from a file
+
+    integer :: gndx, gndy, gndz  ! size of the global array
+    integer :: offx,offy,offz    ! offsets of local array in the global array
+
+    real*8, dimension(:,:,:), allocatable :: double_xyz
+
+    ! MPI variables
+    integer :: group_comm
+    integer :: rank, nproc
+    integer :: ierr
+
+    ! ADIOS variables
+    character (len=200) :: group
+    character (len=200) :: filename
+    !character (len=6)   :: nprocstr
+    integer*8 :: handle, total_size, group_size, adios_totalsize
+    integer   :: err
+
+    real*8 :: start_time, end_time, total_time,gbs,sz
+    real*8 :: cache_start_time, cache_end_time, cache_total_time
+
+
+end module genarray_comm
+
+
+program genarray
+    use genarray_comm
+    implicit none
+    include 'mpif.h'
+
+    call MPI_Init (ierr)
+    call MPI_Comm_dup (MPI_COMM_WORLD, group_comm, ierr)
+    call MPI_Comm_rank (MPI_COMM_WORLD, rank, ierr)
+    call MPI_Comm_size (group_comm, nproc , ierr)
+
+    call adios_init ("genarray3d.xml", ierr)
+    !call MPI_Barrier (group_comm, ierr)
+
+    call processArgs()
+    if (rank == 0) then
+        print *,"Output file: "//trim(outputfile)
+        print '(" Process number        : ",i0," x ",i0," x ",i0)', npx,npy,npz
+        if (common_size) then
+            print '(" Array size per process: ",i0," x ",i0," x ",i0)', ndx,ndy,ndz
+        else
+            print *," Array sizes per processes taken from file: "//trim(inputfile)
+        endif
+
+        if (nproc .ne. npx*npy*npz) then
+            print '(" Error: Number of processors ",i0,"does not match ndx*ndy*ndz=",i0)', nproc, npx*npy*npz
+            call exit(1)
+        endif
+    endif
+
+    !write (*,*) 'rank ', rank, "init completed"
+    !write (nprocstr,'(i0)') nproc
+
+    call determineLocalSize()
+    call determineGlobalSize()
+    call determineOffsets()
+    call generateLocalArray()
+
+    call MPI_BARRIER(MPI_COMM_WORLD,err)
+    start_time = MPI_WTIME()
+    call writeArray()
+    call MPI_BARRIER(MPI_COMM_WORLD,err)
+    end_time = MPI_WTIME()
+    total_time = end_time - start_time
+
+    sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB
+    gbs = sz/total_time
+
+    !if (rank==0) write(6,*) total_time
+    if (rank==0) write(6,'(a10,d12.2,2x,d12.2,2x,d12.3)') outputfile,sz,total_time,gbs
+
+    ! Terminate
+    call MPI_Barrier (MPI_COMM_WORLD, ierr)
+    call adios_finalize (rank, ierr)
+    call MPI_Finalize (ierr)
+end program genarray
+
+
+!!***************************
+subroutine determineLocalSize()
+    use genarray_comm
+    implicit none
+    if (common_size) then
+       ! we are done since we know them from argument
+    else
+       ! have to read from file
+       print *, "To be implemented: read sizes from file 1"
+       call exit(2)
+    endif
+end subroutine determineLocalSize
+
+!!***************************
+subroutine determineGlobalSize()
+    use genarray_comm
+    implicit none
+    if (common_size) then
+        gndx = npx * ndx
+        gndy = npy * ndy
+        gndz = npz * ndz
+    else
+       ! have to read from file
+       print *, "To be implemented: read sizes from file 2"
+       call exit(2)
+    endif
+end subroutine determineGlobalSize
+
+!!***************************
+subroutine determineOffsets()
+    use genarray_comm
+    implicit none
+    integer :: posx, posy, posz ! position index in the array
+    if (common_size) then
+        posx = mod(rank, npx)     ! 1st dim easy: 0, npx, 2npx... are in the same X position
+        posy = mod(rank/npx, npy) ! 2nd dim: (0, npx-1) have the same dim (so divide with npx first)
+        posz = rank/(npx*npy)     ! 3rd dim: npx*npy processes belong into one dim
+        offx = posx * ndx
+        offy = posy * ndy
+        offz = posz * ndz
+    else
+       ! have to read from file
+       print *, "To be implemented: read sizes from file 3"
+       call exit(2)
+    endif
+end subroutine determineOffsets
+
+
+!!***************************
+subroutine generateLocalArray()
+    use genarray_comm
+    implicit none
+    integer :: i,j,k
+    allocate( double_xyz(1:ndx, 1:ndy, 1:ndz) )
+    do k=1,ndz
+        do j=1,ndy
+            do i=1,ndx
+                double_xyz(i,j,k) = 1.0d0*rank
+            enddo
+        enddo
+    enddo
+end subroutine generateLocalArray
+
+
+!!***************************
+subroutine writeArray()
+    use genarray_comm
+    implicit none
+    integer*8 adios_handle, adios_groupsize
+    integer adios_err
+    include 'mpif.h'
+
+    call MPI_BARRIER(MPI_COMM_WORLD,adios_err)
+    cache_start_time = MPI_WTIME()
+
+    group = "genarray"
+    call adios_open (adios_handle, group, outputfile, "w", group_comm, adios_err)
+#include "gwrite_genarray.fh"
+    call MPI_BARRIER(MPI_COMM_WORLD,adios_err)
+    cache_end_time = MPI_WTIME()
+    cache_total_time = cache_end_time - cache_start_time
+
+    sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB
+    gbs = sz/cache_total_time
+
+    !if (rank==0) write(6,*) total_time
+    if (rank==0) print '("Writing: ",a10,d12.2,2x,d12.2,2x,d12.3)', outputfile,sz,cache_total_time,gbs
+
+    call adios_start_calculation(adios_err)
+    call adios_end_iteration(adios_err)
+    call adios_stop_calculation(adios_err)
+
+    call adios_close (adios_handle, adios_err)
+
+
+end subroutine writeArray
+
+
+!!***************************
+subroutine usage()
+    print *, "Usage: genarray  output N  M  K  [nx  ny  nz | infile]"
+    print *, "output: name of output file"
+    print *, "N:      number of processes in X dimension"
+    print *, "M:      number of processes in Y dimension"
+    print *, "K:      number of processes in Z dimension"
+    print *, "nx:     local array size in X dimension per processor"
+    print *, "ny:     local array size in Y dimension per processor"
+    print *, "nz:     local array size in Z dimension per processor"
+    print *, "infile: file that describes nx ny nz for each processor"
+end subroutine usage
+
+!!***************************
+subroutine processArgs()
+    use genarray_comm
+
+#ifndef __GFORTRAN__
+#ifndef __GNUC__
+    interface
+         integer function iargc()
+         end function iargc
+    end interface
+#endif
+#endif
+
+    character(len=256) :: npx_str, npy_str, npz_str, ndx_str, ndy_str, ndz_str
+    integer :: numargs
+
+    !! process arguments
+    numargs = iargc()
+    !print *,"Number of arguments:",numargs
+    if ( numargs < 5 ) then
+        call usage()
+        call exit(1)
+    endif
+    call getarg(1, outputfile)
+    call getarg(2, npx_str)
+    call getarg(3, npy_str)
+    call getarg(4, npz_str)
+    read (npx_str,'(i5)') npx
+    read (npy_str,'(i5)') npy
+    read (npz_str,'(i5)') npz
+    if ( numargs == 5 ) then
+        call getarg(5, inputfile)
+        ndx = 0
+        ndy = 0
+        ndz = 0
+        common_size = .false.
+    else if (numargs == 7) then
+        call getarg(5, ndx_str)
+        call getarg(6, ndy_str)
+        call getarg(7, ndz_str)
+        read (ndx_str,'(i6)') ndx
+        read (ndy_str,'(i6)') ndy
+        read (ndz_str,'(i6)') ndz
+        inputfile=char(0)
+        common_size = .true.
+    else
+        call usage()
+        call exit(1)
+    endif
+
+end subroutine processArgs
diff --git a/tests/genarray/genarray.xml b/tests/genarray/genarray.xml
new file mode 100644
index 0000000..d7ef468
--- /dev/null
+++ b/tests/genarray/genarray.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<adios-config host-language="Fortran">
+  <adios-group name="genarray" coordination-communicator="group_comm" time-index="steps">
+    <var name="X" path="/dimensions" type="integer"/>
+    <var name="Y" path="/dimensions" type="integer"/>
+    <var name="Z" path="/dimensions" type="integer"/>
+
+    <var name="nproc" path="/info" type="integer"/>
+    <attribute name="description" path="/info/nproc" value="Number of writers"/>
+    <var name="npx" path="/info" type="integer"/>
+    <attribute name="description" path="/info/npx" value="Number of processors in x dimension"/>
+    <var name="npy" path="/info" type="integer"/>
+    <attribute name="description" path="/info/npy" value="Number of processors in y dimension"/>
+    <var name="npz" path="/info" type="integer"/>
+    <attribute name="description" path="/info/npz" value="Number of processors in z dimension"/>
+
+
+    <!-- Auxiliary variables for global array indexing -->
+    <var name="offs_x" path="/aux" type="integer"/>
+    <var name="offs_y" path="/aux" type="integer"/>
+    <var name="offs_z" path="/aux" type="integer"/>
+    <var name="size_x" path="/aux" type="integer"/>
+    <var name="size_y" path="/aux" type="integer"/>
+    <var name="size_z" path="/aux" type="integer"/>
+
+    <!-- 2D array written by genarray2D with 1 timesteps OR 
+         3D array written by genarray2D with multiple timesteps -->
+    <global-bounds dimensions="X,Y" offsets="offs_x,offs_y">
+        <var name="int_xy" path="/var" type="integer" dimensions="size_x,size_y"/>
+        <var name="int_xyt" path="/var" type="integer" dimensions="size_x,size_y,steps"/>
+    </global-bounds>
+    <attribute name="description" path="/var/int_xy" 
+               value="2D array with 2D decomposition"/>
+    <attribute name="description" path="/var/int_xyt" 
+               value="3D array with 2D decomposition with time in 3rd dimension"/>
+
+    <!-- 3D array written by genarray with 1 timesteps -->
+    <global-bounds dimensions="X,Y,Z" offsets="offs_x,offs_y,offs_z">
+        <var name="int_xyz" path="/var" type="integer" dimensions="size_x,size_y,size_z"/>
+    </global-bounds>
+    <attribute name="description" path="/var/int_xyz" 
+               value="3D array with 3D decomposition"/>
+
+
+  </adios-group>
+
+  <method group="genarray" method="MPI"/>
+
+  <buffer size-MB="400" allocate-time="now"/>
+
+</adios-config>
diff --git a/tests/genarray/genarray2D.F90 b/tests/genarray/genarray2D.F90
new file mode 100644
index 0000000..f93df9e
--- /dev/null
+++ b/tests/genarray/genarray2D.F90
@@ -0,0 +1,309 @@
+!
+!  ADIOS is freely available under the terms of the BSD license described
+!  in the COPYING file in the top level directory of this source distribution.
+!
+!  Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+!
+
+!
+!  GENARRAY
+!
+!  Write an ADIOS BP file from many processor for test purposes.
+!
+!  nx * ny     processes write a 2D array, where each process writes an
+!  ndx * ndy   piece with filling with some values as integer (4 bytes) value
+!
+!  Block written from rank R:
+!      R*ndx        ... R*ndx
+!      R*ndx+1      ... R*ndx+1
+!      ...          ...
+!      R*ndx+ndy-1      R*ndx+ndy-1
+!
+! E.g 2x2 processes writing 2x2 blocks:
+!     0 0 | 2 2        0 1 | 2 3
+!     1 1 | 3 3        4 5 | 6 7
+!     ----+----   or  -----+----
+!     4 4 | 6 6        8 9 | 10 11
+!     5 5 | 7 7       12 13| 14 15
+!
+! (c) Oak Ridge National Laboratory, 2009
+! Author: Norbert Podhorszki
+!
+module genarray2D_comm
+    ! arguments
+    character(len=256) :: outputfile, inputfile
+    integer :: npx, npy    ! # of processors in x-y direction
+    integer :: ndx, ndy    ! size of array per processor
+    integer :: timesteps   ! number of timesteps to write
+    logical :: common_size ! .true.  if common local sizes are given as argument
+                           ! .false. if we have to read sizes from a file
+
+    integer :: gndx, gndy  ! size of the global array
+    integer :: posx, posy  ! position index in the array
+    integer :: offx, offy  ! offsets of local array in the global array
+
+    integer, dimension(:,:), allocatable :: int_xy
+
+    ! MPI variables
+    integer :: group_comm
+    integer :: rank, nproc
+    integer :: ierr
+
+    ! ADIOS variables
+    character (len=200) :: group
+    character (len=200) :: filename
+    !character (len=6)   :: nprocstr
+    integer*8 :: handle, total_size, group_size, adios_totalsize
+    integer   :: err
+
+    real*8 :: start_time, end_time, total_time,gbs,sz
+    real*8 :: cache_start_time, cache_end_time, cache_total_time
+
+end module genarray2D_comm
+
+
+program genarray
+    use genarray2D_comm
+    implicit none
+    include 'mpif.h'
+
+    call MPI_Init (ierr)
+    call MPI_Comm_dup (MPI_COMM_WORLD, group_comm, ierr)
+    call MPI_Comm_rank (MPI_COMM_WORLD, rank, ierr)
+    call MPI_Comm_size (group_comm, nproc , ierr)
+
+    call adios_init ("genarray.xml", ierr)
+    !call MPI_Barrier (group_comm, ierr)
+
+    call processArgs()
+    if (rank == 0) then
+        print *,"Output file: "//trim(outputfile)
+        print '(" Process number        : ",i0," x ",i0)', npx,npy
+        if (common_size) then
+            print '(" Array size per process: ",i0," x ",i0)', ndx,ndy
+        else
+            print *," Array sizes per processes taken from file: "//trim(inputfile)
+        endif
+
+        if (nproc .ne. npx*npy) then
+            print '(" Error: Number of processors ",i0,"does not match ndx*ndy=",i0)', nproc, npx*npy
+            call exit(1)
+        endif
+    endif
+
+    !write (*,*) 'rank ', rank, "init completed"
+    !write (nprocstr,'(i0)') nproc
+
+    call determineLocalSize()
+    call determineGlobalSize()
+    call determineOffsets()
+    call generateLocalArray()
+
+    call MPI_BARRIER(MPI_COMM_WORLD,err)
+    start_time = MPI_WTIME()
+    call writeArray()
+    call MPI_BARRIER(MPI_COMM_WORLD,err)
+    end_time = MPI_WTIME()
+    total_time = end_time - start_time
+    sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB
+    gbs = sz/total_time
+
+    !if (rank==0) write(6,*) total_time
+    if (rank==0) write(6,'(a10,d12.2,2x,d12.2,2x,d12.3)') outputfile,sz,total_time,gbs
+
+    ! Terminate
+    call MPI_Barrier (MPI_COMM_WORLD, ierr)
+    call adios_finalize (rank, ierr)
+    call MPI_Finalize (ierr)
+end program genarray
+
+
+!!***************************
+subroutine determineLocalSize()
+    use genarray2D_comm
+    implicit none
+    if (common_size) then
+       ! we are done since we know them from argument
+    else
+       ! have to read from file
+       print *, "To be implemented: read sizes from file 1"
+       call exit(2)
+    endif
+end subroutine determineLocalSize
+
+!!***************************
+subroutine determineGlobalSize()
+    use genarray2D_comm
+    implicit none
+    if (common_size) then
+        gndx = npx * ndx
+        gndy = npy * ndy
+    else
+       ! have to read from file
+       print *, "To be implemented: read sizes from file 2"
+       call exit(2)
+    endif
+end subroutine determineGlobalSize
+
+!!***************************
+subroutine determineOffsets()
+    use genarray2D_comm
+    implicit none
+    if (common_size) then
+        posx = mod(rank, npx)     ! 1st dim easy: 0, npx, 2npx... are in the same X position
+        posy = rank/npx           ! 2nd dim: npx processes belong into one dim
+        offx = posx * ndx
+        offy = posy * ndy
+!        print '("rank=",i0," pos: ",i0,",",i0," offset: ",i0,",",i0)',  &
+!                rank, posx, posy, offx, offy
+    else
+       ! have to read from file
+       print *, "To be implemented: read sizes from file 2"
+       call exit(2)
+    endif
+end subroutine determineOffsets
+
+
+!!***************************
+subroutine generateLocalArray()
+    use genarray2D_comm
+    implicit none
+    integer :: i,j,k, startv
+    allocate( int_xy(1:ndx, 1:ndy) )
+    do j=1,ndy
+        startv = (offy+j-1)*gndx + offx
+        do i=1,ndx
+            !int_xy(i,j) =  startv+i-1
+            !int_xy(i,j) = rank*ndx+j-1
+            int_xy(i,j) = rank
+        enddo
+    enddo
+end subroutine generateLocalArray
+
+
+!!***************************
+subroutine writeArray()
+    use genarray2D_comm
+    implicit none
+    integer :: tstep
+    character(2) :: mode = "w"
+    integer*8 adios_err
+    include 'mpif.h'
+
+    ! Write out data using ADIOS
+    group = "genarray"
+    !  calculate how much we write from this processor
+    group_size = 4 * 9               + &  ! X,Y, nproc, all size_ and offs_ integers
+                 4 * ndx * ndy       + &  ! int_xy
+                 4 * ndx * ndy            ! int_xyt
+
+    adios_totalsize = group_size
+
+    do tstep=1,timesteps
+        if (tstep > 1) mode = "a"
+        !print '("rank=",i0," group=",A," file=",A," group_size=",i0)', rank, trim(group), &
+        !    trim(outputfile), group_size
+
+    call MPI_BARRIER(MPI_COMM_WORLD,adios_err)
+    cache_start_time = MPI_WTIME()
+
+        call adios_open (handle, group, outputfile, mode, group_comm, err)
+        call adios_group_size (handle, group_size, total_size, err)
+        !print '("rank=",i0," total_size=",i0," err=",i0)', rank, total_size, err
+
+        ! write dimensions and nproc
+        call adios_write (handle, "X", gndx, err)
+        call adios_write (handle, "Y", gndy, err)
+        call adios_write (handle, "npx", npx, err)
+        call adios_write (handle, "npy", npy, err)
+        call adios_write (handle, "nproc", nproc, err)
+
+        call adios_write (handle, "size_x", ndx, err)
+        call adios_write (handle, "size_y", ndy, err)
+        call adios_write (handle, "offs_x", offx, err)
+        call adios_write (handle, "offs_y", offy, err)
+
+        if (tstep == 1) then
+            call adios_write (handle, "int_xy", int_xy, err)
+        endif
+        call adios_write (handle, "int_xyt", int_xy, err)
+
+    call MPI_BARRIER(MPI_COMM_WORLD,adios_err)
+    cache_end_time = MPI_WTIME()
+    cache_total_time = cache_end_time - cache_start_time
+
+    sz = adios_totalsize * nproc/1024.d0/1024.d0/1024.d0 !size in GB
+    gbs = sz/cache_total_time
+
+    !if (rank==0) write(6,*) total_time
+    if (rank==0) print '("Writing to cache: ",a10,d12.2,2x,d12.2,2x,d12.3)', outputfile,sz,cache_total_time,gbs
+
+        ! start streaming from buffer to disk
+        call adios_close (handle, err)
+!        print '("rank=",i0,": write completed")', rank
+    enddo
+end subroutine writeArray
+
+
+!!***************************
+subroutine usage()
+    print *, "Usage: genarray  output N  M [nx  ny | infile] timesteps"
+    print *, "output: name of output file"
+    print *, "N:      number of processes in X dimension"
+    print *, "M:      number of processes in Y dimension"
+    print *, "nx:     local array size in X dimension per processor"
+    print *, "ny:     local array size in Y dimension per processor"
+    print *, "infile: file that describes nx ny for each processor"
+    print *, "timesteps: number of time steps to write"
+end subroutine usage
+
+!!***************************
+subroutine processArgs()
+    use genarray2D_comm
+
+#ifndef __GFORTRAN__
+#ifndef __GNUC__
+    interface
+         integer function iargc()
+         end function iargc
+    end interface
+#endif
+#endif
+
+    character(len=256) :: npx_str, npy_str, ndx_str, ndy_str, time_str
+    integer :: numargs
+
+    !! process arguments
+    numargs = iargc()
+    !print *,"Number of arguments:",numargs
+    if ( numargs < 5 ) then
+        call usage()
+        call exit(1)
+    endif
+    call getarg(1, outputfile)
+    call getarg(2, npx_str)
+    call getarg(3, npy_str)
+    read (npx_str,'(i5)') npx
+    read (npy_str,'(i5)') npy
+    if ( numargs == 5 ) then
+        call getarg(4, inputfile)
+        call getarg(5, time_str)
+        read (timesteps,'(i6)') time_str
+        ndx = 0
+        ndy = 0
+        common_size = .false.
+    else if (numargs == 6) then
+        call getarg(4, ndx_str)
+        call getarg(5, ndy_str)
+        call getarg(6, time_str)
+        read (ndx_str,'(i6)') ndx
+        read (ndy_str,'(i6)') ndy
+        read (time_str,'(i6)') timesteps
+        inputfile=char(0)
+        common_size = .true.
+    else
+        call usage()
+        call exit(1)
+    endif
+
+end subroutine processArgs
diff --git a/tests/genarray/genarray3d.xml b/tests/genarray/genarray3d.xml
new file mode 100644
index 0000000..cbb3d55
--- /dev/null
+++ b/tests/genarray/genarray3d.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<adios-config host-language="Fortran">
+  <adios-group name="genarray" coordination-communicator="group_comm" time-index="steps">
+    <var name="gndx" path="/dimensions" type="integer"/>
+    <var name="gndy" path="/dimensions" type="integer"/>
+    <var name="gndz" path="/dimensions" type="integer"/>
+
+    <var name="nproc" path="/info" type="integer"/>
+    <attribute name="description" path="/info/nproc" value="Number of writers"/>
+    <var name="npx" path="/info" type="integer"/>
+    <attribute name="description" path="/info/npx" value="Number of processors in x dimension"/>
+    <var name="npy" path="/info" type="integer"/>
+    <attribute name="description" path="/info/npy" value="Number of processors in y dimension"/>
+    <var name="npz" path="/info" type="integer"/>
+    <attribute name="description" path="/info/npz" value="Number of processors in z dimension"/>
+
+
+    <!-- Auxiliary variables for global array indexing -->
+    <var name="offx" path="/aux" type="integer"/>
+    <var name="offy" path="/aux" type="integer"/>
+    <var name="offz" path="/aux" type="integer"/>
+    <var name="ndx" path="/aux" type="integer"/>
+    <var name="ndy" path="/aux" type="integer"/>
+    <var name="ndz" path="/aux" type="integer"/>
+
+    <!-- 3D array written by genarray with 1 timesteps -->
+    <global-bounds dimensions="gndx,gndy,gndz" offsets="offx,offy,offz">
+        <var name="var1" gwrite="double_xyz" gread="double_xyz" path="/var" type="real*8" dimensions="ndx,ndy,ndz"/>
+        <var name="var2" gwrite="double_xyz" gread="double_xyz" path="/var" type="real*8" dimensions="ndx,ndy,ndz"/>
+        <var name="var3" gwrite="double_xyz" gread="double_xyz" path="/var" type="real*8" dimensions="ndx,ndy,ndz"/>
+        <var name="var4" gwrite="double_xyz" gread="double_xyz" path="/var" type="real*8" dimensions="ndx,ndy,ndz"/>
+        <var name="var5" gwrite="double_xyz" gread="double_xyz" path="/var" type="real*8" dimensions="ndx,ndy,ndz"/>
+        <var name="var6" gwrite="double_xyz" gread="double_xyz" path="/var" type="real*8" dimensions="ndx,ndy,ndz"/>
+        <var name="var7" gwrite="double_xyz" gread="double_xyz" path="/var" type="real*8" dimensions="ndx,ndy,ndz"/>
+        <var name="var8" gwrite="double_xyz" gread="double_xyz" path="/var" type="real*8" dimensions="ndx,ndy,ndz"/>
+        <var name="var9" gwrite="double_xyz" gread="double_xyz" path="/var" type="real*8" dimensions="ndx,ndy,ndz"/>
+    </global-bounds>
+    <attribute name="description" path="/var/double_xyz"
+               value="3D array with 3D decomposition"/>
+
+
+  </adios-group>
+
+  <method group="genarray" method="MPI"/>
+
+  <buffer size-MB="400" allocate-time="now"/>
+
+</adios-config>
diff --git a/tests/genarray/job.ewok b/tests/genarray/job.ewok
new file mode 100755
index 0000000..3c7955f
--- /dev/null
+++ b/tests/genarray/job.ewok
@@ -0,0 +1,19 @@
+#PBS -N genarray
+#PBS -A STF006
+#PBS -V
+#PBS -l nodes=32:ppn=2
+#PBS -l walltime=0:15:00
+#PBS -j eo
+
+NPX=4
+NPY=4
+NPZ=4
+NDX=100
+NDY=100
+NDZ=100
+
+cd $PBS_O_WORKDIR
+
+let "NPROC=NPX*NPY*NPZ"
+FN="g_${NPX}x${NPY}x${NPZ}_${NDX}x${NDY}x${NDZ}.bp"
+mpirun -n $NPROC ./genarray $FN $NPX $NPY $NPZ $NDX $NDY $NDZ >& genarray.out
diff --git a/tests/genarray/job2D.ewok b/tests/genarray/job2D.ewok
new file mode 100755
index 0000000..885fdc7
--- /dev/null
+++ b/tests/genarray/job2D.ewok
@@ -0,0 +1,17 @@
+#PBS -N genarray2D
+#PBS -A STF006
+#PBS -V
+#PBS -l nodes=32:ppn=2
+#PBS -l walltime=0:15:00
+#PBS -j eo
+
+NPX=8
+NPY=8
+NDX=100
+NDY=100
+
+cd $PBS_O_WORKDIR
+
+let "NPROC=NPX*NPY"
+FN="g_${NPX}x${NPY}_${NDX}x${NDY}.bp"
+mpirun -n $NPROC ./genarray2D $FN $NPX $NPY $NDX $NDY >& genarray2D.out
diff --git a/tests/suite/HOWTO-Add-new-test b/tests/suite/HOWTO-Add-new-test
new file mode 100644
index 0000000..b09c9b5
--- /dev/null
+++ b/tests/suite/HOWTO-Add-new-test
@@ -0,0 +1,45 @@
+Sequential tests
+================
+They should be put into ./programs and built/run by make check.
+Note that MPI codes cannot run on supercomputer login nodes, even if you have
+a single process (i.e. adios write API must be tested in parallel).
+
+- Put your source and extra input into ./programs
+- Edit the ./programs/Makefile.am to build your code. Follow the instructions
+  in Makefile.am
+- make check
+  will build all codes defined in check_PROGRAMS, and runs those that are 
+  defined in TESTS in the Makefile.am
+
+Parallel tests
+==============
+test.sh runs all .sh script found in ./tests, so you need to make your new 
+shell script in ./tests.
+
+The script has no arguments but a few environment variables are set:
+  MPIRUN        Run command
+  MPIRUN_NP     Run commands option to set number of processes
+  MAXPROCS      Max number of processes allowed
+  HAVE_FORTRAN  yes or no. If no, do not try to use the Fortran examples...
+  SRCDIR        Test source dir where the test.sh is executed from.
+                Your script is in $1/tests (== `dirname $0`)
+                $1/references should store the data to which you compare
+                  the test run
+                $1/programs should contain the binaries you use and are 
+                  built with "make check"
+  TRUNKDIR      ADIOS trunk dir
+                all sources, tests and examples are accessible from this dir
+
+Your parallel test program should be executed as 
+$MPIRUN $MPIRUN_NP <yourcode>
+
+The test.sh creates a ./work.testname/ subdirectory, enters it and runs your
+script from there.
+All stdout and stderr of your script goes into ../log.<testname>
+
+Your script should exit normally (exit 0) if everything is fine, and exit 1 
+on error (or any non-zero). exit 77 means skipping this test (a'la automake).
+Print useful error logs to stdout/stderr to help find the tester what went 
+wrong. 
+
+
diff --git a/tests/suite/HOWTO-Run b/tests/suite/HOWTO-Run
new file mode 100644
index 0000000..71a8513
--- /dev/null
+++ b/tests/suite/HOWTO-Run
@@ -0,0 +1,50 @@
+Run the test after compiling adios in the trunk. I.e. after "make"
+
+1. Build the codes necessary for the tests and run sequential tests, i.e. do
+   a "make check" in adios trunk.
+
+2. Run test.sh script in an interactive-job environment to run the parallel tests.
+   Define the command for running parallel programs like mpirun -np  or  aprun -q -n
+   Run the script in the job directory with full path.
+
+Usage:  <path>/`basename $0` [-m runcmd] [-n "-np"] [-p procs] [-h] [-v] [-k]
+                             [pattern [pattern2 pattern3 ...]]
+  <path>    is used to find all the test codes, inputs and reference outputs. 
+            codes and inputs will be copied to the job directory
+  pattern   if given, only those tests are executed, that match 
+            'tests/*<pattern>*.sh';  otherwise all tests are executed.
+            e.g. arguments   1[0-3] attr global   will execute all tests that
+            have any of the strings 10,11,12,13,attr or global in their name
+            (and end with .sh)
+  OPTIONS
+     -m runcmd  command to start an MPI program. Default is "aprun -q" if aprun
+                is found, otherwise "mpirun"
+     -n runopt  option to runcmd to specify number of cores. 
+                Default is "-n" for aprun, "-np" for mpirun
+     -p procs   Run only those tests that use less up to 'procs' processes. 
+                Default: 128
+     -k         Do not remove logs and work dir of successful tests.
+     -v         Verbose mode
+     -h         Print this help.
+
+Each test will have an ./work.<testname> directory to store anything needed. 
+The test's stdout and stderr is redirected into ./log.<testname> file. 
+
+E.g.
+$ qsub -I -lwalltime=1:00:00 -lsize=12
+$ cd /tmp/work/pnorbert/test/adios/suite
+$ /ccs/proj/e2e/pnorbert/ADIOS/ADIOS/trunk/tests/suite/test.sh -p 12  
+Settings:
+  Test source directory:  /ccs/proj/e2e/pnorbert/ADIOS/ADIOS/trunk/tests/suite
+  Run command:            aprun -q
+  Run command np option:  -n
+  Max. processes to use:  12
+  Keep successful tests' output: no
+
+Run tests
+  Test 01_scalars ... OK
+  Test 02_attributes ... OK
+  Test 03_arrays ... OK
+  ...
+$
+
diff --git a/tests/suite/Makefile.am b/tests/suite/Makefile.am
new file mode 100644
index 0000000..57de0ee
--- /dev/null
+++ b/tests/suite/Makefile.am
@@ -0,0 +1,7 @@
+SUBDIRS = programs 
+EXTRA_DIST = HOWTO-Add-new-test \
+             HOWTO-Run          \
+             cleanup.sh         \
+             reference/*        \
+             test.sh            \
+             tests/*
diff --git a/tests/suite/Makefile.in b/tests/suite/Makefile.in
new file mode 100644
index 0000000..ac7226a
--- /dev/null
+++ b/tests/suite/Makefile.in
@@ -0,0 +1,607 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = tests/suite
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+SUBDIRS = programs 
+EXTRA_DIST = HOWTO-Add-new-test \
+             HOWTO-Run          \
+             cleanup.sh         \
+             reference/*        \
+             test.sh            \
+             tests/*
+
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  tests/suite/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  tests/suite/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	$(mkdir_p) $(distdir)/reference $(distdir)/tests
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/suite/cleanup.sh b/tests/suite/cleanup.sh
new file mode 100755
index 0000000..624dbf5
--- /dev/null
+++ b/tests/suite/cleanup.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+#
+# Deletes all test logs and work dirs in .
+#
+
+set -v
+rm -rf log.* work.*
+
diff --git a/tests/suite/programs/Makefile.am b/tests/suite/programs/Makefile.am
new file mode 100644
index 0000000..dcd7f0b
--- /dev/null
+++ b/tests/suite/programs/Makefile.am
@@ -0,0 +1,52 @@
+# Add your codes that you want to build at 'make check'
+# Do not build Fortran codes if Fortran is not supported.
+# Do not build a code using the write API if only the read API is available
+# Steps:
+# 1. add code name below to check_readonly_C/check_C/check_readonly_Fortran/check_Fortran targets
+# 2. add code name to TESTS if it is a sequential test 
+# 3. define build rules for your code
+# 4. add files to CLEANFILES that should be deleted at 'make clean'
+# 5. add to EXTRA_DIST any non-source files that should go with the distribution
+check_readonly_C=
+if BUILD_WRITE
+check_C= 
+endif
+
+if BUILD_FORTRAN
+check_readonly_Fortran=
+if BUILD_WRITE
+check_Fortran=posix_method
+endif
+endif
+
+check_PROGRAMS=$(check_C) $(check_Fortran) $(check_readonly_C) $(check_readonly_Fortran)
+
+# Sequential tests to be executed by "make check" can be defined right here in TESTS
+# Parallel tests should be defined in ../tests/*.sh and executed by ../test.sh
+TESTS= 
+
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+#############################
+# Build rules for each test #
+#############################
+
+# posix_method
+posix_method_SOURCES=posix_method.F90
+posix_method_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD)
+posix_method_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS)
+posix_method.o: gwrite_posix_method.fh 
+gwrite_posix_method.fh: posix_method.xml
+	$(top_srcdir)/utils/gpp/gpp.py posix_method.xml
+
+
+EXTRA_DIST = posix_method.xml
+
+CLEANFILES = gwrite_posix_method.fh gread_posix_method.fh
+
+FC=$(MPIFC)
+
+FCLINK = \
+	$(LIBTOOL) --mode=link --tag F77 $(FC) \
+	$(AM_FCFLAGS) $(FCFLAGS) $(LDFLAGS) -o $@
diff --git a/tests/suite/programs/Makefile.in b/tests/suite/programs/Makefile.in
new file mode 100644
index 0000000..181e7d1
--- /dev/null
+++ b/tests/suite/programs/Makefile.in
@@ -0,0 +1,646 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_1) \
+	$(am__EXEEXT_1)
+subdir = tests/suite/programs
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__EXEEXT_1 =
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE at am__EXEEXT_2 =  \
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE@	posix_method$(EXEEXT)
+am_posix_method_OBJECTS = posix_method.$(OBJEXT)
+posix_method_OBJECTS = $(am_posix_method_OBJECTS)
+am__DEPENDENCIES_1 =
+posix_method_DEPENDENCIES = $(top_builddir)/src/libadiosf.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+PPFCCOMPILE = $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)
+LTPPFCCOMPILE = $(LIBTOOL) --mode=compile $(FC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+SOURCES = $(posix_method_SOURCES)
+DIST_SOURCES = $(posix_method_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = $(MPIFC)
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+
+# Add your codes that you want to build at 'make check'
+# Do not build Fortran codes if Fortran is not supported.
+# Do not build a code using the write API if only the read API is available
+# Steps:
+# 1. add code name below to check_readonly_C/check_C/check_readonly_Fortran/check_Fortran targets
+# 2. add code name to TESTS if it is a sequential test 
+# 3. define build rules for your code
+# 4. add files to CLEANFILES that should be deleted at 'make clean'
+# 5. add to EXTRA_DIST any non-source files that should go with the distribution
+check_readonly_C = 
+ at BUILD_WRITE_TRUE@check_C = 
+ at BUILD_FORTRAN_TRUE@check_readonly_Fortran = 
+ at BUILD_FORTRAN_TRUE@@BUILD_WRITE_TRUE at check_Fortran = posix_method
+
+# Sequential tests to be executed by "make check" can be defined right here in TESTS
+# Parallel tests should be defined in ../tests/*.sh and executed by ../test.sh
+TESTS = 
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+
+#############################
+# Build rules for each test #
+#############################
+
+# posix_method
+posix_method_SOURCES = posix_method.F90
+posix_method_LDADD = $(top_builddir)/src/libadiosf.a $(ADIOSLIB_LDADD)
+posix_method_LDFLAGS = $(AM_LDFLAGS) $(ADIOSLIB_LDFLAGS)
+EXTRA_DIST = posix_method.xml
+CLEANFILES = gwrite_posix_method.fh gread_posix_method.fh
+FCLINK = \
+	$(LIBTOOL) --mode=link --tag F77 $(FC) \
+	$(AM_FCFLAGS) $(FCFLAGS) $(LDFLAGS) -o $@
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .F90 .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  tests/suite/programs/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  tests/suite/programs/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-checkPROGRAMS:
+	@list='$(check_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+posix_method$(EXEEXT): $(posix_method_OBJECTS) $(posix_method_DEPENDENCIES) 
+	@rm -f posix_method$(EXEEXT)
+	$(FCLINK) $(posix_method_LDFLAGS) $(posix_method_OBJECTS) $(posix_method_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.F90.o:
+	$(PPFCCOMPILE) -c -o $@ $<
+
+.F90.obj:
+	$(PPFCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.F90.lo:
+	$(LTPPFCCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
+	srcdir=$(srcdir); export srcdir; \
+	list='$(TESTS)'; \
+	if test -n "$$list"; then \
+	  for tst in $$list; do \
+	    if test -f ./$$tst; then dir=./; \
+	    elif test -f $$tst; then dir=; \
+	    else dir="$(srcdir)/"; fi; \
+	    if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *" $$tst "*) \
+		xpass=`expr $$xpass + 1`; \
+		failed=`expr $$failed + 1`; \
+		echo "XPASS: $$tst"; \
+	      ;; \
+	      *) \
+		echo "PASS: $$tst"; \
+	      ;; \
+	      esac; \
+	    elif test $$? -ne 77; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *" $$tst "*) \
+		xfail=`expr $$xfail + 1`; \
+		echo "XFAIL: $$tst"; \
+	      ;; \
+	      *) \
+		failed=`expr $$failed + 1`; \
+		echo "FAIL: $$tst"; \
+	      ;; \
+	      esac; \
+	    else \
+	      skip=`expr $$skip + 1`; \
+	      echo "SKIP: $$tst"; \
+	    fi; \
+	  done; \
+	  if test "$$failed" -eq 0; then \
+	    if test "$$xfail" -eq 0; then \
+	      banner="All $$all tests passed"; \
+	    else \
+	      banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+	    fi; \
+	  else \
+	    if test "$$xpass" -eq 0; then \
+	      banner="$$failed of $$all tests failed"; \
+	    else \
+	      banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+	    fi; \
+	  fi; \
+	  dashes="$$banner"; \
+	  skipped=""; \
+	  if test "$$skip" -ne 0; then \
+	    skipped="($$skip tests were not run)"; \
+	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$skipped"; \
+	  fi; \
+	  report=""; \
+	  if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+	    report="Please report to $(PACKAGE_BUGREPORT)"; \
+	    test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$report"; \
+	  fi; \
+	  dashes=`echo "$$dashes" | sed s/./=/g`; \
+	  echo "$$dashes"; \
+	  echo "$$banner"; \
+	  test -z "$$skipped" || echo "$$skipped"; \
+	  test -z "$$report" || echo "$$report"; \
+	  echo "$$dashes"; \
+	  test "$$failed" -eq 0; \
+	else :; fi
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
+	clean-checkPROGRAMS clean-generic clean-libtool ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am
+
+posix_method.o: gwrite_posix_method.fh 
+gwrite_posix_method.fh: posix_method.xml
+	$(top_srcdir)/utils/gpp/gpp.py posix_method.xml
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/suite/programs/posix_method.F90 b/tests/suite/programs/posix_method.F90
new file mode 100644
index 0000000..a1c6ab9
--- /dev/null
+++ b/tests/suite/programs/posix_method.F90
@@ -0,0 +1,105 @@
+!  
+!  ADIOS is freely available under the terms of the BSD license described
+!  in the COPYING file in the top level directory of this source distribution.
+!
+!  Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+!
+
+!/*************************************************************/
+!/*      Test of writing of simple arrays in ADIOS with POSIX method         */
+!/*                                                           */
+!/*     Similar example is examples/Fortran/arrays/arrays_write.c     */
+!/*************************************************************/
+program posix_method
+    implicit none
+    include 'mpif.h'
+
+    character(len=30)   :: filename = "posix_method.bp"
+    integer             :: i, j, ierr
+    integer             :: rank, size, comm
+
+    ! ADIOS variables declarations for matching gwrite_temperature.fh 
+    integer                 :: adios_err
+    integer*8               :: adios_groupsize, adios_totalsize
+    integer*8               :: adios_handle, adios_buf_size
+
+    ! variables to write out 
+    integer, parameter      :: NX = 10, NY = 100
+    integer                 :: NXin, NYin
+    real*8                  :: t(NX,NY), tin(NX,NY)
+    integer                 :: p(NX), pin(NX)
+
+    call MPI_Init (ierr)
+    call MPI_Comm_dup (MPI_COMM_WORLD, comm, ierr)
+    call MPI_Comm_rank (comm, rank, ierr)
+    call MPI_Comm_size (comm, size, ierr)
+
+    do j = 1,NY 
+        do i = 1,NX
+            t(i,j) = rank*NX*NY + (j-1)*NX + i-1
+        enddo     
+    enddo
+
+    do i = 1,NX
+        p(i) = rank*NX + i
+    enddo
+
+    call adios_init ("posix_method.xml", adios_err);
+
+
+    ! Write data out
+    call adios_open (adios_handle, "posix_method", filename, "w", comm, adios_err);
+#include "gwrite_posix_method.fh"
+    call adios_close (adios_handle, adios_err)
+
+
+    ! Read data in
+    call adios_open (adios_handle, "posix_method", filename, "r", comm, adios_err);
+
+    ! First read in the scalars to calculate the size of the arrays
+    adios_buf_size = 4
+    call adios_read (adios_handle, "NX", NXin, adios_buf_size, adios_err)
+    adios_buf_size = 4
+    call adios_read (adios_handle, "NY", NYin, adios_buf_size, adios_err)
+    call adios_close (adios_handle, adios_err)
+
+    if (NX /= NXin) then
+        write (0, '("Error: NX=",i0," read from file != NX=",i0," written to file.")') NXin, NX
+        call exit(1)
+    endif
+    if (NY /= NYin) then
+        write (0, '("Error: NY=",i0," read from file != NY=",i0," written to file.")') NYin, NY
+        call exit(1)
+    endif
+
+    ! Read the arrays
+    call adios_open (adios_handle, "posix_method", filename, "r", comm, adios_err);
+    call adios_group_size (adios_handle, adios_groupsize, adios_totalsize, adios_err)
+    adios_buf_size = 8 * (NX) * (NY)
+    call adios_read (adios_handle, "var_double_2Darray", tin, adios_buf_size, adios_err)
+    adios_buf_size = 4 * (NX)
+    call adios_read (adios_handle, "var_int_1Darray", pin, adios_buf_size, adios_err)
+    call adios_close (adios_handle, adios_err)
+
+    
+    ! Check input against output
+    do i = 1,NX
+        if (p(i)-pin(i) .ge. 0.000001) then
+            write (0,'("Error: p read from file != p written to file.")')
+            call exit(1)
+        endif
+    enddo
+    do j = 1,NY 
+        do i = 1,NX
+            if (t(i,j)-tin(i,j) .ge. 0.000001 ) then
+                write (0,'("Error: t read from file != t written to file.")')
+                call exit(1)
+            endif
+        enddo     
+    enddo
+
+    call adios_finalize (0, adios_err);
+    call MPI_Finalize (ierr);
+
+end program
+
diff --git a/tests/suite/programs/posix_method.xml b/tests/suite/programs/posix_method.xml
new file mode 100644
index 0000000..7770ee0
--- /dev/null
+++ b/tests/suite/programs/posix_method.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<adios-config host-language="Fortran">
+
+    <adios-group name="posix_method">
+        <var name="NX" type="integer"/>
+        <var name="NY" type="integer"/>
+        <var name="var_double_2Darray"  gwrite="t"  type="double"  dimensions="NX,NY"/>
+        <var name="var_int_1Darray"     gwrite="p"  type="integer" dimensions="NX"/>
+    </adios-group>
+
+<method group="posix_method" method="POSIX"/>
+
+<buffer size-MB="20" allocate-time="now"/>
+
+</adios-config>
+
diff --git a/tests/suite/reference/arrays_bpls.txt b/tests/suite/reference/arrays_bpls.txt
new file mode 100644
index 0000000..abaebd2
--- /dev/null
+++ b/tests/suite/reference/arrays_bpls.txt
@@ -0,0 +1,14 @@
+File info:
+  of groups:     1
+  of variables:  4
+  of attributes: 0
+  time steps:    1 starting from 1
+  file size:     43 KB
+  bp version:    513
+  statistics:    Min / Max / Avg / Std_dev
+
+Group arrays:
+  integer    /NX                  scalar = 10 
+  integer    /NY                  scalar = 100 
+  double     /var_double_2Darray  {10, 100} = 0 / 49.99 / 24.995 / 14.4338 
+  integer    /var_int_1Darray     {10} = 0 / 49 / 24.5 / 14.4309 
diff --git a/tests/suite/reference/arrays_read.txt b/tests/suite/reference/arrays_read.txt
new file mode 100644
index 0000000..9c51b8b
--- /dev/null
+++ b/tests/suite/reference/arrays_read.txt
@@ -0,0 +1,15 @@
+rank=0: NX=10 NY=100
+rank=0: p = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+rank=0: t[5,*] = [  5.00,   5.01,   5.02,   5.03,   5.04,   5.05,   5.06,   5.07,   5.08,   5.09,   5.10,   5.11,   5.12,   5.13,   5.14,   5.15,   5.16,   5.17,   5.18,   5.19,   5.20,   5.21,   5.22,   5.23,   5.24,   5.25,   5.26,   5.27,   5.28,   5.29,   5.30,   5.31,   5.32,   5.33,   5.34,   5.35,   5.36,   5.37,   5.38,   5.39,   5.40,   5.41,   5.42,   5.43,   5.44,   5.45,   5.46,   5.47,   5.48,   5.49,   5.50,   5.51,   5.52,   5.53,   5.54,   5.55,   5.56,   5.57,   5.58,    [...]
+rank=1: NX=10 NY=100
+rank=1: p = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
+rank=1: t[5,*] = [ 15.00,  15.01,  15.02,  15.03,  15.04,  15.05,  15.06,  15.07,  15.08,  15.09,  15.10,  15.11,  15.12,  15.13,  15.14,  15.15,  15.16,  15.17,  15.18,  15.19,  15.20,  15.21,  15.22,  15.23,  15.24,  15.25,  15.26,  15.27,  15.28,  15.29,  15.30,  15.31,  15.32,  15.33,  15.34,  15.35,  15.36,  15.37,  15.38,  15.39,  15.40,  15.41,  15.42,  15.43,  15.44,  15.45,  15.46,  15.47,  15.48,  15.49,  15.50,  15.51,  15.52,  15.53,  15.54,  15.55,  15.56,  15.57,  15.58,  1 [...]
+rank=2: NX=10 NY=100
+rank=2: p = [20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
+rank=2: t[5,*] = [ 25.00,  25.01,  25.02,  25.03,  25.04,  25.05,  25.06,  25.07,  25.08,  25.09,  25.10,  25.11,  25.12,  25.13,  25.14,  25.15,  25.16,  25.17,  25.18,  25.19,  25.20,  25.21,  25.22,  25.23,  25.24,  25.25,  25.26,  25.27,  25.28,  25.29,  25.30,  25.31,  25.32,  25.33,  25.34,  25.35,  25.36,  25.37,  25.38,  25.39,  25.40,  25.41,  25.42,  25.43,  25.44,  25.45,  25.46,  25.47,  25.48,  25.49,  25.50,  25.51,  25.52,  25.53,  25.54,  25.55,  25.56,  25.57,  25.58,  2 [...]
+rank=3: NX=10 NY=100
+rank=3: p = [30, 31, 32, 33, 34, 35, 36, 37, 38, 39]
+rank=3: t[5,*] = [ 35.00,  35.01,  35.02,  35.03,  35.04,  35.05,  35.06,  35.07,  35.08,  35.09,  35.10,  35.11,  35.12,  35.13,  35.14,  35.15,  35.16,  35.17,  35.18,  35.19,  35.20,  35.21,  35.22,  35.23,  35.24,  35.25,  35.26,  35.27,  35.28,  35.29,  35.30,  35.31,  35.32,  35.33,  35.34,  35.35,  35.36,  35.37,  35.38,  35.39,  35.40,  35.41,  35.42,  35.43,  35.44,  35.45,  35.46,  35.47,  35.48,  35.49,  35.50,  35.51,  35.52,  35.53,  35.54,  35.55,  35.56,  35.57,  35.58,  3 [...]
+rank=4: NX=10 NY=100
+rank=4: p = [40, 41, 42, 43, 44, 45, 46, 47, 48, 49]
+rank=4: t[5,*] = [ 45.00,  45.01,  45.02,  45.03,  45.04,  45.05,  45.06,  45.07,  45.08,  45.09,  45.10,  45.11,  45.12,  45.13,  45.14,  45.15,  45.16,  45.17,  45.18,  45.19,  45.20,  45.21,  45.22,  45.23,  45.24,  45.25,  45.26,  45.27,  45.28,  45.29,  45.30,  45.31,  45.32,  45.33,  45.34,  45.35,  45.36,  45.37,  45.38,  45.39,  45.40,  45.41,  45.42,  45.43,  45.44,  45.45,  45.46,  45.47,  45.48,  45.49,  45.50,  45.51,  45.52,  45.53,  45.54,  45.55,  45.56,  45.57,  45.58,  4 [...]
diff --git a/tests/suite/reference/attributes_bpls.txt b/tests/suite/reference/attributes_bpls.txt
new file mode 100644
index 0000000..1844d0c
--- /dev/null
+++ b/tests/suite/reference/attributes_bpls.txt
@@ -0,0 +1,20 @@
+File info:
+  of groups:     1
+  of variables:  6
+  of attributes: 4
+  time steps:    1 starting from 1
+  file size:     6 KB
+  bp version:    513
+  statistics:    Min / Max / Avg / Std_dev
+
+Group temperature:
+  integer    /NX                            scalar = 10 
+  integer    /size                          scalar = 5 
+  integer    /rank                          scalar = 0 
+  double     /mean                          scalar = 4.5 
+  string     /date                          scalar = "Nov, 2009"
+  double     /temperature                   {5, 10} = 0 / 49 / 24.5 / 14.4309 
+  integer    /temperature/number of levels  attr   = 1 
+  string     /temperature/description       attr   = "Global array written from 'size' processes"
+  double     /temperature/mean value        attr   = 4.5 
+  string     /temperature/date of coding    attr   = "Nov, 2009"
diff --git a/tests/suite/reference/attributes_read.txt b/tests/suite/reference/attributes_read.txt
new file mode 100644
index 0000000..079200f
--- /dev/null
+++ b/tests/suite/reference/attributes_read.txt
@@ -0,0 +1,8 @@
+rank 0: attr: double /temperature/mean value = 4.500000e+00
+rank 0: attr: integer /temperature/number of levels = 1
+rank 0: attr: string /temperature/date of coding = Nov, 2009
+rank 0: attr: string /temperature/description = Global array written from 'size' processes
+rank 1: attr: double /temperature/mean value = 4.500000e+00
+rank 1: attr: integer /temperature/number of levels = 1
+rank 1: attr: string /temperature/date of coding = Nov, 2009
+rank 1: attr: string /temperature/description = Global array written from 'size' processes
diff --git a/tests/suite/reference/global_array_bpls.txt b/tests/suite/reference/global_array_bpls.txt
new file mode 100644
index 0000000..01c2012
--- /dev/null
+++ b/tests/suite/reference/global_array_bpls.txt
@@ -0,0 +1,22 @@
+File info:
+  of groups:     1
+  of variables:  4
+  of attributes: 1
+  time steps:    1 starting from 1
+  file size:     6 KB
+  bp version:    513
+  statistics:    Min / Max / Avg / Std_dev
+
+  integer    /NX                       scalar = 10 
+  integer    /size                     scalar = 7 
+  integer    /rank                     scalar = 0 
+  double     /temperature              {7, 10} = 0 / 69 / 34.5 / 20.2052 
+    (0,0)    0 1 2 3 4 5 6 7 8 9 
+    (1,0)    10 11 12 13 14 15 16 17 18 19 
+    (2,0)    20 21 22 23 24 25 26 27 28 29 
+    (3,0)    30 31 32 33 34 35 36 37 38 39 
+    (4,0)    40 41 42 43 44 45 46 47 48 49 
+    (5,0)    50 51 52 53 54 55 56 57 58 59 
+    (6,0)    60 61 62 63 64 65 66 67 68 69 
+
+  string     /temperature/description  attr   = "Global array written from 'size' processes"
diff --git a/tests/suite/reference/global_array_no_xml_bpls.txt b/tests/suite/reference/global_array_no_xml_bpls.txt
new file mode 100644
index 0000000..fbea359
--- /dev/null
+++ b/tests/suite/reference/global_array_no_xml_bpls.txt
@@ -0,0 +1,28 @@
+File info:
+  of groups:     1
+  of variables:  4
+  of attributes: 0
+  time steps:    1 starting from 1
+  file size:     7 KB
+  bp version:    513
+  statistics:    Min / Max / Avg / Std_dev
+
+  integer    /NX           scalar = 10 
+  integer    /G            scalar = 140 
+  integer    /O            scalar = 0 
+  double     /temperature  {140} = 0 / 139 / 69.5 / 40.4135 
+    (0)    0 1 2 3 4 5 6 7 8 9 
+    (10)    10 11 12 13 14 15 16 17 18 19 
+    (20)    20 21 22 23 24 25 26 27 28 29 
+    (30)    30 31 32 33 34 35 36 37 38 39 
+    (40)    40 41 42 43 44 45 46 47 48 49 
+    (50)    50 51 52 53 54 55 56 57 58 59 
+    (60)    60 61 62 63 64 65 66 67 68 69 
+    (70)    70 71 72 73 74 75 76 77 78 79 
+    (80)    80 81 82 83 84 85 86 87 88 89 
+    (90)    90 91 92 93 94 95 96 97 98 99 
+    (100)    100 101 102 103 104 105 106 107 108 109 
+    (110)    110 111 112 113 114 115 116 117 118 119 
+    (120)    120 121 122 123 124 125 126 127 128 129 
+    (130)    130 131 132 133 134 135 136 137 138 139 
+
diff --git a/tests/suite/reference/global_array_no_xml_read.txt b/tests/suite/reference/global_array_no_xml_read.txt
new file mode 100644
index 0000000..bd1f20c
--- /dev/null
+++ b/tests/suite/reference/global_array_no_xml_read.txt
@@ -0,0 +1,3 @@
+      0      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
diff --git a/tests/suite/reference/global_array_read.txt b/tests/suite/reference/global_array_read.txt
new file mode 100644
index 0000000..a4ea2fb
--- /dev/null
+++ b/tests/suite/reference/global_array_read.txt
@@ -0,0 +1,7 @@
+rank 0: [0,0:2]      0      1      2      3      4      5      6      7      8      9
+rank 0: [1,0:2]     10     11     12     13     14     15     16     17     18     19
+rank 1: [2,0:2]     20     21     22     23     24     25     26     27     28     29
+rank 1: [3,0:2]     30     31     32     33     34     35     36     37     38     39
+rank 2: [4,0:3]     40     41     42     43     44     45     46     47     48     49
+rank 2: [5,0:3]     50     51     52     53     54     55     56     57     58     59
+rank 2: [6,0:3]     60     61     62     63     64     65     66     67     68     69
diff --git a/tests/suite/reference/global_array_time_bpls.txt b/tests/suite/reference/global_array_time_bpls.txt
new file mode 100644
index 0000000..d1b5360
--- /dev/null
+++ b/tests/suite/reference/global_array_time_bpls.txt
@@ -0,0 +1,15 @@
+File info:
+  of groups:     1
+  of variables:  4
+  of attributes: 1
+  time steps:    13 starting from 1
+  file size:     104 KB
+  bp version:    513
+  statistics:    Min / Max / Avg / Std_dev
+
+Group temperature:
+  integer    /NX                       scalar = 10 
+  integer    /size                     scalar = 9 
+  integer    /rank                     scalar = 0 
+  double     /temperature              {13, 9, 10} = 100 / 1389 / 744.5 / 375.067 
+  string     /temperature/description  attr   = "Global array written from 'size' processes over several timesteps"
diff --git a/tests/suite/reference/global_array_time_read.txt b/tests/suite/reference/global_array_time_read.txt
new file mode 100644
index 0000000..7fbc41f
--- /dev/null
+++ b/tests/suite/reference/global_array_time_read.txt
@@ -0,0 +1,9 @@
+rank=0: [0,0:9,0:10] = [ [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 ] ]	
+rank=1: [1,0:9,0:10] = [ [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 ] ]	
+rank=2: [2,0:9,0:10] = [ [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 ] ]	
+rank=3: [3,0:9,0:10] = [ [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 ] ]	
+rank=4: [4,0:9,0:10] = [ [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 ] ]	
+rank=5: [5,0:9,0:10] = [ [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 ] ]	
+rank=6: [6,0:9,0:10] = [ [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 ] ]	
+rank=7: [7,0:9,0:10] = [ [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 ] ]	
+rank=8: [8,0:9,0:10] = [ [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 ] ]	
diff --git a/tests/suite/reference/scalars_read_c.txt b/tests/suite/reference/scalars_read_c.txt
new file mode 100644
index 0000000..ae64b87
--- /dev/null
+++ b/tests/suite/reference/scalars_read_c.txt
@@ -0,0 +1,13 @@
+byte        v1  = -4
+short       v2  = -3
+integer     v3  = -2
+long        v4  = -1
+uns.byte    v5  = 1
+uns.short   v6  = 2
+uns.int     v7  = 3
+uns.long    v8  = 4
+float       v9  = 5
+double      v10 = 6
+string      v11 = ADIOS example
+complex     v12 = (8, i9)
+dbl-complex v13 = (10, i11)
diff --git a/tests/suite/reference/scalars_read_f.txt b/tests/suite/reference/scalars_read_f.txt
new file mode 100644
index 0000000..a9a72f9
Binary files /dev/null and b/tests/suite/reference/scalars_read_f.txt differ
diff --git a/tests/suite/reference/scalars_write_bpls.txt b/tests/suite/reference/scalars_write_bpls.txt
new file mode 100644
index 0000000..d2d3a3e
--- /dev/null
+++ b/tests/suite/reference/scalars_write_bpls.txt
@@ -0,0 +1,23 @@
+File info:
+  of groups:     1
+  of variables:  13
+  of attributes: 0
+  time steps:    1 starting from 1
+  file size:     4 KB
+  bp version:    513
+  statistics:    Min / Max / Avg / Std_dev
+
+Group scalars:
+  byte       /var_byte            scalar = -4 
+  short      /var_short           scalar = -3 
+  integer    /var_int             scalar = -2 
+  long long  /var_long            scalar = -1 
+  unsigned byte  /var_ubyte           scalar = 1 
+  unsigned short  /var_ushort          scalar = 2 
+  unsigned integer  /var_uint            scalar = 3 
+  unsigned long long  /var_ulong           scalar = 4 
+  real       /var_real            scalar = 5 
+  double     /var_double          scalar = 6 
+  string     /var_string          scalar = "ADIOS example"
+  complex    /var_complex         scalar = (8,i9) 
+  double complex  /var_double_complex  scalar = (10,i11)
diff --git a/tests/suite/test.sh b/tests/suite/test.sh
new file mode 100755
index 0000000..c8007ce
--- /dev/null
+++ b/tests/suite/test.sh
@@ -0,0 +1,155 @@
+#!/bin/bash
+#
+# Run this script in an interactive-job environment, with 16 cores at least.
+# Define MPIRUN and NP_MPIRUN environment variables for running parallel programs
+#   like mpirun and -np  or  aprun and -n
+#
+# Run the script in the job directory with full path.
+#
+# Log output of each test can be found in ./log/
+#
+
+# default values
+XXX=`which aprun &>/dev/null`
+if [ $? == 0 ]; then
+    MPIRUN="aprun -q"
+    NP_MPIRUN=-n
+else
+    MPIRUN=mpirun
+    NP_MPIRUN=-np
+fi
+KEEPOUTPUT=no
+MAXPROCS=128
+
+function Usage() {
+    echo "
+Usage:  <path>/`basename $0` [-m runcmd] [-n "-np"] [-p procs] [-h] [-k]
+                             [pattern [pattern2 pattern3 ...]]
+  <path>    is used to find all the test codes, inputs and reference outputs. 
+            codes and inputs will be copied to the job directory
+  pattern   if given, only those tests are executed, that match 
+            'tests/*<pattern>*.sh';  otherwise all tests are executed.
+            e.g. arguments   1[0-3] attr global   will execute all tests that
+            have any of the strings 10,11,12,13,attr or global in their name
+            (and end with .sh)
+  OPTIONS
+     -m runcmd  command to start an MPI program. Default: $MPIRUN
+     -n runopt  option to runcmd to specify number of cores. Default: $NP_MPIRUN
+     -p procs   Run only those tests that use less up to 'procs' processes. 
+                Default: $MAXPROCS
+     -k         Do not remove logs and work dir of successful tests.
+     -h         Print this help.
+"
+}
+
+#####################
+# Process arguments #
+#####################
+    
+# process option arguments
+while getopts ":m:n:p:kh" Option
+do  
+  case $Option in
+        m) MPIRUN=$OPTARG;;
+        n) NP_MPIRUN=$OPTARG;;
+        p) MAXPROCS=$OPTARG;;
+        k) KEEPOUTPUT=yes;;
+        h) Usage; exit 0;;
+        *) echo "Invalid option $Option"; Usage; exit 255;;   # DEFAULT
+  esac
+done
+shift $(($OPTIND - 1))
+
+# get source path
+SRCDIR=`dirname $0`
+TRUNKDISTANCE=../..
+
+if [ "${SRCDIR:0:1}" != "/" ]; then
+    echo "WARNING: Jobs on some systems do not have access to any directory but to "
+    echo "  parallel file systems. If the tests fail because of this, run this script"
+    echo "  from a directory on the parallel file system and the script will copy the"
+    echo "  data automatically."
+    echo " "
+fi
+
+# check if Fortran codes were built
+S=`grep BUILD_FORTRAN_TRUE $SRCDIR/$TRUNKDISTANCE/Makefile`
+if [ -z ${S#BUILD_FORTRAN_TRUE = } ]; then
+    HAVE_FORTRAN=yes
+else
+    echo "WARNING: Fortran binaries are not built, so test will not use them"
+    HAVE_FORTRAN=no
+fi
+
+# Print info before running tests
+echo "Settings:"
+echo "  Test source directory:  $SRCDIR"
+echo "  Run command:            $MPIRUN"
+echo "  Run command np option:  $NP_MPIRUN"
+echo "  Max. processes to use:  $MAXPROCS"
+echo "  Keep test output:       $KEEPOUTPUT"
+
+
+# find and list tests to be executed
+TESTS=
+if [ ! -z "$1" ]; then
+    while [ ! -z "$1" ]; do
+        TESTS1=`ls $SRCDIR/tests/*$1*.sh`
+        if [ -z "$TESTS1" ]; then
+            echo "ERROR: Did not find any test with name \"$1\" in $SRCDIR/tests."
+        else
+            TESTS="$TESTS $TESTS1"
+        fi
+        shift 1
+    done
+    if [ -z "$TESTS" ]; then
+        exit 1
+    fi
+    echo "  Tests found: $TESTS"
+else
+    TESTS=`ls $SRCDIR/tests/*.sh`
+    if [ -z "$TESTS" ]; then
+        echo "ERROR: Did not find any test in $SRCDIR/tests."
+        exit 1
+    fi
+fi
+
+echo ""
+echo "Run tests"
+
+# run tests one by one
+for TESTSCRIPT in $TESTS; do
+    TEST=`basename ${TESTSCRIPT%%.sh}`
+    echo -n "  Test $TEST ... "
+    rm -rf log.$TEST work.$TEST
+    mkdir -p work.$TEST
+    pushd work.$TEST >/dev/null
+    if [ "${SRCDIR:0:1}" == "/" ]; then
+        TESTSRCDIR=$SRCDIR       
+        TRUNKDIR=$SRCDIR/$TRUNKDISTANCE
+    else
+        # we are one level deeper now
+        TESTSRCDIR=../$SRCDIR
+        TRUNKDIR=../$SRCDIR/$TRUNKDISTANCE
+        TESTSCRIPT=../$TESTSCRIPT
+    fi
+    # Run the test script with setting the environment for it
+    MPIRUN="$MPIRUN" NP_MPIRUN="$NP_MPIRUN" HAVE_FORTRAN="$HAVE_FORTRAN" SRCDIR="$TESTSRCDIR" \
+        TRUNKDIR="$TRUNKDIR" MAXPROCS="$MAXPROCS" \
+        $TESTSCRIPT &> ../log.$TEST
+    EX=$?
+    popd >/dev/null
+    if [ $EX == 0 ]; then
+        echo "OK"
+        [ "$KEEPOUTPUT" == "no" ] && rm -rf work.$TEST log.$TEST
+    elif [ $EX == 77 ];then
+        echo "SKIP. Check log.$TEST for the reason"
+        [ "$KEEPOUTPUT" == "no" ] && rm -rf work.$TEST 
+    else
+        echo "FAILED with exit code $EX. Check log.$TEST for details and work.$TEST/ for outputs."
+    fi
+done
+
+
+
+
diff --git a/tests/suite/tests/01_scalars.sh b/tests/suite/tests/01_scalars.sh
new file mode 100755
index 0000000..5e06ccd
--- /dev/null
+++ b/tests/suite/tests/01_scalars.sh
@@ -0,0 +1,101 @@
+#!/bin/bash
+#
+# Test if adios can write and read scalars correctly
+# Uses codes from examples/C/scalars and examples/Fortran/scalars 
+#
+# Environment variables set by caller:
+# MPIRUN        Run command
+# NP_MPIRUN     Run command's option to set number of processes
+# MAXPROCS      Max number of processes allowed
+# HAVE_FORTRAN  yes or no
+# SRCDIR        Test source dir (.. of this script)
+# TRUNKDIR      ADIOS trunk dir
+
+PROCS=3
+
+if [ $MAXPROCS -lt $PROCS ]; then
+    echo "WARNING: Needs $PROCS processes at least"
+    exit 77  # not failure, just skip
+fi
+
+# copy codes and inputs to . 
+cp $TRUNKDIR/examples/C/scalars/scalars_read .
+cp $TRUNKDIR/examples/C/scalars/scalars_write .
+cp $TRUNKDIR/examples/C/scalars/scalars.xml .
+
+echo "Run C scalars_write"
+echo $MPIRUN $NP_MPIRUN $PROCS ./scalars_write
+$MPIRUN $NP_MPIRUN $PROCS ./scalars_write
+EX=$?
+if [ ! -f scalars.bp ]; then
+    echo "ERROR: C version of scalars_write failed. No BP file is created. Exit code=$EX"
+    exit 1
+fi
+
+echo "Check output with bpls"
+$TRUNKDIR/utils/bpls/bpls -lav scalars.bp | grep -v endianness > c_bpls.txt
+diff -q c_bpls.txt $SRCDIR/reference/scalars_write_bpls.txt
+if [ $? != 0 ]; then
+    echo "ERROR: C version of scalars_write produced a file different from the reference."
+    echo "Compare \"bpls -lav $PWD/scalars.bp | grep -v endianness\" to reference $SRCDIR/reference/scalars_write_bpls.txt"
+    exit 1
+fi
+
+echo "Run C scalars_read"
+$MPIRUN $NP_MPIRUN $PROCS ./scalars_read > c_read.txt
+EX=$?
+if [ $? != 0 ]; then
+    echo "ERROR: C version of scalars_read failed with exit code $EX"
+    exit 1
+fi
+diff -q c_read.txt $SRCDIR/reference/scalars_read_c.txt
+if [ $? != 0 ]; then
+    echo "ERROR: C version of scalars_read produced an output different from the reference."
+    echo "Compare $PWD/c_read.txt reference $SRCDIR/reference/scalars_read_c.txt"
+    exit 1
+fi
+
+
+if [ $HAVE_FORTRAN != yes ]; then
+    exit 0
+fi
+# run the Fortran tests too if available
+
+mv scalars.xml scalars_c.xml
+mv scalars.bp scalars_c.bp
+cp $TRUNKDIR/examples/Fortran/scalars/scalars_read fortran_read
+cp $TRUNKDIR/examples/Fortran/scalars/scalars_write fortran_write
+cp $TRUNKDIR/examples/Fortran/scalars/scalars.xml .
+
+echo "Run Fortran scalar_write"
+$MPIRUN $NP_MPIRUN $PROCS ./fortran_write
+EX=$?
+if [ ! -f scalars.bp ]; then
+    echo "ERROR: Fortran version of scalars_write failed. No BP file is created. Exit code=$EX"
+    exit 1
+fi
+
+echo "Check output with bpls"
+$TRUNKDIR/utils/bpls/bpls -lav scalars.bp | grep -v endianness > f_bpls.txt
+diff -q f_bpls.txt $SRCDIR/reference/scalars_write_bpls.txt
+if [ $? != 0 ]; then
+    echo "ERROR: Fortran version of scalars_write produced a file different from the reference"
+    echo "Compare \"bpls -lav scalars.bp | grep -v endianness\" to reference $SRCDIR/reference/scalars_write_bpls.txt"
+    exit 1
+fi
+
+echo "Run Fortran scalars_read"
+$MPIRUN $NP_MPIRUN $PROCS ./fortran_read > f_read.txt
+EX=$?
+if [ $? != 0 ]; then
+    echo "ERROR: Fortran version of scalars_read failed with exit code $EX"
+    exit 1
+fi
+diff -q f_read.txt $SRCDIR/reference/scalars_read_f.txt
+if [ $? != 0 ]; then
+    echo "ERROR: Fortran version of scalars_read produced an output different from the reference."
+    echo "Compare $PWD/f_read.txt reference $SRCDIR/reference/scalars_read_f.txt"
+    exit 1
+fi
+
+
diff --git a/tests/suite/tests/02_attributes.sh b/tests/suite/tests/02_attributes.sh
new file mode 100755
index 0000000..e6539da
--- /dev/null
+++ b/tests/suite/tests/02_attributes.sh
@@ -0,0 +1,59 @@
+#!/bin/bash
+#
+# Test if adios can write and read attributes correctly
+# Uses codes from examples/C/attributes 
+#
+# Environment variables set by caller:
+# MPIRUN        Run command
+# NP_MPIRUN     Run commands option to set number of processes
+# MAXPROCS      Max number of processes allowed
+# HAVE_FORTRAN  yes or no
+# SRCDIR        Test source dir (.. of this script)
+# TRUNKDIR      ADIOS trunk dir
+
+PROCS=5
+READPROCS=2
+
+if [ $MAXPROCS -lt $PROCS ]; then
+    echo "WARNING: Needs $PROCS processes at least"
+    exit 77  # not failure, just skip
+fi
+
+# copy codes and inputs to . 
+cp $TRUNKDIR/examples/C/attributes/attributes_read .
+cp $TRUNKDIR/examples/C/attributes/attributes_write .
+cp $TRUNKDIR/examples/C/attributes/attributes.xml .
+
+echo "Run C attributes_write"
+$MPIRUN $NP_MPIRUN $PROCS ./attributes_write
+EX=$?
+if [ ! -f attributes.bp ]; then
+    echo "ERROR: C version of attributes_write failed. No BP file is created. Exit code=$EX"
+    exit 1
+fi
+
+echo "Check output with bpls"
+$TRUNKDIR/utils/bpls/bpls -lav attributes.bp | grep -v endianness > c_bpls.txt
+diff -q c_bpls.txt $SRCDIR/reference/attributes_bpls.txt
+if [ $? != 0 ]; then
+    echo "ERROR: C version of attributes_write produced a file different from the reference."
+    echo "Compare \"bpls -lav $PWD/attributes.bp | grep -v endianness\" to reference $SRCDIR/reference/attributes_bpls.txt"
+    exit 1
+fi
+
+echo "Run C attributes_read"
+$MPIRUN $NP_MPIRUN $READPROCS ./attributes_read | sort > c_read.txt
+EX=$?
+if [ $? != 0 ]; then
+    echo "ERROR: C version of attributes_read failed with exit code $EX"
+    exit 1
+fi
+echo "Check output"
+diff -q c_read.txt $SRCDIR/reference/attributes_read.txt
+if [ $? != 0 ]; then
+    echo "ERROR: C version of attributes_read produced an output different from the reference."
+    echo "Compare $PWD/c_read.txt reference $SRCDIR/reference/attributes_read.txt"
+    exit 1
+fi
+
+
diff --git a/tests/suite/tests/03_arrays.sh b/tests/suite/tests/03_arrays.sh
new file mode 100755
index 0000000..9d33f19
--- /dev/null
+++ b/tests/suite/tests/03_arrays.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+#
+# Test if adios can write and read arrays correctly
+# Uses codes from examples/C/arrays 
+#
+# Environment variables set by caller:
+# MPIRUN        Run command
+# NP_MPIRUN     Run commands option to set number of processes
+# MAXPROCS      Max number of processes allowed
+# HAVE_FORTRAN  yes or no
+# SRCDIR        Test source dir (.. of this script)
+# TRUNKDIR      ADIOS trunk dir
+
+PROCS=5
+
+if [ $MAXPROCS -lt $PROCS ]; then
+    echo "WARNING: Needs $PROCS processes at least"
+    exit 77  # not failure, just skip
+fi
+
+# copy codes and inputs to . 
+cp $TRUNKDIR/examples/C/arrays/arrays_read .
+cp $TRUNKDIR/examples/C/arrays/arrays_write .
+cp $TRUNKDIR/examples/C/arrays/arrays.xml .
+
+echo "Run C arrays_write"
+$MPIRUN $NP_MPIRUN $PROCS ./arrays_write
+EX=$?
+if [ ! -f arrays.bp ]; then
+    echo "ERROR: C version of arrays_write failed. No BP file is created. Exit code=$EX"
+    exit 1
+fi
+
+echo "Check output with bpls"
+$TRUNKDIR/utils/bpls/bpls -lav arrays.bp | grep -v endianness > c_bpls.txt
+diff -q c_bpls.txt $SRCDIR/reference/arrays_bpls.txt
+if [ $? != 0 ]; then
+    echo "ERROR: C version of arrays_write produced a file different from the reference."
+    echo "Compare \"bpls -lav $PWD/arrays.bp | grep -v endianness\" to reference $SRCDIR/reference/arrays_bpls.txt"
+    exit 1
+fi
+
+echo "Run C arrays_read"
+$MPIRUN $NP_MPIRUN $PROCS ./arrays_read | sort > c_read.txt
+EX=$?
+if [ $? != 0 ]; then
+    echo "ERROR: C version of arrays_read failed with exit code $EX"
+    exit 1
+fi
+echo "Check output"
+diff -q c_read.txt $SRCDIR/reference/arrays_read.txt
+if [ $? != 0 ]; then
+    echo "ERROR: C version of arrays_read produced an output different from the reference."
+    echo "Compare $PWD/c_read.txt reference $SRCDIR/reference/arrays_read.txt"
+    exit 1
+fi
+
+
diff --git a/tests/suite/tests/04_global_array.sh b/tests/suite/tests/04_global_array.sh
new file mode 100755
index 0000000..f287cd6
--- /dev/null
+++ b/tests/suite/tests/04_global_array.sh
@@ -0,0 +1,89 @@
+#!/bin/bash
+#
+# Test if adios can write and read global arrays over time correctly
+# Uses codes from examples/C/global-array and examples/Fortran/global-array
+#
+# Environment variables set by caller:
+# MPIRUN        Run command
+# NP_MPIRUN     Run commands option to set number of processes
+# MAXPROCS      Max number of processes allowed
+# HAVE_FORTRAN  yes or no
+# SRCDIR        Test source dir (.. of this script)
+# TRUNKDIR      ADIOS trunk dir
+
+PROCS=7
+READPROCS=3
+
+if [ $MAXPROCS -lt $PROCS ]; then
+    echo "WARNING: Needs $PROCS processes at least"
+    exit 77  # not failure, just skip
+fi
+
+# copy codes and inputs to . 
+cp $TRUNKDIR/examples/C/global-array/adios_global .
+cp $TRUNKDIR/examples/C/global-array/adios_read_global .
+cp $TRUNKDIR/examples/C/global-array/adios_global.xml .
+
+echo "Run C adios_global"
+$MPIRUN $NP_MPIRUN $PROCS ./adios_global
+EX=$?
+if [ ! -f adios_global.bp ]; then
+    echo "ERROR: C version of adios_global failed. No BP file is created. Exit code=$EX"
+    exit 1
+fi
+
+echo "Check output with bpls"
+$TRUNKDIR/utils/bpls/bpls -lav adios_global.bp -d -n 10  | grep -v endianness > c_bpls.txt
+diff -q c_bpls.txt $SRCDIR/reference/global_array_bpls.txt
+if [ $? != 0 ]; then
+    echo "ERROR: C version of adios_global produced a file different from the reference."
+    echo "Compare \"bpls -lav $PWD/adios_global.bp -d -n 10 | grep -v endianness\" to reference $SRCDIR/reference/global_array_bpls.txt"
+    exit 1
+fi
+
+echo "Run C adios_read_global"
+$MPIRUN $NP_MPIRUN $READPROCS ./adios_read_global | sort > c_read.txt
+EX=$?
+if [ $? != 0 ]; then
+    echo "ERROR: C version of adios_read_global exited with $EX"
+    echo "Check $PWD/c_read.txt"
+    exit 1
+fi
+
+echo "Check output"
+diff -q c_read.txt $SRCDIR/reference/global_array_read.txt
+if [ $? != 0 ]; then
+    echo "ERROR: C version of adios_read_global produced a file different from the reference."
+    echo "$PWD/c_read.txt to reference $SRCDIR/reference/global_array_read.txt"
+    exit 1
+fi
+
+
+if [ $HAVE_FORTRAN != yes ]; then
+    exit 0
+fi
+# run the Fortran tests too if available
+
+mv adios_global.xml adios_global_c.xml
+mv adios_global.bp adios_global_c.bp
+cp $TRUNKDIR/examples/Fortran/global-array/adios_global adios_global_f
+cp $TRUNKDIR/examples/Fortran/global-array/adios_global.xml .
+
+echo "Run Fortran adios_global_f"
+$MPIRUN $NP_MPIRUN $PROCS ./adios_global_f
+EX=$?
+if [ ! -f adios_global.bp ]; then
+    echo "ERROR: Fortran version of adios_global failed. No BP file is created. Exit code=$EX"
+    exit 1
+fi
+
+echo "Check output with bpls"
+$TRUNKDIR/utils/bpls/bpls -lav adios_global.bp -d -n 10 | grep -v endianness > f_bpls.txt
+diff -q f_bpls.txt $SRCDIR/reference/global_array_bpls.txt
+if [ $? != 0 ]; then
+    echo "ERROR: Fortran version of adios_global produced a file different from the reference."
+    echo "Compare \"bpls -lav $PWD/adios_global.bp -d -n 10 | grep -v endianness\" to reference $SRCDIR/reference/global_array_bpls.txt"
+    exit 1
+fi
+
+
diff --git a/tests/suite/tests/05_global_array_time.sh b/tests/suite/tests/05_global_array_time.sh
new file mode 100755
index 0000000..af826a3
--- /dev/null
+++ b/tests/suite/tests/05_global_array_time.sh
@@ -0,0 +1,88 @@
+#!/bin/bash
+#
+# Test if adios can write and read global arrays over time correctly
+# Uses codes from examples/C/global-array-time and examples/Fortran/global-array-time
+#
+# Environment variables set by caller:
+# MPIRUN        Run command
+# NP_MPIRUN     Run commands option to set number of processes
+# MAXPROCS      Max number of processes allowed
+# HAVE_FORTRAN  yes or no
+# SRCDIR        Test source dir (.. of this script)
+# TRUNKDIR      ADIOS trunk dir
+
+PROCS=9
+
+if [ $MAXPROCS -lt $PROCS ]; then
+    echo "WARNING: Needs $PROCS processes at least"
+    exit 77  # not failure, just skip
+fi
+
+# copy codes and inputs to . 
+cp $TRUNKDIR/examples/C/global-array-time/adios_globaltime .
+cp $TRUNKDIR/examples/C/global-array-time/adios_read_globaltime .
+cp $TRUNKDIR/examples/C/global-array-time/adios_globaltime.xml .
+
+echo "Run C adios_globaltime"
+$MPIRUN $NP_MPIRUN $PROCS ./adios_globaltime
+EX=$?
+if [ ! -f adios_globaltime.bp ]; then
+    echo "ERROR: C version of adios_globaltime failed. No BP file is created. Exit code=$EX"
+    exit 1
+fi
+
+echo "Check output with bpls"
+$TRUNKDIR/utils/bpls/bpls -lav adios_globaltime.bp | grep -v endianness > c_bpls.txt
+diff -q c_bpls.txt $SRCDIR/reference/global_array_time_bpls.txt
+if [ $? != 0 ]; then
+    echo "ERROR: C version of adios_globaltime produced a file different from the reference."
+    echo "Compare \"bpls -lav $PWD/adios_globaltime.bp | grep -v endianness\" to reference $SRCDIR/reference/global_array_time_bpls.txt"
+    exit 1
+fi
+
+echo "Run C adios_read_globaltime"
+$MPIRUN $NP_MPIRUN $PROCS ./adios_read_globaltime | sort > c_read.txt
+EX=$?
+if [ $? != 0 ]; then
+    echo "ERROR: C version of adios_read_globaltime exited with $EX"
+    echo "Check $PWD/c_read.txt"
+    exit 1
+fi
+
+echo "Check output"
+diff -q c_read.txt $SRCDIR/reference/global_array_time_read.txt
+if [ $? != 0 ]; then
+    echo "ERROR: C version of adios_read_globaltime produced a file different from the reference."
+    echo "$PWD/c_read.txt to reference $SRCDIR/reference/global_array_time_read.txt"
+    exit 1
+fi
+
+
+if [ $HAVE_FORTRAN != yes ]; then
+    exit 0
+fi
+# run the Fortran tests too if available
+
+mv adios_globaltime.xml adios_globaltime_c.xml
+mv adios_globaltime.bp adios_globaltime_c.bp
+cp $TRUNKDIR/examples/Fortran/global-array-time/adios_globaltime adios_globaltime_f
+cp $TRUNKDIR/examples/Fortran/global-array-time/adios_globaltime.xml .
+
+echo "Run Fortran adios_globaltime_f"
+$MPIRUN $NP_MPIRUN $PROCS ./adios_globaltime_f
+EX=$?
+if [ ! -f adios_globaltime.bp ]; then
+    echo "ERROR: Fortran version of adios_globaltime failed. No BP file is created. Exit code=$EX"
+    exit 1
+fi
+
+echo "Check output with bpls"
+$TRUNKDIR/utils/bpls/bpls -lav adios_globaltime.bp | grep -v endianness > f_bpls.txt
+diff -q f_bpls.txt $SRCDIR/reference/global_array_time_bpls.txt
+if [ $? != 0 ]; then
+    echo "ERROR: Fortran version of adios_globaltime produced a file different from the reference."
+    echo "Compare \"bpls -lav $PWD/adios_globaltime.bp | grep -v endianness\" to reference $SRCDIR/reference/global_array_time_bpls.txt"
+    exit 1
+fi
+
+
diff --git a/tests/suite/tests/06_posix_method.sh b/tests/suite/tests/06_posix_method.sh
new file mode 100755
index 0000000..5cb4153
--- /dev/null
+++ b/tests/suite/tests/06_posix_method.sh
@@ -0,0 +1,56 @@
+#!/bin/bash
+#
+# Test if adios POSIX method 
+# Uses codes from SRCDIR/programs/posix_method
+#
+# Environment variables set by caller:
+# MPIRUN        Run command
+# NP_MPIRUN     Run commands option to set number of processes
+# MAXPROCS      Max number of processes allowed
+# HAVE_FORTRAN  yes or no
+# SRCDIR        Test source dir (.. of this script)
+# TRUNKDIR      ADIOS trunk dir
+
+PROCS=3
+
+if [ $MAXPROCS -lt $PROCS ]; then
+    echo "WARNING: Needs $PROCS processes at least"
+    exit 77  # not failure, just skip
+fi
+
+if [ "$HAVE_FORTRAN" != "yes" ]; then
+    echo "Fortran is not available for this ADIOS build. This tests wants to use a Fortran90 code." 
+    exit 77 
+fi
+
+# copy codes and inputs to . 
+cp $SRCDIR/programs/posix_method .
+cp $SRCDIR/programs/posix_method.xml .
+
+echo "Run posix_method"
+$MPIRUN $NP_MPIRUN $PROCS ./posix_method
+EX=$?
+if [ $EX != 0 ]; then
+    echo "ERROR: posix method failed with exit code=$EX"
+    exit $EX
+fi
+
+if [ ! -f posix_method.bp ]; then
+    echo "ERROR: posix_method failed. No BP file posix_method.bp was created."
+    exit 1
+fi
+
+if [ ! -d posix_method.bp.dir ]; then
+    echo "ERROR: posix_method failed. No BP subfile directory posix_method.bp.dir was created."
+    exit 1
+fi
+
+for ((i=0; i<$PROCS; i++)); do
+    if [ ! -f posix_method.bp.dir/posix_method.bp.$i ]; then
+        echo "ERROR: posix_method failed. No BP subfile posix_method.bp.dir/posix_method.bp.$i was created."
+        exit 1
+    fi
+done
+
+
+
diff --git a/tests/suite/tests/07_global_array_no_xml.sh b/tests/suite/tests/07_global_array_no_xml.sh
new file mode 100755
index 0000000..c6e866e
--- /dev/null
+++ b/tests/suite/tests/07_global_array_no_xml.sh
@@ -0,0 +1,89 @@
+#!/bin/bash
+#
+# Test if adios can write and read global arrays over time correctly
+# Uses codes from examples/C/global-array and examples/Fortran/global-array
+#
+# Environment variables set by caller:
+# MPIRUN        Run command
+# NP_MPIRUN     Run commands option to set number of processes
+# MAXPROCS      Max number of processes allowed
+# HAVE_FORTRAN  yes or no
+# SRCDIR        Test source dir (.. of this script)
+# TRUNKDIR      ADIOS trunk dir
+
+PROCS=7
+READPROCS=3
+
+if [ $MAXPROCS -lt $PROCS ]; then
+    echo "WARNING: Needs $PROCS processes at least"
+    exit 77  # not failure, just skip
+fi
+
+# copy codes and inputs to . 
+cp $TRUNKDIR/examples/C/global-array/adios_global_no_xml .
+cp $TRUNKDIR/examples/C/global-array/adios_read_global_no_xml .
+
+echo "Run C adios_global_no_xml"
+ls -l ./adios_global_no_xml
+echo $MPIRUN $NP_MPIRUN $PROCS ./adios_global_no_xml
+$MPIRUN $NP_MPIRUN $PROCS ./adios_global_no_xml
+EX=$?
+if [ ! -f adios_global_no_xml.bp ]; then
+    echo "ERROR: C version of adios_global_no_xml failed. No BP file is created. Exit code=$EX"
+    exit 1
+fi
+
+echo "Check output with bpls"
+$TRUNKDIR/utils/bpls/bpls -lav adios_global_no_xml.bp -d -n 10 | grep -v endianness > c_bpls.txt
+diff -q c_bpls.txt $SRCDIR/reference/global_array_no_xml_bpls.txt
+if [ $? != 0 ]; then
+    echo "ERROR: C version of adios_global_no_xml produced a file different from the reference."
+    echo "Compare \"bpls -lav $PWD/adios_global_no_xml.bp -d -n 10 | grep -v endianness\" to reference $SRCDIR/reference/global_array_no_xml_bpls.txt"
+    exit 1
+fi
+
+echo "Run C adios_read_global_no_xml"
+$MPIRUN $NP_MPIRUN $READPROCS ./adios_read_global_no_xml | sort > c_read.txt
+EX=$?
+if [ $? != 0 ]; then
+    echo "ERROR: C version of adios_read_global_no_xml exited with $EX"
+    echo "Check $PWD/c_read.txt"
+    exit 1
+fi
+
+echo "Check output"
+diff -q c_read.txt $SRCDIR/reference/global_array_no_xml_read.txt
+if [ $? != 0 ]; then
+    echo "ERROR: C version of adios_read_global produced a file different from the reference."
+    echo "$PWD/c_read.txt to reference $SRCDIR/reference/global_array_no_xml_read.txt"
+    exit 1
+fi
+
+
+if [ $HAVE_FORTRAN != yes ]; then
+    exit 0
+fi
+# run the Fortran tests too if available
+
+mv adios_global_no_xml.bp adios_global_no_xml_c.bp
+cp $TRUNKDIR/examples/Fortran/global-array/adios_global adios_global_f
+cp $TRUNKDIR/examples/Fortran/global-array/adios_global.xml .
+
+echo "Run Fortran adios_global_f"
+$MPIRUN $NP_MPIRUN $PROCS ./adios_global_f
+EX=$?
+if [ ! -f adios_global.bp ]; then
+    echo "ERROR: Fortran version of adios_global failed. No BP file is created. Exit code=$EX"
+    exit 1
+fi
+
+echo "Check output with bpls"
+$TRUNKDIR/utils/bpls/bpls -lav adios_global.bp -d -n 10 | grep -v endianness > f_bpls.txt
+diff -q f_bpls.txt $SRCDIR/reference/global_array_bpls.txt
+if [ $? != 0 ]; then
+    echo "ERROR: Fortran version of adios_global produced a file different from the reference."
+    echo "Compare \"bpls -lav $PWD/adios_global.bp -d -n 10 | grep -v endianness\" to reference $SRCDIR/reference/global_array_bpls.txt"
+    exit 1
+fi
+
+
diff --git a/tools/matlab/Makefile b/tools/matlab/Makefile
new file mode 100644
index 0000000..5c6f93e
--- /dev/null
+++ b/tools/matlab/Makefile
@@ -0,0 +1,30 @@
+include ../../adios_config.flags
+
+MEXOPTS="-g -DDEBUG"
+default:
+	@echo "ADIOS reader methods for MATLAB"
+	@echo "Have 'mex' compiler in the path and run"
+	@echo "> make matlab"
+
+
+matlab: adiosopenc adiosclosec adiosreadc
+
+adiosopenc:  
+	mex adiosopenc.c ${MEXOPTS} -D_NOMPI  -I. -I../../src -L. -L../../src ${ADIOSREAD_SEQ_INC} ${ADIOSREAD_SEQ_CLIB}
+
+adiosreadc: 
+	mex adiosreadc.c ${MEXOPTS} -D_NOMPI -I. -I../../src -L. -L../../src ${ADIOSREAD_SEQ_INC} ${ADIOSREAD_SEQ_CLIB}
+
+adiosclosec:
+	mex adiosclosec.c ${MEXOPTS} -D_NOMPI -I. -I../../src -L. -L../../src ${ADIOSREAD_SEQ_INC} ${ADIOSREAD_SEQ_CLIB}
+
+#adiosdbgc:
+#	mex adiosdbgc.c ${MEXOPTS} -D_NOMPI -I. -I../../src -L. -L../../src ${ADIOSREAD_SEQ_INC} ${ADIOSREAD_SEQ_CLIB}
+
+clean:
+	rm -f *.mexa64 core* *.o 
+
+install:
+	@echo "Install *.m and *.mexa64 into MATLABPATH"
+	@echo "Do not have 'adios' anywhere in the path where you install the files"
+	@echo "otherwise 'help adios' will not work in Matlab"
diff --git a/tools/matlab/adios.m b/tools/matlab/adios.m
new file mode 100644
index 0000000..63ac9b9
--- /dev/null
+++ b/tools/matlab/adios.m
@@ -0,0 +1,54 @@
+function adios()
+%ADIOS Reader for the ADIOS BP file format
+%   
+%   ADIOS is a componentized I/O layer for high performance output combined
+%   with an easy to use interface and a set of different data writing methods
+%   so that everyone can choose the best method for a particular system.
+%
+%   ADIOSREAD can be used in itself to read in a variable with a known name.
+%   ADIOSOPEN returns a structure with information on all adios groups, 
+%   variables and attributes. The structure can be used to read many variables
+%   without repeatedly opening and closing the file behind the scenes. 
+%   ADIOSCLOSE closes the file, opened by ADIOSOPEN.
+%
+%   Organization of an ADIOS BP file
+%   --------------------------------
+%   There is usually one adios group in a file, but there can be more. 
+%   An adios group is the set of all variables and attributes that have been
+%   written by a (parallel) program at one place in the code. The programmer
+%   may have decided to write more than one groups into the file.
+%   Note that the adios group is not the same as HDF5 groups. Each variable in
+%   the group has a path, which defines a logical hierarchy of the variables 
+%   within one adios group. This logical hierarchy is similar to the hierarchy
+%   in a HDF5 file.
+%
+%   Therefore, ADIOSREAD expects one of the info.Groups(idx) structure to
+%   specify a group to read from, instead of the info structure itself, where
+%   info is returned by ADIOSOPEN.
+%
+%   Time dimension of a variable
+%   ----------------------------
+%   Variables can be written several times from a program, if they have a time
+%   dimension. The reader exposes the variables with an extra dimension, i.e.
+%   a 2D variable written over time is seen as a 3D variable. In MATLAB, the
+%   extra dimension is the last dimension (the slowest changing dimension).
+%   Since the reader allows reading an arbitrary slice of a variable, data for
+%   one timestep can be read in with slicing.
+%
+%   Extra information provided by ADIOSOPEN
+%   ---------------------------------------
+%   The ADIOS BP format stores the min/max values in each variable. 
+%   The info structure therefore contains these min/max values. There is
+%   practically no overhead to provide this information (along with the
+%   values of all attributes) even for file sizes of several terabytes.
+%
+%   Please read the file COPYING in the top directory of the ADIOS source
+%   distribution for information on the copyrights.
+%
+%   See also ADIOSOPEN, ADIOSREAD, ADIOSCLOSE.
+
+%   Copyright 2009 UT-BATTELLE, LLC
+%   $Revision: 1.0 $  $Date: 2009/08/05 12:53:41 $
+%   Author: Norbert Podhorszki <pnorbert at ornl.gov>
+
+help adios
diff --git a/tools/matlab/adiosclose.m b/tools/matlab/adiosclose.m
new file mode 100644
index 0000000..8c63969
--- /dev/null
+++ b/tools/matlab/adiosclose.m
@@ -0,0 +1,151 @@
+function adiosclose(varargin)
+%ADIOSCLOSE Close an ADIOS BP file.
+%   
+%   ADIOSCLOSE closes an ADIOS BP file that was opened by ADIOSOPEN.
+%   Provide the structure returned by ADIOSOPEN as input.
+%
+%   ADIOSCLOSE(STRUCT) 
+%      Close file and free internal data structures.
+%      STRUCT is the output of ADIOSOPEN.
+%
+%   ADIOSCLOSE(STRUCT, 'Verbose', LEVEL)
+%      To get logging from the adiosclose code, set Verbose to 1 or higher.
+%      Higher values cause more and more details to be printed.
+%
+%   Please read the file adioscopyright.txt for more information.
+%
+%   See also ADIOSOPEN, ADIOSREAD, ADIOS.
+
+%   Copyright 2009 UT-BATTELLE, LLC
+%   $Revision: 1.0 $  $Date: 2009/08/05 12:53:41 $
+%   Author: Norbert Podhorszki <pnorbert at ornl.gov>
+
+%
+% Process arguments.
+%
+
+checkArgCounts(varargin{:});
+[args, msg] = parse_inputs(varargin{:});
+if (~isempty(msg))
+    error('MATLAB:adiosopen:inputParsing', '%s', msg);
+end
+
+if (args.Verbose > 0)
+    fn=sprintf('File handler=%lld',args.fh);
+    gharr=sprintf('%lld ',args.ghs);
+    ghs=sprintf('Group handlers=[%s]',gharr);
+    CallArguments = sprintf('adiosclosec:\n  %s\n  %s\n  Verbose=%d\n', fn, ghs, args.Verbose);
+end
+
+
+adiosclosec(args.fh, args.ghs, args.Verbose);
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% FUNCTION:   checkArgCounts %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+function checkArgCounts(varargin)
+
+if (nargin < 1)
+    error('MATLAB:adiosopen:notEnoughInputs', ...
+          'ADIOSCLOSE requires at least one input argument.')
+end
+
+
+if (nargout > 0)
+    error('MATLAB:adiosread:tooManyOutputs', ...
+          'ADIOSCLOSE has no output arguments.')
+end
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% FUNCTION:   parse_inputs   %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+function [args, msg] = parse_inputs(varargin)
+
+arg1  = '';
+args.fh=int64(0);
+args.ngroups=0;
+args.ghs=int64([]);
+args.Verbose = 0;  % verbosity, default is off, i.e. 0
+
+msg = '';
+
+% Arg 1: struct returned by ADIOSOPEN
+if isstruct(varargin{1})
+    arg1 = varargin{1};
+    %
+    % Verify it is an adios struct from ADIOSOPEN
+    %
+    fnames = fieldnames(arg1);
+    if ( ~strcmp(fnames{1},'Name')        || ...
+         ~strcmp(fnames{2},'FileHandler') || ...
+         ~strcmp(fnames{3},'TimeStart')   || ...
+         ~strcmp(fnames{4},'TimeSteps')     || ...
+         ~strcmp(fnames{5},'Groups')         ...
+       )
+    
+        msg = 'STRUCT input argument does not seem to be output of ADIOSOPEN';
+        return
+    end
+    args.fh = int64(arg1.FileHandler);
+    args.ngroups = length(arg1.Groups);
+    for i=1:length(arg1.Groups)
+        args.ghs(i) = int64(arg1.Groups(i).GroupHandler);
+    end
+    varargin = {varargin{2:end}};
+else
+    msg = 'STRUCT input argument must be the output of ADIOSOPEN';
+    return
+end
+
+
+% Parse optional arguments based on their number.
+if (length(varargin) > 0)
+    
+    paramStrings = {'verbose'};
+    
+    % For each pair
+    for k = 1:2:length(varargin)
+        param = lower(varargin{k});
+            
+        if (~ischar(param))
+            msg = 'Parameter name must be a string.';
+            return
+        end
+        
+        idx = strmatch(param, paramStrings);
+        
+        if (isempty(idx))
+            msg = sprintf('Unrecognized parameter name "%s".', param);
+            return
+        elseif (length(idx) > 1)
+            msg = sprintf('Ambiguous parameter name "%s".', param);
+            return
+        end
+
+        switch (paramStrings{idx})
+        % VERBOSE
+        case 'verbose'
+            if (k == length(varargin))
+                msg = 'No value specified for Verbose option.';
+                return
+            end
+        
+            args.Verbose = varargin{k+1};
+            if ((~isnumeric(args.Verbose)) || ...
+                (~isempty(find(rem(args.Verbose, 1) ~= 0))))
+                
+                msg = sprintf('''VERBOSE'' must be an integer.');
+                return
+            end
+            if (args.Verbose < 0)
+                msg = sprintf('''VERBOSE'' must be greater or equal to zero.');
+                return
+            end
+        end
+    end
+end
diff --git a/tools/matlab/adiosclosec.c b/tools/matlab/adiosclosec.c
new file mode 100644
index 0000000..34ac9a9
--- /dev/null
+++ b/tools/matlab/adiosclosec.c
@@ -0,0 +1,114 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/*=================================================================
+ * adiosclosec.c - Close an ADIOS file
+ *
+ * Input: fh, ghs,  Verbose
+ *    fh:       int64 adios file handler
+ *    ghs:      array of int64 group handlers
+ *    Verbose:  numeric (double)
+ *
+ * $Revision: 1.0 $  $Date: 2009/08/05 12:53:41 $
+ * Author: Norbert Podhorszki <pnorbert at ornl.gov>
+ *=================================================================*/
+
+#include "mex.h"
+#include "adios_read.h"
+#include "adios_types.h"
+
+static int verbose=0;
+
+mxClassID adiostypeToMatlabClass(int type, mxComplexity *complexity );
+void errorCheck(int nlhs, int nrhs, const mxArray *prhs[]);
+char* getString(const mxArray *mxstr);
+
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+    int status;
+    char msg[512];                               /* error messages from function calls */
+    mwSize ngroups;
+    int64_t *ghs, *int64p;               /* file and group handlers and temp pointers */
+    int i;
+
+    errorCheck(nlhs, nrhs, prhs);
+
+    /*mexPrintf("nrhs=%d  nlhs=%d\n", nrhs, nlhs);*/
+    
+    /***********************/
+    /* 0. get verbose parameter first */
+    verbose = (int)mxGetScalar(prhs[2]);
+    if (verbose) mexPrintf("Verbosity level: %d\n", verbose);
+
+    /* 1. get file handler */
+    int64p = (int64_t *) mxGetData(prhs[0]);
+    if (verbose) mexPrintf("File handler: \"%lld\"\n", *int64p);
+
+    /* 2. get group handlers */
+    ghs = (int64_t *) mxGetData(prhs[1]);
+    ngroups=mxGetNumberOfElements(prhs[1]);
+    if (verbose) mexPrintf("Number of group handlers: \"%d\"\n", ngroups);
+
+    for (i=0; i<ngroups; i++) {
+        if (verbose) mexPrintf("Close group handler: \"%lld\"\n", ghs[i]);
+        adios_gclose((ADIOS_GROUP *)ghs[i]);
+    }
+    if (verbose) mexPrintf("Close file handler: \"%lld\"\n", *int64p);
+    adios_fclose((ADIOS_FILE *) *int64p);
+
+    if (verbose) mexPrintf("return from adiosclosec\n");
+}
+
+
+void errorCheck(int nlhs, int nrhs, const mxArray *prhs[]){
+    /* Assume that we are called from adiosread.m which checks the arguments already */
+    /* Check for proper number of arguments. */
+    
+    if ( nrhs != 3 ) {
+        mexErrMsgIdAndTxt("MATLAB:adiosclosec:rhs","This function needs exactly 3 arguments: FileHandler, GroupHandlers, Verbose");
+    }
+    
+    if ( !mxIsInt64(prhs[0]) ) {
+        mexErrMsgIdAndTxt("MATLAB:adiosclosec:rhs","First arg must be an int64 handler to an ADIOS file .");
+    } 
+    
+    if ( !mxIsInt64(prhs[1]) ) {
+        mexErrMsgIdAndTxt("MATLAB:adiosclosec:rhs","Second arg must be an int64 adios group handler.");
+    } 
+
+    if ( !mxIsNumeric(prhs[2]) ) {
+        mexErrMsgIdAndTxt("MATLAB:adiosclosec:rhs","Third arg must be a number.");
+    } 
+    
+    if ( nlhs > 0 ) {
+        mexErrMsgIdAndTxt("MATLAB:adiosclosec:lhs","This function does not have output arguments.");
+    }
+    
+#if !defined(MX_COMPAT_32)
+    /* Make sure that it is safe to cast dim to mwSize when using largeArrayDims.*/
+    if ( dim > MWSIZE_MAX ) {
+        mexErrMsgIdAndTxt("MATLAB:adiosclosec:dimensionTooLarge",
+                          "The input dimension, %.0f, is larger than the maximum value of mwSize, %u, when built with largeArrayDims.", dim, MWSIZE_MAX);
+    }
+#endif
+ }
+
+
+/** Make a C char* string from a Matlab string */
+char* getString(const mxArray *mxstr) 
+{
+    mwSize buflen;
+    char   *str;
+    /* Allocate enough memory to hold the converted string. */
+    buflen = mxGetNumberOfElements(mxstr) + 1;
+    str = mxCalloc(buflen, sizeof(char));
+    /* Copy the string data from string_array_ptr and place it into buf. */
+    if (mxGetString(mxstr, str, buflen) != 0)
+        mexErrMsgTxt("Could not convert string data from the file name.");
+    return str;
+}
+
diff --git a/tools/matlab/adiosopen.m b/tools/matlab/adiosopen.m
new file mode 100644
index 0000000..1c5ac3d
--- /dev/null
+++ b/tools/matlab/adiosopen.m
@@ -0,0 +1,188 @@
+function info = adiosopen(varargin)
+%ADIOSOPEN Open an ADIOS BP file and provide information on it.
+%   
+%   ADIOSOPEN opens an ADIOS BP file and returns a structure that
+%   contains the file handler and information on all groups,
+%   variables and attributes.
+%
+%   If you have opened the file with ADIOSOPEN, you can supply the
+%   file handler and the group handler to read in a variable/attribute
+%   with ADIOSREAD. When finished reading all data, you need to close 
+%   the file with ADIOSCLOSE. 
+%
+%   Note: the adios group is not the same as HDF5 groups. Each variable has
+%   a path, which defines a logical hierarchy of the variables within one 
+%   adios group. This logical hierarchy is what is similar to HDF5 groups.
+%
+%   INFO = ADIOSOPEN(FILE) 
+%      Open FILE and return an information structure. 
+%
+%   The returned INFO structure is the following
+%
+%     Name        file path
+%     FileHandler int64 file handler
+%     TimeStart   First timestep in file
+%     TimeEnd     Last timestep in file
+%     Groups      Adios groups in the file. Usually 1 group is in a file.
+%                 This is a structure array of 
+%
+%        Name          group name
+%        GroupHandler  int64 group handler
+%        Variables     structure array of variables
+%           Name          path of variable
+%           Type          Matlab type class of data
+%           Dims          Array of dimensions
+%           Timedim       The time dimension, 0 if there is no time varying 
+%                         part of the variable
+%           GlobalMin     global minimum  of the variable (1-by-1 mxArray)
+%           GlobalMax     global maximum of the variable
+%           
+%        Attributes  structure array of attributes
+%           Name          path of attribute
+%           Type          Matlab type class of data
+%           Value         attribute value
+%
+%
+%   INFO = ADIOSOPEN(FILE, 'Verbose', LEVEL)
+%      To get logging from the adiosopen code, set Verbose to 1 or higher.
+%      Higher values cause more and more details to be printed.
+%
+%   See also ADIOSREAD, ADIOSCLOSE, ADIOS.
+
+%   Copyright 2009 UT-BATTELLE, LLC
+%   $Revision: 1.0 $  $Date: 2009/08/05 12:53:41 $
+%   Author: Norbert Podhorszki <pnorbert at ornl.gov>
+
+%
+% Process arguments.
+%
+
+checkArgCounts(varargin{:});
+[args, msg] = parse_inputs(varargin{:});
+if (~isempty(msg))
+    error('MATLAB:adiosopen:inputParsing', '%s', msg);
+end
+
+if (isnumeric(args.File))
+    fn=sprintf('File handler=%lld',args.File);
+else
+    fn=sprintf('File name=%s',args.File);
+end
+verbose=sprintf('%d ', args.Verbose);
+
+input = sprintf('adiosopenc:\n  %s \n  Verbose=%s', fn, verbose);
+if (args.Verbose > 0) 
+    CallArguments = input
+end
+
+
+if (nargout == 1)
+    info = adiosopenc(args.File, args.Verbose);
+else 
+    adiosopenc(args.File, args.Verbose);
+end
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% FUNCTION:   checkArgCounts %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+function checkArgCounts(varargin)
+
+if (nargin < 1)
+    error('MATLAB:adiosopen:notEnoughInputs', ...
+          'ADIOSOPEN requires at least one input argument.')
+end
+
+
+if (nargout > 1)
+    error('MATLAB:adiosopen:tooManyOutputs', ...
+          'ADIOSOPEN requires one or zero output arguments.')
+end
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% FUNCTION:   parse_inputs   %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+function [args, msg] = parse_inputs(varargin)
+
+args.File    = '';
+args.Verbose = 0;  % verbosity, default is off, i.e. 0
+
+msg = '';
+
+% Arg 1: file name
+if ischar(varargin{1})
+    args.File = varargin{1};
+    %
+    % Verify existence of filename
+    %
+    fid = fopen(args.File);    
+    if (fid == -1)
+        % Look for filename with extensions.
+        fid = fopen([args.File '.bp']);
+    end
+
+    if (fid == -1)
+        error('MATLAB:hdf5read:fileOpen', ...
+              'Couldn''t open file (%s).', ...
+              args.File)
+    else
+        % Get full filename 
+        args.File = fopen(fid);
+        fclose(fid);
+    end
+    varargin = {varargin{2:end}};
+else
+    msg = 'FILE input argument to ADIOSOPEN must be a string ';
+    return
+end
+
+
+% Parse optional arguments based on their number.
+if (length(varargin) > 0)
+    
+    paramStrings = {'verbose'};
+    
+    % For each pair
+    for k = 1:2:length(varargin)
+        param = lower(varargin{k});
+            
+        if (~ischar(param))
+            msg = 'Parameter name must be a string.';
+            return
+        end
+        
+        idx = strmatch(param, paramStrings);
+        
+        if (isempty(idx))
+            msg = sprintf('Unrecognized parameter name "%s".', param);
+            return
+        elseif (length(idx) > 1)
+            msg = sprintf('Ambiguous parameter name "%s".', param);
+            return
+        end
+
+        switch (paramStrings{idx})
+        % VERBOSE
+        case 'verbose'
+            if (k == length(varargin))
+                msg = 'No value specified for Verbose option.';
+                return
+            end
+        
+            args.Verbose = varargin{k+1};
+            if ((~isnumeric(args.Verbose)) || ...
+                (~isempty(find(rem(args.Verbose, 1) ~= 0))))
+                
+                msg = sprintf('''VERBOSE'' must be an integer.');
+                return
+            end
+            if (args.Verbose < 0)
+                msg = sprintf('''VERBOSE'' must be greater or equal to zero.');
+                return
+            end
+        end
+    end
+end
diff --git a/tools/matlab/adiosopenc.c b/tools/matlab/adiosopenc.c
new file mode 100644
index 0000000..e3c8b2c
--- /dev/null
+++ b/tools/matlab/adiosopenc.c
@@ -0,0 +1,427 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/*=================================================================
+ * adiosopenc.c - Open an ADIOS file
+ *
+ * Input: File, Verbose
+ *    File:     string (name) or int64 (handler)
+ *    Verbose:  numeric (double)
+ *
+ * Output: Information structure
+ *     Name        file path
+ *     FileHandler int64 file handler
+ *     TimeStart   First timestep in file (usually = 1)
+ *     TimeSteps   Number of timesteps in file, always at least 1
+ *     Groups      Adios groups in the file. Usually 1 group is in a file.
+ *                 This is a structure array of 
+ *
+ *        Name          group name
+ *        GroupHandler  int64 group handler
+ *        Variables     structure array of variables
+ *           Name          path of variable
+ *           Type          Matlab type class of data
+ *           Dims          Array of dimensions
+ *           Timedim       The time dimension, 0 if there is no time varying 
+ *                         part of the variable
+ *           GlobalMin     global minimum  of the variable (1-by-1 mxArray)
+ *           GlobalMax     global maximum of the variable
+ *           
+ *        Attributes  structure array of attributes
+ *           Name          path of attribute
+ *           Type          Matlab type class of data
+ *           Value         attribute value (mxArray)
+ *
+ *
+ *
+ * $Revision: 1.0 $  $Date: 2009/08/05 12:53:41 $
+ * Author: Norbert Podhorszki <pnorbert at ornl.gov>
+ *=================================================================*/
+
+#include <string.h>              /* memcpy */
+#include "mex.h"
+#include "adios_types.h"
+#include "adios_read.h"
+#include "adios_types.h"
+
+static int verbose=0;
+
+mxClassID adiostypeToMatlabClass(int type, mxComplexity *complexity );
+mxArray* valueToMatlabValue( void * data, mxClassID mxtype, mxComplexity complexFlag);
+void errorCheck(int nlhs, int nrhs, const mxArray *prhs[]);
+char* getString(const mxArray *mxstr);
+static void swap_order(int n, uint64_t *array);
+
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+    char *fname;                                 /* file name */
+    int status;
+    char msg[512];                               /* error messages from function calls */
+    int32_t *int32p;
+
+    ADIOS_FILE *fp;                             /* File handler structure */
+    ADIOS_GROUP *gp;                            /* Group handler structure */
+    ADIOS_VARINFO *vinfo;                       /* Variable info structure */
+    int mpi_comm_dummy;                         /* ADIOS read API needs an MPI communicator */
+    int32_t timedim;                            /* time dimension is translated C 0.. -> Matlab 1.. */
+    int asize;                                  /* Attribute size info */
+    enum ADIOS_DATATYPES adiostype;             /* Attribute type info */
+    void *data;                                 /* Attributes return their values */
+    mwSize mDims[] = {1};                       /* dimensions to create a scalar mxArray */  
+
+    int gi,vi,ai, i;                            /* loop variables for groups, vars and attrs */
+    mxArray *arr;                               /* temp array for constructions */
+    mxArray *groups, *vars, *attrs;             /* struct arrays under top struct */
+    mxClassID mxtype;                           /* matlab type (of vars and attrs) */
+    mxComplexity complexFlag; 
+
+    /* Output structure definition */
+    const char *top_field_names[] = {"Name", "FileHandler", "TimeStart", "TimeSteps", "Groups"}; /* top level struct fields */
+    mwSize ntopfields = 5;
+    mwSize top_struct_dims[] = {1,1};   /* dimensions for top level struct array: 1-by-1 */
+    int top_field_Name;
+    int top_field_FileHandler;
+    int top_field_TimeStart;
+    int top_field_TimeSteps;
+    int top_field_Groups;
+
+    const char *group_field_names[] = {"Name", "GroupHandler", "Variables", "Attributes"}; /* group level struct fields */
+    mwSize ngroupfields = 4;
+    mwSize group_struct_dims[2];        /* dimensions for group level struct array: 1-by-sth */
+    int group_field_Name;
+    int group_field_GroupHandler;
+    int group_field_Variables;
+    int group_field_Attributes;
+
+    const char *var_field_names[] = {"Name","Type","Dims", "Timedim", "GlobalMin", "GlobalMax"}; /* variable level struct fields */
+    mwSize nvarfields = 6;
+    mwSize var_struct_dims[2];        /* dimensions for variable level struct array: 1-by-sth */
+    int var_field_Name;
+    int var_field_Type;
+    int var_field_Dims;
+    int var_field_Timedim;
+    int var_field_GlobalMin;
+    int var_field_GlobalMax;
+
+    const char *attr_field_names[] = {"Name","Type","Value"}; /* attribute level struct fields */
+    mwSize nattrfields = 3;
+    mwSize attr_struct_dims[2];        /* dimensions for attribute level struct array: 1-by-sth */
+    int attr_field_Name;
+    int attr_field_Type;
+    int attr_field_Value;
+
+    errorCheck(nlhs, nrhs, prhs);
+
+    /*mexPrintf("nrhs=%d  nlhs=%d\n", nrhs, nlhs);*/
+    
+    /***********************/
+    /* 0. get verbose parameter first */
+    verbose = (int)mxGetScalar(prhs[1]);
+    if (verbose) mexPrintf("Verbosity level: %d\n", verbose);
+
+    /* 1. get file handler */
+    if (mxIsChar(prhs[0])) {
+        fname = getString( (mxArray *)prhs[0]);
+        if (verbose) mexPrintf("File name: \"%s\"\n", fname);
+    } 
+
+    /**************************************/
+    /* Open ADIOS file now and get groups */
+    fp = adios_fopen (fname, mpi_comm_dummy);
+    if (fp == NULL) {
+       mexErrMsgIdAndTxt("MATLAB:adiosopenc:open",adios_errmsg());
+    }
+    if (verbose) mexPrintf("Number of adios groups: %d, fp=%lld\n", fp->groups_count, (int64_t) fp);
+
+    /******************************/
+    /* Create top level structure */
+    if (verbose) mexPrintf("Create top struct array, 1-by-1\n");
+    plhs[0] = mxCreateStructArray(2, top_struct_dims, ntopfields, top_field_names);
+    top_field_Name = mxGetFieldNumber(plhs[0],"Name");
+    top_field_FileHandler = mxGetFieldNumber(plhs[0],"FileHandler");
+    top_field_TimeStart = mxGetFieldNumber(plhs[0],"TimeStart");
+    top_field_TimeSteps = mxGetFieldNumber(plhs[0],"TimeSteps");
+    top_field_Groups = mxGetFieldNumber(plhs[0],"Groups");
+    mxSetFieldByNumber(plhs[0],0,top_field_Name,mxCreateString(fname));
+    arr = valueToMatlabValue(&fp, mxINT64_CLASS, mxREAL);
+    mxSetFieldByNumber(plhs[0],0,top_field_FileHandler,arr);
+    arr = mxCreateNumericMatrix( 1, 1, mxINT32_CLASS, mxREAL);
+    *(int32_t *)mxGetData(arr) = fp->tidx_start;
+    mxSetFieldByNumber(plhs[0],0,top_field_TimeStart,arr);
+    arr = mxCreateNumericMatrix( 1, 1, mxINT32_CLASS, mxREAL);
+    *(int32_t *)mxGetData(arr) = fp->ntimesteps;
+    mxSetFieldByNumber(plhs[0],0,top_field_TimeSteps,arr);
+    /* Create top.Groups structure array */
+    if (verbose) mexPrintf("Create top.Groups struct array, 1-by-%d\n",fp->groups_count);
+    group_struct_dims[0] = 1;
+    group_struct_dims[1] = fp->groups_count;
+    groups = mxCreateStructArray(2, group_struct_dims, ngroupfields, group_field_names);
+    mxSetFieldByNumber(plhs[0],0,top_field_Groups,groups);
+
+
+    /****************************/
+    /* Fill in Groups structure */
+    group_field_Name = mxGetFieldNumber(groups,"Name");
+    group_field_GroupHandler = mxGetFieldNumber(groups,"GroupHandler");
+    group_field_Variables = mxGetFieldNumber(groups,"Variables");
+    group_field_Attributes = mxGetFieldNumber(groups,"Attributes");
+
+    for (gi = 0; gi < fp->groups_count; gi++) {
+        /* Get info of one group: handler, list of vars, list of attrs */
+        if (verbose) mexPrintf("Group %s: get info\n", fp->group_namelist[gi]);
+        gp = adios_gopen_byid(fp, gi);
+        if (gp == NULL) {
+           mexErrMsgIdAndTxt("MATLAB:adiosopenc:groupinfo",adios_errmsg());
+        }
+        if (verbose) mexPrintf("    %d variables and %d attributes\n", gp->vars_count, gp->attrs_count);
+        /* Group fields for gi-th group */
+        mxSetFieldByNumber(groups,gi,group_field_Name,mxCreateString(fp->group_namelist[gi]));
+        mexPrintf("Group gp=%lld id=%d vcnt=%d\n", (int64_t)gp, gp->grpid, gp->vars_count);
+        arr = valueToMatlabValue(&gp, mxINT64_CLASS, mxREAL);
+        mxSetFieldByNumber(groups,gi,group_field_GroupHandler,arr);
+        /* Create top.Groups.Variables structure array */
+        var_struct_dims[0] = 1;
+        var_struct_dims[1] = gp->vars_count;
+        vars = mxCreateStructArray(2, var_struct_dims, nvarfields, var_field_names);
+        mxSetFieldByNumber(groups,gi,group_field_Variables,vars);
+        var_field_Name = mxGetFieldNumber(vars,"Name");
+        var_field_Type = mxGetFieldNumber(vars,"Type");
+        var_field_Dims = mxGetFieldNumber(vars,"Dims");
+        var_field_Timedim = mxGetFieldNumber(vars,"Timedim");
+        var_field_GlobalMin = mxGetFieldNumber(vars,"GlobalMin");
+        var_field_GlobalMax = mxGetFieldNumber(vars,"GlobalMax");
+        /* Create top.Groups.Attributes structure array */
+        attr_struct_dims[0] = 1;
+        attr_struct_dims[1] = gp->attrs_count;
+        attrs = mxCreateStructArray(2, attr_struct_dims, nattrfields, attr_field_names);
+        mxSetFieldByNumber(groups,gi,group_field_Attributes,attrs);
+        attr_field_Name = mxGetFieldNumber(attrs,"Name");
+        attr_field_Type = mxGetFieldNumber(attrs,"Type");
+        attr_field_Value = mxGetFieldNumber(attrs,"Value");
+
+        /******************************/
+        /* Add variables to the group */
+
+        if (verbose>1) mexPrintf("    Variables\n");
+        for (vi=0; vi < gp->vars_count; vi++) {
+            vinfo = adios_inq_var_byid( gp, vi);
+            if (vinfo == NULL) {
+               mexErrMsgIdAndTxt("MATLAB:adiosopenc:varinfo",adios_errmsg());
+            }
+            /* Flip dimensions from ADIOS-read-api/C/row-major order to Matlab/Fortran/column-major order */
+            swap_order(vinfo->ndim, vinfo->dims);
+
+            if (verbose>1) {
+                mexPrintf("      %s: ndims=%d, adios type=%s, timedim=%d dimensions [", 
+                gp->var_namelist[vi], vinfo->ndim, adios_type_to_string(vinfo->type), vinfo->timedim);
+                for (i=0; i<vinfo->ndim; i++)
+                    mexPrintf("%lld ", vinfo->dims[i]);
+                mexPrintf("]\n");
+            }
+            /* field NAME */
+            mxSetFieldByNumber(vars,vi,var_field_Name,mxCreateString(gp->var_namelist[vi]));
+            /* field TYPE */
+            mxtype = adiostypeToMatlabClass(vinfo->type, &complexFlag);
+            arr = mxCreateNumericMatrix( 1, 1, mxtype, complexFlag);
+            mxSetFieldByNumber(vars,vi,var_field_Type,mxCreateString(mxGetClassName(arr)));
+            mxDestroyArray(arr);
+            /* field DIMS */
+            if (vinfo->ndim > 0) {
+                arr = mxCreateNumericMatrix( 1, vinfo->ndim, mxINT32_CLASS, mxREAL);
+                int32p = (int32_t *)mxGetData(arr);
+                for (i=0; i<vinfo->ndim; i++) 
+                    int32p[i] = (int32_t) vinfo->dims[i];
+            } else {
+                arr = mxCreateNumericMatrix( 0, 0, mxINT32_CLASS, mxREAL);
+            }
+            mxSetFieldByNumber(vars,vi,var_field_Dims,arr);
+
+            /* field TIMEDIM */
+            /* Timedim is -1,0...ndim-1 in C, 0,1..ndim in Matlab */
+            timedim = vinfo->timedim + 1;
+            arr = valueToMatlabValue((void *)(&timedim), mxINT32_CLASS, mxREAL);
+            mxSetFieldByNumber(vars,vi,var_field_Timedim,arr);
+
+            /* field GLOBALMIN */
+            arr = valueToMatlabValue(vinfo->gmin, mxtype, complexFlag);
+            mxSetFieldByNumber(vars,vi,var_field_GlobalMin,arr);
+
+            /* field GLOBALMAX */
+            arr = valueToMatlabValue(vinfo->gmax, mxtype, complexFlag);
+            mxSetFieldByNumber(vars,vi,var_field_GlobalMax,arr);
+
+            adios_free_varinfo(vinfo);
+        }
+
+
+
+        /******************************/
+        /* Add attributes to the group */
+
+        if (verbose>1) mexPrintf("    Attributes\n");
+        for (ai=0; ai < gp->attrs_count; ai++) {
+            status = adios_get_attr_byid( gp, ai, &adiostype, &asize, &data);
+            if (status != 0) {
+               mexErrMsgIdAndTxt("MATLAB:adiosopenc:varinfo",adios_errmsg());
+            }
+            if (verbose>1) 
+                mexPrintf("      %s: adios type=%s, size=%d\n", 
+                gp->attr_namelist[ai], adios_type_to_string(adiostype), asize);
+            /* field NAME */
+            mxSetFieldByNumber(attrs,ai,attr_field_Name,mxCreateString(gp->attr_namelist[ai]));
+            /* field TYPE */
+            mxtype = adiostypeToMatlabClass(adiostype, &complexFlag);
+            arr = mxCreateNumericMatrix( 1, 1, mxtype, complexFlag);
+            mxSetFieldByNumber(attrs,ai,attr_field_Type,mxCreateString(mxGetClassName(arr)));
+            mxDestroyArray(arr);
+            /* field VALUE */
+            arr = valueToMatlabValue(data, mxtype, complexFlag);
+            mxSetFieldByNumber(attrs,ai,attr_field_Value,arr);
+
+            free(data); /* we do not store attribute values yet */
+
+        }
+
+        if (verbose>1) mexPrintf("    finished defining group\n");
+    }
+
+
+    if (verbose) mexPrintf("return from adiosopenc\n");
+}
+
+mxArray * valueToMatlabValue( void * data, mxClassID mxtype, mxComplexity complexFlag)
+{
+    /* copies values in all cases, so one can free(data) later */
+    mxArray *arr;
+    if (data == NULL) {
+        arr = mxCreateString("undefined");
+    } else if (mxtype == mxCHAR_CLASS) {
+        arr = mxCreateString((char *)data);
+    } else if (complexFlag == mxCOMPLEX) {
+        arr = mxCreateDoubleMatrix( 1, 1, mxCOMPLEX);
+        if (mxtype == mxSINGLE_CLASS) {
+            *(double *)mxGetPr(arr) = ((float *)data)[0];
+            *(double *)mxGetPi(arr) = ((float *)data)[1];
+        } else {
+            *(double *)mxGetPr(arr) = ((double *)data)[0];
+            *(double *)mxGetPi(arr) = ((double *)data)[1];
+        }
+    } else {
+        arr = mxCreateNumericMatrix( 1, 1, mxtype, mxREAL);
+        memcpy( mxGetData(arr), data, mxGetElementSize(arr));
+    }
+    return arr;
+}
+
+void errorCheck(int nlhs, int nrhs, const mxArray *prhs[]){
+    /* Assume that we are called from adiosread.m which checks the arguments already */
+    /* Check for proper number of arguments. */
+    
+    if ( nrhs != 2 ) {
+        mexErrMsgIdAndTxt("MATLAB:adiosopenc:rhs","This function needs exactly 2 arguments: File, Verbose");
+    }
+    
+    if ( !mxIsChar(prhs[0]) ) {
+        mexErrMsgIdAndTxt("MATLAB:adiosopenc:rhs","First arg must be a string.");
+    } 
+    
+    if ( !mxIsNumeric(prhs[1]) ) {
+        mexErrMsgIdAndTxt("MATLAB:adiosopenc:rhs","Second arg must be a number.");
+    } 
+    
+    if ( nlhs > 1 ) {
+        mexErrMsgIdAndTxt("MATLAB:adiosopenc:lhs","Too many output arguments.");
+    }
+    
+#if !defined(MX_COMPAT_32)
+    /* Make sure that it is safe to cast dim to mwSize when using largeArrayDims.*/
+    if ( dim > MWSIZE_MAX ) {
+        mexErrMsgIdAndTxt("MATLAB:adiosopenc:dimensionTooLarge",
+                          "The input dimension, %.0f, is larger than the maximum value of mwSize, %u, when built with largeArrayDims.", dim, MWSIZE_MAX);
+    }
+#endif
+ }
+
+
+/** Make a C char* string from a Matlab string */
+char* getString(const mxArray *mxstr) 
+{
+    mwSize buflen;
+    char   *str;
+    /* Allocate enough memory to hold the converted string. */
+    buflen = mxGetNumberOfElements(mxstr) + 1;
+    str = mxCalloc(buflen, sizeof(char));
+    /* Copy the string data from string_array_ptr and place it into buf. */
+    if (mxGetString(mxstr, str, buflen) != 0)
+        mexErrMsgTxt("Could not convert string data from the file name.");
+    return str;
+}
+
+/** return the appropriate class for an adios type (and complexity too) */
+mxClassID adiostypeToMatlabClass(enum ADIOS_DATATYPES type, mxComplexity *complexity ) 
+{
+    *complexity = mxREAL;
+    switch( type ) {
+        case adios_unsigned_byte:
+            return mxUINT8_CLASS;
+        case adios_byte:
+            return mxINT8_CLASS;
+        case adios_string:
+            return mxCHAR_CLASS;
+               
+        case adios_unsigned_short:
+            return mxUINT16_CLASS;
+        case adios_short:
+            return mxINT16_CLASS;
+
+        case adios_unsigned_integer:
+            return mxUINT32_CLASS;
+        case adios_integer:
+            return mxINT32_CLASS;
+
+        case adios_unsigned_long:
+            return mxUINT64_CLASS;
+        case adios_long:
+            return mxINT64_CLASS;
+
+        case adios_real: 
+            return mxSINGLE_CLASS;
+        case adios_double:
+            return mxDOUBLE_CLASS;
+             
+        case adios_complex:     /* 8 bytes */
+            *complexity = mxCOMPLEX;
+            return mxSINGLE_CLASS;
+        case adios_double_complex: /*  16 bytes */
+            *complexity = mxCOMPLEX;
+            return mxDOUBLE_CLASS;
+
+        case adios_long_double: /* 16 bytes */
+        default:
+            mexErrMsgIdAndTxt("MATLAB:adiosopenc.c:dimensionTooLarge",
+                 "Adios type %d (%s) not supported in visit.\n",
+                 type, adios_type_to_string(type));
+            break;
+    }
+    return 0; /* just to avoid warnings. never executed */
+}
+
+
+/* Reverse the order in an array in place.
+   use swapping from Matlab/Fortran/column-major order to ADIOS-read-api/C/row-major order and back
+*/
+static void swap_order(int n, uint64_t *array)
+{
+    int i, tmp;
+    for (i=0; i<n/2; i++) {
+        tmp = array[i];
+        array[i] = array[n-1-i];
+        array[n-1-i] = tmp;
+    }
+}
+
+
diff --git a/tools/matlab/adiosread.m b/tools/matlab/adiosread.m
new file mode 100644
index 0000000..75abe8d
--- /dev/null
+++ b/tools/matlab/adiosread.m
@@ -0,0 +1,268 @@
+function [data, attributes] = adiosread(varargin)
+%ADIOSREAD Read data from an ADIOS BP file.
+%   
+%   ADIOSREAD can read in data with different call options.
+%   The simplest way is to give the name of the file and the path
+%   to a variable/attribute. If you have more than one adios groups
+%   stored in one file, you should supply the group name as well.
+%   In these cases, the library opens the file, reads in the data
+%   and closes the file. 
+%
+%   Note: the adios group is not the same as HDF5 groups. Each variable has
+%   a path, which defines a logical hierarchy of the variables within one 
+%   adios group. This logical hierarchy is what is similar to HDF5 groups.
+%
+%   DATA = ADIOSREAD(FILE, VARPATH) 
+%      Read complete DATA from FILE with path VARPATH.
+%      Use only if you have only one adios group in the file or you know that
+%      the VARPATH is in the first adios group in the file.
+%
+%   DATA = ADIOSREAD(FILE, GROUP, VARPATH) 
+%      Read complete DATA from an adios GROUP of FILE with path VARPATH.
+%      Use this form if you have more than one ADIOS group in the file.
+%      GROUP is either a group name (string) or an index of the groups
+%      (integer, starting from 1).
+% 
+%   DATA = ADIOSREAD(GROUPSTRUCT, VARPATH) 
+%      If you have opened the file with ADIOSOPEN, you can supply the
+%      the group struct to read in a variable/attribute.
+%      GROUPSTRUCT must be one of the info.Groups array.
+%      When finished reading all data, close the file with ADIOSCLOSE. 
+%
+%   DATA... = ADIOSREAD( ..., 'Slice', SLICEDEF)
+%      You can read a portion of a variable. 
+%      A slice is defined as an N-by-2 array of integers, where N is the 
+%      number of dimensions of the variable (or less). A tuple describes the 
+%      "start" and "count" values. The "start" values start from 1.
+%          E.g. [1 10; 5 2] reads the first 10 values in the first dimension
+%      and 2 values from the 5th value in the second dimension resulting in
+%      a 10-by-2 array. 
+%          You can use negative numbers to index from the end of the array
+%      as in python. -1 refers to the last element of the array, -2 the one
+%      before and so on. 
+%          E.g. [-1 1] reads in the last value of a 1D array. 
+%               [1 -1] reads in the complete dimension.
+%      If the slice definition has less rows than the number of dimensions
+%      of the variable, [1 -1] rows are added automatically to read those
+%      dimensions completely.
+%          If the slice definition has more rows than the number of dimensions
+%      of the variable, the extra slice definitions will be ignored.
+%
+%   DATA... = ADIOSREAD( ..., 'Verbose', VALUE)
+%      To get logging from the adiosread code, set Verbose to 1 or higher.
+%      Higher values cause more and more details to be printed. 
+%
+%   Please read the file adioscopyright.txt for more information.
+%
+%   See also ADIOSOPEN, ADIOSCLOSE, ADIOS.
+
+%   Copyright 2009 UT-BATTELLE, LLC
+%   $Revision: 1.0 $  $Date: 2009/08/05 12:53:41 $
+%   Author: Norbert Podhorszki <pnorbert at ornl.gov>
+
+%
+% Process arguments.
+%
+
+checkArgCounts(varargin{:});
+[args, msg] = parse_inputs(varargin{:});
+if (~isempty(msg))
+    error('MATLAB:adiosread:inputParsing', '%s', msg);
+end
+
+if (isnumeric(args.Group))
+    if (isa(args.Group, 'int64'))
+        gn=sprintf('Group handler=%lld',args.Group);
+    else
+        gn=sprintf('Group index=%d',args.Group);
+    end
+else
+    gn=sprintf('Group name=%s',args.Group);
+end
+offsets=sprintf('%d ', args.Offsets);
+counts=sprintf('%d ', args.Counts);
+verbose=sprintf('%d ', args.Verbose);
+
+input = sprintf('adiosreadc:\n  File name=%s \n  %s \n  Var=%s\n  Offsets=[%s]  Counts=[%s] \n  Verbose=%s', ...
+ args.File, gn, args.Path, offsets, counts, verbose);
+if (args.Verbose > 0) 
+    CallArguments = input
+end
+
+
+if (nargout == 1)
+    data = adiosreadc(args.File, args.Group, args.Path, args.Offsets, args.Counts, args.Verbose);
+else 
+    adiosreadc(args.File, args.Group, args.Path, args.Offsets, args.Counts, args.Verbose);
+end
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% FUNCTION:   checkArgCounts %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+function checkArgCounts(varargin)
+
+if (nargin < 2)
+    error('MATLAB:adiosread:notEnoughInputs', ...
+          'ADIOSREAD requires at least two input arguments.')
+end
+
+
+if (nargout > 1)
+    error('MATLAB:adiosread:tooManyOutputs', ...
+          'ADIOSREAD requires one or fewer output arguments.')
+end
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% FUNCTION:   parse_inputs   %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+function [args, msg] = parse_inputs(varargin)
+
+args.File    = '';
+args.Group   = '';
+args.Path    = '';
+args.Offsets = []; % start positions in each dimension for slicing
+args.Counts  = []; % counts in each dimension for slicing
+args.Verbose = 0;  % verbosity, default is off, i.e. 0
+
+msg = '';
+
+% Arg 1: file name or int64 group handler
+if ischar(varargin{1})
+    args.File = varargin{1};
+    %
+    % Verify existence of filename
+    %
+    fid = fopen(args.File);    
+    if (fid == -1)
+        % Look for filename with extensions.
+        fid = fopen([args.File '.bp']);
+    end
+
+    if (fid == -1)
+        error('MATLAB:hdf5read:fileOpen', ...
+              'Couldn''t open file (%s).', ...
+              args.File)
+    else
+        % Get full filename 
+        args.File = fopen(fid);
+        fclose(fid);
+    end
+elseif (isa(varargin{1}, 'struct'))
+    try
+        grp = varargin{1};
+        args.Group = grp.GroupHandler; % int64
+    catch
+        msg = ['Input is not a group struct of the info struct ' ...
+               'returned by ADIOSOPEN'];
+        return
+    end
+else
+    msg = ['1st arg should be a string FILE argument to ADIOSREAD ' ...
+           'or a group struct from ADIOSOPEN'];
+    return
+end
+
+% Arg 2 and maybe 3: group and varpath
+if (rem(nargin, 2) == 0)
+    % even number of arguments: FILE, VARPATH, ...
+    args.Path = varargin{2};
+    varargin = {varargin{3:end}};
+else
+    % odd number of arguments: FILE, GROUP, VARPATH, ...
+    if (args.Group ~= '') 
+        msg = ['GROUPHANDLER, GROUP, VARPATH is not an accepted argument list'];
+        return
+    end
+    args.Group = varargin{2};
+    args.Path = varargin{3};
+    varargin = {varargin{4:end}};
+    % check type of Group
+    if ((~ischar(args.Group)) && (~isnumeric(args.Group))) 
+        msg = ['GROUP input argument to ADIOSREAD must be a string or a number'];
+        return
+    end
+    if (isnumeric(args.Group))
+        % convert group index to int32
+        args.Group = int32(args.Group);
+    end
+end
+% check type of Path
+if ~ischar(args.Path)
+    msg = ['VARPATH input argument to ADIOSREAD must be string.'];
+    return
+end
+
+% Parse optional arguments based on their number.
+if (length(varargin) > 0)
+    
+    paramStrings = {'slice', 'verbose'};
+    
+    % For each pair
+    for k = 1:2:length(varargin)
+        param = lower(varargin{k});
+            
+        if (~ischar(param))
+            msg = 'Parameter name must be a string.';
+            return
+        end
+        
+        idx = strmatch(param, paramStrings);
+        
+        if (isempty(idx))
+            msg = sprintf('Unrecognized parameter name "%s".', param);
+            return
+        elseif (length(idx) > 1)
+            msg = sprintf('Ambiguous parameter name "%s".', param);
+            return
+        end
+
+        switch (paramStrings{idx})
+        % SLICE
+        case 'slice'
+            if (k == length(varargin))
+                msg = 'No slicing value specified for Slice option.';
+                return
+            end
+        
+            slices = varargin{k+1};
+            if ((~isnumeric(slices)) || ...
+                (~isempty(slices) && size(slices, 2) ~= 2) || ...
+                (~isempty(find(rem(slices, 1) ~= 0))))
+
+                msg = 'Slice values must be n-by-2 array of integers.';
+                return
+            end
+
+            if (~isempty(slices))
+                args.Offsets = int64(fix(slices(:,1)));
+                args.Counts = int64(fix(slices(:,2)));
+            else
+                args.Offsets = int64([]);
+                args.Counts = int64([]);
+            end
+            
+        % VERBOSE
+        case 'verbose'
+            if (k == length(varargin))
+                msg = 'No value specified for Verbose option.';
+                return
+            end
+        
+            args.Verbose = varargin{k+1};
+            if ((~isnumeric(args.Verbose)) || ...
+                (~isempty(find(rem(args.Verbose, 1) ~= 0))))
+                
+                msg = sprintf('''VERBOSE'' must be an integer.');
+                return
+            end
+            if (args.Verbose < 0)
+                msg = sprintf('''VERBOSE'' must be greater or equal to zero.');
+                return
+            end
+        end
+    end
+end
diff --git a/tools/matlab/adiosreadc.c b/tools/matlab/adiosreadc.c
new file mode 100644
index 0000000..8831aa5
--- /dev/null
+++ b/tools/matlab/adiosreadc.c
@@ -0,0 +1,458 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/*=================================================================
+ * adiosreadc.c - read a variable/attribute from an ADIOS file
+ *
+ * Input: File, Group, Path, Offset, Count, Verbose
+ *    File:     string (name) or int64 (handler)
+ *    Group:    string (name) or int64 (handler) or int32 (index)
+ *    Path:     string (variable/attribute name with full path)
+ *    Offset:   int32 array 
+ *    Count:    int32 array
+ *    Verbose:  numeric (double)
+ * Output: The variable/attribute as mxArray
+ *
+ *
+ * $Revision: 1.0 $  $Date: 2009/08/05 12:53:41 $
+ * Author: Norbert Podhorszki <pnorbert at ornl.gov>
+ *=================================================================*/
+
+#include <string.h>    /* strlen */
+#include "mex.h"
+#include "adios_read.h"
+#include "adios_types.h"
+
+static int verbose=0;
+
+mxArray* readdata( ADIOS_GROUP *gp, const char *path, int in_noffsets, 
+                   const int64_t *in_offsets, const int64_t *in_counts);
+void errorCheck(int nlhs, int nrhs, const mxArray *prhs[]);
+char* getString(const mxArray *mxstr);
+mxClassID adiostypeToMatlabClass(enum ADIOS_DATATYPES type, mxComplexity *complexity);
+mxArray* createMatlabArray( enum ADIOS_DATATYPES adiostype, int ndims, uint64_t *dims); 
+void recalc_offsets( int ndims, uint64_t *dims, mwSize in_noffsets, 
+                     const int64_t *in_offsets, const int64_t *in_counts,
+                     uint64_t *offsets, uint64_t *counts);
+static void swap_order(int n, uint64_t *array);
+
+
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+    char *fname;        /* file name */
+    char *gname;        /* group name */
+    char *path;         /* name of variable or attribute */
+    mwSize in_noffsets;    /* number of offsets provided, = number of counts */
+    int64_t *in_offsets;    /* offset array provided */
+    int64_t *in_counts;     /* count array provided */
+    int status;
+    char msg[512];        /* error messages from function calls */
+
+    int64_t fh, gh, *int64p; /* file and group handlers and temp pointers */
+    int32_t *int32p;
+    int  haveToCloseFile, haveToCloseGroup, readAttributesToo;
+
+    ADIOS_FILE *fp;
+    ADIOS_GROUP *gp;
+    int mpi_comm_dummy; 
+
+    int i;
+    mxArray *out;        /* output data array */
+    const char *field_names[] = {"name", "value"}; /* 2nd output arg's struct fields */
+    mwSize attr_struct_dims[2];   /* dimensions for 2nd arg struct array: 1-by-sth */
+
+    errorCheck(nlhs, nrhs, prhs);
+
+    /*mexPrintf("nrhs=%d  nlhs=%d\n", nrhs, nlhs);*/
+    
+    /***********************/
+    /* 1. get verbose parameter first */
+    verbose = (int)mxGetScalar(prhs[5]);
+    if (verbose) mexPrintf("Verbosity level: %d\n", verbose);
+
+    /***********************/
+    /* 1. get file handler */
+    fp = NULL;
+    haveToCloseFile = 0;
+    if (mxIsChar(prhs[0])) {
+        fname = getString( (mxArray *)prhs[0]);
+        if (strlen(fname) > 0) {
+            if (verbose) mexPrintf("File name: \"%s\"\n", fname);
+            /* Open ADIOS file now */
+            fp = adios_fopen (fname, mpi_comm_dummy);
+            if (fp == NULL) {
+                mexErrMsgIdAndTxt("MATLAB:adiosreadc:open",adios_errmsg());
+            }
+            haveToCloseFile = 1;
+        }
+    } 
+
+
+    /************************/
+    /* 2. get group handler */
+    if (mxIsInt64(prhs[1])) { /* int64 group handler provided */
+        int64p = (int64_t *) mxGetData(prhs[1]); 
+        gp = (ADIOS_GROUP *) *int64p;
+        mexPrintf("Group gp=%lld id=%d vcnt=%d\n", (int64_t)gp, gp->grpid, gp->vars_count);
+        haveToCloseGroup = 0;
+    } else {
+        /* reference to a group in file */
+        if (fp == NULL) {
+            mexErrMsgIdAndTxt("MATLAB:adiosreadc:open",
+               "Group argument must be an open group struct if File argument is not provided\n");
+        }
+
+        if (mxIsChar(prhs[1])) {
+            gname = getString( (mxArray *)prhs[1]);
+        if (verbose) mexPrintf("Group name: \"%s\"\n", gname );
+
+            /* empty groupname -> first group in the file */
+            if ( strlen(gname)==0 || !strcmp(gname,"/") || !strcmp(gname," ")) {
+                gp = adios_gopen_byid(fp, 0);
+                if (gp == NULL) {
+                    mexErrMsgIdAndTxt("MATLAB:adiosreadc:open",adios_errmsg());
+                }
+            } else {
+                /* Open group by name */
+                gp = adios_gopen(fp, gname);
+                if (gp == NULL) {
+                    mexErrMsgIdAndTxt("MATLAB:adiosreadc:open",adios_errmsg());
+                }
+            }
+            haveToCloseGroup = 1;
+
+        } else if (mxIsInt32(prhs[1])) { /* group index provided */
+            int32p  = (int32_t *) mxGetData(prhs[1]); 
+            if (verbose) mexPrintf("Group index: %d\n", *int32p);
+            gname = NULL;
+
+            /* group index in Matlab starts from 1, in adios starts from 0 */
+            /* Open group by index */
+            gp = adios_gopen_byid(fp, *int32p-1);
+            if (gp == NULL) {
+                mexErrMsgIdAndTxt("MATLAB:adiosreadc:open",adios_errmsg());
+            }
+            haveToCloseGroup = 1;
+        }
+    }
+
+    /*****************************************************************************************/
+    /* 3. get other arguments: char variable name, int64 in_offsets[], int64 in_counts[] */
+    path     = getString(prhs[2]);
+    if (verbose) mexPrintf("Variable name: \"%s\"\n", path );
+    in_noffsets = mxGetNumberOfElements(prhs[3]);
+    in_offsets  = (int64_t *) mxGetData(prhs[3]); 
+    in_counts   = (int64_t *) mxGetData(prhs[4]); 
+
+
+    /*********************************************************************/
+    /* 4. read in variable */
+    out = readdata( gp, path, in_noffsets, in_offsets, in_counts);
+    if ( nlhs >= 1 ) {
+        plhs[0] = out;
+    }
+
+    /********************************************************/
+    /* 5. read in all attributes of a variable if requested */
+#if 0
+    if ( nlhs == 2 ) {
+        if (!isvar) {
+            mexErrMsgIdAndTxt("MATLAB:adiosreadc:read",
+               "Second output argument can be provided only for variables. Path %s refers to an attribute.",
+               path);
+        } else {
+            /* Read all attributes directly under the given path (= path/name) */
+            if (verbose) mexPrintf("Read in attributes under the path %s\n", path);
+            nattrs = adios_readutil_getdirectattributes(gh, path, &attrlist); 
+            if (verbose) mexPrintf("Found %d matching attributes\n", nattrs);
+            attr_struct_dims[0] = 1;
+            attr_struct_dims[1] = nattrs;
+            /* Create a 1-by-n array of structs with fields {name,value}. */ 
+            plhs[1] = mxCreateStructArray(2, attr_struct_dims, 2, field_names);
+            if (verbose) mexPrintf("Created struct array, 1-by-%d\n", attr_struct_dims[1]);
+            i=0;
+            attr=attrlist;
+            while (attr != NULL) {
+                mxSetFieldByNumber(plhs[1],i,0,mxCreateString(attr->name));
+                out = readdata( fh, gh, attr->name, 0, NULL, NULL, timestep, &isvar);
+                mxSetFieldByNumber(plhs[1],i,1,out);
+                if (verbose) mexPrintf("Added attr: %s\n", attr->name);
+                i++;
+                attr=attr->next;
+            }
+            adios_readutil_freenamelist(attrlist);
+        }
+    }
+#endif
+
+
+    /**************************************************/
+    /* 6. close group and file if opened in this call */
+    if (haveToCloseGroup) {
+        if (verbose) mexPrintf("Close group\n");
+        adios_gclose(gp);
+        if (gname) 
+            mxFree(gname);
+    }
+
+    if (haveToCloseFile) {
+        if (verbose) mexPrintf("Close file\n");
+        adios_fclose(fp);
+        if (fname)
+            mxFree(fname);
+    }
+
+
+    mxFree(path);
+
+}
+
+mxArray* readdata( ADIOS_GROUP *gp, const char *path, mwSize in_noffsets,
+                   const int64_t *in_offsets, const int64_t *in_counts) 
+{
+    /* FIXME: does not work for COMPLEX data because
+       adios stores real and imaginary together as Fortran Complex type does, 
+       while matlab stores them as two separate float/double arrays
+    */
+    void *data;             /* content of variable read in */
+    uint64_t offsets[16], counts[16]; /* extended offsets/counts */
+    int64_t read_bytes;
+    uint64_t arraysize;
+    int  status, i;
+    mxArray * out;
+    char msg[512];
+    ADIOS_VARINFO *vinfo;
+
+    /* get type/size info on variable */
+    if (verbose) mexPrintf("Get info on var: %s\n", path);
+    vinfo = adios_inq_var( gp, path);
+    if (vinfo == NULL) {
+        mexErrMsgIdAndTxt("MATLAB:adiosreadc:varinfo",adios_errmsg());
+    }
+    if (verbose) { 
+        mexPrintf("Var=%s type=%s C dimensions %dD [", path, adios_type_to_string(vinfo->type), vinfo->ndim);
+        for (i=0; i<vinfo->ndim; i++)
+            mexPrintf("%lld ", vinfo->dims[i]);
+        mexPrintf("]\n");
+    }
+
+    /* Flip dimensions from ADIOS-read-api/C/row-major order to Matlab/Fortran/column-major order */
+    swap_order(vinfo->ndim, vinfo->dims);
+
+    /* extend offsets/counts if needed, change from 1..N to 0..N-1 indexing and
+       interpret negative indices */
+    recalc_offsets( vinfo->ndim, vinfo->dims, in_noffsets, in_offsets, in_counts, offsets, counts);
+
+    /* create Matlab array with the appropriate type and size */
+    if (vinfo->type == adios_string) {
+        /* Matlab string != char array of C, so handle separately */
+        data = (void *) mxCalloc(vinfo->dims[0], sizeof(char));
+    } else {
+        if (verbose) { 
+            mexPrintf("Create %d-D Matlab array [", vinfo->ndim);
+            for (i=0; i<vinfo->ndim; i++)
+                mexPrintf("%lld ", counts[i]);
+            mexPrintf("]\n");
+        }
+        out = createMatlabArray(vinfo->type, vinfo->ndim, counts); 
+        data = (void *) mxGetData(out);
+    }
+
+    /* Flip offsets/counts from Matlab/Fortran/column-major order to ADIOS-read-api/C/row-major order */
+    swap_order(vinfo->ndim, offsets);
+    swap_order(vinfo->ndim, counts);
+
+    /* read in data */
+    if (verbose) mexPrintf("Read in data\n");
+    
+    read_bytes = adios_read_var_byid( gp, vinfo->varid, offsets, counts, data);
+    if (read_bytes < 0) {
+        mexErrMsgIdAndTxt("MATLAB:adiosreadc:read",adios_errmsg());
+    }
+    if (verbose) mexPrintf("Read in %lld bytes\n", read_bytes);
+
+    if (vinfo->type == adios_string) {
+        out = mxCreateString( (char *)data);
+        mxFree(data);
+    }
+
+    adios_free_varinfo(vinfo);
+    return out;
+}
+    
+
+void errorCheck(int nlhs, int nrhs, const mxArray *prhs[]){
+    /* Assume that we are called from adiosread.m which checks the arguments already */
+    /* Check for proper number of arguments. */
+    
+    if ( nrhs != 6 ) {
+        mexErrMsgIdAndTxt("MATLAB:adiosreadc:rhs","This function needs exactly 6 arguments: File, Group, Varpath, Offsets, Counts, Verbose");
+    }
+    
+    if ( !mxIsChar(prhs[0]) && !mxIsInt64(prhs[0]) ) {
+        mexErrMsgIdAndTxt("MATLAB:adiosreadc:rhs","First arg must be either a string or an int64 handler.");
+    } 
+    
+    if ( nlhs > 1 ) {
+        mexErrMsgIdAndTxt("MATLAB:adiosreadc:lhs","Too many output arguments.");
+    }
+    
+#if !defined(MX_COMPAT_32)
+    /* Make sure that it is safe to cast dim to mwSize when using largeArrayDims.*/
+    if ( dim > MWSIZE_MAX ) {
+        mexErrMsgIdAndTxt("MATLAB:adiosreadc:dimensionTooLarge",
+                          "The input dimension, %.0f, is larger than the maximum value of mwSize, %u, when built with largeArrayDims.", dim, MWSIZE_MAX);
+    }
+#endif
+ }
+
+
+/** Make a C char* string from a Matlab string */
+char* getString(const mxArray *mxstr) 
+{
+    mwSize buflen;
+    char   *str;
+    /* Allocate enough memory to hold the converted string. */
+    buflen = mxGetNumberOfElements(mxstr) + 1;
+    str = mxCalloc(buflen, sizeof(char));
+    /* Copy the string data from string_array_ptr and place it into buf. */
+    if (mxGetString(mxstr, str, buflen) != 0)
+        mexErrMsgTxt("Could not convert string data from the file name.");
+    return str;
+}
+
+/** return the appropriate class for an adios type */
+mxClassID adiostypeToMatlabClass(enum ADIOS_DATATYPES type, mxComplexity *complexity) 
+{
+    *complexity=mxREAL;
+    switch( type ) {
+        case adios_unsigned_byte:
+            return mxUINT8_CLASS;
+        case adios_byte:
+            return mxINT8_CLASS;
+        case adios_string:
+            return mxCHAR_CLASS;
+               
+        case adios_unsigned_short:
+            return mxUINT16_CLASS;
+        case adios_short:
+            return mxINT16_CLASS;
+
+        case adios_unsigned_integer:
+            return mxUINT32_CLASS;
+        case adios_integer:
+            return mxINT32_CLASS;
+
+        case adios_unsigned_long:
+            return mxUINT64_CLASS;
+        case adios_long:
+            return mxINT64_CLASS;
+
+        case adios_real: 
+            return mxSINGLE_CLASS;
+        case adios_double:
+            return mxDOUBLE_CLASS;
+             
+        case adios_complex:     /* 8 bytes */
+            *complexity = mxCOMPLEX;
+            return mxSINGLE_CLASS;
+        case adios_double_complex: /*  16 bytes */
+            *complexity = mxCOMPLEX;
+            return mxDOUBLE_CLASS;
+
+        case adios_long_double: /* 16 bytes */
+        default:
+            mexErrMsgIdAndTxt("MATLAB:adiosreadc.c:dimensionTooLarge",
+                 "Adios type %d (%s) not supported in visit.\n",
+                 type, adios_type_to_string(type));
+            break;
+    }
+    return 0; /* just to avoid warnings. never executed */
+}
+
+/* create an N-dim array with given type and dimensions */
+mxArray* createMatlabArray( enum ADIOS_DATATYPES adiostype, int ndims, uint64_t *dims)
+{
+    mxClassID mxtype;
+    mxArray *arr;
+    mwSize  mNdims;
+    mwSize  mDims[16];
+    mxComplexity ComplexFlag;
+    int     i;
+    int     isTypeComplex;
+
+    /* convert ints to mwSizes */
+    if (ndims > 0) {
+        mNdims = (mwSize) ndims;
+        for (i=0; i<ndims; i++) 
+            mDims[i] = (mwSize)dims[i];
+    } else {
+        /* 0 dim: scalar value -> 1-by-1 Matlab array */
+        mNdims = 2;
+        mDims[0] = 1;
+        mDims[1] = 1;
+    }
+
+    /* get type */
+    mxtype = adiostypeToMatlabClass(adiostype, &ComplexFlag);
+
+    /* create array */
+    arr = mxCreateNumericArray( mNdims, mDims, mxtype, ComplexFlag);
+
+    if (verbose) mexPrintf("Array for adios type %s is created\n", adios_type_to_string(adiostype));
+
+    return arr;
+}
+
+
+/** - extend offset/count arrays to ndims if needed 
+    - recalculate "from 1" Matlab indices to "from 0" C indices
+    - recalculate the negative indices 
+    !!! Provide the output arrays in the caller !!!
+*/
+void recalc_offsets( int ndims, uint64_t *dims, mwSize in_noffsets, 
+                     const int64_t *in_offsets, const int64_t *in_counts,
+                     uint64_t *offsets, uint64_t *counts)
+{
+    int i;
+    for (i=0; i<ndims; i++) {
+        if ((mwSize)i < in_noffsets) {
+            if (in_offsets[i] < 0) /* negative offset means last-|offset| */
+                offsets[i] = dims[i] + in_offsets[i];
+            else 
+                offsets[i] = in_offsets[i] - 1; /* C index start from 0 */
+
+            if (in_counts[i] < 0) /* negative count means last-|count|+1-start */
+                counts[i]  = dims[i] + in_counts[i] - offsets[i] + 1;
+            else
+                counts[i]  = in_counts[i]; 
+        } else {
+            /* extend offset/count array to match variable's dimensions */
+            if (verbose) mexPrintf("Extend offset/counts for dim %d: offset=%d count=%d\n", i, 0, dims[i] );
+            offsets[i] = 0;
+            counts[i]  = dims[i];
+        }
+
+    }
+}
+
+/* Reverse the order in an array in place.
+   use swapping from Matlab/Fortran/column-major order to ADIOS-read-api/C/row-major order and back
+*/
+static void swap_order(int n, uint64_t *array)
+{
+    int i, tmp;
+    for (i=0; i<n/2; i++) {
+        tmp = array[i];
+        array[i] = array[n-1-i];
+        array[n-1-i] = tmp;
+    }
+}
+
+
+
+
diff --git a/utils/Makefile.am b/utils/Makefile.am
new file mode 100644
index 0000000..dd75545
--- /dev/null
+++ b/utils/Makefile.am
@@ -0,0 +1,10 @@
+SUBDIRS= gpp bpdump bp2ascii bpsplit bpls
+if BUILD_WRITE
+SUBDIRS += adios_lint
+endif
+if HAVE_HDF5
+SUBDIRS += bp2h5
+endif
+if HAVE_NETCDF
+SUBDIRS +=bp2ncd
+endif
diff --git a/utils/Makefile.in b/utils/Makefile.in
new file mode 100644
index 0000000..236428a
--- /dev/null
+++ b/utils/Makefile.in
@@ -0,0 +1,604 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+ at BUILD_WRITE_TRUE@am__append_1 = adios_lint
+ at HAVE_HDF5_TRUE@am__append_2 = bp2h5
+ at HAVE_NETCDF_TRUE@am__append_3 = bp2ncd
+subdir = utils
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = gpp bpdump bp2ascii bpsplit bpls adios_lint bp2h5 \
+	bp2ncd
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+SUBDIRS = gpp bpdump bp2ascii bpsplit bpls $(am__append_1) \
+	$(am__append_2) $(am__append_3)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  utils/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  utils/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(mkdir_p) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-libtool clean-recursive ctags \
+	ctags-recursive distclean distclean-generic distclean-libtool \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-exec install-exec-am install-info \
+	install-info-am install-man install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic maintainer-clean-recursive \
+	mostlyclean mostlyclean-generic mostlyclean-libtool \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/utils/README b/utils/README
new file mode 100644
index 0000000..6b61761
--- /dev/null
+++ b/utils/README
@@ -0,0 +1,41 @@
+executables:
+  adios_lint
+  -- check the XML file for correctness. No news is good news.
+  -- USAGE: ./adios_lint <config.xml>
+
+  bpdump
+  -- convert bp format to netcdf format
+  -- USAGE: ./bpdump [-d [var]|--dump [var]] <filename>
+
+  bp2h5
+  -- convert bp format to netcdf format
+  -- USAGE: ./bp2h5 XXXX.bp (XXXX.h5)
+
+  bp2ascii
+  -- convert bp format to netcdf format
+  -- USAGE: ./bp2ascii XXXX.bp -C[-c] col_name
+
+  bp2ncd
+  -- convert bp format to netcdf format
+  -- USAGE: ./bp2ncd XXXX.bp (XXXX.h5)
+   
+  bp2ncdphi
+  (gtc: RUNcoord.bp PHI_00000.bp)
+  -- convert bp format to netcdf format
+  -- merge the array with the same variable name
+  -- the array index is abstracted from "path_name"
+  -- USAGE: bp2ncdphi XXXX.bp (XXXX.h5)
+
+  bp2ncdxgc
+  (xgc: flowdiag.bp fluxdiag.bp)
+  -- convert bp format to netcdf format
+  -- merge the array with the same variable name
+  -- the array index is abstracted from "istep" scalar var
+  -- USAGE: bp2ncdxgc XXXX.bp (XXXX.h5)
+
+FOLDER  gwrite
+  -- gwrite.py and xmlparser.py
+  -- example of how to modify makefile
+  -- save the expanded version of source codes in the current folder to the user-defined folder name 
+  -- USAGE: python gwrite.py folder_name
+   
diff --git a/utils/adios_lint/Makefile.am b/utils/adios_lint/Makefile.am
new file mode 100644
index 0000000..4bca84d
--- /dev/null
+++ b/utils/adios_lint/Makefile.am
@@ -0,0 +1,17 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+bin_PROGRAMS=adios_lint
+
+adios_lint_SOURCES = adios_lint.c
+adios_lint_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_SEQ_CPPFLAGS) $(ADIOSLIB_SEQ_CFLAGS)
+adios_lint_LDFLAGS = $(ADIOSLIB_SEQ_LDFLAGS)
+adios_lint_LDADD = $(top_builddir)/src/libadios_internal_nompi.a 
+adios_lint_LDADD += $(ADIOSLIB_SEQ_LDADD)
+
+if USE_PARALLEL_COMPILER
+    CC=$(MPICC)
+    CXX=$(MPICXX)
+endif
diff --git a/utils/adios_lint/Makefile.in b/utils/adios_lint/Makefile.in
new file mode 100644
index 0000000..212d54d
--- /dev/null
+++ b/utils/adios_lint/Makefile.in
@@ -0,0 +1,576 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = adios_lint$(EXEEXT)
+subdir = utils/adios_lint
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_adios_lint_OBJECTS = adios_lint-adios_lint.$(OBJEXT)
+adios_lint_OBJECTS = $(am_adios_lint_OBJECTS)
+am__DEPENDENCIES_1 =
+adios_lint_DEPENDENCIES =  \
+	$(top_builddir)/src/libadios_internal_nompi.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(adios_lint_SOURCES)
+DIST_SOURCES = $(adios_lint_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = @CC@
+ at USE_PARALLEL_COMPILER_TRUE@CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+ at USE_PARALLEL_COMPILER_TRUE@CXX = $(MPICXX)
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+adios_lint_SOURCES = adios_lint.c
+adios_lint_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_SEQ_CPPFLAGS) $(ADIOSLIB_SEQ_CFLAGS)
+adios_lint_LDFLAGS = $(ADIOSLIB_SEQ_LDFLAGS)
+adios_lint_LDADD = $(top_builddir)/src/libadios_internal_nompi.a \
+	$(ADIOSLIB_SEQ_LDADD)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  utils/adios_lint/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  utils/adios_lint/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
+	done
+
+clean-binPROGRAMS:
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+adios_lint$(EXEEXT): $(adios_lint_OBJECTS) $(adios_lint_DEPENDENCIES) 
+	@rm -f adios_lint$(EXEEXT)
+	$(LINK) $(adios_lint_LDFLAGS) $(adios_lint_OBJECTS) $(adios_lint_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.c.o:
+	$(COMPILE) -c $<
+
+.c.obj:
+	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+	$(LTCOMPILE) -c -o $@ $<
+
+adios_lint-adios_lint.o: adios_lint.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(adios_lint_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o adios_lint-adios_lint.o `test -f 'adios_lint.c' || echo '$(srcdir)/'`adios_lint.c
+
+adios_lint-adios_lint.obj: adios_lint.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(adios_lint_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o adios_lint-adios_lint.obj `if test -f 'adios_lint.c'; then $(CYGPATH_W) 'adios_lint.c'; else $(CYGPATH_W) '$(srcdir)/adios_lint.c'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic clean-libtool ctags distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-binPROGRAMS uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/utils/adios_lint/adios_lint.c b/utils/adios_lint/adios_lint.c
new file mode 100644
index 0000000..3bd3e2d
--- /dev/null
+++ b/utils/adios_lint/adios_lint.c
@@ -0,0 +1,68 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+// mpi
+//#include "mpi.h"
+
+// xml parser
+#include <mxml.h>
+
+// dart
+#include <sys/uio.h>
+#include "adios.h"
+#include "adios_transport_hooks.h"
+#include "adios_internals.h"
+
+#define STR_LEN 1000
+
+//*****************************************
+// Check the groups as follows:
+//*****************************************
+void check_groups (struct adios_group_list_struct * groups)
+{
+// no extra checks needed
+}
+
+//*****************************************
+// Check the groups as follows:
+// 1. Make sure all method groups match real groups
+//*****************************************
+void check_methods (struct adios_method_list_struct * methods
+                   ,struct adios_group_list_struct * groups
+                   )
+{
+// no extra checks needed
+}
+
+int main (int argc, char ** argv)
+{
+    struct adios_method_list_struct * methods = 0;
+    struct adios_group_list_struct * groups = 0;
+    char * filename;
+
+    if (argc < 2)
+        filename = "config.xml";
+    else
+        filename = argv [1];
+
+    if (!adios_parse_config (filename))
+        return 1;
+
+    methods = adios_get_methods ();
+    groups = adios_get_groups ();
+
+    check_groups (groups);
+    check_methods (methods, groups);
+
+    adios_cleanup ();
+
+    return 0;
+}
diff --git a/utils/bp2ascii/Makefile.am b/utils/bp2ascii/Makefile.am
new file mode 100644
index 0000000..2555871
--- /dev/null
+++ b/utils/bp2ascii/Makefile.am
@@ -0,0 +1,17 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+bin_PROGRAMS = bp2ascii
+
+bp2ascii_SOURCES = bp2ascii.c 
+bp2ascii_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_SEQ_CPPFLAGS) $(ADIOSLIB_SEQ_CFLAGS)
+bp2ascii_LDFLAGS = $(ADIOSLIB_SEQ_LDFLAGS)
+bp2ascii_LDADD = $(top_builddir)/src/libadios_internal_nompi.a
+bp2ascii_LDADD += $(ADIOSLIB_SEQ_LDADD)
+
+if USE_PARALLEL_COMPILER
+    CC=$(MPICC)
+    CXX=$(MPICXX)
+endif
diff --git a/utils/bp2ascii/Makefile.in b/utils/bp2ascii/Makefile.in
new file mode 100644
index 0000000..490b56e
--- /dev/null
+++ b/utils/bp2ascii/Makefile.in
@@ -0,0 +1,575 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = bp2ascii$(EXEEXT)
+subdir = utils/bp2ascii
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_bp2ascii_OBJECTS = bp2ascii-bp2ascii.$(OBJEXT)
+bp2ascii_OBJECTS = $(am_bp2ascii_OBJECTS)
+am__DEPENDENCIES_1 =
+bp2ascii_DEPENDENCIES = $(top_builddir)/src/libadios_internal_nompi.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(bp2ascii_SOURCES)
+DIST_SOURCES = $(bp2ascii_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = @CC@
+ at USE_PARALLEL_COMPILER_TRUE@CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+ at USE_PARALLEL_COMPILER_TRUE@CXX = $(MPICXX)
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+bp2ascii_SOURCES = bp2ascii.c 
+bp2ascii_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_SEQ_CPPFLAGS) $(ADIOSLIB_SEQ_CFLAGS)
+bp2ascii_LDFLAGS = $(ADIOSLIB_SEQ_LDFLAGS)
+bp2ascii_LDADD = $(top_builddir)/src/libadios_internal_nompi.a \
+	$(ADIOSLIB_SEQ_LDADD)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  utils/bp2ascii/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  utils/bp2ascii/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
+	done
+
+clean-binPROGRAMS:
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+bp2ascii$(EXEEXT): $(bp2ascii_OBJECTS) $(bp2ascii_DEPENDENCIES) 
+	@rm -f bp2ascii$(EXEEXT)
+	$(LINK) $(bp2ascii_LDFLAGS) $(bp2ascii_OBJECTS) $(bp2ascii_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.c.o:
+	$(COMPILE) -c $<
+
+.c.obj:
+	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+	$(LTCOMPILE) -c -o $@ $<
+
+bp2ascii-bp2ascii.o: bp2ascii.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bp2ascii_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bp2ascii-bp2ascii.o `test -f 'bp2ascii.c' || echo '$(srcdir)/'`bp2ascii.c
+
+bp2ascii-bp2ascii.obj: bp2ascii.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bp2ascii_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bp2ascii-bp2ascii.obj `if test -f 'bp2ascii.c'; then $(CYGPATH_W) 'bp2ascii.c'; else $(CYGPATH_W) '$(srcdir)/bp2ascii.c'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic clean-libtool ctags distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-binPROGRAMS uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/utils/bp2ascii/bp2ascii.c b/utils/bp2ascii/bp2ascii.c
new file mode 100644
index 0000000..5965818
--- /dev/null
+++ b/utils/bp2ascii/bp2ascii.c
@@ -0,0 +1,277 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+//#include "adios_types.h"
+#include "adios_bp_v1.h"
+#include "adios_read.h"
+
+struct dump_struct
+{
+    char * dump_var;
+    enum ADIOS_FLAG host_language_fortran;
+};
+
+struct var_dim
+{
+    uint16_t id;
+    uint64_t rank;
+};
+
+void print_process_group_header (uint64_t num
+                      ,struct adios_process_group_header_struct_v1 * pg_header
+                      );
+void print_process_group_index (
+                         struct adios_index_process_group_struct_v1 * pg_root
+                         );
+void print_var_header (struct adios_var_header_struct_v1 * var_header);
+
+int main (int argc, char ** argv)
+{
+    char * filename;
+    char * var;
+    char newfilename [256];
+    int i = 0;
+    int rc = 0;
+    uint64_t element_num = 0, element_count;
+    struct adios_bp_element_struct * element = NULL;
+    struct dump_struct dump;
+
+    if (argv [1][0] && argv [1][0] == '-' && argc > 3)
+    {
+        if (   !strcmp (argv [1], "-v")
+            || !strcmp (argv [1], "--var")
+           )
+        {
+            dump.dump_var = argv [2];
+            filename = argv [3];
+            printf("%s %s\n",dump.dump_var,filename);
+	    if (argc > 4)
+	        strcpy (newfilename, argv[4]);
+	    else
+            {
+		strcpy (newfilename, dump.dump_var);
+		strcat (newfilename, ".dat");
+            }
+        }
+        else
+        {
+                fprintf (stderr, "usage: %s [-v [var]|--var [var]] <filename> [newfilename]\n"
+                        ,argv [0]
+                        );
+                return -1;
+        }
+    }    
+    else
+    {
+        fprintf (stderr, "usage: %s [-v [var]|--var [var]] <filename> [newfilename]\n"
+                ,argv [0]
+                );
+        return -1;
+    }
+
+    struct adios_bp_buffer_struct_v1 * b = 0;
+    uint32_t version = 0;
+    FILE * outf;
+    outf = fopen (newfilename, "w");
+    b = malloc (sizeof (struct adios_bp_buffer_struct_v1));
+    adios_buffer_struct_init (b);
+
+    rc = adios_posix_open_read_internal (filename, "", b);
+    if (!rc)
+    {
+        fprintf (stderr, "bpdump: file not found: %s\n", filename);
+        return -1;
+    }
+
+    adios_posix_read_version (b);
+    adios_parse_version (b, &version);
+
+    struct adios_index_process_group_struct_v1 * pg_root = 0;
+    struct adios_index_process_group_struct_v1 * pg = 0;
+    struct adios_index_var_struct_v1 * vars_root = 0;
+    struct adios_index_attribute_struct_v1 * attrs_root = 0;
+
+    adios_posix_read_index_offsets (b);
+    adios_parse_index_offsets_v1 (b);
+
+    adios_posix_read_process_group_index (b);
+    adios_parse_process_group_index_v1 (b, &pg_root);
+    print_process_group_index (pg_root);
+
+    adios_posix_read_vars_index (b);
+    adios_parse_vars_index_v1 (b, &vars_root);
+
+    while (vars_root)
+    {
+        //printf("%s\n",vars_root->var_name);
+        if (!strcasecmp (dump.dump_var, vars_root->var_name) )
+            break;
+        else
+            vars_root = vars_root->next;
+    }
+
+    uint64_t element_counts = vars_root->characteristics_count;
+    struct adios_process_group_header_struct_v1 pg_header;
+    struct adios_var_header_struct_v1 var_header;
+    struct adios_var_payload_struct_v1 var_payload;
+    uint64_t offset, var_len;
+    printf("characteristics count: %llu\n", element_counts); 
+
+    for (i = 0; i < element_counts; i++)
+    {
+        offset = vars_root->characteristics[i].offset;
+        b->read_pg_offset = pg_root->offset_in_file;
+
+        printf("offset: %llu read_pg_offset=%llu\n", offset, b->read_pg_offset);
+        if (pg_root->next)
+        {
+            b->read_pg_size =   pg_root->next->offset_in_file
+                              - pg_root->offset_in_file;
+        }
+        else
+        {
+            b->read_pg_size =   b->pg_index_offset
+                              - pg_root->offset_in_file;
+        }
+        
+        adios_init_buffer_read_process_group (b);
+        lseek(b->f, b->read_pg_offset+offset,SEEK_SET);
+
+        read(b->f,b->buff,8);
+        var_len = *(uint64_t *) b->buff;
+
+        read (b->f,b->buff+8, var_len);
+
+        printf("var length: %llu offset: %llu\n",var_len, offset);
+        printf ("payload_size %llux\n", var_header.payload_size);
+
+        adios_parse_var_data_header_v1 (b, &var_header);
+        print_var_header (&var_header);
+        
+        var_payload.payload = malloc (var_header.payload_size);   
+	adios_parse_var_data_payload_v1 (b, &var_header, &var_payload
+                                        ,var_header.payload_size
+                                        );
+        int j;
+        switch (var_header.type) {
+            case adios_long_double:
+                for (j=0; j<var_header.payload_size/16;j++) 
+                    fprintf(outf, "%f ", *((long double*)var_payload.payload+j));
+                    break;
+            case adios_double:
+                for (j=0; j<var_header.payload_size/8;j++) 
+                    fprintf(outf, "%f ", *((double*)var_payload.payload+j));
+                    break;
+            case adios_real:
+                for (j=0; j<(var_header.payload_size)/4;j++) 
+                    fprintf(outf, "%f ", *((float *)var_payload.payload+j));
+                    break;
+            case adios_long:
+                for (j=0; j<(var_header.payload_size)/8;j++) 
+                    fprintf(outf, "%ld ", *((long *)var_payload.payload+j));
+                    break;
+            case adios_unsigned_long:
+                for (j=0; j<(var_header.payload_size)/8;j++) 
+                    fprintf(outf, "%lu ", *((unsigned long*)var_payload.payload+j));
+                    break;
+            case adios_integer:
+                for (j=0; j<(var_header.payload_size)/4;j++) 
+                    fprintf(outf, "%d ", *((int *)var_payload.payload+j));
+                    break;
+            case adios_unsigned_integer:
+                for (j=0; j<(var_header.payload_size)/4;j++) 
+                    fprintf(outf, "%u ", *((unsigned int *)var_payload.payload+j));
+                    break;
+            case adios_unsigned_short:
+                for (j=0; j<(var_header.payload_size)/2;j++) 
+                    fprintf(outf, "%d ", *((unsigned short*)var_payload.payload+j));
+                    break;
+            case adios_short:
+                for (j=0; j<(var_header.payload_size)/2;j++) 
+                    fprintf(outf, "%u ", *((short *)var_payload.payload+j));
+                    break;
+            case adios_unsigned_byte:
+                for (j=0; j<var_header.payload_size;j++) 
+                    fprintf(outf, "%c ", *((unsigned char *)var_payload.payload+j));
+                    break;
+            case adios_byte:
+                for (j=0; j<var_header.payload_size;j++) 
+                    fprintf(outf, "%c ", *((char *)var_payload.payload+j));
+                    break;
+            case adios_string:
+                    fprintf(outf, "%s ", var_payload.payload);
+                    break;
+            case adios_complex:
+                for (j=0; j<(var_header.payload_size)/8;j++) 
+                    fprintf(outf, "%f + %fi", *((float  *)var_payload.payload+2*j),*((float  *)var_payload.payload+j*2+1));
+                    break;
+            case adios_double_complex:
+                for (j=0; j<(var_header.payload_size)/16;j++) 
+                    fprintf(outf, "%f + %fi", *((double *)var_payload.payload+2*j),*((double *)var_payload.payload+j*2+1));
+                    break;
+         }        
+         fprintf(outf,"\n");
+    }
+    fclose(outf);
+    adios_posix_close_internal (b);
+    return 0;
+}
+
+void print_process_group_header (uint64_t num
+                      ,struct adios_process_group_header_struct_v1 * pg_header
+                      )
+{
+    int i;
+    struct adios_method_info_struct_v1 * m;
+
+    printf ("Process Group: %llu\n", num);
+    printf ("\tGroup Name: %s\n", pg_header->name);
+    printf ("\tHost Language Fortran?: %c\n"
+           ,(pg_header->host_language_fortran == adios_flag_yes ? 'Y' : 'N')
+           );
+    printf ("\tCoordination Var Member ID: %d\n", pg_header->coord_var_id);
+    printf ("\tTime Name: %s\n", pg_header->time_index_name);
+    printf ("\tTime: %d\n", pg_header->time_index);
+    printf ("\tMethods used in output: %d\n", pg_header->methods_count);
+    m = pg_header->methods;
+    while (m)
+    {
+        printf ("\t\tMethod ID: %d\n", m->id);
+        printf ("\t\tMethod Parameters: %s\n", m->parameters);
+
+        m = m->next;
+    }
+}
+
+void print_process_group_index (
+                         struct adios_index_process_group_struct_v1 * pg_root
+                         )
+{
+    while (pg_root)
+    {
+        printf ("Group: %s\n", pg_root->group_name);
+        printf ("\tProcess ID: %d\n", pg_root->process_id);
+        printf ("\tTime Name: %s\n", pg_root->time_index_name);
+        printf ("\tTime: %d\n", pg_root->time_index);
+        printf ("\tOffset in File: %llu\n", pg_root->offset_in_file);
+
+        pg_root = pg_root->next;
+    }
+}
+void print_var_header (struct adios_var_header_struct_v1 * var_header)
+{
+    int i = 0;
+    printf ("\t\tVar Name (ID): %s (%d)\n", var_header->name, var_header->id);
+    printf ("\t\tVar Path: %s\n", var_header->path);
+    printf ("\t\tDatatype: %s\n", adios_type_to_string_int (var_header->type));
+    printf ("\t\tIs Dimension: %c\n"
+           ,(var_header->is_dim == adios_flag_yes ? 'Y' : 'N')
+           );
+}
diff --git a/utils/bp2h5/Makefile.am b/utils/bp2h5/Makefile.am
new file mode 100644
index 0000000..1570845
--- /dev/null
+++ b/utils/bp2h5/Makefile.am
@@ -0,0 +1,20 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+bin_PROGRAMS = bp2h5
+
+bp2h5_SOURCES = bp2h5.c hw-utils.c
+
+bp2h5_CPPFLAGS = -DH5_USE_16_API $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_SEQ_CPPFLAGS) $(ADIOSLIB_SEQ_CFLAGS)
+bp2h5_LDFLAGS = $(ADIOSLIB_SEQ_LDFLAGS) -static-libtool-libs
+bp2h5_LDADD = $(top_builddir)/src/libadios_internal_nompi.a
+bp2h5_LDADD += $(ADIOSLIB_SEQ_LDADD)
+
+EXTRA_DIST = hw-utils.h
+if USE_PARALLEL_COMPILER
+    CC=$(MPICC)
+    CXX=$(MPICXX)
+endif
+
diff --git a/utils/bp2h5/Makefile.in b/utils/bp2h5/Makefile.in
new file mode 100644
index 0000000..f12e09a
--- /dev/null
+++ b/utils/bp2h5/Makefile.in
@@ -0,0 +1,582 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = bp2h5$(EXEEXT)
+subdir = utils/bp2h5
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_bp2h5_OBJECTS = bp2h5-bp2h5.$(OBJEXT) bp2h5-hw-utils.$(OBJEXT)
+bp2h5_OBJECTS = $(am_bp2h5_OBJECTS)
+am__DEPENDENCIES_1 =
+bp2h5_DEPENDENCIES = $(top_builddir)/src/libadios_internal_nompi.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(bp2h5_SOURCES)
+DIST_SOURCES = $(bp2h5_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = @CC@
+ at USE_PARALLEL_COMPILER_TRUE@CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+ at USE_PARALLEL_COMPILER_TRUE@CXX = $(MPICXX)
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+bp2h5_SOURCES = bp2h5.c hw-utils.c
+bp2h5_CPPFLAGS = -DH5_USE_16_API $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_SEQ_CPPFLAGS) $(ADIOSLIB_SEQ_CFLAGS)
+bp2h5_LDFLAGS = $(ADIOSLIB_SEQ_LDFLAGS) -static-libtool-libs
+bp2h5_LDADD = $(top_builddir)/src/libadios_internal_nompi.a \
+	$(ADIOSLIB_SEQ_LDADD)
+EXTRA_DIST = hw-utils.h
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  utils/bp2h5/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  utils/bp2h5/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
+	done
+
+clean-binPROGRAMS:
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+bp2h5$(EXEEXT): $(bp2h5_OBJECTS) $(bp2h5_DEPENDENCIES) 
+	@rm -f bp2h5$(EXEEXT)
+	$(LINK) $(bp2h5_LDFLAGS) $(bp2h5_OBJECTS) $(bp2h5_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.c.o:
+	$(COMPILE) -c $<
+
+.c.obj:
+	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+	$(LTCOMPILE) -c -o $@ $<
+
+bp2h5-bp2h5.o: bp2h5.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bp2h5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bp2h5-bp2h5.o `test -f 'bp2h5.c' || echo '$(srcdir)/'`bp2h5.c
+
+bp2h5-bp2h5.obj: bp2h5.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bp2h5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bp2h5-bp2h5.obj `if test -f 'bp2h5.c'; then $(CYGPATH_W) 'bp2h5.c'; else $(CYGPATH_W) '$(srcdir)/bp2h5.c'; fi`
+
+bp2h5-hw-utils.o: hw-utils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bp2h5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bp2h5-hw-utils.o `test -f 'hw-utils.c' || echo '$(srcdir)/'`hw-utils.c
+
+bp2h5-hw-utils.obj: hw-utils.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bp2h5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bp2h5-hw-utils.obj `if test -f 'hw-utils.c'; then $(CYGPATH_W) 'hw-utils.c'; else $(CYGPATH_W) '$(srcdir)/hw-utils.c'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic clean-libtool ctags distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-binPROGRAMS uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/utils/bp2h5/README b/utils/bp2h5/README
new file mode 100644
index 0000000..5fe158d
--- /dev/null
+++ b/utils/bp2h5/README
@@ -0,0 +1,91 @@
+08/07/2008 by zf2:
+Changes made:
+1. Migrate to new BP format.
+2. -c option is removed. host-language information is extracted from header.
+3. Known issue: cannot handle attribute whose value is a var.
+
+06/11/2008 by zf2:
+
+Changes made: 
+1. Replace br_get_next_element_general() with br_get_next_element_specific() 
+   for parsing bp files. br_get_next_element_general() uses a fix-sized buffer
+   for reading dataset and scalar data values. br_get_next_element_specific() 
+   has a pre_element_fetch callback to allocate read buffer on demand before 
+   reading. 
+
+2. Add a set of config flags to customize the converter:
+   - array_dim_order_fortran: 
+      transpose array dimension order if using Fortran convention; otherwise 
+      keep order unchanged.
+   - attr_str_ds_fortran: convert string-typed dataset attribute to HDF5 type
+      H5T_FORTRAN_S1 if using Fortran convention; otherwise convert to 
+      HDF5 type H5T_C_S1_g.
+   - attr_str_gp_fortran: 
+      convert string-typed group attribute to HDF5 type H5T_FORTRAN_S1 if using
+      Fortran convention; otherwise convert to HDF5 type H5T_C_S1_g.
+   - scalar_dataspace: 
+      write scalar variable/attribute in a scalar dataspace or in a single 
+      element array.
+
+3. Add two command line options to set above-mentioned config flag
+   -c config_file, --config=config_file:  
+   If the host-language parameter in config file is "Fortran", then set 
+   array_dim_order_fortran, attr_str_ds_fortran and attr_str_gp_fortran to use
+   Fortran convention; otherwise set them to use C convention
+   --scalar_as_array: 
+   If this option is specified, then set scalar_dataspace to write scalar 
+   variable/attribute in a single element array. If not specified, a scalar 
+   variable/attribute is written in a scalar dataspace. 
+
+4. Fix a bug in hw_dset(): check dims [0].global_bound to decide if a dataset
+   has global bounds, instead of dims [i].global_bound (line: 141)       
+
+5. Add install target in Makefile. 
+
+Known Issues:
+1. Although br_get_next_element_specific() can re-allocate read buffer when 
+   needed, it still requires to read in all bytes at once. This may be 
+   impossible for very large datasets. The root cause of this is that the 
+   br_read_buffer() function in br-utils.c in ADIOS makes a single read() call. 
+
+2. bp2h5 assumes that when writing an attribute, the dataset/group to which 
+   this attribute is attached is already creaded in h5 file. If this is not 
+   the case, bp2h5 would create a single-element-array dataset and attach the 
+   attribute to it. This is a bug. However, since currently all bp file writing
+   routines (including those in adios_posix, adios_mpi, and adios_mpi_cio) 
+   write all vars before writing attributes, this bug is never touched. 
+
+
+TODO:
+1. Since HDF5 provides a rich set of data types, the mapping of ADIOS data 
+   types to HDF5 data types is not deterministic. Currently the mapping is 
+   hard-coded, but it may need to be more flexible. 
+
+2. More careful error checking and handling.
+
+Usage:
+
+bp2h5:
+    Convert a bp file to h5 file.
+
+USAGE: bp2h5 [OPTION] bp_file [h5_file]
+
+    bp2h5 converts an bp file nameed by bp_file to a h5 file named by h5_file.
+    If h5_file is not specified, the generated h5 file is named by the basename
+    of bp_file suffixed by ".h5".
+
+OPTION:
+    -c config_file, --config=config_file
+        (Optional) Specify the XML config file which defines ADIOS groups in bp
+         file. If not specified, the default is "./config.xml"
+    --scalar_as_array
+        (Optional) Write a scalar variable or attribute in a single-element
+        array. If not specified, a scalar variable/attribute is written in a
+        scalar dataspace.
+    -V, --verbose
+        (Optional) Print detailed information during conversion.
+    -h, --help
+        (Optional) Print usage information and exit.
+
+
+
diff --git a/utils/bp2h5/bp2h5.c b/utils/bp2h5/bp2h5.c
new file mode 100644
index 0000000..fe65e58
--- /dev/null
+++ b/utils/bp2h5/bp2h5.c
@@ -0,0 +1,115 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "hw-utils.h"
+
+void print_usage() 
+{
+    printf("bp2h5:\n");
+    printf("    Convert a bp file to h5 file.\n");
+    printf("\nUSAGE: bp2h5 [OPTION] bp_file [h5_file]\n\n");
+    printf("    bp2h5 converts a bp file named by bp_file to a h5 file named by h5_file.\n");
+    printf("    If h5_file is not specified, the generated h5 file is named by the basename\n"
+           "    of bp_file suffixed by \".h5\".\n");
+    printf("\nOPTION:\n");
+    printf("    --scalar_as_array\n");
+    printf("        (Optional) Write a scalar variable or attribute in a single-element \n"
+           "        array. If not specified, a scalar variable/attribute is written in a\n"
+           "        scalar dataspace.\n");
+    printf("    -V, --verbose\n");
+    printf("        (Optional) Print detailed information during conversion.\n");
+    printf("    -h, --help\n");
+    printf("        (Optional) Print usage information and exit.\n");
+    printf("\n");
+}
+
+/*
+ * parse_cmdline() function parses command line arguments. 
+ * It returns 0 if no error is encountered and -1 otherwise.
+ */
+int parse_cmdline(int argc, char **argv
+                 ,char **bp_filename
+				 ,char **h5_filename
+				 ,enum scalar_convention *scalar_as_array
+				 ,enum verbose_level *verb                   
+                 ) 
+{
+    int i = 1;
+    int found_bp_file = 0;
+    int found_h5_file = 0;
+    int found_config_file = 0;
+    
+    *scalar_as_array = USE_SCALAR;
+    *verb = NO_INFO;
+
+    if(argc < 2) {
+        print_usage();
+        return -1;
+    }
+    
+    while (i < argc) {
+        if(!strcmp(argv[i], "--scalar-as_array")) {
+            *scalar_as_array = USE_SINGLE_ELE_ARRAY;
+        }
+        else if(!strcmp(argv[i], "--verbose") || !strcmp(argv[i], "-V")) {
+            //fprintf(stderr, "i:%d\n",i);
+            //fprintf(stderr, "verbose:%d\n",*verb);
+            *verb = LIST_INFO;
+            //*verb = atoi(argv[i+1]);
+            i=i+1;
+        }
+        else if(!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) {
+            print_usage();
+            exit(0);
+        }
+        else if(!found_bp_file) {
+            *bp_filename = argv[i];
+            found_bp_file = 1;
+        }
+        else if(found_bp_file && !found_h5_file) {
+            *h5_filename = argv[i];
+            found_h5_file = 1;
+        }
+        else {
+            // unknown arguments
+            fprintf(stderr, "Error in parsing command line: unknown argument %s\n\n", argv[i]);
+            print_usage();
+            return -1;
+        }
+        i ++;
+    }
+
+    if(!found_bp_file) {
+        fprintf(stderr, "Error in parsing command line: bp_file not provided\n");
+        print_usage();
+        return -1;
+    }
+
+    return 0;
+}
+
+int main (int argc, char ** argv)
+{
+    char *bp_filename = NULL;
+    char *h5_filename = NULL;
+    enum scalar_convention scalar_as_array;
+    enum verbose_level verb;
+
+    // parse cmdline options
+    if(parse_cmdline(argc, argv, &bp_filename, &h5_filename,
+                &scalar_as_array, &verb)) {
+        return -1;
+    }
+
+
+    initialize_bp2h5(USE_FORTRAN, USE_FORTRAN, USE_FORTRAN, USE_FORTRAN, scalar_as_array, verb);
+    // generate h5 file
+    return hw_makeh5(bp_filename, h5_filename);
+}
diff --git a/utils/bp2h5/hw-utils.c b/utils/bp2h5/hw-utils.c
new file mode 100644
index 0000000..14da586
--- /dev/null
+++ b/utils/bp2h5/hw-utils.c
@@ -0,0 +1,1665 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include "stdint.h"
+#include <signal.h>
+#include <sys/types.h>
+#include "adios_types.h"
+#include "adios_transport_hooks.h"
+#include "adios_bp_v1.h"
+//#include "adios_internals.h"
+#include "hw-utils.h"
+
+#define NUM_GP 24
+#define  MAX_RANK 10 * 5
+#define STRLEN 1000 
+struct var_dim
+{
+    uint16_t id;
+    uint64_t rank;
+    uint64_t offset;
+};
+
+/*
+ * Global config variables to set the convenstion of conversion
+ */
+
+/*
+ * array to dataset convention (transpose array dimension order if using Fortran)
+ */
+enum lang_convention array_dim_order_fortran = USE_FORTRAN;
+
+/*
+ * string-typed scalar/dataset write convention
+ */
+enum lang_convention var_str_fortran = USE_FORTRAN;
+
+/*
+ * string-typed dataset attribute write convention
+ */
+enum lang_convention attr_str_ds_fortran = USE_FORTRAN;
+
+/*
+ * string-typed group attribute write convention
+ */
+enum lang_convention attr_str_gp_fortran = USE_FORTRAN;
+
+/* 
+ * scalar var/attribute write convention
+ */
+enum scalar_convention scalar_dataspace = USE_SCALAR;
+
+/*
+ * initialization flag
+ */
+int bp2h5_initialized = 0;
+
+/*
+ * verbose level flag
+ */
+const char * value_to_string (enum ADIOS_DATATYPES type, void * data);
+enum verbose_level verbose = NO_INFO;
+void set_lang_convention(enum ADIOS_FLAG host_language_fortran)
+{
+    if(host_language_fortran == adios_flag_yes) {
+        array_dim_order_fortran = USE_FORTRAN;
+        var_str_fortran = USE_FORTRAN;
+        attr_str_ds_fortran = USE_FORTRAN;
+        attr_str_gp_fortran = USE_FORTRAN;
+    }
+    else {
+        // otherwise assume host language is C
+        array_dim_order_fortran = USE_C;
+        var_str_fortran = USE_C;
+        attr_str_ds_fortran = USE_C;
+        attr_str_gp_fortran = USE_C;
+    }
+}
+
+/*
+ * Parse path of var/attribute
+ *
+ * (copied from binpack-utils.c; this function
+ * is no longer included in libadios.a or 
+ * libadios_int.a)
+ */ 
+char** bp_dirparser(char *str, int *nLevel)
+{
+  char **grp_name;
+  char *pch;
+  int idx = 0, len=0;
+  char *tmpstr;
+  tmpstr= (char *)malloc(1*(strlen(str)+1));
+  strcpy(tmpstr,str);
+  pch = strtok(tmpstr,"/");
+  grp_name = (char **)malloc(NUM_GP*1);
+  while(pch!=NULL && *pch!=' ')
+  {
+
+     len = strlen(pch);
+     grp_name[idx]  = (char *)malloc((len+1)*1);
+     grp_name[idx][0]='\0';
+     strcat(grp_name[idx],pch);
+     pch=strtok(NULL,"/");
+     idx=idx+1;
+  }
+  *nLevel = idx;
+  free(tmpstr);
+  return grp_name;
+}
+
+void print_process_group_header (uint64_t num
+                      ,struct adios_process_group_header_struct_v1 * pg_header
+                      );
+void print_vars_header (struct adios_vars_header_struct_v1 * vars_header)
+{
+    printf ("\tVars Count: %u\n", vars_header->count);
+}
+void copy_buffer(struct adios_bp_buffer_struct_v1 *dest
+                ,struct adios_bp_buffer_struct_v1 *src) {
+
+    memcpy (dest, src, sizeof(struct adios_bp_buffer_struct_v1));
+}
+
+/*
+ * Initialization
+ * initialize_bp2h5() sets config variables and allocate
+ * internal read buffer.
+ * It returns 0 if no error and -1 otherwise
+ */
+int initialize_bp2h5(enum lang_convention array_dim_order,
+                     enum lang_convention var_str,
+                     enum lang_convention attr_str_ds,
+                     enum lang_convention attr_str_gp,
+                     enum scalar_convention scalar_ds,
+                     enum verbose_level verb 
+                     )
+{
+    if(!bp2h5_initialized) {
+        array_dim_order_fortran = array_dim_order;
+        var_str_fortran = var_str;
+        attr_str_ds_fortran = attr_str_ds;
+        attr_str_gp_fortran = attr_str_gp;
+        scalar_dataspace = scalar_ds;
+        verbose = verb;
+        bp2h5_initialized = 1;
+    }
+
+    return 0;
+}
+
+void hw_free2D (char ** grp_name, int level)
+{
+    int i;
+
+    for (i = 0; i < level; i++)
+    {
+        free (grp_name [i]);
+        grp_name [i] = NULL;
+    }
+
+    free (grp_name);
+}
+
+/*
+ * Convert bp file fnamein to a h5 file fnameout
+ */
+int hw_makeh5 (char * fnamein, char * fnameout)
+{
+    char * tmpstr;
+    int size;
+    int i,j;
+    int rc;
+    uint64_t element_size = 0;
+    struct adios_bp_element_struct * element = NULL;
+
+    // initialization
+    if(!bp2h5_initialized && 
+        (initialize_bp2h5(USE_FORTRAN, USE_FORTRAN, USE_FORTRAN, USE_FORTRAN, USE_SCALAR,NO_INFO))) {
+        return -1;
+    }
+
+    // open bp file for read
+    struct adios_bp_buffer_struct_v1 * b = 0, * b0 = 0;
+    uint32_t version = 0;
+
+    b = malloc (sizeof (struct adios_bp_buffer_struct_v1));
+    b0 = malloc (sizeof (struct adios_bp_buffer_struct_v1));
+    adios_buffer_struct_init (b);
+
+    rc = adios_posix_open_read_internal (fnamein, "", b);
+    if (!rc) {
+        fprintf (stderr, "Error in open bp file: cannot open %s file!\n", fnamein);
+        return -1;
+    }
+
+    tmpstr = strdup (fnamein);
+    size = strlen (fnamein);
+    tmpstr [size - 2] = 'h';
+    tmpstr [size - 1] = '5';
+    if(!fnameout) {
+        fnameout=tmpstr;
+    }
+
+    // create h5 file
+    hid_t h5file_id;
+    hid_t root_id;
+    h5file_id = H5Fcreate (fnameout, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+    root_id = H5Gopen (h5file_id, "/");
+
+    // read and parse footer
+    adios_posix_read_version (b);
+    adios_parse_version (b, &version);
+
+    struct adios_index_process_group_struct_v1 * pg_root = 0;
+    struct adios_index_process_group_struct_v1 * pg = 0;
+    struct adios_index_var_struct_v1 * vars_root = 0;
+    struct adios_index_attribute_struct_v1 * attrs_root = 0;
+
+    // read and parse index
+    adios_posix_read_index_offsets (b);
+    adios_parse_index_offsets_v1 (b);
+
+    adios_posix_read_process_group_index (b);
+    adios_parse_process_group_index_v1 (b, &pg_root);
+
+    adios_posix_read_vars_index (b);
+    adios_parse_vars_index_v1 (b, &vars_root);
+    adios_posix_read_attributes_index (b);
+    adios_parse_attributes_index_v1 (b, &attrs_root);
+    /* xxx.bp --> xxx.h5
+     * parse element from bp file and write to hdf5 file
+     */
+    uint64_t element_num = 0;
+    uint64_t pg_num = 0;
+    pg = pg_root;
+    int var_dims_count = 0;
+    struct var_dim * var_dims = 0;
+    while (pg) {
+
+        struct adios_process_group_header_struct_v1 pg_header;
+        struct adios_vars_header_struct_v1 vars_header;
+        struct adios_attributes_header_struct_v1 attrs_header;
+
+        struct adios_var_header_struct_v1 var_header;
+        struct adios_var_payload_struct_v1 var_payload;
+        struct adios_attribute_struct_v1 attribute;
+
+        // setup where to read the process group from (and size)
+        b->read_pg_offset = pg->offset_in_file;
+        if (pg->next) {
+            b->read_pg_size =   pg->next->offset_in_file
+                - pg->offset_in_file;
+        }
+        else {
+            b->read_pg_size =   b->pg_index_offset
+                - pg->offset_in_file;
+        }
+        adios_posix_read_process_group (b);
+        adios_parse_process_group_header_v1 (b, &pg_header);
+        adios_parse_vars_header_v1 (b, &vars_header);
+
+        set_lang_convention(pg_header.host_language_fortran);
+        uint64_t length_of_var;
+        // process each var in current process group
+        if (element_num%2 == 0) {
+            var_dims = realloc (var_dims, (vars_header.count)
+                    * sizeof (struct var_dim)
+                    );
+            for (i = 0; i < vars_header.count; i++) {
+                var_payload.payload = 0;
+                copy_buffer(b0,b); 
+                length_of_var = *(uint64_t *) (b->buff + b->offset);
+                adios_parse_var_data_header_v1 (b, &var_header);
+
+                if (   var_header.is_dim == adios_flag_yes
+                    || var_header.dims == 0) {
+                    if (!var_payload.payload) { 
+                        var_payload.payload = malloc (var_header.payload_size);
+                        adios_parse_var_data_payload_v1 (b, &var_header, &var_payload
+                                ,var_header.payload_size
+                                );
+                        var_dims [var_dims_count].id = var_header.id;
+                        var_dims [var_dims_count].rank = *(uint32_t *)
+                            var_payload.payload;
+                        var_dims [var_dims_count].offset = b0->offset; 
+                    }
+                    else {
+                        //printf("payload malloc : %s %d\n",__FILE__,__LINE__);
+                        //return;
+                    }
+                }
+                else {
+                    var_dims [var_dims_count].id = var_header.id;
+                    var_dims [var_dims_count].rank = 0;
+                    var_dims [var_dims_count].offset = b0->offset; 
+                }
+
+                var_dims_count ++;
+                copy_buffer(b,b0); 
+                b->offset = b->offset+length_of_var;
+                if (var_payload.payload) {
+                    free (var_payload.payload);
+                    var_payload.payload = 0;
+                }
+                /*
+                   printf("var id=%d name=%s rank=%d offset=%llu\n", 
+                   var_header.id, 
+                   var_header.name,
+                   var_dims[var_dims_count-1].rank,
+                   var_dims[var_dims_count-1].offset);
+                   */		
+            }
+            adios_parse_attributes_header_v1 (b, &attrs_header);
+            for (i = 0; i < attrs_header.count; i++) {
+                adios_parse_attribute_v1 (b, &attribute);
+                var_dims = realloc (var_dims, (var_dims_count+1)
+                        * sizeof (struct var_dim)
+                        );
+                if (attribute.is_var == adios_flag_yes) {
+                    var_dims [var_dims_count].id = attribute.var_id;
+                    var_dims [var_dims_count].rank = 0;
+                    var_dims [var_dims_count].offset = 0;
+                    for (j=0; j<var_dims_count;j++) {
+                        if (attribute.var_id == var_dims [j].id) {
+                            var_dims [var_dims_count].id = attribute.id;
+                            var_dims [var_dims_count].rank = var_dims [j].rank;
+                            var_dims [var_dims_count].offset = var_dims [j].offset;
+                            /*
+                               printf("attribute: %s  vid= %llu rank: %llu\n",attribute.name,
+                               attribute.id,var_dims[var_dims_count].rank);
+                               */
+                            j = var_dims_count;
+                        }
+                    }
+                }
+                else {
+                    var_dims [var_dims_count].id = attribute.id;
+            var_dims [var_dims_count].rank = 0;
+            var_dims [var_dims_count].offset = 0;
+            switch(attribute.type) { 
+                case adios_unsigned_short:
+                    var_dims [var_dims_count].rank = (uint64_t)*((unsigned short*) attribute.value);
+                    break;
+                case adios_unsigned_integer:
+                    var_dims [var_dims_count].rank = (uint64_t) *((unsigned int *) attribute.value);
+                    break;
+                case adios_unsigned_long:
+                    var_dims [var_dims_count].rank = (uint64_t) *((unsigned long*) attribute.value);
+                    break;
+                case adios_short:
+                    var_dims [var_dims_count].rank = (uint64_t)*((short*) attribute.value);
+                    break;
+                case adios_integer:
+                    var_dims [var_dims_count].rank = (uint64_t) *((int *) attribute.value);
+                    break;
+                case adios_long:
+                    var_dims [var_dims_count].rank = (uint64_t) *((long *) attribute.value);
+                    break;
+                case adios_byte:
+                case adios_unsigned_byte:
+                case adios_string:
+                    break;
+                case adios_complex:
+                case adios_double_complex:
+                    fprintf(stderr, "Error in mapping ADIOS Data Types to HDF5: complex not supported yet.\n");
+                    break;
+                case adios_unknown:
+                default:
+                    fprintf(stderr, "Error in mapping ADIOS Data Types to HDF5: unknown data type.\n");
+            }
+        }
+        var_dims_count ++;
+            }
+        }
+        // write to h5 file
+        // make sure the buffer is big enough or send in null
+        else {
+            if (verbose >= LIST_INFO) {
+                printf("-------------------------------------------\n");
+                printf("total vars: %d, pg timeindex: %d\n",
+                        vars_header.count, 
+                        pg->time_index);
+            }
+            for (i = 0; i < vars_header.count; i++) {
+                var_payload.payload = 0;
+                adios_parse_var_data_header_v1 (b, &var_header);
+                if (var_header.dims) {
+                    if (verbose >= LIST_INFO)
+                        printf("\t%3d) dataset : %s\n",i,var_header.name);
+                    uint64_t element = 0;
+                    struct adios_dimension_struct_v1 * d = var_header.dims;
+                    int i = 0, ranks = 0, c = 0;
+                    uint64_t * dims,* global_dims,* offsets;
+                    while (d) {
+                        ranks++;
+                        d = d->next;
+                    }
+                    //adios_parse_var_data_payload_v1 (b, &var_header, NULL, 0);
+                    // get local dimensions
+                    dims = (uint64_t *) malloc (8 * ranks);
+                    memset (dims, 0, 8 * ranks);
+
+                    d = var_header.dims;
+                    uint64_t * dims_t = dims;
+
+                    while (d) {
+                        if (d->dimension.var_id != 0) {
+                            for (i = 0; i < var_dims_count; i++) {
+                                //printf("%s: %d %llu \n",var_header.name,
+                        //i,var_dims [i].rank); 
+                        if (var_dims [i].id == d->dimension.var_id){ 
+                            *dims_t = var_dims [i].rank; 
+                            i = var_dims_count+1;
+                        }
+                    }
+                }
+                else { 
+                    *dims_t = d->dimension.rank;
+                }
+                d = d->next;
+                dims_t++;
+            }
+            // get global dimensions
+            global_dims = (uint64_t *) malloc (8 * ranks);
+            memset (global_dims, 0, 8 * ranks);
+
+            d = var_header.dims;
+            dims_t = global_dims;
+
+            while (d) {
+                if (d->global_dimension.var_id != 0) {
+                    for (i = 0; i < var_dims_count; i++) {
+                        if (var_dims [i].id == \
+                                d->global_dimension.var_id) {
+                            *dims_t = var_dims [i].rank;
+                            i = var_dims_count+1;
+                        }
+                    }
+                }
+                else
+                    *dims_t = d->global_dimension.rank;
+                d = d->next;
+                dims_t++;
+            }
+
+            // get offsets
+		    offsets = (uint64_t *) malloc (8 * ranks);
+		    memset (offsets, 0, 8 * ranks);
+
+		    d = var_header.dims;
+		    dims_t = offsets;
+
+            while (d) {
+                if (d->local_offset.var_id != 0) {
+                    for (i = 0; i < var_dims_count; i++) {
+                        if (var_dims [i].id == d->local_offset.var_id) {
+                            *dims_t = var_dims [i].rank;
+                            i = var_dims_count+1;
+                        }
+                    }
+                }
+                else {
+                    *dims_t = d->local_offset.rank;
+                }
+                d = d->next;
+                dims_t++;
+            }
+
+            var_payload.payload = malloc (var_header.payload_size);
+            adios_parse_var_data_payload_v1 (b, &var_header, &var_payload
+                    ,var_header.payload_size
+                    );
+            // now ready to write dataset to h5 file
+            /*
+               if (!strcmp(var_header.name,"nextnode") ||
+               !strcmp(var_header.name,"itheta0") )
+               printf("==============\n");
+               printf("  %s\n",var_header.name);
+               printf("==============\n");
+            printf("%d %d %d %d\n",ranks, global_dims[0],dims[0],offsets[0]); 
+            printf("%d %d %d %d\n",ranks, global_dims[1],dims[1],offsets[1]); 
+            printf("%d %d %d %d\n",ranks, global_dims[2],dims[2],offsets[2]); 
+            printf("%d %d %d %d\n",ranks, global_dims[3],dims[3],offsets[3]); 
+            */
+            hw_dset(root_id, var_header.path, var_header.name, 
+                    var_payload.payload,var_header.type, 
+                    ranks, dims, global_dims, offsets,
+                    pg->time_index
+                   );      
+
+		    free(dims);
+		    free(global_dims);
+		    free(offsets);
+		}
+		else {
+                    // scalar var
+		    if (verbose >= LIST_INFO)
+	                    fprintf(stderr, "\t%3d) scalar  : %s\n",i,var_header.name);
+		    if (!var_payload.payload) 
+                        var_payload.payload = malloc (var_header.payload_size);
+		    adios_parse_var_data_payload_v1 (b, &var_header, &var_payload
+                                                    ,var_header.payload_size
+                                                    );
+	            hw_scalar (root_id, var_header.path, var_header.name
+                              ,var_payload.payload
+			      ,var_header.type
+                              ,0
+			      );     
+		}
+                if (var_payload.payload) {
+                    free(var_payload.payload);
+                    var_payload.payload = 0;
+                }
+            }
+            adios_parse_attributes_header_v1 (b, &attrs_header);
+                // process each attribute in current process group
+            for (i = 0; i < attrs_header.count; i++) {
+                adios_parse_attribute_v1 (b, &attribute);
+		// write to h5 file
+		if(attribute.is_var == adios_flag_no) {
+                    switch(attribute.type) { 
+		        case adios_string:
+		            hw_attr_str_ds (root_id, attribute.path, attribute.name, attribute.value);
+			    break;
+			case adios_byte:
+		            hw_attr_str_ds (root_id, attribute.path, attribute.name, attribute.value);
+			    break;
+			case adios_real:
+			case adios_double:
+			case adios_long_double:
+			case adios_unsigned_byte:
+			case adios_unsigned_short:
+			case adios_unsigned_integer:
+			case adios_unsigned_long:
+			case adios_short:
+			case adios_integer:
+			case adios_long:
+                            hw_attr_num_ds (root_id, attribute.path, attribute.name, attribute.value
+                                           ,attribute.type
+                                           );
+			    break;
+                        case adios_complex:
+			case adios_double_complex:
+		            fprintf(stderr, "Error in mapping ADIOS Data Types to HDF5: complex not supported yet.\n");
+			    break;
+			case adios_unknown:
+			default:
+			    fprintf(stderr, "Error in mapping ADIOS Data Types to HDF5: unknown data type.\n");
+		    }
+		}
+		else {
+                    for (j = vars_header.count; j <var_dims_count; j++) {
+                        //printf("id=%d rank=%d %llu\n",attribute.var_id,attribute.var_id,var_dims[j].offset);
+		       if (attribute.id== var_dims[j].id) { 
+                            if (var_dims[j].rank> 0) {
+                                //printf("\tattribute %s -> id (%d): %d\n",
+                                //     attribute.name,attribute.var_id, var_dims[j].rank);
+                                //printf("\tattribute %s -> id (%d):value (%llu)\n"
+                                //      ,attribute.name
+                                //      ,attribute.id
+                                //      ,var_dims[j].rank);
+		                hw_attr_num_ds (root_id, attribute.path, attribute.name
+                                              ,&var_dims[j].rank,adios_long); 
+			    //case adios_byte:
+	                    }
+		            else {
+                                //printf("\tattribute %s/%s -> id (%d)\n"
+                                //      ,attribute.path
+                                //      ,attribute.name
+                                //      ,attribute.id);
+                                copy_buffer(b0,b);
+                                b0->offset = var_dims[j].offset; 
+                                adios_parse_var_data_header_v1 (b0, &var_header);
+                                if (!var_payload.payload) { 
+		                    var_payload.payload = malloc (var_header.payload_size);
+		                    adios_parse_var_data_payload_v1 (b0, &var_header, &var_payload
+				                             ,var_header.payload_size
+				    );
+                                    if (var_header.type==adios_byte || var_header.type==adios_string)
+                                        //printf("\t varname: %s %d %s\n"
+                                        //      , var_header.name
+                                        //      , var_header.type
+                                        //      , var_payload.payload);
+                                        hw_attr_str_ds (root_id, attribute.path
+                                                       ,attribute.name
+                                                       ,var_payload.payload);
+                                    else
+		                        hw_attr_num_ds (root_id, attribute.path
+                                                       ,attribute.name
+                                                       ,var_payload.payload,var_header.type);
+                                    if (var_payload.payload)
+                                        free(var_payload.payload);
+		                    //hw_attr_num_ds (root_id, attribute.path, attribute.name
+                                    //        ,var_header.type, var_payload.payload);
+	                        }
+	                    }
+                         }
+	            }
+	        }
+            }
+	    var_dims_count = 0;
+            pg = pg->next;
+        }
+        element_num ++;
+	element_num = element_num%2;
+    }
+    if (var_dims) 
+        free (var_dims);
+
+    if (tmpstr)
+	free (tmpstr);
+    adios_posix_close_internal (b);
+    hid_t h5_status;
+    h5_status = H5Gclose (root_id);
+    h5_status = H5Fclose (h5file_id);
+    return 0;
+}
+
+/*
+ * Write dataset to h5 file
+ */
+void hw_dset(hid_t root_id, 
+             char * dirstr, 
+             char * name, 
+             void * data,
+             enum ADIOS_DATATYPES type, 
+             int rank,
+             uint64_t *dims,
+             uint64_t *global_dims,
+             uint64_t *offsets,
+             uint32_t time_index 
+            )
+{
+    H5Eset_auto (NULL,NULL);
+    char ** grp_name;
+    int level;
+    int i;
+    hid_t grp_id [NUM_GP + 1];
+    grp_id [0] = root_id;
+    grp_name = bp_dirparser (dirstr, &level);
+    
+    for (i = 0; i < level; i++)
+    {
+        grp_id [i + 1] = H5Gopen (grp_id [i],grp_name [i]);
+        if (grp_id [i + 1] < 0)
+        {
+            grp_id [i + 1] = H5Gcreate (grp_id [i], grp_name [i], 0);
+        }
+    }
+
+    if (global_dims[0]) {
+
+        hid_t dataspace;
+        hid_t memspace;
+        hid_t dataset;
+        hid_t type_id;
+
+        herr_t h5_status;
+
+        h5_status = bp_getH5TypeId (type, &type_id, data);
+         
+    	/*
+        hsize_t * global_h5dims;
+        hsize_t * local_h5dims;
+        hsize_t * start;
+        hsize_t * stride;
+
+        global_h5dims = (hsize_t *) malloc (rank * sizeof (hsize_t));
+        local_h5dims = (hsize_t *) malloc (rank * sizeof (hsize_t));
+        start = (hsize_t *) malloc (rank * sizeof (hsize_t));
+        stride = (hsize_t *) malloc (rank * sizeof (hsize_t));
+        */
+
+        hsize_t global_h5dims[10];
+        hsize_t local_h5dims[10];
+        hsize_t start[10];
+        hsize_t stride[10];
+
+        int i, time_idx;
+        if(array_dim_order_fortran == USE_FORTRAN) {
+            int reverse_i; 
+            time_idx=-1;
+            // transpose dimension order for Fortran arrays
+            for (i = 0; i < rank; i++) {
+                reverse_i = rank - 1 - i;
+                global_h5dims [reverse_i] = global_dims[i];
+                local_h5dims [reverse_i] = dims[i];
+                start [reverse_i] = offsets[i];
+                stride [reverse_i] = 1;
+                if (dims[i]==0) {
+                    if (verbose >= LIST_INFO)
+                        fprintf(stderr, "timeindex=%d rank=%d\n",i, rank);
+                    time_idx = reverse_i;
+                    local_h5dims[reverse_i]=1;
+                }
+            }
+            if (time_idx == 0) {
+                if (global_h5dims[time_idx]!=0) {
+                    for (i=0;i<rank-1;i++) {
+                        global_h5dims[i+1] = global_h5dims[i];
+                        start[i+1] = start[i];
+                    }
+                    global_h5dims[time_idx] = 1;
+                }
+                else if (global_h5dims[time_idx]==0 &&
+                        local_h5dims[time_idx]!=0) {
+/*
+                    for (i=rank-1;i>0;i--) {
+                        local_h5dims[i] = local_h5dims[i-1];
+                    }
+*/
+                    local_h5dims[0] = 1;
+                }
+            }
+            if (time_idx == rank-1 && global_h5dims[time_idx]==0) {
+                global_h5dims[time_idx] = 1;
+                start[time_idx] = 0;
+            }
+        }
+        else if(array_dim_order_fortran == USE_C) {
+            time_idx=-1;
+            for (i = 0; i < rank; i++) {
+                global_h5dims[i] = global_dims[i];
+                local_h5dims[i] = dims[i];
+                start [i] = offsets[i];
+                stride [i] = 1;
+		if (dims[i]==0) {
+                    time_idx = i;
+		    local_h5dims[i]=1;
+		}
+            }
+            if (time_idx == 0 && global_h5dims[time_idx]!=0) {
+	        for (i=rank-1;i>0;i--) {
+                    global_h5dims [i] = global_h5dims[i-1];
+                    start[i] = start[i-1];
+                }
+
+		global_h5dims[time_idx] = 1;
+		start[time_idx] = 0;
+            }
+            if (time_idx == rank-1 && global_h5dims[time_idx]==0) {
+	        for (i=rank-1;i>0;i--) {
+                    global_h5dims [i] = global_h5dims[i-1];
+                    local_h5dims [i] = local_h5dims[i-1];
+                    start[i] = start[i-1];
+                }
+                time_idx=0;
+		global_h5dims[time_idx] = 1;
+		start[time_idx] = 0;
+            }
+        }
+
+        dataset = H5Dopen (grp_id [level], name);
+        if (dataset>0) {
+		dataspace = H5Dget_space(dataset);
+		int rank_old = H5Sget_simple_extent_ndims(dataspace);
+		if (rank_old!=rank && dataspace>0) {
+			printf("rank doesnot match!\n");
+			H5Sclose(dataspace);
+			return;
+		}
+		hsize_t *maxdims = (hsize_t *) malloc (rank * sizeof (hsize_t));
+		h5_status = H5Sget_simple_extent_dims(dataspace,maxdims,NULL);
+                if(time_idx>=0) {  
+			global_h5dims[time_idx] = time_index;
+			start[time_idx] = time_index-1;
+			stride[time_idx] = 1;
+			if (maxdims[time_idx] < global_h5dims[time_idx]) {
+				if (verbose >= DEBUG_INFO)
+					fprintf(stderr, "%d %d now extend the dataset!\n", 
+							maxdims[time_idx],
+							global_h5dims[time_idx]);
+				h5_status = H5Dextend (dataset, global_h5dims);
+				if (h5_status<0)
+					fprintf(stderr, "H5Dextent has error!\n");
+				h5_status=H5Dclose(dataset);
+				dataset = H5Dopen (grp_id [level], name);
+				dataspace = H5Dget_space(dataset);
+			}
+		}
+                free (maxdims);
+        }
+        else {
+		global_h5dims[time_idx] = 1;
+		dataspace = H5Screate_simple (rank, global_h5dims, NULL);
+		if (dataspace < 0)
+			fprintf(stderr, "dataspace is not created!\n");
+    		hid_t cparms = H5Pcreate(H5P_DATASET_CREATE);
+    		h5_status = H5Pset_chunk(cparms,rank,local_h5dims);
+		dataset = H5Dcreate (grp_id [level], name, type_id
+				,dataspace,cparms
+				);
+		H5Pclose(cparms);
+		if (dataset< 0)
+			fprintf(stderr, "dataset is not created!\n");
+        } 
+
+        if (verbose >= LIST_INFO) {
+		for (i=0;i<rank;i++) 
+			fprintf(stderr,"\t     [%d]:\tg(%d)c(%d)o(%d)\n",
+				i, global_h5dims[i],local_h5dims[i],start[i]);
+	}
+
+        memspace = H5Screate_simple (rank, local_h5dims, NULL);
+        if (memspace< 0)
+            fprintf(stderr, "memspace is not created!\n");
+	h5_status = H5Sselect_hyperslab (dataspace, H5S_SELECT_SET
+                                  ,start, stride, local_h5dims, NULL
+                                  );
+	if (h5_status< 0)
+		fprintf(stderr, "H5Sselect_hyperslab returns error!\n");
+	h5_status = H5Dwrite (dataset, type_id, memspace, dataspace
+                             ,H5P_DEFAULT, data
+                             );
+	if (h5_status< 0)
+		fprintf(stderr, "dataset is not written! (err=%d)\n", h5_status);
+
+        H5Sclose (memspace);
+        H5Sclose (dataspace);
+        H5Dclose (dataset);
+        H5Tclose (type_id);
+	/*
+        free(global_h5dims);
+        free(local_h5dims);
+        free(start);
+        free(stride);
+	*/
+    }
+    else {
+        hsize_t * h5dims;
+        h5dims = (hsize_t *) malloc (rank * sizeof (hsize_t));    
+        if(array_dim_order_fortran == USE_FORTRAN) { 
+            // transpose dimension order for Fortran arrays
+            int i, time_idx, upper;
+            for (i = 0; i < rank; i++) {
+                h5dims [rank-1-i] = (hsize_t) dims[i];
+	     }
+        }
+        else if(array_dim_order_fortran == USE_C) {
+            int i;
+            for (i = 0; i < rank; i++)
+                h5dims [i] = (hsize_t) dims[i];
+        }
+
+        if(verbose >= DEBUG_INFO) {
+            int i;
+            for (i = 0; i < rank; i++) {
+                fprintf(stderr, "  Dataspace index = %d dimension = %d \n"
+                       ,i
+                       ,h5dims[i]
+                       );
+            }
+        }
+        hw_dataset (grp_id [level], name, data, type, rank, h5dims);
+        for (i = 1; i < level + 1; i++)
+            H5Gclose (grp_id [i]);
+
+        free (h5dims);
+    }
+    hw_free2D (grp_name, level);
+}
+
+/*
+ * Write a scalar var to h5 file
+ */
+void hw_scalar (hid_t root_id, char * dirstr, char * name, void * data
+               ,enum ADIOS_DATATYPES type, int append
+               )
+{
+    H5Eset_auto (NULL, NULL);
+    char ** grp_name;
+    int level;
+    int i;
+    int ndims = 1;
+    hid_t grp_id [NUM_GP + 1];
+    hsize_t dims [] = {1};
+    
+    grp_id [0] = root_id;
+    grp_name = bp_dirparser (dirstr, &level);
+    
+    for (i = 0; i < level; i++)
+    {
+        grp_id [i + 1] = H5Gopen (grp_id [i], grp_name [i]);
+        if (grp_id [i + 1] < 0) {
+            grp_id [i + 1] = H5Gcreate (grp_id [i], grp_name [i], 0);
+        }
+    }
+
+    if(scalar_dataspace == USE_SCALAR) {
+        // write in a scalar
+        hw_scalar_as_scalar (grp_id [level], name, data, type, append);
+    }
+    else if(scalar_dataspace == USE_SINGLE_ELE_ARRAY) {
+        // write in a single-element array
+        hw_scalar_as_array (grp_id [level], name, data, type, ndims, dims, append);
+    }
+
+    for (i = 1; i < level + 1; i++)
+        H5Gclose (grp_id [i]);
+
+    hw_free2D (grp_name, level);
+}
+
+/*
+ * Write a scalar var to h5 file as a scalar
+ */
+void hw_scalar_as_scalar (hid_t parent_id, char * name, void * data
+                 ,enum ADIOS_DATATYPES type, int append
+                 )
+{
+    hid_t h5_dataset_id;
+    hid_t h5_dataspace;
+    hid_t h5_type_id;
+    int status;
+    herr_t h5_status;
+
+    status = bp_getH5TypeId (type, &h5_type_id, data);
+    if(status == 0 && h5_type_id > 0)
+    {
+        h5_dataspace = H5Screate(H5S_SCALAR);
+        if (h5_dataspace > 0) 
+        {
+            h5_dataset_id = H5Dcreate (parent_id, name, h5_type_id
+                                      ,h5_dataspace, H5P_DEFAULT
+                                      );
+            if (h5_dataset_id > 0)
+            {
+                
+                status = H5Dwrite (h5_dataset_id, h5_type_id, H5S_ALL
+                                  ,H5S_ALL, H5P_DEFAULT, data
+                                  );
+                status = H5Dclose (h5_dataset_id);
+            }
+            else
+            {
+                if (append)
+                {
+                    h5_dataset_id = H5Dopen(parent_id, name);
+                    if (h5_dataset_id > 0)
+                    {
+                        h5_status = H5Dwrite (h5_dataset_id, h5_type_id, H5S_ALL
+                                             ,H5S_ALL, H5P_DEFAULT, data
+                                             );
+                        status = H5Sclose (h5_dataset_id);
+                    }
+                }
+            }
+            status = H5Sclose (h5_dataspace);
+        }
+        H5Tclose (h5_type_id);
+    }
+
+    return;
+}
+
+/*
+ * Write a scalar var to h5 file as a single-element array
+ */
+void hw_scalar_as_array (hid_t parent_id, char * name, void * data
+                 ,enum ADIOS_DATATYPES type, int ndims, hsize_t * dims
+                 ,int append
+                 )
+{
+    hid_t h5_dataset_id;
+    hid_t h5_dataspace;
+    hid_t h5_type_id;
+    int status;
+    herr_t h5_status;
+
+    status = bp_getH5TypeId (type, &h5_type_id, data);
+    if(status == 0 && h5_type_id > 0)
+    {
+        h5_dataspace = H5Screate_simple (ndims, dims, NULL);
+        if (h5_dataspace > 0) 
+        {
+            h5_dataset_id = H5Dcreate (parent_id, name, h5_type_id
+                                      ,h5_dataspace, H5P_DEFAULT
+                                      );
+            if (h5_dataset_id > 0)
+            {
+                
+                status = H5Dwrite (h5_dataset_id, h5_type_id, H5S_ALL
+                                  ,H5S_ALL, H5P_DEFAULT, data
+                                  );
+                status = H5Dclose (h5_dataset_id);
+            }
+            else
+            {
+                if (append)
+                {
+                    h5_dataset_id = H5Dopen(parent_id, name);
+                    if (h5_dataset_id > 0)
+                    {
+                        h5_status = H5Dwrite (h5_dataset_id, h5_type_id, H5S_ALL
+                                             ,H5S_ALL, H5P_DEFAULT, data
+                                             );
+                        status = H5Sclose (h5_dataset_id);
+                    }
+                }
+            }
+            status = H5Sclose (h5_dataspace);
+        }
+        H5Tclose (h5_type_id);
+    }
+
+    return;
+}
+
+/*
+ * hw_attr_str_gp() writes string-typed group attribute 
+ * hw_attr_str_gp() finds the group to which the attribute is attached and
+ * writes the attribute. 
+ */
+void hw_attr_str_gp (hid_t root_id, char * dirstr, char * aname, char * aval)
+{
+    H5Eset_auto (NULL, NULL);
+    char ** grp_name;
+    int level;
+    int i;
+    hid_t grp_id [NUM_GP + 1];
+
+    grp_id [0] = root_id;
+    grp_name = bp_dirparser (dirstr, &level);
+    
+    for (i = 0; i < level; i++)
+    {
+        grp_id [i + 1] = H5Gopen (grp_id [i], grp_name [i]);
+        if (grp_id [i + 1] < 0)
+        {
+            grp_id [i + 1] = H5Gcreate (grp_id [i], grp_name [i], 0);
+        }
+    }
+
+    hw_string_attr_gp_internal (grp_id [level], aname, aval);
+
+    for (i = 1; i < level; i++)
+        H5Gclose (grp_id [i]);
+
+    hw_free2D (grp_name, level);
+}
+
+/*
+ * hw_attr_str_ds() writes string-typed dataset attribute 
+ * hw_attr_str_ds() finds the dataset to which the attribute is attached and
+ * writes the attribute. 
+ */
+void hw_attr_str_ds (hid_t root_id, char * dirstr, char * aname, char * aval)
+{
+    H5Eset_auto (NULL, NULL);
+
+    char ** grp_name;
+    int level;
+    int i;
+    hid_t grp_id [NUM_GP + 1];
+    hid_t dataset_id;
+    hid_t type_id;
+    hid_t space_id;
+    hsize_t dims [] = {1};
+
+    grp_id [0] = root_id;
+    
+    grp_name = bp_dirparser (dirstr, &level);
+    
+    for (i = 0; i < level; i++)
+    {
+        grp_id [i + 1] = H5Gopen (grp_id [i], grp_name [i]);
+        if (grp_id [i + 1] < 0)
+        {
+            grp_id [i + 1] = H5Gcreate (grp_id [i], grp_name [i], 0);
+        }
+    }
+    if (grp_id[level] > 0) {
+        hw_string_attr_gp_internal (grp_id [level], aname, aval);
+
+        for (i = 1; i < level; i++)
+            H5Gclose (grp_id [i]);
+
+        hw_free2D (grp_name, level);
+        return;
+    }
+    for (i = 0; i < level - 1; i++) {
+        grp_id [i + 1] = H5Gopen (grp_id [i], grp_name [i]);
+	if (grp_id [i + 1] < 0) {
+            grp_id [i + 1] = H5Gcreate (grp_id [i], grp_name [i], 0);
+        }
+    }
+    
+    dataset_id = H5Dopen (grp_id [level - 1], grp_name [level - 1]);
+     
+    type_id = H5Tcopy (H5T_NATIVE_INT);
+    if (dataset_id == -1)
+    {
+        // BUG:
+        // create a dataset if the dataset specified by path doesn't exist
+        // actually this code never get executed because ADIOS always writes
+        // all vars before writing attributes
+        // in case the dataset does not exist, then there is no way to ensure
+        // the dataspace is single element array
+        // FIX:
+        // delay attribute write until corresponding dataset is written
+        //fprintf(stderr, "Warning in writing h5 file: you hit a bug (%s: %d)\n", __FILE__, __LINE__);
+
+        space_id = H5Screate_simple (1, dims, NULL);
+        dataset_id = H5Dcreate (grp_id [level - 1], grp_name [level - 1]
+                               ,type_id, space_id, H5P_DEFAULT
+                               );
+        if(dataset_id==-1)
+           hw_attr_str_gp (root_id, dirstr, aname, aval);
+    }
+   
+    if(dataset_id>0) hw_string_attr_ds_internal (dataset_id, aname, aval);
+
+    H5Dclose (dataset_id);
+    for (i = 1; i < level; i++)
+        H5Gclose (grp_id [i]);
+
+    hw_free2D (grp_name, level);
+}
+
+/*
+ * String-typed group attribute is converted to hdf5 dataset attribute 
+ * in C convention or Fortran convention. 
+ */
+void hw_string_attr_gp_internal (hid_t parent_id, const char *name,const char *value)
+{
+    if(attr_str_gp_fortran == USE_C) {
+        hw_string_attr_c(parent_id, name, value);   
+    }
+    else if(attr_str_gp_fortran == USE_FORTRAN) {
+        hw_string_attr_f(parent_id, name, value);    
+    }
+}
+
+/*
+ * String-typed dataset attribute is converted to hdf5 dataset attribute 
+ * in C convention or Fortran convention. 
+ */
+void hw_string_attr_ds_internal (hid_t parent_id, const char *name,const char *value)
+{
+    if(attr_str_ds_fortran == USE_C) {
+        hw_string_attr_c(parent_id, name, value);   
+    }
+    else if(attr_str_ds_fortran == USE_FORTRAN) {
+        hw_string_attr_f(parent_id, name, value);    
+    }
+}
+
+/*
+ * Write string-typed attribute in C convention
+ */
+void hw_string_attr_c (hid_t parent_id, const char *name,const char *value)
+{
+    hid_t dspace_id,dtype_id,attr_id;
+    dspace_id = H5Screate(H5S_SCALAR);
+    if(dspace_id>0)
+    {
+        dtype_id = H5Tcopy(H5T_C_S1_g);
+        if(dtype_id>0)
+        {
+            H5Tset_size(dtype_id,strlen(value)+1);
+            attr_id = H5Acreate(parent_id,name,dtype_id,dspace_id,H5P_DEFAULT);
+            if(attr_id>0)
+            {
+                H5Awrite(attr_id,dtype_id,value);
+                H5Aclose(attr_id);
+            }
+            H5Tclose(dtype_id);
+        }
+        H5Sclose(dspace_id);
+    }
+
+    return;
+}
+
+/*
+ * Write string-typed attribute in Fortran convention
+ */
+void hw_string_attr_f (hid_t parent_id, const char *name,const char *value)
+{
+    hid_t dspace_id, dtype_id, attr_id;
+    hsize_t adims[1] = {1};
+
+    dspace_id = H5Screate(H5S_SCALAR);
+    //dspace_id = H5Screate_simple(1, adims, NULL);
+    if(dspace_id > 0)
+    {
+        dtype_id = H5Tcopy(H5T_C_S1_g);
+        //dtype_id = H5Tcopy(H5T_FORTRAN_S1); // Fortran string
+        if(dtype_id > 0)
+        {
+            //H5Tset_size(dtype_id, strlen(value));
+            H5Tset_size(dtype_id,strlen(value)+1);
+            attr_id = H5Acreate(parent_id, name, dtype_id, dspace_id, H5P_DEFAULT);
+            if(attr_id > 0)
+            {
+                H5Awrite(attr_id, dtype_id, value);
+                H5Aclose(attr_id);
+            }
+            H5Tclose(dtype_id);
+        }
+        H5Sclose(dspace_id);
+    }
+
+    return;
+}
+
+/*
+ * hw_attr_num_gp() writes numeric-typed group attribute 
+ * hw_attr_num_gp() finds the group to which the attribute is attached and
+ * writes the attribute. 
+ */
+void hw_attr_num_gp(hid_t root_id, char *dirstr, char *aname, void *avalue, enum ADIOS_DATATYPES type)
+{
+    H5Eset_auto(NULL,NULL);
+    char **grp_name;
+    int level,i;
+    hid_t grp_id[NUM_GP+1];
+
+    grp_id[0] = root_id;
+    grp_name = bp_dirparser(dirstr,&level);
+    
+    for(i=0;i<level;i++)
+    {
+        grp_id[i+1] = H5Gopen(grp_id[i],grp_name[i]);
+        if(grp_id[i+1]<0)
+        {
+            grp_id[i+1] = H5Gcreate(grp_id[i],grp_name[i], 0);
+        }
+    }
+
+    hw_scalar_attr(grp_id[level], aname, avalue,type);
+
+    for(i=1;i<level;i++)
+        H5Gclose(grp_id[i]);
+
+    hw_free2D(grp_name,level);
+}
+
+/*
+ * hw_attr_num_ds() writes numeric-typed dataset attribute 
+ * hw_attr_num_ds() finds the dataset to which the attribute is attached and
+ * writes the attribute. 
+ */
+void hw_attr_num_ds(hid_t root_id, char *dirstr, char *aname, void *avalue, enum ADIOS_DATATYPES type)
+{
+    H5Eset_auto(NULL,NULL);
+    char **grp_name;
+    int level,i;
+    hid_t grp_id[NUM_GP+1],dataset_id,type_id, space_id;
+    hsize_t dims[]={1};
+
+    grp_id[0] = root_id;
+    
+    grp_name = bp_dirparser(dirstr,&level);
+    for(i=0;i<level;i++)
+    {
+        grp_id[i+1] = H5Gopen(grp_id[i],grp_name[i]);
+        if(grp_id[i+1]<0)
+        {
+            grp_id[i+1] = H5Gcreate(grp_id[i],grp_name[i], 0);
+        }
+    }
+
+    if (grp_id[level] > 0) {    
+        hw_scalar_attr(grp_id[level], aname, avalue,type);
+        for(i=1;i<level;i++)
+            H5Gclose(grp_id[i]);
+        hw_free2D(grp_name,level);
+        return; 
+    }
+    
+    for (i = 0; i < level - 1; i++) {
+        grp_id [i + 1] = H5Gopen (grp_id [i], grp_name [i]);
+	if (grp_id [i + 1] < 0) {
+            grp_id [i + 1] = H5Gcreate (grp_id [i], grp_name [i], 0);
+        }
+    }
+    
+    dataset_id = H5Dopen(grp_id[level-1],grp_name[level-1]);
+    
+    if(dataset_id==-1)
+    {
+        // BUG:
+        // create a dataset if the dataset specified by path doesn't exist
+        // actually this code never get executed because ADIOS always writes
+        // all vars before writing attributes
+        // in case the dataset does not exist, then there is no way to ensure
+        // the dataspace is single element array
+        // FIX:
+        // delay attribute write until corresponding dataset is written
+        fprintf(stderr, "Warning in writing h5 file: you hit a bug (%s: %d)\n", __FILE__, __LINE__);
+
+        type_id = H5Tcopy(H5T_NATIVE_INT);
+        space_id = H5Screate_simple(1,dims,NULL);
+        dataset_id = H5Dcreate(grp_id[level-1],grp_name[level-1],type_id,space_id,H5P_DEFAULT);
+        if(dataset_id==-1)
+        {
+           printf("hit group att!%d\n",type);
+           if(type==adios_string)
+              hw_attr_str_gp (root_id, dirstr, aname, avalue);
+           else
+              hw_attr_num_gp (root_id, dirstr, aname, avalue,type);
+        }
+    }
+
+    if(dataset_id>0)
+    {
+       hw_scalar_attr(dataset_id, aname, avalue,type);
+      //printf("%s: dataset_id:%d, %s\n",grp_name[0],dataset_id,aname);
+       H5Dclose(dataset_id);
+    }
+
+
+    for(i=1;i<level;i++)
+        H5Gclose(grp_id[i]);
+
+    hw_free2D(grp_name,level);
+}
+
+/*
+ * Write an integer attribute as a scalar or a single-element-array
+ */
+void hw_scalar_attr( hid_t parent_id, const char *name, void *value,enum ADIOS_DATATYPES type)
+{
+    if(scalar_dataspace == USE_SCALAR) {
+        hw_scalar_attr_scalar (parent_id, name, value, type);
+    }
+    else if(scalar_dataspace == USE_SINGLE_ELE_ARRAY){
+        hw_scalar_attr_array (parent_id, name, value, type);
+    }
+}
+
+/*
+ * Write an integer attribute to a h5 file as a scalar
+ *
+ * Edited from the AVS example file src/hdf5/examp/write_struct.c
+ */
+void hw_scalar_attr_scalar ( hid_t parent_id, const char *name, void *value, enum ADIOS_DATATYPES type)
+{
+    hid_t h5_dspace_id, h5_attr_id, h5_type_id;
+    int status;
+    herr_t h5_status;
+  
+    h5_dspace_id = H5Screate( H5S_SCALAR );
+    if( h5_dspace_id > 0 ) 
+    {
+        status = bp_getH5TypeId( type, &h5_type_id, value );
+        if ( status == 0 && h5_type_id > 0 ) 
+        {
+            h5_attr_id = H5Acreate( parent_id, name, h5_type_id,h5_dspace_id, H5P_DEFAULT );
+            if( h5_attr_id > 0 ) 
+            {
+                h5_status = H5Awrite( h5_attr_id, h5_type_id, value );
+                if (h5_status < 0)
+                    fprintf(stderr, "Failed to write an attribute (%s) to the h5 file!\n",name);
+                H5Aclose( h5_attr_id );     /* close attribute */
+            }
+            H5Sclose( h5_dspace_id );       /* close dataspace */
+        }
+        H5Tclose( h5_type_id );
+    }
+    return;
+}
+
+/*
+ * Write an integer attribute to a h5 file as a single-element-array
+ */
+void hw_scalar_attr_array ( hid_t parent_id, const char *name, void *value, enum ADIOS_DATATYPES type)
+{
+    hid_t h5_dspace_id, h5_attr_id, h5_type_id;
+    int status;
+    herr_t h5_status;
+    hsize_t dims[1] = {1};
+  
+    h5_dspace_id = H5Screate_simple(1, dims, NULL);
+    if( h5_dspace_id > 0 ) 
+    {
+        status = bp_getH5TypeId( type, &h5_type_id, value );
+        if ( status == 0 && h5_type_id > 0 ) 
+        {
+            h5_attr_id = H5Acreate( parent_id, name, h5_type_id, h5_dspace_id, H5P_DEFAULT );
+            if( h5_attr_id > 0 ) 
+            {
+                h5_status = H5Awrite( h5_attr_id, h5_type_id, value );
+                if (h5_status < 0)
+                    fprintf(stderr, "Failed to write an attribute (%s) to the h5 file!\n", name);
+                H5Aclose( h5_attr_id );     /* close attribute */
+            }
+            H5Sclose( h5_dspace_id );       /* close dataspace */
+        }
+        H5Tclose( h5_type_id );
+    }
+    return;
+}
+
+/*
+ * Write an array as a dataset to a h5 file 
+ */
+void hw_dataset(hid_t parent_id, char* name, void* data,enum ADIOS_DATATYPES type, int rank, hsize_t * dims)
+{
+    hid_t dataset_id, dataspace, cparms, type_id,filespace;    
+    int i,rank_old, time_idx;
+    herr_t h5_status;
+    hsize_t *offset;
+    hsize_t *maxdims;
+    maxdims = (hsize_t*)malloc(sizeof(hsize_t)*rank);
+    offset = (hsize_t*)malloc(sizeof(hsize_t)*rank);
+/*
+    for (i=0;i<rank;i++) {
+	time_idx = dims[i];
+        dims[i] = time_idx;
+    }
+*/
+    cparms = H5Pcreate(H5P_DATASET_CREATE);
+
+    for(i=0;i<rank;i++) {
+        maxdims[i] = H5S_UNLIMITED;    
+        offset[i] = 0;
+    }
+    for (i=0;i<rank;i++) {
+	if (dims[i]==0) {
+	    dims[i]=1;
+	    break;
+	}
+    }
+
+    h5_status = H5Pset_chunk(cparms,rank,dims);
+
+    time_idx = i; 
+
+    h5_status = bp_getH5TypeId(type, &type_id, data);
+    if(h5_status == 0 && type_id>0) {
+        dataset_id = H5Dopen(parent_id,name);
+        if(dataset_id<0) {
+            dataspace = H5Screate_simple(rank, dims, NULL);
+            if(dataspace>0 && h5_status==0) {
+                dataset_id = H5Dcreate(parent_id, name, type_id, dataspace,cparms);
+		if (dataset_id < 0) {
+			dataset_id = H5Gopen (parent_id, name);
+			if (dataset_id > 0) {
+				H5Gunlink(parent_id,name);	
+                		dataset_id = H5Dcreate(parent_id, name, type_id, dataspace,cparms);
+			}
+		}
+                if(dataset_id<0) {
+			fprintf(stderr, "Dataset %s Creation failed!\n",name);
+                    H5Sclose(dataspace);
+                    return;
+                }
+                h5_status = H5Dextend (dataset_id, dims);
+                filespace = H5Dget_space(dataset_id);
+                h5_status = H5Sselect_hyperslab(filespace,H5S_SELECT_SET,offset,NULL,dims,NULL);
+                h5_status = H5Dwrite(dataset_id,type_id,dataspace,filespace,H5P_DEFAULT,data);
+            }
+        }
+        else {
+            filespace = H5Dget_space(dataset_id);
+            rank_old = H5Sget_simple_extent_ndims(filespace);
+            if(rank_old!=rank && filespace>0) {
+                H5Sclose(filespace);
+                return;
+            }
+            h5_status = H5Sget_simple_extent_dims(filespace,maxdims,NULL);
+            if (time_idx<rank) {
+                if (verbose >= DEBUG_INFO) 
+ 			printf("\ttime step: %d\n",maxdims[i]);
+                offset[time_idx] = maxdims[time_idx];
+                maxdims [time_idx] += dims[time_idx];
+            }
+            h5_status = H5Dextend (dataset_id, maxdims);
+            filespace = H5Dget_space(dataset_id);
+            int ret_rank = H5Sget_simple_extent_dims(filespace,maxdims,NULL);
+            if(verbose >= DEBUG_INFO) {
+                printf("parent_id=%d,dataset_id=%d, name=%s,filespace=%d\n",\
+                        parent_id,dataset_id, name,filespace);
+            }
+
+            h5_status = H5Sselect_hyperslab(filespace,H5S_SELECT_SET,offset,NULL,dims,NULL);
+            dataspace = H5Screate_simple(rank, dims, NULL);
+            h5_status = H5Dwrite(dataset_id,type_id,dataspace,filespace,H5P_DEFAULT,data);
+        }
+        if(dataset_id>0) {
+            h5_status = H5Dclose(dataset_id);
+	}
+        if(dataspace>0)
+            h5_status = H5Sclose(dataspace);
+        if(filespace>0)
+            h5_status = H5Sclose(filespace);
+    }
+    h5_status=H5Tclose(type_id);
+    h5_status=H5Pclose(cparms);
+    free(maxdims);
+    free(offset);
+    return;
+}
+
+/*
+ * Maps bp datatypes to h5 datatypes 
+ *
+ * The Mapping is according to HDF5 Reference Manual
+ * (http://hdf.ncsa.uiuc.edu/HDF5/doc1.6/Datatypes.html)
+ */
+int bp_getH5TypeId(enum ADIOS_DATATYPES type, hid_t* h5_type_id, void * val)
+{
+    int size, status=0;
+
+    switch (type)
+    {
+        case adios_byte:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_CHAR);
+            break;
+        case adios_string:
+            if(var_str_fortran == USE_FORTRAN) {
+                *h5_type_id = H5Tcopy(H5T_FORTRAN_S1);
+            }
+            else { // otherwise assume C
+                *h5_type_id = H5Tcopy(H5T_C_S1_g);
+            }
+            break;
+        case adios_real:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_FLOAT);
+            break;
+        case adios_double:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_DOUBLE);
+            break;
+        case adios_long_double:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_LDOUBLE);
+            break;
+        case adios_unsigned_byte:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_UINT8);
+            break;
+        case adios_unsigned_short:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_UINT16);
+            break;
+        case adios_unsigned_integer:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_UINT32);
+            break;
+        case adios_unsigned_long:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_UINT64);
+            break;
+        case adios_short:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_INT16);
+            break;
+        case adios_integer:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_INT32);
+            break;
+        case adios_long:
+            *h5_type_id = H5Tcopy(H5T_NATIVE_INT64);
+            break;
+        case adios_complex:
+        case adios_double_complex:
+            fprintf(stderr, "Error in mapping ADIOS Data Types to HDF5: complex not supported yet.\n");
+            status = -1;
+            break;
+        case adios_unknown:
+        default:
+            fprintf(stderr, "Error in mapping ADIOS Data Types to HDF5: unknown data type.\n");
+            status = -1;
+    }
+    return status;
+}
+
+const char * value_to_string (enum ADIOS_DATATYPES type, void * data)
+{
+    static char s [100];
+    s [0] = 0;
+
+    switch (type)
+    {
+        case adios_unsigned_byte:
+            sprintf (s, "%u", *(((uint8_t *) data)));
+            break;
+
+        case adios_byte:
+            sprintf (s, "%d", *(((int8_t *) data)));
+            break;
+
+        case adios_short:
+            sprintf (s, "%hd", *(((int16_t *) data)));
+            break;
+
+        case adios_unsigned_short:
+            sprintf (s, "%uh", *(((uint16_t *) data)));
+            break;
+
+        case adios_integer:
+            sprintf (s, "%d", *(((int32_t *) data)));
+            break;
+
+        case adios_unsigned_integer:
+            sprintf (s, "%u", *(((uint32_t *) data)));
+            break;
+
+        case adios_long:
+            sprintf (s, "%lld", *(((int64_t *) data)));
+            break;
+
+        case adios_unsigned_long:
+            sprintf (s, "%llu", *(((uint64_t *) data)));
+            break;
+
+        case adios_real:
+            sprintf (s, "%f", *(((float *) data)));
+            break;
+
+        case adios_double:
+            sprintf (s, "%le", *(((double *) data)));
+            break;
+
+        case adios_long_double:
+            sprintf (s, "%Le", *(((long double *) data)));
+            break;
+        case adios_string:
+            sprintf (s, "%s", ((char *) data));
+            break;
+
+        case adios_complex:
+            sprintf (s, "(%f %f)", *(((float *) data) + 0)
+                                 , *(((float *) data) + 1)
+                    );
+            break;
+
+        case adios_double_complex:
+            sprintf (s, "(%lf %lf)", *(((double *) data) + 0)
+                                   , *(((double *) data) + 1)
+                    );
+            break;
+    }
+
+    return s;
+}
+
+void print_process_group_header (uint64_t num
+                      ,struct adios_process_group_header_struct_v1 * pg_header
+                      )
+{
+    int i;
+    struct adios_method_info_struct_v1 * m;
+
+    printf ("Process Group: %llu\n", num);
+    printf ("\tGroup Name: %s\n", pg_header->name);
+    printf ("\tHost Language Fortran?: %c\n"
+           ,(pg_header->host_language_fortran == adios_flag_yes ? 'Y' : 'N')
+           );
+    printf ("\tCoordination Var Member ID: %d\n", pg_header->coord_var_id);
+    printf ("\tTime Name: %s\n", pg_header->time_index_name);
+    printf ("\tTime: %d\n", pg_header->time_index);
+    printf ("\tMethods used in output: %d\n", pg_header->methods_count);
+    m = pg_header->methods;
+    while (m)
+    {
+        printf ("\t\tMethod ID: %d\n", m->id);
+        printf ("\t\tMethod Parameters: %s\n", m->parameters);
+
+        m = m->next;
+    }
+}
+
diff --git a/utils/bp2h5/hw-utils.h b/utils/bp2h5/hw-utils.h
new file mode 100644
index 0000000..948b0ec
--- /dev/null
+++ b/utils/bp2h5/hw-utils.h
@@ -0,0 +1,163 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#ifndef HW_UTILS_H
+#define HW_UTILS_H 1
+
+#include "stdint.h"
+#include "hdf5.h"
+#include "adios_types.h"
+
+enum lang_convention {
+    USE_FORTRAN = 1,
+    USE_C = 2
+};
+
+enum scalar_convention {
+    USE_SCALAR = 1,
+    USE_SINGLE_ELE_ARRAY = 2
+};
+
+enum verbose_level {
+    NO_INFO = 0,
+    LIST_INFO = 1,    
+    DEBUG_INFO = 2   
+};
+
+/*
+ * Initialization
+ * initialize_bp2h5() sets config variables and allocate
+ * internal read buffer.
+ * It returns 0 if no error and -1 otherwise
+ */
+int initialize_bp2h5(enum lang_convention array_dim_order,
+                     enum lang_convention var_str,
+                     enum lang_convention attr_str_ds,
+                     enum lang_convention attr_str_gp,
+                     enum scalar_convention scalar_ds,
+                     enum verbose_level verb
+                     );
+
+/*
+ * Convert bp file fnamein to a h5 file fnameout
+ */
+int hw_makeh5(char *filename, char *filename1);
+
+/*
+ * String-typed dataset attribute is converted to hdf5 dataset attribute 
+ * in C convention or Fortran convention. 
+ */
+void hw_string_attr_ds_internal ( hid_t parent_id, const char *name,const char *value);
+
+/*
+ * String-typed group attribute is converted to hdf5 dataset attribute 
+ * in C convention or Fortran convention. 
+ */
+void hw_string_attr_gp_internal (hid_t parent_id, const char *name,const char *value);
+
+/*
+ * Write string-typed attribute in Fortran convention
+ */
+void hw_string_attr_f (hid_t parent_id, const char *name,const char *value);
+
+/*
+ * Write string-typed attribute in C convention
+ */
+void hw_string_attr_c (hid_t parent_id, const char *name,const char *value);
+
+/*
+ * Write an integer attribute as a scalar or a single-element-array
+ */
+void hw_scalar_attr(hid_t parent_id, const char *name, void *value,enum ADIOS_DATATYPES type);
+
+/*
+ * Write an integer attribute to an h5 file as a scalar
+ *
+ * Edited from the AVS example file src/hdf5/examp/write_struct.c
+ */
+void hw_scalar_attr_scalar ( hid_t parent_id, const char *name, void *value, enum ADIOS_DATATYPES type);
+
+/*
+ * Write an integer attribute to an h5 file as a single-element-array
+ */
+void hw_scalar_attr_array ( hid_t parent_id, const char *name, void *value, enum ADIOS_DATATYPES type);
+
+/*
+ * Write dataset to h5 file
+ */
+/*
+ * Write dataset to h5 file
+ */
+void hw_dset (hid_t root_id, char * dirstr, char * name, void * data
+             ,enum ADIOS_DATATYPES type, int rank
+             ,uint64_t *dims
+             ,uint64_t *global_dims
+             ,uint64_t *offsets
+             ,uint32_t time_index 
+             );
+
+/*
+ * Write a scalar var to h5 file as a scalar
+ */
+void hw_scalar_as_scalar (hid_t parent_id, char * name, void * data
+                 ,enum ADIOS_DATATYPES type, int append
+                 );
+
+/*
+ * Write a scalar var to h5 file as a single-element array
+ */
+void hw_scalar_as_array (hid_t parent_id, char * name, void * data
+                 ,enum ADIOS_DATATYPES type, int ndims, hsize_t * dims
+                 ,int append
+                 );
+
+/*
+ * write a scalar var to h5 file
+ */
+void hw_scalar (hid_t root_id, char * dirstr, char * name, void * data
+               ,enum ADIOS_DATATYPES type, int append
+               );
+
+/*
+ * hw_attr_str_ds() writes string-typed dataset attribute 
+ * hw_attr_str_ds() finds the dataset to which the attribute is attached and
+ * writes the attribute. 
+ */
+void hw_attr_str_ds (hid_t root_id, char * dirstr, char * aname, char * aval);
+
+/*
+ * hw_attr_num_ds() writes numeric-typed dataset attribute 
+ * hw_attr_num_ds() finds the dataset to which the attribute is attached and
+ * writes the attribute. 
+ */
+void hw_attr_num_ds(hid_t root_id, char *dirstr, char *aname, void *avalue, enum ADIOS_DATATYPES type);
+
+/*
+ * hw_attr_str_gp() writes string-typed group attribute 
+ * hw_attr_str_gp() finds the group to which the attribute is attached and
+ * writes the attribute. 
+ */
+void hw_attr_str_gp (hid_t root_id, char * dirstr, char * aname, char * aval);
+
+/*
+ * hw_attr_num_gp() writes numeric-typed group attribute 
+ * hw_attr_num_gp() finds the group to which the attribute is attached and
+ * writes the attribute. 
+ */
+void hw_attr_num_gp(hid_t root_id, char *dirstr, char *aname, void *avalue, enum ADIOS_DATATYPES type);
+
+/*
+ * Write an array as a dataset to an h5 file 
+ */
+void hw_dataset(hid_t parent_id, char* name, void* data,enum ADIOS_DATATYPES type, int ndims, hsize_t * dims);
+
+/*
+ * Maps bp datatypes to h5 datatypes 
+ */
+ int bp_getH5TypeId(enum ADIOS_DATATYPES type, hid_t* h5_type_id, void * val);
+
+#endif
diff --git a/utils/bp2ncd/Makefile.am b/utils/bp2ncd/Makefile.am
new file mode 100644
index 0000000..0abe030
--- /dev/null
+++ b/utils/bp2ncd/Makefile.am
@@ -0,0 +1,19 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+bin_PROGRAMS = bp2ncd
+
+bp2ncd_SOURCES = bp2ncd.c
+
+bp2ncd_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_SEQ_CPPFLAGS) $(ADIOSLIB_SEQ_CFLAGS)
+bp2ncd_LDFLAGS = $(ADIOSLIB_SEQ_LDFLAGS) -static-libtool-libs
+bp2ncd_LDADD = $(top_builddir)/src/libadios_internal_nompi.a
+bp2ncd_LDADD += $(ADIOSLIB_SEQ_LDADD)
+
+EXTRA_DIST = bp2ncd.h
+if USE_PARALLEL_COMPILER
+    CC=$(MPICC)
+    CXX=$(MPICXX)
+endif
diff --git a/utils/bp2ncd/Makefile.in b/utils/bp2ncd/Makefile.in
new file mode 100644
index 0000000..4b56509
--- /dev/null
+++ b/utils/bp2ncd/Makefile.in
@@ -0,0 +1,576 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = bp2ncd$(EXEEXT)
+subdir = utils/bp2ncd
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_bp2ncd_OBJECTS = bp2ncd-bp2ncd.$(OBJEXT)
+bp2ncd_OBJECTS = $(am_bp2ncd_OBJECTS)
+am__DEPENDENCIES_1 =
+bp2ncd_DEPENDENCIES = $(top_builddir)/src/libadios_internal_nompi.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(bp2ncd_SOURCES)
+DIST_SOURCES = $(bp2ncd_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = @CC@
+ at USE_PARALLEL_COMPILER_TRUE@CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+ at USE_PARALLEL_COMPILER_TRUE@CXX = $(MPICXX)
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+bp2ncd_SOURCES = bp2ncd.c
+bp2ncd_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_SEQ_CPPFLAGS) $(ADIOSLIB_SEQ_CFLAGS)
+bp2ncd_LDFLAGS = $(ADIOSLIB_SEQ_LDFLAGS) -static-libtool-libs
+bp2ncd_LDADD = $(top_builddir)/src/libadios_internal_nompi.a \
+	$(ADIOSLIB_SEQ_LDADD)
+EXTRA_DIST = bp2ncd.h
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  utils/bp2ncd/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  utils/bp2ncd/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
+	done
+
+clean-binPROGRAMS:
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+bp2ncd$(EXEEXT): $(bp2ncd_OBJECTS) $(bp2ncd_DEPENDENCIES) 
+	@rm -f bp2ncd$(EXEEXT)
+	$(LINK) $(bp2ncd_LDFLAGS) $(bp2ncd_OBJECTS) $(bp2ncd_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.c.o:
+	$(COMPILE) -c $<
+
+.c.obj:
+	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+	$(LTCOMPILE) -c -o $@ $<
+
+bp2ncd-bp2ncd.o: bp2ncd.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bp2ncd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bp2ncd-bp2ncd.o `test -f 'bp2ncd.c' || echo '$(srcdir)/'`bp2ncd.c
+
+bp2ncd-bp2ncd.obj: bp2ncd.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bp2ncd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bp2ncd-bp2ncd.obj `if test -f 'bp2ncd.c'; then $(CYGPATH_W) 'bp2ncd.c'; else $(CYGPATH_W) '$(srcdir)/bp2ncd.c'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic clean-libtool ctags distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-binPROGRAMS uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/utils/bp2ncd/bp2ncd.c b/utils/bp2ncd/bp2ncd.c
new file mode 100644
index 0000000..182091c
--- /dev/null
+++ b/utils/bp2ncd/bp2ncd.c
@@ -0,0 +1,849 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <string.h>
+#include "netcdf.h"
+#include "adios_types.h"
+#include "adios_transport_hooks.h"
+#include "adios_bp_v1.h"
+#include "adios_internals.h"
+#define ERR(e){if(e){printf("Error:%s\n",nc_strerror(e));return 2;}}
+#define DIVIDER "\t---------------------------------\n"
+//#define DIVIDER "\t************************************\n"
+
+struct var_dim
+{
+    uint16_t id;
+    uint64_t rank;
+    int      nc_dimid;
+    char dimname[256];
+};
+
+void copy_buffer(struct adios_bp_buffer_struct_v1 *dest
+                ,struct adios_bp_buffer_struct_v1 *src) {
+
+    memcpy (dest, src, sizeof(struct adios_bp_buffer_struct_v1));
+}
+static int verbose=0;
+int ncd_gen_name (char *fullname, char *path, char *name) {
+    int i;
+    char *new_path = strdup (path);
+    if ( path[0] == '/')
+         new_path=new_path+1;
+          
+    for ( i = 0; i < strlen (new_path); i++) {
+        if ( new_path[i] == '[' || new_path[i] == ']' || new_path[i] == '/' || new_path[i] == '\\')
+            new_path[i] = '_';
+    }
+    if (*new_path != '\0') {
+        if (new_path[i-1]!='_') {
+            if (strcmp(name,"") )  
+                sprintf (fullname, "%s_%s", new_path, name);
+            else {
+                strcpy (fullname,new_path);
+                fullname [strlen(fullname)] = '\0'; 
+            }
+        }
+        else 
+            if (strcmp(name,"") )  
+                sprintf (fullname, "%s%s", new_path, name);
+            else {
+                strcpy (fullname,new_path);
+                fullname [strlen(fullname)] = '\0'; 
+            }
+    }
+    else
+        strcpy (fullname, name);
+    return 0;
+}
+int ncd_attr_str_ds (int ncid 
+                    ,struct adios_attribute_struct_v1 * attribute
+                    ,struct adios_bp_buffer_struct_v1 * ptr_buffer
+                    ,int count
+                    ,struct var_dim * var_dims
+                    ,int var_dims_count) {
+    int i;
+    char fullname[255];
+    char *path = attribute->path;
+    char *name = attribute->name;
+    char *new_path;
+    int  valid,retval,attid;
+
+    ncd_gen_name (fullname, path, name);
+    valid = -1;
+    if (strcmp(path,"/")==0) {
+        valid = NC_GLOBAL;
+        strcpy(fullname, name);
+    }
+    else {
+        ncd_gen_name (fullname, path, "");
+        //printf("\tpathname:%s\n",fullname);
+        retval=nc_inq_varid(ncid,fullname,&valid);
+        if(retval < 0)
+           return 1; 
+        else
+            strcpy(fullname, name);
+        //ERR(retval); 
+        //if (valid<0)
+        //    ncd_gen_name (fullname, path,name);
+        //printf("\t attr_name:%s %d\n",fullname,valid);
+    }
+    retval=nc_inq_attid(ncid,valid,fullname,&attid);
+    //printf("\tretval:%d attid=%d\n",retval,attid);
+    //printf(DIVIDER);
+    if (retval == NC_NOERR ) {
+       //printf("\tattribute (%s) existed\n", fullname);
+       return 0;
+     }
+    else
+       //printf("\tattribute: %s \n", fullname);
+
+    nc_redef(ncid);
+
+    void *value = attribute->value;
+    size_t len = 1; 
+    enum ADIOS_DATATYPES type =  attribute->type;
+    struct adios_var_header_struct_v1 var_header;
+    struct adios_var_payload_struct_v1 var_payload;  
+    uint64_t offset; 
+    struct adios_index_var_struct_v1 * vars_root = 0;
+//    struct adios_index_attribute_struct_v1 * atts_root = 0;
+
+    var_payload.payload = 0;
+
+    if ( attribute->is_var == adios_flag_yes) {
+        adios_posix_read_vars_index (ptr_buffer);
+        adios_parse_vars_index_v1 (ptr_buffer, &vars_root);
+        //print_vars_index ( vars_root);
+        while (vars_root) {
+            if (vars_root->id == attribute->var_id) {
+                type = vars_root->type;
+                if (!(vars_root->characteristics->dims.dims)) { 
+                    value = vars_root->characteristics->value; 
+                    //printf("\t      var: %s = ", vars_root->var_name);
+                }
+                else {
+                    offset = vars_root->characteristics->offset;
+                }
+                break; 
+            } 
+            vars_root = vars_root->next;
+        }
+#if 0
+        for ( i = 0; i < count; i++) {
+            adios_parse_var_data_header_v1 (ptr_buffer, &var_header);
+            if ( var_header.id == attribute->var_id) {
+                struct  adios_dimension_struct_v1 * dims = var_header.dims; 
+                while (dims) {
+                      if ( dims->dimension.var_id != 0 ) {
+                           for (i = 0; i < var_dims_count; i++) {
+                                if (var_dims [i].id == dims->dimension.var_id ){
+                                    len *= var_dims [i]. rank;
+			            break;
+                                } 
+                           }
+                      }
+                      else
+                         len *= dims->dimension.rank;
+                      dims = dims->next;
+                 }
+                 type = var_header.type;
+                 var_payload.payload = malloc (var_header.payload_size);
+                 adios_parse_var_data_payload_v1 (ptr_buffer, &var_header, &var_payload, var_header.payload_size);
+                 value = var_payload.payload;
+              }
+              else
+                  adios_parse_var_data_payload_v1 (ptr_buffer, &var_header, NULL, 0);
+
+         }
+#endif
+    }
+    else
+        //printf("\t      XML: ");   
+    switch (type) {
+         case adios_unsigned_byte:
+            retval=nc_put_att_uchar(ncid,valid,fullname,NC_BYTE,len,value);
+            break;
+         case adios_byte:
+            retval=nc_put_att_schar(ncid,valid,fullname,NC_BYTE,len,value);
+            break;
+         case adios_string:
+            //printf("%s\n", (char *) value);    
+            retval=nc_put_att_text(ncid,valid,fullname, strlen(value),value);
+            break;
+         case adios_short:
+            //printf("\tvaule: %s\n", *(short *) value);    
+            retval=nc_put_att_short(ncid,valid,fullname,NC_SHORT,len,value);
+            ERR(retval); 
+            break;
+         case adios_integer:
+            //printf("%d\n", *((int *) value));    
+            retval=nc_put_att_int(ncid,valid,fullname,NC_INT,len,value);
+            break;
+         case adios_long:
+            //printf("\tvaule: %s\n", *(long *) value);    
+            retval=nc_put_att_long(ncid,valid,fullname,NC_LONG,len,value);
+            break;
+         case adios_real:
+            //printf("\tvaule: %s\n", *(float *) value);    
+            retval=nc_put_att_float(ncid,valid,fullname,NC_FLOAT,len,value);
+            break;
+         case adios_double:
+            //printf("\tvaule: %s\n", *(double *) value);    
+            retval=nc_put_att_double(ncid,valid,fullname,NC_DOUBLE,len,value);
+            break;
+         default:
+            break;
+     }
+     ERR(retval);
+
+    nc_enddef(ncid); 
+    if ( var_payload.payload)
+        free (var_payload.payload);
+}
+
+int ncd_dataset (int ncid
+                ,struct adios_var_header_struct_v1 *ptr_var_header
+                ,struct adios_var_payload_struct_v1 *ptr_var_payload
+                ,struct adios_bp_buffer_struct_v1 * ptr_buffer
+                ,struct var_dim *var_dims
+                ,int var_dims_count) {
+
+    char *name = ptr_var_header->name;
+    char *path = ptr_var_header->path;
+    char *new_path, fullname[256],dimname[256];
+    enum ADIOS_DATATYPES type = ptr_var_header->type;
+    enum ADIOS_FLAG is_dim = ptr_var_header->is_dim;
+    void *val = ptr_var_payload->payload; 
+    uint64_t payload_size = ptr_var_header->payload_size;
+    struct adios_dimension_struct_v1 *dims = ptr_var_header->dims; 
+    int maxrank = 0, i,j, valid=-1, nc_dimid=-1, retval=0, time_dimrank=0;
+    size_t rank = 0, start_dims[10],count_dims[10];
+    int dimids[10];
+    const char one_name[] = "one";
+    static int onename_dimid = -1;
+    int time_index; 
+    struct adios_index_attribute_struct_v1 * atts_root = 0;
+    
+    memset(dimids,-1,10*sizeof(int));
+    if(!strcmp(path,"") && !strcmp(name,""))
+	return 0;
+    ncd_gen_name (fullname, path, name);
+   
+    //printf(DIVIDER);
+    //printf("\t  dataset: %s\n", fullname);
+
+    val = ptr_var_payload->payload;
+    nc_redef(ncid);
+    enum ADIOS_FLAG time_flag;
+    while (dims) {
+        ++maxrank;
+        if (dims->dimension.time_index == adios_flag_yes) {
+            time_flag = adios_flag_yes;
+            time_dimrank = maxrank-1;
+        } 
+        dims = dims->next;
+    } 
+    dims = ptr_var_header->dims;
+    time_index = 0; 
+    if (dims) {
+        for (j = 0; j < maxrank; j++) {
+            if (time_flag==adios_flag_yes && time_dimrank >0 ) {
+//		  //printf("%d %d\n",time_dimrank,j); 
+               if (j < time_dimrank)
+                   rank = j+1;
+               else if(j==time_dimrank)
+                   rank = 0;
+               else  
+                   rank = j;
+            }
+            else
+               rank = j;
+//            printf("rank cal:time_index=%d j=%d rank=%d\n",time_dimrank,j,rank);
+            /**********************************************************************
+            * Process dataset which has global bounds with dynamic dimension value
+            **********************************************************************/
+            if ( dims->global_dimension.var_id != 0 ) {
+                    for (i = 0; i < var_dims_count; i++) {
+                        if (var_dims [i].id == dims->global_dimension.var_id) {
+                            dimids [rank] = var_dims [i]. nc_dimid;
+                            break;
+                        }
+                    }
+                    if (i==var_dims_count) {
+                        adios_posix_read_attributes_index (ptr_buffer);
+			adios_parse_attributes_index_v1 (ptr_buffer, &atts_root);
+	                while (atts_root) {
+		            if (atts_root->id == dims->global_dimension.var_id) {
+                                dimids[ rank] = *(int*)atts_root->characteristics->value;
+			        break; 
+			    }
+                            atts_root = atts_root->next; 
+	                }
+                }
+                if (dims->dimension.var_id!=0 ) {
+                    for (i = 0; i < var_dims_count; i++){
+                        if (var_dims [i].id == dims->dimension.var_id) {
+                            count_dims [ rank]=var_dims [i].rank;
+                            break;
+                        }
+                    }
+                    if (i==var_dims_count) {
+                        adios_posix_read_attributes_index (ptr_buffer);
+			adios_parse_attributes_index_v1 (ptr_buffer, &atts_root);
+			//print_attributes_index ( atts_root);
+			while (atts_root) {
+		            if (atts_root->id == dims->dimension.var_id) {
+                                count_dims [ rank] = *(int*)atts_root->characteristics->value;
+				break; 
+			    } 
+			    atts_root = atts_root->next;
+			}
+                    }
+                }
+                else
+                    count_dims [ rank] = dims->dimension.rank;
+
+                if ( dims->local_offset.var_id != 0 ) {
+                    for (i = 0; i < var_dims_count; i++){
+                         if (var_dims [i].id == dims->local_offset.var_id){
+                             start_dims[rank]=var_dims [i]. rank;;
+                             break;
+                         }
+                    }
+                    if (i==var_dims_count) {
+                        adios_posix_read_attributes_index (ptr_buffer);
+			adios_parse_attributes_index_v1 (ptr_buffer, &atts_root);
+			while (atts_root) {
+		            if (atts_root->id == dims->local_offset.var_id) {
+                                start_dims [rank] = *(int*)atts_root->characteristics->value;
+				break; 
+			    } 
+			    atts_root = atts_root->next;
+			}
+                    }
+                }
+                else{
+                         start_dims[ rank]=dims->local_offset.rank;
+                }
+            }
+            /**********************************************************************
+            * Process dataset which has global bounds with constant dimension value
+            ***********************************************************************/
+            else if (dims->global_dimension.rank !=0 ) {
+                //printf(" \tconstant global_info: %s rank: %d\n",fullname, dimids[rank]);
+                dimids[rank] = dims->global_dimension.rank;
+                if (dims->dimension.var_id!=0 ) {
+                    for (i = 0; i < var_dims_count; i++){
+                         if (var_dims [i].id == dims->dimension.var_id)
+                            count_dims[rank]=var_dims [i]. rank;
+                    }
+                }
+                else
+                    dimids[rank] = dims->dimension.rank;
+                if (dims->local_offset.var_id!=0 ) {
+                    for (i = 0; i < var_dims_count; i++){
+                        if (var_dims [i].id == dims->local_offset.var_id)
+                                 start_dims[rank]=var_dims [i]. rank;
+                    }
+                }
+                else
+                    start_dims[rank]=dims->local_offset.rank;
+            }
+            /*******************************************
+            * Process dataset which has no global bounds
+            ********************************************/
+            else {
+                //printf("\tdim: %s %d\n",atts_root->attr_name,dims->dimension.rank);
+                if ( dims->dimension.var_id!=0
+                   ||time_flag == adios_flag_yes) {
+                    if (dims->dimension.rank!=0) {
+                            sprintf(dimname,"%s_%d",fullname,rank);
+                            dimids[rank]=-1;
+                            nc_inq_dimid(ncid, dimname, &dimids[rank]); 
+                            if (dimids [rank] <= 0) 
+                                retval=nc_def_dim (ncid, dimname,dims->dimension.rank,&dimids[rank]);
+                            start_dims[rank] = 0;
+         		    count_dims[rank] = dims->dimension.rank;
+                            fprintf(stderr,"\tdim[%d]: c(%d):s(%d): dimid=%d\n"
+                                  ,rank 
+                                  ,count_dims[rank] 
+                                  ,start_dims[rank]
+                                  ,dimids[rank]
+                                  );
+
+                    }
+                    else {
+                        for (i = 0; i < var_dims_count; i++) {
+                            if (var_dims [i].id == dims->dimension.var_id) {
+                                if (dims->dimension.time_index == adios_flag_yes) {
+                                    start_dims[rank] = var_dims[i].rank - 1;
+                                    time_index = var_dims[i].rank;
+         			    count_dims[rank] = 1;
+                                    dimids[rank] = var_dims [i].nc_dimid; 
+                                    /*printf("\tdim[%d]: c(%d):s(%d): dimid=%d (time-index)\n"
+                                          ,rank
+                                          ,count_dims[rank]
+                                          ,start_dims[rank]
+                                          ,dimids[rank]
+                                          ); 
+*/
+                                }
+                                else {
+                                    start_dims[rank] = 0;
+			            count_dims[rank] = var_dims[i].rank;
+                                    dimids[rank]=var_dims[i].nc_dimid;
+				    fprintf(stderr,"\tdim[%d]: c(%d):s(%d): dimid=%d\n"
+                                          ,rank
+                                          ,count_dims[rank]
+                                          ,start_dims[rank]
+                                          ,dimids[rank]
+                                          ); 
+                                } 
+                                break;
+                            }
+                        }
+                   }
+                    if (i==var_dims_count) {
+                        adios_posix_read_attributes_index (ptr_buffer);
+			adios_parse_attributes_index_v1 (ptr_buffer, &atts_root);
+                        //print_attributes_index(atts_root);
+			while (atts_root) {
+		            if (atts_root->id == dims->dimension.var_id) {
+                                ncd_gen_name (dimname, atts_root->attr_path
+                                ,atts_root->attr_name); 
+				if (!atts_root->characteristics->value) {
+                           		for (i = 0; i < var_dims_count; i++) {
+                                		if (var_dims [i].id == atts_root->characteristics->var_id) {
+                                			start_dims[rank]=0;
+				    	          	count_dims [rank] = var_dims [i].rank;
+							
+                                               	  	nc_inq_dimid(ncid, dimname, &dimids[rank]);
+                       		         	    	if (dimids [rank] <= 0)
+                               		     			nc_def_dim (ncid, dimname
+                                       	        			,var_dims[i].rank
+                                       	        			,&dimids [rank]);
+							i = var_dims_count + 1; 
+		 	 			}		
+		 	 		}		
+		 	 	}		
+                                else {
+					count_dims [ rank] = *(int *)atts_root->characteristics->value;
+                                	start_dims[rank]=0;
+                                	nc_inq_dimid(ncid, dimname, &dimids[rank]);
+                                	if (dimids [rank] <= 0)
+                                    		nc_def_dim (ncid, dimname
+                                               		,*(int *)atts_root->characteristics->value
+                                               		,&dimids [rank]); 
+				}
+                                /*printf("\t local[%d]: c(%d) id(%d)\n"
+                                  ,rank,count_dims[rank], dimids[rank]); */
+				break; 
+			    } 
+			    atts_root = atts_root->next;
+			}
+                    }
+                }
+                else {
+                    //printf ("Error, every dimension in netcdf need to have name!\n");
+                    sprintf(dimname,"%s_%d", fullname,rank);
+                    nc_inq_dimid(ncid,dimname,&nc_dimid);
+                    if (nc_dimid<0)
+                        retval = nc_def_dim ( ncid, dimname, dims->dimension.rank, &nc_dimid);
+                    dimids[rank]=nc_dimid;
+                    count_dims[rank] = dims->dimension.rank;
+                    start_dims[rank] =0; 
+                    ERR(retval);
+                    fprintf(stderr, "\t local[%d]: %d\n",rank,dims->dimension.rank);
+                } 
+            }
+            if (dims)
+ 		dims = dims->next;
+        } // end of for loop
+        val = ptr_var_payload->payload;    
+        nc_inq_varid(ncid,fullname,&valid);
+        nc_redef(ncid);
+	int time_idx=-1;
+        for (rank = 0; rank < maxrank; rank++) {
+        	if (count_dims[rank]==0) {
+			count_dims[rank]=1;
+                 	time_idx = rank;
+		 	break;
+		}
+        } 
+        for (rank = 0; rank < maxrank; rank++) {
+		if (verbose>0)
+            		fprintf(stderr, "\tdimension info[%d]: c(%d) s(%d)\n"
+                    		,rank,count_dims[rank], start_dims[rank]);
+	}
+        if (time_idx == 0 && dimids[time_idx]!=0) {
+	    for (rank=maxrank-1;rank>0;rank--) {
+	        dimids[rank] = dimids[rank-1];		
+	        start_dims[rank] = start_dims[rank-1];		
+            }
+	    start_dims[time_idx] = var_dims[0].rank-1;
+	    dimids[time_idx] = var_dims[0].id;		
+        }
+		 
+        switch(type) { 
+        case adios_real:
+            //for (rank=0;rank<maxrank;rank++)
+            // 	printf("\t local[%d]: c(%d) (%d) %d\n",
+            //    rank,count_dims[rank], start_dims[rank], dimids[rank]);
+            if ( valid<0) {
+                retval=nc_def_var(ncid,fullname,NC_FLOAT,maxrank,dimids,&valid);
+                ERR(retval);
+            }
+            retval=nc_enddef(ncid);
+            retval=nc_put_vara_float(ncid,valid,start_dims,count_dims,val);
+            ERR(retval);
+            break;
+        case adios_double:
+            if ( valid<0) 
+                retval=nc_def_var(ncid,fullname,NC_DOUBLE,maxrank,dimids,&valid);
+            ERR(retval);
+            retval=nc_enddef(ncid);
+            ERR(retval);
+            retval=nc_put_vara_double(ncid,valid,start_dims,count_dims,val);
+            ERR(retval);
+            //printf("end   writing!\n");
+            break;
+        case adios_long:
+            if ( valid<0) 
+                retval=nc_def_var(ncid,fullname,NC_LONG,maxrank,dimids,&valid);
+            retval=nc_enddef(ncid);
+            retval=nc_put_vara_long(ncid,valid,start_dims,count_dims,val);
+            break;
+        case adios_unsigned_byte:
+            if ( valid<0) 
+                retval=nc_def_var(ncid,fullname,NC_BYTE,maxrank,dimids,&valid);
+            retval=nc_enddef(ncid);
+            retval=nc_put_vara_uchar(ncid,valid,start_dims,count_dims,val);
+            break;
+        case adios_byte:
+	    //printf("write byte test %d %d\n",maxrank,dimids[0]);
+            if ( valid<0) 
+                retval=nc_def_var(ncid,fullname,NC_BYTE,maxrank,dimids,&valid);
+            ERR (retval);
+            //printf("\t vid=%d\n",valid);
+            retval=nc_enddef(ncid);
+            retval=nc_put_vara_schar(ncid,valid,start_dims,count_dims,val);
+            ERR (retval);
+	    //printf("write byte test\n");
+            break;
+        case adios_integer:
+            if (valid < 0) {
+               retval = nc_def_var (ncid,fullname,NC_INT,maxrank,dimids,&valid);
+               //printf("definition done!\n");
+            } 
+            retval = nc_enddef (ncid);
+            ERR (retval);
+            retval=nc_put_vara_int (ncid,valid,start_dims,count_dims,val);
+            ERR (retval);
+            break;
+        default:
+            retval=nc_enddef(ncid);
+            break;
+        }
+    }
+    else if (ptr_var_header->is_dim == adios_flag_yes) {
+        for ( j = 0; j<var_dims_count;j++){
+           if (var_dims [j].id==ptr_var_header->id) { 
+               break; 
+           }
+        }
+          
+        nc_redef(ncid);
+        nc_inq_dimid ( ncid, fullname, &nc_dimid);
+        if ( var_dims[j].rank == 0)
+            return 0;
+        if ( nc_dimid < 0) {
+           retval = nc_def_dim ( ncid, fullname, var_dims[j].rank, &nc_dimid);
+           ERR(retval);
+        }
+        var_dims [j].nc_dimid = nc_dimid;
+    }
+    else {
+        rank = 1;
+        nc_redef(ncid);
+        if (onename_dimid==-1)
+        {
+            retval=nc_def_dim (ncid, "one", 1, &onename_dimid);
+            ERR(retval);
+        }
+        else {
+            nc_redef(ncid);
+            nc_inq_varid (ncid, fullname, &valid);
+        }
+        dimids[0]=onename_dimid;
+        rank = 1;
+    switch (type) {
+        case adios_real:
+            if (valid < 0 ) {
+               //printf("\t ncd-scalar-real: %d %d %s\n",dimids[0],valid, fullname);
+               retval=nc_def_var(ncid,fullname,NC_FLOAT,rank,dimids,&valid);
+               ERR(retval);
+            }
+            retval=nc_enddef(ncid);
+            ERR(retval);
+            retval=nc_put_var_float(ncid,valid,val);
+            break;
+        case adios_double:
+            if (valid < 0 ) {
+               //printf("\t ncd-scalar: %d %d %s\n",dimids[0],valid, fullname);
+               retval=nc_def_var(ncid,fullname,NC_DOUBLE,rank,dimids,&valid);
+               ERR(retval);
+               retval=nc_enddef(ncid);
+               ERR(retval);
+            }
+            retval=nc_enddef(ncid);
+            retval=nc_put_var_double(ncid,valid,val);
+            break;
+        case adios_long:
+            if (valid < 0 ) {
+               //printf("\t ncd-scalar: %d %d %s\n",dimids[0],valid, fullname);
+               retval=nc_def_var(ncid,fullname,NC_LONG,rank,dimids,&valid);
+               ERR(retval);
+            }
+            retval=nc_enddef(ncid);
+            ERR(retval);
+            retval=nc_def_var(ncid,fullname,NC_LONG,rank,dimids,&valid);
+            retval=nc_enddef(ncid);
+            retval=nc_put_var_long(ncid,valid,val);
+            break;
+        case adios_integer:
+            if (valid < 0 ) {
+               retval=nc_def_var(ncid,fullname,NC_INT,rank,dimids,&valid);
+               ERR(retval);
+            }
+            retval=nc_enddef(ncid);
+            ERR(retval);
+            //printf("\t   scalar: %d\n", *(int *)val);
+            retval=nc_put_var_int(ncid,valid,val);
+            ERR(retval);
+            break;
+        default:
+            retval=nc_enddef(ncid);
+            break;
+        }
+    }
+    return 0;
+}
+
+int main (int argc, char ** argv)
+{
+    char out_fname [256];
+    char * var;
+    int i = 0;
+    int rc = 0;
+    uint64_t element_size = 0;
+    struct adios_bp_element_struct * element = NULL;
+    if (argc < 2)
+    {
+        fprintf (stderr, "usage: %s <argv[1]_in> [argv[1]_out]\n"
+                ,argv [0]
+                );
+
+        return -1;
+    }
+
+    if (argc > 2)
+        strcpy (out_fname,argv[2]);
+    else 
+    {
+        int size = strlen(argv[1]);
+        strcpy (out_fname,argv[1]);
+        if(!strcmp (&out_fname[size-3], ".bp")) {
+          out_fname [size-2] = 'n'; 
+          out_fname [size-1] = 'c';
+        }
+        else {
+          strcat(out_fname, ".nc");
+        }
+        
+    }
+    int ncid, retval;
+    nc_create ( out_fname, NC_CLOBBER | NC_64BIT_OFFSET, &ncid);
+
+    struct adios_bp_buffer_struct_v1 * b = 0;
+    struct adios_bp_buffer_struct_v1 * b_0 = 0;
+    struct adios_bp_buffer_struct_v1 * b_1 = 0;
+    uint32_t version = 0;
+
+    b = malloc (sizeof (struct adios_bp_buffer_struct_v1));
+    b_0 = malloc (sizeof (struct adios_bp_buffer_struct_v1));
+    b_1 = malloc (sizeof (struct adios_bp_buffer_struct_v1));
+    adios_buffer_struct_init (b);
+
+    rc = adios_posix_open_read_internal (argv[1], "", b);
+    if (!rc)
+    {
+        fprintf (stderr, "bpdump: file not found: %s\n", argv[1]);
+
+        return -1;
+    }
+
+    adios_posix_read_version (b);
+    adios_parse_version (b, &version);
+
+    struct adios_index_process_group_struct_v1 * pg_root = 0;
+    struct adios_index_process_group_struct_v1 * pg = 0;
+    struct adios_index_var_struct_v1 * vars_root = 0;
+    struct adios_index_attribute_struct_v1 * attrs_root = 0;
+
+    adios_posix_read_index_offsets (b);
+    adios_parse_index_offsets_v1 (b);
+
+    adios_posix_read_process_group_index (b);
+    adios_parse_process_group_index_v1 (b, &pg_root);
+
+    copy_buffer(b_0, b);
+    adios_posix_read_vars_index (b);
+    adios_parse_vars_index_v1 (b, &vars_root);
+
+    copy_buffer(b_1, b);
+    adios_posix_read_attributes_index (b);
+    adios_parse_attributes_index_v1 (b, &attrs_root);
+
+    uint64_t element_num = 1;
+    pg = pg_root;
+    while (pg)
+    {
+        int i,j;
+        int var_dims_count = 0;
+        struct var_dim * var_dims = 0;
+
+        struct adios_process_group_header_struct_v1 pg_header;
+        struct adios_vars_header_struct_v1 vars_header;
+        struct adios_attributes_header_struct_v1 attrs_header;
+
+        struct adios_var_header_struct_v1 var_header;
+        struct adios_var_payload_struct_v1 var_payload;
+        struct adios_attribute_struct_v1 attribute;
+
+        // setup here to read the process group from (and size)
+        b->read_pg_offset = pg->offset_in_file;
+        if (pg->next)
+        {
+            b->read_pg_size =   pg->next->offset_in_file
+                              - pg->offset_in_file;
+        }
+        else
+        {
+            b->read_pg_size =   b->pg_index_offset
+                              - pg->offset_in_file;
+        }
+
+        adios_posix_read_process_group (b);
+        adios_parse_process_group_header_v1 (b, &pg_header);
+        //printf ("*************************************************\n"); 
+        //printf ("\tTime Index Name: %s %d\n", pg_header.time_index_name, pg_header.time_index);
+        //printf ("*************************************************\n"); 
+
+        /****************************************
+        * Create unlimited time index dimension 
+        ****************************************/
+        if (pg_header.time_index_name) {
+             
+             var_dims = realloc (var_dims, (var_dims_count + 1)
+                          * sizeof (struct var_dim)
+                          );
+	     static int time_dimid = -1;
+	     nc_def_dim(ncid,pg_header.time_index_name,NC_UNLIMITED,&time_dimid);
+	     nc_enddef(ncid);
+	     strcpy(var_dims[var_dims_count].dimname,pg_header.time_index_name);
+	     var_dims[var_dims_count].id = 0; 
+	     var_dims[var_dims_count].rank = pg_header.time_index;
+	     var_dims[var_dims_count].nc_dimid = time_dimid;
+
+             var_dims_count=var_dims_count+1;
+        }
+
+        adios_parse_vars_header_v1 (b, &vars_header);
+  
+        //printf("time-index id: %s %d\n",pg_header.time_index_name, vars_header.count);
+        for (i = 0; i < vars_header.count; i++) {
+            var_payload.payload = 0;
+            adios_parse_var_data_header_v1 (b, &var_header);
+
+            if (var_header.is_dim == adios_flag_yes) {
+                var_payload.payload = malloc (var_header.payload_size);
+                adios_parse_var_data_payload_v1 (b, &var_header, &var_payload
+                                                ,var_header.payload_size
+                                                );
+            }
+            else {
+                var_payload.payload = malloc (var_header.payload_size);
+                adios_parse_var_data_payload_v1 (b, &var_header, &var_payload
+                                                ,var_header.payload_size
+                                                );
+                ncd_dataset(ncid,&var_header, &var_payload,b_1,var_dims,var_dims_count);
+            }
+
+            if (var_header.is_dim == adios_flag_yes) {
+                int flag=0;
+                var_dims = realloc (var_dims,   (var_dims_count + 1)
+                                              * sizeof (struct var_dim)
+                                   );
+                
+                strcpy(var_dims [var_dims_count].dimname,var_header.name);
+                var_dims [var_dims_count].id = -1;
+                var_dims [var_dims_count].rank = -1;
+                var_dims [var_dims_count].nc_dimid = -1;
+
+                for( j = 0 ; j < var_dims_count; j++){
+                    if (var_dims [j].id == var_header.id) { 
+                         var_dims [j].rank == *(unsigned int *) var_payload.payload; 
+                         flag = 1;
+                         break; 
+                    }
+                }
+
+                if(flag == 0) {
+                    var_dims [var_dims_count].id = var_header.id;
+                    var_dims [var_dims_count].rank = *(unsigned int *)
+                                                            var_payload.payload;
+                    var_dims_count++;
+                }
+                ncd_dataset(ncid,&var_header, &var_payload,b_1,var_dims,var_dims_count);
+            }
+
+            if (var_payload.payload)
+            {
+                free (var_payload.payload);
+                var_payload.payload;
+            }
+            //printf ("\n");
+        }
+
+        adios_parse_attributes_header_v1 (b, &attrs_header);
+
+        for (i = 0; i < attrs_header.count; i++)
+        {
+
+            adios_parse_attribute_v1 (b, &attribute);
+            ncd_attr_str_ds (ncid, &attribute, b_0, vars_header.count, var_dims, var_dims_count);
+        }
+
+        var_dims_count = 0;
+        if (var_dims)
+            free (var_dims);
+        pg = pg->next;
+    }
+    //printf (DIVIDER);
+    //printf ("End of %s\n", argv[1]);
+
+    adios_posix_close_internal (b);
+    free (b);
+    free (b_0);
+    nc_close (ncid);
+    return 0;
+}
+
diff --git a/utils/bp2ncd/bp2ncd.h b/utils/bp2ncd/bp2ncd.h
new file mode 100644
index 0000000..befc105
--- /dev/null
+++ b/utils/bp2ncd/bp2ncd.h
@@ -0,0 +1,69 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#define ERR(e){if(e){printf("Error:%s\n",nc_strerror(e));return 2;}}
+enum verbose_level
+{
+	NO_INFO = 0,
+	LIST_INFO = 1,
+	DEBUG_INFO = 2
+};
+struct var_dims_struct 
+{
+	uint16_t id;
+	uint64_t rank;
+	int	 nc_dimid;
+	char	 varname[256];
+};
+
+struct time_slice_struct
+{
+	uint32_t from;
+	uint32_t to;
+};
+void copy_buffer(struct adios_bp_buffer_struct_v1 *dest
+                ,struct adios_bp_buffer_struct_v1 *src) {
+    
+    memcpy (dest, src, sizeof(struct adios_bp_buffer_struct_v1));
+}
+int assign_value_ulonglong(uint64_t *, enum ADIOS_DATATYPES type, void *);
+
+int add_vardims_var(int ncid,
+		    struct var_dims_struct *var_dims,
+		    int *var_dims_count, 
+		    struct adios_var_header_struct_v1 *var_header, 
+		    struct adios_var_payload_struct_v1 *var_payload, 
+		    struct adios_bp_buffer_struct_v1 *b);
+
+int add_vardims_attribute(int ncid,
+			  struct var_dims_struct* var_dims,
+                      	  int *var_dims_count,
+			  struct adios_attribute_struct_v1 *attribute);
+int makencd(char *bp_fname, char *ncd_fname,int,int);
+int parse_cmdline(int argc,
+		  char **argv,
+		  char **bp_fname,
+		  char **ncd_fname,
+		  uint32_t *from_timeindex,
+		  uint32_t *to_timeindexj,
+		  enum verbose_level *verb);
+void print_usage(); 
+
+int ncd_gen_name (char *fullname, char *path, char *name); 
+int ncd_dataset(int ncid, 
+	     	struct adios_var_header_struct_v1 *var_header, 
+	     	void *var_payload, 
+	     	struct var_dims_struct *var_dims, 
+	     	int var_dims_count);
+int ncd_scalar(int ncid, 
+	       struct adios_var_header_struct_v1 *var_header,
+	       void *var_payload); 
+
+int ncd_attr(int ncid, 
+             struct adios_attribute_struct_v1 * attribute,
+             struct var_dims_struct * var_dims,
+	     int var_dims_count); 
diff --git a/utils/bpdump/Makefile.am b/utils/bpdump/Makefile.am
new file mode 100644
index 0000000..2097f88
--- /dev/null
+++ b/utils/bpdump/Makefile.am
@@ -0,0 +1,17 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+bin_PROGRAMS = bpdump
+
+bpdump_SOURCES = bpdump.c
+bpdump_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_SEQ_CPPFLAGS) $(ADIOSLIB_SEQ_CFLAGS)
+bpdump_LDFLAGS = $(ADIOSLIB_SEQ_LDFLAGS)
+bpdump_LDADD = $(top_builddir)/src/libadios_internal_nompi.a
+bpdump_LDADD += $(ADIOSLIB_SEQ_LDADD)
+
+if USE_PARALLEL_COMPILER
+    CC=$(MPICC)
+    CXX=$(MPICXX)
+endif
diff --git a/utils/bpdump/Makefile.in b/utils/bpdump/Makefile.in
new file mode 100644
index 0000000..f678994
--- /dev/null
+++ b/utils/bpdump/Makefile.in
@@ -0,0 +1,575 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = bpdump$(EXEEXT)
+subdir = utils/bpdump
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_bpdump_OBJECTS = bpdump-bpdump.$(OBJEXT)
+bpdump_OBJECTS = $(am_bpdump_OBJECTS)
+am__DEPENDENCIES_1 =
+bpdump_DEPENDENCIES = $(top_builddir)/src/libadios_internal_nompi.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(bpdump_SOURCES)
+DIST_SOURCES = $(bpdump_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = @CC@
+ at USE_PARALLEL_COMPILER_TRUE@CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+ at USE_PARALLEL_COMPILER_TRUE@CXX = $(MPICXX)
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+bpdump_SOURCES = bpdump.c
+bpdump_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_SEQ_CPPFLAGS) $(ADIOSLIB_SEQ_CFLAGS)
+bpdump_LDFLAGS = $(ADIOSLIB_SEQ_LDFLAGS)
+bpdump_LDADD = $(top_builddir)/src/libadios_internal_nompi.a \
+	$(ADIOSLIB_SEQ_LDADD)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  utils/bpdump/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  utils/bpdump/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
+	done
+
+clean-binPROGRAMS:
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+bpdump$(EXEEXT): $(bpdump_OBJECTS) $(bpdump_DEPENDENCIES) 
+	@rm -f bpdump$(EXEEXT)
+	$(LINK) $(bpdump_LDFLAGS) $(bpdump_OBJECTS) $(bpdump_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.c.o:
+	$(COMPILE) -c $<
+
+.c.obj:
+	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+	$(LTCOMPILE) -c -o $@ $<
+
+bpdump-bpdump.o: bpdump.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bpdump_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bpdump-bpdump.o `test -f 'bpdump.c' || echo '$(srcdir)/'`bpdump.c
+
+bpdump-bpdump.obj: bpdump.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bpdump_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bpdump-bpdump.obj `if test -f 'bpdump.c'; then $(CYGPATH_W) 'bpdump.c'; else $(CYGPATH_W) '$(srcdir)/bpdump.c'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic clean-libtool ctags distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-binPROGRAMS uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/utils/bpdump/bpdump.c b/utils/bpdump/bpdump.c
new file mode 100644
index 0000000..208e73e
--- /dev/null
+++ b/utils/bpdump/bpdump.c
@@ -0,0 +1,1221 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include "adios_types.h"
+#include "adios_transport_hooks.h"
+#include "adios_bp_v1.h"
+#include "bp_utils.h"
+//#include "adios_internals.h"
+
+#define DIVIDER "========================================================\n"
+
+struct dump_struct
+{
+    int do_dump;
+    char * dump_var;
+    enum ADIOS_FLAG host_language_fortran;
+};
+
+struct var_dim
+{
+    uint16_t id;
+    uint64_t rank;
+};
+
+void print_process_group_header (uint64_t num
+                      ,struct adios_process_group_header_struct_v1 * pg_header
+                      );
+void print_vars_header (struct adios_vars_header_struct_v1 * vars_header);
+void print_var_header (struct adios_var_header_struct_v1 * var_header);
+void print_var_payload (struct adios_var_header_struct_v1 * var_header
+                       ,struct adios_var_payload_struct_v1 * var_payload
+                       ,struct dump_struct * dump
+                       ,int var_dims_count
+                       ,struct var_dim * var_dims
+                       );
+void print_attrs_header (
+                      struct adios_attributes_header_struct_v1 * attrs_header
+                      );
+void print_attribute (struct adios_attribute_struct_v1 * attribute);
+void print_process_group_index (
+                         struct adios_index_process_group_struct_v1 * pg_root
+                         );
+void print_vars_index (struct adios_index_var_struct_v1 * vars_root);
+void print_attributes_index
+                         (struct adios_index_attribute_struct_v1 * attrs_root);
+
+/*int print_dataset (int type, int ranks, struct adios_bp_dimension_struct * dims
+                  ,void * data
+                  );*/
+
+//const char * value_to_string (enum ADIOS_DATATYPES type, void * data);
+const char * value_to_string_ptr (enum ADIOS_DATATYPES type, void * data, uint64_t element);
+
+int main (int argc, char ** argv)
+{
+    char * filename;
+    char * var;
+    int i = 0;
+    int rc = 0;
+    uint64_t element_size = 0;
+    struct adios_bp_element_struct * element = NULL;
+    struct dump_struct dump;
+
+    if (argc < 2)
+    {
+        fprintf (stderr, "usage: %s [-d [var]|--dump [var]] <filename>\n"
+                ,argv [0]
+                );
+
+        return -1;
+    }
+
+    if (argv [1][0] && argv [1][0] == '-')
+    {
+        if (   !strcmp (argv [1], "-d")
+            || !strcmp (argv [1], "--dump")
+           )
+        {
+            dump.do_dump = 1;
+            if (argc > 2)
+            {
+                dump.dump_var = argv [2];
+                filename = argv [3];
+                printf("%s %s\n",dump.dump_var,filename);
+            }
+            else
+            {
+                dump.dump_var = 0;
+                filename = argv [2];
+                printf("%s %s\n",dump.dump_var,filename);
+            }
+        }
+        else
+        {
+            fprintf (stderr, "usage: %s [-d [var]|--dump [var]] <filename>\n"
+                    ,argv [0]
+                    );
+
+            return -1;
+        }
+    }
+    else
+    {
+        filename = argv [1];
+        dump.do_dump = 0;
+        dump.dump_var = 0;
+    }
+
+    struct adios_bp_buffer_struct_v1 * b = 0;
+    uint32_t version = 0;
+    uint16_t flag = 0;
+
+    b = malloc (sizeof (struct adios_bp_buffer_struct_v1));
+    adios_buffer_struct_init (b);
+
+    rc = adios_posix_open_read_internal (filename, "", b);
+    if (!rc)
+    {
+        fprintf (stderr, "bpdump: file not found: %s\n", filename);
+
+        return -1;
+    }
+
+    adios_posix_read_version (b);
+    adios_parse_version (b, &version);
+
+    struct adios_index_process_group_struct_v1 * pg_root = 0;
+    struct adios_index_process_group_struct_v1 * pg = 0;
+    struct adios_index_var_struct_v1 * vars_root = 0;
+    struct adios_index_attribute_struct_v1 * attrs_root = 0;
+
+    printf (DIVIDER);
+    printf ("Process Groups Index:\n");
+    adios_posix_read_index_offsets (b);
+    adios_parse_index_offsets_v1 (b);
+
+    /*
+    printf ("End of process groups       = %llu\n", b->end_of_pgs);
+    printf ("Process Groups Index Offset = %llu\n", b->pg_index_offset);
+    printf ("Process Groups Index Size   = %llu\n", b->pg_size);
+    printf ("Variable Index Offset       = %llu\n", b->vars_index_offset);
+    printf ("Variable Index Size         = %llu\n", b->vars_size);
+    printf ("Attribute Index Offset      = %llu\n", b->attrs_index_offset);
+    printf ("Attribute Index Size        = %llu\n", b->attrs_size);
+    */
+
+    adios_posix_read_process_group_index (b);
+    adios_parse_process_group_index_v1 (b, &pg_root);
+    print_process_group_index (pg_root);
+
+    printf (DIVIDER);
+    printf ("Vars Index:\n");
+    adios_posix_read_vars_index (b);
+    adios_parse_vars_index_v1 (b, &vars_root);
+    print_vars_index (vars_root);
+
+    printf (DIVIDER);
+    printf ("Attributes Index:\n");
+    adios_posix_read_attributes_index (b);
+    adios_parse_attributes_index_v1 (b, &attrs_root);
+    print_attributes_index (attrs_root);
+
+    if (version & ADIOS_VERSION_HAVE_SUBFILE)
+    {
+        printf (DIVIDER);
+        return;
+    }
+
+
+    uint64_t element_num = 1;
+    pg = pg_root;
+    while (pg)
+    {
+        int var_dims_count = 0;
+        struct var_dim * var_dims = 0;
+
+        printf (DIVIDER);
+
+        struct adios_process_group_header_struct_v1 pg_header;
+        struct adios_vars_header_struct_v1 vars_header;
+        struct adios_attributes_header_struct_v1 attrs_header;
+
+        struct adios_var_header_struct_v1 var_header;
+        struct adios_var_payload_struct_v1 var_payload;
+        struct adios_attribute_struct_v1 attribute;
+
+        // setup where to read the process group from (and size)
+        b->read_pg_offset = pg->offset_in_file;
+        if (pg->next)
+        {
+            b->read_pg_size =   pg->next->offset_in_file
+                              - pg->offset_in_file;
+        }
+        else
+        {
+            b->read_pg_size =   b->pg_index_offset
+                              - pg->offset_in_file;
+        }
+
+        adios_posix_read_process_group (b);
+        adios_parse_process_group_header_v1 (b, &pg_header);
+        print_process_group_header (element_num++, &pg_header);
+        //printf ("\tSize of group in fil: %llu bytes\n",  b->read_pg_size);
+
+        adios_parse_vars_header_v1 (b, &vars_header);
+        print_vars_header (&vars_header);
+
+        dump.host_language_fortran = pg_header.host_language_fortran;
+        int i;
+        for (i = 0; i < vars_header.count; i++)
+        {
+            var_payload.payload = 0;
+
+            adios_parse_var_data_header_v1 (b, &var_header);
+            print_var_header (&var_header);
+
+            if (   var_header.dims == 0
+                ||    dump.do_dump
+                   && !strcasecmp (dump.dump_var, var_header.name)
+               )
+            {
+                // add one for string null terminators
+                var_payload.payload = malloc (var_header.payload_size + 1);
+                adios_parse_var_data_payload_v1 (b, &var_header, &var_payload
+                                                ,var_header.payload_size
+                                                );
+            }
+            else
+            {
+                adios_parse_var_data_payload_v1 (b, &var_header, NULL, 0);
+            }
+
+            if (var_header.is_dim == adios_flag_yes)
+            {
+                var_dims = realloc (var_dims,   (var_dims_count + 1)
+                                              * sizeof (struct var_dim)
+                                   );
+
+                var_dims [var_dims_count].id = var_header.id;
+                var_dims [var_dims_count].rank = *(unsigned int *)
+                                                        var_payload.payload;
+                var_dims_count++;
+            }
+
+            if (dump.do_dump)
+            {
+                // make sure the buffer is big enough or send in null
+                print_var_payload (&var_header, &var_payload, &dump
+                                  ,var_dims_count, var_dims
+                                  );
+            }
+            if (var_payload.payload)
+            {
+                free (var_payload.payload);
+                var_payload.payload = 0;
+            }
+            printf ("\n");
+        }
+
+        adios_parse_attributes_header_v1 (b, &attrs_header);
+        print_attrs_header (&attrs_header);
+
+        for (i = 0; i < attrs_header.count; i++)
+        {
+            adios_parse_attribute_v1 (b, &attribute);
+            print_attribute (&attribute);
+            printf ("\n");
+        }
+
+        var_dims_count = 0;
+        if (var_dims)
+            free (var_dims);
+        pg = pg->next;
+    }
+    printf (DIVIDER);
+    printf ("End of %s\n", filename);
+
+    adios_posix_close_internal (b);
+
+    return 0;
+}
+
+/* In src/bp_utils.c
+const char * value_to_string (enum ADIOS_DATATYPES type, void * data)
+{
+    static char s [100];
+    s [0] = 0;
+
+
+    switch (type)
+    {
+        case adios_unsigned_byte:
+            sprintf (s, "%u", *(((uint8_t *) data)));
+            break;
+
+        case adios_byte:
+            sprintf (s, "%d", *(((int8_t *) data)));
+            break;
+
+        case adios_short:
+            sprintf (s, "%hd", *(((int16_t *) data)));
+            break;
+
+        case adios_unsigned_short:
+            sprintf (s, "%uh", *(((uint16_t *) data)));
+            break;
+
+        case adios_integer:
+            sprintf (s, "%d", *(((int32_t *) data)));
+            break;
+
+        case adios_unsigned_integer:
+            sprintf (s, "%u", *(((uint32_t *) data)));
+            break;
+
+        case adios_long:
+            sprintf (s, "%lld", *(((int64_t *) data)));
+            break;
+
+        case adios_unsigned_long:
+            sprintf (s, "%llu", *(((uint64_t *) data)));
+            break;
+
+        case adios_real:
+            sprintf (s, "%f", *(((float *) data)));
+            break;
+
+        case adios_double:
+            sprintf (s, "%le", *(((double *) data)));
+            break;
+
+        case adios_long_double:
+            sprintf (s, "%Le", *(((long double *) data)));
+            break;
+
+        case adios_string:
+            sprintf (s, "%s", ((char *) data));
+            break;
+
+        case adios_complex:
+            sprintf (s, "(%f %f)", *(((float *) data) + 0)
+                                 , *(((float *) data) + 1)
+                    );
+            break;
+
+        case adios_double_complex:
+            sprintf (s, "(%lf %lf)", *(((double *) data) + 0)
+                                   , *(((double *) data) + 1)
+                    );
+            break;
+    }
+
+    return s;
+}
+*/
+
+const char * value_to_string_ptr (enum ADIOS_DATATYPES type, void * data, uint64_t element)
+{
+    static char s [100];
+    s [0] = 0;
+
+
+    switch (type)
+    {
+        case adios_unsigned_byte:
+        {
+            uint8_t * p = (uint8_t *) data;
+            sprintf (s, "%u", p [element]);
+            break;
+        }
+
+        case adios_byte:
+        {
+            int8_t * p = (int8_t *) data;
+            sprintf (s, "%d", p [element]);
+            break;
+        }
+
+        case adios_short:
+        {
+            int16_t * p = (int16_t *) data;
+            sprintf (s, "%hd", p [element]);
+            break;
+        }
+
+        case adios_unsigned_short:
+        {
+            uint16_t * p = (uint16_t *) data;
+            sprintf (s, "%uh", p [element]);
+            break;
+        }
+
+        case adios_integer:
+        {
+            int32_t * p = (int32_t *) data;
+            sprintf (s, "%d", p [element]);
+            break;
+        }
+
+        case adios_unsigned_integer:
+        {
+            uint32_t * p = (uint32_t *) data;
+            sprintf (s, "%u", p [element]);
+            break;
+        }
+
+        case adios_long:
+        {
+            int64_t * p = (int64_t *) data;
+            sprintf (s, "%lld", p [element]);
+            break;
+        }
+
+        case adios_unsigned_long:
+        {
+            uint64_t * p = (uint64_t *) data;
+            sprintf (s, "%llu", p [element]);
+            break;
+        }
+
+        case adios_real:
+        {
+            float * p = (float *) data;
+            sprintf (s, "%f", p [element]);
+            break;
+        }
+
+        case adios_double:
+        {
+            double * p = (double *) data;
+            sprintf (s, "%le", p [element]);
+            break;
+        }
+
+        case adios_long_double:
+        {
+            long double * p = (long double *) data;
+            sprintf (s, "%Le", p [element]);
+            break;
+        }
+
+        case adios_string:
+        {
+            char * p = (char *) data;
+            //sprintf (s, "%s", p [element]);
+            sprintf (s, "");
+            fprintf (stderr, "arrays of strings not fully supported\n");
+            break;
+        }
+
+        case adios_complex:
+        {
+            float * p = (float *) data;
+            sprintf (s, "(%f %f)", p [element * 2 + 0]
+                                 , p [element * 2 + 1]
+                    );
+            break;
+        }
+
+        case adios_double_complex:
+        {
+            double * p = (double *) data;
+            sprintf (s, "(%lf %lf)", p [element * 2 + 0]
+                                   , p [element * 2 + 1]
+                    );
+            break;
+        }
+    }
+
+    return s;
+}
+        
+void print_process_group_header (uint64_t num
+                      ,struct adios_process_group_header_struct_v1 * pg_header
+                      )
+{
+    int i;
+    struct adios_method_info_struct_v1 * m;
+
+    printf ("Process Group: %llu\n", num);
+    printf ("\tGroup Name: %s\n", pg_header->name);
+    printf ("\tHost Language Fortran?: %c\n"
+           ,(pg_header->host_language_fortran == adios_flag_yes ? 'Y' : 'N')
+           );
+    printf ("\tCoordination Var Member ID: %d\n", pg_header->coord_var_id);
+    printf ("\tTime Name: %s\n", pg_header->time_index_name);
+    printf ("\tTime: %d\n", pg_header->time_index);
+    printf ("\tMethods used in output: %d\n", pg_header->methods_count);
+    m = pg_header->methods;
+    while (m)
+    {
+        printf ("\t\tMethod ID: %d\n", m->id);
+        printf ("\t\tMethod Parameters: %s\n", m->parameters);
+ 
+        m = m->next;
+    }
+}
+
+void print_vars_header (struct adios_vars_header_struct_v1 * vars_header)
+{
+    printf ("\tVars Count: %u\n", vars_header->count);
+}
+
+void print_var_header (struct adios_var_header_struct_v1 * var_header)
+{
+    int i = 0;
+
+    printf ("\t\tVar Name (ID): %s (%d)\n", var_header->name, var_header->id);
+    printf ("\t\tVar Path: %s\n", var_header->path);
+    printf ("\t\tDatatype: %s\n", adios_type_to_string_int (var_header->type));
+    printf ("\t\tIs Dimension: %c\n"
+           ,(var_header->is_dim == adios_flag_yes ? 'Y' : 'N')
+           );
+    if (var_header->dims)
+    {
+        struct adios_dimension_struct_v1 * d = var_header->dims;
+        printf ("\t\tDimensions:\n");
+        while (d)
+        {
+            printf ("\t\t\tDim %d l:g:o: ", i++);
+            if (d->dimension.var_id == 0)
+            {
+                if (d->dimension.time_index == adios_flag_yes)
+                {
+                    printf ("TIME");
+                }
+                else
+                {
+                    printf ("R(%llu)", d->dimension.rank);
+                }
+            }
+            else
+            {
+                printf ("V(%hu)", d->dimension.var_id);
+            }
+
+            if (   d->global_dimension.var_id != 0
+                || d->global_dimension.rank != 0
+               )
+            {
+                if (d->global_dimension.var_id == 0)
+                {
+                    if (d->global_dimension.time_index == adios_flag_yes)
+                    {
+                        printf (":TIME");
+                    }
+                    else
+                    {
+                        printf (":R(%llu)", d->global_dimension.rank);
+                    }
+                }
+                else
+                {
+                    printf (":V(%hu)", d->global_dimension.var_id);
+                }
+                if (d->local_offset.var_id == 0)
+                {
+                    if (d->local_offset.time_index == adios_flag_yes)
+                    {
+                        printf (":TIME");
+                    }
+                    else
+                    {
+                        printf (":R(%llu)\n", d->local_offset.rank);
+		    }
+                }
+                else
+                {
+                    printf (":V(%hu)\n", d->local_offset.var_id);
+                }
+            }
+            printf ("\n");
+
+            d = d->next;
+	}
+    }
+    printf ("\t\tCharacteristics:\n");
+    printf ("\t\t\tOffset(%llu)", var_header->characteristics.offset);
+
+    /* NCSU - Print min, max */
+
+	if (var_header->type == adios_complex || var_header->type == adios_double_complex)
+	{
+		uint8_t type;
+
+		if (var_header->type == adios_complex)
+			type = adios_double;
+		else
+			type = adios_long_double;
+
+        if (var_header->characteristics.stats && var_header->characteristics.stats[0][adios_statistic_min].data)
+        {
+            printf ("\tMin(%s)", bp_value_to_string (type
+                                       ,var_header->characteristics.stats[0][adios_statistic_min].data
+                                       )
+                   );
+        }
+        if (var_header->characteristics.stats && var_header->characteristics.stats[0][adios_statistic_max].data)
+        {
+            printf ("\tMax(%s)", bp_value_to_string (type
+                                       ,var_header->characteristics.stats[0][adios_statistic_max].data
+                                       )
+                   );
+        }
+
+	}
+	else
+	{
+    	if (var_header->characteristics.stats && var_header->characteristics.stats[0][adios_statistic_min].data)
+    	{
+    	    printf ("\tMin(%s)", bp_value_to_string (var_header->type
+    	                               ,var_header->characteristics.stats[0][adios_statistic_min].data
+    	                               )
+    	           );
+    	}
+    	if (var_header->characteristics.stats && var_header->characteristics.stats[0][adios_statistic_max].data)
+    	{
+    	    printf ("\tMax(%s)", bp_value_to_string (var_header->type
+    	                               ,var_header->characteristics.stats[0][adios_statistic_max].data
+    	                               )
+    	           );
+    	}
+	}
+	
+    
+
+    if (var_header->characteristics.value)
+    {
+        printf ("\t\t\tValue(%s)", bp_value_to_string (var_header->type
+                                          ,var_header->characteristics.value
+                                          )
+               );
+    }
+    if (var_header->characteristics.dims.count != 0)
+    {
+        int j;
+
+        printf ("\t\t\tDims (l:g:o): (");
+        for (j = 0; j < var_header->characteristics.dims.count; j++)
+        {
+            if (j != 0)
+                printf (",");
+            if (var_header->characteristics.dims.dims [j * 3 + 1] != 0)
+            {
+                printf ("%llu:%llu:%llu"
+                       ,var_header->characteristics.dims.dims [j * 3 + 0]
+                       ,var_header->characteristics.dims.dims [j * 3 + 1]
+                       ,var_header->characteristics.dims.dims [j * 3 + 2]
+                       );
+            }
+            else
+            {
+                printf ("%llu"
+                       ,var_header->characteristics.dims.dims [j * 3 + 0]
+                       );
+            }
+        }
+        printf (")");
+    }
+    printf ("\n");
+}
+
+#if 0
+void adios_var_element_count (int rank
+
+                             ,struct adios_bp_dimension_struct * dims
+                             ,uint64_t * use_count
+                             ,uint64_t * total_count
+                             )
+{
+    int i;
+
+    *use_count = 1;
+    *total_count = 1;
+
+    for (i = 0; i < rank; i++)
+    {
+        *use_count *= dims [i].local_bound;
+        *total_count *= dims [i].local_bound;
+        int use_size = dims [i].use_upper_bound - dims [i].use_lower_bound + 1;
+        int total_size = dims [i].upper_bound - dims [i].lower_bound + 1;
+
+        // adjust for the stride
+        if (dims [i].stride <= use_size / 2)
+        {
+            if (use_size % dims [i].stride == 1) // correct fencepost error
+                use_size = use_size / dims [i].stride + 1;
+            else
+                use_size = use_size / dims [i].stride;
+        }
+        else
+        {
+            if (dims [i].stride >= use_size)
+                use_size = 1;
+            else
+                use_size = use_size / dims [i].stride + 1;  // maybe always 2?
+        }
+
+        // need to correct for empty/bad arrays
+        if (   dims [i].use_upper_bound < dims [i].use_lower_bound
+            || dims [i].upper_bound < dims [i].lower_bound
+           )
+        {
+            use_size = 0;
+            total_size = 0;
+        }
+
+        // number of items in the array
+        *use_count *= use_size;
+        *total_count *= total_size;
+    }
+}
+#endif
+
+    // for writing out bits in a global way, we would need this piece
+static
+int increment_dimension (enum ADIOS_FLAG host_language_fortran
+                        ,uint64_t element
+                        ,int ranks
+                        ,uint64_t * dims
+                        ,uint64_t * position
+                        )
+{
+    int i;
+    int done = 0;
+    
+    if (element == 0)
+    {
+        for (i = 0; i < ranks; i++)
+        {
+            position [i] = 0;
+        }   
+        done = 1;
+    }   
+    else  // increment our position
+    {
+//        if (host_language_fortran == adios_flag_yes)
+        {
+            i = 0;
+            while (!done && i < ranks)
+            {
+                // if less than max, just increment this dim
+                if (position [i] < dims [i] - 1)
+                {
+                    position [i]++;
+                    done = 1;
+                }
+                else  // reset dim and move to next to increment
+                {
+                    position [i] = 0;
+                    i++;
+                }
+            }
+        }
+#if 0
+        else
+        {
+            i = ranks - 1;
+            while (!done && i >= 0)
+            {
+                // if less than max, just increment this dim
+                if (position [i] < dims [i])
+                {
+                    position [i]++;
+                    done = 1;
+                }
+                else  // reset dim and move to next to increment
+                {
+                    position [i] = 0;
+                    i--;
+                }
+            }
+        }
+#endif
+    }
+
+    return done;
+
+#if 0
+    // for writing out bits in a global way, we would need this piece
+    // check against bounds
+    for (i = 0; i < rank; i++)
+    {
+        if (   position [i] < dims [i].use_lower_bound
+            || position [i] > dims [i].use_upper_bound
+           )
+        {
+            return 0;
+        }
+        else
+        {
+            // (pos - use lower) mod stride == 0 == use this element
+            if (((position [i] - dims [i].use_lower_bound) % dims [i].stride) != 0)
+                return 0;
+        }
+    }
+
+    return 1;  // we only get here if we are within all bounds
+#endif
+}
+
+static
+int dims_not_max (uint64_t * position, uint64_t * dims, int ranks)
+{
+    int i;
+
+    for (i = 0; i < ranks; i++)
+    {
+        if (position [i] != dims [i] - 1)
+            return 1;
+    }
+
+    return 0;
+}
+
+void print_var_payload (struct adios_var_header_struct_v1 * var_header
+                       ,struct adios_var_payload_struct_v1 * var_payload
+                       ,struct dump_struct * dump
+                       ,int var_dims_count
+                       ,struct var_dim * var_dims
+                       )
+{
+    if (   dump->do_dump
+        && var_header->dims
+        && !strcasecmp (dump->dump_var, var_header->name)
+       )
+    {
+        if (var_header->dims)
+        {
+            uint64_t element = 0;
+            int ranks = 0;
+            struct adios_dimension_struct_v1 * d = var_header->dims;
+            int c = 0;
+            uint64_t * position = 0;
+            uint64_t * dims = 0;
+            int i = 0;
+            int size_of_type = adios_get_type_size (var_header->type, "");
+
+            while (d)
+            {
+                ranks++;
+                d = d->next;
+            }
+
+            position = (uint64_t *) malloc (8 * ranks);
+            memset (position, 0, 8 * ranks);
+            dims = (uint64_t *) malloc (8 * ranks);
+            memset (dims, 0, 8 * ranks);
+
+            d = var_header->dims;
+            uint64_t * dims_t = dims;
+
+            while (d)
+            {
+                if (d->dimension.var_id != 0)
+                {
+                    for (i = 0; i < var_dims_count; i++)
+                    {
+                        if (var_dims [i].id == d->dimension.var_id)
+                        {
+                            *dims_t = var_dims [i].rank;
+                        }
+                    }
+                }
+                else
+                {
+                    if (d->dimension.time_index == adios_flag_yes)
+                    {
+                        *dims_t = 1;
+                    }
+                    else
+                    {
+                        *dims_t = d->dimension.rank;
+                    }
+                }
+
+                d = d->next;
+                dims_t++;
+            }
+
+            while (dims_not_max (position, dims, ranks))
+            {
+                increment_dimension (dump->host_language_fortran
+                                    ,element
+                                    ,ranks
+                                    ,dims
+                                    ,position
+                                    );
+                if (c > 65)
+                {
+                    printf ("\n");
+                    c = 0;
+                }
+
+                c += printf ("[");
+                for (i = 0; i < ranks; i++)
+                {
+                    if (i > 0)
+                        c += printf (",%llu", position [i]);
+                    else
+                        c += printf ("%llu", position [i]);
+                }
+                c += printf ("] ");
+                c += printf ("%s ", value_to_string_ptr (var_header->type
+                                                 ,var_payload->payload, element
+                                                 )
+                       );
+
+                element++;
+            }
+            printf ("\n");
+
+            if (position)
+                free (position);
+            if (dims)
+                free (dims);
+            position = 0;
+            dims = 0;
+        }
+    }
+    if (!var_header->dims)
+    {
+        if (var_header->type != adios_string) 
+            printf ("\t\t\tValue: %s\n", bp_value_to_string (var_header->type ,var_payload->payload));
+        else
+            printf ("\t\t\tValue: \"%s\"\n", bp_value_to_string (var_header->type ,var_payload->payload));
+    }
+}
+
+void print_attrs_header (
+                      struct adios_attributes_header_struct_v1 * attrs_header
+                      )
+{
+    printf ("\tAttributes Count: %u\n", attrs_header->count);
+}
+
+void print_attribute (struct adios_attribute_struct_v1 * attribute)
+{
+    printf ("\t\tAttribute Name (ID): %s (%d)\n"
+           ,attribute->name, attribute->id
+           );
+    printf ("\t\tAttribute Path: %s\n", attribute->path);
+    if (attribute->is_var == adios_flag_yes)
+    {
+        printf ("\t\tAssociated Var ID: %d\n", attribute->var_id);
+    }
+    else
+    {
+        printf ("\t\tDatatype: %s\n", adios_type_to_string_int (attribute->type));
+        printf ("\t\tValue: %s\n", bp_value_to_string (attribute->type
+                                                   ,attribute->value
+                                                   )
+               );
+    }
+}
+
+void print_process_group_index (
+                         struct adios_index_process_group_struct_v1 * pg_root
+                         )
+{
+    while (pg_root)
+    {
+        printf ("Group: %s\n", pg_root->group_name);
+        printf ("\tProcess ID: %d\n", pg_root->process_id);
+        printf ("\tTime Name: %s\n", pg_root->time_index_name);
+        printf ("\tTime: %d\n", pg_root->time_index);
+        printf ("\tOffset in File: %llu\n", pg_root->offset_in_file);
+
+        pg_root = pg_root->next;
+    }
+}
+
+void print_vars_index (struct adios_index_var_struct_v1 * vars_root)
+{
+    while (vars_root)
+    {
+        if (!strcmp (vars_root->var_path, "/"))
+        {
+            printf ("Var (Group) [ID]: /%s (%s) [%d]\n", vars_root->var_name
+                   ,vars_root->group_name, vars_root->id
+                   );
+        }
+        else
+	{
+            printf ("Var (Group) [ID]: %s/%s (%s) [%d]\n", vars_root->var_path
+                   ,vars_root->var_name, vars_root->group_name, vars_root->id
+                   );
+	}
+        printf ("\tDatatype: %s\n", adios_type_to_string_int (vars_root->type));
+        printf ("\tVars Characteristics: %llu\n"
+               ,vars_root->characteristics_count
+               );
+        uint64_t i;
+        for (i = 0; i < vars_root->characteristics_count; i++)
+        {
+            printf ("\tOffset(%llu)", vars_root->characteristics [i].offset);
+            printf ("\tPayload Offset(%llu)", vars_root->characteristics [i].payload_offset);
+            if (vars_root->characteristics [i].file_name)
+            {
+                printf ("\tFile Name(%s)", vars_root->characteristics [i].file_name);
+            }
+            printf ("\tTime Index(%d)", vars_root->characteristics [i].time_index);
+
+    		/* NCSU - Print min, max */
+			if (vars_root->type == adios_complex || vars_root->type == adios_double_complex)
+			{
+        		uint8_t type;
+
+        		if (vars_root->type == adios_complex)
+        		    type = adios_double;
+        		else
+        		    type = adios_long_double;
+
+
+    			if (vars_root->characteristics [i].stats && vars_root->characteristics [i].stats[0][adios_statistic_min].data)
+    			{
+    			    printf ("\tMin(%s)", bp_value_to_string (type
+    			                               ,vars_root->characteristics [i].stats[0][adios_statistic_min].data
+    			                               )
+    			           );
+    			}
+    			if (vars_root->characteristics [i].stats && vars_root->characteristics [i].stats[0][adios_statistic_max].data)
+    			{
+    			    printf ("\tMax(%s)", bp_value_to_string (type
+    			                               ,vars_root->characteristics [i].stats[0][adios_statistic_max].data
+    			                               )
+    			           );
+    			}
+			}
+			else
+			{
+    			if (vars_root->characteristics [i].stats && vars_root->characteristics [i].stats[0][adios_statistic_min].data)
+    			{
+    			    printf ("\tMin(%s)", bp_value_to_string (vars_root->type
+    			                               ,vars_root->characteristics [i].stats[0][adios_statistic_min].data
+    			                               )
+    			           );
+    			}
+    			if (vars_root->characteristics [i].stats && vars_root->characteristics [i].stats[0][adios_statistic_max].data)
+    			{
+    			    printf ("\tMax(%s)", bp_value_to_string (vars_root->type
+    			                               ,vars_root->characteristics [i].stats[0][adios_statistic_max].data
+    			                               )
+    			           );
+    			}
+			}
+    		//*/
+
+            if (vars_root->characteristics [i].value)
+            {
+                if (vars_root->type != adios_string)
+                    printf ("\tValue(%s)", bp_value_to_string (vars_root->type,
+                            vars_root->characteristics [i].value));
+                else
+                    printf ("\tValue(\"%s\")", bp_value_to_string (vars_root->type,
+                            vars_root->characteristics [i].value));
+            }
+            if (vars_root->characteristics [i].dims.count != 0)
+            {
+                int j;
+
+                printf ("\tDims (l:g:o): (");
+                for (j = 0; j < vars_root->characteristics [i].dims.count; j++)
+                {
+                    if (j != 0)
+                        printf (",");
+                    if (  vars_root->characteristics [i].dims.dims [j * 3 + 1]
+                        != 0
+                       )
+                    {
+                        printf ("%llu:%llu:%llu"
+                         ,vars_root->characteristics [i].dims.dims [j * 3 + 0]
+                         ,vars_root->characteristics [i].dims.dims [j * 3 + 1]
+                         ,vars_root->characteristics [i].dims.dims [j * 3 + 2]
+                               );
+                    }
+                    else
+                    {
+                        printf ("%llu"
+                         ,vars_root->characteristics [i].dims.dims [j * 3 + 0]
+                               );
+                    }
+                }
+                printf (")");
+            }
+            printf ("\n");
+        }
+
+        vars_root = vars_root->next;
+    }
+}
+
+void print_attributes_index
+                          (struct adios_index_attribute_struct_v1 * attrs_root)
+{
+    while (attrs_root)
+    {
+        if (!strcmp (attrs_root->attr_path, "/"))
+        {
+            printf ("Attribute (Group) [ID]: /%s (%s) [%d]\n"
+                   ,attrs_root->attr_name, attrs_root->group_name
+                   ,attrs_root->id
+                   );
+        }
+        else
+	{
+            printf ("Attribute (Group) [ID]: %s/%s (%s) [%d]\n"
+                   ,attrs_root->attr_path
+                   ,attrs_root->attr_name, attrs_root->group_name
+                   ,attrs_root->id
+                   );
+	}
+        printf ("\tDatatype: %s\n", adios_type_to_string_int (attrs_root->type));
+        printf ("\tAttribute Characteristics: %llu\n"
+               ,attrs_root->characteristics_count
+               );
+        uint64_t i;
+        for (i = 0; i < attrs_root->characteristics_count; i++)
+        {
+            printf ("\t\tOffset(%llu)", attrs_root->characteristics [i].offset);
+            printf ("\t\tPayload Offset(%llu)", attrs_root->characteristics [i].payload_offset);
+            if (attrs_root->characteristics [i].file_name)
+            {
+                printf ("\t\tFile Name(%s)", attrs_root->characteristics [i].file_name);
+            }
+            printf ("\t\tTime Index(%d)", attrs_root->characteristics [i].time_index);
+
+    		/* NCSU - Print min, max  */
+			if (attrs_root->type == adios_complex || attrs_root->type == adios_double_complex)
+			{
+				uint8_t type;
+				if (attrs_root->type == adios_complex)
+					type = adios_double;
+				else
+					type = adios_long_double;
+
+                if (attrs_root->characteristics [i].stats && attrs_root->characteristics [i].stats[0][adios_statistic_min].data)
+                {
+                    printf ("\tMin(%s)", bp_value_to_string (type
+                                               ,attrs_root->characteristics [i].stats[0][adios_statistic_min].data
+                                               )
+                           );
+                }
+                if (attrs_root->characteristics [i].stats && attrs_root->characteristics [i].stats[0][adios_statistic_max].data)
+                {
+                    printf ("\tMax(%s)", bp_value_to_string (type
+                                               ,attrs_root->characteristics [i].stats[0][adios_statistic_max].data
+                                               )
+                           );
+                }
+			}
+			else
+			{
+    			if (attrs_root->characteristics [i].stats && attrs_root->characteristics [i].stats[0][adios_statistic_min].data)
+    			{
+    			    printf ("\tMin(%s)", bp_value_to_string (attrs_root->type
+    			                               ,attrs_root->characteristics [i].stats[0][adios_statistic_min].data
+    			                               )
+    			           );
+    			}
+    			if (attrs_root->characteristics [i].stats && attrs_root->characteristics [i].stats[0][adios_statistic_max].data)
+    			{
+    			    printf ("\tMax(%s)", bp_value_to_string (attrs_root->type
+    			                               ,attrs_root->characteristics [i].stats[0][adios_statistic_max].data
+    			                               )
+    			           );
+    			}
+			}
+
+            if (attrs_root->characteristics [i].value)
+            {
+                printf ("\t\tValue(%s)", bp_value_to_string (attrs_root->type
+                                        ,attrs_root->characteristics [i].value
+                                        )
+                       );
+            }
+            if (attrs_root->characteristics [i].var_id)
+            {
+                printf ("\t\tVar(%u)", attrs_root->characteristics [i].var_id);
+            }
+            if (attrs_root->characteristics [i].dims.count != 0)
+            {
+                int j;
+
+                printf ("\t\tDims (l:g:o): (");
+                for (j = 0; j < attrs_root->characteristics [i].dims.count; j++)
+                {
+                    if (j != 0)
+                        printf (",");
+                    if (  attrs_root->characteristics [i].dims.dims [j * 3 + 1]
+                        != 0
+                       )
+                    {
+                        printf ("%llu:%llu:%llu"
+                         ,attrs_root->characteristics [i].dims.dims [j * 3 + 0]
+                         ,attrs_root->characteristics [i].dims.dims [j * 3 + 1]
+                         ,attrs_root->characteristics [i].dims.dims [j * 3 + 2]
+                               );
+                    }
+                    else
+                    {
+                        printf ("%llu"
+                         ,attrs_root->characteristics [i].dims.dims [j * 3 + 0]
+                               );
+                    }
+                }
+                printf (")");
+            }
+            printf ("\n");
+        }
+
+        attrs_root = attrs_root->next;
+    }
+}
diff --git a/utils/bpls/Makefile.am b/utils/bpls/Makefile.am
new file mode 100644
index 0000000..f6e137e
--- /dev/null
+++ b/utils/bpls/Makefile.am
@@ -0,0 +1,17 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+bin_PROGRAMS = bpls
+
+bpls_SOURCES = bpls.c 
+bpls_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSREADLIB_SEQ_CPPFLAGS) $(ADIOSREADLIB_SEQ_CFLAGS)
+bpls_LDFLAGS = $(ADIOSREADLIB_SEQ_LDFLAGS) 
+bpls_LDADD = $(top_builddir)/src/libadiosread_nompi.a 
+bpls_LDADD += $(ADIOSREADLIB_SEQ_LDADD)
+
+EXTRA_DIST = bpls.h
+#CC=$(MPICC)
+#CXX=$(MPICXX)
+
diff --git a/utils/bpls/Makefile.in b/utils/bpls/Makefile.in
new file mode 100644
index 0000000..db00a88
--- /dev/null
+++ b/utils/bpls/Makefile.in
@@ -0,0 +1,576 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = bpls$(EXEEXT)
+subdir = utils/bpls
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_bpls_OBJECTS = bpls-bpls.$(OBJEXT)
+bpls_OBJECTS = $(am_bpls_OBJECTS)
+am__DEPENDENCIES_1 =
+bpls_DEPENDENCIES = $(top_builddir)/src/libadiosread_nompi.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(bpls_SOURCES)
+DIST_SOURCES = $(bpls_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+bpls_SOURCES = bpls.c 
+bpls_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSREADLIB_SEQ_CPPFLAGS) $(ADIOSREADLIB_SEQ_CFLAGS)
+bpls_LDFLAGS = $(ADIOSREADLIB_SEQ_LDFLAGS) 
+bpls_LDADD = $(top_builddir)/src/libadiosread_nompi.a \
+	$(ADIOSREADLIB_SEQ_LDADD)
+EXTRA_DIST = bpls.h
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  utils/bpls/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  utils/bpls/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
+	done
+
+clean-binPROGRAMS:
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+bpls$(EXEEXT): $(bpls_OBJECTS) $(bpls_DEPENDENCIES) 
+	@rm -f bpls$(EXEEXT)
+	$(LINK) $(bpls_LDFLAGS) $(bpls_OBJECTS) $(bpls_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.c.o:
+	$(COMPILE) -c $<
+
+.c.obj:
+	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+	$(LTCOMPILE) -c -o $@ $<
+
+bpls-bpls.o: bpls.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bpls_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bpls-bpls.o `test -f 'bpls.c' || echo '$(srcdir)/'`bpls.c
+
+bpls-bpls.obj: bpls.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bpls_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bpls-bpls.obj `if test -f 'bpls.c'; then $(CYGPATH_W) 'bpls.c'; else $(CYGPATH_W) '$(srcdir)/bpls.c'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic clean-libtool ctags distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-binPROGRAMS uninstall-info-am
+
+#CC=$(MPICC)
+#CXX=$(MPICXX)
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/utils/bpls/bpls.c b/utils/bpls/bpls.c
new file mode 100644
index 0000000..1e17f36
--- /dev/null
+++ b/utils/bpls/bpls.c
@@ -0,0 +1,1496 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/* 
+ * List the content of a BP file.
+ *
+ * Author: Norbert Podhorszki, pnorbert at ornl.gov
+ *
+ **/
+
+#ifndef _GNU_SOURCE
+#   define _GNU_SOURCE
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <getopt.h>
+#include <errno.h>
+#include <limits.h>   // LONG_MAX
+#include <math.h>     // NAN
+#include <libgen.h>   // basename
+#include <regex.h>    // regular expression matching
+#include <fnmatch.h>  // shell pattern matching
+
+#include "bpls.h"
+#include "adios_read.h"
+#include "adios_types.h"
+
+
+#ifdef DMALLOC
+#include "dmalloc.h"
+#endif
+
+// global variables 
+// Values from the arguments or defaults
+char *outpath;              // output files' starting path (can be extended with subdirs, names, indexes)
+char *varmask[MAX_MASKS];   // can have many -var masks (either shell patterns or extended regular expressions)
+char *grpmask;              // list only groups matching the mask
+int  nmasks;                // number of masks specified
+char *vfile;                // file name to bpls
+char *start;                // dimension spec starting points 
+char *count;                // dimension spec counts
+char format[32];            // format string for one data element (e.g. %6.2f)
+bool formatgiven;           // true if format string is provided as argument
+
+// Flags from arguments or defaults
+bool dump;                 // dump data not just list info
+bool output_xml;
+bool use_regexp;           // use varmasks as regular expressions
+bool sortnames;            // sort names before listing
+bool listattrs;            // do list attributes too
+bool attrsonly;            // do list attributes only
+bool readattrs;            // also read all attributes and print
+bool longopt;              // -l is turned on
+bool timestep;
+bool noindex;              // do no print array indices with data
+bool printByteAsChar;      // print 8 bit integer arrays as string
+bool plot;                 // dump histogram related information
+
+// other global variables
+char *prgname; /* argv[0] */
+//long timefrom, timeto;
+int  istart[MAX_DIMS], icount[MAX_DIMS], ndimsspecified=0;
+regex_t varregex[MAX_MASKS]; // compiled regular expressions of varmask
+regex_t grpregex;            // compiled regular expressions of grpmask
+int  ncols = 6; // how many values to print in one row (only for -p)
+int  verbose = 0;
+FILE *outf;   // file to print to or stdout
+char commentchar;
+
+struct option options[] = {
+    {"help",                 no_argument,          NULL,    'h'},
+    {"verbose",              no_argument,          NULL,    'v'},
+    {"dump",                 no_argument,          NULL,    'd'},
+    {"group",                no_argument,          NULL,    'g'},
+    {"regexp",               no_argument,          NULL,    'e'},
+    {"plot",                 no_argument,          NULL,    'p'},
+    {"output",               required_argument,    NULL,    'o'},
+    {"xml",                  no_argument,          NULL,    'x'},
+    {"start",                required_argument,    NULL,    's'}, 
+    {"count",                required_argument,    NULL,    'c'}, 
+    {"noindex",              no_argument,          NULL,    'y'},
+    {"sort",                 no_argument,          NULL,    'r'},
+    {"timestep",             no_argument,          NULL,    't'},
+    {"attrs",                no_argument,          NULL,    'a'},
+    {"attrsonly",            no_argument,          NULL,    'A'},
+    {"long",                 no_argument,          NULL,    'l'},
+    {"string",               no_argument,          NULL,    'S'},
+    {"columns",              required_argument,    NULL,    'n'}, 
+    {"format",               required_argument,    NULL,    'f'}, 
+    //    {"time",                 required_argument,    NULL,    't'}, 
+    {NULL,                   0,                    NULL,    0}
+};
+
+
+static const char *optstring = "hvepyrtaAldSg:o:x:s:c:n:f:";
+
+// help function
+void display_help() {
+    //printf( "Usage: %s  \n", prgname);
+    printf("usage: bpls [OPTIONS] file [mask1 mask2 ...]\n"
+            "\nList/dump content of a BP file. \n"
+            "A mask can be a shell pattern like with 'ls' e.g. \"*/x?\".\n"
+            "Variables with multiple timesteps are reported with an extra dimensions.\n"
+            "The time dimension is the first dimension then.\n"
+            "\n"
+            "  --long      | -l           Print values of all scalars and attributes and\n"
+            "                               min/max values of arrays (no overhead to get them!)\n"
+            "  --attrs     | -a           List/match attributes too\n"
+            "  --attrsonly | -A           List attributes only\n"
+            "  --sort      | -r           Sort names before listing\n"
+            "  --timestep  | -t           Print values of timestep elements\n"
+            "  --group     | -g <mask>    List/dump groups matching the mask only\n"
+            "  --dump      | -d           Dump matched variables/attributes\n"
+            "                               To match attributes too, add option -a\n"
+            "  --regexp    | -e           Treat masks as extended regular expressions\n"
+            "  --plot      | -p           Dumps the histogram information that can be read by gnuplot\n"
+            "  --output    | -o <path>    Print to a file instead of stdout\n"
+            /*
+               "  --xml    | -x            # print as xml instead of ascii text\n"
+             */
+            "  --start     | -s \"spec\"    Offset indices in each dimension \n"
+            "                               (default is 0 for all dimensions) \n"
+            "                               <0 is handled as in python (-1 is last)\n"
+            "  --count     | -c \"spec\"    Number of elements in each dimension\n"
+            "                               -1 denotes 'until end' of dimension\n"
+            "                               (default is -1 for all dimensions)\n"
+            "  --noindex   | -y           Print data without array indices\n"
+            "  --string    | -S           Print 8bit integer arrays as strings\n"
+            "  --columns   | -n \"cols\"    Number of data elements per row to print\n"
+            "  --format    | -f \"str\"     Format string to use for one data item in print\n"
+            "                               instead of the default. E.g. \"%%6.3f\"\n"
+            /*
+               "  --time    | -t N [M]      # print data for timesteps N..M only (or only N)\n"
+               "                              default is to print all available timesteps\n"
+             */
+            "\n"
+            "  Examples for slicing:\n"
+            "  -s \"0,0,0\"   -c \"1,99,1\":  Print 100 elements (of the 2nd dimension).\n"
+            "  -s \"0,0\"     -c \"1,-1\":    Print the whole 2nd dimension however large it is.\n"
+            "  -s \"-1,-1\"   -c \"1,1\":     Print the very last element (of a 2D array)\n"
+            "\n"
+            "Help options\n"
+            "  --help      | -h           Print this help.\n"
+            "  --verbose   | -v           Print log about what this program is doing.\n"
+            "                               Use multiple -v to increase logging level.\n"
+            "Typical use: bpls -lavr <file>\n"
+            );
+}
+
+/** Main */
+int main( int argc, char *argv[] ) {
+    int retval = 0;
+    int i, timearg=false; 
+    long int tmp;
+
+    init_globals();
+
+    ////prgname = strdup(argv[0]);
+
+    /* other variables */
+    int c, last_c='_';
+    int last_opt = -1;
+    /* Process the arguments */
+    while ((c = getopt_long(argc, argv, optstring, options, NULL)) != -1) {
+        switch (c) {
+            case 'a':
+                listattrs=true;
+                break;
+            case 'A':
+                listattrs=true;
+                attrsonly=true;
+                break;
+            case 'c':
+                count = strndup(optarg,256);
+                break;
+            case 'd':
+                dump = true;
+                break;
+            case 'e':
+                use_regexp = true;
+                break;
+            case 'f':
+                snprintf(format, sizeof(format), "%s", optarg);
+                formatgiven = true;
+                break;
+            case 'g':
+                grpmask = strndup(optarg,256);
+                break;
+            case 'h':
+                display_help();
+                return 0;
+            case 'r':
+                sortnames = true;
+                break;
+            case 'l':
+                longopt = true;
+                readattrs = true;
+                break;
+            case 'n':
+                tmp = strtol(optarg, (char **)NULL, 0);
+                if (errno) {
+                    fprintf(stderr, "Error: could not convert --columns value: %s\n", optarg);
+                    return 1;
+                }
+                ncols=tmp;
+                break;
+            case 'o':
+                outpath = strndup(optarg,256);
+                break;
+            case 'p':
+                plot = true; 
+                break;
+            case 's':
+                start = strndup(optarg,256);
+                break;
+            case 'S':
+                printByteAsChar = true;
+                break;
+            case 't':
+                timestep = true;
+                break;
+            case 'x':
+                output_xml = true;
+                break;
+            case 'y':
+                noindex = true;
+                break;
+            case 'v':
+                verbose++;
+                break;
+                /*
+                   case 't':
+                   tmp = strtol(optarg, (char **)NULL, 0);
+                   if (errno) {
+                   fprintf(stderr, "Error: could not convert --time value: %s\n", optarg);
+                   return 1;
+                   }
+                   timefrom = tmp; // 1st arg to --time
+                   lastopt = 't';  // maybe there is a a 2nd arg too
+                   break;
+                 */
+
+            case 1:
+                /* This means a field is unknown, or could be multiple arg or bad arg*/
+                /*
+                   if (last_c=='t') {  // --time 2nd arg (or not if not a number)
+                   errno = 0;
+                   tmp = strtol(optarg, (char **)NULL, 0);
+                   if (!errno) {
+                   timeto = tmp;
+                   printf("Time set to %d - %d\n", timefrom, timeto);
+                   timearg=true;
+                   }
+                   } 
+                 */
+                if (!timearg) {
+                    fprintf(stderr, "Unrecognized argument: %s\n", optarg);
+                    return 1;
+                }
+                break;
+
+            default:
+                printf("Processing default: %c\n", c);
+                break;
+        } /* end switch */
+        last_c = c;
+    } /* end while */
+
+    /* Check if we have a file defined */
+    if (optind >= argc) {
+        fprintf(stderr,"Missing file name\n");
+        return 1;
+    }
+    vfile = strdup(argv[optind++]);
+    while (optind < argc) {
+        varmask[nmasks] = strndup(argv[optind++],256);
+        nmasks++;
+    }
+
+    /* Process dimension specifications */
+    if (start != NULL) parseDimSpec(start, istart);
+    if (count != NULL) parseDimSpec(count, icount);
+
+    // process the regular expressions
+    if (use_regexp) {
+        retval = compile_regexp_masks();
+        if (retval)
+            return retval;
+    }
+
+    if (noindex) commentchar = ';';
+    else         commentchar = ' ';
+
+
+    if (verbose>1) 
+        printSettings();
+
+    retval = print_start(outpath);
+    if (retval)
+        return retval;
+
+    /* Start working */
+    retval = doList(vfile);
+
+    print_stop();
+
+    /* Free allocated memories */
+    //myfree(prgname);
+    myfree(outpath);
+    for (i=0; i<nmasks; i++) {
+        myfree(varmask[i]);
+        regfree(&(varregex[i]));
+    }
+    myfree(vfile);
+
+    return retval; 
+}
+
+void init_globals(void) {
+    int i;
+    // variables for arguments
+    outpath              = NULL;
+    for (i=0; i<MAX_MASKS; i++)
+        varmask[i]       = NULL;
+    nmasks               = 0;
+    vfile                = NULL;
+    start                = NULL;
+    count                = NULL;
+    verbose              = 0;
+    ncols                = 6;    // by default when printing ascii, print "X Y", not X: Y1 Y2...
+    dump                 = false;
+    output_xml           = false;
+    noindex              = false;
+    timestep             = false;
+    sortnames            = false;
+    listattrs            = false;
+    attrsonly            = false;
+    readattrs            = false;
+    longopt              = false;
+    //timefrom             = 1;
+    //timeto               = -1;
+    use_regexp           = false;
+    plot                 = false;
+    formatgiven          = false;
+    printByteAsChar      = false;
+    for (i=0; i<MAX_DIMS; i++) {
+        istart[i]  = 0;
+        icount[i]  = -1;  // read full var by default
+    }
+    ndimsspecified = 0;
+}
+
+
+#define PRINT_DIMS(str, v, n, loopvar) printf("%s = { ", str); \
+    for (loopvar=0; loopvar<n;loopvar++) printf("%lld ", v[loopvar]);    \
+printf("}")
+
+void printSettings(void) {
+    int i;
+    printf("Settings :\n");
+    printf("  masks  : %d ", nmasks);
+    for (i=0; i<nmasks; i++)
+        printf("%s ", varmask[i]);
+    printf("\n");
+    printf("  file   : %s\n", vfile);
+    if (grpmask)
+        printf("  groups : %s\n", grpmask);
+    printf("  output : %s\n", (outpath ? outpath : "stdout"));
+
+    if (start != NULL) {
+        PRINT_DIMS("  start", istart, ndimsspecified,i); printf("\n");
+    }
+    if (count != NULL) {
+        PRINT_DIMS("  count", icount, ndimsspecified,i); printf("\n");
+    }
+
+    if (longopt)
+        printf("      -l : show scalar values and min/max/avg of arrays\n");
+    if (sortnames)
+        printf("      -t : sort names before listing\n");
+    if (attrsonly)
+        printf("      -A : list attributes only\n");
+    else if (listattrs)
+        printf("      -a : list attributes too\n");
+    if (dump)
+        printf("      -d : dump matching variables and attributes\n");
+    if (use_regexp)
+        printf("      -e : handle masks as regular expressions\n");
+    if (formatgiven)
+        printf("      -f : dump using printf format \"%s\"\n", format);
+    if (output_xml)
+        printf("      -x : output data in XML format\n");
+}
+
+    void bpexit(int code, ADIOS_FILE *fp, ADIOS_GROUP *gp) {
+        if (gp > 0)
+            adios_gclose (gp);
+        if (fp > 0)
+            adios_fclose (fp);
+        exit(code);
+    }
+
+void print_file_size(uint64_t size)
+{
+    static const int  sn=7;
+    static const char *sm[]={"bytes", "KB", "MB", "GB", "TB", "PB", "EB"};
+    uint64_t s = size, r;
+    int idx = 0;
+    while ( s/1024 > 0 ) {
+        r = s%1024; 
+        s = s/1024;
+        idx++;
+    }
+    if (r > 511)
+        s++;
+    printf ("  file size:     %lld %s\n", s, sm[idx]); 
+
+}
+
+// prototypes
+int print_data_hist(ADIOS_VARINFO * vi, char * varname);
+int print_data_characteristics(void * min, void * max, double * avg, double * std_dev, enum ADIOS_DATATYPES adiosvartype, bool allowformat);
+
+int doList(const char *path) {
+    //int     ntsteps;
+
+    ADIOS_FILE  *fp;
+    ADIOS_GROUP *gp; // reused for each group
+    ADIOS_VARINFO *vi; 
+    enum ADIOS_DATATYPES vartype;
+    int     grpid, i, j, n;             // loop vars
+    int     status;
+    int     attrsize;                       // info about one attribute
+    int     mpi_comm_dummy=0;
+    bool    matches;
+    int     len, maxlen;
+    int     nVarsMatched=0;
+    int     nGroupsMatched=0;
+    int     retval;
+    char  **names;  // vars and attrs together, sorted or unsorted
+    bool   *isVar;  // true for each var, false for each attr
+    int     nNames; // number of vars + attrs
+    void   *value;  // scalar value is returned by get_attr
+
+    if (verbose>1) printf("\nADIOS BP open: read header info from %s\n", path);
+
+    // open the BP file
+    fp = adios_fopen (path, mpi_comm_dummy); 
+    if (fp == NULL) {
+        fprintf(stderr, "Error: %s\n", adios_errmsg());
+        bpexit(7, 0, 0);
+    }
+
+    // get number of groups, variables, timesteps, and attributes 
+    // all parameters are integers, 
+    // besides the last parameter, which is an array of strings for holding the list of group names
+    //ntsteps = fp->tidx_stop - fp->tidx_start + 1;
+    if (verbose) {
+        printf ("File info:\n");
+        printf ("  of groups:     %d\n", fp->groups_count);
+        printf ("  of variables:  %d\n", fp->vars_count);
+        printf ("  of attributes: %d\n", fp->attrs_count);
+        printf ("  time steps:    %d starting from %d\n", fp->ntimesteps, fp->tidx_start);
+        print_file_size(fp->file_size);
+        printf ("  bp version:    %d\n", fp->version);
+        printf ("  endianness:    %s\n", (fp->endianness ? "Big Endian" : "Little Endian"));
+        if (longopt) 
+            printf ("  statistics:    Min / Max / Avg / Std_dev\n");
+        printf ("\n");
+    }
+
+
+    // each group has to be handled separately
+    for (grpid=0; grpid < fp->groups_count; grpid++) {
+        if (!grpMatchesMask(fp->group_namelist[grpid]))
+            continue;
+        nGroupsMatched++;
+        if (!dump) fprintf(outf, "Group %s:\n", fp->group_namelist[grpid]);
+        gp = adios_gopen_byid (fp, grpid);
+        if (gp == NULL) {
+            fprintf(stderr, "Error: %s\n", adios_errmsg());
+            bpexit(8, fp, 0);
+        }
+
+        if (sortnames) {
+            if (!attrsonly)
+                qsort(gp->var_namelist, gp->vars_count, sizeof(char *), cmpstringp);
+            if (listattrs)
+                qsort(gp->attr_namelist, gp->attrs_count, sizeof(char *), cmpstringp);
+        }
+
+        if (attrsonly)
+            nNames = gp->attrs_count;
+        else if (listattrs)
+            nNames = gp->vars_count + gp->attrs_count;
+        else 
+            nNames = gp->vars_count;
+        names = (char **) malloc (nNames * sizeof (char*)); // store only pointers
+        isVar = (bool *) malloc (nNames * sizeof (bool));
+        if (names == NULL || isVar == NULL) {
+            fprintf(stderr, "Error: could not allocate char* and bool arrays of %d elements\n", nNames);
+            return 5;
+        }
+        mergeLists(gp->vars_count, gp->var_namelist, gp->attrs_count, gp->attr_namelist,
+                names, isVar);
+
+        // calculate max length of variable names in the first round
+        maxlen = 4;
+        for (n=0; n<nNames; n++) {
+            len = strlen(names[n]);
+            if (len > maxlen) maxlen = len;
+        }
+
+        /* VARIABLES */
+        for (n=0; n<nNames; n++) {
+            matches = false;
+            if (isVar[n])  {
+                vi = adios_inq_var (gp, names[n]);
+                if (!vi) {
+                    fprintf(stderr, "Error: %s\n", adios_errmsg());
+                }
+                vartype = vi->type;
+            } else {
+                retval = adios_get_attr (gp, names[n], &vartype, &attrsize, &value);
+                if (retval) {
+                    fprintf(stderr, "Error: %s\n", adios_errmsg());
+                }
+            }
+
+            matches = matchesAMask(names[n]);
+
+            if (matches) {
+                nVarsMatched++;
+                // print definition of variable
+                fprintf(outf,"%c %-*s  %-*s", commentchar, 9, adios_type_to_string(vartype), maxlen, names[n]); 
+                if (!isVar[n]) {
+                    // list (and print) attribute
+                    if (readattrs || dump) {
+                        fprintf(outf,"  attr   = ");
+                        print_data(value, 0, vartype, false); 
+                        fprintf(outf,"\n");
+                        matches = false; // already printed
+                    } else {
+                        fprintf(outf,"  attr\n");
+                    }
+                } else if (!vi) { 
+                    // after error
+                    fprintf(outf, "\n");
+                } else if (vi->ndim > 0) {
+                    // array
+                    //fprintf(outf,"  {%s%d", (vi->timedim==0 ? "T-": ""),vi->dims[0]);
+                    fprintf(outf,"  {%lld", vi->dims[0]);
+                    for (j=1; j < vi->ndim; j++) {
+                        fprintf(outf,", %lld", vi->dims[j]);
+                    }
+                    fprintf(outf,"}");
+
+                    if (vi->hist && plot) {
+                        print_data_hist(vi, &names[n][1]);
+                    }
+
+                    if (longopt && vi->gmin && vi->gmax) {
+
+                        if(timestep == false || (vi->timedim < 0)) {    
+
+                            fprintf(outf," = ");
+                            print_data(vi->gmin, 0, vartype, false); 
+
+                            fprintf(outf,"/ ");
+                            print_data(vi->gmax, 0, vartype, false); 
+
+                            if(vartype == adios_complex || vartype == adios_double_complex) {
+
+                                fprintf(outf,"/ ");
+                                print_data(vi->gavg, 0, adios_double_complex, false);
+                            } else {
+
+                                fprintf(outf,"/ ");
+                                print_data(vi->gavg, 0, adios_double, false);
+                            }
+
+                            if(vartype == adios_complex || vartype == adios_double_complex) {
+
+                                fprintf(outf,"/ ");
+                                print_data(vi->gstd_dev, 0, adios_double_complex, false);
+                            } else {
+
+                                fprintf(outf,"/ ");
+                                print_data(vi->gstd_dev, 0, adios_double, false);
+                            }
+
+                            //fprintf(outf," {MIN / MAX / AVG / STD_DEV} ");
+                        } else {
+                            int time_start = 0, time_end = vi->dims[0];
+
+                            if (start != NULL) {
+                                if (istart[0] >= 0)
+                                    time_start = istart[0];
+                                else
+                                    time_start = vi->dims[0] - 1 + istart[0];
+                            }
+
+                            if (count != NULL) {
+                                if(icount[0] > 0)
+                                    time_end = time_start + icount[0];
+                                else
+                                    time_end = vi->dims[0] + icount[0] + 1;
+                            }
+
+                            if (time_start < 0 || time_start >= vi->dims[0]) {
+                                fprintf (stderr, "Error when reading variable %s. errno=%d : Variable (id=%d) has no data at %d time step\n", names[n], 15, vi->varid, time_start);
+                                return 15;
+                            }
+
+                            if (time_end < 0 || time_end > vi->dims[0]) {
+                                fprintf (stderr, "Error when reading variable %s. errno=%d : Variable (id=%d) has no data at %d time step\n", names[n], 15, vi->varid, time_end);
+                                return 15;
+                            }
+
+                            static char *indent_char = " ";
+                            int indent_len=11;
+
+                            /* Start - Print the headers of statistics first */
+                            fprintf(outf, "\n%-*s", indent_len+7, indent_char);
+                            fprintf(outf, "%10s  ", "MIN");
+                            fprintf(outf, "%10s  ", "MAX");
+                            fprintf(outf, "%10s  ", "AVG");
+                            fprintf(outf, "%10s  ", "STD DEV");
+
+                            /* End - Print the headers of statistics first */
+
+                            void *min, *max, *avg, *std_dev;
+                            enum ADIOS_DATATYPES vt = vartype;
+                            if (vi->type == adios_complex || vi->type == adios_double_complex)
+                                vt = adios_double;
+                            fprintf(outf, "\n%-*sglobal:", indent_len, indent_char);
+                            print_data_characteristics(vi->gmin, vi->gmax, vi->gavg, vi->gstd_dev, vt, false);
+
+                            for(i = time_start; i < time_end; i++) {
+                                min = max = avg = std_dev = 0;
+                                if (vi->maxs && vi->maxs[i]) max = vi->maxs[i];
+                                if (vi->mins && vi->mins[i]) min = vi->mins[i];
+                                if (vi->avgs && vi->avgs[i]) avg = vi->avgs[i];
+                                if (vi->std_devs && vi->std_devs[i]) std_dev = vi->std_devs[i];
+
+                                // Align the output, previous lines has atleast (maxlen + strlen(names[n])) characters
+                                // Better way to printf N spaces?
+                                fprintf(outf, "\n%-*st%-5d:", indent_len, indent_char, i);
+                                print_data_characteristics(min, max, avg, std_dev, vt, false);
+                            }
+                            fprintf(outf, "\n");
+                        }
+                    }
+                    fprintf(outf,"\n");
+                } else {
+                    // scalar
+                    fprintf(outf,"  scalar");
+                    if (longopt && vi->value) {
+                        fprintf(outf," = ");
+                        print_data(vi->value, 0, vartype, false); 
+                        matches = false; // already printed
+                    }
+                    fprintf(outf,"\n");
+                }
+            }
+
+            if (matches && dump) {
+                // print variable content 
+                if (isVar[n])
+                    retval = readVar(gp, vi, names[n]);
+                if (retval && retval != 10) // do not return after unsupported type
+                    return retval;
+                fprintf(outf,"\n");
+            }
+
+            if (isVar[n])
+                adios_free_varinfo(vi);
+            else
+                free(value);
+        }
+        adios_gclose (gp);
+        free(names);
+        free(isVar);
+    }
+
+    if (grpmask != NULL && nGroupsMatched == 0) {
+        fprintf(stderr, "\nError: None of the groups matched the group mask you provided: %s\n", grpmask);
+        return 4;
+    }
+    if (nmasks > 0 && nVarsMatched == 0) {
+        fprintf(stderr, "\nError: None of the variables matched any name/regexp you provided\n");
+        return 4;
+    }
+    adios_fclose (fp);
+    return 0;
+}                
+
+int print_data_hist(ADIOS_VARINFO * vi, char * varname)
+{
+    char hist_file[256], gnuplot_file[256];
+    int i;
+    char xtics[512], str[512];
+    FILE * out_hist, * out_plot;
+
+    memcpy(hist_file,  varname, strlen(varname) + 1);    
+    strcat(hist_file, ".hist");
+
+    if ((out_hist = fopen(hist_file,"w")) == NULL) {
+        fprintf(stderr, "Error at opening for writing file %s: %s\n",
+                hist_file, strerror(errno));
+        return 30;
+    }
+
+    memcpy(gnuplot_file,  varname, strlen(varname) + 1);    
+    strcat(gnuplot_file, ".gpl");
+
+    if ((out_plot = fopen(gnuplot_file,"w")) == NULL) {
+        fprintf(stderr, "Error at opening for writing file %s: %s\n",
+                gnuplot_file, strerror(errno));
+        return 30;
+    }
+
+    xtics[0] = '\0';
+    strcat(xtics, "set xtics offset start axis (");
+    for (i = 0; i <= vi->hist->num_breaks; i++)
+    {
+        if (i == 0)
+        {
+            fprintf(out_hist, "-Inf %.2lf %u\n", vi->hist->breaks[i], vi->hist->gfrequencies[i]);
+            sprintf(str, "\"-Inf\" pos(%d)", i); 
+        }
+        else if (i < vi->hist->num_breaks)
+        {
+            fprintf(out_hist, "%.2lf %.2lf %u\n", vi->hist->breaks[i - 1], vi->hist->breaks[i], vi->hist->gfrequencies[i]);
+            sprintf(str, ", \"%.2lf\" pos(%d)", vi->hist->breaks[i - 1], i); 
+        }
+        else     
+        {
+            fprintf(out_hist, "%.2lf Inf %u\n", vi->hist->breaks[i], vi->hist->gfrequencies[i]);
+            sprintf(str, ", \"Inf\" pos(%d)", i); 
+        }
+        strcat(xtics, str);
+    }
+    strcat(xtics, ")\n");
+
+    fprintf(out_plot, "start = -0.5\npos(x) = start + x * 1\nset boxwidth 1\nset style fill solid border 5#5lt6#6\n");
+    fprintf(out_plot, xtics);
+    fprintf(out_plot, "plot '%s' using 3 smooth frequency w boxes\n", hist_file);
+    fprintf(out_plot, "pause -1 'Press Enter to quit'\n");
+}
+
+int cmpstringp(const void *p1, const void *p2)
+{
+    /* The actual arguments to this function are "pointers to
+       pointers to char", but strcmp() arguments are "pointers
+       to char", hence the following cast plus dereference */
+    return strcmp(* (char * const *) p1, * (char * const *) p2);
+}
+/** Merge listV with listA if listattrs=true, return listA if attrsonly=true, otherwise just return listV.
+  If sortnames=true, quicksort the result list.
+ */
+void mergeLists(int nV, char **listV, int nA, char **listA, char **mlist, bool *isVar) 
+{
+    int v, a, idx;
+    if (sortnames && listattrs && !attrsonly) {
+        // merge sort the two lists
+        v = 0;
+        a = 0;
+        while (v < nV || a < nA) {
+            if (a < nA && (v >= nV || strcmp(listV[v], listA[a]) > 0)) {
+                // fully consumed var list or 
+                // next item in attr list is less than next item in var list
+                mlist[v+a] = listA[a];
+                isVar[v+a] = false;
+                a++;
+            } else {
+                mlist[v+a] = listV[v];
+                isVar[v+a] = true;
+                v++;
+            }
+        }
+    } else {
+        // first add vars then attrs (if ask ed)
+        idx = 0;
+        if (!attrsonly) {
+            for (v=0; v<nV; v++) {
+                mlist[idx] = listV[v];
+                isVar[idx] = true;
+                idx++;
+            }
+        }
+        if (listattrs) {
+            for (a=0; a<nA; a++) {
+                mlist[idx] = listA[a];
+                isVar[idx] = false;
+                idx++;
+            }
+        }
+    }
+}
+
+int getTypeInfo( enum ADIOS_DATATYPES adiosvartype, int* elemsize)
+{
+    switch(adiosvartype) {
+        case adios_unsigned_byte:
+            *elemsize = 1;
+            break;
+        case adios_byte:
+            *elemsize = 1;
+            break;
+        case adios_string:
+            *elemsize = 1;
+            break;
+
+        case adios_unsigned_short:  
+            *elemsize = 2;
+            break;
+        case adios_short:
+            *elemsize = 2;
+            break;
+
+        case adios_unsigned_integer:
+            *elemsize = 4;
+            break;
+        case adios_integer:    
+            *elemsize = 4;
+            break;
+
+        case adios_unsigned_long:
+            *elemsize = 8;
+            break;
+        case adios_long:        
+            *elemsize = 8;
+            break;
+
+        case adios_real:
+            *elemsize = 4;
+            break;
+
+        case adios_double:
+            *elemsize = 8;
+            break;
+
+        case adios_complex:  
+            *elemsize = 8;
+            break;
+
+        case adios_double_complex:
+            *elemsize = 16;
+            break;
+
+        case adios_long_double: // do not know how to print
+            //*elemsize = 16;
+        default:
+            return 1;
+    }
+    return 0;
+}
+
+/** Read data of a variable and print 
+ * Return: 0: ok, != 0 on error
+ */
+int readVar(ADIOS_GROUP *gp, ADIOS_VARINFO *vi, const char * name)
+{
+    int i,j;
+    uint64_t start_t[MAX_DIMS], count_t[MAX_DIMS]; // processed <0 values in start/count
+    uint64_t s[MAX_DIMS], c[MAX_DIMS]; // for block reading of smaller chunks
+    uint64_t nelems;         // number of elements to read
+    int elemsize;            // size in bytes of one element
+    uint64_t st, ct;
+    void *data;
+    uint64_t sum;           // working var to sum up things
+    int  maxreadn;          // max number of elements to read once up to a limit (10MB of data)
+    int  actualreadn;       // our decision how much to read at once
+    int  readn[MAX_DIMS];   // how big chunk to read in in each dimension?
+    int64_t bytes_read;     // retval from adios_get_var()
+    bool incdim;            // used in incremental reading in
+
+    if (getTypeInfo(vi->type, &elemsize)) {
+        fprintf(stderr, "Adios type %d (%s) not supported in bpls. var=%s\n", 
+                vi->type, adios_type_to_string(vi->type), name);
+        return 10;
+    }
+
+    // create the counter arrays with the appropriate lengths
+    // transfer start and count arrays to format dependent arrays
+
+    nelems = 1;
+    for (j=0; j<vi->ndim; j++) {
+        if (istart[j] < 0)  // negative index means last-|index|
+            st = vi->dims[j]+istart[j];
+        else
+            st = istart[j];
+        if (icount[j] < 0)  // negative index means last-|index|+1-start
+            ct = vi->dims[j]+icount[j]+1-st;
+        else
+            ct = icount[j];
+
+        if (verbose>2) 
+            printf("    j=%d, st=%llu ct=%llu\n", j, st, ct);
+
+        start_t[j] = st;
+        count_t[j] = ct;
+        nelems *= ct;
+        if (verbose>1) 
+            printf("    s[%d]=%llu, c[%d]=%llu, n=%llu\n", j, start_t[j], j, count_t[j], nelems);
+    }
+
+    if (verbose>1) {
+        printf(" total size of data to read = %llu\n", nelems*elemsize);
+    }
+
+    print_slice_info(vi->ndim, vi->dims, start_t, count_t);
+
+    maxreadn = MAX_BUFFERSIZE/elemsize;
+    if (nelems < maxreadn)
+        maxreadn = nelems;
+
+    // special case: string. Need to use different elemsize
+    if (vi->type == adios_string) {
+        if (vi->value)
+            elemsize = strlen(vi->value)+1;
+        maxreadn = elemsize;
+    }
+
+    // allocate data array
+    data = (void *) malloc (maxreadn*elemsize+8); // +8 for just to be sure
+
+    // determine strategy how to read in:
+    //  - at once
+    //  - loop over 1st dimension
+    //  - loop over 1st & 2nd dimension
+    //  - etc
+    if (verbose>1) printf("Read size strategy:\n");
+    sum = (uint64_t) 1;
+    actualreadn = (uint64_t) 1;
+    for (i=vi->ndim-1; i>=0; i--) {
+        if (sum >= (uint64_t) maxreadn) {
+            readn[i] = 1;
+        } else {
+            readn[i] = maxreadn / (int)sum; // sum is small for 4 bytes here
+            // this may be over the max count for this dimension
+            if (readn[i] > count_t[i]) 
+                readn[i] = count_t[i];
+        }
+        if (verbose>1) printf("    dim %d: read %d elements\n", i, readn[i]);
+        sum = sum * (uint64_t) count_t[i];
+        actualreadn = actualreadn * readn[i];
+    }
+    if (verbose>1) printf("    read %d elements at once, %lld in total (nelems=%lld)\n", actualreadn, sum, nelems);
+
+
+    // init s and c
+    for (j=0; j<vi->ndim; j++) {
+        s[j]=start_t[j];
+        c[j]=readn[j];
+    }
+
+    // read until read all 'nelems' elements
+    sum = 0;
+    while (sum < nelems) {
+
+        // how many elements do we read in next?
+        actualreadn = 1;
+        for (j=0; j<vi->ndim; j++) 
+            actualreadn *= c[j];
+
+        if (verbose>2) {
+            printf("adios_read_var name=%s ", name);
+            PRINT_DIMS("  start", s, vi->ndim, j); 
+            PRINT_DIMS("  count", c, vi->ndim, j); 
+            printf("  read %d elems\n", actualreadn);
+        }
+
+        // read a slice finally
+        bytes_read = adios_read_var_byid (gp, vi->varid, s, c, data); 
+
+        if (bytes_read < 0) {
+            fprintf(stderr, "Error when reading variable %s. errno=%d : %s \n", name, adios_errno, adios_errmsg());
+            free(data);
+            return 11;
+        }
+
+        if (verbose>2) printf("  read %lld bytes\n", bytes_read);
+
+        // print slice
+        print_dataset(data, vi->type, s, c, vi->ndim, vi->dims); 
+
+        // prepare for next read
+        sum += actualreadn;
+        incdim=true; // largest dim should be increased 
+        for (j=vi->ndim-1; j>=0; j--) {
+            if (incdim) {
+                if (s[j]+c[j] == start_t[j]+count_t[j]) {
+                    // reached the end of this dimension
+                    s[j] = start_t[j];
+                    c[j] = readn[j];
+                    incdim = true; // next smaller dim can increase too
+                } else {
+                    // move up in this dimension up to total count
+                    s[j] += readn[j];
+                    if (s[j]+c[j] > start_t[j]+count_t[j]) {
+                        // do not reach over the limit
+                        c[j] = start_t[j]+count_t[j]-s[j];
+                    }
+                    incdim = false;
+                }
+            }
+        }
+    } // end while sum < nelems
+    print_endline();
+
+
+    free(data);
+    return 0;
+}
+
+
+bool matchesAMask(char *name) {
+    int excode;
+    int i;
+    int startpos=0; // to match with starting / or without
+    regmatch_t pmatch[1] = {{ (regoff_t) -1, (regoff_t) -1}};
+
+    if (nmasks == 0) 
+        return true;
+
+    for (i=0; i<nmasks; i++) {
+        if (use_regexp) {
+            excode = regexec (&(varregex[i]), name, 1, pmatch, 0);
+            if (name[0] == '/') // have to check if it matches from the second character too
+                startpos = 1;
+            if (excode == 0 &&                  // matches
+                    (pmatch[0].rm_so == 0 || pmatch[0].rm_so == startpos) &&         // from the beginning
+                    pmatch[0].rm_eo == strlen(name) // to the very end of the name
+               ) {
+                if (verbose>1)
+                    printf("Name %s matches regexp %i %s\n", name, i, varmask[i]);
+                //printf("Match from %d to %d\n", (int) pmatch[0].rm_so, (int) pmatch[0].rm_eo);
+                return true;
+            }
+        } else {
+            // use shell pattern matching
+            if (varmask[i][0] != '/' && name[0] == '/')
+                startpos = 1;
+            if ( fnmatch( varmask[i], name+startpos, FNM_FILE_NAME) == 0) {
+                if (verbose>1)
+                    printf("Name %s matches varmask %i %s\n", name, i, varmask[i]);
+                return true; 
+            }
+        }
+    }
+    return false;
+}
+
+/* return true if mask is null */
+bool grpMatchesMask(char *name) {
+    int startpos=0;
+    int excode;
+    regmatch_t pmatch[1] = {{ (regoff_t) -1, (regoff_t) -1}};
+
+    if (grpmask == NULL)
+        return true;
+
+    if (use_regexp) {
+        excode = regexec (&(grpregex), name, 1, pmatch, 0);
+        if (name[0] == '/') // have to check if it matches from the second character too
+            startpos = 1;
+        if (excode == 0 &&                  // matches
+                (pmatch[0].rm_so == 0 || pmatch[0].rm_so == startpos) &&         // from the beginning
+                pmatch[0].rm_eo == strlen(name) // to the very end of the name
+           ) {
+            if (verbose>1)
+                printf("Name %s matches regexp %s\n", name, grpmask);
+            //printf("Match from %d to %d\n", (int) pmatch[0].rm_so, (int) pmatch[0].rm_eo);
+            return true;
+        }
+    } else {
+        // use shell pattern matching
+        if (grpmask[0] != '/' && name[0] == '/')
+            startpos = 1;
+        if ( fnmatch( grpmask, name+startpos, FNM_FILE_NAME) == 0) {
+            if (verbose>1)
+                printf("Name %s matches groupmask %s\n", name, grpmask);
+            return true; 
+        }
+    }
+    return false;
+}
+
+
+int  print_start(const char *fname) {
+    if ( fname == NULL) {
+        outf = stdout;
+    } else {
+        if ((outf = fopen(fname,"w")) == NULL) {
+            fprintf(stderr, "Error at opening for writing file %s: %s\n",
+                    fname, strerror(errno));
+            return 30;
+        }
+    }
+    return 0;
+}
+
+void print_stop() {
+    fclose(outf);
+}
+
+static int nextcol=0;  // column index to start with (can have lines split in two calls)
+
+void print_slice_info(int ndim, uint64_t *dims, uint64_t *s, uint64_t *c)
+{
+    // print the slice info in indexing is on and 
+    // not the complete variable is read
+    int i;
+    bool isaslice = false;
+    for (i=0; i<ndim; i++) {
+        if (c[i] < dims[i])
+            isaslice = true;
+    }
+    if (isaslice) {
+        fprintf(outf,"%c   slice (%lld:%lld", commentchar, s[0], s[0]+c[0]-1);
+        for (i=1; i<ndim; i++) {
+            fprintf(outf,", %lld:%lld", s[i], s[i]+c[i]-1);
+        }
+        fprintf(outf,")\n");
+    }
+}
+
+int print_data_as_string(void * data, int maxlen, enum ADIOS_DATATYPES adiosvartype)
+{
+    char *str = (char *)data;
+    int len = maxlen;
+    bool cstring = false;
+    switch(adiosvartype) {
+        case adios_unsigned_byte:
+        case adios_byte:
+        case adios_string:
+            while ( str[len-1] == 0) { len--; }   // go backwards on ascii 0s
+            if (len < maxlen) {
+                // it's a C string with terminating \0
+                fprintf(outf,"\"%s\"", str);
+            } else {
+                // fortran VARCHAR, lets trim from right padded zeros
+                while ( str[len-1] == ' ') {len--;}
+                fprintf(outf,"\"%*.*s\"", len, len, (char *) data);
+                if (len < maxlen)
+                    fprintf(outf," + %d spaces", maxlen-len);
+            }
+            break;
+        default:
+            fprintf(stderr, "Error in bpls code: cannot use print_data_as_string() for type \"%s\"\n", 
+                    adios_type_to_string(adiosvartype));
+            return -1;
+            break;
+    }
+    return 0;
+}
+
+int print_data_characteristics(void * min, void * max, double * avg, double * std_dev, enum ADIOS_DATATYPES adiosvartype, bool allowformat)
+{
+    bool f = formatgiven && allowformat;
+
+    switch(adiosvartype) {
+        case adios_unsigned_byte:
+            if (min) fprintf(outf,(f ? format : "%10hhu  "), ((unsigned char *) min));
+            else fprintf(outf, "      null  ");
+            if (max) fprintf(outf,(f ? format : "%10hhu  "), ((unsigned char *) max));
+            else fprintf(outf, "      null  ");
+            if (avg) fprintf(outf, "%10.2f  ", * avg);
+            else fprintf(outf, "      null  ");
+            if (std_dev) fprintf(outf, "%10.2f  ", * std_dev);
+            else fprintf(outf, "      null  ");
+            break;
+        case adios_byte:
+            if (min) fprintf(outf,(f ? format : "%10hhd  "), ((char *) min));
+            else fprintf(outf, "      null  ");
+            if (max) fprintf(outf,(f ? format : "%10hhd  "), ((char *) max));
+            else fprintf(outf, "      null  ");
+            if (avg) fprintf(outf, "%10.2f  ", * avg);
+            else fprintf(outf, "      null  ");
+            if (std_dev) fprintf(outf, "%10.2f  ", * std_dev);
+            else fprintf(outf, "      null  ");
+            break;
+        case adios_string:
+            break;
+
+        case adios_unsigned_short:
+            if (min) fprintf(outf,(f ? format : "%10hu  "), (* (unsigned short *) min));
+            else fprintf(outf, "      null  ");
+            if (max) fprintf(outf,(f ? format : "%10hu  "), (* (unsigned short *) max));
+            else fprintf(outf, "      null  ");
+            if (avg) fprintf(outf, "%10.2f  ", * avg);
+            else fprintf(outf, "      null  ");
+            if (std_dev) fprintf(outf, "%10.2f  ", * std_dev);
+            else fprintf(outf, "      null  ");
+            break;
+        case adios_short:
+            if (min) fprintf(outf,(f ? format : "%10hd  "), (* (short *) min));
+            else fprintf(outf, "      null  ");
+            if (max) fprintf(outf,(f ? format : "%10hd  "), (* (short *) max));
+            else fprintf(outf, "      null  ");
+            if (avg) fprintf(outf, "%10.2f  ", * avg);
+            else fprintf(outf, "      null  ");
+            if (std_dev) fprintf(outf, "%10.2f  ", * std_dev);
+            else fprintf(outf, "      null  ");
+            break;
+
+        case adios_unsigned_integer:
+            if (min) fprintf(outf,(f ? format : "%10u  "), (* (unsigned int *) min));
+            else fprintf(outf, "      null  ");
+            if (max) fprintf(outf,(f ? format : "%10u  "), (* (unsigned int *) max));
+            else fprintf(outf, "      null  ");
+            if (avg) fprintf(outf, "%10.2f  ", * avg);
+            else fprintf(outf, "      null  ");
+            if (std_dev) fprintf(outf, "%10.2f  ", * std_dev);
+            else fprintf(outf, "      null  ");
+            break;
+        case adios_integer:
+            if (min) fprintf(outf,(f ? format : "%10d  "), (* (int *) min));
+            else fprintf(outf, "      null  ");
+            if (max) fprintf(outf,(f ? format : "%10d  "), (* (int *) max));
+            else fprintf(outf, "      null  ");
+            if (avg) fprintf(outf, "%10.2f  ", * avg);
+            else fprintf(outf, "      null  ");
+            if (std_dev) fprintf(outf, "%10.2f  ", * std_dev);
+            else fprintf(outf, "      null  ");
+            break;
+
+        case adios_unsigned_long:
+            if (min) fprintf(outf,(f ? format : "%10llu  "), (* (unsigned long long *) min));
+            else fprintf(outf, "      null  ");
+            if (max) fprintf(outf,(f ? format : "%10llu  "), (* (unsigned long long *) max));
+            else fprintf(outf, "      null  ");
+            if (avg) fprintf(outf, "%10.2f  ", * avg);
+            else fprintf(outf, "      null  ");
+            if (std_dev) fprintf(outf, "%10.2f  ", * std_dev);
+            else fprintf(outf, "      null  ");
+            break;
+        case adios_long:
+            if (min) fprintf(outf,(f ? format : "%10lld  "), (* (long long *) min));
+            else fprintf(outf, "      null  ");
+            if (max) fprintf(outf,(f ? format : "%10lld  "), (* (long long *) max));
+            else fprintf(outf, "      null  ");
+            if (avg) fprintf(outf, "%10.2f  ", * avg);
+            else fprintf(outf, "      null  ");
+            if (std_dev) fprintf(outf, "%10.2f  ", * std_dev);
+            else fprintf(outf, "      null  ");
+            break;
+
+        case adios_real:
+        case adios_double:
+            if (min) fprintf(outf,(f ? format : "%10.2g  "), (* (float *) min));
+            else fprintf(outf, "      null  ");
+            if (max) fprintf(outf,(f ? format : "%10.2g  "), (* (float *) max));
+            else fprintf(outf, "      null  ");
+            if (avg) fprintf(outf, "%10.2g  ", * avg);
+            else fprintf(outf, "      null  ");
+            if (std_dev) fprintf(outf, "%10.2g  ", * std_dev);
+            else fprintf(outf, "      null  ");
+            break;
+
+        case adios_long_double:
+            //fprintf(outf,(f ? format : "%g "), ((double *) data)[item]);
+            fprintf(outf,(f ? format : "????????"));
+            break;
+
+            // TO DO
+            /*
+               case adios_complex:
+               fprintf(outf,(f ? format : "(%g,i%g) "), ((float *) data)[2*item], ((float *) data)[2*item+1]);
+               break;
+
+               case adios_double_complex:
+               fprintf(outf,(f ? format : "(%g,i%g)" ), ((double *) data)[2*item], ((double *) data)[2*item+1]);
+               break;
+             */
+    } // end switch
+    return 0;
+}
+
+int print_data(void *data, int item, enum ADIOS_DATATYPES adiosvartype, bool allowformat)
+{
+    bool f = formatgiven && allowformat;
+    if (data == NULL) {
+        fprintf(outf, "null ");
+        return 0;
+    }
+    // print next data item into vstr
+    switch(adiosvartype) {
+        case adios_unsigned_byte:
+            fprintf(outf,(f ? format : "%hhu "), ((unsigned char *) data)[item]);
+            break;
+        case adios_byte:
+            fprintf(outf,(f ? format : "%hhd "), ((signed char *) data)[item]);
+            break;
+        case adios_string:
+            fprintf(outf,(f ? format : "\"%s\""), ((char *) data)+item);
+            break;
+
+        case adios_unsigned_short:  
+            fprintf(outf,(f ? format : "%hu "), ((unsigned short *) data)[item]);
+            break;
+        case adios_short:
+            fprintf(outf,(f ? format : "%hd "), ((signed short *) data)[item]);
+            break;
+
+        case adios_unsigned_integer:
+            fprintf(outf,(f ? format : "%u "), ((unsigned int *) data)[item]);
+            break;
+        case adios_integer:    
+            fprintf(outf,(f ? format : "%d "), ((signed int *) data)[item]);
+            break;
+
+        case adios_unsigned_long:
+            fprintf(outf,(f ? format : "%llu "), ((unsigned long long *) data)[item]);
+            break;
+        case adios_long:        
+            fprintf(outf,(f ? format : "%lld "), ((signed long long *) data)[item]);
+            break;
+
+        case adios_real:
+            fprintf(outf,(f ? format : "%g "), ((float *) data)[item]);
+            break;
+
+        case adios_double:
+            fprintf(outf,(f ? format : "%g "), ((double *) data)[item]);
+            break;
+
+
+        case adios_long_double:
+            //fprintf(outf,(f ? format : "%g "), ((double *) data)[item]);
+            fprintf(outf,(f ? format : "????????"));
+            break;
+
+
+        case adios_complex:  
+            fprintf(outf,(f ? format : "(%g,i%g) "), ((float *) data)[2*item], ((float *) data)[2*item+1]);
+            break;
+
+        case adios_double_complex:
+            fprintf(outf,(f ? format : "(%g,i%g)" ), ((double *) data)[2*item], ((double *) data)[2*item+1]);
+            break;
+    } // end switch
+    return 0;
+}
+
+int print_dataset(void *data, enum ADIOS_DATATYPES adiosvartype, 
+        uint64_t *s, uint64_t *c, int ndim, uint64_t *dims)
+{
+    int i,item, steps;
+    char idxstr[128], vstr[128], buf[16];
+    uint64_t ids[MAX_DIMS];  // current indices
+    bool roll;
+
+    // init current indices
+    steps = 1;
+    for (i=0; i<ndim; i++) {
+        ids[i] = s[i];
+        steps *= c[i];
+    }
+
+    item = 0; // index to *data 
+    // loop through each data item and print value
+    while (item < steps) {
+
+        // print indices if needed into idxstr;
+        idxstr[0] = '\0'; // empty idx string
+        if (nextcol == 0) {
+            if (!noindex && ndim > 0) {
+                sprintf(idxstr,"    (%lld",ids[0]);
+                for (i=1; i<ndim; i++) {
+                    sprintf(buf,",%lld",ids[i]);
+                    strcat(idxstr, buf);
+                }
+                strcat(idxstr,")    ");
+            }
+        }
+
+        // print item
+        fprintf(outf, "%s", idxstr);
+        if (printByteAsChar && (adiosvartype == adios_byte || adiosvartype == adios_unsigned_byte)) {
+            /* special case: k-D byte array printed as (k-1)D array of strings */
+            if (ndim == 0) {
+                print_data_as_string(data, steps, adiosvartype);
+            } else {
+                print_data_as_string(data+item, c[ndim-1], adiosvartype); // print data of last dim as string
+                item += c[ndim-1]-1; // will be ++-ed once below
+                ids[ndim-1] = s[ndim-1]+c[ndim-1]-1; // will be rolled below
+            }
+            nextcol = ncols-1; // force new line, will be ++-ed once below
+        } else {
+            print_data(data, item, adiosvartype, true);
+        }
+
+        // increment/reset column index
+        nextcol++;
+        if (nextcol == ncols) {
+            fprintf(outf,"\n");
+            nextcol = 0;
+        }
+
+        // increment indices
+        item++;
+        roll = true;
+        for (i=ndim-1; i>=0; i--) {
+            if (roll) {
+                if (ids[i] == s[i]+c[i]-1 ) {
+                    // last index in this dimension, roll upward
+                    ids[i] = s[i];
+                } else {
+                    ids[i]++;
+                    roll = false;
+                }
+            }
+        }
+    }
+    return 0;
+}
+
+void print_endline(void) 
+{
+    if (nextcol != 0)
+        fprintf(outf,"\n");
+    nextcol = 0;
+}
+
+
+
+// parse a string "0, 3; 027" into an integer array
+// of [0,3,27] 
+// exits if parsing failes
+void parseDimSpec(char *str, int *dims)
+{
+    char *token, *saveptr;
+    char *s;  // copy of s; strtok modifies the string
+    int  i=0;
+
+    s = strndup(str, 256);
+    token = strtok_r(s, " ,;x\t\n", &saveptr);
+    while (token != NULL && i < MAX_DIMS) {
+        //printf("\t|%s|", token);
+        errno = 0;
+        dims[i] = strtol(token, (char **)NULL, 0);
+        if (errno) {
+            fprintf(stderr, "Error: could not convert field into a value: %s from \"%s\"\n", token, str);
+            exit(200);
+        }
+
+        // get next item
+        token = strtok_r(NULL, " ,;x\t\n", &saveptr);
+        i++;
+    }
+    //if (i>0) printf("\n");
+
+    if (i > ndimsspecified) ndimsspecified = i;
+
+    // check if number of dims specified is larger than we can handle
+    if (token != NULL) {
+        fprintf(stderr, "Error: More dimensions specified in \"%s\" than we can handle (%d)\n", str, MAX_DIMS);
+        exit(200);
+    }
+}
+
+int compile_regexp_masks(void)
+{
+    int i, errcode;
+    char buf[256];
+    for (i=0; i<nmasks; i++) {
+        errcode = regcomp( &(varregex[i]), varmask[i], REG_EXTENDED);
+        if (errcode) {
+            regerror(errcode, &(varregex[i]), buf, sizeof(buf));
+            fprintf(stderr, "Error: var %s is an invalid extended regular expression: %s\n", varmask[i], buf);
+            return 2;
+        }
+    }
+    if (grpmask != NULL) {
+        errcode = regcomp( &(grpregex), grpmask, REG_EXTENDED);
+        if (errcode) {
+            regerror(errcode, &(grpregex), buf, sizeof(buf));
+            fprintf(stderr, "Error: var %s is an invalid extended regular expression: %s\n", grpmask, buf);
+            return 2;
+        }
+    }
+    return 0;
+}
diff --git a/utils/bpls/bpls.h b/utils/bpls/bpls.h
new file mode 100644
index 0000000..5ba5664
--- /dev/null
+++ b/utils/bpls/bpls.h
@@ -0,0 +1,49 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+
+#include <stdint.h>
+#include "adios_read.h"
+
+/* definitions for bpls.c */
+#define myfree(p) if (p) { free(p); p=NULL; }
+
+#ifndef HAVE_STRNDUP
+#  define strndup(str,len) strdup(str)
+#endif
+
+typedef int bool;
+#define false 0
+#define true  1
+
+#define CUT_TO_BYTE(x) (x < 0 ? 0 : (x > 255 ? 255 : x))
+
+#define MAX_DIMS 16
+#define MAX_MASKS 10
+#define MAX_BUFFERSIZE (10*1024*1024)
+
+// how to print one data item of an array
+//enum PrintDataType {STRING, INT, FLOAT, DOUBLE, COMPLEX};
+
+void init_globals(void);
+void processDimSpecs(void);
+void parseDimSpec(char *str, int *dims);
+int compile_regexp_masks(void);
+void printSettings(void);
+int  doList(const char *path);
+void mergeLists(int nV, char **listV, int nA, char **listA, char **mlist, bool *isVar);
+int  readVar(ADIOS_GROUP *gp, ADIOS_VARINFO *vi, const char *naQWme);
+int cmpstringp(const void *p1, const void *p2);
+bool grpMatchesMask(char *name);
+bool matchesAMask(char *name);
+int  print_start(const char *fname);
+void print_slice_info(int ndim, uint64_t *dims, uint64_t *s, uint64_t *c);
+int print_data(void *data, int item, enum ADIOS_DATATYPES adiosvartype, bool allowformat);
+int print_dataset(void *data, enum ADIOS_DATATYPES adiosvartype, 
+               uint64_t *s, uint64_t *c, int ndims, uint64_t *dims);  
+void print_endline(void);
+void print_stop(void);
diff --git a/utils/bpsplit/Makefile.am b/utils/bpsplit/Makefile.am
new file mode 100644
index 0000000..09e66b1
--- /dev/null
+++ b/utils/bpsplit/Makefile.am
@@ -0,0 +1,30 @@
+INCLUDES = $(all_includes)
+INCLUDES += -I$(top_builddir)/src
+
+AUTOMAKE_OPTIONS = no-dependencies
+
+bin_PROGRAMS = bpsplit bpappend bpgettime
+
+bpsplit_SOURCES = bpsplit.c
+bpsplit_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_SEQ_CPPFLAGS) $(ADIOSLIB_SEQ_CFLAGS)
+bpsplit_LDFLAGS = $(ADIOSLIB_SEQ_LDFLAGS)
+bpsplit_LDADD = $(top_builddir)/src/libadios_internal_nompi.a 
+bpsplit_LDADD += $(ADIOSLIB_SEQ_LDADD)
+
+bpappend_SOURCES = bpappend.c
+bpappend_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_SEQ_CPPFLAGS) $(ADIOSLIB_SEQ_CFLAGS)
+bpappend_LDFLAGS = $(ADIOSLIB_SEQ_LDFLAGS)
+bpappend_LDADD = $(top_builddir)/src/libadios_internal_nompi.a
+bpappend_LDADD += $(ADIOSLIB_SEQ_LDADD)
+
+bpgettime_SOURCES = bpgettime.c
+bpgettime_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_SEQ_CPPFLAGS) $(ADIOSLIB_SEQ_CFLAGS)
+bpgettime_LDFLAGS = $(ADIOSLIB_SEQ_LDFLAGS)
+bpgettime_LDADD = $(top_builddir)/src/libadios_internal_nompi.a
+bpgettime_LDADD += $(ADIOSLIB_SEQ_LDADD)
+
+if USE_PARALLEL_COMPILER
+    CC=$(MPICC)
+    CXX=$(MPICXX)
+endif
+
diff --git a/utils/bpsplit/Makefile.in b/utils/bpsplit/Makefile.in
new file mode 100644
index 0000000..ab93e50
--- /dev/null
+++ b/utils/bpsplit/Makefile.in
@@ -0,0 +1,613 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = bpsplit$(EXEEXT) bpappend$(EXEEXT) bpgettime$(EXEEXT)
+subdir = utils/bpsplit
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_bpappend_OBJECTS = bpappend-bpappend.$(OBJEXT)
+bpappend_OBJECTS = $(am_bpappend_OBJECTS)
+am__DEPENDENCIES_1 =
+bpappend_DEPENDENCIES = $(top_builddir)/src/libadios_internal_nompi.a \
+	$(am__DEPENDENCIES_1)
+am_bpgettime_OBJECTS = bpgettime-bpgettime.$(OBJEXT)
+bpgettime_OBJECTS = $(am_bpgettime_OBJECTS)
+bpgettime_DEPENDENCIES =  \
+	$(top_builddir)/src/libadios_internal_nompi.a \
+	$(am__DEPENDENCIES_1)
+am_bpsplit_OBJECTS = bpsplit-bpsplit.$(OBJEXT)
+bpsplit_OBJECTS = $(am_bpsplit_OBJECTS)
+bpsplit_DEPENDENCIES = $(top_builddir)/src/libadios_internal_nompi.a \
+	$(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(bpappend_SOURCES) $(bpgettime_SOURCES) $(bpsplit_SOURCES)
+DIST_SOURCES = $(bpappend_SOURCES) $(bpgettime_SOURCES) \
+	$(bpsplit_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = @CC@
+ at USE_PARALLEL_COMPILER_TRUE@CC = $(MPICC)
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+ at USE_PARALLEL_COMPILER_TRUE@CXX = $(MPICXX)
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INCLUDES = $(all_includes) -I$(top_builddir)/src
+AUTOMAKE_OPTIONS = no-dependencies
+bpsplit_SOURCES = bpsplit.c
+bpsplit_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_SEQ_CPPFLAGS) $(ADIOSLIB_SEQ_CFLAGS)
+bpsplit_LDFLAGS = $(ADIOSLIB_SEQ_LDFLAGS)
+bpsplit_LDADD = $(top_builddir)/src/libadios_internal_nompi.a \
+	$(ADIOSLIB_SEQ_LDADD)
+bpappend_SOURCES = bpappend.c
+bpappend_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_SEQ_CPPFLAGS) $(ADIOSLIB_SEQ_CFLAGS)
+bpappend_LDFLAGS = $(ADIOSLIB_SEQ_LDFLAGS)
+bpappend_LDADD = $(top_builddir)/src/libadios_internal_nompi.a \
+	$(ADIOSLIB_SEQ_LDADD)
+bpgettime_SOURCES = bpgettime.c
+bpgettime_CPPFLAGS = $(ADIOSLIB_EXTRA_CPPFLAGS) $(ADIOSLIB_SEQ_CPPFLAGS) $(ADIOSLIB_SEQ_CFLAGS)
+bpgettime_LDFLAGS = $(ADIOSLIB_SEQ_LDFLAGS)
+bpgettime_LDADD = $(top_builddir)/src/libadios_internal_nompi.a \
+	$(ADIOSLIB_SEQ_LDADD)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  utils/bpsplit/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  utils/bpsplit/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
+	done
+
+clean-binPROGRAMS:
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+bpappend$(EXEEXT): $(bpappend_OBJECTS) $(bpappend_DEPENDENCIES) 
+	@rm -f bpappend$(EXEEXT)
+	$(LINK) $(bpappend_LDFLAGS) $(bpappend_OBJECTS) $(bpappend_LDADD) $(LIBS)
+bpgettime$(EXEEXT): $(bpgettime_OBJECTS) $(bpgettime_DEPENDENCIES) 
+	@rm -f bpgettime$(EXEEXT)
+	$(LINK) $(bpgettime_LDFLAGS) $(bpgettime_OBJECTS) $(bpgettime_LDADD) $(LIBS)
+bpsplit$(EXEEXT): $(bpsplit_OBJECTS) $(bpsplit_DEPENDENCIES) 
+	@rm -f bpsplit$(EXEEXT)
+	$(LINK) $(bpsplit_LDFLAGS) $(bpsplit_OBJECTS) $(bpsplit_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.c.o:
+	$(COMPILE) -c $<
+
+.c.obj:
+	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+	$(LTCOMPILE) -c -o $@ $<
+
+bpappend-bpappend.o: bpappend.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bpappend_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bpappend-bpappend.o `test -f 'bpappend.c' || echo '$(srcdir)/'`bpappend.c
+
+bpappend-bpappend.obj: bpappend.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bpappend_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bpappend-bpappend.obj `if test -f 'bpappend.c'; then $(CYGPATH_W) 'bpappend.c'; else $(CYGPATH_W) '$(srcdir)/bpappend.c'; fi`
+
+bpgettime-bpgettime.o: bpgettime.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bpgettime_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bpgettime-bpgettime.o `test -f 'bpgettime.c' || echo '$(srcdir)/'`bpgettime.c
+
+bpgettime-bpgettime.obj: bpgettime.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bpgettime_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bpgettime-bpgettime.obj `if test -f 'bpgettime.c'; then $(CYGPATH_W) 'bpgettime.c'; else $(CYGPATH_W) '$(srcdir)/bpgettime.c'; fi`
+
+bpsplit-bpsplit.o: bpsplit.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bpsplit_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bpsplit-bpsplit.o `test -f 'bpsplit.c' || echo '$(srcdir)/'`bpsplit.c
+
+bpsplit-bpsplit.obj: bpsplit.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bpsplit_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bpsplit-bpsplit.obj `if test -f 'bpsplit.c'; then $(CYGPATH_W) 'bpsplit.c'; else $(CYGPATH_W) '$(srcdir)/bpsplit.c'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic clean-libtool ctags distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-binPROGRAMS uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/utils/bpsplit/bpappend.c b/utils/bpsplit/bpappend.c
new file mode 100644
index 0000000..4d22eee
--- /dev/null
+++ b/utils/bpsplit/bpappend.c
@@ -0,0 +1,562 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/*
+   BPAPPEND: append a BP file to another 
+
+   Author: Norbert Podhorszki, pnorbert at ornl.gov
+
+**/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+#ifndef __USE_LARGEFILE64
+#define __USE_LARGEFILE64
+#endif
+
+#include <sys/types.h> 
+#include <unistd.h>  
+#include <fcntl.h>  // open64
+#include <sys/stat.h> // S_IRUSR and alike
+#include <errno.h>
+
+#ifndef _GNU_SOURCE
+#   define _GNU_SOURCE
+#endif
+
+#include <string.h>
+#include <getopt.h>
+
+#include "adios_types.h"
+#include "adios_transport_hooks.h"
+#include "adios_bp_v1.h"
+#include "adios_internals.h"
+
+#ifndef strndup   //HAVE_STRNDUP
+#  define strndup(str,len) strdup(str)
+#endif
+
+#if defined(__APPLE__) || defined(__WIN32__) 
+#    define lseek64 lseek
+#    define open64  open
+#endif
+
+#define DIVIDER "========================================================\n"
+
+
+typedef int bool;
+#define true 1
+#define false 0
+
+/** Prototypes */
+int bpappend(char *filein, char *fileout);
+void cleanup(void);
+
+/** Global variables */
+int verbose   = 0;            // 1: print log to stdout, 2: debug 
+
+
+struct option options[] = {
+    {"help",        no_argument,       NULL, 'h'},
+    {"verbose",     no_argument,       NULL, 'v'},
+    {NULL,          0,                 NULL, 0}
+};
+
+static const char *optstring = "+hv";
+
+char *prgname; /* argv[0] */
+
+
+void display_help() {
+   printf(
+"Usage: %s [-h | --help] [-v | --verbose] splitfile appendfile\n"
+"\n"
+"Append timesteps into a time-stepped BP file from another file BP file splitted by bpsplit.\n"
+"splitfile will be appended to appendfile.\n"
+"\n"
+"  --help | -h     Print this help.\n"
+"  --verbose | -v  Log activity about what this program is doing.\n"
+"                  Extra -v increases the number of messages.\n"
+"\n"
+,prgname
+);
+
+}
+
+
+/** Main */
+int main( int argc, char *argv[] ) {
+    int excode;
+    int from      = -1;           // split from  'from'. -1=last
+    int to        = -1;           // split until 'to'. -1=last
+    char *filein  = NULL;
+    char *fileout = NULL;       
+
+    prgname = strdup(argv[0]);
+
+    /* other variables */
+    int c, last_c='_';
+    int idx = 1;
+    /* Process the arguments */
+    while ((c = getopt_long(argc, argv, optstring, options, NULL)) != -1) {
+        switch (c) {
+        case 'h':
+            display_help();
+            return 0;
+        case 'v':
+            verbose++;
+            break;
+        case 1:
+            /* This means a field is unknown, could be multiple arg (we do not have such)
+               or bad arg*/
+            /*
+            if (last_c=='z') {
+                // process additional argument; 
+            }*/
+            /* else { Unknown param } */
+            fprintf(stderr, "Unrecognized argument: %s\n", optarg);
+            return 1;
+        default:
+            printf ("\nError: Unknown command line option: %s\n\n", argv[optind]);
+            display_help();
+            exit (1);
+            break;
+        } /* end switch */
+        last_c = c;
+        idx++;
+    } /* end while */
+
+    if (argc >= optind+2) {
+        // Read the required arguments
+        filein  = strndup(argv[optind], 256);
+        fileout = strndup(argv[optind+1], 256);
+    } else {
+        display_help();
+        return 1;
+    }
+
+    /* Do the work */
+    excode = bpappend(filein, fileout);
+    if (excode)
+        cleanup();
+
+    return excode; 
+}
+
+// global vars for the functions below
+//   filein's data structs
+struct adios_bp_buffer_struct_v1           * in_bp         = 0;
+struct adios_index_process_group_struct_v1 * in_pg_root    = 0;
+struct adios_index_var_struct_v1           * in_vars_root  = 0; 
+struct adios_index_attribute_struct_v1     * in_attrs_root = 0; 
+//   fileout's data structs 
+struct adios_bp_buffer_struct_v1           * out_bp         = 0;
+struct adios_index_process_group_struct_v1 * out_pg_root    = 0;
+struct adios_index_var_struct_v1           * out_vars_root  = 0; 
+struct adios_index_attribute_struct_v1     * out_attrs_root = 0; 
+int    outf;  // file handle for output file (we write raw since we copy groups, not vars and attrs)
+
+uint64_t append_offset_start = 0;  // the beginning offset in out_bp to write group data of in_bp
+
+//   aux variables to contain tail of index chains (for cleanup only)
+struct adios_index_process_group_struct_v1 * tail_pg_root    = 0;
+
+/** Read the indexes from the input file and parse them into the in_* structs 
+ */
+int read_indexes(char *filename, bool input) {
+    struct adios_bp_buffer_struct_v1           * bp;
+    struct adios_index_process_group_struct_v1 * pg_root = 0;
+    struct adios_index_var_struct_v1           * vars_root = 0;
+    struct adios_index_attribute_struct_v1     * attrs_root = 0;
+    int excode = 0;
+    uint32_t version = 0;
+    int rc = 0;
+
+    if (verbose) printf("Read indexes from %s\n", filename);
+
+    // init bp struct for reading
+    bp = malloc (sizeof (struct adios_bp_buffer_struct_v1));
+    adios_buffer_struct_init (bp);
+
+    // open infile 
+    rc = adios_posix_open_read_internal (filename, "", bp);
+    if (!rc) {
+        if (input) fprintf (stderr, "%s: file not found: %s\n", prgname, filename);
+        return 128;
+    }
+
+    // read version
+    adios_posix_read_version (bp);
+    adios_parse_version (bp, &version);
+
+    // read and parse process group index
+    adios_posix_read_index_offsets (bp);
+    adios_parse_index_offsets_v1 (bp);
+    adios_posix_read_process_group_index (bp);
+    adios_parse_process_group_index_v1 (bp, &pg_root);
+    
+    // read and parse variable index
+    adios_posix_read_vars_index (bp);
+    adios_parse_vars_index_v1 (bp, &vars_root);
+
+    // read and parse attribute index
+    adios_posix_read_attributes_index (bp);
+    adios_parse_attributes_index_v1 (bp, &attrs_root);
+
+    if (verbose>1) {
+        printf (DIVIDER);
+        printf ("%s file %s:\n", (input ? "Input" : "Output"), filename);
+        printf ("Process Groups Index:\n");
+        printf ("Process Groups Index Offset = %llu\n", bp->pg_index_offset);
+        printf ("Process Groups Index Size   = %llu\n", bp->pg_size);
+        printf ("Variable Index Offset       = %llu\n", bp->vars_index_offset);
+        printf ("Variable Index Size         = %llu\n", bp->vars_size);
+        printf ("Attribute Index Offset      = %llu\n", bp->attrs_index_offset);
+        printf ("Attribute Index Size        = %llu\n", bp->attrs_size);
+    }
+
+    // set global pointers 
+    if (input) {
+        in_bp         = bp;
+        in_pg_root    = pg_root;
+        in_vars_root  = vars_root;
+        in_attrs_root = attrs_root;
+    } else {
+        out_bp         = bp;
+        out_pg_root    = pg_root;
+        out_vars_root  = vars_root;
+        out_attrs_root = attrs_root;
+        // we do not need the readonly file handle anymore
+        close(bp->f);
+        bp->f = -1;
+    }
+
+    return excode;
+}
+
+/** Copy the input file to the output file.
+ *  FIXME: how should we copy if endianness should be changed?
+ */
+#define COPYBUFSIZE 1024
+int copy_file( const char *filein, const char *fileout) {
+    int inf, outf;
+    if (verbose) printf("Copy input %s to output %s\n", filein, fileout);
+
+    // open files
+    errno = 0;
+    inf = open64( filein, O_RDONLY);  
+    if (inf == -1) {
+        fprintf(stderr, "Cannot open input file %s: %s\n", filein, strerror(errno));
+        return 1;
+    }
+    errno = 0;
+    outf = open64( fileout, O_WRONLY | O_CREAT | O_TRUNC,
+                S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH
+              );
+    if (outf == -1) {
+        fprintf(stderr, "Cannot open output file %s: %s\n", fileout, strerror(errno));
+        close(inf);
+        return 1;
+    }
+   
+    // copy data
+    char buf[COPYBUFSIZE];
+    ssize_t bytes_read, bytes_written;
+    uint64_t bytes_copied  = 0;
+    bytes_read = read( inf, (void *)buf, COPYBUFSIZE);
+    while (bytes_read > 0) {
+        bytes_written = write( outf, (void *) buf, bytes_read);
+        if (bytes_written != bytes_read) {
+            fprintf(stderr, "Error: could not write %d bytes to output file %s at offset 0: %s\n", 
+                    bytes_read, fileout, strerror(errno));
+            close(inf);
+            close(outf);
+            return 4;
+        }
+        bytes_copied += bytes_written;
+        bytes_read = read( inf, (void *)buf, COPYBUFSIZE);
+    }
+    if (bytes_read < 0) {
+        fprintf(stderr, "Error at reading input file %s from offset %llu: %s\n", 
+                filein, bytes_copied, strerror(errno));
+        close(inf);
+        close(outf);
+        return 2;
+    }
+    if (verbose>1) printf("  copied %llu (0x%llx) bytes of data into %s\n", bytes_copied, bytes_copied, fileout);
+
+    close(inf);
+    close(outf);
+
+    return 0;
+}
+
+
+/** Return error (-1) if timesteps in input is NOT >= than timesteps in output.
+ */
+int check_timesteps(void) {
+    struct adios_index_process_group_struct_v1 * pg;
+    uint32_t ts_start_in, ts_end_in;
+    uint32_t ts_start_out, ts_end_out;
+    if (verbose>1) printf("Check timesteps\n");
+
+    if (out_pg_root == NULL) return 0;
+
+    pg = out_pg_root;
+    ts_start_out = pg->time_index;
+    while (pg->next) pg = pg->next; 
+    ts_end_out = pg->time_index;
+
+    pg = in_pg_root;
+    ts_start_in = pg->time_index;
+    while (pg->next) pg = pg->next; 
+    ts_end_in = pg->time_index;
+
+    if (verbose) { 
+        printf("Timesteps in output file: %u - %u\n", ts_start_out, ts_end_out);
+        printf("Timesteps in input  file: %u - %u\n", ts_start_in, ts_end_in);
+    }
+
+    if (ts_start_in < ts_end_out) {
+        fprintf(stderr, "Error: Timesteps in input file should be >= than last timestep in output file\n");
+        return 1;
+    }
+
+    return 0;
+}
+
+/** Recalculate offsets of input to the position in output. 
+  * That is, add out_bp->pg_index_offset to all offsets.
+  */
+void recalc_offsets(void) {
+    struct adios_index_process_group_struct_v1 * pg = in_pg_root;
+    struct adios_index_var_struct_v1       * vg = in_vars_root;
+    struct adios_index_attribute_struct_v1 * ag = in_attrs_root;
+    int i, start, count;
+
+    // process group offsets
+    if (verbose) printf("Recalc offsets for new process groups\n");
+    while (pg) {
+        pg->offset_in_file += out_bp->pg_index_offset;
+        pg = pg->next;
+    }
+
+    // variable characteristics offsets
+    if (verbose) printf("Recalc offsets for new variable characteristics\n");
+    while (vg) {
+        start = 0;
+        count = 0;
+        for (i=0; i < vg->characteristics_count; i++) {
+            vg->characteristics[i].offset += out_bp->pg_index_offset;
+        }
+        vg = vg->next;
+    }
+
+    // attribute characteristics offsets
+    if (verbose) printf("Recalc offsets for new attribute characteristics\n");
+    while (ag) {
+        start = 0;
+        count = 0;
+        for (i=0; i < ag->characteristics_count; i++) {
+            ag->characteristics[i].offset += out_bp->pg_index_offset;
+        }
+        ag = ag->next;
+    }
+}
+
+/** Recover output file if something went bad during the append.
+  */
+int recover(int f) {
+    // Append input indexes into the output indexes
+    char * buffer = 0;
+    uint64_t buffer_size = 0;
+    uint64_t buffer_offset = 0;
+    uint64_t index_start = out_bp->pg_index_offset;
+    off_t pos;
+    ssize_t bytes_written;
+
+    fprintf(stderr, "Recover original output after error in append...\n");
+
+    // seek back to the point where the original index was in the output file
+    pos = lseek64 (f, out_bp->pg_index_offset, SEEK_SET); 
+    if ( pos == (off_t)-1 ) {
+        fprintf(stderr, "  Error at seeking to the original index position in the output file: %s\n", strerror(errno));
+        return 1;
+    }
+
+    // write old index into a buffer
+    adios_write_index_v1 (&buffer, &buffer_size, &buffer_offset, index_start, 
+                          out_pg_root, out_vars_root, out_attrs_root);
+    if (verbose>1) fprintf(stderr, "  original index size %llu 0x%llx\n", buffer_offset, buffer_offset);
+    adios_write_version_v1 (&buffer, &buffer_size, &buffer_offset);
+
+    // write index buffer out
+    if (verbose>1) fprintf(stderr, "  write %llu 0x%llx bytes of indexes...\n", buffer_offset, buffer_offset);
+    bytes_written = write (f, buffer, buffer_offset);
+    free(buffer);
+    if (bytes_written == -1) {
+        fprintf(stderr, "  Error at writing original index into output file: %s\n", strerror(errno));
+        return 2;
+    }
+    if (bytes_written != buffer_offset) {
+        fprintf(stderr, "  Error: could not write complete original index into output file: %llu bytes from %llu\n"
+                "Index in output file will be damaged.\n",
+                bytes_written, buffer_offset);
+        return 2;
+    }
+
+    // truncate file back to original size
+    if ( (ftruncate( f, out_bp->pg_index_offset + bytes_written)) == -1) {
+        fprintf(stderr, "  Error: Could not truncate output file back to original size: %s\n", strerror(errno));
+        return 3;
+    }
+
+    return 0;
+}
+
+/** Write the output file.
+ *   copy data from input file into the output
+ *   write out merged indexes
+ *   write out version
+ *
+ *  FIXME: how should we copy if endianness should be changed?
+ */
+#define COPYBUFSIZE 1024
+int append_in_to_out( const char *fileout, const char *filein) {
+    int f;
+    // open file
+    if (verbose) printf("Write data to output file %s\n", fileout);
+    errno = 0;
+    f = open64( fileout, O_WRONLY);
+    if (f == -1) {
+        fprintf(stderr, "Cannot open output file %s: %s\n", fileout, strerror(errno));
+        return 1;
+    }
+   
+    // copy data
+    char buf[COPYBUFSIZE];
+    ssize_t bytes_read, bytes_written;
+    uint64_t bytes_to_copy = in_bp->pg_index_offset; // all groups in input but no indexes
+    uint64_t bytes_copied  = 0;
+    off_t    pos;
+    lseek64 (in_bp->f, 0, SEEK_SET);
+    if (verbose>1) 
+        printf("  seek in output to end of group data, %llu (0x%llx) \n", 
+                out_bp->pg_index_offset, out_bp->pg_index_offset);
+    pos = lseek64 (f, out_bp->pg_index_offset, SEEK_SET); // seek behind groups, overwrite old index
+    if (pos != out_bp->pg_index_offset) {
+            fprintf(stderr, "Error: cannot seek to offset %llu (0x%llx) in file %s: %s\n", 
+                    out_bp->pg_index_offset, out_bp->pg_index_offset, filein, strerror(errno));
+            close(f);
+            return 2;
+    }
+    if (verbose>1) printf("  copy data from input file, %llu bytes\n", in_bp->pg_index_offset);
+    while (bytes_copied < bytes_to_copy) {
+        bytes_read = read( in_bp->f, (void *)buf, COPYBUFSIZE);
+        if (bytes_read < 0) {
+            fprintf(stderr, "Error at reading input file %s from offset %llu: %s\n", 
+                    filein, bytes_copied, strerror(errno));
+            recover(f);
+            close(f);
+            return 3;
+        } else if (bytes_read == 0) {
+            fprintf(stderr, "Error unexpected end of input file %s at offset %llu: %s\n", 
+                    filein, bytes_copied, strerror(errno));
+            recover(f);
+            close(f);
+            return 4;
+        }
+        // check to not to copy too much
+        if (bytes_copied + bytes_read > bytes_to_copy)
+            bytes_read = bytes_to_copy - bytes_copied;
+
+        bytes_written = write( f, (void *) buf, bytes_read);
+        if (bytes_written != bytes_read) {
+            fprintf(stderr, "Error: could not write %d bytes to output file %s at offset %llu: %s\n", 
+                    bytes_read, fileout, out_bp->pg_index_offset+bytes_copied, strerror(errno));
+            recover(f);
+            close(f);
+            return 4;
+        }
+
+        bytes_copied += bytes_written;
+    }
+    if (verbose>1) printf("  written %llu (0x%llx) bytes of data into %s\n", bytes_copied, bytes_copied, fileout);
+
+    // Append input indexes into the output indexes
+    char * buffer = 0;
+    uint64_t buffer_size = 0;
+    uint64_t buffer_offset = 0;
+    uint64_t index_start =  in_bp->pg_index_offset + out_bp->pg_index_offset;
+
+    if (verbose>1) printf("  index starts at %llu (0x%llx)\n", index_start, index_start);
+
+    // merge in old indicies
+    adios_merge_index_v1 (&out_pg_root, &out_vars_root, &out_attrs_root,
+                          in_pg_root, in_vars_root, in_attrs_root);
+    adios_write_index_v1 (&buffer, &buffer_size, &buffer_offset, index_start, 
+                          out_pg_root, out_vars_root, out_attrs_root);
+    if (verbose>1) printf("  index size %llu 0x%llx\n", buffer_offset, buffer_offset);
+    adios_write_version_v1 (&buffer, &buffer_size, &buffer_offset);
+
+    // write index buffer out
+    if (verbose>1) printf("  write %llu 0x%llx bytes of indexes into %s\n", buffer_offset, buffer_offset, fileout);
+    bytes_written = write (f, buffer, buffer_offset);
+
+    if (verbose>1) printf("  written %llu 0x%llx bytes of indexes into %s\n", bytes_written, bytes_written, fileout);
+
+    // clean up
+    free(buffer);
+    close(f);
+
+    return 0;
+}
+
+int bpappend(char *filein, char *fileout) {
+    int excode = 0;
+    uint32_t from, to;
+    uint32_t maxtime = 1;   // at least there is time=1 (single group) in a bp file
+    struct adios_bp_buffer_struct_v1 * b = 0;
+
+    // open output file if exists, read and parse indexes 
+    excode = read_indexes( fileout, false );
+    if (excode == 128) {
+        // output file does not exist, so just copy input to output
+        return copy_file(filein, fileout);
+    } else if (excode) {
+        return excode; // finish here on error
+    }
+    // we have to append input to output
+
+    // open input file, read and parse indexes 
+    excode = read_indexes( filein, true );
+    if (excode) 
+        return excode; // finish here on error
+
+    // check if timesteps of input >= timesteps already in output 
+    excode = check_timesteps();
+    if (excode)
+        return excode; // finish here on error
+
+    // recalculate offsets for the new data
+    recalc_offsets();
+
+    // append input to output file
+    excode = append_in_to_out(fileout, filein);  // filein just for error messages
+
+    return excode;
+}
+
+void cleanup(void) {
+    if (!in_bp)
+         adios_posix_close_internal (in_bp);
+    if (!outf)
+         close (outf);
+
+}
diff --git a/utils/bpsplit/bpgettime.c b/utils/bpsplit/bpgettime.c
new file mode 100644
index 0000000..e8faf53
--- /dev/null
+++ b/utils/bpsplit/bpgettime.c
@@ -0,0 +1,204 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/*
+   BPGETTIME: Determine number of timesteps in a timestepped BP file
+
+   Author: Norbert Podhorszki, pnorbert at ornl.gov
+
+**/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+#ifndef __USE_LARGEFILE64
+#define __USE_LARGEFILE64
+#endif
+
+#include <sys/types.h> 
+#include <unistd.h>  
+#include <fcntl.h>  // open64
+#include <sys/stat.h> // S_IRUSR and alike
+#include <errno.h>
+
+#ifndef _GNU_SOURCE
+#   define _GNU_SOURCE
+#endif
+
+#include <string.h>
+#include <getopt.h>
+
+#include "adios_types.h"
+#include "adios_transport_hooks.h"
+#include "adios_bp_v1.h"
+#include "adios_internals.h"
+
+#ifndef strndup   //HAVE_STRNDUP
+#  define strndup(str,len) strdup(str)
+#endif
+
+#define DIVIDER "========================================================\n"
+
+
+typedef int bool;
+#define true 1
+#define false 0
+
+/** Prototypes */
+int bpgettime(char *filein);
+
+/** Global variables */
+int verbose   = 0;            // 1: print log to stdout, 2: debug 
+bool simple_output  = false;  // true: simple print for scripts to use: min max format
+
+
+struct option options[] = {
+    {"help",        no_argument,       NULL, 'h'},
+    {"verbose",     no_argument,       NULL, 'v'},
+    {"simple",      no_argument,       NULL, 's'},
+    {NULL,          0,                 NULL, 0}
+};
+
+static const char *optstring = "+hvs";
+
+char *prgname; /* argv[0] */
+
+
+void display_help() {
+   printf(
+"Usage: %s [-h | --help] [-v | --verbose] [-s | --simple] bpfile \n"
+"\n"
+"Print the number of timesteps available in the BP file\n"
+"\n"
+"  --help    | -h  Print this help.\n"
+"  --verbose | -v  Log activity about what this program is doing.\n"
+"                  Extra -v increases the number of messages.\n"
+"  --simple  | -s  Simple output for scripts:  min max\n"
+"\n"
+,prgname
+);
+
+}
+
+
+/** Main */
+int main( int argc, char *argv[] ) {
+    int excode;
+    char *filein  = NULL;
+
+    prgname = strdup(argv[0]);
+
+    /* other variables */
+    int c, last_c='_';
+    int idx = 1;
+    /* Process the arguments */
+    while ((c = getopt_long(argc, argv, optstring, options, NULL)) != -1) {
+        switch (c) {
+        case 'h':
+            display_help();
+            return 0;
+        case 'v':
+            verbose++;
+            break;
+        case 's':
+            simple_output=true;
+            break;
+        case 1:
+            /* This means a field is unknown, could be multiple arg (we do not have such)
+               or bad arg*/
+            /*
+            if (last_c=='z') {
+                // process additional argument; 
+            }*/
+            /* else { Unknown param } */
+            fprintf(stderr, "Unrecognized argument: %s\n", optarg);
+            return 1;
+        default:
+            printf ("\nError: Unknown command line option: %s\n\n", argv[optind]);
+            display_help();
+            exit (1);
+            break;
+        } /* end switch */
+        last_c = c;
+        idx++;
+    } /* end while */
+
+    if (argc >= optind+1) {
+        // Read the required arguments
+        filein  = strndup(argv[optind], 256);
+    } else {
+        display_help();
+        return 1;
+    }
+
+    /* Do the work */
+    excode = bpgettime(filein);
+
+    return excode; 
+}
+
+
+/** Read the indexes from the input file and parse them into the in_* structs 
+ */
+int bpgettime(char *filename) {
+    struct adios_bp_buffer_struct_v1           * in_bp         = 0;
+    struct adios_index_process_group_struct_v1 * in_pg_root    = 0;
+    struct adios_index_process_group_struct_v1 * pg = 0;
+    uint32_t ts_min=0, ts_max=0, ngroups=0;
+    int excode = 0;
+    uint32_t version = 0;
+    int rc = 0;
+
+    // init bp struct for reading
+    in_bp = malloc (sizeof (struct adios_bp_buffer_struct_v1));
+    adios_buffer_struct_init (in_bp);
+
+    // open infile 
+    rc = adios_posix_open_read_internal (filename, "", in_bp);
+    if (!rc) {
+        fprintf (stderr, "%s: file not found: %s\n", prgname, filename);
+        return 2;
+    }
+
+    // read version
+    adios_posix_read_version (in_bp);
+    adios_parse_version (in_bp, &version);
+
+    // read and parse process group index
+    adios_posix_read_index_offsets (in_bp);
+    adios_parse_index_offsets_v1 (in_bp);
+    adios_posix_read_process_group_index (in_bp);
+    adios_parse_process_group_index_v1 (in_bp, &in_pg_root);
+
+    // close file
+    adios_posix_close_internal (in_bp);
+    
+    // get the smallest timestep (= timestep of first process group)
+    // get the largest timestep (= timestep of last process group)
+    pg = in_pg_root;
+    ts_min = pg->time_index;
+    ngroups = 0;
+    while (pg) {
+        ts_max = pg->time_index;
+        ngroups++;
+        pg = pg->next; 
+    }
+    
+    if (!simple_output) { 
+        printf("Smallest timestep: %u\n", ts_min);
+        printf("Largest timestep: %u\n", ts_max);
+        if (verbose) {
+            printf("Number of groups: %u\n", ngroups);
+        }
+    } else {
+        printf("%u %u\n", ts_min, ts_max); 
+    }
+
+    return excode;
+}
+
diff --git a/utils/bpsplit/bpsplit.c b/utils/bpsplit/bpsplit.c
new file mode 100644
index 0000000..770e38e
--- /dev/null
+++ b/utils/bpsplit/bpsplit.c
@@ -0,0 +1,679 @@
+/* 
+ * ADIOS is freely available under the terms of the BSD license described
+ * in the COPYING file in the top level directory of this source distribution.
+ *
+ * Copyright (c) 2008 - 2009.  UT-BATTELLE, LLC. All rights reserved.
+ */
+
+/*
+   BPSPLIT: Carve out some timesteps from a timestepped BP file
+
+   Author: Norbert Podhorszki, pnorbert at ornl.gov
+
+**/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+#ifndef __USE_LARGEFILE64
+#define __USE_LARGEFILE64
+#endif 
+
+#include <sys/types.h> 
+#include <unistd.h>  
+#include <fcntl.h>  // open64
+#include <sys/stat.h> // S_IRUSR and alike
+#include <errno.h>
+
+#ifndef _GNU_SOURCE
+#   define _GNU_SOURCE
+#endif
+
+#include <string.h>
+#include <getopt.h>
+
+#include "adios_types.h"
+#include "adios_transport_hooks.h"
+#include "adios_bp_v1.h"
+#include "adios_internals.h"
+
+#ifndef strndup   //HAVE_STRNDUP
+#  define strndup(str,len) strdup(str)
+#endif
+
+#if defined(__APPLE__) || defined(__WIN32__) 
+#    define lseek64 lseek
+#    define open64  open
+#endif
+
+#define DIVIDER "========================================================\n"
+
+
+typedef int bool;
+#define true 1
+#define false 0
+
+/** Prototypes */
+int bpsplit(char *filein, char *fileout, char *recordfile, int from_in, int to_in, bool skiplast);
+void cleanup(void);
+
+/** Global variables */
+int verbose   = 0;            // 1: print log to stdout, 2: debug 
+
+
+struct option options[] = {
+    {"from",        required_argument, NULL, 'n'},
+    {"to",          required_argument, NULL, 'm'},
+    {"recordfile",  required_argument, NULL, 'r'},
+    {"skiplast",    no_argument,       NULL, 's'},
+    {"help",        no_argument,       NULL, 'h'},
+    {"verbose",     no_argument,       NULL, 'v'},
+    {NULL,          0,                 NULL, 0}
+};
+
+static const char *optstring = "+hvn:m:r:s";
+
+char *prgname; /* argv[0] */
+
+
+void display_help() {
+   printf(
+"Usage: %s [-h | --help] [-v | --verbose] [--from N | -n N] [--to M | -m M]\n"
+"          [--recordfile path | -r path ] [ --skiplast | -s ] \n"
+"          inputfile outputfile\n"
+"\n"
+"Copy some timesteps from a time-stepped BP file into another file.\n"
+"\n"
+"  --help | -h     Print this help.\n"
+"  --verbose | -v  Log activity about what this program is doing.\n"
+"                  Extra -v increases the number of messages.\n"
+"  --from | -n N   Start from Nth timestep. \n"
+"                  Note: BP file timesteps starts from 1.\n"
+"  --to | -m M     Finish at Mth timestep.\n"
+"                  -k means last+k+1 (-1=last)\n"
+"  --recordfile | \n"
+"   -r path        write out last timestep into file <path>\n"
+"  --skiplast      Skip the last timestep (like -m -2)\n"
+"\n"
+"  Default behavior: -n -1 -m -1 \n"
+"\n"
+"  Do not use -r and -n together. If -r is used, bpsplit will examine the\n" 
+"  content of file 'last' and splits all timesteps from inputfile that\n"
+"  are newer (greater) then that timestep\n"
+"\n"
+"  --skiplast would do the same up to the one before last timestep.\n"
+"  This is useful if you expect a process may be still writing in.bp\n"
+,prgname
+);
+
+}
+
+
+/** Main */
+int main( int argc, char *argv[] ) {
+    int excode;
+    int from      = -1;           // split from  'from'. -1=last
+    int to        = -1;           // split until 'to'. -1=last
+    bool skiplast = false;
+    char *filein  = NULL;
+    char *fileout = NULL;       
+    char *recordfile = NULL;      // contains last timestep splitted before
+    bool n_was_set = false;       // test if both n and recordfile is specified 
+
+    prgname = strdup(argv[0]);
+
+    /* other variables */
+    int c, last_c='_';
+    int idx = 1;
+    /* Process the arguments */
+    while ((c = getopt_long(argc, argv, optstring, options, NULL)) != -1) {
+        switch (c) {
+        case 'h':
+            display_help();
+            return 0;
+        case 'v':
+            verbose++;
+            break;
+        case 'n':
+            errno = 0; 
+            from = strtol(optarg, (char **)NULL, 0);
+            if (errno) {
+                fprintf(stderr, "Error: could not convert --from/-n option's value: %s\n", optarg);
+                return 1;
+            }
+            n_was_set=true;
+            break;
+        case 'm':
+            errno = 0; 
+            to = strtol(optarg, (char **)NULL, 0);
+            if (errno) {
+                fprintf(stderr, "Error: could not convert --to/-m option's value: %s\n", optarg);
+                return 1;
+            }
+            break;
+        case 'r':
+            recordfile = strndup(optarg,256);
+            break;
+        case 's':
+            skiplast = true;
+            break;
+        case 1:
+            /* This means a field is unknown, could be multiple arg (we do not have such)
+               or bad arg*/
+            /*
+            if (last_c=='z') {
+                // process additional argument; 
+            }*/
+            /* else { Unknown param } */
+            fprintf(stderr, "Unrecognized argument: %s\n", optarg);
+            return 1;
+        default:
+            printf ("\nError: Unknown command line option after: %s\n\n", argv[optind]);
+            display_help();
+            exit (1);
+            break;
+        } /* end switch */
+        last_c = c;
+        idx++;
+    } /* end while */
+
+    if (argc >= optind+2) {
+        // Read the required arguments
+        filein  = strndup(argv[optind], 256);
+        fileout = strndup(argv[optind+1], 256);
+    } else {
+        display_help();
+        return 1;
+    }
+
+    if (n_was_set && recordfile) {
+        fprintf(stderr, "Error: -n/--from index and -r/--recordfile should not be used together!\n");
+        return 2;
+    }
+
+    /* Do the work */
+    excode = bpsplit(filein, fileout, recordfile, from, to, skiplast);
+    if (excode)
+        cleanup();
+
+    return excode; 
+}
+
+// global vars for the functions below
+//   filein's data structs
+struct adios_bp_buffer_struct_v1           * in_bp         = 0;
+struct adios_index_process_group_struct_v1 * in_pg_root    = 0;
+struct adios_index_var_struct_v1           * vars_root     = 0; // in-place processing will occur
+struct adios_index_attribute_struct_v1     * attrs_root    = 0; // in-place processing will occur
+//   fileout's data structs 
+struct adios_bp_buffer_struct_v1           * out_bp         = 0;
+struct adios_index_process_group_struct_v1 * out_pg_root    = 0;
+uint64_t out_offset_start = 0;  // the beginning offset of group data in in_bp to write out to out_bp
+uint64_t out_offset_end = 0;    // the end offset of group data in in_bp to write out to out_bp
+//   aux variables to contain tail of index chains (for cleanup only)
+struct adios_index_process_group_struct_v1 * tail_pg_root    = 0;
+//   recordfile
+uint32_t lasttime; // timestep written previously into the recordfile
+
+/** Read the indexes from the input file and parse them into the in_* structs 
+ */
+int read_indexes(char *filename) {
+    int excode = 0;
+    uint32_t version = 0;
+    int rc = 0;
+
+    // init bp struct for reading
+    in_bp = malloc (sizeof (struct adios_bp_buffer_struct_v1));
+    adios_buffer_struct_init (in_bp);
+
+    // open infile 
+    rc = adios_posix_open_read_internal (filename, "", in_bp);
+    if (!rc) {
+        fprintf (stderr, "%s: file not found: %s\n", prgname, filename);
+        return 2;
+    }
+
+    // read version
+    adios_posix_read_version (in_bp);
+    adios_parse_version (in_bp, &version);
+
+    // read and parse process group index
+    adios_posix_read_index_offsets (in_bp);
+    adios_parse_index_offsets_v1 (in_bp);
+    adios_posix_read_process_group_index (in_bp);
+    adios_parse_process_group_index_v1 (in_bp, &in_pg_root);
+    
+    // read and parse variable index
+    adios_posix_read_vars_index (in_bp);
+    adios_parse_vars_index_v1 (in_bp, &vars_root);
+
+    // read and parse attribute index
+    adios_posix_read_attributes_index (in_bp);
+    adios_parse_attributes_index_v1 (in_bp, &attrs_root);
+
+    if (verbose>1) {
+        printf (DIVIDER);
+        printf ("Process Groups Index:\n");
+        printf ("End of process groups       = %llu\n", in_bp->end_of_pgs);
+        printf ("Process Groups Index Offset = %llu\n", in_bp->pg_index_offset);
+        printf ("Process Groups Index Size   = %llu\n", in_bp->pg_size);
+        printf ("Variable Index Offset       = %llu\n", in_bp->vars_index_offset);
+        printf ("Variable Index Size         = %llu\n", in_bp->vars_size);
+        printf ("Attribute Index Offset      = %llu\n", in_bp->attrs_index_offset);
+        printf ("Attribute Index Size        = %llu\n", in_bp->attrs_size);
+    }
+
+    return excode;
+}
+
+/** get the largest timestep in the input file (= timestep of last process group) 
+ */
+uint32_t timesteps_available() {
+    struct adios_index_process_group_struct_v1 * pg = in_pg_root;
+    uint32_t ts;
+    while (pg) {
+        ts = pg->time_index;
+        pg = pg->next; 
+    }
+    if (verbose) printf("Largest timestep in input file: %u\n", ts);
+    return ts;
+}
+
+/** get last timestep written into the recordfile (if exist) 
+ *  lasttime is set to the value in the file or 0
+ *  return value is error code, 
+ *  0 on success, 
+ *  -1 if file does not exists (not an error!) 
+ *  1 for failure to read existing file
+ */
+int get_last_time(char *recordfile) {
+    int excode = 0;
+    int n;
+    FILE * rf;
+    lasttime = 0;  // there is at least 1 group with Time=1 in a bp file
+    if (recordfile == NULL) 
+        return 0;
+    if (verbose>1) printf("Try to read recordfile: %s\n", recordfile);
+    rf = fopen( recordfile, "r");
+    if (rf == NULL) 
+        return -1; // no problem, just no such file (yet)
+    if (verbose) printf("Read recordfile: %s\n", recordfile);
+    n = fscanf(rf, "%u\n", &lasttime);
+    if (n != 1) {
+        fprintf(stderr, "Recordfile %s does not contain an unsigned integer value in the first line: %s\n",
+           recordfile, strerror(errno));
+        excode = 1;
+        lasttime = 0;
+    }
+    if (verbose && n==1) printf("Last time from recordfile: %u\n", lasttime);
+    fclose(rf);
+
+    return excode;
+}
+
+/** Write out last timestep into the recordfile.
+ */
+int record_last_time(char *recordfile, int laststep) {
+    FILE * rf;
+    if (recordfile == NULL) 
+        return 0;
+    if (verbose>1) printf("Try to write last step into recordfile: %s\n", recordfile);
+    rf = fopen( recordfile, "w");
+    if (rf == NULL) {
+        fprintf(stderr, "Could not create recordfile %s: %s\n", recordfile, strerror(errno));
+        return 1;
+    }
+    if (verbose) printf("Write step %d into recordfile: %s\n", laststep, recordfile);
+    fprintf( rf, "%u\n", laststep);
+    fclose(rf);
+    return 0;
+}
+
+/** Handle -maxt+1 ... -1 and 1 ... maxt indexes.
+    Return 0 on any other (invalid) indexes
+ */
+uint32_t handle_negative_index( int t, uint32_t maxt, char *var) {
+    int j = t;
+    if (j < 0) {
+        j = maxt + j + 1; // -1 = last, -2 = last-1...
+    }
+    if (j <= 0 || j > maxt) {
+        fprintf(stderr, "Error: %s index %u should be in 1..%u or -%u..-1\n",
+            var, t, maxt, maxt-1);
+        j = 0;
+    }
+    return j;
+}
+
+/** 1. Split in_pg_root index chain to 3 parts (1..from-1, from..to, to+1..end), so that 
+ *    in_pg_root   index chain contains indexes from the beginning
+ *    out_pg_root  index chain contains indexes from 'from' to 'to' timesteps
+ *    tail_pg_root index chain contains anything greater than 'to' timestep
+ *  We assume here that 
+ *     1 <= from <= to 
+ *     the chain is ordered by time
+ *
+ *  2. Also recalculate the offsets of groups to be written out to their future
+ *  position in the output.
+ *
+ *  3. Set the start and end offsets in the input file that contains all groups
+ *  to be copied in out_offset_start and out_offset_end
+ *      out_offset_start   points to the first byte to be copied.
+ *      out_offset_end     points to a byte which is not copied!
+ */
+void split_pg_index( uint32_t from, uint32_t to) {
+    struct adios_index_process_group_struct_v1 * pg = in_pg_root;
+    struct adios_index_process_group_struct_v1 * pg_prev = NULL;
+    int    section=0; // 0=in, 1=out, 2=tail
+    out_offset_start = 0; // default to return if there is nothing to write out too
+    out_offset_end = 0;
+    if (verbose) printf("Split process group index chain\n");
+    while (pg) {
+        if (section == 0 && pg->time_index >= from) {
+            // reached from..to section
+            // start out_pg_root index chain
+            out_pg_root = pg;
+            // this is the starting offset from which data should be copied
+            out_offset_start = pg->offset_in_file;
+            // unlink previous->next pointer to this item
+            if (pg_prev) pg_prev->next = NULL;
+            else in_pg_root = NULL;
+            section = 1;
+            if (verbose>1) printf("  section out starts at time %d\n", pg->time_index);
+        }
+        else if (section < 2 && pg->time_index > to) {
+            // reached to+1.. section
+            // start tail_pg_root index chain
+            tail_pg_root = pg;
+            // unlink previous->next pointer to this item
+            if (pg_prev) pg_prev->next = NULL;
+            else in_pg_root = NULL;
+            if (verbose>1) printf("  section tail starts at time %d\n", pg->time_index);
+            break; // nothing more to look for
+        }
+
+        if (section == 1)  {
+            // recalculate the offset of the outgoing group to the position in the output
+            if (verbose>1) printf("    group time %d offset %lld -> %lld\n", 
+                            pg->time_index, pg->offset_in_file, pg->offset_in_file - out_offset_start);
+            pg->offset_in_file -= out_offset_start;
+        }
+
+        pg_prev = pg;
+        pg = pg->next; 
+    }
+
+    // determine the out_offset
+    if (tail_pg_root) 
+        out_offset_end = tail_pg_root->offset_in_file; // end points to a byte which is not copied!
+    else
+        out_offset_end = in_bp->pg_index_offset; // pg index is right after all the pg data in the bp file
+    if (verbose>1) printf("  offset start = %llu  end = %llu\n", out_offset_start, out_offset_end);
+}
+
+/** Determine the start and beginning offsets in input file (of groups) that should be
+ *  copied into output file.
+ *  out_offset_start points to the first byte to be copied.
+ *  out_offset_end points to a byte which is not copied!
+ */
+/*
+void determine_pg_offsets() {
+    // determine offsets
+    if (verbose) printf("Determine process group offsets\n");
+    if (out_pg_root) {
+        out_offset_start = out_pg_root->offset_in_file;
+        if (tail_pg_root) 
+            out_offset_end = tail_pg_root->offset_in_file; // end points to a byte which is not copied!
+        else
+            out_offset_end = in_bp->pg_index_offset; // pg index is right after all the pg data in the bp file
+    } else {
+        out_offset_start = 0;
+        out_offset_end = 0;
+    }
+    if (verbose>1) printf("  offset start = %llu  end = %llu\n", out_offset_start, out_offset_end);
+}
+*/
+
+/** Remove all characteristics from variable and attr indexes that fall outside 
+ *  the offsets to be written out. Also recalculate the offsets of characteristics
+ *  to their future position in the output. 
+ *  Call after split_pg_index()
+ */
+void weed_out_indexes(void) {
+    struct adios_index_var_struct_v1       * vg = vars_root;
+    struct adios_index_var_struct_v1       * vg_prev = NULL;
+    struct adios_index_attribute_struct_v1 * ag = attrs_root;
+    struct adios_index_attribute_struct_v1 * ag_prev = NULL;
+    int i, start, count;
+    
+    // process variables
+    if (verbose) printf("Weed out characteristics from variables\n");
+    while (vg) {
+        // look for those characteristics that are within our offsets
+        start = 0;
+        count = 0; 
+        for (i=0; i < vg->characteristics_count; i++) {
+            if (vg->characteristics[i].offset < out_offset_start)
+                start++;
+            else if (vg->characteristics[i].offset >= out_offset_start && 
+                     vg->characteristics[i].offset <= out_offset_end) {
+                // recalc offset for output offset
+                vg->characteristics[i].offset -= out_offset_start; 
+                count++;
+            } else
+                break;
+        }
+        if (verbose>1)
+            printf("    Var %s/%s: characteristics start=%d, count=%d to be kept\n", 
+                    vg->var_path, vg->var_name, start, count);
+        if (start > 0) {
+            for (i=0; i<count; i++)   // shift valid characteristics to the beginning of the array
+                vg->characteristics[i] = vg->characteristics[start+i];
+        }
+        vg->characteristics_count = count;
+        if (count == 0) {
+            // no characteristics <=> this variable is not contained in the output slice
+            // take it out from the chain
+            if (vg_prev != NULL) vg_prev->next = vg->next;
+            else vars_root = vg->next;
+        } else {
+            vg_prev = vg; // advance prev only if this variable is kept in chain
+        }
+        vg = vg->next;
+    }
+
+    // process attributes
+    if (verbose) printf("Weed out characteristics from attributes\n");
+    while (ag) {
+        // look for those characteristics that are within our offsets
+        start = 0;
+        count = 0; 
+        for (i=0; i < ag->characteristics_count; i++) {
+            if (ag->characteristics[i].offset < out_offset_start)
+                start++;
+            else if (ag->characteristics[i].offset >= out_offset_start && 
+                     ag->characteristics[i].offset <= out_offset_end) {
+                // recalc offset for output offset
+                ag->characteristics[i].offset -= out_offset_start; 
+                count++;
+            } else
+                break;
+        }
+        if (verbose>1)
+            printf("    Attr %s/%s: characteristics start=%d, count=%d to be kept\n", 
+                ag->attr_path, ag->attr_name, start, count);
+        if (start > 0) {
+            for (i=0; i<count; i++) 
+                ag->characteristics[i] = ag->characteristics[start+i];
+        }
+        ag->characteristics_count = count;
+        if (count == 0) {
+            // no characteristics <=> this attribute is not contained in the output slice
+            // take it out from the chain
+            if (ag_prev != NULL) ag_prev->next = ag->next;
+            else attrs_root = ag->next;
+        } else {
+            ag_prev = ag; // advance prev only if this attribute is kept in chain
+        }
+        ag = ag->next;
+    }
+}
+
+/** Write the output file.
+ *   copy data from input file from min offset to max offset
+ *   write out indexes
+ *   write out version
+ *
+ *  FIXME: how should we copy if endianness should be changed?
+ */
+#define COPYBUFSIZE 1024
+int write_out( const char *fileout, const char *filein) {
+    int f;
+    // open file
+    if (verbose) printf("Write data to output file %s\n", fileout);
+    errno = 0;
+    f = open64( fileout, O_WRONLY | O_CREAT | O_TRUNC,
+                S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH
+              );
+    if (f == -1) {
+        fprintf(stderr, "Cannot open output file %s: %s\n", fileout, strerror(errno));
+        return 1;
+    }
+   
+    // copy data
+    char buf[COPYBUFSIZE];
+    ssize_t bytes_read, bytes_written;
+    uint64_t bytes_to_copy = out_offset_end - out_offset_start; // end byte should not be copied
+    uint64_t bytes_copied  = 0;
+    if (verbose>1) printf("  seek in input file to %llu\n", out_offset_start);
+    lseek64 (in_bp->f, out_offset_start, SEEK_SET);
+    while (bytes_copied < bytes_to_copy) {
+        bytes_read = read( in_bp->f, (void *)buf, COPYBUFSIZE);
+        if (bytes_read < 0) {
+            fprintf(stderr, "Error at reading input file %s from offset %llu: %s\n", 
+                    filein, out_offset_start+bytes_copied, strerror(errno));
+            close(f);
+            return 2;
+        } else if (bytes_read == 0) {
+            fprintf(stderr, "Error unexpected end of input file %s at offset %llu: %s\n", 
+                    filein, out_offset_start+bytes_copied, strerror(errno));
+            close(f);
+            return 3;
+        }
+        // check to not to copy too much
+        if (bytes_copied + bytes_read > bytes_to_copy)
+            bytes_read = bytes_to_copy - bytes_copied;
+
+        bytes_written = write( f, (void *) buf, bytes_read);
+        if (bytes_written != bytes_read) {
+            fprintf(stderr, "Error: could not write %d bytes to output file %s at offset %llu: %s\n", 
+                    bytes_read, fileout, out_offset_start+bytes_copied, strerror(errno));
+            close(f);
+            return 4;
+        }
+
+        bytes_copied += bytes_written;
+    }
+    if (verbose>1) printf("  written %llu %llx bytes of data into %s\n", bytes_copied, bytes_copied, fileout);
+
+    // write indexes and version into a buffer
+    char * buffer = NULL;
+    uint64_t buffer_size = 0;
+    uint64_t buffer_offset = 0;
+    adios_write_index_v1 (&buffer, &buffer_size, &buffer_offset, bytes_copied,
+                          out_pg_root, vars_root, attrs_root);
+    if (verbose>1) printf("  index size %llu 0x%llx\n", buffer_offset, buffer_offset);
+    adios_write_version_v1 (&buffer, &buffer_size, &buffer_offset);
+
+    // write buffer out
+    if (verbose>1) printf("  write %llu 0x%llx bytes of indexes into %s\n", buffer_offset, buffer_offset, fileout);
+    bytes_written = write (f, buffer, buffer_offset);
+
+    if (verbose>1) printf("  written %llu 0x%llx bytes of indexes into %s\n", bytes_written, bytes_written, fileout);
+
+    // clean up
+    free(buffer);
+    close(f);
+
+    return 0;
+}
+
+int bpsplit(char *filein, char *fileout, char *recordfile, int from_in, int to_in, bool skiplast) {
+    int excode = 0;
+    uint32_t from, to;
+    uint32_t maxtime = 1;   // at least there is time=1 (single group) in a bp file
+    struct adios_bp_buffer_struct_v1 * b = 0;
+
+    // open input file, read and parse indexes 
+    excode = read_indexes( filein );
+    if (excode) 
+        return excode; // finish here on error
+    maxtime = timesteps_available();
+
+    // get last timestep from recordfile (if exists)
+    excode = get_last_time(recordfile);
+    if (excode > 0) // -1 is not an error
+        return excode; // finish here on error
+    if (excode == -1)
+        from = 1;  // nothing in recordfile, so we start from beginning
+    if (lasttime >= maxtime) {
+        fprintf(stderr, "Error: last timestep recorded in recordfile %s (%u) >= maxtime %u. No output file is created\n",
+            recordfile, lasttime, maxtime);
+        return 5; // finish here on error
+    }
+    // if recordfile was given, it's content is stronger than from, to!
+    if (lasttime > 0) {
+        from = lasttime+1;
+    }
+
+
+    // set from and to correctly now (handle negative values)
+    //  type is converted from int to uint32_t at this point
+    if (!recordfile) 
+        from = handle_negative_index(from_in, maxtime, "from");
+    to  = handle_negative_index(to_in, maxtime, "to");
+    // handle skiplast option
+    if (skiplast && to == maxtime) {
+        if (verbose) printf("Skip-last option applied.\n");
+        to--;
+    }
+    if (verbose) printf("Indexes from %u to %u\n", from, to);
+    if (from == 0 || to == 0)
+        return 4; // finish here on error
+    if (from > to) {
+        fprintf(stderr, "Error: From index evaluated %d > to index evaluated %d.\n", from, to);
+        return 4; // finish here on error
+    }
+
+    if (lasttime >= to) {
+        fprintf(stderr, "Error: To index %u <=  what was recorded in recordfile %s (%u).\n",
+            to, recordfile, lasttime);
+        return 6; // exit with error, because no output file will be created.
+    }
+
+    // split in_pg_root index chain to in*, out* and tail*  (1..from-1, from..to, to+1..end)
+    // also get min and max offset we have to copy
+    split_pg_index( from, to);
+    if (out_offset_start == out_offset_end) {
+        fprintf(stderr, "Error: Nothing to write out. File is not created.\n");
+        return 7;
+    }
+    weed_out_indexes();     // remove things from vars and attrs referring outside the offsets
+    
+    // write output file
+    excode = write_out(fileout, filein);  // filein just for error messages
+    if (excode > 0) 
+        return excode; // finish here on error
+
+    // write recordfile (if exists)
+    excode = record_last_time( recordfile, to);
+
+    return excode;
+}
+
+void cleanup(void) {
+    if (!in_bp)
+         adios_posix_close_internal (in_bp);
+
+}
diff --git a/utils/gpp/Makefile.am b/utils/gpp/Makefile.am
new file mode 100644
index 0000000..5331e12
--- /dev/null
+++ b/utils/gpp/Makefile.am
@@ -0,0 +1,2 @@
+dist_bin_SCRIPTS = gpp.py xmlparser.py gpp_types.py
+
diff --git a/utils/gpp/Makefile.in b/utils/gpp/Makefile.in
new file mode 100644
index 0000000..de318e7
--- /dev/null
+++ b/utils/gpp/Makefile.in
@@ -0,0 +1,470 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = utils/gpp
+DIST_COMMON = $(dist_bin_SCRIPTS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/ac_dart.m4 \
+	$(top_srcdir)/config/ac_datatap.m4 \
+	$(top_srcdir)/config/ac_dimes.m4 \
+	$(top_srcdir)/config/ac_dmalloc.m4 \
+	$(top_srcdir)/config/ac_hdf5.m4 \
+	$(top_srcdir)/config/ac_infiniband.m4 \
+	$(top_srcdir)/config/ac_mxml.m4 \
+	$(top_srcdir)/config/ac_nc4par.m4 \
+	$(top_srcdir)/config/ac_netcdf.m4 \
+	$(top_srcdir)/config/ac_nssi.m4 \
+	$(top_srcdir)/config/ac_pablo.m4 \
+	$(top_srcdir)/config/ac_phdf5.m4 \
+	$(top_srcdir)/config/ac_portals.m4 \
+	$(top_srcdir)/config/acx_mpi.m4 \
+	$(top_srcdir)/config/acx_pthread.m4 \
+	$(top_srcdir)/config/cercs.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+dist_binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+SCRIPTS = $(dist_bin_SCRIPTS)
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ADIOSLIB_CFLAGS = @ADIOSLIB_CFLAGS@
+ADIOSLIB_CPPFLAGS = @ADIOSLIB_CPPFLAGS@
+ADIOSLIB_EXTRA_CPPFLAGS = @ADIOSLIB_EXTRA_CPPFLAGS@
+ADIOSLIB_LDADD = @ADIOSLIB_LDADD@
+ADIOSLIB_LDFLAGS = @ADIOSLIB_LDFLAGS@
+ADIOSLIB_SEQ_CFLAGS = @ADIOSLIB_SEQ_CFLAGS@
+ADIOSLIB_SEQ_CPPFLAGS = @ADIOSLIB_SEQ_CPPFLAGS@
+ADIOSLIB_SEQ_LDADD = @ADIOSLIB_SEQ_LDADD@
+ADIOSLIB_SEQ_LDFLAGS = @ADIOSLIB_SEQ_LDFLAGS@
+ADIOSREADLIB_CFLAGS = @ADIOSREADLIB_CFLAGS@
+ADIOSREADLIB_CPPFLAGS = @ADIOSREADLIB_CPPFLAGS@
+ADIOSREADLIB_LDADD = @ADIOSREADLIB_LDADD@
+ADIOSREADLIB_LDFLAGS = @ADIOSREADLIB_LDFLAGS@
+ADIOSREADLIB_SEQ_CFLAGS = @ADIOSREADLIB_SEQ_CFLAGS@
+ADIOSREADLIB_SEQ_CPPFLAGS = @ADIOSREADLIB_SEQ_CPPFLAGS@
+ADIOSREADLIB_SEQ_LDADD = @ADIOSREADLIB_SEQ_LDADD@
+ADIOSREADLIB_SEQ_LDFLAGS = @ADIOSREADLIB_SEQ_LDFLAGS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_FORTRAN_FALSE = @BUILD_FORTRAN_FALSE@
+BUILD_FORTRAN_TRUE = @BUILD_FORTRAN_TRUE@
+BUILD_WRITE_FALSE = @BUILD_WRITE_FALSE@
+BUILD_WRITE_TRUE = @BUILD_WRITE_TRUE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CSH = @CSH@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DART_CPPFLAGS = @DART_CPPFLAGS@
+DART_LDFLAGS = @DART_LDFLAGS@
+DART_LIBS = @DART_LIBS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIMES_CPPFLAGS = @DIMES_CPPFLAGS@
+DIMES_LDFLAGS = @DIMES_LDFLAGS@
+DIMES_LIBS = @DIMES_LIBS@
+DMALLOC_CPPFLAGS = @DMALLOC_CPPFLAGS@
+DMALLOC_LDFLAGS = @DMALLOC_LDFLAGS@
+DMALLOC_LIBS = @DMALLOC_LIBS@
+DT_CPPFLAGS = @DT_CPPFLAGS@
+DT_LDFLAGS = @DT_LDFLAGS@
+DT_LIBS = @DT_LIBS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCLIBS = @FCLIBS@
+FFLAGS = @FFLAGS@
+HAVE_DART_FALSE = @HAVE_DART_FALSE@
+HAVE_DART_TRUE = @HAVE_DART_TRUE@
+HAVE_DATATAP_FALSE = @HAVE_DATATAP_FALSE@
+HAVE_DATATAP_TRUE = @HAVE_DATATAP_TRUE@
+HAVE_DIMES_FALSE = @HAVE_DIMES_FALSE@
+HAVE_DIMES_TRUE = @HAVE_DIMES_TRUE@
+HAVE_DMALLOC_FALSE = @HAVE_DMALLOC_FALSE@
+HAVE_DMALLOC_TRUE = @HAVE_DMALLOC_TRUE@
+HAVE_HDF5_FALSE = @HAVE_HDF5_FALSE@
+HAVE_HDF5_TRUE = @HAVE_HDF5_TRUE@
+HAVE_INFINIBAND_FALSE = @HAVE_INFINIBAND_FALSE@
+HAVE_INFINIBAND_TRUE = @HAVE_INFINIBAND_TRUE@
+HAVE_MPI_FALSE = @HAVE_MPI_FALSE@
+HAVE_MPI_TRUE = @HAVE_MPI_TRUE@
+HAVE_MXML_FALSE = @HAVE_MXML_FALSE@
+HAVE_MXML_TRUE = @HAVE_MXML_TRUE@
+HAVE_NC4PAR_FALSE = @HAVE_NC4PAR_FALSE@
+HAVE_NC4PAR_TRUE = @HAVE_NC4PAR_TRUE@
+HAVE_NETCDF_FALSE = @HAVE_NETCDF_FALSE@
+HAVE_NETCDF_TRUE = @HAVE_NETCDF_TRUE@
+HAVE_NSSI_FALSE = @HAVE_NSSI_FALSE@
+HAVE_NSSI_TRUE = @HAVE_NSSI_TRUE@
+HAVE_PABLO_FALSE = @HAVE_PABLO_FALSE@
+HAVE_PABLO_TRUE = @HAVE_PABLO_TRUE@
+HAVE_PHDF5_FALSE = @HAVE_PHDF5_FALSE@
+HAVE_PHDF5_TRUE = @HAVE_PHDF5_TRUE@
+HAVE_PORTALS_FALSE = @HAVE_PORTALS_FALSE@
+HAVE_PORTALS_TRUE = @HAVE_PORTALS_TRUE@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+INFINIBAND_CFLAGS = @INFINIBAND_CFLAGS@
+INFINIBAND_CPPFLAGS = @INFINIBAND_CPPFLAGS@
+INFINIBAND_HEADER = @INFINIBAND_HEADER@
+INFINIBAND_LDFLAGS = @INFINIBAND_LDFLAGS@
+INFINIBAND_LIBS = @INFINIBAND_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MPICC = @MPICC@
+MPICXX = @MPICXX@
+MPIFC = @MPIFC@
+MPILIBS = @MPILIBS@
+MXML_CPPFLAGS = @MXML_CPPFLAGS@
+MXML_LDFLAGS = @MXML_LDFLAGS@
+MXML_LIBS = @MXML_LIBS@
+NC4PAR_CPPFLAGS = @NC4PAR_CPPFLAGS@
+NC4PAR_LDFLAGS = @NC4PAR_LDFLAGS@
+NC4PAR_LIBS = @NC4PAR_LIBS@
+NEED_DARWIN_SINGLE_MODULE_FALSE = @NEED_DARWIN_SINGLE_MODULE_FALSE@
+NEED_DARWIN_SINGLE_MODULE_TRUE = @NEED_DARWIN_SINGLE_MODULE_TRUE@
+NETCDF_CPPFLAGS = @NETCDF_CPPFLAGS@
+NETCDF_LDFLAGS = @NETCDF_LDFLAGS@
+NETCDF_LIBS = @NETCDF_LIBS@
+NSSI_BUILDDIR = @NSSI_BUILDDIR@
+NSSI_CFLAGS = @NSSI_CFLAGS@
+NSSI_CPPFLAGS = @NSSI_CPPFLAGS@
+NSSI_LDFLAGS = @NSSI_LDFLAGS@
+NSSI_LIBS = @NSSI_LIBS@
+NSSI_SERVER_LIBS = @NSSI_SERVER_LIBS@
+NSSI_SRCDIR = @NSSI_SRCDIR@
+OBJEXT = @OBJEXT@
+PABLO_CPPFLAGS = @PABLO_CPPFLAGS@
+PABLO_LDFLAGS = @PABLO_LDFLAGS@
+PABLO_LIBS = @PABLO_LIBS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATHPROG = @PATHPROG@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PHDF5_CPPFLAGS = @PHDF5_CPPFLAGS@
+PHDF5_LDFLAGS = @PHDF5_LDFLAGS@
+PHDF5_LIBS = @PHDF5_LIBS@
+PORTALS_CFLAGS = @PORTALS_CFLAGS@
+PORTALS_CPPFLAGS = @PORTALS_CPPFLAGS@
+PORTALS_HEADER = @PORTALS_HEADER@
+PORTALS_LDFLAGS = @PORTALS_LDFLAGS@
+PORTALS_LIBS = @PORTALS_LIBS@
+PORTALS_NAL_HEADER = @PORTALS_NAL_HEADER@
+PORTALS_RT_HEADER = @PORTALS_RT_HEADER@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+RESEARCH_TRANSPORTS_FALSE = @RESEARCH_TRANSPORTS_FALSE@
+RESEARCH_TRANSPORTS_TRUE = @RESEARCH_TRANSPORTS_TRUE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_PARALLEL_COMPILER_FALSE = @USE_PARALLEL_COMPILER_FALSE@
+USE_PARALLEL_COMPILER_TRUE = @USE_PARALLEL_COMPILER_TRUE@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+dist_bin_SCRIPTS = gpp.py xmlparser.py gpp_types.py
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  utils/gpp/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  utils/gpp/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-dist_binSCRIPTS: $(dist_bin_SCRIPTS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+	@list='$(dist_bin_SCRIPTS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  if test -f $$d$$p; then \
+	    f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+	    echo " $(dist_binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	    $(dist_binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
+	  else :; fi; \
+	done
+
+uninstall-dist_binSCRIPTS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(dist_bin_SCRIPTS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
+	done
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-dist_binSCRIPTS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-dist_binSCRIPTS uninstall-info-am
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	distclean distclean-generic distclean-libtool distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dist_binSCRIPTS \
+	install-exec install-exec-am install-info install-info-am \
+	install-man install-strip installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am uninstall uninstall-am uninstall-dist_binSCRIPTS \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/utils/gpp/gpp.py b/utils/gpp/gpp.py
new file mode 100755
index 0000000..db8efc8
--- /dev/null
+++ b/utils/gpp/gpp.py
@@ -0,0 +1,41 @@
+#! /usr/bin/python
+import os
+import sys
+import xml.dom.minidom
+import dircache
+import xmlparser 
+from time import sleep
+
+currentdir=os.curdir
+def callback(arg, dirname,fnames):
+    for filename in fnames: #os.listdir(dirname):
+        if(filename.endswith(".F90") or filename.endswith(".f90") or filename.endswith(".F95")
+            or filename.endswith(".f95") or filename.endswith(".c")):
+           arg.append(filename)
+
+def main(argv=None):
+    global vardict
+    vardict = xmlparser.getVarlistFromXML(sys.argv[1])
+    for fname in vardict:
+        #line=xmlparser.sizestr[fname]
+        line = ""
+        if(xmlparser.language_group_dict[fname]==1):
+           wfile= open("gwrite_"+fname+".fh","w") 
+           rfile= open("gread_"+fname+".fh","w")
+	   rfile.write("adios_groupsize = 0\n"); 
+	   rfile.write("adios_totalsize = 0\n"); 
+        elif(xmlparser.language_group_dict[fname]==2):
+           wfile= open("gwrite_"+fname+".ch","w") 
+           rfile= open("gread_"+fname+".ch","w")
+	   rfile.write("adios_groupsize = 0;\n"); 
+	   rfile.write("adios_totalsize = 0;\n"); 
+        wfile.write(line); 
+        rfile.write(line); 
+        linerw = vardict[fname]
+        wfile.write(linerw[0])
+        rfile.write(linerw[1]) 
+        wfile.close()
+        rfile.close() 
+
+if __name__=="__main__":
+   main()
diff --git a/utils/gpp/gpp_types.py b/utils/gpp/gpp_types.py
new file mode 100644
index 0000000..2b1ce42
--- /dev/null
+++ b/utils/gpp/gpp_types.py
@@ -0,0 +1,45 @@
+import sys
+import os
+
+adios_size={}
+adios_size["byte"]=1
+adios_size["integer*1"]=1
+
+adios_size["short"]=2
+adios_size["integer*2"]=2
+
+adios_size["integer"]=4
+adios_size["integer*4"]=4
+
+adios_size["string"]=1
+adios_size["long"]=8
+adios_size["integer*8"]=8
+
+adios_size["unsigned byte"]=1
+adios_size["unsigned integer*1"]=1
+
+adios_size["unsigned short"]=2
+adios_size["unsigned integer*2"]=2
+
+adios_size["unsigned integer"]=4
+adios_size["unsigned integer*4"]=4
+
+adios_size["unsigned long"]=8
+adios_size["unsigned integer*8"]=8
+
+adios_size["real"]=4
+adios_size["real*4"]=4
+adios_size["float"]=4
+
+adios_size["unsigned real"]=4
+adios_size["unsigned real*4"]=4
+adios_size["unsigned float"]=4
+
+adios_size["real*8"]=8
+adios_size["double"]=8
+
+adios_size["unsigned real*8"]=8
+adios_size["unsigned double"]=8
+
+adios_size["complex"]=8
+adios_size["double complex"]=16
diff --git a/utils/gpp/xmlparser.py b/utils/gpp/xmlparser.py
new file mode 100644
index 0000000..7c15b4f
--- /dev/null
+++ b/utils/gpp/xmlparser.py
@@ -0,0 +1,335 @@
+#!/usr/bin/env python
+import sys
+import os
+import xml.dom.minidom
+import gpp_types 
+from time import sleep
+
+sizeformular=[]
+sizestr={}
+getsize=gpp_types.adios_size
+var_size_dict={}
+
+def processvar(node,language_sw,coord_comm,coord_var,time_var):
+    global sizeformular
+    global var_gname_dict 
+    global var_size_dict 
+    line=""
+    liner=""
+    linew=""
+    linerw={}
+########################################################          
+# Modified Code: Case Insensitive
+########################################################          
+    attkeys=node.attributes.keys()
+    varname=""
+    typename="" 
+    pathname="" 
+    dimsname=""
+    gwname=""
+    grname=""
+    readyn = True 
+    for akey in attkeys:
+        akeystr=str(akey).lower()
+        if(akeystr=="dimensions"):
+           dimsname=node.attributes[akey].value
+        elif(akeystr=="type"):
+           typename=node.attributes[akey].value
+        elif(akeystr=="path"):
+           pathname=node.attributes[akey].value
+        elif(akeystr=="name"):
+           varname=node.attributes[akey].value
+        elif(akeystr=="gwrite"):
+           gwname=node.attributes[akey].value
+        elif(akeystr=="gread"):
+           grname=node.attributes[akey].value
+        elif(akeystr=="read"):
+           if(node.attributes[akey].value=='no'):
+              readyn = False
+    if(varname=="" or typename==""):
+       print "Warning: empty varname or type for adiosgroup: "+node.nodeName
+    if(gwname==""):
+       gwname=varname
+    if(grname==""):
+       grname=varname
+    for c in grname:
+       if (c == '+' or c == '-' or c == '*' or c == '/' or c == '^' or c == '**'):
+          readyn = False
+    if(var_gname_dict.has_key(varname)):
+       if(pathname!="" and pathname[len(pathname)-1]!='/'):
+          varname=pathname+'/'+varname
+       var_gname_dict[varname] = gwname 
+    else:
+       var_gname_dict[varname] = gwname 
+
+# Add var-size-mapping   
+    line="" 
+    if (dimsname==""):
+       if (typename=="string"):
+           if (language_sw==1):
+               line="len_trim("+gwname+")" 
+               liner="len("+grname+")" 
+           else:        
+               line="strlen("+gwname+")" 
+               # FIXME: we do not know how much space do we have in the 
+               #  variable when reading a string into it. 
+               #  we just give a stupidly big number (2GB) here and if the
+               #  space allocated is less then what is read in,
+               #  that is considered to be the responsibility of the programmer
+               liner="2147483648" 
+       else:
+           line=str(getsize[typename])
+           if (readyn==True):
+                liner=line 
+    else:
+       str_varsize=str(getsize[typename])
+       dimsarr=dimsname.split(',');
+       for dimsele in dimsarr:
+         if(dimsele==dimsarr[0]):
+            if(dimsele.isdigit()):
+               line=str_varsize+' * '+'('+dimsele+')'
+            elif(var_gname_dict.has_key(dimsele)):
+               line=str_varsize+' * '+'('+var_gname_dict[dimsele]+')'
+            else:
+               line=str_varsize
+         else:
+            if(dimsele.isdigit()):
+               line = line+' * '+'('+dimsele+')'
+            elif(dimsele == time_var):
+               line = line
+            elif(var_gname_dict.has_key(dimsele)):
+               line = line + ' * (' + var_gname_dict[dimsele]+')'
+            else: 
+               line = line
+       if (readyn==True):
+           liner = line
+    sizeformular.append(line)    
+    var_size_dict[varname]=line
+
+    if (language_sw==1):
+        linew = "call adios_write (adios_handle, "   \
+              + "\""+varname+"\", "         \
+              + gwname +", adios_err)\n"         
+        if (readyn): 
+           liner = "adios_buf_size = "+liner                 \
+                 + "\ncall adios_read (adios_handle, " \
+                 + "\"" + varname                      \
+                 + "\", " + grname            \
+                 + ", adios_buf_size, adios_err)\n"
+    elif(language_sw==2):
+        if (dimsname==""):
+           if(typename=="string"): 
+              linew = "adios_write (adios_handle, "          \
+                 + "\"" + varname + "\", "                   \
+                 + gwname + ");\n"                         
+           else: 
+              linew = "adios_write (adios_handle, "          \
+                 + "\"" + varname + "\", &"                  \
+                 + gwname + ");\n"                         
+           if (readyn):
+             if(typename=="string"): 
+               liner = "adios_buf_size = "+liner                  \
+                     + ";\nadios_read (adios_handle, "      \
+                     + "\"" + varname + "\", "             \
+                     + grname + ", adios_buf_size);\n"
+             else: 
+               liner = "adios_buf_size = "+liner                  \
+                     + ";\nadios_read (adios_handle, "      \
+                     + "\"" + varname + "\", &"             \
+                     + grname + ", adios_buf_size);\n"
+        else: 
+           linew = "adios_write (adios_handle, "         \
+                 + "\"" + varname + "\", "               \
+                 + gwname + ");\n"                         
+           if (readyn): 
+              liner = "adios_buf_size = " +liner                 \
+                     + ";\nadios_read (adios_handle, " \
+                     + "\"" + varname + "\", "               \
+                     + grname + ", adios_buf_size);\n"
+    linerw=[linew,liner]
+    return linerw
+
+def processattr(node, language_sw):
+    global sizeformular
+    global var_gname_dict
+    attkeys=node.attributes.keys()
+    attrname=""
+    varname=""
+    pathname=""
+    valuename=""
+    typename="" 
+    for akey in attkeys:
+        akeystr=str(akey).lower()
+        if ( akeystr == 'name'):
+           attrname = node.attributes[akey].value 
+        elif ( akeystr == 'path'):
+           pathname = node.attributes[akey].value 
+        elif ( akeystr == 'value'):
+           valuename = node.attributes[akey].value 
+        elif (akeystr == 'type'):
+           typename = node.attributes[akey].value 
+        elif ( akeystr == 'var'):
+           varname=node.attributes[akey].value
+        else:
+           print "\""+pathname+attrname+"\" is not declared before the attribute \"" \
+                     +node.attributes["name"].value+"\""
+    if (valuename != ''):
+       if (typename != ''):
+           var_gname_dict[pathname+attrname] = valuename
+           var_gname_dict[attrname] = valuename
+    elif (varname != ""):
+       var_gname_dict[attrname] = var_gname_dict[varname]
+         
+def processnode(nodelist,language_sw,coord_comm,coord_var,time_var):
+   global items,sizeformular
+   for node in nodelist:
+       if (node.nodeType==node.ELEMENT_NODE and node.nodeName.lower()=="var"):
+           itemsrw=(processvar(node,language_sw,coord_comm,coord_var,time_var))
+           items[0] = items[0] + itemsrw[0]
+           items[1] = items[1] + itemsrw[1]
+       if (node.nodeType==node.ELEMENT_NODE and node.nodeName.lower()=="attribute"):
+           processattr(node,language_sw)
+       elif (node.nodeType==node.ELEMENT_NODE and node.nodeName.lower()=="gwrite"):
+           srccode =str(node.getAttribute("src"))
+           items [0] = items[0] + srccode + "\n"
+           items [1] = items[1] + srccode + "\n"
+       subnodelist=node.childNodes
+       processnode(subnodelist,language_sw,coord_comm,coord_var,time_var)
+
+def getVarlistFromXML(xmlFile):
+    global items,sizeformular, language_group_dict,var_gname_dict,var_size_dict 
+    var_gname_dict={}
+    items={}
+    items=["",""]
+    language_group_dict={}
+    variables={}
+    doc=xml.dom.minidom.parse(xmlFile)# parse an XML file by name
+    idx=0
+    group=doc.childNodes
+    if(group.length!=1):
+       print "Fatal: adios-config should be one and only one!"
+       raise SystemExit
+    root=group[0]
+    if(root.tagName.lower()!="adios-config"):
+       print "Fatal: wrong root element, switch to adios-config"  
+       raise SystemExit
+    attnum=len(root.attributes.keys())
+    if (attnum==0) :
+        language_flag=1
+    elif(attnum==1):
+        attkeys=root.attributes.keys()
+        if(str(attkeys[0]).lower()=="host-language"):
+           language=group[0].getAttribute(attkeys[0])
+        if (language.lower()=="fortran"):
+            language_flag=1
+        elif(language.lower()=="c" or language.lower()=="cpp"):
+            language_flag=2
+        else:
+            language_flag==-1
+            print "Fatal: Unknown language supported!"
+            raise SystemExit
+    gname=""
+    time_var = ""
+    coord_var = ""
+    coord_comm = "MPI_COMM_WORLD"
+    for group in root.childNodes:
+      if (group.nodeType==group.ELEMENT_NODE): 
+        if (group.tagName.lower()=="adios-group"): 
+            indent=""
+            attkeys=group.attributes.keys()
+            glanguage=language_flag
+            for akey in attkeys:
+                akeystr=str(akey).lower()
+                if (akeystr=="name"):
+                    gname=group.attributes[akey].value
+                elif (akeystr == "coordination-communicator"):
+                    coord_comm=group.attributes[akey].value
+                elif (akeystr == "coordination-var"):
+                    coord_var=group.attributes[akey].value
+                elif (akeystr=="host-language"):
+                    language=group.attributes[akey].value
+                    if (language.lower()=="fortran"):
+                               glanguage=1
+                    elif(language.lower()=="c" or language.lower()=="cpp"):
+                        glanguage=2
+                    else:
+                        glanguage==-1
+                        print "Fatal: Unknown language supported!"
+                        raise SystemExit
+                elif (akeystr == "time-index"):
+                    time_var = group.attributes[akey].value
+                else:
+                    print "Warning: Unknown attribute --"+str(akey)+"-- for adios-group: "+gname
+            if (gname ==""):
+                print "Fatal: name for adios-group is required!"
+                raise SystemExit
+
+            nodelist=group.childNodes
+             
+            #line = ""
+            #if(glanguage==1):
+            #        if (coord_var!= ""):
+            #            line = line                              \
+            #                + "call adios_write (adios_handle, "\
+            #                + "\""+coord_var+"\"//char(0), "    \
+            #                + coord_var +")\n"         
+            #        if (time_var != ""):
+            #             line = line                              \
+            #                  + "call adios_write (adios_handle, "\
+            #                  + "\""+time_var+"\"//char(0), "     \
+            #                  + time_var +")\n"        
+            #elif(glanguage):
+            #        if (coord_var!= ""):
+            #            line = line                              \
+            #                  + "adios_write (adios_handle, "\
+            #                  + "\""+coord_var+"\", &"    \
+            #                  + coord_var +");\n"         
+            #    if (time_var != ""):
+            #            line = line                              \
+            #                  + "adios_write (adios_handle, "\
+            #                  + "\""+time_var+"\", &"     \
+            #                  + time_var +");\n"
+            #items[0] = items[0]+line
+            items=["",""]
+            processnode(nodelist,glanguage,coord_comm,coord_var,time_var)
+
+            if(glanguage==1):
+               if (coord_comm == ''):
+                  line="call adios_group_size (adios_handle, adios_groupsize, adios_totalsize, adios_err)\n"
+               else:
+                  line="call adios_group_size (adios_handle, adios_groupsize, adios_totalsize, adios_err)\n"
+            else:
+               if (coord_comm == ''):
+                   line="adios_group_size (adios_handle, adios_groupsize, &adios_totalsize);\n"
+               else:
+                   line="adios_group_size (adios_handle, adios_groupsize, &adios_totalsize);\n"
+            items[0]=line+items[0]
+            items[1]=line+items[1]
+            var_gname_dict={}
+            line = sizeformular[0]
+            if (glanguage == 1): 
+                for i in range(1,len(sizeformular)):
+                    line =line +' &\n                + '+sizeformular[i]
+                items[0]="adios_groupsize = " + line+"\n"+items[0]
+            elif (glanguage == 2): 
+                for i in range(1,len(sizeformular)):
+                    line =line +' \\\n                + '+sizeformular[i]
+                items[0]="adios_groupsize = " + line+";\n"+items[0]
+
+            language_group_dict[gname]=glanguage
+             
+            variables[str(gname)]=items
+            sizestr[str(gname)] = line
+            sizeformular=[]
+    return variables
+
+def main(argv=None):
+    if argv is None:
+        argv=sys.argv
+    vardict = getVarlistFromXML("config.xml")
+    #print vardict.keys()
+#    for key,value in vardict.items():
+#        if(key=="restart"): 
+#            print key,value
+if __name__ == "__main__":
+     main()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/adios.git



More information about the debian-science-commits mailing list