Commit 794b840b authored by Praetorius, Simon's avatar Praetorius, Simon
parents a08be7e4 251ee7ea
...@@ -40,6 +40,8 @@ if (MSVC) ...@@ -40,6 +40,8 @@ if (MSVC)
set(BUILD_SHARED_LIBS false) set(BUILD_SHARED_LIBS false)
mark_as_advanced(BUILD_SHARED_LIBS) mark_as_advanced(BUILD_SHARED_LIBS)
message(WARNING "Currently we can only build static libraries with Visual Studio") message(WARNING "Currently we can only build static libraries with Visual Studio")
add_definitions(-DNOMINMAX -D_CONSOLE -DSTRICT -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS)
endif (MSVC) endif (MSVC)
# parallel of sequential version # parallel of sequential version
......
...@@ -24,9 +24,9 @@ if (AMDIS_NEED_CXX11) ...@@ -24,9 +24,9 @@ if (AMDIS_NEED_CXX11)
if (NOT AMDIS_NEED_CXX11) if (NOT AMDIS_NEED_CXX11)
message(FATAL_ERROR "AMDiS was compiled with c++11 support, but the current compiler does not support this feature!") message(FATAL_ERROR "AMDiS was compiled with c++11 support, but the current compiler does not support this feature!")
endif (NOT AMDIS_NEED_CXX11) endif (NOT AMDIS_NEED_CXX11)
list(APPEND AMDIS_COMPILEFLAGS "-DHAS_CXX11=1") list(APPEND AMDIS_COMPILEFLAGS "-DAMDIS_HAS_CXX11=1")
else () else ()
list(APPEND AMDIS_COMPILEFLAGS "-DHAS_CXX11=0") list(APPEND AMDIS_COMPILEFLAGS "-DAMDIS_HAS_CXX11=0")
endif (AMDIS_NEED_CXX11) endif (AMDIS_NEED_CXX11)
......
...@@ -59,6 +59,10 @@ else () ...@@ -59,6 +59,10 @@ else ()
list(APPEND AMDIS_CONFIGURATION "SEQUENTIAL") list(APPEND AMDIS_CONFIGURATION "SEQUENTIAL")
endif () endif ()
if (MSVC)
add_definitions(-DNOMINMAX -D_CONSOLE -DSTRICT -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS)
endif (MSVC)
if (NOT EXISTS ${AMDIS_DIR}/AMDIS${POSTFIX}.cmake) if (NOT EXISTS ${AMDIS_DIR}/AMDIS${POSTFIX}.cmake)
message(FATAL_ERROR "Configuration ${AMDIS_CONFIGURATION} can not be found in ${AMDIS_DIR}.") message(FATAL_ERROR "Configuration ${AMDIS_CONFIGURATION} can not be found in ${AMDIS_DIR}.")
endif () endif ()
......
...@@ -34,9 +34,9 @@ set(COMPILEFLAGS "") ...@@ -34,9 +34,9 @@ set(COMPILEFLAGS "")
enable_cxx11(ENABLE_CXX11 COMPILEFLAGS) enable_cxx11(ENABLE_CXX11 COMPILEFLAGS)
if (ENABLE_CXX11) if (ENABLE_CXX11)
list(APPEND COMPILEFLAGS "-DHAS_CXX11=1") list(APPEND COMPILEFLAGS "-DAMDIS_HAS_CXX11=1")
else () else ()
list(APPEND COMPILEFLAGS "-DHAS_CXX11=0") list(APPEND COMPILEFLAGS "-DAMDIS_HAS_CXX11=0")
endif (ENABLE_CXX11) endif (ENABLE_CXX11)
enable_mtl4(COMPILEFLAGS AMDIS_INCLUDE_DIRS _) enable_mtl4(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
...@@ -188,7 +188,7 @@ include(muparser) ...@@ -188,7 +188,7 @@ include(muparser)
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
if (ENABLE_COMPRESSION) if (ENABLE_COMPRESSION)
list(APPEND COMPILEFLAGS "-DHAVE_COMPRESSION=1") list(APPEND COMPILEFLAGS "-DAMDIS_HAS_COMPRESSION")
endif (ENABLE_COMPRESSION) endif (ENABLE_COMPRESSION)
if (ENABLE_EXTENSIONS) if (ENABLE_EXTENSIONS)
...@@ -222,10 +222,6 @@ if (ENABLE_SEQ_PETSC) ...@@ -222,10 +222,6 @@ if (ENABLE_SEQ_PETSC)
include(amdis_seq_petsc) include(amdis_seq_petsc)
endif (ENABLE_SEQ_PETSC) endif (ENABLE_SEQ_PETSC)
if (MSVC)
list(APPEND COMPILEFLAGS "-D_SCL_SECURE_NO_WARNINGS" "-D_CRT_SECURE_NO_WARNINGS")
endif (MSVC)
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
include_directories(${AMDIS_INCLUDE_DIRS}) include_directories(${AMDIS_INCLUDE_DIRS})
......
...@@ -16,6 +16,11 @@ add_library(muparser ...@@ -16,6 +16,11 @@ add_library(muparser
include_directories(${MUPARSER_INCLUDE_DIR}) include_directories(${MUPARSER_INCLUDE_DIR})
if (ENABLE_CXX11)
add_definitions(-DMUPARSER_HAS_CXX11=1)
endif (ENABLE_CXX11)
# specify how to install this target: # specify how to install this target:
# ----------------------------------- # -----------------------------------
......
...@@ -24,9 +24,9 @@ if (AMDIS_NEED_CXX11) ...@@ -24,9 +24,9 @@ if (AMDIS_NEED_CXX11)
if (NOT AMDIS_NEED_CXX11) if (NOT AMDIS_NEED_CXX11)
message(FATAL_ERROR "AMDiS was compiled with c++11 support, but the current compiler does not support this feature!") message(FATAL_ERROR "AMDiS was compiled with c++11 support, but the current compiler does not support this feature!")
endif (NOT AMDIS_NEED_CXX11) endif (NOT AMDIS_NEED_CXX11)
target_compile_definitions(amdis_base INTERFACE HAS_CXX11=1) target_compile_definitions(amdis_base INTERFACE AMDIS_HAS_CXX11=1)
else () else ()
target_compile_definitions(amdis_base INTERFACE HAS_CXX11=0) target_compile_definitions(amdis_base INTERFACE AMDIS_HAS_CXX11=0)
endif (AMDIS_NEED_CXX11) endif (AMDIS_NEED_CXX11)
...@@ -37,7 +37,7 @@ if (_AMDIS_H) ...@@ -37,7 +37,7 @@ if (_AMDIS_H)
get_filename_component(AMDIS_INCLUDE_DIR ${_AMDIS_H} PATH CACHE) get_filename_component(AMDIS_INCLUDE_DIR ${_AMDIS_H} PATH CACHE)
target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR}) target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR})
else () else ()
message(ERROR "Could not detect the AMDiS include directory. Please set the variable AMDIS_INCLUDE_DIR to the directory containing the AMDiS headers.") message(FATAL_ERROR "Could not detect the AMDiS include directory. Please set the variable AMDIS_INCLUDE_DIR to the directory containing the AMDiS headers.")
endif () endif ()
unset(_AMDIS_H CACHE) unset(_AMDIS_H CACHE)
...@@ -59,7 +59,7 @@ if (_AMDIS_LIBD) ...@@ -59,7 +59,7 @@ if (_AMDIS_LIBD)
endif () endif ()
if (NOT(_AMDIS_LIB OR _AMDIS_LIBD)) if (NOT(_AMDIS_LIB OR _AMDIS_LIBD))
message(ERROR "Could not detect the AMDiS${POSTFIX} library. Please set the variable _AMDIS_LIB to the AMDiS${POSTFIX} library.") message(FATAL_ERROR "Could not detect the AMDiS${POSTFIX} library. Please set the variable _AMDIS_LIB to the AMDiS${POSTFIX} library.")
endif () endif ()
...@@ -100,7 +100,7 @@ if (AMDIS_NEED_EXTENSIONS) ...@@ -100,7 +100,7 @@ if (AMDIS_NEED_EXTENSIONS)
target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR}/extensions/base_problems) target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR}/extensions/base_problems)
endif (AMDIS_NEED_BASE_PROBLEMS) endif (AMDIS_NEED_BASE_PROBLEMS)
else () else ()
message(ERROR "Extensions library not found") message(FATAL_ERROR "Extensions library not found")
endif () endif ()
if (_EXTENSIONS_LIB) if (_EXTENSIONS_LIB)
...@@ -117,10 +117,10 @@ endif (AMDIS_NEED_EXTENSIONS) ...@@ -117,10 +117,10 @@ endif (AMDIS_NEED_EXTENSIONS)
if (AMDIS_NEED_REINIT) if (AMDIS_NEED_REINIT)
find_library(_REINIT_LIB amdisreinit${POSTFIX} PATHS ${AMDIS_DIR}/../../lib/amdis/) find_library(_REINIT_LIB amdisreinit${POSTFIX} PATHS ${AMDIS_DIR}/../../lib/amdis/)
find_library(_REINIT_LIBD amdisreinit${POSTFIX}d PATHS ${AMDIS_DIR}/../../lib/amdis/) # debug version find_library(_REINIT_LIBD amdisreinit${POSTFIX}d PATHS ${AMDIS_DIR}/../../lib/amdis/) # debug version
if (_REINIT_LIB OR _REINIT_LIB) if (_REINIT_LIB OR _REINIT_LIBD)
target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR}/reinit) target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR}/reinit)
else () else ()
message(ERROR "Reinit library not found") message(FATAL_ERROR "Reinit library not found")
endif () endif ()
if (_REINIT_LIB) if (_REINIT_LIB)
...@@ -140,7 +140,7 @@ if (AMDIS_NEED_COMPOSITE_FEM) ...@@ -140,7 +140,7 @@ if (AMDIS_NEED_COMPOSITE_FEM)
if (_COMPOSITE_FEM_LIB OR _COMPOSITE_FEM_LIBD) if (_COMPOSITE_FEM_LIB OR _COMPOSITE_FEM_LIBD)
target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR}/compositeFEM) target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR}/compositeFEM)
else () else ()
message(ERROR "CompositeFEM library not found") message(FATAL_ERROR "CompositeFEM library not found")
endif () endif ()
if (_COMPOSITE_FEM_LIB) if (_COMPOSITE_FEM_LIB)
...@@ -159,7 +159,7 @@ if (_MUPARSER_LIB) ...@@ -159,7 +159,7 @@ if (_MUPARSER_LIB)
target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR}/muparser) target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR}/muparser)
target_link_libraries(amdis_base INTERFACE ${_MUPARSER_LIB}) target_link_libraries(amdis_base INTERFACE ${_MUPARSER_LIB})
else () else ()
message(ERROR "MuParser library not found") message(FATAL_ERROR "MuParser library not found")
endif () endif ()
unset(_MUPARSER_LIB CACHE) unset(_MUPARSER_LIB CACHE)
...@@ -205,6 +205,7 @@ if (AMDIS_NEED_PNG) ...@@ -205,6 +205,7 @@ if (AMDIS_NEED_PNG)
target_enable_png(amdis_base INTERFACE ON) target_enable_png(amdis_base INTERFACE ON)
endif () endif ()
# Sequential PETSc library # Sequential PETSc library
# -------------- # --------------
if (AMDIS_NEED_SEQ_PETSC AND NOT AMDIS_HAS_PARALLEL_DOMAIN) if (AMDIS_NEED_SEQ_PETSC AND NOT AMDIS_HAS_PARALLEL_DOMAIN)
......
...@@ -65,6 +65,10 @@ else () ...@@ -65,6 +65,10 @@ else ()
list(APPEND AMDIS_CONFIGURATION "SEQUENTIAL") list(APPEND AMDIS_CONFIGURATION "SEQUENTIAL")
endif () endif ()
if (MSVC)
add_definitions(-DNOMINMAX -D_CONSOLE -DSTRICT -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS)
endif (MSVC)
if (NOT EXISTS ${AMDIS_DIR}/AMDIS${POSTFIX}.cmake) if (NOT EXISTS ${AMDIS_DIR}/AMDIS${POSTFIX}.cmake)
message(FATAL_ERROR "Configuration ${AMDIS_CONFIGURATION} can not be found in ${AMDIS_DIR}.") message(FATAL_ERROR "Configuration ${AMDIS_CONFIGURATION} can not be found in ${AMDIS_DIR}.")
endif () endif ()
......
...@@ -25,9 +25,9 @@ target_compile_definitions(amdis_base INTERFACE) ...@@ -25,9 +25,9 @@ target_compile_definitions(amdis_base INTERFACE)
target_enable_cxx11(ENABLE_CXX11 amdis_base INTERFACE) target_enable_cxx11(ENABLE_CXX11 amdis_base INTERFACE)
if (ENABLE_CXX11) if (ENABLE_CXX11)
target_compile_definitions(amdis_base INTERFACE HAS_CXX11=1) target_compile_definitions(amdis_base INTERFACE AMDIS_HAS_CXX11=1)
else () else ()
target_compile_definitions(amdis_base INTERFACE HAS_CXX11=0) target_compile_definitions(amdis_base INTERFACE AMDIS_HAS_CXX11=0)
endif (ENABLE_CXX11) endif (ENABLE_CXX11)
target_enable_mtl4(amdis_base INTERFACE) target_enable_mtl4(amdis_base INTERFACE)
...@@ -178,7 +178,7 @@ include(muparser) # -> target muparser ...@@ -178,7 +178,7 @@ include(muparser) # -> target muparser
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
if (ENABLE_COMPRESSION) if (ENABLE_COMPRESSION)
target_compile_definitions(amdis PRIVATE HAVE_COMPRESSION=1) target_compile_definitions(amdis PRIVATE AMDIS_HAS_COMPRESSION=1)
endif (ENABLE_COMPRESSION) endif (ENABLE_COMPRESSION)
if (ENABLE_REINIT) if (ENABLE_REINIT)
...@@ -195,12 +195,6 @@ endif (ENABLE_SEQ_PETSC) ...@@ -195,12 +195,6 @@ endif (ENABLE_SEQ_PETSC)
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
if (MSVC)
target_compile_definitions(amdis PRIVATE
_SCL_SECURE_NO_WARNINGS
_CRT_SECURE_NO_WARNINGS)
endif (MSVC)
target_link_libraries(amdis AMDiS::base muparser) target_link_libraries(amdis AMDiS::base muparser)
# specify how to install this target: # specify how to install this target:
......
...@@ -18,7 +18,7 @@ target_include_directories(muparser PUBLIC ${MUPARSER_INCLUDE_DIR}) ...@@ -18,7 +18,7 @@ target_include_directories(muparser PUBLIC ${MUPARSER_INCLUDE_DIR})
if (ENABLE_CXX11) if (ENABLE_CXX11)
target_enable_cxx11(MUPARSER_ENABLE_CXX11 muparser PRIVATE) target_enable_cxx11(MUPARSER_ENABLE_CXX11 muparser PRIVATE)
target_compile_definitions(muparser PRIVATE HAS_CXX11=1) target_compile_definitions(muparser PRIVATE MUPARSER_HAS_CXX11=1)
endif (ENABLE_CXX11) endif (ENABLE_CXX11)
# specify how to install this target: # specify how to install this target:
......
...@@ -262,7 +262,7 @@ private: ...@@ -262,7 +262,7 @@ private:
mutable stringbuf_type m_vStringBuf; ///< String buffer, used for storing string function arguments mutable stringbuf_type m_vStringBuf; ///< String buffer, used for storing string function arguments
stringbuf_type m_vStringVarBuf; stringbuf_type m_vStringVarBuf;
#if HAS_CXX11 #if MUPARSER_HAS_CXX11
std::unique_ptr<token_reader_type> m_pTokenReader; ///< Managed pointer to the token reader object. std::unique_ptr<token_reader_type> m_pTokenReader; ///< Managed pointer to the token reader object.
#else #else
std::auto_ptr<token_reader_type> m_pTokenReader; ///< Managed pointer to the token reader object. std::auto_ptr<token_reader_type> m_pTokenReader; ///< Managed pointer to the token reader object.
......
...@@ -78,7 +78,7 @@ namespace mu ...@@ -78,7 +78,7 @@ namespace mu
TString m_strTok; ///< Token string TString m_strTok; ///< Token string
TString m_strVal; ///< Value for string variables TString m_strVal; ///< Value for string variables
value_type m_fVal; value_type m_fVal;
#if HAS_CXX11 #if MUPARSER_HAS_CXX11
std::unique_ptr<ParserCallback> m_pCallback; std::unique_ptr<ParserCallback> m_pCallback;
#else #else
std::auto_ptr<ParserCallback> m_pCallback; std::auto_ptr<ParserCallback> m_pCallback;
......
...@@ -1040,7 +1040,7 @@ namespace mu ...@@ -1040,7 +1040,7 @@ namespace mu
try try
{ {
#if HAS_CXX11 #if MUPARSER_HAS_CXX11
std::unique_ptr<Parser> p1; std::unique_ptr<Parser> p1;
#else #else
std::auto_ptr<Parser> p1; std::auto_ptr<Parser> p1;
......
...@@ -145,7 +145,7 @@ namespace mu ...@@ -145,7 +145,7 @@ namespace mu
*/ */
ParserTokenReader* ParserTokenReader::Clone(ParserBase *a_pParent) const ParserTokenReader* ParserTokenReader::Clone(ParserBase *a_pParent) const
{ {
#if HAS_CXX11 #if MUPARSER_HAS_CXX11
std::unique_ptr<ParserTokenReader> ptr(new ParserTokenReader(*this)); std::unique_ptr<ParserTokenReader> ptr(new ParserTokenReader(*this));
#else #else
std::auto_ptr<ParserTokenReader> ptr(new ParserTokenReader(*this)); std::auto_ptr<ParserTokenReader> ptr(new ParserTokenReader(*this));
......
...@@ -72,7 +72,7 @@ namespace AMDiS { ...@@ -72,7 +72,7 @@ namespace AMDiS {
} }
#if HAS_CXX11 #if AMDIS_HAS_CXX11
// c++11 std::function of lambda-functions // c++11 std::function of lambda-functions
void DirichletBC<_value_by_function>::fillBoundaryCondition( void DirichletBC<_value_by_function>::fillBoundaryCondition(
DOFVectorBase<double>* vector, DOFVectorBase<double>* vector,
......
...@@ -160,7 +160,7 @@ namespace AMDiS ...@@ -160,7 +160,7 @@ namespace AMDiS
}; };
#if HAS_CXX11 #if AMDIS_HAS_CXX11
// specialization for std::function or lambdas as value container // specialization for std::function or lambdas as value container
template <> template <>
class DirichletBC<_value_by_function> : public detail::DirichletBC class DirichletBC<_value_by_function> : public detail::DirichletBC
......
...@@ -686,7 +686,7 @@ inline void addSOT(Operator& op, double term, int I, int J) ...@@ -686,7 +686,7 @@ inline void addSOT(Operator& op, double term, int I, int J)
} }
#if HAS_CXX11 #if AMDIS_HAS_CXX11
template <class Term, class Result = void> template <class Term, class Result = void>
using ScalarTerm = typename boost::enable_if< boost::is_same<double, typename Term::value_type>, Result >::type; using ScalarTerm = typename boost::enable_if< boost::is_same<double, typename Term::value_type>, Result >::type;
......
...@@ -1412,7 +1412,7 @@ namespace AMDiS { ...@@ -1412,7 +1412,7 @@ namespace AMDiS {
} }
#if HAS_CXX11 #if AMDIS_HAS_CXX11
void ProblemStatSeq::addDirichletBC(BoundaryType type, int row, int col, void ProblemStatSeq::addDirichletBC(BoundaryType type, int row, int col,
std::function<double(WorldVector<double>)> b) std::function<double(WorldVector<double>)> b)
{ {
......
...@@ -197,7 +197,7 @@ namespace AMDiS { ...@@ -197,7 +197,7 @@ namespace AMDiS {
AbstractFunction<double, WorldVector<double> > *b); AbstractFunction<double, WorldVector<double> > *b);
#if HAS_CXX11 #if AMDIS_HAS_CXX11
/// Adds a Dirichlet boundary condition, where the rhs is given by an /// Adds a Dirichlet boundary condition, where the rhs is given by an
/// lambda function or a std::function object /// lambda function or a std::function object
virtual void addDirichletBC(BoundaryType type, int row, int col, virtual void addDirichletBC(BoundaryType type, int row, int col,
......
...@@ -47,7 +47,7 @@ typedef size_t aligned_size_t __attribute__ ((aligned(CACHE_LINE))); ...@@ -47,7 +47,7 @@ typedef size_t aligned_size_t __attribute__ ((aligned(CACHE_LINE)));
// C++11 features // C++11 features
// -------------- // --------------
#if HAS_CXX11 #if AMDIS_HAS_CXX11
// __has_feature(cxx_rvalue_references) // __has_feature(cxx_rvalue_references)
#if CLANG_VERSION >= 20900 && !defined(HAS_VARIADIC_TEMPLATES) #if CLANG_VERSION >= 20900 && !defined(HAS_VARIADIC_TEMPLATES)
......
...@@ -63,8 +63,8 @@ typedef size_t aligned_size_t; ...@@ -63,8 +63,8 @@ typedef size_t aligned_size_t;
// C++11 features // C++11 features
// -------------- // --------------
#ifndef HAS_CXX11 #ifndef AMDIS_HAS_CXX11
#define HAS_CXX11 0 #define AMDIS_HAS_CXX11 0
#endif #endif
#ifndef HAS_VARIADIC_TEMPLATES #ifndef HAS_VARIADIC_TEMPLATES
......
...@@ -47,7 +47,7 @@ typedef size_t aligned_size_t __attribute__ ((aligned(CACHE_LINE))); ...@@ -47,7 +47,7 @@ typedef size_t aligned_size_t __attribute__ ((aligned(CACHE_LINE)));
// C++11 features // C++11 features
// -------------- // --------------
#if HAS_CXX11 #if AMDIS_HAS_CXX11
#if GCC_VERSION >= 40300 && !defined(HAS_VARIADIC_TEMPLATES) #if GCC_VERSION >= 40300 && !defined(HAS_VARIADIC_TEMPLATES)
#define HAS_VARIADIC_TEMPLATES 1 #define HAS_VARIADIC_TEMPLATES 1
......
...@@ -51,7 +51,7 @@ typedef __declspec(align(CACHE_LINE)) size_t aligned_size_t; ...@@ -51,7 +51,7 @@ typedef __declspec(align(CACHE_LINE)) size_t aligned_size_t;
// C++11 features // C++11 features
// -------------- // --------------
#if HAS_CXX11 #if AMDIS_HAS_CXX11
#if INTEL_VERSION >= 1201 && !defined(HAS_VARIADIC_TEMPLATES) #if INTEL_VERSION >= 1201 && !defined(HAS_VARIADIC_TEMPLATES)
#define HAS_VARIADIC_TEMPLATES 1 #define HAS_VARIADIC_TEMPLATES 1
......
...@@ -52,6 +52,11 @@ typedef __declspec(align(CACHE_LINE)) size_t aligned_size_t; ...@@ -52,6 +52,11 @@ typedef __declspec(align(CACHE_LINE)) size_t aligned_size_t;
#define ALWAYS_INLINE __forceinline #define ALWAYS_INLINE __forceinline
#define OPENMODE std::ios::open_mode #define OPENMODE std::ios::open_mode
#ifdef max
#undef max
#undef min
#endif
#if MSC_VERSION >= 1800 && !defined(HAS_VARIADIC_TEMPLATES) #if MSC_VERSION >= 1800 && !defined(HAS_VARIADIC_TEMPLATES)
#define HAS_VARIADIC_TEMPLATES 1 #define HAS_VARIADIC_TEMPLATES 1
#endif #endif
......
...@@ -233,7 +233,7 @@ namespace AMDiS ...@@ -233,7 +233,7 @@ namespace AMDiS
if (writeParaViewVectorFormat) { if (writeParaViewVectorFormat) {
io::VtkVectorWriter::Aux<T> vtkVectorWriter(&dataCollectors, writeAs3dVector); io::VtkVectorWriter::Aux<T> vtkVectorWriter(&dataCollectors, writeAs3dVector);
#ifdef HAVE_COMPRESSION #ifdef AMDIS_HAS_COMPRESSION
vtkVectorWriter.setCompression(compression); vtkVectorWriter.setCompression(compression);
#endif #endif
vtkVectorWriter.writeFile(fn + paraviewFileExt); vtkVectorWriter.writeFile(fn + paraviewFileExt);
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <boost/iostreams/filtering_streambuf.hpp> #include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/iostreams/copy.hpp> #include <boost/iostreams/copy.hpp>
#ifdef HAVE_COMPRESSION #ifdef AMDIS_HAS_COMPRESSION
#include <boost/iostreams/filter/zlib.hpp> #include <boost/iostreams/filter/zlib.hpp>
#endif #endif
...@@ -242,12 +242,12 @@ namespace AMDiS { namespace io { ...@@ -242,12 +242,12 @@ namespace AMDiS { namespace io {
if(minor >= 1) if(minor >= 1)
file.read(const_cast<char*>(cps.data()), 4); file.read(const_cast<char*>(cps.data()), 4);
#ifdef HAVE_COMPRESSION #if HAMDIS_HAS_COMPRESSION
TEST_EXIT(cps == "null" || cps == "zlib") TEST_EXIT(cps == "null" || cps == "zlib")
("Cannot read Arh2 file. Currently only support zlib compression.\n"); ("Cannot read Arh2 file. Currently only support zlib compression.\n");
#else #else
TEST_EXIT(cps == "null") TEST_EXIT(cps == "null")
("HAVE_COMPRESSION OFF. Cannot read compressed Arh2 file.\n"); ("AMDIS_HAS_COMPRESSION==OFF. Cannot read compressed Arh2 file.\n");
#endif #endif
TEST_EXIT(dow == (unsigned)mesh->getGeo(WORLD)) TEST_EXIT(dow == (unsigned)mesh->getGeo(WORLD))
...@@ -371,7 +371,7 @@ namespace AMDiS { namespace io { ...@@ -371,7 +371,7 @@ namespace AMDiS { namespace io {
file.read(buffer, size); file.read(buffer, size);
dataStream.write(buffer, size); dataStream.write(buffer, size);
delete[] buffer; delete[] buffer;
#ifdef HAVE_COMPRESSION #ifdef AMDIS_HAS_COMPRESSION
if(cps == "zlib") { if(cps == "zlib") {
stringstream tmp(ios::out | ios::in); stringstream tmp(ios::out | ios::in);
boost::iostreams::filtering_streambuf<boost::iostreams::input> in; boost::iostreams::filtering_streambuf<boost::iostreams::input> in;
...@@ -554,12 +554,12 @@ namespace AMDiS { namespace io { ...@@ -554,12 +554,12 @@ namespace AMDiS { namespace io {
if(minor > 0) if(minor > 0)
file.read(const_cast<char*>(cps.data()), 4); file.read(const_cast<char*>(cps.data()), 4);
#ifdef HAVE_COMPRESSION #ifdef AMDIS_HAS_COMPRESSION
TEST_EXIT(cps == "null" || cps == "zlib") TEST_EXIT(cps == "null" || cps == "zlib")
("Cannot read Arh2 file. Currently only support zlib compression.\n"); ("Cannot read Arh2 file. Currently only support zlib compression.\n");
#else #else
TEST_EXIT(cps == "null") TEST_EXIT(cps == "null")
("HAVE_COMPRESSION OFF. Cannot read compressed Arh2 file.\n"); ("AMDIS_HAS_COMPRESSION OFF. Cannot read compressed Arh2 file.\n");
#endif #endif
vector<int> macroElIndex(nMacroElements); vector<int> macroElIndex(nMacroElements);
...@@ -600,7 +600,7 @@ namespace AMDiS { namespace io { ...@@ -600,7 +600,7 @@ namespace AMDiS { namespace io {
dataStream.write(buffer, size); dataStream.write(buffer, size);
delete[] buffer; delete[] buffer;
#ifdef HAVE_COMPRESSION #ifdef AMDIS_HAS_COMPRESSION
if(cps == "zlib") { if(cps == "zlib") {
stringstream tmp(ios::out | ios::in); stringstream tmp(ios::out | ios::in);
boost::iostreams::filtering_streambuf<boost::iostreams::input> in; boost::iostreams::filtering_streambuf<boost::iostreams::input> in;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <boost/iostreams/filtering_streambuf.hpp> #include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/iostreams/copy.hpp> #include <boost/iostreams/copy.hpp>
#ifdef HAVE_COMPRESSION #ifdef AMDIS_HAS_COMPRESSION
#include <boost/iostreams/filter/zlib.hpp> #include <boost/iostreams/filter/zlib.hpp>
#endif #endif
...@@ -151,7 +151,7 @@ namespace AMDiS { namespace io { ...@@ -151,7 +151,7 @@ namespace AMDiS { namespace io {
namesLen + //value vector table namesLen + //value vector table
nValueVectors * 8; //also value vector table nValueVectors * 8; //also value vector table
string typeId = "arh2", cps("null"); string typeId = "arh2", cps("null");
#ifdef HAVE_COMPRESSION #ifdef AMDIS_HAS_COMPRESSION
cps = "zlib"; cps = "zlib";
#endif #endif
uint8_t *major = const_cast<uint8_t*>(&(AMDiS::io::Arh2Writer::MAJOR)); uint8_t *major = const_cast<uint8_t*>(&(AMDiS::io::Arh2Writer::MAJOR));
...@@ -426,7 +426,7 @@ namespace AMDiS { namespace io { ...@@ -426,7 +426,7 @@ namespace AMDiS { namespace io {
} }
stringstream tmp(ios::out | ios::in | ios::binary); stringstream tmp(ios::out | ios::in | ios::binary);
boost::iostreams::filtering_streambuf<boost::iostreams::input> in; boost::iostreams::filtering_streambuf<boost::iostreams::input> in;
#ifdef HAVE_COMPRESSION #ifdef AMDIS_HAS_COMPRESSION
in.push(boost::iostreams::zlib_compressor()); in.push(boost::iostreams::zlib_compressor());
#endif #endif
in.push(dataStream); in.push(dataStream);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <boost/iostreams/filtering_streambuf.hpp> #include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/iostreams/copy.hpp> #include <boost/iostreams/copy.hpp>
#ifdef HAVE_COMPRESSION #ifdef AMDIS_HAS_COMPRESSION
#include <boost/iostreams/filter/zlib.hpp> #include <boost/iostreams/filter/zlib.hpp>
#include <boost/iostreams/filter/bzip2.hpp> #include <boost/iostreams/filter/bzip2.hpp>
#endif #endif
...@@ -251,14 +251,14 @@ namespace AMDiS { namespace io { ...@@ -251,14 +251,14 @@ namespace AMDiS { namespace io {
file.read(reinterpret_cast<char*>(&cpsflag), 4); file.read(reinterpret_cast<char*>(&cpsflag), 4);
cps = static_cast<Cpsformat::Value>(cpsflag); cps = static_cast<Cpsformat::Value>(cpsflag);
#ifdef HAVE_COMPRESSION #ifdef AMDIS_HAS_COMPRESSION
TEST_EXIT(cps == Cpsformat::ZLIB || TEST_EXIT(cps == Cpsformat::ZLIB ||
cps == Cpsformat::BZIP2 || cps == Cpsformat::BZIP2 ||
cps == Cpsformat::NONE) cps == Cpsformat::NONE)
("Cannot read Arh3 file. Currently only support zlib and bzip2 compression.\n"); ("Cannot read Arh3 file. Currently only support zlib and bzip2 compression.\n");
#else #else
TEST_EXIT(cps == Cpsformat::NONE) TEST_EXIT(cps == Cpsformat::NONE)
("HAVE_COMPRESSION OFF. Cannot read compressed Arh3 file.\n"); ("AMDIS_HAS_COMPRESSION OFF. Cannot read compressed Arh3 file.\n");
#endif #endif
TEST_EXIT(dow == (unsigned)mesh->getGeo(WORLD)) TEST_EXIT(dow == (unsigned)mesh->getGeo(WORLD))
...@@ -421,7 +421,7 @@ namespace AMDiS { namespace io { ...@@ -421,7 +421,7 @@ namespace AMDiS { namespace io {
file.read(buffer, size); file.read(buffer, size);
dataStream.write(buffer, size); dataStream.write(buffer, size);
delete[] buffer; delete[] buffer;
#ifdef HAVE_COMPRESSION #ifdef AMDIS_HAS_COMPRESSION
stringstream tmp(ios::out | ios::in); stringstream tmp(ios::out | ios::in);
boost::iostreams::filtering_streambuf<boost::iostreams::input> in; boost::iostreams::filtering_streambuf<boost::iostreams::input> in;
switch(cps) switch(cps)
...@@ -649,14 +649,14 @@ namespace AMDiS { namespace io { ...@@ -649,14 +649,14 @@ namespace AMDiS { namespace io {
file.read(reinterpret_cast<char*>(&cpsflag), 4); file.read(reinterpret_cast<char*>(&cpsflag), 4);
cps = static_cast<Cpsformat::Value>(cpsflag); cps = static_cast<Cpsformat::Value>(cpsflag);
#ifdef HAVE_COMPRESSION #ifdef AMDIS_HAS_COMPRESSION
TEST_EXIT(cps == Cpsformat::ZLIB || TEST_EXIT(cps == Cpsformat::ZLIB ||
cps == Cpsformat::BZIP2 || cps == Cpsformat::BZIP2 ||
cps == Cpsformat::NONE) cps == Cpsformat::NONE)
("Cannot read Arh3 file. Currently only support zlib and bzip2 compression.\n"); ("Cannot read Arh3 file. Currently only support zlib and bzip2 compression.\n");
#else #else
TEST_EXIT(cps == Cpsformat::NONE) TEST_EXIT(cps == Cpsformat::NONE)
("HAVE_COMPRESSION OFF. Cannot read compressed Arh3 file.\n"); ("AMDIS_HAS_COMPRESSION OFF. Cannot read compressed Arh3 file.\n");
#endif #endif
vector<int> macroElIndex(nMacroElements); vector<int> macroElIndex(nMacroElements);
...@@ -715,7 +715,7 @@ namespace AMDiS { namespace io { ...@@ -715,7 +715,7 @@ namespace AMDiS { namespace io {
dataStream.write(buffer, size); dataStream.write(buffer, size);
delete[] buffer;