Commit 0eaef31c authored by Joseph G. Hennessey's avatar Joseph G. Hennessey

changes for ParaView 5.1.2 compatibility and for windows/linux/macosx builds

parent 6e4cb06a
......@@ -62,7 +62,7 @@ MACRO(VersionWrite vProjectName export_name)
FOREACH(il ${include_list})
SET(includes "${includes}\n\#include \"${il}\"")
ENDFOREACH()
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${vProjectName}Version.hpp
FILE(WRITE ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${vProjectName}Version.hpp
"/* Current Version of ${vProjectName}
* Major is: ${vMajor}
* Minor is: ${vMinor}
......@@ -73,7 +73,7 @@ ${includes}
extern ${export_name} ProjectVersion ${vProjectName}Version;\n"
)
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${vProjectName}Version.cpp
FILE(WRITE ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${vProjectName}Version.cpp
"/* Current Version of ${vProjectName}
* Make sure to include this file in your built sources
*/
......
......@@ -39,6 +39,12 @@ if(XDMF_BUILD_TESTING)
endif()
if (XDMF_STATIC_AND_SHARED)
STRING(REGEX MATCH "-fPIC" IS_FPIC "${CMAKE_CXX_FLAGS}")
if ("${IS_FPIC}" STREQUAL "")
if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif(UNIX)
endif ("${IS_FPIC}" STREQUAL "")
add_definitions(-DXDMFSTATIC)
endif ()
......@@ -294,6 +300,7 @@ include_directories(${XdmfCore_INCLUDE_DIRS} ${XdmfDSM_INCLUDE_DIRS})
link_directories(${XDMF_LIBRARY_DIRS})
option(XDMF_BUILD_CORE_ONLY OFF)
mark_as_advanced(XDMF_BUILD_CORE_ONLY)
if(NOT XDMF_BUILD_CORE_ONLY)
set(XdmfSources
XdmfAggregate
......@@ -364,16 +371,16 @@ if(NOT XDMF_BUILD_CORE_ONLY)
set_target_properties(${XDMF_LIBNAME} PROPERTIES
PREFIX ../
IMPORT_PREFIX ../
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}/
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}/)
if(XDMF_STATIC_AND_SHARED AND BUILD_SHARED_LIBS)
set_target_properties(Xdmf_Static PROPERTIES
PREFIX ../
IMPORT_PREFIX ../
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}/
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}/)
endif ()
endif()
endif()
......
......@@ -192,7 +192,7 @@ protected:
private:
XdmfTopology(const XdmfTopology &);
XdmfTopology(const XdmfTopology &); // Not implemented.
void operator=(const XdmfTopology &); // Not implemented.
shared_ptr<const XdmfTopologyType> mType;
......
......@@ -9,7 +9,7 @@ include(SetUpVersion)
include(TestBigEndian)
if(VERSION_CONTROL_AUTOUPDATE OR
NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/XdmfVersion.hpp)
NOT EXISTS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/XdmfVersion.hpp)
VersionCreate("Xdmf" "3" "3" "0" "XDMFCORE_EXPORT" "XdmfCore.hpp")
endif()
......@@ -28,6 +28,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
#set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
option(XDMF_BUILD_DSM OFF)
mark_as_advanced(XDMF_BUILD_DSM)
if(XDMF_BUILD_DSM)
option(XDMF_BUILD_DSM_THREADS ON)
......@@ -53,6 +54,11 @@ endif ()
mark_as_advanced(CLEAR HDF5_C_INCLUDE_DIR)
mark_as_advanced(CLEAR HDF5_hdf5_LIBRARY_DEBUG)
mark_as_advanced(CLEAR HDF5_hdf5_LIBRARY_RELEASE)
set(HDF5_LIBRARIES ${vtkhdf5_LIBRARIES})
set(HDF5_hdf5_LIBRARY_RELEASE ${vtkhdf5_LIBRARIES})
set(HDF5_INCLUDE_DIRS ${vtkhdf5_INCLUDE_DIRS})
set(HDF5_C_INCLUDE_DIR ${vtkhdf5_INCLUDE_DIRS})
set(HDF5_FOUND TRUE)
find_package(HDF5 REQUIRED)
if(HDF5_FOUND)
mark_as_advanced(FORCE HDF5_C_INCLUDE_DIR)
......@@ -87,6 +93,9 @@ if(HDF5_FOUND)
endif()
set(LIBXML2_LIBRARIES ${vtklibxml2_LIBRARIES})
set(LIBXML2_INCLUDE_DIR ${vtklibxml2_INCLUDE_DIRS})
set(LIBXML2_FOUND TRUE)
find_package(LibXml2 REQUIRED)
if(LIBXML2_FOUND)
include_directories(${LIBXML2_INCLUDE_DIR})
......@@ -140,7 +149,7 @@ set(XdmfCoreSources
XdmfSparseMatrix
XdmfSubset
XdmfSystemUtils
${CMAKE_CURRENT_BINARY_DIR}/XdmfVersion
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/XdmfVersion
XdmfVisitor
XdmfWriter)
......@@ -189,16 +198,16 @@ if(WIN32)
set_target_properties(XdmfCore PROPERTIES
PREFIX ../
IMPORT_PREFIX ../
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}/
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}/)
if (XDMF_STATIC_AND_SHARED AND BUILD_SHARED_LIBS)
set_target_properties(XdmfCore_Static PROPERTIES
PREFIX ../
IMPORT_PREFIX ../
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}/
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}/)
endif ()
endif()
endif()
......
......@@ -26,9 +26,9 @@
// C Compatible Includes
#include "XdmfCore.hpp"
#include "XdmfItem.hpp"
#include "XdmfArrayReference.hpp"
#include "XdmfHeavyDataController.hpp"
#include "XdmfItem.hpp"
#ifdef __cplusplus
......
......@@ -662,9 +662,7 @@ XdmfArray::initialize(const std::vector<unsigned int> & dimensions)
{
mDimensions = dimensions;
const unsigned int size = static_cast<unsigned int>(
std::accumulate(dimensions.begin(),
dimensions.end(),
1,
std::accumulate(dimensions.begin(), dimensions.end(), 1,
std::multiplies<unsigned int>()));
return this->initialize<T>(size);
}
......@@ -707,10 +705,11 @@ template <typename T>
void
XdmfArray::pushBack(const T & value)
{
this->setIsChanged(true);
return boost::apply_visitor(PushBack<T>(value,
this),
mArray);
this->setIsChanged(true);
}
template<typename T>
......@@ -718,11 +717,12 @@ void
XdmfArray::resize(const unsigned int numValues,
const T & value)
{
this->setIsChanged(true);
return boost::apply_visitor(Resize<T>(this,
numValues,
value),
mArray);
this->setIsChanged(true);
}
template<typename T>
......@@ -730,11 +730,8 @@ void
XdmfArray::resize(const std::vector<unsigned int> & dimensions,
const T & value)
{
const unsigned int size = static_cast<unsigned int>(
std::accumulate(dimensions.begin(),
dimensions.end(),
1,
std::multiplies<unsigned int>()));
const unsigned int size = static_cast<unsigned int>(std::accumulate(dimensions.begin(), dimensions.end(), 1,
std::multiplies<unsigned int>()));
this->resize(size, value);
mDimensions = dimensions;
this->setIsChanged(true);
......
......@@ -21,9 +21,6 @@
/* */
/*****************************************************************************/
#include <libxml/uri.h>
#include <libxml/xpointer.h>
#include <libxml/xmlreader.h>
#include <boost/algorithm/string/trim.hpp>
#include <boost/tokenizer.hpp>
#include <cstring>
......@@ -215,7 +212,6 @@ public:
if (mItemFactory->isArrayTag((char *)currNode->name)) {
while(childNode != NULL) {
if(childNode->type == XML_TEXT_NODE && childNode->content) {
#if 1 //ARL's side
const char * content = (char*)childNode->content;
// Determine if content is whitespace
......@@ -237,16 +233,6 @@ public:
itemProperties.insert(std::make_pair("XMLDir", mXMLDir));
break;
}
#else //VTK's side, breaks XDMF's tests, revisit if problematic in VTK
std::string content((char *)childNode->content);
boost::algorithm::trim(content);
if(content.size() != 0) {
itemProperties.insert(std::make_pair("Content", content));
itemProperties.insert(std::make_pair("XMLDir", mXMLDir));
break;
}
#endif
}
childNode = childNode->next;
}
......
......@@ -323,4 +323,4 @@ catch (XdmfError & e) { \
}
#endif
#endif
#endif /* XDMFERROR_HPP_ */
......@@ -123,6 +123,7 @@ XdmfHDF5Writer::New(const std::string & filePath,
return p;
}
//Set mUseDeflate(true), and mDeflateFactor(6) for default compression
XdmfHDF5Writer::XdmfHDF5Writer(const std::string & filePath) :
XdmfHeavyDataWriter(filePath, 1, 800),
mImpl(new XdmfHDF5WriterImpl()),
......@@ -131,6 +132,7 @@ XdmfHDF5Writer::XdmfHDF5Writer(const std::string & filePath) :
{
}
//Set mUseDeflate(true), and mDeflateFactor(6) for default compression
XdmfHDF5Writer::XdmfHDF5Writer(const XdmfHDF5Writer & writerRef) :
XdmfHeavyDataWriter(writerRef.getFilePath(), 1, 800),
mImpl(new XdmfHDF5WriterImpl()),
......@@ -1399,7 +1401,7 @@ XdmfHDF5Writer::write(XdmfArray & array)
const hsize_t totalDimensionsSize =
std::accumulate(current_dims.begin(),
current_dims.end(),
1,
(hsize_t) 1,
std::multiplies<hsize_t>());
// The Nth root of the chunk size divided by the dimensions added together
const double factor =
......
......@@ -76,6 +76,8 @@ XdmfHeavyDataDescription::traverse(const shared_ptr<XdmfBaseVisitor> visitor)
}
// C Wrappers
XDMFHEAVYDATADESCRIPTION *
XdmfHeavyDataDescriptionNew(char * key, char * value)
{
......
......@@ -221,7 +221,7 @@ protected:
private:
XdmfInformation(const XdmfInformation &);
XdmfInformation(const XdmfInformation &); // Not implemented.
void operator=(const XdmfInformation &); // Not implemented.
std::string mKey;
......
......@@ -34,7 +34,7 @@ XdmfItem::XdmfItem() :
{
}
XdmfItem::XdmfItem(XdmfItem &refItem) :
XdmfItem::XdmfItem(const XdmfItem &refItem) :
mInformations(refItem.mInformations),
mIsChanged(true)
{
......
......@@ -37,8 +37,12 @@ class XdmfVisitor;
// Includes
#include <loki/Visitor.h>
#define vtk_libxml2_reference reference // Reversing VTK name mangling
#include <libxml/xmlexports.h>
#include <libxml/tree.h>
#include <libxml/uri.h>
#include <libxml/xpointer.h>
#include <libxml/xmlreader.h>
#include <map>
#include <set>
#include <string>
......@@ -375,7 +379,7 @@ public:
*/
virtual void traverse(const shared_ptr<XdmfBaseVisitor> visitor);
XdmfItem(XdmfItem &);
XdmfItem(const XdmfItem &);
protected:
......@@ -409,7 +413,7 @@ protected:
private:
XdmfItem(const XdmfItem &); // Not implemented.
// XdmfItem(const XdmfItem &); // It is implemented for C wrappers.
void operator=(const XdmfItem &); // Not implemented.
};
......
......@@ -22,7 +22,6 @@
/*****************************************************************************/
#include <fstream>
#include <libxml/tree.h>
#include <sstream>
#include <utility>
#include "XdmfArray.hpp"
......@@ -120,6 +119,9 @@ public:
(xmlChar*)"Version",
(xmlChar*)mVersionString.c_str());
xmlDocSetRootElement(mXMLDocument, mXMLCurrentNode);
if(mHeavyDataWriter->getMode() == XdmfHeavyDataWriter::Default) {
mHeavyDataWriter->openFile();
}
}
int mDepth;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment