Index: src/bord.cpp
===================================================================
--- src/bord.cpp	(revision 491)
+++ src/bord.cpp	(working copy)
@@ -1624,9 +1624,89 @@
 } // ibis::bord::dumpNames
 
 int ibis::bord::dump(std::ostream& out, const char* del) const {
-    return dump(out, nEvents, del);
+	if (strcmp(del, "JSON")==0)
+		return dumpJSON(out, nEvents);
+	else
+		return dump(out, nEvents, del);
 } // ibis::bord::dump
 
+int ibis::bord::dumpJSON(std::ostream& out, uint64_t nr) const {
+    const uint32_t ncol = columns.size();
+    if (ncol == 0 || nr == 0) return 0;
+
+    std::vector<const ibis::bord::column*> clist;
+    if (colorder.empty()) { // alphabetic ordering
+	for (ibis::part::columnList::const_iterator it = columns.begin();
+	     it != columns.end(); ++ it) {
+	    const ibis::bord::column* col =
+		dynamic_cast<const ibis::bord::column*>((*it).second);
+	    if (col != 0)
+		clist.push_back(col);
+	}
+    }
+    else if (colorder.size() == ncol) { // use external order
+	for (uint32_t i = 0; i < ncol; ++ i) {
+	    const ibis::bord::column* col =
+		dynamic_cast<const ibis::bord::column*>(colorder[i]);
+	    if (col != 0)
+		clist.push_back(col);
+	}
+    }
+    else { // externally specified ones are ordered first
+	std::set<const char*, ibis::lessi> names;
+	for (ibis::part::columnList::const_iterator it = columns.begin();
+	     it != columns.end(); ++ it)
+	    names.insert((*it).first);
+	for (uint32_t i = 0; i < colorder.size(); ++ i) {
+	    const ibis::bord::column* col =
+		dynamic_cast<const ibis::bord::column*>(colorder[i]);
+	    if (col != 0) {
+		clist.push_back(col);
+		names.erase(col->name());
+	    }
+	}
+	for (std::set<const char*, ibis::lessi>::const_iterator it =
+		 names.begin();
+	     it != names.end(); ++ it) {
+	    ibis::part::columnList::const_iterator cit = columns.find(*it);
+	    const ibis::bord::column* col =
+		dynamic_cast<const ibis::bord::column*>((*cit).second);
+	    if (col != 0)
+		clist.push_back(col);
+	}
+    }
+    if (clist.size() < ncol) return -3;
+
+    int ierr = 0;
+    // print the first row with error checking
+	out << "[[";
+    ierr = clist[0]->dump(out, 0U);
+    if (ierr < 0) return ierr;
+    for (uint32_t j = 1; j < ncol; ++ j) {
+		out << ",";
+		ierr = clist[j]->dump(out, 0U);
+		if (ierr < 0) return ierr;
+    }
+    out << "]";
+    if (! out) return -4;
+    // print the remaining rows without checking the return values from
+    // functions called
+    if (nr > nEvents) nr = nEvents;
+    for (uint32_t i = 1; i < nr; ++ i) {
+		out << ",[";
+		(void) clist[0]->dump(out, i);
+		for (uint32_t j = 1; j < ncol; ++ j) {
+	    	out << ",";
+	    	(void) clist[j]->dump(out, i);
+		}
+		out << "]";
+    }
+    if (! out)
+		ierr = -4;
+	out << "]";
+    return ierr;
+} // ibis::bord::dumpJSON
+
 /**
    Print the first nr rows of the data to the given output stream.
 
Index: src/bord.h
===================================================================
--- src/bord.h	(revision 491)
+++ src/bord.h	(working copy)
@@ -48,6 +48,7 @@
     virtual void dumpNames(std::ostream&, const char*) const;
     virtual int dump(std::ostream&, const char*) const;
     virtual int dump(std::ostream&, uint64_t, const char*) const;
+	virtual int dumpJSON(std::ostream&, uint64_t) const;
     virtual int dump(std::ostream&, uint64_t, uint64_t, const char*) const;
     virtual int backup(const char* dir, const char* tname=0,
 		       const char* tdesc=0) const;
Index: libtool
===================================================================
--- libtool	(revision 491)
+++ libtool	(working copy)
@@ -2,7 +2,7 @@
 
 # libtool - Provide generalized library-building support services.
 # Generated automatically by config.status (fastbit) ibis1.2.9.3
-# Libtool was configured on host bit.lbl.gov:
+# Libtool was configured on host asiago.local:
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
 #
 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
@@ -161,7 +161,7 @@
 LTCC="gcc"
 
 # LTCC compiler flags.
-LTCFLAGS="-g -O0 -m64 -Wall -D_THREAD_SAFE "
+LTCFLAGS="-g -O2 -D_THREAD_SAFE "
 
 # Take the output of nm and produce a listing of raw symbols and C names.
 global_symbol_pipe="sed -n -e 's/^.*[	 ]\\([BCDEGRST][BCDEGRST]*\\)[	 ][	 ]*_\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 _\\2 \\2/p' | sed '/ __gnu_lto/d'"
