deal.II-preCICIE adapter [cMake can not find a configuration file for package "precice"]

Dear ALL,
Happy new year,

I am new at dealing with deal.II, precice and in general with linux, thus I apologize in advance if my question is very basic but I cannnot install the deal.II-preCICE adapter.

I followed the directions provided here: Get the deal.II adapter | preCICE - The Coupling Library, in the section “Build the adapter”
I used the following command:

git clone GitHub - precice/dealii-adapter: A coupled structural solver written with the C++ finite element library deal.II && cd dealii-adapter

Next, I used
cmake -DDEAL_II_DIR=~/dealii -DpreCICE_DIR=/usr/bin .

I am currently using preCICE-3.2.0 but the error I get is this:

Could not find a configuration file for package “precice” that is
compatible with requested version “2.0”.

The following configuration files were considered but not accepted:

~/software/precice-2.3.0/cmake/preciceConfig.cmake, version: unknown

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

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

I do not know how to test if I have the right location of preCICE, perhaps that is causing the problem.
Any help is greatly appreciated.

Best
Rob

Notes for you new topic:

  • Please use tags that match your topic (e.g. openfoam, calculix, cht).
  • Please use a clear, descriptive title.
  • Please put any output or code fragments in a code fragment, like this:
    ---[precice] This is some screen output
    ---[precice] with multiple lines
    
    (three “`” in the beginning, three “`” in the end) or upload the respective log files.
  • Don’t forget to describe your system and the respective preCICE/solver/dependency versions.

Thank you for being part of the preCICE community! :hugs:

Hi and welcome @Rob_T,

that’s interesting. How did you install preCICE on your system?

Usually, there are two common scenarios:

  1. you installed preCICE by downloading and installing the binaries system-wide: in this cases, you can omit the second argument -Dprecice_DIR, since cmake searches in the systems directories by default
  2. you downloaded the source code and compiled preCICE yourself: in this cases, you either specify the build directory (if you did not run make install after building preCICE, i.e., you don’t install it system-wide) e.g., cmake -Dprecice_DIR=$HOME/precice/build or you specify the install prefix of your preCICE installation.

However, it looks like your preCICE installation has not the correct version information and therefore, cmake does not accept it. Removing the version requirement here dealii-adapter/CMakeLists.txt at 005933d6b45f885a64aee7ce597a3d7d81d54aff · precice/dealii-adapter · GitHub (just remove the 2.0) will ignore the requirement.

Hi David,

Thank you for your reply,

For installing precice I downloaded and extracted precice version 2.3.0 using

wget https://github.com/precice/precice/archive/v2.3.0.tar.gz
tar -xzvf v2.3.0.tar.gz
cd precice-2.3.0

as directed in: Building from source - Preparation | preCICE - The Coupling Library

The extracted files are located in: ~/software/precice-2.3.0 since I wanted to use a user-wide prefix

I also modified the .bashrc file as instructed in the same webpage

PRECICE_PREFIX=~/software/prefix # set this to your selected prefix
export LD_LIBRARY_PATH=$PRECICE_PREFIX/lib:$LD_LIBRARY_PATH
export CPATH=$PRECICE_PREFIX/include:$CPATH
# Enable detection with pkg-config and CMake
export PKG_CONFIG_PATH=$PRECICE_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
export CMAKE_PREFIX_PATH=$PRECICE_PREFIX:$CMAKE_PREFIX_PATH

I was looking for the lib and include folders inside the precice-2.3.0 folder but there isn’t any. So at the end it looks like I did not install it.

I tried to install it using:

cmake –DCMAKE_INSTALL_PREFIX=~/software/precice-2.3.0

but I get the following error

CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
CMake 3.10.2 or higher is required. You are running version 3.5.1

Can I just change the first line of the CMakelists.txt file which is:

cmake minimum required (VERSION 3.10.2)

for (VERSION 3.5.1) to match the version I am using or do I need to update the CMake version? If that is the case how can I do that?

Regards,

Rob

This way, you download and extract the source code, but you don’t build preCICE. Which Linux distribution are you working on? Have you considered to install compiled binaries instead of building from source?

Note that the prefix refers here to the installation prefix. So you either need to download binaries or you need to compile and install the slef-generated binaries in PRECICE_PREFIX

No, cmake version 3.10.2 is required. However, you can easily install a newer version of cmake (if you still want to build preCICE yourself).

Hi David,

This way, you download and extract the source code, but you don’t build preCICE. Which Linux distribution are you working on? Have you considered to install compiled binaries instead of building from source?

I am using ubuntu 16.04. I though that I need to build from source that’s why I chose this path

If it is possible to install the compiled binaries than I’m ok with it. However, if due to ubuntu 16.04 I need to build from source, do I need to remove my current cmake version and install the 3.10.2 version?

Regards,
Rob

I see, then you need to build preCICE on your own, indeed.

