precice / dealii-adapter

A coupled structural solver written with the C++ finite element library deal.II
GNU Lesser General Public License v3.0
19 stars 12 forks source link

Provide better error message, if deal.II version is too old #52

Closed BenjaminRodenberg closed 3 years ago

BenjaminRodenberg commented 3 years ago

I tried installing the adapter after installing Deal.II using apt on my Ubuntu 20.04 system. By default Ubuntu 20.04 gives me Deal.II 9.1.0, but the adapter requires 9.2.0 as indicated here. Since installing via apt was recommended by the documentation of the adapter this situation confused me a bit.

What I tried

cmake . gave the following error

~/dealii-adapter/linear_elasticity$ cmake .
-- Build type: Release
CMake Error at CMakeLists.txt:39 (MESSAGE):

  *** Could not locate a (sufficiently recent) version of deal.II.  ***

  You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake

  or set an environment variable "DEAL_II_DIR" that contains this path.

-- Configuring incomplete, errors occurred!

Here, I was unsure whether my deal.II installation is found or not. I finally cloned the deal.II github repository and when trying to build an example I got the following error

~/dealii/examples/step-1$ cmake .
CMake Warning at CMakeLists.txt:26 (FIND_PACKAGE):
  Could not find a configuration file for package "deal.II" that is
  compatible with requested version "9.3.0".

  The following configuration files were considered but not accepted:

    /usr/share/cmake/deal.II/deal.IIConfig.cmake, version: 9.1.1

CMake Error at CMakeLists.txt:30 (MESSAGE):

  *** Could not locate a (sufficiently recent) version of deal.II.  ***

  You may want to either pass a flag -DDEAL_II_DIR=/path/to/deal.II to cmake

  or set an environment variable "DEAL_II_DIR" that contains this path.

-- Configuring incomplete, errors occurred!

From my perspective this error message was very useful, since it told me that:

1) my deal.II is found 2) my deal.II version is too old

My Suggestion

Is it possible to add a similar error in the CMakeLists.txt of the adapter?

davidscn commented 3 years ago

The key is here the QUIET: https://github.com/precice/dealii-adapter/blob/1d148462224d0148ee77ebd6d7f93612c0adcd8e/linear_elasticity/CMakeLists.txt#L35

I addded it as part of #50. As open TODO, we should update the website docs for building from apt.

davidscn commented 3 years ago

Has been addressed in #50