From 5184d0c6e8e42380a182a8b822f7b99279616f70 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 10 May 2018 15:32:46 +0200 Subject: [PATCH] Make Ceres compile without warnings --- CeresFE/CMakeLists.txt | 36 +++++++++++++++++++++++++++++++----- CeresFE/src/ceres.cc | 10 ++-------- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/CeresFE/CMakeLists.txt b/CeresFE/CMakeLists.txt index 966b843..8570ff7 100644 --- a/CeresFE/CMakeLists.txt +++ b/CeresFE/CMakeLists.txt @@ -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}) diff --git a/CeresFE/src/ceres.cc b/CeresFE/src/ceres.cc index fbd6f5a..135850a 100644 --- a/CeresFE/src/ceres.cc +++ b/CeresFE/src/ceres.cc @@ -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::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) { -- 2.39.5