Commit 51905346 authored by miller86's avatar miller86
Browse files

fixing issues encountered while testing writer with different implementations

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@5896 18c085ea-50e0-402c-830e-de6fd14e8384
parent e28c25d4
......@@ -167,8 +167,8 @@ DEFAULT_VISUS_LIB=/usr/gapps/visit/visus/linux_rhel3_gcc_3.2.3_new/lib
## along with whatever other entries in the implementation specification you need
## and then just work directly on the source code in src/databases/ITAPS_C.
##
#DEFAULT_ITAPS_IMPLS="MOAB:cub,vmesh:-DITAPS_MOAB,-I/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/MOAB/include:-L/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/MOAB/lib,-liMesh,-lMOAB,/misc/gapps/hdf5/1.6.5/LinuxE3/serial/64/optim/lib/libhdf5.a,-L/usr/gapps/visit/netcdf/3.6.0/linux_rhel3_gcc_3.2.3/lib,-lnetcdf_c++,-lnetcdf FMDB:sms:-I/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/FMDB/include:-L/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/FMDB/lib,-lFMDB,-lSCORECModel,-lSCORECUtil GRUMMP:bdry,smesh,vmesh:-I/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/GRUMMP/include:-L/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/GRUMMP/lib,-liMesh_GRUMMP,-lGR_3D,-lGR_surf,-lGR_2D,-lGR_base,-lSUMAAlog_lite,-lOptMS"
DEFAULT_ITAPS_IMPLS="MOAB:cub,vmesh:-DITAPS_MOAB,-I/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/MOAB.old/include:-L/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/MOAB.old/lib,-liMesh,-lMOAB FMDB:sms:-I/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/FMDB/include:-L/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/FMDB/lib,-lFMDB,-lSCORECModel,-lSCORECUtil GRUMMP:bdry,smesh,vmesh:-I/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/GRUMMP/include:-L/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/GRUMMP/lib,-liMesh_GRUMMP,-lGR_3D,-lGR_surf,-lGR_2D,-lGR_base,-lSUMAAlog_lite,-lOptMS"
#DEFAULT_ITAPS_IMPLS="MOAB:cub,vmesh:-I/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/MOAB/include:-L/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/MOAB/lib,-liMesh,-lMOAB,/misc/gapps/hdf5/1.6.5/LinuxE3/serial/64/optim/lib/libhdf5.a,-L/usr/gapps/visit/netcdf/3.6.0/linux_rhel3_gcc_3.2.3/lib,-lnetcdf_c++,-lnetcdf FMDB:sms:-I/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/FMDB/include:-L/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/FMDB/lib,-lFMDB,-lSCORECModel,-lSCORECUtil GRUMMP:bdry,smesh,vmesh:-I/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/GRUMMP/include:-L/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/GRUMMP/lib,-liMesh_GRUMMP,-lGR_3D,-lGR_surf,-lGR_2D,-lGR_base,-lSUMAAlog_lite,-lOptMS"
DEFAULT_ITAPS_IMPLS="MOAB:cub,vmesh:-I/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/MOAB.old/include:-L/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/MOAB.old/lib,-liMesh,-lMOAB FMDB:sms:-I/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/FMDB/include:-L/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/FMDB/lib,-lFMDB,-lSCORECModel,-lSCORECUtil GRUMMP:bdry,smesh,vmesh:-I/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/GRUMMP/include:-L/usr/gapps/visit/itaps/linux_rhel3_gcc_3.2.3/GRUMMP/lib,-liMesh_GRUMMP,-lGR_3D,-lGR_surf,-lGR_2D,-lGR_base,-lSUMAAlog_lite,-lOptMS"
##
## CCMIO
......
......@@ -5900,13 +5900,14 @@ else
echo "${ECHO_T}no" >&6
fi
 
