moab-dev
Threads by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
February 2014
- 10 participants
- 80 discussions
commit/MOAB: danwu: Add a new example ErrorHandlingModel to show how MOAB's enhanced error handling model works.
by commits-noreply@bitbucket.org 28 Feb '14
by commits-noreply@bitbucket.org 28 Feb '14
28 Feb '14
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/9a8d18905f85/
Changeset: 9a8d18905f85
Branch: error_handling_enhancement
User: danwu
Date: 2014-02-28 22:58:20
Summary: Add a new example ErrorHandlingModel to show how MOAB's enhanced error handling model works.
Affected #: 2 files
diff --git a/examples/ErrorHandlingModel.cpp b/examples/ErrorHandlingModel.cpp
new file mode 100644
index 0000000..5b89a44
--- /dev/null
+++ b/examples/ErrorHandlingModel.cpp
@@ -0,0 +1,104 @@
+/** @example ErrorHandlingModel.cpp
+ * Description: This example will show how MOAB's enhanced error handling model works. \n
+ * The errors are all contrived, used for illustration purpose only. \n
+ *
+ * <b>To run</b>: mpiexec -np 4 ./ErrorHandlingModel <test_case_num> \n
+ */
+
+#include "moab/ErrorHandler.hpp"
+#ifdef USE_MPI
+#include "moab_mpi.h"
+#endif
+
+#include <iostream>
+#include <stdlib.h>
+
+using namespace moab;
+using namespace std;
+
+#ifdef USE_ERROR_INFO_CLASS
+// TBD
+#else
+// Functions that create and handle contrived errors
+// Call hierarchy: A calls B, and B calls C
+ErrorCode FunctionC(int test_case_num, int rank)
+{
+ if (1 == test_case_num) {
+ // Simulate a global fatal error MB_NOT_IMPLEMENTED on all processors
+ // Note, it is only printed by root processor 0
+ SET_GLB_ERR(MB_NOT_IMPLEMENTED, "A contrived global error MB_NOT_IMPLEMENTED");
+ }
+ else if (2 == test_case_num) {
+ // Simulate a per-processor relevant error MB_INDEX_OUT_OF_RANGE on all processors
+ // Note, it is printed by all processors
+ SET_ERR_STR(MB_INDEX_OUT_OF_RANGE, "A contrived error MB_INDEX_OUT_OF_RANGE on processor " << rank);
+ }
+ else if (3 == test_case_num) {
+ // Simulate a per-processor relevant error MB_TYPE_OUT_OF_RANGE on all processors except root
+ // Note, it is printed by all non-root processors
+ if (0 != rank) {
+ SET_ERR_STR(MB_TYPE_OUT_OF_RANGE, "A contrived error MB_TYPE_OUT_OF_RANGE on processor " << rank);
+ }
+ }
+ else if (4 == test_case_num) {
+ // Simulate a per-processor relevant error MB_INDEX_OUT_OF_RANGE on processor 1
+ // Note, it is only printed by processor 1
+ if (1 == rank) {
+ SET_ERR(MB_INDEX_OUT_OF_RANGE, "A contrived error MB_INDEX_OUT_OF_RANGE on processor 1");
+ }
+
+ // Simulate a per-processor relevant error MB_TYPE_OUT_OF_RANGE on processor 3
+ // Note, it is only printed by processor 3
+ if (3 == rank) {
+ SET_ERR(MB_TYPE_OUT_OF_RANGE, "A contrived error MB_TYPE_OUT_OF_RANGE on processor 3");
+ }
+ }
+
+ return MB_SUCCESS;
+}
+
+ErrorCode FunctionB(int test_case_num, int rank)
+{
+ ErrorCode err_code = FunctionC(test_case_num, rank);CHK_ERR(err_code);
+
+ return MB_SUCCESS;
+}
+
+ErrorCode FunctionA(int test_case_num, int rank)
+{
+ ErrorCode err_code = FunctionB(test_case_num, rank);CHK_ERR(err_code);
+
+ return MB_SUCCESS;
+}
+#endif
+
+int main(int argc, char** argv)
+{
+ // The required arg is a test case number (1, 2, 3 or 4)
+ if (argc < 2) {
+ cout << "Usage: " << argv[0] << " <test_case_num>" << endl;
+ return 0;
+ }
+
+#ifdef USE_MPI
+ MPI_Init(&argc, &argv);
+#endif
+
+ MBErrorHandler_Init();
+
+ int test_case_num = atoi(argv[1]);
+ int rank = 0;
+#ifdef USE_MPI
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+#endif
+
+ ErrorCode rval = FunctionA(test_case_num, rank);CHK_ERR(rval);
+
+ MBErrorHandler_Finalize();
+
+#ifdef USE_MPI
+ MPI_Finalize();
+#endif
+
+ return 0;
+}
diff --git a/examples/makefile b/examples/makefile
index 6993b64..f61c689 100644
--- a/examples/makefile
+++ b/examples/makefile
@@ -10,7 +10,7 @@ MESH_DIR="../MeshFiles/unittest"
EXAMPLES = HelloMOAB GetEntities SetsNTags LoadPartial structuredmesh StructuredMeshSimple DirectAccessWithHoles DirectAccessNoHoles point_in_elem_search DeformMeshRemap
PAREXAMPLES = HelloParMOAB ReduceExchangeTags LloydRelaxation CrystalRouterExample
EXOIIEXAMPLES = TestExodusII
-ERROREXAMPLES = TestErrorHandling TestErrorHandlingPar
+ERROREXAMPLES = TestErrorHandling TestErrorHandlingPar ErrorHandlingModel
F90EXAMPLES = DirectAccessNoHolesF90 PushParMeshIntoMoabF90
default: ${EXAMPLES} ${PAREXAMPLES} ${EXOIIEXAMPLES} ${ERROREXAMPLES} ${F90EXAMPLES}
@@ -72,6 +72,9 @@ TestErrorHandling: TestErrorHandling.o ${MOAB_LIBDIR}/libMOAB.la
TestErrorHandlingPar: TestErrorHandlingPar.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
+ErrorHandlingModel: ErrorHandlingModel.o ${MOAB_LIBDIR}/libMOAB.la
+ ${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
+
clean:
rm -rf *.o *.mod *.h5m ${EXAMPLES} ${PAREXAMPLES} ${EXOIIEXAMPLES} ${ERROREXAMPLES} ${F90EXAMPLES}
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
8 new commits in MOAB:
https://bitbucket.org/fathomteam/moab/commits/3c33610784b1/
Changeset: 3c33610784b1
Branch: None
User: Lukasz Kaczmarczyk
Date: 2013-09-22 22:06:58
Summary: cubit file, block data attributes in variable length tag
Affected #: 1 file
diff --git a/src/io/Tqdcfr.cpp b/src/io/Tqdcfr.cpp
index 717f43a..2d24e0e 100644
--- a/src/io/Tqdcfr.cpp
+++ b/src/io/Tqdcfr.cpp
@@ -916,6 +916,7 @@ ErrorCode Tqdcfr::read_block(const unsigned int blindex,
Tqdcfr::ModelEntry *model,
Tqdcfr::BlockHeader *blockh)
{
+
if (blockh->memCt == 0) return MB_SUCCESS;
// position file
@@ -945,24 +946,35 @@ ErrorCode Tqdcfr::read_block(const unsigned int blindex,
ErrorCode result = put_into_set(blockh->setHandle, block_entities, excl_entities);
if (MB_SUCCESS != result) return result;
- // read attribs if there are any
+ // read attribs if there are any
+ // <-- likask
+ Tag block_attribs;
+ {
+ int def_Block_Attributes_lenght = 0;
+ result = mdbImpl->tag_get_handle("Block_Attributes",def_Block_Attributes_lenght,MB_TYPE_DOUBLE,
+ block_attribs,MB_TAG_CREAT|MB_TAG_SPARSE|MB_TAG_VARLEN,NULL);
+ if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
+ }
if (blockh->attribOrder > 0) {
- Tag block_attribs;
-
+
FREADD(blockh->attribOrder); num_read += sizeof(double);
- // now do something with them...
+ // now do something with them...
// This code seems broken. It is apparently supposed to read
// blockh->attribOrder values for each block and store them in
// a tag. However, blockh->attribOrder is not a constant
// so the same fixed-length tag cannot be used for all blocks.
// For now, just store one value, as that was what the buggy code
// previously did.
- result = mdbImpl->tag_get_handle("Block_Attributes", 1/*blockh->attribOrder*/,
- MB_TYPE_DOUBLE, block_attribs,
- MB_TAG_SPARSE|MB_TAG_CREAT);
- if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
- result = mdbImpl->tag_set_data(block_attribs, &(blockh->setHandle), 1,
- &(dbl_buf[0]));
+ //result = mdbImpl->tag_get_handle("Block_Attributes", 1 /*blockh->attribOrder*/,
+ //MB_TYPE_DOUBLE, block_attribs,
+ //MB_TAG_SPARSE|MB_TAG_CREAT);
+ //if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
+ //result = mdbImpl->tag_set_data(block_attribs, &(blockh->setHandle), 1,
+ //&(dbl_buf[0]));
+ // <- likask
+ void const* tag_data[] = { &dbl_buf[0] };
+ int tag_sizes[] = { blockh->attribOrder };
+ result = mdbImpl->tag_set_by_ptr(block_attribs,&(blockh->setHandle),1,tag_data,tag_sizes);
if (MB_SUCCESS != result) return result;
}
@@ -1922,6 +1934,16 @@ ErrorCode Tqdcfr::BlockHeader::read_info_header(const double data_version,
block_headers[i].blockLength = instance->uint_buf[10];
block_headers[i].blockDim = instance->uint_buf[11];
+ // <-likask
+ std::vector<unsigned int> def_uint_zero(12,0);
+ Tag bhTag_header;
+ result = instance->mdbImpl->tag_get_handle("BLOCK_HEADER",12*sizeof(unsigned int),MB_TYPE_INTEGER,
+ bhTag_header,MB_TAG_CREAT|MB_TAG_SPARSE|MB_TAG_BYTES,&def_uint_zero[0]);
+ if (MB_SUCCESS != result) return result;
+ result = instance->mdbImpl->tag_set_data(bhTag_header,&(block_headers[i].setHandle), 1,
+ &(instance->uint_buf[0]));
+ if (MB_SUCCESS != result) return result;
+
// adjust element type for data version; older element types didn't include
// 4 new trishell element types
if (data_version <= 1.0 && block_headers[i].blockElemType >= 15)
https://bitbucket.org/fathomteam/moab/commits/0416f322f684/
Changeset: 0416f322f684
Branch: None
User: likask
Date: 2013-09-22 23:15:52
Summary: Merged fathomteam/moab into master
Affected #: 13 files
diff --git a/MeshFiles/unittest/16_unmerged_hex.h5m b/MeshFiles/unittest/16_unmerged_hex.h5m
new file mode 100644
index 0000000..2ebde86
Binary files /dev/null and b/MeshFiles/unittest/16_unmerged_hex.h5m differ
diff --git a/MeshFiles/unittest/Makefile.am b/MeshFiles/unittest/Makefile.am
index 16dc2ed..a1784ee 100644
--- a/MeshFiles/unittest/Makefile.am
+++ b/MeshFiles/unittest/Makefile.am
@@ -1,6 +1,7 @@
SUBDIRS = io
EXTRA_DIST = 125hex.g \
+ 16_unmerged_hex.h5m \
1hex.g \
1khex.g \
1tet.g \
diff --git a/config/compiler.m4 b/config/compiler.m4
index 6a7e2ed..ce83a5f 100644
--- a/config/compiler.m4
+++ b/config/compiler.m4
@@ -222,6 +222,14 @@ if test "xyes" = "x$enable_debug"; then
CFLAGS="$CFLAGS -g"
FCFLAGS="$FCFLAGS -g"
FFLAGS="$FFLAGS -g"
+ # Add -fstack-protector-all option for g++ in debug mode
+ if test "x$cxx_compiler" = "xGNU"; then
+ CXXFLAGS="$CXXFLAGS -fstack-protector-all"
+ fi
+ # Add -fstack-protector-all option for gcc in debug mode
+ if test "x$cc_compiler" = "xGNU"; then
+ CFLAGS="$CFLAGS -fstack-protector-all"
+ fi
fi
if test "xyes" = "x$enable_cxx_optimize"; then
CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG"
diff --git a/examples/HelloMOAB.cpp b/examples/HelloMOAB.cpp
index 6129233..6ca2b23 100644
--- a/examples/HelloMOAB.cpp
+++ b/examples/HelloMOAB.cpp
@@ -57,6 +57,8 @@ int main( int argc, char** argv )
cout << "Number of edges is " << edges.size() << endl;
cout << "Number of faces is " << faces.size() << endl;
cout << "Number of elements is " << elems.size() << endl;
-
+
+ delete iface;
+
return 0;
}
diff --git a/src/MergeMesh.cpp b/src/MergeMesh.cpp
index 4cc8158..7293e17 100644
--- a/src/MergeMesh.cpp
+++ b/src/MergeMesh.cpp
@@ -61,7 +61,7 @@ moab::ErrorCode MergeMesh::merge_entities(moab::Range &elems,
// get the skin of the entities
moab::Skinner skinner(mbImpl);
moab::Range skin_range;
- moab::ErrorCode result = skinner.find_skin(0, elems, 0, skin_range);
+ moab::ErrorCode result = skinner.find_skin(0, elems, 0, skin_range, false, false);
if (moab::MB_SUCCESS != result) return result;
// create a tag to mark merged-to entity; reuse tree_root
@@ -232,16 +232,16 @@ moab::ErrorCode MergeMesh::merge_higher_dimensions(moab::Range &elems)
for(int dim = 1; dim <3; dim++){
skinEnts.clear();
moreDeadEnts.clear();
- result = skinner.find_skin(0, elems, dim, skinEnts);
+ result = skinner.find_skin(0, elems, dim, skinEnts, false, false);
//Go through each skin entity and see if it shares adjacancies with another entity
for(moab::Range::iterator skinIt = skinEnts.begin(); skinIt != skinEnts.end(); skinIt++){
adj.clear();
//Get the adjacencies 1 dimension lower
- result = mbImpl->get_adjacencies(&(*skinIt), 1, dim-1, true, adj);
+ result = mbImpl->get_adjacencies(&(*skinIt), 1, dim-1, false, adj);
if(result != moab::MB_SUCCESS) return result;
//See what other entities share these adjacencies
matches.clear();
- result = mbImpl->get_adjacencies(adj, dim, true, matches, moab::Interface::INTERSECT);
+ result = mbImpl->get_adjacencies(adj, dim, false, matches, moab::Interface::INTERSECT);
if(result != moab::MB_SUCCESS) return result;
//If there is more than one entity, then we have some to merge and erase
if(matches.size() > 1){
diff --git a/src/Skinner.cpp b/src/Skinner.cpp
index b5fd24e..c3c6b1b 100644
--- a/src/Skinner.cpp
+++ b/src/Skinner.cpp
@@ -1015,11 +1015,12 @@ ErrorCode Skinner::find_skin(const EntityHandle this_set,
const Range &entities,
int dim,
Range &skin_entities,
- bool create_vert_elem_adjs)
+ bool create_vert_elem_adjs,
+ bool create_skin_elements)
{
Range tmp_skin;
ErrorCode result = find_skin(this_set, entities, (dim==0), tmp_skin, 0,
- create_vert_elem_adjs, true);
+ create_vert_elem_adjs, create_skin_elements);
if (MB_SUCCESS != result || tmp_skin.empty()) return result;
if (tmp_skin.all_of_dimension(dim)) {
@@ -1029,7 +1030,7 @@ ErrorCode Skinner::find_skin(const EntityHandle this_set,
skin_entities.merge(tmp_skin);
}
else {
- result = thisMB->get_adjacencies( tmp_skin, dim, true, skin_entities,
+ result = thisMB->get_adjacencies( tmp_skin, dim, create_skin_elements, skin_entities,
Interface::UNION );
}
diff --git a/src/io/NCHelperHOMME.cpp b/src/io/NCHelperHOMME.cpp
index 4f2ac51..f750e78 100644
--- a/src/io/NCHelperHOMME.cpp
+++ b/src/io/NCHelperHOMME.cpp
@@ -232,7 +232,7 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
conn_fname = "HommeMapping.nc";
}
- int success;
+ int success = 0;
int rank = 0;
int procs = 1;
@@ -265,9 +265,11 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
ERRORR(rval, "Failed to get dimensions for connectivity.");
// Read connectivity into temporary variable
- int num_fine_quads, num_coarse_quads, start_idx;
+ int num_fine_quads = 0;
+ int num_coarse_quads = 0;
+ int start_idx = 0;
std::vector<std::string>::iterator vit;
- int idx;
+ int idx = 0;
if ((vit = std::find(conn_names.begin(), conn_names.end(), "ncells")) != conn_names.end())
idx = vit - conn_names.begin();
else if ((vit = std::find(conn_names.begin(), conn_names.end(), "ncenters")) != conn_names.end())
diff --git a/src/moab/Skinner.hpp b/src/moab/Skinner.hpp
index 7ec5450..4eb2f51 100644
--- a/src/moab/Skinner.hpp
+++ b/src/moab/Skinner.hpp
@@ -119,7 +119,8 @@ public:
const Range &entities,
int dim,
Range &skin_entities,
- bool create_vert_elem_adjs = false);
+ bool create_vert_elem_adjs = false,
+ bool create_skin_elements = true);
ErrorCode classify_2d_boundary( const Range &boundary,
const Range &bar_elements,
diff --git a/test/Makefile.am b/test/Makefile.am
index e4d591f..99c5211 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -54,6 +54,7 @@ if HDF5_FILE
TESTS += mbfacet_test \
gttool_test \
cropvol_test \
+ mergemesh_test \
mbground_test
endif
@@ -75,6 +76,7 @@ MOSTLYCLEANFILES = mb_write.g \
tri_mid_edge_face_nodes.g \
mb_stress_out.g \
merge_test.g \
+ mm_out.h5m \
tree.h5m
# Tests and such
@@ -123,6 +125,7 @@ var_len_test_no_template_CPPFLAGS = -UTEMPLATE_SPECIALIZATION $(AM_CPPFLAGS) $(C
tag_test_SOURCES = TestUtil.hpp TagTest.cpp
spatial_locator_test_SOURCES = TestUtil.hpp spatial_locator_test.cpp
+mergemesh_test_SOURCES = mergemesh_test.cpp
mbcn_test_SOURCES = $(top_srcdir)/src/moab/CN.hpp \
$(top_srcdir)/src/CN.cpp \
diff --git a/test/mergemesh_test.cpp b/test/mergemesh_test.cpp
new file mode 100644
index 0000000..fca5304
--- /dev/null
+++ b/test/mergemesh_test.cpp
@@ -0,0 +1,48 @@
+#include "moab/Core.hpp"
+#include "moab/Range.hpp"
+#include "moab/MergeMesh.hpp"
+#include <iostream>
+
+#define STRINGIFY_(A) #A
+#define STRINGIFY(A) STRINGIFY_(A)
+
+using namespace moab;
+
+const char* meshfile = STRINGIFY(MESHDIR) "/16_unmerged_hex.h5m";
+
+
+int main( int argc, char* argv[] )
+{
+ Core moab_core;
+ ErrorCode rval;
+ Interface* iface = &moab_core;
+ // can be generalized to load user defined input/output file
+// std::cout << "loading mesh file " << (std::string) meshfile << std::endl;
+ rval = iface->load_mesh(meshfile);
+ if (MB_SUCCESS != rval) {
+ std::cerr << "Error reading file: " << meshfile << std::endl;
+ exit(2);
+ }
+ int dim = 3;
+ moab::Range ents;
+ iface->get_entities_by_dimension(0, dim, ents);
+
+ MergeMesh mm(iface);
+ double merge_tol = 1e-3;
+ bool merge_higher_dim_entities = true;
+
+ rval = mm.merge_entities(ents, merge_tol, merge_higher_dim_entities);
+ if (MB_SUCCESS != rval) {
+ std::cerr << "Error in MergeMesh during merging entities" << std::endl;
+ exit(2);
+ }
+
+ // Fixed for now
+ const char *outfile = "mm_out.h5m";
+ rval = iface->write_mesh( outfile);
+ if (MB_SUCCESS != rval) {
+ std::cerr << "Error saving file: " << outfile << std::endl;
+ exit(2);
+ }
+ return 0;
+}
diff --git a/tools/mbcoupler/Coupler.cpp b/tools/mbcoupler/Coupler.cpp
index 71231b8..f7f74b2 100644
--- a/tools/mbcoupler/Coupler.cpp
+++ b/tools/mbcoupler/Coupler.cpp
@@ -6,6 +6,7 @@
#include "iMesh_extensions.h"
#include "moab/gs.hpp"
#include "moab/TupleList.hpp"
+#include "moab/Error.hpp"
#include "iostream"
#include <stdio.h>
#include <algorithm>
@@ -518,6 +519,27 @@ ErrorCode Coupler::test_local_box(double *xyz,
return MB_SUCCESS;
}
+ErrorCode Coupler::interpolate(Coupler::Method method,
+ const std::string &interp_tag,
+ double *interp_vals,
+ TupleList *tl,
+ bool normalize)
+{
+ Tag tag;
+ ErrorCode result ;
+ if (_spectralSource)
+ result = mbImpl->tag_get_handle(interp_tag.c_str(), _ntot, MB_TYPE_DOUBLE, tag);
+ else
+ result = mbImpl->tag_get_handle(interp_tag.c_str(), 1, MB_TYPE_DOUBLE, tag);
+ if (MB_SUCCESS != result) {
+ std::ostringstream str;
+ str << "Failed to get handle for interpolation tag \"" << interp_tag << "\"";
+ mError->set_last_error(str.str());
+ return result;
+ }
+ return interpolate(method, tag, interp_vals, tl, normalize);
+}
+
ErrorCode Coupler::interpolate(Coupler::Method *methods,
Tag *tags,
int *points_per_method,
diff --git a/tools/mbcoupler/Coupler.hpp b/tools/mbcoupler/Coupler.hpp
index 74170d5..705e2dc 100644
--- a/tools/mbcoupler/Coupler.hpp
+++ b/tools/mbcoupler/Coupler.hpp
@@ -29,7 +29,6 @@
#include "moab/Interface.hpp"
#include "moab/CartVect.hpp"
#include "moab/TupleList.hpp"
-#include "moab/Error.hpp"
#include <sstream>
@@ -41,6 +40,8 @@ class AdaptiveKDTree;
class TupleList;
+class Error;
+
class Coupler
{
public:
@@ -530,27 +531,6 @@ private:
// error object used to set last error on interface
Error *mError;
};
-
-inline ErrorCode Coupler::interpolate(Coupler::Method method,
- const std::string &interp_tag,
- double *interp_vals,
- TupleList *tl,
- bool normalize)
-{
- Tag tag;
- ErrorCode result ;
- if (_spectralSource)
- result = mbImpl->tag_get_handle(interp_tag.c_str(), _ntot, MB_TYPE_DOUBLE, tag);
- else
- result = mbImpl->tag_get_handle(interp_tag.c_str(), 1, MB_TYPE_DOUBLE, tag);
- if (MB_SUCCESS != result) {
- std::ostringstream str;
- str << "Failed to get handle for interpolation tag \"" << interp_tag << "\"";
- mError->set_last_error(str.str());
- return result;
- }
- return interpolate(method, tag, interp_vals, tl, normalize);
-}
inline ErrorCode Coupler::interpolate(Coupler::Method method,
Tag tag,
diff --git a/tools/mbcslam/Intx2MeshOnSphere.cpp b/tools/mbcslam/Intx2MeshOnSphere.cpp
index a875d7b..0952ef6 100644
--- a/tools/mbcslam/Intx2MeshOnSphere.cpp
+++ b/tools/mbcslam/Intx2MeshOnSphere.cpp
@@ -439,10 +439,10 @@ ErrorCode Intx2MeshOnSphere::update_tracer_data(EntityHandle out_set, Tag & tagE
int blueIndex, redIndex;
rval = mb->tag_get_data(blueParentTag, &poly, 1, &blueIndex);
ERRORR(rval, "can't get blue tag");
- EntityHandle blue = rs1[blueIndex];
+ //EntityHandle blue = rs1[blueIndex];
rval = mb->tag_get_data(redParentTag, &poly, 1, &redIndex);
ERRORR(rval, "can't get red tag");
- EntityHandle red=rs2[redIndex];
+ //EntityHandle red = rs2[redIndex];
// big assumption here, red and blue are "parallel" ;we should have an index from
// blue to red (so a deformed blue corresponds to an arrival red)
double areap = area_spherical_element(mb, poly, R);
https://bitbucket.org/fathomteam/moab/commits/836d872d1bc3/
Changeset: 836d872d1bc3
Branch: None
User: Lukasz Kaczmarczyk
Date: 2013-10-03 22:21:53
Summary: use variable names w/o capitalisation and correction of spelling mistake
Affected #: 1 file
diff --git a/src/io/Tqdcfr.cpp b/src/io/Tqdcfr.cpp
index 2d24e0e..cb2ea2a 100644
--- a/src/io/Tqdcfr.cpp
+++ b/src/io/Tqdcfr.cpp
@@ -950,8 +950,8 @@ ErrorCode Tqdcfr::read_block(const unsigned int blindex,
// <-- likask
Tag block_attribs;
{
- int def_Block_Attributes_lenght = 0;
- result = mdbImpl->tag_get_handle("Block_Attributes",def_Block_Attributes_lenght,MB_TYPE_DOUBLE,
+ int def_block_attributes_length = 0;
+ result = mdbImpl->tag_get_handle("Block_Attributes",def_block_attributes_length,MB_TYPE_DOUBLE,
block_attribs,MB_TAG_CREAT|MB_TAG_SPARSE|MB_TAG_VARLEN,NULL);
if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
}
https://bitbucket.org/fathomteam/moab/commits/07b79036c614/
Changeset: 07b79036c614
Branch: None
User: Lukasz Kaczmarczyk
Date: 2013-10-03 23:36:42
Summary: add nee tags name to MBTagConventions.hpp
do changes in Tqdcfr.cpp, cleaning unnecessary comments and tags names
Affected #: 2 files
diff --git a/src/MBTagConventions.hpp b/src/MBTagConventions.hpp
index 61e5732..5cb518f 100644
--- a/src/MBTagConventions.hpp
+++ b/src/MBTagConventions.hpp
@@ -108,6 +108,18 @@
#define NAME_TAG_NAME "NAME"
#define NAME_TAG_SIZE 32
+/* BLOCK_HEADER: tag
+ * A fixex lenght tag containg block header data
+ * BlockColor, MaterialId and BlockDimension
+ */
+#define BLOCK_HEADER "BLOCK_HEADER"
+
+/* BLOCK_ATTRIBUTES: tag
+ * A varible lenght tag of doubles
+ * Tag contains attributes set to BlockSet in cubit file
+ */
+#define BLOCK_ATTRIBUTES "BLOCK_ATTRIBUTES"
+
#ifndef MB_PARALLEL_CONVENTIONS_H
#define MB_PARALLEL_CONVENTIONS_H
diff --git a/src/io/Tqdcfr.cpp b/src/io/Tqdcfr.cpp
index cb2ea2a..21fc253 100644
--- a/src/io/Tqdcfr.cpp
+++ b/src/io/Tqdcfr.cpp
@@ -588,7 +588,6 @@ ErrorCode Tqdcfr::read_nodeset(const unsigned int nsindex,
if (MB_SUCCESS != result) return result;
}
// check for more data
- // <- likask
if (num_read < nodeseth->nsLength) {
FREADC(2); num_read += 2;
if (char_buf[0] == 'i' && char_buf[1] == 'd') {
@@ -604,7 +603,7 @@ ErrorCode Tqdcfr::read_nodeset(const unsigned int nsindex,
}
}
- if(debug) { // <-likask
+ if(debug) {
nodeseth->print();
if(!bc_data.empty()) {
std::cout << "bc_data = ";
@@ -619,7 +618,7 @@ ErrorCode Tqdcfr::read_nodeset(const unsigned int nsindex,
}
std::cout << std::endl;
}
- } // <-likask
+ }
// and put entities into this nodeset's set
ErrorCode result = put_into_set(nodeseth->setHandle, ns_entities, excl_entities);
@@ -628,7 +627,6 @@ ErrorCode Tqdcfr::read_nodeset(const unsigned int nsindex,
result = get_names(model->nodesetMD, nsindex, nodeseth->setHandle);
if (MB_SUCCESS != result) return result;
- // <-likask
const int def_bc_data_len = 0;
std::string tag_name = std::string(DIRICHLET_SET_TAG_NAME)+"__BC_DATA";
Tag nbc_data;
@@ -757,7 +755,7 @@ ErrorCode Tqdcfr::read_sideset(const unsigned int ssindex,
}
}
- if(debug) { // <-likask
+ if(debug) {
sideseth->print();
if(!bc_data.empty()) {
std::cout << "bc_data = ";
@@ -772,12 +770,11 @@ ErrorCode Tqdcfr::read_sideset(const unsigned int ssindex,
}
std::cout << std::endl;
}
- } // <-likask
+ }
result = get_names(model->sidesetMD, ssindex, sideseth->setHandle);
if (MB_SUCCESS != result) return result;
- // <-likask
const int def_bc_data_len = 0;
std::string tag_name = std::string(NEUMANN_SET_TAG_NAME)+"__BC_DATA";
Tag nbc_data;
@@ -947,31 +944,16 @@ ErrorCode Tqdcfr::read_block(const unsigned int blindex,
if (MB_SUCCESS != result) return result;
// read attribs if there are any
- // <-- likask
Tag block_attribs;
{
int def_block_attributes_length = 0;
- result = mdbImpl->tag_get_handle("Block_Attributes",def_block_attributes_length,MB_TYPE_DOUBLE,
+ result = mdbImpl->tag_get_handle(BLOCK_ATTRIBUTES,def_block_attributes_length,MB_TYPE_DOUBLE,
block_attribs,MB_TAG_CREAT|MB_TAG_SPARSE|MB_TAG_VARLEN,NULL);
if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
}
if (blockh->attribOrder > 0) {
FREADD(blockh->attribOrder); num_read += sizeof(double);
- // now do something with them...
- // This code seems broken. It is apparently supposed to read
- // blockh->attribOrder values for each block and store them in
- // a tag. However, blockh->attribOrder is not a constant
- // so the same fixed-length tag cannot be used for all blocks.
- // For now, just store one value, as that was what the buggy code
- // previously did.
- //result = mdbImpl->tag_get_handle("Block_Attributes", 1 /*blockh->attribOrder*/,
- //MB_TYPE_DOUBLE, block_attribs,
- //MB_TAG_SPARSE|MB_TAG_CREAT);
- //if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
- //result = mdbImpl->tag_set_data(block_attribs, &(blockh->setHandle), 1,
- //&(dbl_buf[0]));
- // <- likask
void const* tag_data[] = { &dbl_buf[0] };
int tag_sizes[] = { blockh->attribOrder };
result = mdbImpl->tag_set_by_ptr(block_attribs,&(blockh->setHandle),1,tag_data,tag_sizes);
@@ -1934,14 +1916,14 @@ ErrorCode Tqdcfr::BlockHeader::read_info_header(const double data_version,
block_headers[i].blockLength = instance->uint_buf[10];
block_headers[i].blockDim = instance->uint_buf[11];
- // <-likask
- std::vector<unsigned int> def_uint_zero(12,0);
Tag bhTag_header;
- result = instance->mdbImpl->tag_get_handle("BLOCK_HEADER",12*sizeof(unsigned int),MB_TYPE_INTEGER,
+ std::vector<unsigned int> def_uint_zero(3,0);
+ result = instance->mdbImpl->tag_get_handle(BLOCK_HEADER,3*sizeof(unsigned int),MB_TYPE_INTEGER,
bhTag_header,MB_TAG_CREAT|MB_TAG_SPARSE|MB_TAG_BYTES,&def_uint_zero[0]);
if (MB_SUCCESS != result) return result;
+ int block_header_data[] = { block_headers[i].blockCol, block_headers[i].blockMat, block_headers[i].blockDim };
result = instance->mdbImpl->tag_set_data(bhTag_header,&(block_headers[i].setHandle), 1,
- &(instance->uint_buf[0]));
+ block_header_data);
if (MB_SUCCESS != result) return result;
// adjust element type for data version; older element types didn't include
https://bitbucket.org/fathomteam/moab/commits/bbf82ab9f139/
Changeset: bbf82ab9f139
Branch: None
User: Lukasz Kaczmarczyk
Date: 2013-10-03 23:40:46
Summary: changes for cubit file reader
add varible lenght tag for saving block attributes
add fixed lenght tag for block header
add tags name to MBTagConventions.hpp do changes in Tqdcfr.cpp, cleaning unnecessary comments and tags names
Affected #: 2 files
diff --git a/src/MBTagConventions.hpp b/src/MBTagConventions.hpp
index 61e5732..5cb518f 100644
--- a/src/MBTagConventions.hpp
+++ b/src/MBTagConventions.hpp
@@ -108,6 +108,18 @@
#define NAME_TAG_NAME "NAME"
#define NAME_TAG_SIZE 32
+/* BLOCK_HEADER: tag
+ * A fixex lenght tag containg block header data
+ * BlockColor, MaterialId and BlockDimension
+ */
+#define BLOCK_HEADER "BLOCK_HEADER"
+
+/* BLOCK_ATTRIBUTES: tag
+ * A varible lenght tag of doubles
+ * Tag contains attributes set to BlockSet in cubit file
+ */
+#define BLOCK_ATTRIBUTES "BLOCK_ATTRIBUTES"
+
#ifndef MB_PARALLEL_CONVENTIONS_H
#define MB_PARALLEL_CONVENTIONS_H
diff --git a/src/io/Tqdcfr.cpp b/src/io/Tqdcfr.cpp
index 717f43a..21fc253 100644
--- a/src/io/Tqdcfr.cpp
+++ b/src/io/Tqdcfr.cpp
@@ -588,7 +588,6 @@ ErrorCode Tqdcfr::read_nodeset(const unsigned int nsindex,
if (MB_SUCCESS != result) return result;
}
// check for more data
- // <- likask
if (num_read < nodeseth->nsLength) {
FREADC(2); num_read += 2;
if (char_buf[0] == 'i' && char_buf[1] == 'd') {
@@ -604,7 +603,7 @@ ErrorCode Tqdcfr::read_nodeset(const unsigned int nsindex,
}
}
- if(debug) { // <-likask
+ if(debug) {
nodeseth->print();
if(!bc_data.empty()) {
std::cout << "bc_data = ";
@@ -619,7 +618,7 @@ ErrorCode Tqdcfr::read_nodeset(const unsigned int nsindex,
}
std::cout << std::endl;
}
- } // <-likask
+ }
// and put entities into this nodeset's set
ErrorCode result = put_into_set(nodeseth->setHandle, ns_entities, excl_entities);
@@ -628,7 +627,6 @@ ErrorCode Tqdcfr::read_nodeset(const unsigned int nsindex,
result = get_names(model->nodesetMD, nsindex, nodeseth->setHandle);
if (MB_SUCCESS != result) return result;
- // <-likask
const int def_bc_data_len = 0;
std::string tag_name = std::string(DIRICHLET_SET_TAG_NAME)+"__BC_DATA";
Tag nbc_data;
@@ -757,7 +755,7 @@ ErrorCode Tqdcfr::read_sideset(const unsigned int ssindex,
}
}
- if(debug) { // <-likask
+ if(debug) {
sideseth->print();
if(!bc_data.empty()) {
std::cout << "bc_data = ";
@@ -772,12 +770,11 @@ ErrorCode Tqdcfr::read_sideset(const unsigned int ssindex,
}
std::cout << std::endl;
}
- } // <-likask
+ }
result = get_names(model->sidesetMD, ssindex, sideseth->setHandle);
if (MB_SUCCESS != result) return result;
- // <-likask
const int def_bc_data_len = 0;
std::string tag_name = std::string(NEUMANN_SET_TAG_NAME)+"__BC_DATA";
Tag nbc_data;
@@ -916,6 +913,7 @@ ErrorCode Tqdcfr::read_block(const unsigned int blindex,
Tqdcfr::ModelEntry *model,
Tqdcfr::BlockHeader *blockh)
{
+
if (blockh->memCt == 0) return MB_SUCCESS;
// position file
@@ -945,24 +943,20 @@ ErrorCode Tqdcfr::read_block(const unsigned int blindex,
ErrorCode result = put_into_set(blockh->setHandle, block_entities, excl_entities);
if (MB_SUCCESS != result) return result;
- // read attribs if there are any
+ // read attribs if there are any
+ Tag block_attribs;
+ {
+ int def_block_attributes_length = 0;
+ result = mdbImpl->tag_get_handle(BLOCK_ATTRIBUTES,def_block_attributes_length,MB_TYPE_DOUBLE,
+ block_attribs,MB_TAG_CREAT|MB_TAG_SPARSE|MB_TAG_VARLEN,NULL);
+ if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
+ }
if (blockh->attribOrder > 0) {
- Tag block_attribs;
-
+
FREADD(blockh->attribOrder); num_read += sizeof(double);
- // now do something with them...
- // This code seems broken. It is apparently supposed to read
- // blockh->attribOrder values for each block and store them in
- // a tag. However, blockh->attribOrder is not a constant
- // so the same fixed-length tag cannot be used for all blocks.
- // For now, just store one value, as that was what the buggy code
- // previously did.
- result = mdbImpl->tag_get_handle("Block_Attributes", 1/*blockh->attribOrder*/,
- MB_TYPE_DOUBLE, block_attribs,
- MB_TAG_SPARSE|MB_TAG_CREAT);
- if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
- result = mdbImpl->tag_set_data(block_attribs, &(blockh->setHandle), 1,
- &(dbl_buf[0]));
+ void const* tag_data[] = { &dbl_buf[0] };
+ int tag_sizes[] = { blockh->attribOrder };
+ result = mdbImpl->tag_set_by_ptr(block_attribs,&(blockh->setHandle),1,tag_data,tag_sizes);
if (MB_SUCCESS != result) return result;
}
@@ -1922,6 +1916,16 @@ ErrorCode Tqdcfr::BlockHeader::read_info_header(const double data_version,
block_headers[i].blockLength = instance->uint_buf[10];
block_headers[i].blockDim = instance->uint_buf[11];
+ Tag bhTag_header;
+ std::vector<unsigned int> def_uint_zero(3,0);
+ result = instance->mdbImpl->tag_get_handle(BLOCK_HEADER,3*sizeof(unsigned int),MB_TYPE_INTEGER,
+ bhTag_header,MB_TAG_CREAT|MB_TAG_SPARSE|MB_TAG_BYTES,&def_uint_zero[0]);
+ if (MB_SUCCESS != result) return result;
+ int block_header_data[] = { block_headers[i].blockCol, block_headers[i].blockMat, block_headers[i].blockDim };
+ result = instance->mdbImpl->tag_set_data(bhTag_header,&(block_headers[i].setHandle), 1,
+ block_header_data);
+ if (MB_SUCCESS != result) return result;
+
// adjust element type for data version; older element types didn't include
// 4 new trishell element types
if (data_version <= 1.0 && block_headers[i].blockElemType >= 15)
https://bitbucket.org/fathomteam/moab/commits/31d1d81cb130/
Changeset: 31d1d81cb130
Branch: None
User: Lukasz Kaczmarczyk
Date: 2013-10-03 23:42:50
Summary: Merge branch 'block_atributes_cubit_file_reading' of https://bitbucket.org/likask/moab into block_atributes_cubit_file_reading
* 'block_atributes_cubit_file_reading' of https://bitbucket.org/likask/moab:
add nee tags name to MBTagConventions.hpp do changes in Tqdcfr.cpp, cleaning unnecessary comments and tags names
use variable names w/o capitalisation and correction of spelling mistake
cubit file, block data attributes in variable length tag
Affected #: 0 files
https://bitbucket.org/fathomteam/moab/commits/f62e9a9a1033/
Changeset: f62e9a9a1033
Branch: None
User: Lukasz Kaczmarczyk
Date: 2013-10-03 23:48:52
Summary: cosmetic changes
Affected #: 1 file
diff --git a/src/io/Tqdcfr.cpp b/src/io/Tqdcfr.cpp
index 21fc253..c45f412 100644
--- a/src/io/Tqdcfr.cpp
+++ b/src/io/Tqdcfr.cpp
@@ -1917,13 +1917,16 @@ ErrorCode Tqdcfr::BlockHeader::read_info_header(const double data_version,
block_headers[i].blockDim = instance->uint_buf[11];
Tag bhTag_header;
- std::vector<unsigned int> def_uint_zero(3,0);
- result = instance->mdbImpl->tag_get_handle(BLOCK_HEADER,3*sizeof(unsigned int),MB_TYPE_INTEGER,
- bhTag_header,MB_TAG_CREAT|MB_TAG_SPARSE|MB_TAG_BYTES,&def_uint_zero[0]);
- if (MB_SUCCESS != result) return result;
- int block_header_data[] = { block_headers[i].blockCol, block_headers[i].blockMat, block_headers[i].blockDim };
- result = instance->mdbImpl->tag_set_data(bhTag_header,&(block_headers[i].setHandle), 1,
+ {
+ std::vector<int> def_uint_zero(3,0);
+ result = instance->mdbImpl->tag_get_handle(BLOCK_HEADER,3*sizeof(unsigned int),MB_TYPE_INTEGER,
+ bhTag_header,MB_TAG_CREAT|MB_TAG_SPARSE|MB_TAG_BYTES,&def_uint_zero[0]);
+ if (MB_SUCCESS != result) return result;
+ int block_header_data[] = { block_headers[i].blockCol, block_headers[i].blockMat, block_headers[i].blockDim };
+ result = instance->mdbImpl->tag_set_data(bhTag_header,&(block_headers[i].setHandle), 1,
block_header_data);
+ }
+
if (MB_SUCCESS != result) return result;
// adjust element type for data version; older element types didn't include
https://bitbucket.org/fathomteam/moab/commits/9522b060e29d/
Changeset: 9522b060e29d
Branch: master
User: vijaysm
Date: 2014-02-28 21:51:00
Summary: Merged in likask/moab/block_atributes_cubit_file_reading (pull request #15)
block attributes and block header for cubit file reader
Affected #: 2 files
diff --git a/src/MBTagConventions.hpp b/src/MBTagConventions.hpp
index 61e5732..5cb518f 100644
--- a/src/MBTagConventions.hpp
+++ b/src/MBTagConventions.hpp
@@ -108,6 +108,18 @@
#define NAME_TAG_NAME "NAME"
#define NAME_TAG_SIZE 32
+/* BLOCK_HEADER: tag
+ * A fixex lenght tag containg block header data
+ * BlockColor, MaterialId and BlockDimension
+ */
+#define BLOCK_HEADER "BLOCK_HEADER"
+
+/* BLOCK_ATTRIBUTES: tag
+ * A varible lenght tag of doubles
+ * Tag contains attributes set to BlockSet in cubit file
+ */
+#define BLOCK_ATTRIBUTES "BLOCK_ATTRIBUTES"
+
#ifndef MB_PARALLEL_CONVENTIONS_H
#define MB_PARALLEL_CONVENTIONS_H
diff --git a/src/io/Tqdcfr.cpp b/src/io/Tqdcfr.cpp
index afc0493..701ff15 100644
--- a/src/io/Tqdcfr.cpp
+++ b/src/io/Tqdcfr.cpp
@@ -592,7 +592,6 @@ ErrorCode Tqdcfr::read_nodeset(const unsigned int nsindex,
if (MB_SUCCESS != result) return result;
}
// check for more data
- // <- likask
if (num_read < nodeseth->nsLength) {
FREADC(2); num_read += 2;
if (char_buf[0] == 'i' && char_buf[1] == 'd') {
@@ -608,7 +607,7 @@ ErrorCode Tqdcfr::read_nodeset(const unsigned int nsindex,
}
}
- if(debug) { // <-likask
+ if(debug) {
nodeseth->print();
if(!bc_data.empty()) {
std::cout << "bc_data = ";
@@ -623,7 +622,7 @@ ErrorCode Tqdcfr::read_nodeset(const unsigned int nsindex,
}
std::cout << std::endl;
}
- } // <-likask
+ }
// and put entities into this nodeset's set
ErrorCode result = put_into_set(nodeseth->setHandle, ns_entities, excl_entities);
@@ -632,7 +631,6 @@ ErrorCode Tqdcfr::read_nodeset(const unsigned int nsindex,
result = get_names(model->nodesetMD, nsindex, nodeseth->setHandle);
if (MB_SUCCESS != result) return result;
- // <-likask
const int def_bc_data_len = 0;
std::string tag_name = std::string(DIRICHLET_SET_TAG_NAME)+"__BC_DATA";
Tag nbc_data;
@@ -761,7 +759,7 @@ ErrorCode Tqdcfr::read_sideset(const unsigned int ssindex,
}
}
- if(debug) { // <-likask
+ if(debug) {
sideseth->print();
if(!bc_data.empty()) {
std::cout << "bc_data = ";
@@ -776,12 +774,11 @@ ErrorCode Tqdcfr::read_sideset(const unsigned int ssindex,
}
std::cout << std::endl;
}
- } // <-likask
+ }
result = get_names(model->sidesetMD, ssindex, sideseth->setHandle);
if (MB_SUCCESS != result) return result;
- // <-likask
const int def_bc_data_len = 0;
std::string tag_name = std::string(NEUMANN_SET_TAG_NAME)+"__BC_DATA";
Tag nbc_data;
@@ -920,6 +917,7 @@ ErrorCode Tqdcfr::read_block(const unsigned int blindex,
Tqdcfr::ModelEntry *model,
Tqdcfr::BlockHeader *blockh)
{
+
if (blockh->memCt == 0) return MB_SUCCESS;
// position file
@@ -949,24 +947,20 @@ ErrorCode Tqdcfr::read_block(const unsigned int blindex,
ErrorCode result = put_into_set(blockh->setHandle, block_entities, excl_entities);
if (MB_SUCCESS != result) return result;
- // read attribs if there are any
+ // read attribs if there are any
+ Tag block_attribs;
+ {
+ int def_block_attributes_length = 0;
+ result = mdbImpl->tag_get_handle(BLOCK_ATTRIBUTES,def_block_attributes_length,MB_TYPE_DOUBLE,
+ block_attribs,MB_TAG_CREAT|MB_TAG_SPARSE|MB_TAG_VARLEN,NULL);
+ if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
+ }
if (blockh->attribOrder > 0) {
- Tag block_attribs;
-
+
FREADD(blockh->attribOrder); num_read += sizeof(double);
- // now do something with them...
- // This code seems broken. It is apparently supposed to read
- // blockh->attribOrder values for each block and store them in
- // a tag. However, blockh->attribOrder is not a constant
- // so the same fixed-length tag cannot be used for all blocks.
- // For now, just store one value, as that was what the buggy code
- // previously did.
- result = mdbImpl->tag_get_handle("Block_Attributes", 1/*blockh->attribOrder*/,
- MB_TYPE_DOUBLE, block_attribs,
- MB_TAG_SPARSE|MB_TAG_CREAT);
- if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
- result = mdbImpl->tag_set_data(block_attribs, &(blockh->setHandle), 1,
- &(dbl_buf[0]));
+ void const* tag_data[] = { &dbl_buf[0] };
+ int tag_sizes[] = { blockh->attribOrder };
+ result = mdbImpl->tag_set_by_ptr(block_attribs,&(blockh->setHandle),1,tag_data,tag_sizes);
if (MB_SUCCESS != result) return result;
}
@@ -1932,6 +1926,19 @@ ErrorCode Tqdcfr::BlockHeader::read_info_header(const double data_version,
block_headers[i].blockLength = instance->uint_buf[10];
block_headers[i].blockDim = instance->uint_buf[11];
+ Tag bhTag_header;
+ {
+ std::vector<int> def_uint_zero(3,0);
+ result = instance->mdbImpl->tag_get_handle(BLOCK_HEADER,3*sizeof(unsigned int),MB_TYPE_INTEGER,
+ bhTag_header,MB_TAG_CREAT|MB_TAG_SPARSE|MB_TAG_BYTES,&def_uint_zero[0]);
+ if (MB_SUCCESS != result) return result;
+ int block_header_data[] = { block_headers[i].blockCol, block_headers[i].blockMat, block_headers[i].blockDim };
+ result = instance->mdbImpl->tag_set_data(bhTag_header,&(block_headers[i].setHandle), 1,
+ block_header_data);
+ }
+
+ if (MB_SUCCESS != result) return result;
+
// adjust element type for data version; older element types didn't include
// 4 new trishell element types
if (data_version <= 1.0 && block_headers[i].blockElemType >= 15)
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
28 Feb '14
1
0
commit/MOAB: danwu: Updated TestErrorHandling and TestErrorHandlingPar examples.
by commits-noreply@bitbucket.org 27 Feb '14
by commits-noreply@bitbucket.org 27 Feb '14
27 Feb '14
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/77a62b343cd3/
Changeset: 77a62b343cd3
Branch: error_handling_enhancement
User: danwu
Date: 2014-02-28 03:08:53
Summary: Updated TestErrorHandling and TestErrorHandlingPar examples.
Affected #: 2 files
diff --git a/examples/TestErrorHandling.cpp b/examples/TestErrorHandling.cpp
index 3e16667..f160ab8 100644
--- a/examples/TestErrorHandling.cpp
+++ b/examples/TestErrorHandling.cpp
@@ -1,8 +1,7 @@
/** @example TestErrorHandling.cpp \n
- * Description: Demonstrates enhanced error handling of MOAB. \n
- * This example tests MOAB's trace back error handler. \n
+ * Description: This example tests MOAB's trace back error handler. \n
*
- * To run: ./TestErrorHandling \n
+ * <b>To run</b>: ./TestErrorHandling <test_case_num> \n
*/
#include "moab/Core.hpp"
@@ -15,130 +14,9 @@
using namespace moab;
using namespace std;
-// Functions that create and handle contrived errors
-// Call hierarchy: A calls B, and B calls C
-#ifdef USE_ERROR_INFO_CLASS
-ErrorInfo FunctionC(int n)
-{
- if (1 == n) {
- // No error occurs
- return ERROR_INFO_SUCCESS;
- }
- else if (2 == n) {
- // Simulate MB_FILE_WRITE_ERROR
- SET_ERR(MB_FILE_WRITE_ERROR, "FunctionC() created a contrived error MB_FILE_WRITE_ERROR");
- }
- else if (3 == n) {
- // Simulate MB_NOT_IMPLEMENTED
- ErrorInfo err_info(MB_NOT_IMPLEMENTED);
- err_info << "n = " << n << ", FunctionC() created a contrived error MB_NOT_IMPLEMENTED (this message is built with C++ streaming)";
- SET_ERR1(err_info);
- }
-
- return ERROR_INFO_SUCCESS;
-}
-
-ErrorInfo FunctionB(int n)
-{
- ErrorInfo err_info = FunctionC(n);CHK_ERR(err_info);
-
- return ERROR_INFO_SUCCESS;
-}
-
-ErrorInfo FunctionA(int n)
-{
- ErrorInfo err_info = FunctionB(n);CHK_ERR(err_info);
-
- return ERROR_INFO_SUCCESS;
-}
-#else
-ErrorCode FunctionC(int n)
-{
- if (1 == n) {
- // No error occurs
- return MB_SUCCESS;
- }
- else if (2 == n) {
- // Simulate MB_FILE_WRITE_ERROR
- SET_ERR(MB_FILE_WRITE_ERROR, "FunctionC() created a contrived error MB_FILE_WRITE_ERROR");
- }
- else if (3 == n) {
- // Simulate MB_NOT_IMPLEMENTED
- SET_ERR_STR(MB_NOT_IMPLEMENTED, "n = " << n << ", FunctionC() created a contrived error MB_NOT_IMPLEMENTED (this message is built with C++ streaming)");
- }
-
- return MB_SUCCESS;
-}
-
-ErrorCode FunctionB(int n)
-{
- ErrorCode err_code = FunctionC(n);CHK_ERR(err_code);
-
- return MB_SUCCESS;
-}
-
-ErrorCode FunctionA(int n)
-{
- ErrorCode err_code = FunctionB(n);CHK_ERR(err_code);
-
- return MB_SUCCESS;
-}
-#endif
-
-#ifdef USE_ERROR_INFO_CLASS
-// In this test case, no error occurs in the call hierarchy
-ErrorInfo TestErrorHandling_1()
-{
- ErrorInfo err_info = FunctionA(1);CHK_ERR(err_info);
-
- return ERROR_INFO_SUCCESS;
-}
-
-// In this test case, a contrived error MB_FILE_WRITE_ERROR is returned by FunctionC
-ErrorInfo TestErrorHandling_2()
-{
- ErrorInfo err_info = FunctionA(2);CHK_ERR(err_info);
-
- return ERROR_INFO_SUCCESS;
-}
-
-// In this test case, a contrived error MB_NOT_IMPLEMENTED is returned by FunctionC
-// The error message is built with C++ streaming
-ErrorInfo TestErrorHandling_3()
-{
- ErrorInfo err_info = FunctionA(3);CHK_ERR(err_info);
-
- return ERROR_INFO_SUCCESS;
-}
-#else
-// In this test case, no error occurs in the call hierarchy
+// In this test case, an error MB_FILE_DOES_NOT_EXIST is returned by MOAB
ErrorCode TestErrorHandling_1()
{
- ErrorCode err_code = FunctionA(1);CHK_ERR(err_code);
-
- return MB_SUCCESS;
-}
-
-// In this test case, a contrived error MB_FILE_WRITE_ERROR is returned by FunctionC
-ErrorCode TestErrorHandling_2()
-{
- ErrorCode err_code = FunctionA(2);CHK_ERR(err_code);
-
- return MB_SUCCESS;
-}
-
-// In this test case, a contrived error MB_NOT_IMPLEMENTED is returned by FunctionC
-// The error message is built with C++ streaming
-ErrorCode TestErrorHandling_3()
-{
- ErrorCode err_code = FunctionA(3);CHK_ERR(err_code);
-
- return MB_SUCCESS;
-}
-
-// In this test case, a real error MB_FILE_DOES_NOT_EXIST is returned by MOAB
-ErrorCode TestErrorHandling_4()
-{
Core moab;
Interface& mb = moab;
@@ -148,8 +26,8 @@ ErrorCode TestErrorHandling_4()
return MB_SUCCESS;
}
-// In this test case, a real error MB_INDEX_OUT_OF_RANGE is returned by MOAB
-ErrorCode TestErrorHandling_5()
+// In this test case, an error MB_INDEX_OUT_OF_RANGE is returned by MOAB
+ErrorCode TestErrorHandling_2()
{
Core moab;
Interface& mb = moab;
@@ -160,8 +38,8 @@ ErrorCode TestErrorHandling_5()
return MB_SUCCESS;
}
-// In this test case, a real error MB_NOT_IMPLEMENTED is returned by MOAB
-ErrorCode TestErrorHandling_6()
+// In this test case, an error MB_NOT_IMPLEMENTED is returned by MOAB
+ErrorCode TestErrorHandling_3()
{
Core moab;
Interface& mb = moab;
@@ -172,42 +50,33 @@ ErrorCode TestErrorHandling_6()
return MB_SUCCESS;
}
-#endif
int main(int argc, char** argv)
{
+ // The required arg is a test case number (1, 2 or 3)
+ if (argc < 2) {
+ cout << "Usage: " << argv[0] << " <test_case_num>" << endl;
+ return 0;
+ }
+
#ifdef USE_MPI
MPI_Init(&argc, &argv);
#endif
MBErrorHandler_Init();
- cout << "--------------------Running test case 1 start--------------------" << endl;
- TestErrorHandling_1();
- cout << "--------------------Running test case 1 end----------------------\n" << endl;
-
- cout << "--------------------Running test case 2 start--------------------" << endl;
- TestErrorHandling_2();
- cout << "--------------------Running test case 2 end----------------------\n" << endl;
-
- cout << "--------------------Running test case 3 start--------------------" << endl;
- TestErrorHandling_3();
- cout << "--------------------Running test case 3 end----------------------\n" << endl;
-
-#ifdef USE_ERROR_INFO_CLASS
-#else
- cout << "--------------------Running test case 4 start--------------------" << endl;
- TestErrorHandling_4();
- cout << "--------------------Running test case 4 end----------------------\n" << endl;
-
- cout << "--------------------Running test case 5 start--------------------" << endl;
- TestErrorHandling_5();
- cout << "--------------------Running test case 5 end----------------------\n" << endl;
+ ErrorCode rval = MB_SUCCESS;
- cout << "--------------------Running test case 6 start--------------------" << endl;
- TestErrorHandling_6();
- cout << "--------------------Running test case 6 end----------------------\n" << endl;
-#endif
+ int test_case_num = atoi(argv[1]);
+ if (1 == test_case_num) {
+ rval = TestErrorHandling_1();CHK_ERR(rval);
+ }
+ else if (2 == test_case_num) {
+ rval = TestErrorHandling_2();CHK_ERR(rval);
+ }
+ else if (3 == test_case_num) {
+ rval = TestErrorHandling_3();CHK_ERR(rval);
+ }
MBErrorHandler_Finalize();
diff --git a/examples/TestErrorHandlingPar.cpp b/examples/TestErrorHandlingPar.cpp
index eed938c..0e3a6c2 100644
--- a/examples/TestErrorHandlingPar.cpp
+++ b/examples/TestErrorHandlingPar.cpp
@@ -1,160 +1,103 @@
-/** @example TestErrorHandlingPar.cpp
- * Description: Demonstrates enhanced error handling of parallel MOAB.\n
- * This example tests MOAB's trace back error handler in parallel.\n
+/** @example TestErrorHandlingPar.cpp \n
+ * Description: This example tests MOAB's trace back error handler in parallel.\n
*
- * <b>To run</b>: mpiexec -np <n> ./TestErrorHandlingPar \n
+ * <b>To run</b>: mpiexec -np <n> ./TestErrorHandlingPar <test_case_num> \n
*/
#include "moab/Core.hpp"
-
#ifdef USE_MPI
#include "moab_mpi.h"
#endif
-using namespace moab;
-
-// Functions that create and handle a contrived error
-// Call hierarchy: A calls B, and B calls C
-#ifdef USE_ERROR_INFO_CLASS
-ErrorInfo FunctionC(int rank)
-{
- // Simulate MB_FILE_WRITE_ERROR
- ErrorInfo err_info(MB_FILE_WRITE_ERROR);
- err_info << "FunctionC() created a contrived error MB_FILE_WRITE_ERROR in processor " << rank;
- SET_ERR1(err_info);
-
- return ERROR_INFO_SUCCESS;
-}
-
-ErrorInfo FunctionB(int rank)
-{
- ErrorInfo err_info = FunctionC(rank);CHK_ERR(err_info);
-
- return ERROR_INFO_SUCCESS;
-}
-
-ErrorInfo FunctionA(int rank)
-{
- ErrorInfo err_info = FunctionB(rank);CHK_ERR(err_info);
-
- return ERROR_INFO_SUCCESS;
-}
-
-// In this test case, MB_FILE_WRITE_ERROR is returned by FunctionC in each processor
-ErrorInfo TestErrorHandlingPar(int rank)
-{
- ErrorInfo err_info = FunctionA(rank);CHK_ERR(err_info);
-
- return ERROR_INFO_SUCCESS;
-}
-#else
-ErrorCode FunctionC(int rank)
-{
- // Simulate MB_FILE_WRITE_ERROR
- SET_ERR_STR(MB_FILE_WRITE_ERROR, "FunctionC() created a contrived error MB_FILE_WRITE_ERROR in processor " << rank);
-
- return MB_SUCCESS;
-}
-
-ErrorCode FunctionB(int rank)
-{
- ErrorCode err_code = FunctionC(rank);CHK_ERR(err_code);
-
- return MB_SUCCESS;
-}
-
-ErrorCode FunctionA(int rank)
-{
- ErrorCode err_code = FunctionB(rank);CHK_ERR(err_code);
-
- return MB_SUCCESS;
-}
-#endif
-
-#ifdef USE_ERROR_INFO_CLASS
-// In this test case, MB_FILE_WRITE_ERROR is returned by FunctionC in each processor
-ErrorInfo TestErrorHandlingPar_1()
-{
- int rank = 0;
-#ifdef USE_MPI
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-#endif
+#include <iostream>
- ErrorInfo err_info = FunctionA(rank);CHK_ERR(err_info);
+using namespace moab;
+using namespace std;
- return ERROR_INFO_SUCCESS;
-}
-#else
-// In this test case, MB_FILE_WRITE_ERROR is returned by FunctionC in each processor
+// In this test case, an error MB_FILE_DOES_NOT_EXIST is returned by MOAB
+// Note, as a global fatal error, it is only printed by processor 0
ErrorCode TestErrorHandlingPar_1()
{
- int rank = 0;
+ Core moab;
+ Interface& mb = moab;
+
+ std::string opts = ";;";
#ifdef USE_MPI
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ // Use parallel options
+ opts += "PARALLEL=READ_PART;PARTITION_METHOD=SQIJ";
#endif
- ErrorCode err_code = FunctionA(rank);CHK_ERR(err_code);
+ // Load a file that does not exist
+ ErrorCode rval = mb.load_file("no_such_file.nc", NULL, opts.c_str());CHK_ERR(rval);
return MB_SUCCESS;
}
-// In this test case, a real error MB_FILE_DOES_NOT_EXIST is returned by MOAB
+// In this test case, an error MB_INDEX_OUT_OF_RANGE is returned by MOAB
ErrorCode TestErrorHandlingPar_2()
{
Core moab;
Interface& mb = moab;
- std::string opts;
+ std::string opts = ";;";
#ifdef USE_MPI
// Use parallel options
- opts = std::string(";;PARALLEL=READ_PART;PARTITION_METHOD=TRIVIAL");
-#else
- opts = std::string(";;");
+ opts += "PARALLEL=READ_PART;PARTITION_METHOD=SQIJ";
#endif
- // Load a file that does not exist
- ErrorCode rval = mb.load_file("no_such_file.nc", NULL, opts.c_str());CHK_ERR(rval);
+ // Load a file that is not recognized by MOAB
+ ErrorCode rval = mb.load_file("TestErrorHandlingPar.cpp", NULL, opts.c_str());CHK_ERR(rval);
return MB_SUCCESS;
}
-// In this test case, a real error MB_INDEX_OUT_OF_RANGE is returned by MOAB
+// In this test case, an error MB_NOT_IMPLEMENTED is returned by MOAB
+// Note, as a global fatal error, it is only printed by processor 0
ErrorCode TestErrorHandlingPar_3()
{
Core moab;
Interface& mb = moab;
- std::string opts;
+ std::string opts = ";;";
#ifdef USE_MPI
// Use parallel options
- opts = std::string(";;PARALLEL=READ_PART;PARTITION_METHOD=TRIVIAL");
-#else
- opts = std::string(";;");
+ opts += "PARALLEL=READ_PART;PARTITION_METHOD=SQIJ";
#endif
- // Load a file that is not recognized by MOAB
- ErrorCode rval = mb.load_file("TestErrorHandlingPar.cpp", NULL, opts.c_str());CHK_ERR(rval);
+ // Load a CAM-FV file and read a variable on edges (not supported yet)
+ string test_file = string(MESH_DIR) + string("/io/fv26x46x72.t.3.nc");
+ opts += ";VARIABLE=US";
+ ErrorCode rval = mb.load_file(test_file.c_str(), NULL, opts.c_str());CHK_ERR(rval);
return MB_SUCCESS;
}
-#endif
int main(int argc, char** argv)
{
+ // The required arg is a test case number (1, 2 or 3)
+ if (argc < 2) {
+ cout << "Usage: " << argv[0] << " <test_case_num>" << endl;
+ return 0;
+ }
+
#ifdef USE_MPI
MPI_Init(&argc, &argv);
#endif
MBErrorHandler_Init();
- TestErrorHandlingPar_1();
-
-#ifdef USE_ERROR_INFO_CLASS
-#else
- TestErrorHandlingPar_2();
-
- TestErrorHandlingPar_3();
-#endif
+ ErrorCode rval = MB_SUCCESS;
+
+ int test_case_num = atoi(argv[1]);
+ if (1 == test_case_num) {
+ rval = TestErrorHandlingPar_1();CHK_ERR(rval);
+ }
+ else if (2 == test_case_num) {
+ rval = TestErrorHandlingPar_2();CHK_ERR(rval);
+ }
+ else if (3 == test_case_num) {
+ rval = TestErrorHandlingPar_3();CHK_ERR(rval);
+ }
MBErrorHandler_Finalize();
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/MOAB: danwu: In merged examples/makefile, add ERROREXAMPLES back to the file list of make clean.
by commits-noreply@bitbucket.org 26 Feb '14
by commits-noreply@bitbucket.org 26 Feb '14
26 Feb '14
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/3e22920aa86d/
Changeset: 3e22920aa86d
Branch: error_handling_enhancement
User: danwu
Date: 2014-02-26 23:17:01
Summary: In merged examples/makefile, add ERROREXAMPLES back to the file list of make clean.
Affected #: 1 file
diff --git a/examples/makefile b/examples/makefile
index 7b18e33..6993b64 100644
--- a/examples/makefile
+++ b/examples/makefile
@@ -73,7 +73,7 @@ TestErrorHandlingPar: TestErrorHandlingPar.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
clean:
- rm -rf *.o *.mod *.h5m ${EXAMPLES} ${PAREXAMPLES} ${EXOIIEXAMPLES} ${F90EXAMPLES}
+ rm -rf *.o *.mod *.h5m ${EXAMPLES} ${PAREXAMPLES} ${EXOIIEXAMPLES} ${ERROREXAMPLES} ${F90EXAMPLES}
.cpp.o:
${MOAB_CXX} ${CXXFLAGS} ${MOAB_CXXFLAGS} ${MOAB_CPPFLAGS} ${MOAB_INCLUDES} -DMESH_DIR=\"${MESH_DIR}\" -c $<
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/MOAB: danwu: Merged master into error_handling_enhancement
by commits-noreply@bitbucket.org 26 Feb '14
by commits-noreply@bitbucket.org 26 Feb '14
26 Feb '14
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/ad0c3fcf685f/
Changeset: ad0c3fcf685f
Branch: error_handling_enhancement
User: danwu
Date: 2014-02-26 22:18:55
Summary: Merged master into error_handling_enhancement
Affected #: 10 files
diff --git a/MeshFiles/unittest/io/Makefile.am b/MeshFiles/unittest/io/Makefile.am
index dbce393..3b767aa 100644
--- a/MeshFiles/unittest/io/Makefile.am
+++ b/MeshFiles/unittest/io/Makefile.am
@@ -5,6 +5,7 @@ EXTRA_DIST = HommeMapping.nc \
camEul26x48x96.t3.nc \
fv26x46x72.t.3.nc \
cubtest12.cub \
+ cubtest14.cub \
cubtest.jou \
dum.sat \
dum.stp \
diff --git a/MeshFiles/unittest/io/cubtest14.cub b/MeshFiles/unittest/io/cubtest14.cub
new file mode 100644
index 0000000..ae88269
Binary files /dev/null and b/MeshFiles/unittest/io/cubtest14.cub differ
diff --git a/config/hdf5.m4 b/config/hdf5.m4
index 4d3d11d..b603d24 100644
--- a/config/hdf5.m4
+++ b/config/hdf5.m4
@@ -28,16 +28,17 @@ if test "xyes" != "x$HAVE_LIB_HDF5"; then
HAVE_LIB_HDF5=no
FATHOM_HDF5_LIBS_HELPER
+ FATHOM_HDF5_LIBS_HELPER([-ldl])
if test $HAVE_ZLIB = yes; then
- FATHOM_HDF5_LIBS_HELPER([-lz])
- FATHOM_HDF5_LIBS_HELPER([-lz -lpthread])
+ FATHOM_HDF5_LIBS_HELPER([-lz -ldl])
+ FATHOM_HDF5_LIBS_HELPER([-lz -ldl -lpthread])
fi
if test $HAVE_SZIP = yes; then
- FATHOM_HDF5_LIBS_HELPER([-lsz])
- FATHOM_HDF5_LIBS_HELPER([-lsz -lpthread])
+ FATHOM_HDF5_LIBS_HELPER([-lsz -ldl])
+ FATHOM_HDF5_LIBS_HELPER([-lsz -ldl -lpthread])
if test $HAVE_ZLIB = yes; then
- FATHOM_HDF5_LIBS_HELPER([-lsz -lz])
- FATHOM_HDF5_LIBS_HELPER([-lsz -lz -lpthread])
+ FATHOM_HDF5_LIBS_HELPER([-lsz -lz -ldl])
+ FATHOM_HDF5_LIBS_HELPER([-lsz -lz -ldl -lpthread])
fi
fi
fi
diff --git a/config/netcdf.m4 b/config/netcdf.m4
index 041327d..4c13802 100644
--- a/config/netcdf.m4
+++ b/config/netcdf.m4
@@ -85,33 +85,47 @@ if test "xno" != "x$NETCDF_ARG"; then
NETCDF_CPPFLAGS="-I${NETCDF_ARG}"
fi
fi
-
+
+ AC_PATH_PROG([NC_CONFIG], [nc-config], [no], [${NETCDF_ARG}/bin])
+ if test "$NC_CONFIG" != "no" ; then
+ NETCDF_CPPFLAGS="`$NC_CONFIG --cflags`"
+ NETCDF_LDFLAGS="`$NC_CONFIG --libs`"
+ NETCDF_VERSION="`$NC_CONFIG --version`"
+ AC_SUBST([NETCDF_CPPFLAGS])
+ AC_SUBST([NETCDF_LDFLAGS])
+ AC_SUBST([NETCDF_VERSION])
+ else
+ HAVE_NETCDF=no
+ AC_MSG_WARN("NetCDF configuration utility not found")
+ fi
+
old_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$NETCDF_CPPFLAGS $CPPFLAGS"
old_LDFLAGS="$LDFLAGS"
- LDFLAGS="$NETCDF_LDFLAGS $HDF5_LDFLAGS $LDFLAGS"
+ LDFLAGS="$NETCDF_LDFLAGS $LDFLAGS"
# Check for C library
AC_LANG_PUSH([C])
AC_CHECK_HEADERS( [netcdf.h],
[FATHOM_CHECK_NETCDF_LIMITS([$1],[$2],[netcdf.h],[NETCDF_SUFFICIENT_DIM_VARS])],
[AC_MSG_WARN([[NetCDF header not found.]]); HAVE_NETCDF=no] )
-
+
# Check if netcdf is usable by itself
+ # AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf"], [NETCDF_LIBS=${NETCDF_LDFLAGS}] )
AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf"], [
- # Check if netcdf is usable with HDF5
+ # Check if netcdf is usable with HDF5
unset ac_cv_lib_netcdf
unset ac_cv_lib_netcdf_nc_create
- # If we haven't already looked for HDF5 libraries, again now incase
- # they're in the NetCDF lib directory.
+ # If we haven't already looked for HDF5 libraries, again now incase
+ # they're in the NetCDF lib directory.
FATHOM_DETECT_HDF5_LIBS
LDFLAGS="$LDFLAGS $HDF5_LDFLAGS"
- AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf -lhdf5_hl"], [
+ AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf -lhdf5_hl $HDF5_LIBS"], [
# Try one more time with HDF5 and libcurl
unset ac_cv_lib_netcdf
unset ac_cv_lib_netcdf_nc_create
- AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf -lhdf5_hl -lcurl"],
- [HAVE_NETCDF=no], [-lhdf5_hl $HDF5_LIBS -lcurl] )],
+ AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf -lhdf5_hl -lcurl "],
+ [HAVE_NETCDF=no], [-lhdf5_hl $HDF5_LIBS -lcurl ] )],
[-lhdf5_hl $HDF5_LIBS] )],
)
diff --git a/configure.ac b/configure.ac
index ea22a5e..82bf72b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -593,13 +593,14 @@ AC_ARG_WITH( [vtk-lib-suffix],
[case "x$withval" in
xyes)
AC_MSG_ERROR([Must specify a non-empty suffix!])
- VTK_LIB_SUFFIX=
+ VTK_LIB_SUFFIX=
;;
xno)
- VTK_LIB_SUFFIX=
+ AC_MSG_ERROR([Must specify a non-empty suffix!])
+ VTK_LIB_SUFFIX=
;;
x*)
- VTK_LIB_SUFFIX="$withval"
+ VTK_LIB_SUFFIX="$withval"
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-vtk-lib-suffix=\"${withval}\""
;;
esac],[VTK_LIB_SUFFIX=] )
@@ -758,6 +759,40 @@ AC_SUBST(ZOLTAN_INC_FLAGS)
EXPORT_LDFLAGS="$ZOLTAN_LIB_FLAGS $EXPORT_LDFLAGS"
+
+dnl Define a function that checks for the existence of a library
+dnl and if it exists, prepends the corresponding link flag to a
+dnl sepecified variable
+dnl Arguments:
+dnl - The library name
+dnl - The name of the variable to which to prepend the library link flag
+dnl - List of extra libraries required for link test
+dnl - Optional library path linker argument (e.g. -L/opt/foo)
+ AC_DEFUN([FATHOM_CHECK_LIB_LIST],[
+ old_LIBS="$LIBS"
+ LIBS="$5 ${$3} $old_LIBS"
+ AC_HAVE_LIBRARY([$1],[$3="-l$1 ${$3}"],[],[$4])
+ LIBS="$old_LIBS"
+ ])
+
+dnl Define a function that checks for the existence of a library
+dnl and if it exists, prepends the corresponding link flag to a
+dnl sepecified variable
+dnl Arguments:
+dnl - The library name
+dnl - The name of the variable to which to prepend the library link flag
+dnl - List of extra libraries required for link test
+dnl - Optional library path linker argument (e.g. -L/opt/foo)
+ AC_DEFUN([FATHOM_CHECK_VTK_LIB_LIST],[
+ old_LIBS="$LIBS"
+ LIBS="$5 ${$3} $old_LIBS"
+ AC_CHECK_LIB([$1$VTK_LIB_SUFFIX], main,
+ [$3="-l$1$VTK_LIB_SUFFIX ${$3}"],
+ [],[$4])dnl
+ LIBS="$old_LIBS"
+ ])
+
+
################################################################################
# VTK for qvdual and/or vtkMOABReader
################################################################################
@@ -786,7 +821,6 @@ if test "xno" != "x$WITH_VTK" -a "x" != "x$WITH_VTK"; then
AC_LANG_CPLUSPLUS
VTK_INCLUDES=
- VTK_LIB_SUFFIX=-pv3.98
case "x$WITH_VTK" in
xyes|x)
VTK_LIB_DIR=
@@ -806,9 +840,7 @@ if test "xno" != "x$WITH_VTK" -a "x" != "x$WITH_VTK"; then
for dir in /usr/lib/vtk /usr/lib /usr/bin /usr; do
if test "x" = "x$VTK_LIB_DIR"; then
LIBS="$old_LIBS -L$dir"
- unset ac_cv_lib_vtkCommon
- unset ac_cv_lib_vtkCommon_main
- AC_HAVE_LIBRARY([vtkCommonCore$VTK_LIB_SUFFIX],[VTK_LIB_DIR=$dir])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkCommonCore],[$VTK_LIB_SUFFIX], [VTK_LIB_DIR],[],[-L$dir])
fi
done
if test "x" = "x$VTK_LIB_DIR"; then
@@ -828,15 +860,15 @@ if test "xno" != "x$WITH_VTK" -a "x" != "x$WITH_VTK"; then
# Check for non-installed VTK source
AC_CHECK_FILE([vtkUnstructuredGrid.h],[
for subdir in . Common Common/DataModel Filtering GenericFiltering Graphics Hybrid Imaging Parallel Patented Rendering Utilities Utilities/vtkexpat Utilities/expat Utilities/DICOMParser Utilties/vtkpng Utilities/vtkzlib Utilities/freetype/include/freetype Wrapping; do
- AC_MSG_CHECKING([for directory ${WITH_VTK}/$subdir])
- if test -d ${WITH_VTK}/$subdir; then
- VTK_INC_DIR="$VTK_INC_DIR -I${WITH_VTK}/$subdir"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- fi
- done
- ],[AC_MSG_ERROR([VTK includes not found])]
+ AC_MSG_CHECKING([for directory ${WITH_VTK}/$subdir])
+ if test -d ${WITH_VTK}/$subdir; then
+ VTK_INC_DIR="$VTK_INC_DIR -I${WITH_VTK}/$subdir"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ done
+ ],[AC_MSG_ERROR([VTK includes not found])]
)
fi
VTK_INCLUDES="$VTK_INC_DIR"
@@ -844,7 +876,7 @@ if test "xno" != "x$WITH_VTK" -a "x" != "x$WITH_VTK"; then
for dir in ${WITH_VTK}/lib ${WITH_VTK}/lib/vtk ${VTK_DIR}/bin ${WITH_VTK}/bin ${WITH_VTK}; do
if test "x" = "x$VTK_LIB_DIR"; then
LIBS="$old_LIBS -L$dir"
- AC_HAVE_LIBRARY([vtkCommonCore$VTK_LIB_SUFFIX],[VTK_LIB_DIR=$dir])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkCommonCore],[$VTK_LIB_SUFFIX], [VTK_LIB_DIR],[],[-L$dir])
fi
done
if test "x" = "x$VTK_LIB_DIR"; then
@@ -853,22 +885,7 @@ if test "xno" != "x$WITH_VTK" -a "x" != "x$WITH_VTK"; then
LIBS="$old_LIBS"
;;
esac
-
-dnl Define a function that checks for the existence of a library
-dnl and if it exists, prepends the corresponding link flag to a
-dnl sepecified variable
-dnl Arguments:
-dnl - The library name
-dnl - The name of the variable to which to prepend the library link flag
-dnl - List of extra libraries required for link test
-dnl - Optional library path linker argument (e.g. -L/opt/foo)
- AC_DEFUN([FATHOM_CHECK_LIB_LIST],[
- old_LIBS="$LIBS"
- LIBS="$5 ${$3} $old_LIBS"
- AC_HAVE_LIBRARY([$1$2],[$3="-l$1$2 ${$3}"],[],[$4])
- LIBS="$old_LIBS"
- ])
-
+
# These are ordered such that a given library depends only on those libraries
# that preceed it in the list.
FATHOM_CHECK_LIB_LIST([pthread],[],[vtk_sys_libs])
@@ -883,27 +900,28 @@ dnl - Optional library path linker argument (e.g. -L/opt/foo)
FATHOM_CHECK_LIB_LIST([GL],[], [vtk_x_libs],[$x_libs_arg],[-L$x_libraries])
FATHOM_CHECK_LIB_LIST([GLU],[], [vtk_x_libs],[$x_libs_arg],[-L$x_libraries])
vtk_libs_arg="-L$x_libraries $vtk_x_libs $X_EXTRA_LIBS -lX11 $X_PRE_LIBS $vtk_sys_libs"
- FATHOM_CHECK_LIB_LIST([vtksys],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkCommonCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkDICOMParser],[$VTK_LIB_SUFFIX],[vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkfreetype],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkexpat],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkzlib],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkpng],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkjpeg],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtktiff],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkftgl],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkFiltering],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkImaging],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([verdict],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkGraphics],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkNetCDF],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkexoIIc],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkmetaio],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkIO],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkRendering],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkParallel],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkHybrid],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+
+ FATHOM_CHECK_VTK_LIB_LIST([vtksys],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkCommonCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkDICOMParser],[$VTK_LIB_SUFFIX],[vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkfreetype],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkexpat],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkzlib],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkpng],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkjpeg],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtktiff],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkftgl],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkFiltersCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkImagingCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([verdict],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkGraphics],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkNetCDF],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkexoIIc],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkmetaio],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkIOCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkRenderingCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkParallelCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ #FATHOM_CHECK_VTK_LIB_LIST([vtkHybrid],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
# Make sure we found at least vtkCommonCore and vtkRendering
if ! echo "x $vtk_libs" | grep lvtkCommonCore >/dev/null; then
diff --git a/examples/LoadPartial.cpp b/examples/LoadPartial.cpp
new file mode 100644
index 0000000..ef1f2e7
--- /dev/null
+++ b/examples/LoadPartial.cpp
@@ -0,0 +1,63 @@
+/** @example LoadPartial.cpp \n
+ * \brief Load a part of a file \n
+ * <b>To run</b>: LoadPartial <file><tag_name><val1><val2> ...\n
+ *
+ * In this example, it is shown how to load only a part of one file; the file must be organized in sets.
+ * (cherry-picking only the sets we want)
+ * The sets to load are identified by a tag name and the tag values for the sets of interest.
+ * This procedure is used when reading in parallel, as each processor will load only
+ * its part of the file, identified either by partition or by material/block sets
+ * by default, this example will load parallel partition sets
+ * with values 1, 2, and 5 from ../MeshFiles/unittest/64bricks_1khex.h5m
+ * The example will always write the output to a file name part.h5m
+ */
+
+#include <iostream>
+#include <vector>
+
+// Include header for MOAB instance and tag conventions for
+#include "moab/Core.hpp"
+#include "MBTagConventions.hpp"
+
+int main(int argc, char **argv) {
+
+ // instantiate & load a file
+ moab::Interface *mb = new moab::Core();
+
+ moab::ErrorCode rval;
+ if (argc <= 1) //
+ {
+ // the default file to load
+ int set_tag_values[] = {1, 2, 5};
+ int num_set_tag_values = 3;
+ // this file is in the mesh files directory
+ rval = mb->load_file("../MeshFiles/unittest/64bricks_1khex.h5m",
+ 0, 0, PARALLEL_PARTITION_TAG_NAME, set_tag_values, num_set_tag_values);
+ }
+ else
+ {
+ // first arg is input file, second is tag name, then are the tag values
+ if (argc < 4)
+ {
+ std::cout<< " usage is " << argv[0] << " <file><tag_name><value1><value2> .. \n";
+ return 0;
+ }
+
+ else
+ {
+ std::vector<int> vals(argc-3); // the first 3 args are exe, file, tagname; the rest are values
+ for (int i=3; i<argc; i++)
+ vals[i-3] = atoi(argv[i]);
+ rval = mb->load_file(argv[1], 0, 0, argv[2], &vals[0], (int) vals.size() );
+ }
+ }
+ if (moab::MB_SUCCESS!=rval)
+ std::cout << " failed to read\n";
+ rval = mb->write_file("part.h5m");
+ if (moab::MB_SUCCESS!=rval)
+ std::cout << " failed to write partial file.\n";
+ else
+ std::cout << " wrote successfully part.h5m.\n";
+ delete mb;
+ return 0;
+}
diff --git a/examples/makefile b/examples/makefile
index 9cb50bf..7b18e33 100644
--- a/examples/makefile
+++ b/examples/makefile
@@ -7,7 +7,7 @@ include ${MOAB_DIR}/lib/iMesh-Defs.inc
# MESH_DIR is the directory containing mesh files that come with MOAB source
MESH_DIR="../MeshFiles/unittest"
-EXAMPLES = HelloMOAB GetEntities SetsNTags structuredmesh StructuredMeshSimple DirectAccessWithHoles DirectAccessNoHoles point_in_elem_search DeformMeshRemap
+EXAMPLES = HelloMOAB GetEntities SetsNTags LoadPartial structuredmesh StructuredMeshSimple DirectAccessWithHoles DirectAccessNoHoles point_in_elem_search DeformMeshRemap
PAREXAMPLES = HelloParMOAB ReduceExchangeTags LloydRelaxation CrystalRouterExample
EXOIIEXAMPLES = TestExodusII
ERROREXAMPLES = TestErrorHandling TestErrorHandlingPar
@@ -15,7 +15,7 @@ F90EXAMPLES = DirectAccessNoHolesF90 PushParMeshIntoMoabF90
default: ${EXAMPLES} ${PAREXAMPLES} ${EXOIIEXAMPLES} ${ERROREXAMPLES} ${F90EXAMPLES}
-HelloMOAB : HelloMOAB.o ${MOAB_LIBDIR}/libMOAB.la
+HelloMOAB: HelloMOAB.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
GetEntities: GetEntities.o ${MOAB_LIBDIR}/libMOAB.la
@@ -27,10 +27,13 @@ SetsNTags: SetsNTags.o ${MOAB_LIBDIR}/libMOAB.la
LloydRelaxation: LloydRelaxation.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
-structuredmesh : structuredmesh.o ${MOAB_LIBDIR}/libMOAB.la
+LoadPartial: LoadPartial.o ${MOAB_LIBDIR}/libMOAB.la
+ ${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK} ${MOAB_LIBS_LINK}
+
+structuredmesh: structuredmesh.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
-StructuredMeshSimple : StructuredMeshSimple.o ${MOAB_LIBDIR}/libMOAB.la
+StructuredMeshSimple: StructuredMeshSimple.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
DirectAccessWithHoles: DirectAccessWithHoles.o ${MOAB_LIBDIR}/libMOAB.la
@@ -42,13 +45,13 @@ DirectAccessNoHoles: DirectAccessNoHoles.o ${MOAB_LIBDIR}/libMOAB.la
DirectAccessNoHolesF90: DirectAccessNoHolesF90.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_FC} -o $@ $< ${IMESH_LIBS}
-ReduceExchangeTags : ReduceExchangeTags.o ${MOAB_LIBDIR}/libMOAB.la
+ReduceExchangeTags: ReduceExchangeTags.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
HelloParMOAB: HelloParMOAB.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
-CrystalRouterExample: CrystalRouterExample.o ${MOAB_LIBDIR}/libMOAB.la
+CrystalRouterExample: CrystalRouterExample.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
TestExodusII: TestExodusII.o ${MOAB_LIBDIR}/libMOAB.la
@@ -72,9 +75,9 @@ TestErrorHandlingPar: TestErrorHandlingPar.o ${MOAB_LIBDIR}/libMOAB.la
clean:
rm -rf *.o *.mod *.h5m ${EXAMPLES} ${PAREXAMPLES} ${EXOIIEXAMPLES} ${F90EXAMPLES}
-.cpp.o :
+.cpp.o:
${MOAB_CXX} ${CXXFLAGS} ${MOAB_CXXFLAGS} ${MOAB_CPPFLAGS} ${MOAB_INCLUDES} -DMESH_DIR=\"${MESH_DIR}\" -c $<
-.F90.o :
+.F90.o:
${IMESH_FC} ${FCFLAGS} ${IMESH_FCFLAGS} ${MOAB_CPPFLAGS} ${IMESH_INCLUDES} ${IMESH_FCDEFS} -DMESH_DIR=\"${MESH_DIR}\" -c $<
diff --git a/src/ScdInterface.cpp b/src/ScdInterface.cpp
index 12f5b89..3f95538 100644
--- a/src/ScdInterface.cpp
+++ b/src/ScdInterface.cpp
@@ -339,6 +339,13 @@ ErrorCode ScdInterface::create_box_set(const HomCoord low, const HomCoord high,
Tag ScdInterface::box_periodic_tag(bool create_if_missing)
{
+ // Reset boxPeriodicTag in case it has been deleted (e.g. by Core::clean_up_failed_read)
+ if (boxPeriodicTag) {
+ std::string tag_name;
+ if (MB_TAG_NOT_FOUND == mbImpl->tag_get_name(boxPeriodicTag, tag_name))
+ boxPeriodicTag = NULL;
+ }
+
if (boxPeriodicTag || !create_if_missing) return boxPeriodicTag;
ErrorCode rval = mbImpl->tag_get_handle("BOX_PERIODIC", 3, MB_TYPE_INTEGER,
@@ -349,6 +356,13 @@ Tag ScdInterface::box_periodic_tag(bool create_if_missing)
Tag ScdInterface::box_dims_tag(bool create_if_missing)
{
+ // Reset boxDimsTag in case it has been deleted (e.g. by clean_up_failed_read)
+ if (boxDimsTag) {
+ std::string tag_name;
+ if (MB_TAG_NOT_FOUND == mbImpl->tag_get_name(boxDimsTag, tag_name))
+ boxDimsTag = NULL;
+ }
+
if (boxDimsTag || !create_if_missing) return boxDimsTag;
ErrorCode rval = mbImpl->tag_get_handle("BOX_DIMS", 6, MB_TYPE_INTEGER,
@@ -359,6 +373,13 @@ Tag ScdInterface::box_dims_tag(bool create_if_missing)
Tag ScdInterface::global_box_dims_tag(bool create_if_missing)
{
+ // Reset globalBoxDimsTag in case it has been deleted (e.g. by Core::clean_up_failed_read)
+ if (globalBoxDimsTag) {
+ std::string tag_name;
+ if (MB_TAG_NOT_FOUND == mbImpl->tag_get_name(globalBoxDimsTag, tag_name))
+ globalBoxDimsTag = NULL;
+ }
+
if (globalBoxDimsTag || !create_if_missing) return globalBoxDimsTag;
ErrorCode rval = mbImpl->tag_get_handle("GLOBAL_BOX_DIMS", 6, MB_TYPE_INTEGER,
@@ -369,6 +390,13 @@ Tag ScdInterface::global_box_dims_tag(bool create_if_missing)
Tag ScdInterface::part_method_tag(bool create_if_missing)
{
+ // Reset partMethodTag in case it has been deleted (e.g. by Core::clean_up_failed_read)
+ if (partMethodTag) {
+ std::string tag_name;
+ if (MB_TAG_NOT_FOUND == mbImpl->tag_get_name(partMethodTag, tag_name))
+ partMethodTag = NULL;
+ }
+
if (partMethodTag || !create_if_missing) return partMethodTag;
ErrorCode rval = mbImpl->tag_get_handle("PARTITION_METHOD", 1, MB_TYPE_INTEGER,
@@ -379,6 +407,13 @@ Tag ScdInterface::part_method_tag(bool create_if_missing)
Tag ScdInterface::box_set_tag(bool create_if_missing)
{
+ // Reset boxSetTag in case it has been deleted (e.g. by Core::clean_up_failed_read)
+ if (boxSetTag) {
+ std::string tag_name;
+ if (MB_TAG_NOT_FOUND == mbImpl->tag_get_name(boxSetTag, tag_name))
+ boxSetTag = NULL;
+ }
+
if (boxSetTag || !create_if_missing) return boxSetTag;
ErrorCode rval = mbImpl->tag_get_handle("__BOX_SET", sizeof(ScdBox*), MB_TYPE_OPAQUE,
diff --git a/src/io/Tqdcfr.cpp b/src/io/Tqdcfr.cpp
index 76767ea..afc0493 100644
--- a/src/io/Tqdcfr.cpp
+++ b/src/io/Tqdcfr.cpp
@@ -2920,7 +2920,7 @@ int main(int argc, char* argv[])
MPI_Init(&argc, &argv);
#endif
// Check command line arg
- const char* file = STRINGIFY(SRCDIR) "/brick_cubit10.2.cub";
+ const char* file = STRINGIFY(MESHDIR) "/io/brick_cubit10.2.cub";
if (argc < 2)
{
std::cout << "Usage: tqdcfr <cub_file_name>" << std::endl;
diff --git a/test/io/cub_file_test.cc b/test/io/cub_file_test.cc
index 691fea3..f9a65bf 100644
--- a/test/io/cub_file_test.cc
+++ b/test/io/cub_file_test.cc
@@ -3,6 +3,7 @@
#include "MBTagConventions.hpp"
#include "moab/CN.hpp"
#include "moab/Range.hpp"
+#include "moab/GeomTopoTool.hpp"
#include <math.h>
#include <algorithm>
@@ -80,10 +81,12 @@ using namespace moab;
static const char input_file_1[] = STRINGIFY(MESHDIR) "/io/test.cub";
static const char ho_file[] = STRINGIFY(MESHDIR) "/io/ho_test.cub";
static const char cubit12_file[] = STRINGIFY(MESHDIR) "/io/cubtest12.cub";
+static const char cubit14_file[] = STRINGIFY(MESHDIR) "/io/cubtest14.cub";
#else
static const char input_file_1[] = "test.cub";
static const char ho_file[] = "ho_test.cub";
static const char cubit12_file[] = "cubtest12.cub";
+static const char cubit12_file[] = "cubtest14.cub";
#endif
void read_file( Interface& moab, const char* input_file );
@@ -143,6 +146,7 @@ void test_hex27() { test_ho_elements(MBHEX, 27); }
void test_multiple_files();
void test_cubit12();
+void test_cubit14();
int main()
{
@@ -170,6 +174,7 @@ int main()
result += RUN_TEST(test_hex27);
result += RUN_TEST(test_multiple_files);
result += RUN_TEST(test_cubit12);
+ result += RUN_TEST(test_cubit14);
return result;
}
@@ -1075,3 +1080,22 @@ void test_cubit12()
Interface& mb = mb_impl;
read_file( mb, cubit12_file);
}
+
+void test_cubit14()
+{
+ Core mb_impl;
+ Interface& mb = mb_impl;
+ read_file( mb, cubit14_file);
+ // check the global id for some geometry sets
+ GeomTopoTool gtt(&mb_impl);
+ Range ranges[5];
+ ErrorCode rval = gtt.find_geomsets(ranges);
+ CHECK_ERR(rval);
+ EntityHandle set0=ranges[0][0]; // does it have a global id > 0?
+ Tag gid_tag;
+ rval = mb.tag_get_handle( "GLOBAL_ID", 1, MB_TYPE_INTEGER, gid_tag ); CHECK_ERR(rval);
+
+ int val;
+ rval = mb.tag_get_data(gid_tag, &set0, 1, &val );
+ CHECK ( val!=0 );
+}
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/MOAB: danwu: Fix merge conflicts in examples/makefile
by commits-noreply@bitbucket.org 26 Feb '14
by commits-noreply@bitbucket.org 26 Feb '14
26 Feb '14
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/a6e136fb7e04/
Changeset: a6e136fb7e04
Branch: error_handling_enhancement
User: danwu
Date: 2014-02-26 22:17:41
Summary: Fix merge conflicts in examples/makefile
Affected #: 1 file
diff --git a/examples/makefile b/examples/makefile
index 46d894b..9cb50bf 100644
--- a/examples/makefile
+++ b/examples/makefile
@@ -70,7 +70,7 @@ TestErrorHandlingPar: TestErrorHandlingPar.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
clean:
- rm -rf *.o *.mod ${EXAMPLES} ${PAREXAMPLES} ${EXOIIEXAMPLES} ${ERROREXAMPLES} ${F90EXAMPLES}
+ rm -rf *.o *.mod *.h5m ${EXAMPLES} ${PAREXAMPLES} ${EXOIIEXAMPLES} ${F90EXAMPLES}
.cpp.o :
${MOAB_CXX} ${CXXFLAGS} ${MOAB_CXXFLAGS} ${MOAB_CPPFLAGS} ${MOAB_INCLUDES} -DMESH_DIR=\"${MESH_DIR}\" -c $<
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
6 new commits in MOAB:
https://bitbucket.org/fathomteam/moab/commits/544cc920f598/
Changeset: 544cc920f598
Branch: None
User: vijaysm
Date: 2014-01-13 22:21:31
Summary: Fix HDF5 dependency on libdl (DLOpen) and use nc-config if available to get the necessary information for Netcdf.
Affected #: 2 files
diff --git a/config/hdf5.m4 b/config/hdf5.m4
index 4d3d11d..b603d24 100644
--- a/config/hdf5.m4
+++ b/config/hdf5.m4
@@ -28,16 +28,17 @@ if test "xyes" != "x$HAVE_LIB_HDF5"; then
HAVE_LIB_HDF5=no
FATHOM_HDF5_LIBS_HELPER
+ FATHOM_HDF5_LIBS_HELPER([-ldl])
if test $HAVE_ZLIB = yes; then
- FATHOM_HDF5_LIBS_HELPER([-lz])
- FATHOM_HDF5_LIBS_HELPER([-lz -lpthread])
+ FATHOM_HDF5_LIBS_HELPER([-lz -ldl])
+ FATHOM_HDF5_LIBS_HELPER([-lz -ldl -lpthread])
fi
if test $HAVE_SZIP = yes; then
- FATHOM_HDF5_LIBS_HELPER([-lsz])
- FATHOM_HDF5_LIBS_HELPER([-lsz -lpthread])
+ FATHOM_HDF5_LIBS_HELPER([-lsz -ldl])
+ FATHOM_HDF5_LIBS_HELPER([-lsz -ldl -lpthread])
if test $HAVE_ZLIB = yes; then
- FATHOM_HDF5_LIBS_HELPER([-lsz -lz])
- FATHOM_HDF5_LIBS_HELPER([-lsz -lz -lpthread])
+ FATHOM_HDF5_LIBS_HELPER([-lsz -lz -ldl])
+ FATHOM_HDF5_LIBS_HELPER([-lsz -lz -ldl -lpthread])
fi
fi
fi
diff --git a/config/netcdf.m4 b/config/netcdf.m4
index 041327d..b3fb2d6 100644
--- a/config/netcdf.m4
+++ b/config/netcdf.m4
@@ -85,35 +85,50 @@ if test "xno" != "x$NETCDF_ARG"; then
NETCDF_CPPFLAGS="-I${NETCDF_ARG}"
fi
fi
-
+
+ AC_PATH_PROG([NC_CONFIG], [nc-config], [no], [${NETCDF_ARG}/bin])
+ if test "$NC_CONFIG" != "no" ; then
+ NETCDF_CPPFLAGS="`$NC_CONFIG --cflags`"
+ NETCDF_LDFLAGS="`$NC_CONFIG --libs`"
+ NETCDF_VERSION="`$NC_CONFIG --version`"
+ AC_SUBST([NETCDF_CPPFLAGS])
+ AC_SUBST([NETCDF_LDFLAGS])
+ AC_SUBST([NETCDF_VERSION])
+ m4_if([$1], [], [:], [$1])
+ else
+ HAVE_NETCDF=no
+ AC_MSG_WARN("NetCDF configuration utility not found")
+ fi
+
old_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$NETCDF_CPPFLAGS $CPPFLAGS"
old_LDFLAGS="$LDFLAGS"
- LDFLAGS="$NETCDF_LDFLAGS $HDF5_LDFLAGS $LDFLAGS"
+ LDFLAGS="$NETCDF_LDFLAGS $LDFLAGS"
# Check for C library
AC_LANG_PUSH([C])
AC_CHECK_HEADERS( [netcdf.h],
[FATHOM_CHECK_NETCDF_LIMITS([$1],[$2],[netcdf.h],[NETCDF_SUFFICIENT_DIM_VARS])],
[AC_MSG_WARN([[NetCDF header not found.]]); HAVE_NETCDF=no] )
-
+
# Check if netcdf is usable by itself
- AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf"], [
- # Check if netcdf is usable with HDF5
- unset ac_cv_lib_netcdf
- unset ac_cv_lib_netcdf_nc_create
- # If we haven't already looked for HDF5 libraries, again now incase
- # they're in the NetCDF lib directory.
- FATHOM_DETECT_HDF5_LIBS
- LDFLAGS="$LDFLAGS $HDF5_LDFLAGS"
- AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf -lhdf5_hl"], [
- # Try one more time with HDF5 and libcurl
- unset ac_cv_lib_netcdf
- unset ac_cv_lib_netcdf_nc_create
- AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf -lhdf5_hl -lcurl"],
- [HAVE_NETCDF=no], [-lhdf5_hl $HDF5_LIBS -lcurl] )],
- [-lhdf5_hl $HDF5_LIBS] )],
- )
+ AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf"], [NETCDF_LIBS=${NETCDF_LDFLAGS}] )
+# AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf"], [
+# # Check if netcdf is usable with HDF5
+# unset ac_cv_lib_netcdf
+# unset ac_cv_lib_netcdf_nc_create
+# # If we haven't already looked for HDF5 libraries, again now incase
+# # they're in the NetCDF lib directory.
+# FATHOM_DETECT_HDF5_LIBS
+# LDFLAGS="$LDFLAGS $HDF5_LDFLAGS"
+# AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf -lhdf5_hl"], [
+# # Try one more time with HDF5 and libcurl
+# unset ac_cv_lib_netcdf
+# unset ac_cv_lib_netcdf_nc_create
+# AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf -lhdf5_hl "],
+# [HAVE_NETCDF=no], [-lhdf5_hl $HDF5_LIBS ] )],
+# [-lhdf5_hl $HDF5_LIBS] )],
+# )
CPPFLAGS="$old_CPPFLAGS"
LDFLAGS="$old_LDFLAGS"
https://bitbucket.org/fathomteam/moab/commits/174c7ef27f82/
Changeset: 174c7ef27f82
Branch: None
User: vijaysm
Date: 2014-01-14 00:47:51
Summary: Remove an unwanted command.
Affected #: 1 file
diff --git a/config/netcdf.m4 b/config/netcdf.m4
index b3fb2d6..fbdfd7c 100644
--- a/config/netcdf.m4
+++ b/config/netcdf.m4
@@ -94,7 +94,6 @@ if test "xno" != "x$NETCDF_ARG"; then
AC_SUBST([NETCDF_CPPFLAGS])
AC_SUBST([NETCDF_LDFLAGS])
AC_SUBST([NETCDF_VERSION])
- m4_if([$1], [], [:], [$1])
else
HAVE_NETCDF=no
AC_MSG_WARN("NetCDF configuration utility not found")
https://bitbucket.org/fathomteam/moab/commits/e159eeaa10e0/
Changeset: e159eeaa10e0
Branch: None
User: vijaysm
Date: 2014-01-14 00:48:14
Summary: Fix the configuration for VTK. Tested on Ubuntu with VTK-6.0. Several
existing checks for libraries were invalid. We should do separate
checks based on the version to satisfy a broad range of dependencies.
Affected #: 1 file
diff --git a/configure.ac b/configure.ac
index ea22a5e..d1e6f73 100644
--- a/configure.ac
+++ b/configure.ac
@@ -593,13 +593,14 @@ AC_ARG_WITH( [vtk-lib-suffix],
[case "x$withval" in
xyes)
AC_MSG_ERROR([Must specify a non-empty suffix!])
- VTK_LIB_SUFFIX=
+ VTK_LIB_SUFFIX=
;;
xno)
- VTK_LIB_SUFFIX=
+ AC_MSG_ERROR([Must specify a non-empty suffix!])
+ VTK_LIB_SUFFIX=
;;
x*)
- VTK_LIB_SUFFIX="$withval"
+ VTK_LIB_SUFFIX="$withval"
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-vtk-lib-suffix=\"${withval}\""
;;
esac],[VTK_LIB_SUFFIX=] )
@@ -758,6 +759,55 @@ AC_SUBST(ZOLTAN_INC_FLAGS)
EXPORT_LDFLAGS="$ZOLTAN_LIB_FLAGS $EXPORT_LDFLAGS"
+
+dnl Define a function that checks for the existence of a library
+dnl and if it exists, prepends the corresponding link flag to a
+dnl sepecified variable
+dnl Arguments:
+dnl - The library name
+dnl - The name of the variable to which to prepend the library link flag
+dnl - List of extra libraries required for link test
+dnl - Optional library path linker argument (e.g. -L/opt/foo)
+ AC_DEFUN([FATHOM_CHECK_LIB_LIST],[
+ old_LIBS="$LIBS"
+ LIBS="$5 ${$3} $old_LIBS"
+ AC_HAVE_LIBRARY([$1],[$3="-l$1 ${$3}"],[],[$4])
+ #AC_HAVE_LIBRARY($1,[$3="-l$1 ${$3}"],[],[$4])
+ #AC_CHECK_LIB([$1${2}], main,
+ # [$3="-l$1 ${$3}"
+ # ac_cv_lib_$1${2}=yes],
+ # [ac_cv_lib_$1${2}=no],[$4])dnl
+ #ac_cv_lib_$1=ac_cv_lib_[]$1[]_main
+ #ac_cv_lib_[]AC_Lib_Name()=ac_cv_lib_[]AC_Lib_Name()_main
+ LIBS="$old_LIBS"
+ ])
+
+dnl Define a function that checks for the existence of a library
+dnl and if it exists, prepends the corresponding link flag to a
+dnl sepecified variable
+dnl Arguments:
+dnl - The library name
+dnl - The name of the variable to which to prepend the library link flag
+dnl - List of extra libraries required for link test
+dnl - Optional library path linker argument (e.g. -L/opt/foo)
+ AC_DEFUN([FATHOM_CHECK_VTK_LIB_LIST],[
+ old_LIBS="$LIBS"
+ LIBS="$5 ${$3} $old_LIBS"
+ #AC_HAVE_LIBRARY([$1${2}],[$3="-l$1$2 ${$3}"],[],[$4])
+ #AC_HAVE_LIBRARY($1,[$3="-l$1 ${$3}"],[],[$4])
+ AC_CHECK_LIB([$1$VTK_LIB_SUFFIX], main,
+ [$3="-l$1$VTK_LIB_SUFFIX ${$3}"],
+ [],[$4])dnl
+ #AC_CHECK_LIB([$1$VTK_LIB_SUFFIX], main,
+ # [$3="-l$1$VTK_LIB_SUFFIX ${$3}"
+ # eval "ac_cv_lib_$1$VTK_LIB_SUFFIX=yes"],
+ # [eval "ac_cv_lib_$1$VTK_LIB_SUFFIX=no"],[$4])dnl
+ #ac_cv_lib_$1=ac_cv_lib_[]$1[]_main
+ #ac_cv_lib_[]AC_Lib_Name()=ac_cv_lib_[]AC_Lib_Name()_main
+ LIBS="$old_LIBS"
+ ])
+
+
################################################################################
# VTK for qvdual and/or vtkMOABReader
################################################################################
@@ -786,7 +836,7 @@ if test "xno" != "x$WITH_VTK" -a "x" != "x$WITH_VTK"; then
AC_LANG_CPLUSPLUS
VTK_INCLUDES=
- VTK_LIB_SUFFIX=-pv3.98
+ #VTK_LIB_SUFFIX=-pv3.98
case "x$WITH_VTK" in
xyes|x)
VTK_LIB_DIR=
@@ -806,9 +856,10 @@ if test "xno" != "x$WITH_VTK" -a "x" != "x$WITH_VTK"; then
for dir in /usr/lib/vtk /usr/lib /usr/bin /usr; do
if test "x" = "x$VTK_LIB_DIR"; then
LIBS="$old_LIBS -L$dir"
- unset ac_cv_lib_vtkCommon
- unset ac_cv_lib_vtkCommon_main
- AC_HAVE_LIBRARY([vtkCommonCore$VTK_LIB_SUFFIX],[VTK_LIB_DIR=$dir])
+ #unset ac_cv_lib_vtkCommon
+ #unset ac_cv_lib_vtkCommon_main
+ #AC_HAVE_LIBRARY([vtkCommonCore$VTK_LIB_SUFFIX],[VTK_LIB_DIR=$dir])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkCommonCore],[$VTK_LIB_SUFFIX], [VTK_LIB_DIR],[],[-L$dir])
fi
done
if test "x" = "x$VTK_LIB_DIR"; then
@@ -828,15 +879,15 @@ if test "xno" != "x$WITH_VTK" -a "x" != "x$WITH_VTK"; then
# Check for non-installed VTK source
AC_CHECK_FILE([vtkUnstructuredGrid.h],[
for subdir in . Common Common/DataModel Filtering GenericFiltering Graphics Hybrid Imaging Parallel Patented Rendering Utilities Utilities/vtkexpat Utilities/expat Utilities/DICOMParser Utilties/vtkpng Utilities/vtkzlib Utilities/freetype/include/freetype Wrapping; do
- AC_MSG_CHECKING([for directory ${WITH_VTK}/$subdir])
- if test -d ${WITH_VTK}/$subdir; then
- VTK_INC_DIR="$VTK_INC_DIR -I${WITH_VTK}/$subdir"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- fi
- done
- ],[AC_MSG_ERROR([VTK includes not found])]
+ AC_MSG_CHECKING([for directory ${WITH_VTK}/$subdir])
+ if test -d ${WITH_VTK}/$subdir; then
+ VTK_INC_DIR="$VTK_INC_DIR -I${WITH_VTK}/$subdir"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ done
+ ],[AC_MSG_ERROR([VTK includes not found])]
)
fi
VTK_INCLUDES="$VTK_INC_DIR"
@@ -844,7 +895,8 @@ if test "xno" != "x$WITH_VTK" -a "x" != "x$WITH_VTK"; then
for dir in ${WITH_VTK}/lib ${WITH_VTK}/lib/vtk ${VTK_DIR}/bin ${WITH_VTK}/bin ${WITH_VTK}; do
if test "x" = "x$VTK_LIB_DIR"; then
LIBS="$old_LIBS -L$dir"
- AC_HAVE_LIBRARY([vtkCommonCore$VTK_LIB_SUFFIX],[VTK_LIB_DIR=$dir])
+ #AC_HAVE_LIBRARY([vtkCommonCore${VTK_LIB_SUFFIX}],[VTK_LIB_DIR=$dir])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkCommonCore],[$VTK_LIB_SUFFIX], [VTK_LIB_DIR],[],[-L$dir])
fi
done
if test "x" = "x$VTK_LIB_DIR"; then
@@ -853,22 +905,7 @@ if test "xno" != "x$WITH_VTK" -a "x" != "x$WITH_VTK"; then
LIBS="$old_LIBS"
;;
esac
-
-dnl Define a function that checks for the existence of a library
-dnl and if it exists, prepends the corresponding link flag to a
-dnl sepecified variable
-dnl Arguments:
-dnl - The library name
-dnl - The name of the variable to which to prepend the library link flag
-dnl - List of extra libraries required for link test
-dnl - Optional library path linker argument (e.g. -L/opt/foo)
- AC_DEFUN([FATHOM_CHECK_LIB_LIST],[
- old_LIBS="$LIBS"
- LIBS="$5 ${$3} $old_LIBS"
- AC_HAVE_LIBRARY([$1$2],[$3="-l$1$2 ${$3}"],[],[$4])
- LIBS="$old_LIBS"
- ])
-
+
# These are ordered such that a given library depends only on those libraries
# that preceed it in the list.
FATHOM_CHECK_LIB_LIST([pthread],[],[vtk_sys_libs])
@@ -883,27 +920,29 @@ dnl - Optional library path linker argument (e.g. -L/opt/foo)
FATHOM_CHECK_LIB_LIST([GL],[], [vtk_x_libs],[$x_libs_arg],[-L$x_libraries])
FATHOM_CHECK_LIB_LIST([GLU],[], [vtk_x_libs],[$x_libs_arg],[-L$x_libraries])
vtk_libs_arg="-L$x_libraries $vtk_x_libs $X_EXTRA_LIBS -lX11 $X_PRE_LIBS $vtk_sys_libs"
- FATHOM_CHECK_LIB_LIST([vtksys],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkCommonCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkDICOMParser],[$VTK_LIB_SUFFIX],[vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkfreetype],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkexpat],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkzlib],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkpng],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkjpeg],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtktiff],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkftgl],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkFiltering],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkImaging],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([verdict],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkGraphics],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkNetCDF],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkexoIIc],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkmetaio],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkIO],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkRendering],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkParallel],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkHybrid],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+
+ #FATHOM_CHECK_LIB_LIST(vtksys$VTK_LIB_SUFFIX,[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtksys],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkCommonCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkDICOMParser],[$VTK_LIB_SUFFIX],[vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkfreetype],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkexpat],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkzlib],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkpng],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkjpeg],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtktiff],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkftgl],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkFiltersCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkImagingCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([verdict],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkGraphics],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkNetCDF],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkexoIIc],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkmetaio],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkIOCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkRenderingCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkParallelCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ #FATHOM_CHECK_VTK_LIB_LIST([vtkHybrid],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
# Make sure we found at least vtkCommonCore and vtkRendering
if ! echo "x $vtk_libs" | grep lvtkCommonCore >/dev/null; then
https://bitbucket.org/fathomteam/moab/commits/92e900be0897/
Changeset: 92e900be0897
Branch: None
User: vijaysm
Date: 2014-01-29 17:09:21
Summary: Remove the miscellaneous comments. Enable the netcdf library checks similar to original master version.
Affected #: 1 file
diff --git a/config/netcdf.m4 b/config/netcdf.m4
index fbdfd7c..4c13802 100644
--- a/config/netcdf.m4
+++ b/config/netcdf.m4
@@ -111,23 +111,23 @@ if test "xno" != "x$NETCDF_ARG"; then
[AC_MSG_WARN([[NetCDF header not found.]]); HAVE_NETCDF=no] )
# Check if netcdf is usable by itself
- AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf"], [NETCDF_LIBS=${NETCDF_LDFLAGS}] )
-# AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf"], [
-# # Check if netcdf is usable with HDF5
-# unset ac_cv_lib_netcdf
-# unset ac_cv_lib_netcdf_nc_create
-# # If we haven't already looked for HDF5 libraries, again now incase
-# # they're in the NetCDF lib directory.
-# FATHOM_DETECT_HDF5_LIBS
-# LDFLAGS="$LDFLAGS $HDF5_LDFLAGS"
-# AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf -lhdf5_hl"], [
-# # Try one more time with HDF5 and libcurl
-# unset ac_cv_lib_netcdf
-# unset ac_cv_lib_netcdf_nc_create
-# AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf -lhdf5_hl "],
-# [HAVE_NETCDF=no], [-lhdf5_hl $HDF5_LIBS ] )],
-# [-lhdf5_hl $HDF5_LIBS] )],
-# )
+ # AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf"], [NETCDF_LIBS=${NETCDF_LDFLAGS}] )
+ AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf"], [
+ # Check if netcdf is usable with HDF5
+ unset ac_cv_lib_netcdf
+ unset ac_cv_lib_netcdf_nc_create
+ # If we haven't already looked for HDF5 libraries, again now incase
+ # they're in the NetCDF lib directory.
+ FATHOM_DETECT_HDF5_LIBS
+ LDFLAGS="$LDFLAGS $HDF5_LDFLAGS"
+ AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf -lhdf5_hl $HDF5_LIBS"], [
+ # Try one more time with HDF5 and libcurl
+ unset ac_cv_lib_netcdf
+ unset ac_cv_lib_netcdf_nc_create
+ AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf -lhdf5_hl -lcurl "],
+ [HAVE_NETCDF=no], [-lhdf5_hl $HDF5_LIBS -lcurl ] )],
+ [-lhdf5_hl $HDF5_LIBS] )],
+ )
CPPFLAGS="$old_CPPFLAGS"
LDFLAGS="$old_LDFLAGS"
https://bitbucket.org/fathomteam/moab/commits/7852969d01cc/
Changeset: 7852969d01cc
Branch: None
User: vijaysm
Date: 2014-01-29 17:19:59
Summary: Remove stale comments in VTK configuration.
Affected #: 1 file
diff --git a/configure.ac b/configure.ac
index d1e6f73..82bf72b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -772,13 +772,6 @@ dnl - Optional library path linker argument (e.g. -L/opt/foo)
old_LIBS="$LIBS"
LIBS="$5 ${$3} $old_LIBS"
AC_HAVE_LIBRARY([$1],[$3="-l$1 ${$3}"],[],[$4])
- #AC_HAVE_LIBRARY($1,[$3="-l$1 ${$3}"],[],[$4])
- #AC_CHECK_LIB([$1${2}], main,
- # [$3="-l$1 ${$3}"
- # ac_cv_lib_$1${2}=yes],
- # [ac_cv_lib_$1${2}=no],[$4])dnl
- #ac_cv_lib_$1=ac_cv_lib_[]$1[]_main
- #ac_cv_lib_[]AC_Lib_Name()=ac_cv_lib_[]AC_Lib_Name()_main
LIBS="$old_LIBS"
])
@@ -793,17 +786,9 @@ dnl - Optional library path linker argument (e.g. -L/opt/foo)
AC_DEFUN([FATHOM_CHECK_VTK_LIB_LIST],[
old_LIBS="$LIBS"
LIBS="$5 ${$3} $old_LIBS"
- #AC_HAVE_LIBRARY([$1${2}],[$3="-l$1$2 ${$3}"],[],[$4])
- #AC_HAVE_LIBRARY($1,[$3="-l$1 ${$3}"],[],[$4])
AC_CHECK_LIB([$1$VTK_LIB_SUFFIX], main,
[$3="-l$1$VTK_LIB_SUFFIX ${$3}"],
[],[$4])dnl
- #AC_CHECK_LIB([$1$VTK_LIB_SUFFIX], main,
- # [$3="-l$1$VTK_LIB_SUFFIX ${$3}"
- # eval "ac_cv_lib_$1$VTK_LIB_SUFFIX=yes"],
- # [eval "ac_cv_lib_$1$VTK_LIB_SUFFIX=no"],[$4])dnl
- #ac_cv_lib_$1=ac_cv_lib_[]$1[]_main
- #ac_cv_lib_[]AC_Lib_Name()=ac_cv_lib_[]AC_Lib_Name()_main
LIBS="$old_LIBS"
])
@@ -836,7 +821,6 @@ if test "xno" != "x$WITH_VTK" -a "x" != "x$WITH_VTK"; then
AC_LANG_CPLUSPLUS
VTK_INCLUDES=
- #VTK_LIB_SUFFIX=-pv3.98
case "x$WITH_VTK" in
xyes|x)
VTK_LIB_DIR=
@@ -856,9 +840,6 @@ if test "xno" != "x$WITH_VTK" -a "x" != "x$WITH_VTK"; then
for dir in /usr/lib/vtk /usr/lib /usr/bin /usr; do
if test "x" = "x$VTK_LIB_DIR"; then
LIBS="$old_LIBS -L$dir"
- #unset ac_cv_lib_vtkCommon
- #unset ac_cv_lib_vtkCommon_main
- #AC_HAVE_LIBRARY([vtkCommonCore$VTK_LIB_SUFFIX],[VTK_LIB_DIR=$dir])
FATHOM_CHECK_VTK_LIB_LIST([vtkCommonCore],[$VTK_LIB_SUFFIX], [VTK_LIB_DIR],[],[-L$dir])
fi
done
@@ -895,7 +876,6 @@ if test "xno" != "x$WITH_VTK" -a "x" != "x$WITH_VTK"; then
for dir in ${WITH_VTK}/lib ${WITH_VTK}/lib/vtk ${VTK_DIR}/bin ${WITH_VTK}/bin ${WITH_VTK}; do
if test "x" = "x$VTK_LIB_DIR"; then
LIBS="$old_LIBS -L$dir"
- #AC_HAVE_LIBRARY([vtkCommonCore${VTK_LIB_SUFFIX}],[VTK_LIB_DIR=$dir])
FATHOM_CHECK_VTK_LIB_LIST([vtkCommonCore],[$VTK_LIB_SUFFIX], [VTK_LIB_DIR],[],[-L$dir])
fi
done
@@ -921,7 +901,6 @@ if test "xno" != "x$WITH_VTK" -a "x" != "x$WITH_VTK"; then
FATHOM_CHECK_LIB_LIST([GLU],[], [vtk_x_libs],[$x_libs_arg],[-L$x_libraries])
vtk_libs_arg="-L$x_libraries $vtk_x_libs $X_EXTRA_LIBS -lX11 $X_PRE_LIBS $vtk_sys_libs"
- #FATHOM_CHECK_LIB_LIST(vtksys$VTK_LIB_SUFFIX,[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
FATHOM_CHECK_VTK_LIB_LIST([vtksys],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
FATHOM_CHECK_VTK_LIB_LIST([vtkCommonCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
FATHOM_CHECK_VTK_LIB_LIST([vtkDICOMParser],[$VTK_LIB_SUFFIX],[vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
https://bitbucket.org/fathomteam/moab/commits/100cd3e3373a/
Changeset: 100cd3e3373a
Branch: master
User: vijaysm
Date: 2014-02-26 22:13:49
Summary: Merged in vijaysm/moab/autoconf-fixes (pull request #17)
Configuration fixes for HDF5, NetCDF, VTK
Affected #: 3 files
diff --git a/config/hdf5.m4 b/config/hdf5.m4
index 4d3d11d..b603d24 100644
--- a/config/hdf5.m4
+++ b/config/hdf5.m4
@@ -28,16 +28,17 @@ if test "xyes" != "x$HAVE_LIB_HDF5"; then
HAVE_LIB_HDF5=no
FATHOM_HDF5_LIBS_HELPER
+ FATHOM_HDF5_LIBS_HELPER([-ldl])
if test $HAVE_ZLIB = yes; then
- FATHOM_HDF5_LIBS_HELPER([-lz])
- FATHOM_HDF5_LIBS_HELPER([-lz -lpthread])
+ FATHOM_HDF5_LIBS_HELPER([-lz -ldl])
+ FATHOM_HDF5_LIBS_HELPER([-lz -ldl -lpthread])
fi
if test $HAVE_SZIP = yes; then
- FATHOM_HDF5_LIBS_HELPER([-lsz])
- FATHOM_HDF5_LIBS_HELPER([-lsz -lpthread])
+ FATHOM_HDF5_LIBS_HELPER([-lsz -ldl])
+ FATHOM_HDF5_LIBS_HELPER([-lsz -ldl -lpthread])
if test $HAVE_ZLIB = yes; then
- FATHOM_HDF5_LIBS_HELPER([-lsz -lz])
- FATHOM_HDF5_LIBS_HELPER([-lsz -lz -lpthread])
+ FATHOM_HDF5_LIBS_HELPER([-lsz -lz -ldl])
+ FATHOM_HDF5_LIBS_HELPER([-lsz -lz -ldl -lpthread])
fi
fi
fi
diff --git a/config/netcdf.m4 b/config/netcdf.m4
index 041327d..4c13802 100644
--- a/config/netcdf.m4
+++ b/config/netcdf.m4
@@ -85,33 +85,47 @@ if test "xno" != "x$NETCDF_ARG"; then
NETCDF_CPPFLAGS="-I${NETCDF_ARG}"
fi
fi
-
+
+ AC_PATH_PROG([NC_CONFIG], [nc-config], [no], [${NETCDF_ARG}/bin])
+ if test "$NC_CONFIG" != "no" ; then
+ NETCDF_CPPFLAGS="`$NC_CONFIG --cflags`"
+ NETCDF_LDFLAGS="`$NC_CONFIG --libs`"
+ NETCDF_VERSION="`$NC_CONFIG --version`"
+ AC_SUBST([NETCDF_CPPFLAGS])
+ AC_SUBST([NETCDF_LDFLAGS])
+ AC_SUBST([NETCDF_VERSION])
+ else
+ HAVE_NETCDF=no
+ AC_MSG_WARN("NetCDF configuration utility not found")
+ fi
+
old_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$NETCDF_CPPFLAGS $CPPFLAGS"
old_LDFLAGS="$LDFLAGS"
- LDFLAGS="$NETCDF_LDFLAGS $HDF5_LDFLAGS $LDFLAGS"
+ LDFLAGS="$NETCDF_LDFLAGS $LDFLAGS"
# Check for C library
AC_LANG_PUSH([C])
AC_CHECK_HEADERS( [netcdf.h],
[FATHOM_CHECK_NETCDF_LIMITS([$1],[$2],[netcdf.h],[NETCDF_SUFFICIENT_DIM_VARS])],
[AC_MSG_WARN([[NetCDF header not found.]]); HAVE_NETCDF=no] )
-
+
# Check if netcdf is usable by itself
+ # AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf"], [NETCDF_LIBS=${NETCDF_LDFLAGS}] )
AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf"], [
- # Check if netcdf is usable with HDF5
+ # Check if netcdf is usable with HDF5
unset ac_cv_lib_netcdf
unset ac_cv_lib_netcdf_nc_create
- # If we haven't already looked for HDF5 libraries, again now incase
- # they're in the NetCDF lib directory.
+ # If we haven't already looked for HDF5 libraries, again now incase
+ # they're in the NetCDF lib directory.
FATHOM_DETECT_HDF5_LIBS
LDFLAGS="$LDFLAGS $HDF5_LDFLAGS"
- AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf -lhdf5_hl"], [
+ AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf -lhdf5_hl $HDF5_LIBS"], [
# Try one more time with HDF5 and libcurl
unset ac_cv_lib_netcdf
unset ac_cv_lib_netcdf_nc_create
- AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf -lhdf5_hl -lcurl"],
- [HAVE_NETCDF=no], [-lhdf5_hl $HDF5_LIBS -lcurl] )],
+ AC_CHECK_LIB( [netcdf], [nc_create], [NETCDF_LIBS="-lnetcdf -lhdf5_hl -lcurl "],
+ [HAVE_NETCDF=no], [-lhdf5_hl $HDF5_LIBS -lcurl ] )],
[-lhdf5_hl $HDF5_LIBS] )],
)
diff --git a/configure.ac b/configure.ac
index ea22a5e..82bf72b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -593,13 +593,14 @@ AC_ARG_WITH( [vtk-lib-suffix],
[case "x$withval" in
xyes)
AC_MSG_ERROR([Must specify a non-empty suffix!])
- VTK_LIB_SUFFIX=
+ VTK_LIB_SUFFIX=
;;
xno)
- VTK_LIB_SUFFIX=
+ AC_MSG_ERROR([Must specify a non-empty suffix!])
+ VTK_LIB_SUFFIX=
;;
x*)
- VTK_LIB_SUFFIX="$withval"
+ VTK_LIB_SUFFIX="$withval"
DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --with-vtk-lib-suffix=\"${withval}\""
;;
esac],[VTK_LIB_SUFFIX=] )
@@ -758,6 +759,40 @@ AC_SUBST(ZOLTAN_INC_FLAGS)
EXPORT_LDFLAGS="$ZOLTAN_LIB_FLAGS $EXPORT_LDFLAGS"
+
+dnl Define a function that checks for the existence of a library
+dnl and if it exists, prepends the corresponding link flag to a
+dnl sepecified variable
+dnl Arguments:
+dnl - The library name
+dnl - The name of the variable to which to prepend the library link flag
+dnl - List of extra libraries required for link test
+dnl - Optional library path linker argument (e.g. -L/opt/foo)
+ AC_DEFUN([FATHOM_CHECK_LIB_LIST],[
+ old_LIBS="$LIBS"
+ LIBS="$5 ${$3} $old_LIBS"
+ AC_HAVE_LIBRARY([$1],[$3="-l$1 ${$3}"],[],[$4])
+ LIBS="$old_LIBS"
+ ])
+
+dnl Define a function that checks for the existence of a library
+dnl and if it exists, prepends the corresponding link flag to a
+dnl sepecified variable
+dnl Arguments:
+dnl - The library name
+dnl - The name of the variable to which to prepend the library link flag
+dnl - List of extra libraries required for link test
+dnl - Optional library path linker argument (e.g. -L/opt/foo)
+ AC_DEFUN([FATHOM_CHECK_VTK_LIB_LIST],[
+ old_LIBS="$LIBS"
+ LIBS="$5 ${$3} $old_LIBS"
+ AC_CHECK_LIB([$1$VTK_LIB_SUFFIX], main,
+ [$3="-l$1$VTK_LIB_SUFFIX ${$3}"],
+ [],[$4])dnl
+ LIBS="$old_LIBS"
+ ])
+
+
################################################################################
# VTK for qvdual and/or vtkMOABReader
################################################################################
@@ -786,7 +821,6 @@ if test "xno" != "x$WITH_VTK" -a "x" != "x$WITH_VTK"; then
AC_LANG_CPLUSPLUS
VTK_INCLUDES=
- VTK_LIB_SUFFIX=-pv3.98
case "x$WITH_VTK" in
xyes|x)
VTK_LIB_DIR=
@@ -806,9 +840,7 @@ if test "xno" != "x$WITH_VTK" -a "x" != "x$WITH_VTK"; then
for dir in /usr/lib/vtk /usr/lib /usr/bin /usr; do
if test "x" = "x$VTK_LIB_DIR"; then
LIBS="$old_LIBS -L$dir"
- unset ac_cv_lib_vtkCommon
- unset ac_cv_lib_vtkCommon_main
- AC_HAVE_LIBRARY([vtkCommonCore$VTK_LIB_SUFFIX],[VTK_LIB_DIR=$dir])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkCommonCore],[$VTK_LIB_SUFFIX], [VTK_LIB_DIR],[],[-L$dir])
fi
done
if test "x" = "x$VTK_LIB_DIR"; then
@@ -828,15 +860,15 @@ if test "xno" != "x$WITH_VTK" -a "x" != "x$WITH_VTK"; then
# Check for non-installed VTK source
AC_CHECK_FILE([vtkUnstructuredGrid.h],[
for subdir in . Common Common/DataModel Filtering GenericFiltering Graphics Hybrid Imaging Parallel Patented Rendering Utilities Utilities/vtkexpat Utilities/expat Utilities/DICOMParser Utilties/vtkpng Utilities/vtkzlib Utilities/freetype/include/freetype Wrapping; do
- AC_MSG_CHECKING([for directory ${WITH_VTK}/$subdir])
- if test -d ${WITH_VTK}/$subdir; then
- VTK_INC_DIR="$VTK_INC_DIR -I${WITH_VTK}/$subdir"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- fi
- done
- ],[AC_MSG_ERROR([VTK includes not found])]
+ AC_MSG_CHECKING([for directory ${WITH_VTK}/$subdir])
+ if test -d ${WITH_VTK}/$subdir; then
+ VTK_INC_DIR="$VTK_INC_DIR -I${WITH_VTK}/$subdir"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ done
+ ],[AC_MSG_ERROR([VTK includes not found])]
)
fi
VTK_INCLUDES="$VTK_INC_DIR"
@@ -844,7 +876,7 @@ if test "xno" != "x$WITH_VTK" -a "x" != "x$WITH_VTK"; then
for dir in ${WITH_VTK}/lib ${WITH_VTK}/lib/vtk ${VTK_DIR}/bin ${WITH_VTK}/bin ${WITH_VTK}; do
if test "x" = "x$VTK_LIB_DIR"; then
LIBS="$old_LIBS -L$dir"
- AC_HAVE_LIBRARY([vtkCommonCore$VTK_LIB_SUFFIX],[VTK_LIB_DIR=$dir])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkCommonCore],[$VTK_LIB_SUFFIX], [VTK_LIB_DIR],[],[-L$dir])
fi
done
if test "x" = "x$VTK_LIB_DIR"; then
@@ -853,22 +885,7 @@ if test "xno" != "x$WITH_VTK" -a "x" != "x$WITH_VTK"; then
LIBS="$old_LIBS"
;;
esac
-
-dnl Define a function that checks for the existence of a library
-dnl and if it exists, prepends the corresponding link flag to a
-dnl sepecified variable
-dnl Arguments:
-dnl - The library name
-dnl - The name of the variable to which to prepend the library link flag
-dnl - List of extra libraries required for link test
-dnl - Optional library path linker argument (e.g. -L/opt/foo)
- AC_DEFUN([FATHOM_CHECK_LIB_LIST],[
- old_LIBS="$LIBS"
- LIBS="$5 ${$3} $old_LIBS"
- AC_HAVE_LIBRARY([$1$2],[$3="-l$1$2 ${$3}"],[],[$4])
- LIBS="$old_LIBS"
- ])
-
+
# These are ordered such that a given library depends only on those libraries
# that preceed it in the list.
FATHOM_CHECK_LIB_LIST([pthread],[],[vtk_sys_libs])
@@ -883,27 +900,28 @@ dnl - Optional library path linker argument (e.g. -L/opt/foo)
FATHOM_CHECK_LIB_LIST([GL],[], [vtk_x_libs],[$x_libs_arg],[-L$x_libraries])
FATHOM_CHECK_LIB_LIST([GLU],[], [vtk_x_libs],[$x_libs_arg],[-L$x_libraries])
vtk_libs_arg="-L$x_libraries $vtk_x_libs $X_EXTRA_LIBS -lX11 $X_PRE_LIBS $vtk_sys_libs"
- FATHOM_CHECK_LIB_LIST([vtksys],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkCommonCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkDICOMParser],[$VTK_LIB_SUFFIX],[vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkfreetype],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkexpat],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkzlib],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkpng],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkjpeg],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtktiff],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkftgl],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkFiltering],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkImaging],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([verdict],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkGraphics],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkNetCDF],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkexoIIc],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkmetaio],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkIO],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkRendering],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkParallel],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
- FATHOM_CHECK_LIB_LIST([vtkHybrid],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+
+ FATHOM_CHECK_VTK_LIB_LIST([vtksys],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkCommonCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkDICOMParser],[$VTK_LIB_SUFFIX],[vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkfreetype],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkexpat],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkzlib],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkpng],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkjpeg],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtktiff],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkftgl],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkFiltersCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkImagingCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([verdict],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkGraphics],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkNetCDF],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkexoIIc],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkmetaio],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkIOCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkRenderingCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ FATHOM_CHECK_VTK_LIB_LIST([vtkParallelCore],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
+ #FATHOM_CHECK_VTK_LIB_LIST([vtkHybrid],[$VTK_LIB_SUFFIX], [vtk_libs],[$vtk_libs_arg],[-L$VTK_LIB_DIR])
# Make sure we found at least vtkCommonCore and vtkRendering
if ! echo "x $vtk_libs" | grep lvtkCommonCore >/dev/null; then
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/MOAB: danwu: Applied some minor changes to examples/makefile.
by commits-noreply@bitbucket.org 26 Feb '14
by commits-noreply@bitbucket.org 26 Feb '14
26 Feb '14
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/327f0f8cac34/
Changeset: 327f0f8cac34
Branch: master
User: danwu
Date: 2014-02-26 21:59:56
Summary: Applied some minor changes to examples/makefile.
Affected #: 1 file
diff --git a/examples/makefile b/examples/makefile
index 1e8c521..41dc577 100644
--- a/examples/makefile
+++ b/examples/makefile
@@ -7,14 +7,14 @@ include ${MOAB_DIR}/lib/iMesh-Defs.inc
# MESH_DIR is the directory containing mesh files that come with MOAB source
MESH_DIR="../MeshFiles/unittest"
-EXAMPLES = HelloMOAB GetEntities SetsNTags structuredmesh StructuredMeshSimple DirectAccessWithHoles DirectAccessNoHoles point_in_elem_search DeformMeshRemap
+EXAMPLES = HelloMOAB GetEntities SetsNTags LoadPartial structuredmesh StructuredMeshSimple DirectAccessWithHoles DirectAccessNoHoles point_in_elem_search DeformMeshRemap
PAREXAMPLES = HelloParMOAB ReduceExchangeTags LloydRelaxation CrystalRouterExample
EXOIIEXAMPLES = TestExodusII
F90EXAMPLES = DirectAccessNoHolesF90 PushParMeshIntoMoabF90
default: ${EXAMPLES} ${PAREXAMPLES} ${EXOIIEXAMPLES} ${F90EXAMPLES}
-HelloMOAB : HelloMOAB.o ${MOAB_LIBDIR}/libMOAB.la
+HelloMOAB: HelloMOAB.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
GetEntities: GetEntities.o ${MOAB_LIBDIR}/libMOAB.la
@@ -26,10 +26,13 @@ SetsNTags: SetsNTags.o ${MOAB_LIBDIR}/libMOAB.la
LloydRelaxation: LloydRelaxation.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
-structuredmesh : structuredmesh.o ${MOAB_LIBDIR}/libMOAB.la
+LoadPartial: LoadPartial.o ${MOAB_LIBDIR}/libMOAB.la
+ ${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK} ${MOAB_LIBS_LINK}
+
+structuredmesh: structuredmesh.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
-StructuredMeshSimple : StructuredMeshSimple.o ${MOAB_LIBDIR}/libMOAB.la
+StructuredMeshSimple: StructuredMeshSimple.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
DirectAccessWithHoles: DirectAccessWithHoles.o ${MOAB_LIBDIR}/libMOAB.la
@@ -41,13 +44,13 @@ DirectAccessNoHoles: DirectAccessNoHoles.o ${MOAB_LIBDIR}/libMOAB.la
DirectAccessNoHolesF90: DirectAccessNoHolesF90.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_FC} -o $@ $< ${IMESH_LIBS}
-ReduceExchangeTags : ReduceExchangeTags.o ${MOAB_LIBDIR}/libMOAB.la
+ReduceExchangeTags: ReduceExchangeTags.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
HelloParMOAB: HelloParMOAB.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
-CrystalRouterExample: CrystalRouterExample.o ${MOAB_LIBDIR}/libMOAB.la
+CrystalRouterExample: CrystalRouterExample.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
TestExodusII: TestExodusII.o ${MOAB_LIBDIR}/libMOAB.la
@@ -62,15 +65,12 @@ PushParMeshIntoMoabF90: PushParMeshIntoMoabF90.o
DeformMeshRemap: DeformMeshRemap.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK} -lmbcoupler ${MOAB_LIBS_LINK}
-LoadPartial: LoadPartial.o ${MOAB_LIBDIR}/libMOAB.la
- ${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK} ${MOAB_LIBS_LINK}
-
clean:
- rm -rf *.o *.mod ${EXAMPLES} ${PAREXAMPLES} ${EXOIIEXAMPLES} ${F90EXAMPLES}
+ rm -rf *.o *.mod *.h5m ${EXAMPLES} ${PAREXAMPLES} ${EXOIIEXAMPLES} ${F90EXAMPLES}
-.cpp.o :
+.cpp.o:
${MOAB_CXX} ${CXXFLAGS} ${MOAB_CXXFLAGS} ${MOAB_CPPFLAGS} ${MOAB_INCLUDES} -DMESH_DIR=\"${MESH_DIR}\" -c $<
-.F90.o :
+.F90.o:
${IMESH_FC} ${FCFLAGS} ${IMESH_FCFLAGS} ${MOAB_CPPFLAGS} ${IMESH_INCLUDES} ${IMESH_FCDEFS} -DMESH_DIR=\"${MESH_DIR}\" -c $<
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/MOAB: danwu: There is a segmentation fault on load_file("MeshFiles/unittest/io/fv26x46x72.t.3.nc", NULL, "VARIABLE=US"). It turns out that some tags of ScdInterface class (e.g. __BOX_SET) might get deleted (e.g. by Core::clean_up_failed_read) before they are dereferenced later. These dangling tags should be reset to NULL so that they can be recreated upon request.
by commits-noreply@bitbucket.org 25 Feb '14
by commits-noreply@bitbucket.org 25 Feb '14
25 Feb '14
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/71326735b78e/
Changeset: 71326735b78e
Branch: master
User: danwu
Date: 2014-02-25 21:25:26
Summary: There is a segmentation fault on load_file("MeshFiles/unittest/io/fv26x46x72.t.3.nc", NULL, "VARIABLE=US"). It turns out that some tags of ScdInterface class (e.g. __BOX_SET) might get deleted (e.g. by Core::clean_up_failed_read) before they are dereferenced later. These dangling tags should be reset to NULL so that they can be recreated upon request.
Affected #: 1 file
diff --git a/src/ScdInterface.cpp b/src/ScdInterface.cpp
index 12f5b89..3f95538 100644
--- a/src/ScdInterface.cpp
+++ b/src/ScdInterface.cpp
@@ -339,6 +339,13 @@ ErrorCode ScdInterface::create_box_set(const HomCoord low, const HomCoord high,
Tag ScdInterface::box_periodic_tag(bool create_if_missing)
{
+ // Reset boxPeriodicTag in case it has been deleted (e.g. by Core::clean_up_failed_read)
+ if (boxPeriodicTag) {
+ std::string tag_name;
+ if (MB_TAG_NOT_FOUND == mbImpl->tag_get_name(boxPeriodicTag, tag_name))
+ boxPeriodicTag = NULL;
+ }
+
if (boxPeriodicTag || !create_if_missing) return boxPeriodicTag;
ErrorCode rval = mbImpl->tag_get_handle("BOX_PERIODIC", 3, MB_TYPE_INTEGER,
@@ -349,6 +356,13 @@ Tag ScdInterface::box_periodic_tag(bool create_if_missing)
Tag ScdInterface::box_dims_tag(bool create_if_missing)
{
+ // Reset boxDimsTag in case it has been deleted (e.g. by clean_up_failed_read)
+ if (boxDimsTag) {
+ std::string tag_name;
+ if (MB_TAG_NOT_FOUND == mbImpl->tag_get_name(boxDimsTag, tag_name))
+ boxDimsTag = NULL;
+ }
+
if (boxDimsTag || !create_if_missing) return boxDimsTag;
ErrorCode rval = mbImpl->tag_get_handle("BOX_DIMS", 6, MB_TYPE_INTEGER,
@@ -359,6 +373,13 @@ Tag ScdInterface::box_dims_tag(bool create_if_missing)
Tag ScdInterface::global_box_dims_tag(bool create_if_missing)
{
+ // Reset globalBoxDimsTag in case it has been deleted (e.g. by Core::clean_up_failed_read)
+ if (globalBoxDimsTag) {
+ std::string tag_name;
+ if (MB_TAG_NOT_FOUND == mbImpl->tag_get_name(globalBoxDimsTag, tag_name))
+ globalBoxDimsTag = NULL;
+ }
+
if (globalBoxDimsTag || !create_if_missing) return globalBoxDimsTag;
ErrorCode rval = mbImpl->tag_get_handle("GLOBAL_BOX_DIMS", 6, MB_TYPE_INTEGER,
@@ -369,6 +390,13 @@ Tag ScdInterface::global_box_dims_tag(bool create_if_missing)
Tag ScdInterface::part_method_tag(bool create_if_missing)
{
+ // Reset partMethodTag in case it has been deleted (e.g. by Core::clean_up_failed_read)
+ if (partMethodTag) {
+ std::string tag_name;
+ if (MB_TAG_NOT_FOUND == mbImpl->tag_get_name(partMethodTag, tag_name))
+ partMethodTag = NULL;
+ }
+
if (partMethodTag || !create_if_missing) return partMethodTag;
ErrorCode rval = mbImpl->tag_get_handle("PARTITION_METHOD", 1, MB_TYPE_INTEGER,
@@ -379,6 +407,13 @@ Tag ScdInterface::part_method_tag(bool create_if_missing)
Tag ScdInterface::box_set_tag(bool create_if_missing)
{
+ // Reset boxSetTag in case it has been deleted (e.g. by Core::clean_up_failed_read)
+ if (boxSetTag) {
+ std::string tag_name;
+ if (MB_TAG_NOT_FOUND == mbImpl->tag_get_name(boxSetTag, tag_name))
+ boxSetTag = NULL;
+ }
+
if (boxSetTag || !create_if_missing) return boxSetTag;
ErrorCode rval = mbImpl->tag_get_handle("__BOX_SET", sizeof(ScdBox*), MB_TYPE_OPAQUE,
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0