]> https://gitweb.dealii.org/ - code-gallery.git/commitdiff
Make Ceres compile without warnings
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 10 May 2018 13:32:46 +0000 (15:32 +0200)
committerMatthias Maier <tamiko@43-1.org>
Thu, 10 May 2018 22:27:56 +0000 (17:27 -0500)
CeresFE/CMakeLists.txt
CeresFE/src/ceres.cc

index 966b8433bfc0712c9263914a5571da0efafada79..8570ff7078bf96672dc521d27f91cdc10b8bfbc1 100644 (file)
@@ -4,7 +4,7 @@
 
 CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2)
 
-FIND_PACKAGE(deal.II 8.3 REQUIRED
+FIND_PACKAGE(deal.II 9.0 REQUIRED
   HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR}
   )
 
@@ -16,12 +16,26 @@ PROJECT("ceres")
 #
 
 FIND_PATH(LIBCONFIG_INCLUDE_DIR libconfig.h++
-  HINTS ${LIBCONFIG_DIR}
+  HINTS ${LIBCONFIG_DIR} $ENV{LIBCONFIG_DIR}
   PATH_SUFFIXES include
   )
 
 FIND_LIBRARY(LIBCONFIG_LIBRARY NAMES config++
-  HINTS ${LIBCONFIG_DIR}
+  HINTS ${LIBCONFIG_DIR} $ENV{LIBCONFIG_DIR}
+  PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
+  )
+
+#
+# Find armadillo
+#
+
+FIND_PATH(ARMADILLO_INCLUDE_DIR armadillo
+  HINTS ${ARMADILLO_DIR} $ENV{ARMADILLO_DIR}
+  PATH_SUFFIXES include
+  )
+
+FIND_LIBRARY(ARMADILLO_LIBRARY NAMES armadillo
+  HINTS ${ARMADILLO_DIR} $ENV{ARMADILLO_DIR}
   PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
   )
 
@@ -47,6 +61,16 @@ IF(${LIBCONFIG_INCLUDE_DIR} MATCHES "-NOTFOUND" OR ${LIBCONFIG_LIBRARY} MATCHES
     )
 ENDIF()
 
+
+IF(${ARMADILLO_INCLUDE_DIR} MATCHES "-NOTFOUND" OR ${ARMADILLO_LIBRARY} MATCHES "-NOTFOUND")
+  MESSAGE(FATAL_ERROR "\n"
+    "*** Could not locate armadillo ***\n\n"
+    "This code gallery program requires armadillo, "
+    "http://arma.sourceforge.net.\n"
+    "Please install it either by hand, or with your favorite package manager"
+    )
+ENDIF()
+
 #
 # Set up program:
 #
@@ -55,6 +79,8 @@ SET(TARGET "ceres")
 SET(TARGET_SRC src/${TARGET}.cc)
 DEAL_II_INVOKE_AUTOPILOT()
 
-TARGET_INCLUDE_DIRECTORIES(${TARGET} PUBLIC ${LIBCONFIG_INCLUDE_DIR})
-TARGET_LINK_LIBRARIES(${TARGET} ${LIBCONFIG_LIBRARY})
+TARGET_INCLUDE_DIRECTORIES(${TARGET}
+                           PUBLIC ${LIBCONFIG_INCLUDE_DIR} ${ARMADILLO_INCLUDE_DIR})
+TARGET_LINK_LIBRARIES(${TARGET}
+                      ${LIBCONFIG_LIBRARY} ${ARMADILLO_LIBRARY})
 
index fbd6f5a034e138a78119223d65a2e7e4b06eef5e..135850ad81bfaa5373a32039b969581259770248 100644 (file)
@@ -743,15 +743,9 @@ namespace Step22
 
         // Finds vertices where the radius is zero DIM
         bool is_singular = false;
-        unsigned int singular_vertex_id = 0;
         for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
-          {
-            if (cell->face(f)->center()[0] == 0)
-              {
-                is_singular = true;
-                singular_vertex_id = f;
-              }
-          }
+          if (cell->face(f)->center()[0] == 0)
+            is_singular = true;
 
         if (is_singular == false || system_parameters::cylindrical == false)
           {

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.