Regarding the cmake version, I guess that an answer similar to this one is probably the best way to go.

Thanks a lot David, I really appreciate the support.

Best,
Rob

I have installed
cmake3.10.2 boost1.65.1, eigen3.4.0.

Also, I built precice 3.2.0 using:

cmake -DCMAKE_INSTALL_PREFIX=~/software/precice -DPRECICE_PETScMapping=off

it did work. Then I tried to build the dealii-adapter with:

cmake -DDEAL_II_DIR=~/dealii -DpreCICE_DIR=~/software/precice-2.3.0 .

I sort of got it since I got the following message:

– Build files have been written to: ~/software/dealii-adapter

However, when I typed:

make

this is the output I got:

Scanning dependencies of target elasticity
[ 20%] Building CXX object CMakeFiles/elasticity.dir/elasticity.cc.o
[ 40%] Building CXX object CMakeFiles/elasticity.dir/source/linear_elasticity/linear_elasticity.cc.o
[ 60%] Building CXX object CMakeFiles/elasticity.dir/source/nonlinear_elasticity/nonlinear_elasticity.cc.o
[ 80%] Building CXX object CMakeFiles/elasticity.dir/include/adapter/parameters.cc.o
make[2]: *** No rule to make target ‘~/dealii/lib/libdeal_II.g.so.9.3.2’, needed by ‘elasticity’. Stop.
CMakeFiles/Makefile2:131: recipe for target ‘CMakeFiles/elasticity.dir/all’ failed
make[1]: *** [CMakeFiles/elasticity.dir/all] Error 2
Makefile:83: recipe for target ‘all’ failed
make: *** [all] Error 2

What is the meaning of no rule for target?. Am I missing a file or is there something else I did not include?

How did you install deal.II?

For the installation of dealII the following was done:
I downloaded the compressed file and followed instructions from this site:

https://www.dealii.org/9.3.0/readme.html

Then I installed in using:

cmake -DCMAKE_INSTALL_PREFIX=~/software/dealii-9.3.2/deal.II

The output was:

Component configuration:
( DEAL_II_COMPONENT_DOCUMENTATION = OFF )
DEAL_II_COMPONENT_EXAMPLES
( DEAL_II_COMPONENT_PACKAGE = OFF )
( DEAL_II_COMPONENT_PYTHON_BINDINGS = OFF )

Detailed information (compiler flags, feature configuration) can be found in detailed.log
Run $ make info to print a help message with a list of top level targets
– Configuring done
– Generating done
– Build files have been written to: ~/software/dealii-9.3.2

Next, I typed: make install

It was compiled, but then at 77% it stopped with the output:

[ 77%] Building CXX object source/base/CMakeFiles/obj_base_release.dir/symmetric_tensor.cc.o
In file included from ~/software/dealii-9.3.2/source/base/symmetric_tensor.cc:20:0:
~/software/dealii-9.3.2/include/deal.II/base/symmetric_tensor.templates.h: In instantiation of ‘std::array<Number, 3ul> dealii::eigenvalues(const dealii::SymmetricTensor<2, 3, Number>&) [with Number = float]’:
~/software/dealii-9.3.2/source/base/symmetric_tensor.inst:85:42: required from here
~/software/dealii-9.3.2/include/deal.II/base/symmetric_tensor.templates.h:113:39: in constexpr expansion of ‘dealii::determinant<3, float>(B)’
~/software/dealii-9.3.2/include/deal.II/base/symmetric_tensor.templates.h:113:43: internal compiler error: Segmentation fault
const Number tmp_2 = determinant(B) / 2.0;
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
source/base/CMakeFiles/obj_base_release.dir/build.make:2030: recipe for target ‘source/base/CMakeFiles/obj_base_release.dir/symmetric_tensor.cc.o’ failed
make[2]: *** [source/base/CMakeFiles/obj_base_release.dir/symmetric_tensor.cc.o] Error 1
CMakeFiles/Makefile2:1897: recipe for target ‘source/base/CMakeFiles/obj_base_release.dir/all’ failed
make[1]: *** [source/base/CMakeFiles/obj_base_release.dir/all] Error 2
Makefile:129: recipe for target ‘all’ failed
make: *** [all] Error 2

It seems that there is a file or more missing, however I got the files from the official deal.II site. Any ideas?

Now, I undertand, I first need to get this solved before I try to install the adapter

Hm This looks rather like a problem with your compiler/deal.II. Maybe deal.II 9.3 requires a different compiler (with c++14 support) or similar. People on the deal.II mailinglist can probably tell you better. You might get away using a lower deal.II version (the adapter requires 9.2) or upgrading your compiler (or use clang which might be pull’able from apt).

Thanks. The problem was due to deal 9.3. I installed deal. 9.2.0 and the installation was successful. After that I was able to install the adapter.
Cheers,
Roberto

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.