echo "$as_me:$LINENO: checking for library containing strerror" >&5
echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6
if test "${ac_cv_search_strerror+set}" = set; then
echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5
echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6
if test "${ac_cv_lib_cposix_strerror+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_func_search_save_LIBS=$LIBS
ac_cv_search_strerror=no
ac_check_lib_save_LIBS=$LIBS
LIBS="-lcposix $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
......@@ -5951,80 +5952,24 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_search_strerror="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_strerror" = no; then
for ac_lib in cposix; do
LIBS="-l$ac_lib $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 strerror ();
int
main ()
{
strerror ();
;
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_strerror="-l$ac_lib"
break
ac_cv_lib_cposix_strerror=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
 
ac_cv_lib_cposix_strerror=no
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
done
LIBS=$ac_check_lib_save_LIBS
fi
LIBS=$ac_func_search_save_LIBS
echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5
echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6
if test $ac_cv_lib_cposix_strerror = yes; then
LIBS="$LIBS -lcposix"
fi
echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5
echo "${ECHO_T}$ac_cv_search_strerror" >&6
if test "$ac_cv_search_strerror" != no; then
test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS"
 
fi
 
 
BUILD_FORTRAN=""
......@@ -9582,8 +9527,8 @@ echo "$as_me: error: \"Configure needs to remove ITAPS implementation copy datab
# <CXXFLAGS> and </CXXFLAGS> on the same line.
#
sed -i -e "s%<Extensions>\(.*\)</Extensions>%<Extensions>${impl_exts}</Extensions>%" databases/$impl_name/$impl_name.xml
sed -i -e "s%<CXXFLAGS>\(.*\)</CXXFLAGS>%<CXXFLAGS>$\(ITAPS_C${itaps_impl_id}_INCLUDE)</CXXFLAGS>%" databases/$impl_name/$impl_name.xml
sed -i -e "s%<LIBS>\(.*\)</LIBS>%<LIBS>$\(ITAPS_C${itaps_impl_id}_LIB)</LIBS>%" databases/$impl_name/$impl_name.xml
sed -i -e "s%<CXXFLAGS>\(.*\)</CXXFLAGS>%<CXXFLAGS>-D${impl_name} $\(ITAPS_C${itaps_impl_id}_INCLUDE\)</CXXFLAGS>%" databases/$impl_name/$impl_name.xml
sed -i -e "s%<LIBS>\(.*\)</LIBS>%<LIBS>$\(ITAPS_C${itaps_impl_id}_LIB\)</LIBS>%" databases/$impl_name/$impl_name.xml
 
#
# Fix the extensions in the PluginInfo.C file
......
......@@ -904,6 +904,9 @@ dnl
dnl Josh Stratton, Tue Dec 16 11:03:21 MST 2008
dnl Added Tuvok the the 3rd-party builtin libraries
dnl
dnl Mark C. Miller, Sat Dec 20 07:38:09 PST 2008
dnl Added logic to specify itaps impl in CPPFLAGS when building itaps
dnl plugin.
dnl --------------------------------------------------------------------------
dnl
......@@ -2821,8 +2824,8 @@ if test -n "$with_itaps_impls" && test with_itaps_impls != "no"; then
# <CXXFLAGS> and </CXXFLAGS> on the same line.
#
sed -i -e "s%<Extensions>\(.*\)</Extensions>%<Extensions>${impl_exts}</Extensions>%" databases/$impl_name/$impl_name.xml
sed -i -e "s%<CXXFLAGS>\(.*\)</CXXFLAGS>%<CXXFLAGS>$\(ITAPS_C${itaps_impl_id}_INCLUDE)</CXXFLAGS>%" databases/$impl_name/$impl_name.xml
sed -i -e "s%<LIBS>\(.*\)</LIBS>%<LIBS>$\(ITAPS_C${itaps_impl_id}_LIB)</LIBS>%" databases/$impl_name/$impl_name.xml
sed -i -e "s%<CXXFLAGS>\(.*\)</CXXFLAGS>%<CXXFLAGS>-D${impl_name} $\(ITAPS_C${itaps_impl_id}_INCLUDE\)</CXXFLAGS>%" databases/$impl_name/$impl_name.xml
sed -i -e "s%<LIBS>\(.*\)</LIBS>%<LIBS>$\(ITAPS_C${itaps_impl_id}_LIB\)</LIBS>%" databases/$impl_name/$impl_name.xml
#
# Fix the extensions in the PluginInfo.C file
......
......@@ -4,7 +4,7 @@
must be formatted as single lines so that configure
can perform the necessary sed substitutions. -->
<Extensions> cub vmesh </Extensions>
<CXXFLAGS> $(ITAPS_C_INCLUDE) </CXXFLAGS>
<CXXFLAGS> -DITAPS_C $(ITAPS_C_INCLUDE) </CXXFLAGS>
<LIBS> $(ITAPS_C_LIB) </LIBS>
<Files components="M">
avtITAPS_CFileFormat.C
......
......@@ -200,8 +200,8 @@ avtITAPS_CFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
// ok, try loading the mesh.
try
{
iMesh_load(itapsMesh, rootSet, vmeshFileName.c_str(), dummyStr, &itapsError,
vmeshFileName.length(), 0);
iMesh_load(itapsMesh, rootSet, tmpFileName.c_str(), dummyStr, &itapsError,
tmpFileName.length(), 0);
CheckITAPSError(itapsMesh, iMesh_load, NoL);
// determine spatial and topological dimensions of mesh
......@@ -445,9 +445,8 @@ avtITAPS_CFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
char desc[256];
desc[0] = '\0';
int tmpError = itapsError;
#ifdef ITAPS_MOAB
#if !defined(ITAPS_GRUMMP)
iMesh_getDescription(itapsMesh, desc, &itapsError, sizeof(desc));
#elif ITAPS_GRUMMP
#endif
SNPRINTF(msg, sizeof(msg), "Encountered ITAPS error (%d) \"%s\""
"\nUnable to open file!", tmpError, desc);
......@@ -603,9 +602,8 @@ avtITAPS_CFileFormat::GetMesh(int domain, const char *meshname)
char desc[256];
desc[0] = '\0';
int tmpError = itapsError;
#ifdef ITAPS_MOAB
#if !defined(ITAPS_GRUMMP)
iMesh_getDescription(itapsMesh, desc, &itapsError, sizeof(desc));
#elif ITAPS_GRUMMP
#endif
SNPRINTF(msg, sizeof(msg), "Encountered ITAPS error (%d) \"%s\""
"\nUnable to open file!", tmpError, desc);
......@@ -755,9 +753,8 @@ avtITAPS_CFileFormat::GetNodalSubsetVar(int domain, const char *varname,
char desc[256];
desc[0] = '\0';
int tmpError = itapsError;
#ifdef ITAPS_MOAB
#if !defined(ITAPS_GRUMMP)
iMesh_getDescription(itapsMesh, desc, &itapsError, sizeof(desc));
#elif ITAPS_GRUMMP
#endif
SNPRINTF(msg, sizeof(msg), "Encountered ITAPS error (%d) \"%s\""
"\nUnable to open file!", tmpError, desc);
......@@ -967,9 +964,8 @@ tagFound:
char desc[256];
desc[0] = '\0';
int tmpError = itapsError;
#ifdef ITAPS_MOAB
#if !defined(ITAPS_GRUMMP)
iMesh_getDescription(itapsMesh, desc, &itapsError, sizeof(desc));
#elif ITAPS_GRUMMP
#endif
SNPRINTF(msg, sizeof(msg), "Encountered ITAPS error (%d) \"%s\""
"\nUnable to open file!", tmpError, desc);
......
......@@ -95,6 +95,8 @@ DBOptionsAttributes *
GetITAPS_CWriteOptions(void)
{
DBOptionsAttributes *rv = new DBOptionsAttributes;
#ifdef ITAPS_MOAB
rv->SetEnum("Format", 0);
vector<string> formats;
formats.push_back("MOAB"); // 0
......@@ -106,5 +108,7 @@ GetITAPS_CWriteOptions(void)
formats.push_back("GMSH"); // 6
formats.push_back("STL"); // 7
rv->SetEnumStrings("Format", formats);
#endif
return rv;
}
......@@ -137,11 +137,7 @@ string
avtITAPS_CUtility::VisIt_iMesh_getTagName(iMesh_Instance theMesh, iBase_TagHandle theTag)
{
static char tmpName[256];
#ifdef ITAPS_MOAB
iMesh_getTagName(theMesh, theTag, tmpName, &itapsError, sizeof(tmpName));
#elif ITAPS_GRUMMP
iMesh_getTagName(theMesh, theTag, tmpName, sizeof(tmpName), &itapsError);
#endif
return string(tmpName);
}
......
......@@ -78,7 +78,7 @@ using std::vector;
// to debug4 also.
//
// ****************************************************************************
#ifdef ITAPS_MOAB
#if !defined(ITAPS_GRUMMP)
#define CheckITAPSError2(IMI, ERR, FN, ARGS, THELINE, THEFILE) \
if (ERR != 0) \
{ \
......
......@@ -55,6 +55,7 @@
#include <vtkCellType.h>
#include <vtkDataArray.h>
#include <vtkDataSet.h>
//#include <vtkDelaunay3D.h>
#include <vtkPointData.h>
#include <vtkType.h>
......@@ -77,9 +78,9 @@ using namespace avtITAPS_CUtility;
avtITAPS_CWriter::avtITAPS_CWriter(DBOptionsAttributes *dbopts)
{
formatType = "MOAB";
#if defined(ITAPS_MOAB)
saveOptions = "MOAB";
formatExtension = "h5m";
for (int i = 0; dbopts != 0 && i < dbopts->GetNumberOfOptions(); ++i)
{
if (dbopts->GetName(i) == "Format")
......@@ -87,16 +88,21 @@ avtITAPS_CWriter::avtITAPS_CWriter(DBOptionsAttributes *dbopts)
switch (dbopts->GetEnum("Format"))
{
case 0: break; // default case
case 1: formatType = "EXODUS"; formatExtension = "exoII"; break;
case 2: formatType = "VTK"; formatExtension = "vtk"; break;
case 3: formatType = "SLAC"; formatExtension = "slac"; break;
case 4: formatType = "GMV"; formatExtension = "gmv"; break;
case 5: formatType = "ANSYS"; formatExtension = "ans"; break;
case 6: formatType = "GMSH"; formatExtension = "gmsh"; break;
case 7: formatType = "STL"; formatExtension = "stl"; break;
case 1: saveOptions = "EXODUS"; formatExtension = "exoII"; break;
case 2: saveOptions = "VTK"; formatExtension = "vtk"; break;
case 3: saveOptions = "SLAC"; formatExtension = "slac"; break;
case 4: saveOptions = "GMV"; formatExtension = "gmv"; break;
case 5: saveOptions = "ANSYS"; formatExtension = "ans"; break;
case 6: saveOptions = "GMSH"; formatExtension = "gmsh"; break;
case 7: saveOptions = "STL"; formatExtension = "stl"; break;
}
}
}
#elif defined(ITAPS_GRUMMP)
formatExtension = ""; // grummp seems to append '.vmesh' always
#else
formatExtension = "unk";
#endif
}
// ****************************************************************************
......@@ -169,15 +175,25 @@ avtITAPS_CWriter::WriteHeaders(const avtDatabaseMetaData *md,
//
// ****************************************************************************
static void
WriteMesh(vtkDataSet *ds, int chunk,
WriteMesh(vtkDataSet *_ds, int chunk,
iMesh_Instance itapsMesh, iBase_EntitySetHandle rootSet,
iBase_EntityHandle **pntHdls, iBase_EntityHandle **cellHdls)
{
int i,j;
vtkDataSet *ds = _ds;
*pntHdls = 0;
*cellHdls = 0;
//#if defined(ITAPS_GRUMMP)
#if 0
vtkDelaunay3D *d3d = vtkDelaunay3D::New();
d3d->SetInput(_ds);
d3d->Update();
ds = (vtkDataSet*) d3d->GetOutput();
//#warning FREE SOME STUFF HERE
#endif
try
{
// Create the entity set representing this chunk
......@@ -249,9 +265,8 @@ WriteMesh(vtkDataSet *ds, int chunk,
char desc[256];
desc[0] = '\0';
int tmpError = itapsError;
#ifdef ITAPS_MOAB
#if !defined(ITAPS_GRUMMP)
iMesh_getDescription(itapsMesh, desc, &itapsError, sizeof(desc));
#elif ITAPS_GRUMMP
#endif
SNPRINTF(msg, sizeof(msg), "Encountered ITAPS error (%d) \"%s\""
"\nUnable to open file!", tmpError, desc);
......@@ -481,9 +496,8 @@ WriteVariables(vtkDataSet *ds, int chunk,
char desc[256];
desc[0] = '\0';
int tmpError = itapsError;
#ifdef ITAPS_MOAB
#if !defined(ITAPS_GRUMMP)
iMesh_getDescription(itapsMesh, desc, &itapsError, sizeof(desc));
#elif ITAPS_GRUMMP
#endif
SNPRINTF(msg, sizeof(msg), "Encountered ITAPS error (%d) \"%s\""
"\nUnable to open file!", tmpError, desc);
......@@ -538,9 +552,12 @@ avtITAPS_CWriter::WriteChunk(vtkDataSet *ds, int chunk)
// save the file
string fname = dir + stem;
char filename[1024];
sprintf(filename, "%s.%d.%s", fname.c_str(), chunk, formatExtension.c_str());
iMesh_save(itapsMesh, rootSet, filename, formatType.c_str(), &itapsError,
strlen(filename), formatType.size());
if (formatExtension != "")
sprintf(filename, "%s.%d.%s", fname.c_str(), chunk, formatExtension.c_str());
else
sprintf(filename, "%s.%d", fname.c_str(), chunk);
iMesh_save(itapsMesh, rootSet, filename, saveOptions.c_str(), &itapsError,
strlen(filename), saveOptions.size());
CheckITAPSError(itapsMesh, iMesh_save, NoL);
}
......@@ -550,9 +567,8 @@ avtITAPS_CWriter::WriteChunk(vtkDataSet *ds, int chunk)
char desc[256];
desc[0] = '\0';
int tmpError = itapsError;
#ifdef ITAPS_MOAB
#if !defined(ITAPS_GRUMMP)
iMesh_getDescription(itapsMesh, desc, &itapsError, sizeof(desc));
#elif ITAPS_GRUMMP
#endif
SNPRINTF(msg, sizeof(msg), "Encountered ITAPS error (%d) \"%s\""
"\nUnable to open file!", tmpError, desc);
......
......@@ -89,7 +89,7 @@ class avtITAPS_CWriter : public virtual avtDatabaseWriter
private:
string stem;
string dir;
string formatType;
string saveOptions;
string formatExtension;
int nblocks;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment