# Problem with cmake when installing dolfinx\_mpc

**URL:** https://fenicsproject.discourse.group/t/problem-with-cmake-when-installing-dolfinx-mpc/9715
**Category:** dolfinx
**Created:** [November 9, 2022, 9:08am UTC](https://fenicsproject.discourse.group/t/problem-with-cmake-when-installing-dolfinx-mpc/9715 "2022-11-09T09:08:26Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![lclaire](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/lclaire/32/1615_2.png) [@lclaire](https://fenicsproject.discourse.group/u/lclaire)
#### Post date: [November 9, 2022, 9:08am UTC](https://fenicsproject.discourse.group/t/problem-with-cmake-when-installing-dolfinx-mpc/9715/1 "2022-11-09T09:08:26Z")

</div>

Hello, I am trying to install dolfinx\_mpc on my computer (Ubuntu) using the instruction from the dockerfile ([dolfinx\_mpc/Dockerfile at dokken/v0.5.1 · jorgensd/dolfinx\_mpc · GitHub](https://github.com/jorgensd/dolfinx_mpc/blob/dokken/v0.5.1/Dockerfile)). When i run cmake:

```auto
cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build-dir cpp/

```

I get the following error:

```auto
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'ffcx'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'ffcx'
-- UFC could not be found. (missing: UFC_INCLUDE_DIRS UFC_VERSION UFC_VERSION_OK UFC_SIGNATURE) 
CMake Error at CMakeLists.txt:93 (find_package):
  By not providing "FindDOLFINX.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "DOLFINX", but
  CMake did not find one.

  Could not find a package configuration file provided by "DOLFINX"
  (requested version 0.5.1) with any of the following names:

    DOLFINXConfig.cmake
    dolfinx-config.cmake

  Add the installation prefix of "DOLFINX" to CMAKE_PREFIX_PATH or set
  "DOLFINX_DIR" to a directory containing one of the above files. If
  "DOLFINX" provides a separate development package or SDK, be sure it has
  been installed.

-- Configuring incomplete, errors occurred!

```

I am not sure how to proceed further. Many thanks in advance for your help!

Claire

---

<div class="post-metadata">

### Author: ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)
#### Post date: [November 9, 2022, 9:31am UTC](https://fenicsproject.discourse.group/t/problem-with-cmake-when-installing-dolfinx-mpc/9715/2 "2022-11-09T09:31:43Z")

</div>

As the error message states, do you have DOLFINx and FFCx installed on your system?  
These are prerequisites for `DOLFINx_mpc`, as stated in: [GitHub - jorgensd/dolfinx\_mpc at dokken/v0.5.1](https://github.com/jorgensd/dolfinx_mpc/tree/dokken/v0.5.1#installation)  
The dockerfile is based on the dolfinx docker images, which already has DOLFINx installed.

---

<div class="post-metadata">

### Author: ![lclaire](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/lclaire/32/1615_2.png) [@lclaire](https://fenicsproject.discourse.group/u/lclaire)
#### Post date: [November 9, 2022, 9:54am UTC](https://fenicsproject.discourse.group/t/problem-with-cmake-when-installing-dolfinx-mpc/9715/3 "2022-11-09T09:54:00Z")

</div>

Thanks for your answer @dokken! I do have dolfinx installed on my computer (using anaconda, I am not sure whether this might be the problem). I don’t know about FFCx, I did not realize this was a requirement. I will look into it!

---

<div class="post-metadata">

### Author: ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)
#### Post date: [November 9, 2022, 10:10am UTC](https://fenicsproject.discourse.group/t/problem-with-cmake-when-installing-dolfinx-mpc/9715/4 "2022-11-09T10:10:19Z")

</div>

FFCx is a requirement of DOLFINx. It does not seem like your cmake picks up the fact that you have installed DOLFINx in the conda enviroment. Could you try calling `python3 -c "import ffcx; print('ffcx. __version__')"` and `python3 -c "import dolfinx; print('dolfinx. __version__')"`

---

<div class="post-metadata">

### Author: ![lclaire](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/lclaire/32/1615_2.png) [@lclaire](https://fenicsproject.discourse.group/u/lclaire)
#### Post date: [November 9, 2022, 10:24am UTC](https://fenicsproject.discourse.group/t/problem-with-cmake-when-installing-dolfinx-mpc/9715/5 "2022-11-09T10:24:27Z")

</div>

I installed FFCx by running

```auto
pip install fenics-ffcx

```

now cmake yields another error:

```auto
-- Configuring done
CMake Error at CMakeLists.txt:137 (add_library):
  Target "dolfinx_mpc" links to target "hdf5::hdf5" but the target was not
  found. Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

CMake Error at CMakeLists.txt:137 (add_library):
  Target "dolfinx_mpc" links to target "hdf5::hdf5" but the target was not
  found. Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.

```

I did define the environment variables as in the dockerfile though

```auto
echo $HDF5_DIR
/usr/local

```

```auto
echo $CC
/home/claire/anaconda3/envs/fenicsx-0.5.1/bin/x86_64-conda-linux-gnu-cc

```

```auto
echo $HDF5_MPI
ON

```

---

<div class="post-metadata">

### Author: ![lclaire](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/lclaire/32/1615_2.png) [@lclaire](https://fenicsproject.discourse.group/u/lclaire)
#### Post date: [November 9, 2022, 10:25am UTC](https://fenicsproject.discourse.group/t/problem-with-cmake-when-installing-dolfinx-mpc/9715/6 "2022-11-09T10:25:48Z")

</div>

`python3 -c "import ffcx; print('ffcx. __version__')" and python3 -c "import dolfinx; print('dolfinx. __version__')"` returns `ffcx. __version__ `

---

<div class="post-metadata">

### Author: ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)
#### Post date: [November 9, 2022, 10:51am UTC](https://fenicsproject.discourse.group/t/problem-with-cmake-when-installing-dolfinx-mpc/9715/7 "2022-11-09T10:51:01Z")

</div>

Typo on my end, I meant  
`python3 -c "import ffcx; print(ffcx. __version__ )"`  
`python3 -c "import dolfinx; print(dolfinx. __version__ )"`

---

<div class="post-metadata">

### Author: ![lclaire](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/lclaire/32/1615_2.png) [@lclaire](https://fenicsproject.discourse.group/u/lclaire)
#### Post date: [November 9, 2022, 11:21am UTC](https://fenicsproject.discourse.group/t/problem-with-cmake-when-installing-dolfinx-mpc/9715/8 "2022-11-09T11:21:52Z")

</div>

```auto
python3 -c "import ffcx; print(ffcx. __version__ )"
0.5.0

```

```auto
python3 -c "import dolfinx; print(dolfinx. __version__ )"
hwloc/linux: Ignoring PCI device with non-16bit domain.
Pass --enable-32bits-pci-domain to configure to support such devices
(warning: it would break the library ABI, don't enable unless really needed).
0.5.1

```
