From 251ee7ea56af115ae12bb41f03c69263c3af92c6 Mon Sep 17 00:00:00 2001
From: Simon Praetorius <simon.praetorius@tu-dresden.de>
Date: Sun, 30 Oct 2016 16:29:41 +0100
Subject: [PATCH] added windows compatibility

---
 AMDiS/CMakeLists.txt                          |  2 +
 AMDiS/cmake/AMDIS.cmake.in                    |  4 +-
 AMDiS/cmake/AMDISConfig.cmake.in              |  4 ++
 AMDiS/cmake/CMakeLists.txt                    | 10 +--
 AMDiS/cmake/muparser.cmake                    |  5 ++
 AMDiS/cmake3/AMDIS.cmake.in                   | 19 +++---
 AMDiS/cmake3/AMDISConfig.cmake.in             |  4 ++
 AMDiS/cmake3/CMakeLists.txt                   | 12 +---
 AMDiS/cmake3/muparser.cmake                   |  2 +-
 .../lib/muparser_v134/include/muParserBase.h  |  2 +-
 .../lib/muparser_v134/include/muParserToken.h |  2 +-
 AMDiS/lib/muparser_v134/src/muParserTest.cpp  |  2 +-
 .../muparser_v134/src/muParserTokenReader.cpp |  2 +-
 AMDiS/src/DirichletBC.cc                      |  2 +-
 AMDiS/src/DirichletBC.h                       |  2 +-
 AMDiS/src/Expressions.h                       |  2 +-
 AMDiS/src/ProblemStat.cc                      |  2 +-
 AMDiS/src/ProblemStat.h                       |  2 +-
 AMDiS/src/config/Config_clang.h               |  2 +-
 AMDiS/src/config/Config_defaults.h            |  4 +-
 AMDiS/src/config/Config_gcc.h                 |  2 +-
 AMDiS/src/config/Config_intel.h               |  2 +-
 AMDiS/src/config/Config_msc.h                 |  5 ++
 AMDiS/src/io/FileWriter.hh                    |  2 +-
 AMDiS/src/io/detail/Arh2Reader.cc             | 14 ++--
 AMDiS/src/io/detail/Arh2Writer.cc             |  6 +-
 AMDiS/src/io/detail/Arh3Reader.cc             | 14 ++--
 AMDiS/src/io/detail/Arh3Writer.cc             |  6 +-
 AMDiS/src/io/detail/VtkReader.h               |  8 +--
 AMDiS/src/io/detail/VtkVectorWriter.h         |  8 +--
 AMDiS/src/io/detail/VtkVectorWriter.hh        |  4 +-
 AMDiS/src/io/detail/VtkWriter.cc              |  6 +-
 AMDiS/src/io/detail/VtkWriter.h               |  4 +-
 AMDiS/src/traits/basic.hpp                    |  4 +-
 test/other/CMakeLists.txt                     |  4 +-
 test/other/src/Test_Arh3.h                    | 64 +++++++++----------
 tools/build_amdis.sh                          | 10 +--
 37 files changed, 130 insertions(+), 119 deletions(-)

diff --git a/AMDiS/CMakeLists.txt b/AMDiS/CMakeLists.txt
index 2e4f39a8..243f51f2 100644
--- a/AMDiS/CMakeLists.txt
+++ b/AMDiS/CMakeLists.txt
@@ -40,6 +40,8 @@ if (MSVC)
   set(BUILD_SHARED_LIBS false)
   mark_as_advanced(BUILD_SHARED_LIBS)
   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)
 
 # parallel of sequential version
diff --git a/AMDiS/cmake/AMDIS.cmake.in b/AMDiS/cmake/AMDIS.cmake.in
index 41930471..e8405352 100644
--- a/AMDiS/cmake/AMDIS.cmake.in
+++ b/AMDiS/cmake/AMDIS.cmake.in
@@ -24,9 +24,9 @@ if (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!")
   endif (NOT AMDIS_NEED_CXX11)
-  list(APPEND AMDIS_COMPILEFLAGS "-DHAS_CXX11=1")
+  list(APPEND AMDIS_COMPILEFLAGS "-DAMDIS_HAS_CXX11=1")
 else ()
-  list(APPEND AMDIS_COMPILEFLAGS "-DHAS_CXX11=0")
+  list(APPEND AMDIS_COMPILEFLAGS "-DAMDIS_HAS_CXX11=0")
 endif (AMDIS_NEED_CXX11)
 
 
diff --git a/AMDiS/cmake/AMDISConfig.cmake.in b/AMDiS/cmake/AMDISConfig.cmake.in
index 1fa1fc21..d3d56eb5 100644
--- a/AMDiS/cmake/AMDISConfig.cmake.in
+++ b/AMDiS/cmake/AMDISConfig.cmake.in
@@ -59,6 +59,10 @@ else ()
   list(APPEND AMDIS_CONFIGURATION "SEQUENTIAL")
 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)
   message(FATAL_ERROR "Configuration ${AMDIS_CONFIGURATION} can not be found in ${AMDIS_DIR}.")
 endif ()
diff --git a/AMDiS/cmake/CMakeLists.txt b/AMDiS/cmake/CMakeLists.txt
index 9765114a..8687cde7 100644
--- a/AMDiS/cmake/CMakeLists.txt
+++ b/AMDiS/cmake/CMakeLists.txt
@@ -34,9 +34,9 @@ set(COMPILEFLAGS "")
 
 enable_cxx11(ENABLE_CXX11 COMPILEFLAGS)
 if (ENABLE_CXX11)
-  list(APPEND COMPILEFLAGS "-DHAS_CXX11=1")
+  list(APPEND COMPILEFLAGS "-DAMDIS_HAS_CXX11=1")
 else ()
-  list(APPEND COMPILEFLAGS "-DHAS_CXX11=0")
+  list(APPEND COMPILEFLAGS "-DAMDIS_HAS_CXX11=0")
 endif (ENABLE_CXX11)
 
 enable_mtl4(COMPILEFLAGS AMDIS_INCLUDE_DIRS _)
@@ -188,7 +188,7 @@ include(muparser)
 # ------------------------------------------------------------------------------
 
 if (ENABLE_COMPRESSION)
-  list(APPEND COMPILEFLAGS "-DHAVE_COMPRESSION=1")
+  list(APPEND COMPILEFLAGS "-DAMDIS_HAS_COMPRESSION")
 endif (ENABLE_COMPRESSION)
 
 if (ENABLE_EXTENSIONS)
@@ -222,10 +222,6 @@ if (ENABLE_SEQ_PETSC)
   include(amdis_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})
diff --git a/AMDiS/cmake/muparser.cmake b/AMDiS/cmake/muparser.cmake
index 92e2c24f..bb161dae 100644
--- a/AMDiS/cmake/muparser.cmake
+++ b/AMDiS/cmake/muparser.cmake
@@ -16,6 +16,11 @@ add_library(muparser
 
 include_directories(${MUPARSER_INCLUDE_DIR})
 
+
+if (ENABLE_CXX11)
+  add_definitions(-DMUPARSER_HAS_CXX11=1)
+endif (ENABLE_CXX11)
+
 # specify how to install this target:
 # -----------------------------------
 
diff --git a/AMDiS/cmake3/AMDIS.cmake.in b/AMDiS/cmake3/AMDIS.cmake.in
index 93b16985..09ac1243 100644
--- a/AMDiS/cmake3/AMDIS.cmake.in
+++ b/AMDiS/cmake3/AMDIS.cmake.in
@@ -24,9 +24,9 @@ if (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!")
   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 ()
-  target_compile_definitions(amdis_base INTERFACE HAS_CXX11=0)
+  target_compile_definitions(amdis_base INTERFACE AMDIS_HAS_CXX11=0)
 endif (AMDIS_NEED_CXX11)
 
 
@@ -37,7 +37,7 @@ if (_AMDIS_H)
   get_filename_component(AMDIS_INCLUDE_DIR ${_AMDIS_H} PATH CACHE)
   target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR})
 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 ()
 unset(_AMDIS_H CACHE)
 
@@ -59,7 +59,7 @@ if (_AMDIS_LIBD)
 endif ()
 
 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 ()
 
 
@@ -100,7 +100,7 @@ if (AMDIS_NEED_EXTENSIONS)
       target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR}/extensions/base_problems)
     endif (AMDIS_NEED_BASE_PROBLEMS)
   else ()
-    message(ERROR "Extensions library not found")
+    message(FATAL_ERROR "Extensions library not found")
   endif ()
 
   if (_EXTENSIONS_LIB)
@@ -117,10 +117,10 @@ endif (AMDIS_NEED_EXTENSIONS)
 if (AMDIS_NEED_REINIT)
   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
-  if (_REINIT_LIB OR _REINIT_LIB)
+  if (_REINIT_LIB OR _REINIT_LIBD)
     target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR}/reinit)
   else ()
-    message(ERROR "Reinit library not found")
+    message(FATAL_ERROR "Reinit library not found")
   endif ()
 
   if (_REINIT_LIB)
@@ -140,7 +140,7 @@ if (AMDIS_NEED_COMPOSITE_FEM)
   if (_COMPOSITE_FEM_LIB OR _COMPOSITE_FEM_LIBD)
     target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR}/compositeFEM)
   else ()
-    message(ERROR "CompositeFEM library not found")
+    message(FATAL_ERROR "CompositeFEM library not found")
   endif ()
 
   if (_COMPOSITE_FEM_LIB)
@@ -159,7 +159,7 @@ if (_MUPARSER_LIB)
   target_include_directories(amdis_base INTERFACE ${AMDIS_INCLUDE_DIR}/muparser)
   target_link_libraries(amdis_base INTERFACE ${_MUPARSER_LIB})
 else ()
-  message(ERROR "MuParser library not found")
+  message(FATAL_ERROR "MuParser library not found")
 endif ()
 unset(_MUPARSER_LIB CACHE)
 
@@ -205,6 +205,7 @@ if (AMDIS_NEED_PNG)
   target_enable_png(amdis_base INTERFACE ON)
 endif ()
 
+
 # Sequential PETSc library
 # --------------
 if (AMDIS_NEED_SEQ_PETSC AND NOT AMDIS_HAS_PARALLEL_DOMAIN)
diff --git a/AMDiS/cmake3/AMDISConfig.cmake.in b/AMDiS/cmake3/AMDISConfig.cmake.in
index 7bf65e74..9b345095 100644
--- a/AMDiS/cmake3/AMDISConfig.cmake.in
+++ b/AMDiS/cmake3/AMDISConfig.cmake.in
@@ -65,6 +65,10 @@ else ()
   list(APPEND AMDIS_CONFIGURATION "SEQUENTIAL")
 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)
   message(FATAL_ERROR "Configuration ${AMDIS_CONFIGURATION} can not be found in ${AMDIS_DIR}.")
 endif ()
diff --git a/AMDiS/cmake3/CMakeLists.txt b/AMDiS/cmake3/CMakeLists.txt
index 8dcc7141..7652b351 100644
--- a/AMDiS/cmake3/CMakeLists.txt
+++ b/AMDiS/cmake3/CMakeLists.txt
@@ -25,9 +25,9 @@ target_compile_definitions(amdis_base INTERFACE)
 
 target_enable_cxx11(ENABLE_CXX11 amdis_base INTERFACE)
 if (ENABLE_CXX11)
-  target_compile_definitions(amdis_base INTERFACE HAS_CXX11=1)
+  target_compile_definitions(amdis_base INTERFACE AMDIS_HAS_CXX11=1)
 else ()
-  target_compile_definitions(amdis_base INTERFACE HAS_CXX11=0)
+  target_compile_definitions(amdis_base INTERFACE AMDIS_HAS_CXX11=0)
 endif (ENABLE_CXX11)
 
 target_enable_mtl4(amdis_base INTERFACE)
