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

**URL:** <https://precice.discourse.group/t/deal-ii-precicie-adapter-cmake-can-not-find-a-configuration-file-for-package-precice/855>\
**Category:** Official adapters and tutorials\
**Tags:** dealii\
**Created:** [January 2, 2022, 8:26pm UTC](https://precice.discourse.group/t/deal-ii-precicie-adapter-cmake-can-not-find-a-configuration-file-for-package-precice/855 "2022-01-02T20:26:01Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rob\_T](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@Rob\_T](https://precice.discourse.group/u/Rob_T)\
**Post date:** [January 2, 2022, 8:26pm UTC](https://precice.discourse.group/t/deal-ii-precicie-adapter-cmake-can-not-find-a-configuration-file-for-package-precice/855/1 "2022-01-02T20:26:01Z")

</div>

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](https://precice.org/adapter-dealii-get.html), 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](https://github.com/precice/dealii-adapter.git) && 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:

```plaintext
---[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! 🤗

---

<div class="post-metadata">

**Author:** ![DavidSCN](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@DavidSCN](https://precice.discourse.group/u/DavidSCN)\
**Post date:** [January 3, 2022, 10:42am UTC](https://precice.discourse.group/t/deal-ii-precicie-adapter-cmake-can-not-find-a-configuration-file-for-package-precice/855/2 "2022-01-03T10:42:16Z")

</div>

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](https://github.com/precice/dealii-adapter/blob/005933d6b45f885a64aee7ce597a3d7d81d54aff/CMakeLists.txt#L54) (just remove the 2.0) will ignore the requirement.

---

<div class="post-metadata">

**Author:** ![Rob\_T](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@Rob\_T](https://precice.discourse.group/u/Rob_T)\
**Post date:** [January 3, 2022, 2:00pm UTC](https://precice.discourse.group/t/deal-ii-precicie-adapter-cmake-can-not-find-a-configuration-file-for-package-precice/855/3 "2022-01-03T14:00:36Z")

</div>

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](https://precice.org/installation-source-preparation)

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

---

<div class="post-metadata">

**Author:** ![DavidSCN](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@DavidSCN](https://precice.discourse.group/u/DavidSCN)\
**Post date:** [January 3, 2022, 2:20pm UTC](https://precice.discourse.group/t/deal-ii-precicie-adapter-cmake-can-not-find-a-configuration-file-for-package-precice/855/4 "2022-01-03T14:20:22Z")

</div>

> [@Rob\_T](#):
>
> as directed in: [Building from source - Preparation | preCICE - The Coupling Library](https://precice.org/installation-source-preparation)

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?

> [@Rob\_T](#):
>
> I also modified the .bashrc file as instructed in the same webpage

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`

> [@Rob\_T](#):
>
> Can I just change the first line of the CMakelists.txt file which is:

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).

---

<div class="post-metadata">

**Author:** ![Rob\_T](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@Rob\_T](https://precice.discourse.group/u/Rob_T)\
**Post date:** [January 3, 2022, 4:29pm UTC](https://precice.discourse.group/t/deal-ii-precicie-adapter-cmake-can-not-find-a-configuration-file-for-package-precice/855/5 "2022-01-03T16:29:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DavidSCN](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@DavidSCN](https://precice.discourse.group/u/DavidSCN)\
**Post date:** [January 3, 2022, 4:50pm UTC](https://precice.discourse.group/t/deal-ii-precicie-adapter-cmake-can-not-find-a-configuration-file-for-package-precice/855/6 "2022-01-03T16:50:01Z")

</div>

> [@Rob\_T](#):
>
> I am using ubuntu 16.04. I though that I need to build from source that’s why I chose this path

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](https://askubuntu.com/questions/829310/how-to-upgrade-cmake-in-ubuntu) is probably the best way to go.

---

<div class="post-metadata">

**Author:** ![Rob\_T](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@Rob\_T](https://precice.discourse.group/u/Rob_T)\
**Post date:** [January 3, 2022, 5:56pm UTC](https://precice.discourse.group/t/deal-ii-precicie-adapter-cmake-can-not-find-a-configuration-file-for-package-precice/855/7 "2022-01-03T17:56:35Z")

</div>

Thanks a lot David, I really appreciate the support.

Best,  
Rob

---

<div class="post-metadata">

**Author:** ![Rob\_T](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@Rob\_T](https://precice.discourse.group/u/Rob_T)\
**Post date:** [January 5, 2022, 8:13pm UTC](https://precice.discourse.group/t/deal-ii-precicie-adapter-cmake-can-not-find-a-configuration-file-for-package-precice/855/8 "2022-01-05T20:13:57Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![DavidSCN](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@DavidSCN](https://precice.discourse.group/u/DavidSCN)\
**Post date:** [January 5, 2022, 9:07pm UTC](https://precice.discourse.group/t/deal-ii-precicie-adapter-cmake-can-not-find-a-configuration-file-for-package-precice/855/9 "2022-01-05T21:07:22Z")

</div>

How did you install deal.II?

---

<div class="post-metadata">

**Author:** ![Rob\_T](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@Rob\_T](https://precice.discourse.group/u/Rob_T)\
**Post date:** [January 6, 2022, 5:20pm UTC](https://precice.discourse.group/t/deal-ii-precicie-adapter-cmake-can-not-find-a-configuration-file-for-package-precice/855/10 "2022-01-06T17:20:09Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![DavidSCN](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@DavidSCN](https://precice.discourse.group/u/DavidSCN)\
**Post date:** [January 7, 2022, 7:44am UTC](https://precice.discourse.group/t/deal-ii-precicie-adapter-cmake-can-not-find-a-configuration-file-for-package-precice/855/11 "2022-01-07T07:44:36Z")

</div>

_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](https://groups.google.com/g/dealii) 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`).

---

<div class="post-metadata">

**Author:** ![Rob\_T](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@Rob\_T](https://precice.discourse.group/u/Rob_T)\
**Post date:** [January 9, 2022, 2:55pm UTC](https://precice.discourse.group/t/deal-ii-precicie-adapter-cmake-can-not-find-a-configuration-file-for-package-precice/855/12 "2022-01-09T14:55:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/precice/original/1X/67d2a5fa6f80e597e2267ff17fa8c1673cd11caa.svg) [@system](https://precice.discourse.group/u/system)\
**Post date:** [January 12, 2022, 2:56pm UTC](https://precice.discourse.group/t/deal-ii-precicie-adapter-cmake-can-not-find-a-configuration-file-for-package-precice/855/13 "2022-01-12T14:56:01Z")

</div>

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