@@ -178,7 +178,7 @@ include(muparser)           # -> target muparser
 # ------------------------------------------------------------------------------
 
 if (ENABLE_COMPRESSION)
-  target_compile_definitions(amdis PRIVATE HAVE_COMPRESSION=1)
+  target_compile_definitions(amdis PRIVATE AMDIS_HAS_COMPRESSION=1)
 endif (ENABLE_COMPRESSION)
 
 if (ENABLE_REINIT)
@@ -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)
 
 # specify how to install this target:
diff --git a/AMDiS/cmake3/muparser.cmake b/AMDiS/cmake3/muparser.cmake
index 3d1f88b6..448bd8f2 100644
--- a/AMDiS/cmake3/muparser.cmake
+++ b/AMDiS/cmake3/muparser.cmake
@@ -18,7 +18,7 @@ target_include_directories(muparser PUBLIC ${MUPARSER_INCLUDE_DIR})
 
 if (ENABLE_CXX11)
   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)
 
 # specify how to install this target:
diff --git a/AMDiS/lib/muparser_v134/include/muParserBase.h b/AMDiS/lib/muparser_v134/include/muParserBase.h
index eb537e9f..be7f02c0 100644
--- a/AMDiS/lib/muparser_v134/include/muParserBase.h
+++ b/AMDiS/lib/muparser_v134/include/muParserBase.h
@@ -262,7 +262,7 @@ private:
     mutable stringbuf_type  m_vStringBuf; ///< String buffer, used for storing string function arguments
     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.
 #else
     std::auto_ptr<token_reader_type> m_pTokenReader; ///< Managed pointer to the token reader object.
diff --git a/AMDiS/lib/muparser_v134/include/muParserToken.h b/AMDiS/lib/muparser_v134/include/muParserToken.h
index 2a38542f..e2ea7f5e 100644
--- a/AMDiS/lib/muparser_v134/include/muParserToken.h
+++ b/AMDiS/lib/muparser_v134/include/muParserToken.h
@@ -78,7 +78,7 @@ namespace mu
       TString m_strTok;   ///< Token string
       TString m_strVal;   ///< Value for string variables
       value_type m_fVal;
-#if HAS_CXX11
+#if MUPARSER_HAS_CXX11
       std::unique_ptr<ParserCallback> m_pCallback;
 #else
       std::auto_ptr<ParserCallback> m_pCallback;
diff --git a/AMDiS/lib/muparser_v134/src/muParserTest.cpp b/AMDiS/lib/muparser_v134/src/muParserTest.cpp
index fb4e82f6..cd61092f 100644
--- a/AMDiS/lib/muparser_v134/src/muParserTest.cpp
+++ b/AMDiS/lib/muparser_v134/src/muParserTest.cpp
@@ -1040,7 +1040,7 @@ namespace mu
 
       try
       {
-#if HAS_CXX11
+#if MUPARSER_HAS_CXX11
         std::unique_ptr<Parser> p1;
 #else
         std::auto_ptr<Parser> p1;
diff --git a/AMDiS/lib/muparser_v134/src/muParserTokenReader.cpp b/AMDiS/lib/muparser_v134/src/muParserTokenReader.cpp
index 6e79d6a1..02dd026b 100644
--- a/AMDiS/lib/muparser_v134/src/muParserTokenReader.cpp
+++ b/AMDiS/lib/muparser_v134/src/muParserTokenReader.cpp
@@ -145,7 +145,7 @@ namespace mu
   */
   ParserTokenReader* ParserTokenReader::Clone(ParserBase *a_pParent) const
   {
-#if HAS_CXX11
+#if MUPARSER_HAS_CXX11
     std::unique_ptr<ParserTokenReader> ptr(new ParserTokenReader(*this));
 #else
     std::auto_ptr<ParserTokenReader> ptr(new ParserTokenReader(*this));
diff --git a/AMDiS/src/DirichletBC.cc b/AMDiS/src/DirichletBC.cc
index 701ccc55..3a2ac67d 100644
--- a/AMDiS/src/DirichletBC.cc
+++ b/AMDiS/src/DirichletBC.cc
@@ -72,7 +72,7 @@ namespace AMDiS {
   }
 
 
-#if HAS_CXX11
+#if AMDIS_HAS_CXX11
   // c++11 std::function of lambda-functions
   void DirichletBC<_value_by_function>::fillBoundaryCondition(
 	  DOFVectorBase<double>* vector,
diff --git a/AMDiS/src/DirichletBC.h b/AMDiS/src/DirichletBC.h
index 360c6b77..eb3fee7d 100644
--- a/AMDiS/src/DirichletBC.h
+++ b/AMDiS/src/DirichletBC.h
@@ -160,7 +160,7 @@ namespace AMDiS
     };
 
 
-#if HAS_CXX11
+#if AMDIS_HAS_CXX11
     // specialization for std::function or lambdas as value container
     template <>
     class DirichletBC<_value_by_function> : public detail::DirichletBC
diff --git a/AMDiS/src/Expressions.h b/AMDiS/src/Expressions.h
index ea5524ca..08c7f461 100644
--- a/AMDiS/src/Expressions.h
+++ b/AMDiS/src/Expressions.h
@@ -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>
 using ScalarTerm = typename boost::enable_if< boost::is_same<double, typename Term::value_type>, Result >::type;
diff --git a/AMDiS/src/ProblemStat.cc b/AMDiS/src/ProblemStat.cc
index 1caf5c7d..e208657b 100644
--- a/AMDiS/src/ProblemStat.cc
+++ b/AMDiS/src/ProblemStat.cc
@@ -1412,7 +1412,7 @@ namespace AMDiS {
   }
 
 
-#if HAS_CXX11
+#if AMDIS_HAS_CXX11
   void ProblemStatSeq::addDirichletBC(BoundaryType type, int row, int col,
 				      std::function<double(WorldVector<double>)> b)
   {
diff --git a/AMDiS/src/ProblemStat.h b/AMDiS/src/ProblemStat.h
index 0df3abb3..449a1de3 100644
--- a/AMDiS/src/ProblemStat.h
+++ b/AMDiS/src/ProblemStat.h
@@ -197,7 +197,7 @@ namespace AMDiS {
 				AbstractFunction<double, WorldVector<double> > *b);
 
 
-#if HAS_CXX11
+#if AMDIS_HAS_CXX11
     /// Adds a Dirichlet boundary condition, where the rhs is given by an
     /// lambda function or a std::function object
     virtual void addDirichletBC(BoundaryType type, int row, int col,
diff --git a/AMDiS/src/config/Config_clang.h b/AMDiS/src/config/Config_clang.h
index 9007feb2..39433c74 100644
--- a/AMDiS/src/config/Config_clang.h
+++ b/AMDiS/src/config/Config_clang.h
@@ -47,7 +47,7 @@ typedef size_t aligned_size_t   __attribute__ ((aligned(CACHE_LINE)));
 
 // C++11 features
 // --------------
-#if HAS_CXX11
+#if AMDIS_HAS_CXX11
 
 // __has_feature(cxx_rvalue_references)
 #if CLANG_VERSION >= 20900 && !defined(HAS_VARIADIC_TEMPLATES)
diff --git a/AMDiS/src/config/Config_defaults.h b/AMDiS/src/config/Config_defaults.h
index 86172e07..806491e0 100644
--- a/AMDiS/src/config/Config_defaults.h
+++ b/AMDiS/src/config/Config_defaults.h
@@ -63,8 +63,8 @@ typedef size_t aligned_size_t;
 
 // C++11 features
 // --------------
-#ifndef HAS_CXX11
-  #define HAS_CXX11 0
+#ifndef AMDIS_HAS_CXX11
+  #define AMDIS_HAS_CXX11 0
 #endif
 
 #ifndef HAS_VARIADIC_TEMPLATES
diff --git a/AMDiS/src/config/Config_gcc.h b/AMDiS/src/config/Config_gcc.h
index c281e3f7..88e30b3c 100644
--- a/AMDiS/src/config/Config_gcc.h
+++ b/AMDiS/src/config/Config_gcc.h
@@ -47,7 +47,7 @@ typedef size_t aligned_size_t   __attribute__ ((aligned(CACHE_LINE)));
 
 // C++11 features
 // --------------
-#if HAS_CXX11
+#if AMDIS_HAS_CXX11
 
 #if GCC_VERSION >= 40300 && !defined(HAS_VARIADIC_TEMPLATES)
   #define HAS_VARIADIC_TEMPLATES 1
diff --git a/AMDiS/src/config/Config_intel.h b/AMDiS/src/config/Config_intel.h
index 0ee7ab5b..ff584805 100644
--- a/AMDiS/src/config/Config_intel.h
+++ b/AMDiS/src/config/Config_intel.h
@@ -51,7 +51,7 @@ typedef __declspec(align(CACHE_LINE)) size_t aligned_size_t;
 
 // C++11 features
 // --------------
-#if HAS_CXX11
+#if AMDIS_HAS_CXX11
 
 #if INTEL_VERSION >= 1201 && !defined(HAS_VARIADIC_TEMPLATES)
   #define HAS_VARIADIC_TEMPLATES 1
diff --git a/AMDiS/src/config/Config_msc.h b/AMDiS/src/config/Config_msc.h
index faecc691..e08c4288 100644
--- a/AMDiS/src/config/Config_msc.h
+++ b/AMDiS/src/config/Config_msc.h
@@ -52,6 +52,11 @@ typedef __declspec(align(CACHE_LINE)) size_t aligned_size_t;
 #define ALWAYS_INLINE    __forceinline
 #define OPENMODE         std::ios::open_mode
 
+#ifdef max
+#undef max
+#undef min
+#endif
+
 #if MSC_VERSION >= 1800 && !defined(HAS_VARIADIC_TEMPLATES)
   #define HAS_VARIADIC_TEMPLATES 1
 #endif
diff --git a/AMDiS/src/io/FileWriter.hh b/AMDiS/src/io/FileWriter.hh
index 76b861ea..6f8e36c8 100644
--- a/AMDiS/src/io/FileWriter.hh
+++ b/AMDiS/src/io/FileWriter.hh
@@ -233,7 +233,7 @@ namespace AMDiS
 
       if (writeParaViewVectorFormat) {
 	io::VtkVectorWriter::Aux<T> vtkVectorWriter(&dataCollectors, writeAs3dVector);
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 	vtkVectorWriter.setCompression(compression);
 #endif
 	vtkVectorWriter.writeFile(fn + paraviewFileExt);
diff --git a/AMDiS/src/io/detail/Arh2Reader.cc b/AMDiS/src/io/detail/Arh2Reader.cc
index 690c8e63..56c4d1d0 100644
--- a/AMDiS/src/io/detail/Arh2Reader.cc
+++ b/AMDiS/src/io/detail/Arh2Reader.cc
@@ -10,7 +10,7 @@
 #include <boost/filesystem.hpp>
 #include <boost/iostreams/filtering_streambuf.hpp>
 #include <boost/iostreams/copy.hpp>
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 #include <boost/iostreams/filter/zlib.hpp>
 #endif
 
@@ -242,12 +242,12 @@ namespace AMDiS { namespace io {
 	if(minor >= 1)
 	  file.read(const_cast<char*>(cps.data()), 4);
 
-#ifdef HAVE_COMPRESSION
+#if HAMDIS_HAS_COMPRESSION
 	TEST_EXIT(cps == "null" || cps == "zlib")
 	  ("Cannot read Arh2 file. Currently only support zlib compression.\n");
 #else
 	TEST_EXIT(cps == "null")
-	  ("HAVE_COMPRESSION OFF. Cannot read compressed Arh2 file.\n");
+	  ("AMDIS_HAS_COMPRESSION==OFF. Cannot read compressed Arh2 file.\n");
 #endif
 
 	TEST_EXIT(dow == (unsigned)mesh->getGeo(WORLD))
@@ -371,7 +371,7 @@ namespace AMDiS { namespace io {
 	  file.read(buffer, size);
 	  dataStream.write(buffer, size);
 	  delete[] buffer;
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 	  if(cps == "zlib") {
 	    stringstream tmp(ios::out | ios::in);
 	    boost::iostreams::filtering_streambuf<boost::iostreams::input> in;
@@ -554,12 +554,12 @@ namespace AMDiS { namespace io {
 	if(minor > 0)
 	  file.read(const_cast<char*>(cps.data()), 4);
 
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 	TEST_EXIT(cps == "null" || cps == "zlib")
 	  ("Cannot read Arh2 file. Currently only support zlib compression.\n");
 #else
 	TEST_EXIT(cps == "null")
-	  ("HAVE_COMPRESSION OFF. Cannot read compressed Arh2 file.\n");
+	  ("AMDIS_HAS_COMPRESSION OFF. Cannot read compressed Arh2 file.\n");
 #endif
 
 	vector<int> macroElIndex(nMacroElements);
@@ -600,7 +600,7 @@ namespace AMDiS { namespace io {
 	  dataStream.write(buffer, size);
 	  delete[] buffer;
 
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 	  if(cps == "zlib") {
 	    stringstream tmp(ios::out | ios::in);
 	    boost::iostreams::filtering_streambuf<boost::iostreams::input> in;
diff --git a/AMDiS/src/io/detail/Arh2Writer.cc b/AMDiS/src/io/detail/Arh2Writer.cc
index a94633a1..d5e799af 100644
--- a/AMDiS/src/io/detail/Arh2Writer.cc
+++ b/AMDiS/src/io/detail/Arh2Writer.cc
@@ -11,7 +11,7 @@
 
 #include <boost/iostreams/filtering_streambuf.hpp>
 #include <boost/iostreams/copy.hpp>
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 #include <boost/iostreams/filter/zlib.hpp>
 #endif
 
@@ -151,7 +151,7 @@ namespace AMDiS { namespace io {
 			     namesLen + 	     //value vector table
 			     nValueVectors * 8;      //also value vector table
         string typeId = "arh2", cps("null");
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 	cps = "zlib";
 #endif
         uint8_t *major = const_cast<uint8_t*>(&(AMDiS::io::Arh2Writer::MAJOR));
@@ -426,7 +426,7 @@ namespace AMDiS { namespace io {
         }
 	stringstream tmp(ios::out | ios::in | ios::binary);
         boost::iostreams::filtering_streambuf<boost::iostreams::input> in;
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 	in.push(boost::iostreams::zlib_compressor());
 #endif
 	in.push(dataStream);
diff --git a/AMDiS/src/io/detail/Arh3Reader.cc b/AMDiS/src/io/detail/Arh3Reader.cc
index 913287f2..f33ea69b 100644
--- a/AMDiS/src/io/detail/Arh3Reader.cc
+++ b/AMDiS/src/io/detail/Arh3Reader.cc
@@ -14,7 +14,7 @@
 #include <boost/filesystem.hpp>
 #include <boost/iostreams/filtering_streambuf.hpp>
 #include <boost/iostreams/copy.hpp>
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 #include <boost/iostreams/filter/zlib.hpp>
 #include <boost/iostreams/filter/bzip2.hpp>
 #endif
@@ -251,14 +251,14 @@ namespace AMDiS { namespace io {
 	file.read(reinterpret_cast<char*>(&cpsflag), 4);
 	cps = static_cast<Cpsformat::Value>(cpsflag);
 
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 	TEST_EXIT(cps == Cpsformat::ZLIB  ||
 		  cps == Cpsformat::BZIP2 ||
 		  cps == Cpsformat::NONE)
 	  ("Cannot read Arh3 file. Currently only support zlib and bzip2 compression.\n");
 #else
 	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
 
 	TEST_EXIT(dow == (unsigned)mesh->getGeo(WORLD))
@@ -421,7 +421,7 @@ namespace AMDiS { namespace io {
 	  file.read(buffer, size);
 	  dataStream.write(buffer, size);
 	  delete[] buffer;
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 	  stringstream tmp(ios::out | ios::in);
 	  boost::iostreams::filtering_streambuf<boost::iostreams::input> in;
 	  switch(cps)
@@ -649,14 +649,14 @@ namespace AMDiS { namespace io {
 	file.read(reinterpret_cast<char*>(&cpsflag), 4);
 	cps = static_cast<Cpsformat::Value>(cpsflag);
 
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 	TEST_EXIT(cps == Cpsformat::ZLIB  ||
 		  cps == Cpsformat::BZIP2 ||
 		  cps == Cpsformat::NONE)
 	  ("Cannot read Arh3 file. Currently only support zlib and bzip2 compression.\n");
 #else
 	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
 
 	vector<int> macroElIndex(nMacroElements);
@@ -715,7 +715,7 @@ namespace AMDiS { namespace io {
 	  dataStream.write(buffer, size);
 	  delete[] buffer;
 
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 	  stringstream tmp(ios::out | ios::in);
 	  boost::iostreams::filtering_streambuf<boost::iostreams::input> in;
 	  switch(cps)
diff --git a/AMDiS/src/io/detail/Arh3Writer.cc b/AMDiS/src/io/detail/Arh3Writer.cc
index 066c4dfb..2af797c7 100644
--- a/AMDiS/src/io/detail/Arh3Writer.cc
+++ b/AMDiS/src/io/detail/Arh3Writer.cc
@@ -15,7 +15,7 @@
 #include <boost/iostreams/filtering_streambuf.hpp>
 #include <boost/iostreams/device/file_descriptor.hpp>
 #include <boost/iostreams/copy.hpp>
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 #include <boost/iostreams/filter/zlib.hpp>
 #include <boost/iostreams/filter/bzip2.hpp>
 #endif
@@ -371,7 +371,7 @@ namespace AMDiS { namespace io {
 			     4 +			  //macroFile_nl
 			     macroFile_nl;		  //macroFile
         string typeId = "sarh";
-#ifndef HAVE_COMPRESSION
+#if !AMDIS_HAS_COMPRESSION
 	cps = Cpsformat::NONE;
 #endif
         uint8_t *major = const_cast<uint8_t*>(&(AMDiS::io::Arh3Reader::MAJOR));
@@ -716,7 +716,7 @@ namespace AMDiS { namespace io {
         }
 	stringstream tmp(ios::out | ios::in | ios::binary);
         boost::iostreams::filtering_streambuf<boost::iostreams::input> in;
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 	switch(cps)
 	{
 	  case Cpsformat::ZLIB:
diff --git a/AMDiS/src/io/detail/VtkReader.h b/AMDiS/src/io/detail/VtkReader.h
index 5284b4dd..ca78fdad 100644
--- a/AMDiS/src/io/detail/VtkReader.h
+++ b/AMDiS/src/io/detail/VtkReader.h
@@ -32,7 +32,7 @@
 #include <boost/archive/iterators/transform_width.hpp>
 #include <boost/iostreams/filtering_streambuf.hpp>
 #include <boost/iostreams/copy.hpp>
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 #include <boost/iostreams/filter/zlib.hpp>
 #endif
 #include "DOFVector.h"
@@ -95,7 +95,7 @@ namespace AMDiS
 	  return result;
 	}
 
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 	inline std::string decompress(std::string text)
 	{
 	  std::stringstream tmp1, tmp2;
@@ -120,7 +120,7 @@ namespace AMDiS
 	  string header = "", body = "", data = "";
 
 	  if(zlib) {
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 	    string s = input.substr(0, 8);
 	    if (base64)
 	      s = detail::base64ToStr(s);
@@ -151,7 +151,7 @@ namespace AMDiS
 	      offset += *ptr;
 	    }
 #else
-            ERROR_EXIT("HAVE_COMPRESSION OFF. VtkReader cannot read APPENDED_COMPRESSED vtu files.\n");
+            ERROR_EXIT("AMDIS_HAS_COMPRESSION OFF. VtkReader cannot read APPENDED_COMPRESSED vtu files.\n");
 #endif
 	  } else {
  	    header = (base64) ? detail::base64ToStr(input) : input;
diff --git a/AMDiS/src/io/detail/VtkVectorWriter.h b/AMDiS/src/io/detail/VtkVectorWriter.h
index ba681562..12138651 100644
--- a/AMDiS/src/io/detail/VtkVectorWriter.h
+++ b/AMDiS/src/io/detail/VtkVectorWriter.h
@@ -28,7 +28,7 @@
 #include "io/DataCollector.h"
 #include "SystemVector.h"
 
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 #include "io/FileCompression.h"
 #endif
 
@@ -43,7 +43,7 @@ namespace AMDiS
       struct Aux {
 	Aux(std::vector<DataCollector<S>*> *dc, bool writeAs3dVector_=false)
 	  : dataCollector(dc)
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 	    , compress(NONE)
 #endif
 	    , writeAs3dVector(writeAs3dVector_)
@@ -61,7 +61,7 @@ namespace AMDiS
 			      std::string fnPrefix, std::string fnPostfix);
 
 
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 	/// Set a compressing method for file output.
 	void setCompression(FileCompression c)
 	{
@@ -154,7 +154,7 @@ namespace AMDiS
 	/// List of DataCollectors, for each component of the problem one.
 	std::vector<DataCollector<S>*> *dataCollector;
 
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 	/** \brief
 	* Defines if the file has to be compressed for ouput, and with which
 	* kind of compress method.
diff --git a/AMDiS/src/io/detail/VtkVectorWriter.hh b/AMDiS/src/io/detail/VtkVectorWriter.hh
index dcc9bfa3..4bfb412a 100644
--- a/AMDiS/src/io/detail/VtkVectorWriter.hh
+++ b/AMDiS/src/io/detail/VtkVectorWriter.hh
@@ -42,7 +42,7 @@
 #include <boost/iostreams/device/file_descriptor.hpp>
 #include <boost/lexical_cast.hpp>
 
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 // #include <boost/iostreams/filter/gzip.hpp>
 // #include <boost/iostreams/filter/bzip2.hpp>
 #endif
@@ -67,7 +67,7 @@ namespace AMDiS
 	FUNCNAME("Aux<S>::writeFile()");
 
 	boost::iostreams::filtering_ostream file;
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 // 	switch (compress) {
 // 	case GZIP:
 // 	  file.push(boost::iostreams::gzip_compressor());
diff --git a/AMDiS/src/io/detail/VtkWriter.cc b/AMDiS/src/io/detail/VtkWriter.cc
index 78d43ba7..ef6327b0 100644
--- a/AMDiS/src/io/detail/VtkWriter.cc
+++ b/AMDiS/src/io/detail/VtkWriter.cc
@@ -33,7 +33,7 @@
 #include <boost/iostreams/filtering_stream.hpp>
 #include <boost/iostreams/device/file_descriptor.hpp>
 #include <boost/iostreams/copy.hpp>
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 #include <boost/iostreams/filter/zlib.hpp>
 #endif
 #include "AdaptInfo.h"
@@ -86,7 +86,7 @@ namespace AMDiS  { namespace io {
 	    break;
 	  }
 	  case APPENDED_COMPRESSED: {
-#ifdef HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
 	    BinaryStream hstream;
 	    int nBlocks = bstream.getSize() / AMDIS_ZLIB_BLOCK_SIZE + 1;
 	    int finalsize = bstream.getSize() % AMDIS_ZLIB_BLOCK_SIZE;
@@ -232,7 +232,7 @@ namespace AMDiS  { namespace io {
 	  FUNCNAME("writeParallelFile()");
 	  using boost::lexical_cast;
 
-#ifndef HAVE_COMPRESSION
+#ifndef AMDIS_HAS_COMPRESSION
 	  if(format == APPENDED_COMPRESSED)
 	    format = APPENDED;
 #endif
diff --git a/AMDiS/src/io/detail/VtkWriter.h b/AMDiS/src/io/detail/VtkWriter.h
index a74e80c8..7556025c 100644
--- a/AMDiS/src/io/detail/VtkWriter.h
+++ b/AMDiS/src/io/detail/VtkWriter.h
@@ -119,11 +119,11 @@ namespace AMDiS  { namespace io {
 	    bstream(hp),
 	    writeAsVector(writeAsVector_)
 	{
-#ifndef HAVE_COMPRESSION
+#ifndef AMDIS_HAS_COMPRESSION
 	  FUNCNAME("VtkWriter::Aux::Aux()");
 	  if(f == APPENDED_COMPRESSED) {
 	    f = APPENDED;
-	    WARNING("HAVE_COMPRESSION OFF. So vtuformat is automatically changed from APPENDED_COMPRESSED to APPENDED.\n");
+	    WARNING("AMDIS_HAS_COMPRESSION OFF. So vtuformat is automatically changed from APPENDED_COMPRESSED to APPENDED.\n");
 	  }
 #endif
           degree = (*dataCollector)[0]->getFeSpace()->getBasisFcts()->getDegree();
diff --git a/AMDiS/src/traits/basic.hpp b/AMDiS/src/traits/basic.hpp
index 1f030393..11db2229 100644
--- a/AMDiS/src/traits/basic.hpp
+++ b/AMDiS/src/traits/basic.hpp
@@ -35,7 +35,7 @@
 #include <boost/utility/enable_if.hpp>
 #endif
 
-#if HAS_CXX11
+#if AMDIS_HAS_CXX11
 #include <type_traits>
 #endif
 
@@ -45,7 +45,7 @@ namespace AMDiS
   // introduce some shortcuts for boost::mpl
   // ---------------------------------------
 
-#if HAS_CXX11
+#if AMDIS_HAS_CXX11
   template <bool B>
   using bool_ = std::integral_constant<bool, B>;
 
diff --git a/test/other/CMakeLists.txt b/test/other/CMakeLists.txt
index e3e8ec52..efea5596 100644
--- a/test/other/CMakeLists.txt
+++ b/test/other/CMakeLists.txt
@@ -61,7 +61,7 @@ endif (AMDIS_HAS_PARALLEL_DOMAIN)
 
 
 # tests if AMDiS-Extensions
-if (AMDIS_NEED_EXTENSIONS)
+if (AMDIS_NEED_EXTENSIONS AND NOT AMDIS_HAS_PARALLEL_DOMAIN)
   add_executable(test_bg_mesh src/Test_BackgroundMesh2.cc)
   target_link_libraries(test_bg_mesh ${AMDIS_LIBRARIES})
   add_test(NAME RunTestBgMesh WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND test_bg_mesh init/test_bg_mesh.dat)
@@ -75,7 +75,7 @@ if (AMDIS_NEED_EXTENSIONS)
   add_executable(test_vtk src/Test_Vtk.cc)
   target_link_libraries(test_vtk ${AMDIS_LIBRARIES})
   list(APPEND TEST_DEPENDENCIES test_vtk)
-endif (AMDIS_NEED_EXTENSIONS)
+endif (AMDIS_NEED_EXTENSIONS AND NOT AMDIS_HAS_PARALLEL_DOMAIN)
 
 add_dependencies(check ${TEST_DEPENDENCIES})
 
diff --git a/test/other/src/Test_Arh3.h b/test/other/src/Test_Arh3.h
index c440b9b2..bd7c1fd7 100644
--- a/test/other/src/Test_Arh3.h
+++ b/test/other/src/Test_Arh3.h
@@ -5,7 +5,7 @@
  * Copyright (C) 2013 Dresden University of Technology. All Rights Reserved.
  * Web: https://fusionforge.zih.tu-dresden.de/projects/amdis
  *
- * Authors: 
+ * Authors:
  * Simon Vey, Thomas Witkowski, Andreas Naumann, Simon Praetorius, et al.
  *
  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
@@ -15,7 +15,7 @@
  * This file is part of AMDiS
  *
  * See also license.opensource.txt in the distribution.
- * 
+ *
  ******************************************************************************/
 
 
@@ -44,19 +44,19 @@ namespace amdis_tests
   {
   private:
     ProblemStat* ellipt;
-    
+
   public:
     Test_Arh3(int argc, char** argv)
     {
-      ellipt = new ProblemStat("ellipt"); 
+      ellipt = new ProblemStat("ellipt");
       ellipt->initialize(INIT_ALL);
     }
-    
+
     ~Test_Arh3()
     {
       delete ellipt;
     }
-    
+
 
 
     // _________________________________________________________________________
@@ -64,32 +64,32 @@ namespace amdis_tests
     void test()
     {
       using namespace Arh3Writer;
-      
+
       DataVec former, later;
-      
+
 #if HAVE_PARALLEL_DOMAIN_AMDIS
       Parallel::MeshDistributor::globalMeshDistributor->initParallelization();
 #endif
       Arh3Reader::readByName("./macro/arh3.1.arh", ellipt->getSolution());
       Arh3Reader::readFile("./macro/arh3.1.arh", ellipt->getSolution());
       Arh3Reader::readFile("./macro/arh3.1.arh", ellipt->getSolution(), true, 2);
-      
+
       BOOST_CHECK_THROW(Arh3Reader::readFile("./macro/arh3.1.arh", ellipt->getSolution(), true, 3), std::runtime_error );
       BOOST_CHECK_MESSAGE(!Arh2Reader::isReadable("./macro/arh3.1.arh", ellipt->getSolution()), "arh2 reader can read arh3 file...\n");
       BOOST_CHECK_MESSAGE(Arh3Reader::isReadable("./macro/arh3.1.arh", ellipt->getSolution()), "arh3 reader doesn't recognize the file.\n");
-      
+
       writeFile(ellipt->getSolution(), "./output/NoCompression.arh",
 			    true, Cpsformat::NONE);
-#if HAVE_COMPRESSION
+#ifdef AMDIS_HAS_COMPRESSION
       writeFile(ellipt->getSolution(), "./output/Zlib.arh",
 			    true, Cpsformat::ZLIB);
-      
+
       writeFile(ellipt->getSolution(), "./output/Zlib_ui08.arh",
 			    true, Cpsformat::ZLIB, "UI08");
-      
+
       writeFile(ellipt->getSolution(), "./output/Bzip2.arh",
 			    true, Cpsformat::BZIP2);
-      
+
       writeFile(ellipt->getSolution(), "./output/Bzip2_sf32.arh",
 			    true, Cpsformat::BZIP2, "SF32");
 #ifndef HAVE_PARALLEL_DOMAIN_AMDIS
@@ -97,44 +97,44 @@ namespace amdis_tests
 			    true, Cpsformat::NONE, "UF32"), std::runtime_error);
 #endif
 
-      
+
       setData(former, ellipt->getSolution());
       resetDataVector(ellipt->getSolution());
-      
+
       Arh3Reader::readFile("./output/Bzip2.arh", ellipt->getSolution());
       setData(later, ellipt->getSolution());
-      
+
       BOOST_CHECK_MESSAGE(compareDataVector(former, later), "read and write do NOT match.");
-      
+
       // int <-> double     wrong
       //================================//
-      resetDataVector(ellipt->getSolution()); 
-      
+      resetDataVector(ellipt->getSolution());
+
       Arh3Reader::readFile("./output/Bzip2_sf32.arh", ellipt->getSolution());
       setData(later, ellipt->getSolution());
       BOOST_CHECK_MESSAGE(!compareDataVector(former, later), "read and write should NOT match.");
-      
+
       // float <-> double   wrong
       //================================//
-      resetDataVector(ellipt->getSolution()); 
-      
+      resetDataVector(ellipt->getSolution());
+
       Arh3Reader::readFile("./output/Zlib_ui08.arh", ellipt->getSolution());
       setData(later, ellipt->getSolution());
       BOOST_CHECK_MESSAGE(!compareDataVector(former, later), "read and write should NOT match.");
-#endif      
+#endif
     }
-    
+
     void endTest()
     {
       finalize();
     }
-    
+
   protected:
     int argc;
     char** argv;
-    
-  protected:  
-  
+
+  protected:
+
     // some helper functions
     // -------------------------------------------------------------------------
 
@@ -177,7 +177,7 @@ namespace amdis_tests
     {
       FUNCNAME("compareDataVector");
       bool same = true;
-    
+
       if(&vec1 == &vec2)
       {
 	cout<<"RESULT: parameter1 and 2 are identical!\n";
@@ -190,7 +190,7 @@ namespace amdis_tests
       {
 	if(vec1[i] != vec2[i])
 	{
-	  MSG("RESULT: vec number %i is not equal.\n", (i + 1)); 
+	  MSG("RESULT: vec number %i is not equal.\n", (i + 1));
     /*      std::vector<double>::const_iterator it;
 	  for (it = vec2[i].begin(); it < vec2[i].end(); it++)
 	    std::cout << ' ' << *it;
@@ -201,7 +201,7 @@ namespace amdis_tests
       }
       for(int i = minsize; i < maxsize; i++)
       {
-	MSG("RESULT: vec number %i not exist.\n", (i + 1)); 
+	MSG("RESULT: vec number %i not exist.\n", (i + 1));
 	same = false;
       }
       if(same)
diff --git a/tools/build_amdis.sh b/tools/build_amdis.sh
index 6f8af88a..74adac0a 100755
--- a/tools/build_amdis.sh
+++ b/tools/build_amdis.sh
@@ -11,7 +11,7 @@ if [ $# -gt 0 ]; then
   while [[ $1 = -* ]]; do
   case "$1" in
     --stage)
-        STAGE="$2" # [build|demo|test]
+        STAGE="$2" # [build|demo|test|all]
         shift 2 ;;
     --config)
         CONFIG="$2" # [Debug|Release]
@@ -47,7 +47,7 @@ else
 fi
 
 
-if [ "${STAGE}" == "build" ]; then
+if [[ "${STAGE}" == "build" || "${STAGE}" == "all" ]]; then
   # at first build AMDiS
   cmake -E make_directory ${ROOT}/build_${POSTFIX}
   cmake -E chdir ${ROOT}/build_${POSTFIX} cmake \
@@ -57,10 +57,10 @@ if [ "${STAGE}" == "build" ]; then
         -DENABLE_EXTENSIONS:BOOL=ON \
         ${FLAGS} \
         ${ROOT}/AMDiS
-  cmake --build ${ROOT}/build_${POSTFIX} --target install
+  cmake --build ${ROOT}/build_${POSTFIX} --target install -- -j2
 fi
 
-if [ "${STAGE}" == "demo" ]; then
+if [[ "${STAGE}" == "demo" || "${STAGE}" == "all" ]]; then
   # now build the demos
   BASEDIR=${ROOT}/demo
   cmake -E make_directory ${BASEDIR}/build_${POSTFIX}
@@ -72,7 +72,7 @@ if [ "${STAGE}" == "demo" ]; then
   cmake --build ${BASEDIR}/build_${POSTFIX}
 fi
 
-if [ "${STAGE}" == "test" ]; then
+if [[ "${STAGE}" == "test" || "${STAGE}" == "all" ]]; then
   # now build and run the test_suite
   BASEDIR=${ROOT}/test
   cmake -E make_directory ${BASEDIR}/build_${POSTFIX}
-- 
GitLab