# Dolfinx\_Installation from Source (C++/Cpp build)

**URL:** <https://fenicsproject.discourse.group/t/dolfinx-installation-from-source-c-cpp-build/16690>\
**Category:** dolfinx\
**Tags:** installation\
**Created:** [January 9, 2025, 12:48pm UTC](https://fenicsproject.discourse.group/t/dolfinx-installation-from-source-c-cpp-build/16690 "2025-01-09T12:48:27Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vikram\_Bharadwaj](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/vikram_bharadwaj/32/7969_2.png) [@Vikram\_Bharadwaj](https://fenicsproject.discourse.group/u/Vikram_Bharadwaj)\
**Post date:** [January 9, 2025, 12:48pm UTC](https://fenicsproject.discourse.group/t/dolfinx-installation-from-source-c-cpp-build/16690/1 "2025-01-09T12:48:28Z")

</div>

I have followed the installation steps provided on the official page for installing DolfinX from the source: [Installation — DOLFINx 0.10.0.0 documentation](https://docs.fenicsproject.org/dolfinx/main/python/installation.html#source)

However, I am encountering an error during the installation process. Specifically, I am facing an issue while trying to install dolfinx from the source.

 ![image](https://global.discourse-cdn.com/free1/uploads/fenicsproject1/original/2X/d/d108efd9f7ca2a256bae4bf43973645131351c7b.png)  
I have uploaded a screenshot of the error message I am getting for your reference.

Please help me to solve this error.

---

<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:** [January 9, 2025, 1:17pm UTC](https://fenicsproject.discourse.group/t/dolfinx-installation-from-source-c-cpp-build/16690/2 "2025-01-09T13:17:23Z")

</div>

As stated in the aforementioned link:

> [@Vikram\_Bharadwaj](#):
>
> [Installation — DOLFINx 0.10.0.0 documentation](https://docs.fenicsproject.org/dolfinx/main/python/installation.html#source)

there are several dependencies that you need to install:

> Required
> 
> - C++ compiler (supporting the C++20 standard)
> - [Basix C++ core](https://github.com/FEniCS/basix)
> - [Boost](https://www.boost.org), with the following compiled Boost components
> - timer
> 
> - [CMake](https://cmake.org) [build dependency]
> - HDF5 (with MPI support enabled)
> - MPI supporting MPI standard version 3 or above.
> - [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/)
> - [pugixml](https://pugixml.org/)
> - [spdlog](https://github.com/gabime/spdlog/)
> - UFCx [`ufcx.h`, provided by FFCx package or FFCx UFCx CMake install at `ffcx/cmake/*`]
> - At least one of ParMETIS [2](https://docs.fenicsproject.org/dolfinx/main/python/installation.html#id6), KaHIP or PT-SCOTCH [2](https://docs.fenicsproject.org/dolfinx/main/python/installation.html#id6)

See for instance: [dolfinx/docker/Dockerfile.test-env at main · FEniCS/dolfinx · GitHub](https://github.com/FEniCS/dolfinx/blob/main/docker/Dockerfile.test-env)  
for instructions on how to install these on linux.

---

<div class="post-metadata">

**Author:** ![Vikram\_Bharadwaj](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/vikram_bharadwaj/32/7969_2.png) [@Vikram\_Bharadwaj](https://fenicsproject.discourse.group/u/Vikram_Bharadwaj)\
**Post date:** [January 9, 2025, 6:20pm UTC](https://fenicsproject.discourse.group/t/dolfinx-installation-from-source-c-cpp-build/16690/3 "2025-01-09T18:20:33Z")

</div>

> [@dokken](#):
>
> these

Thank you for your response, I will try to follow the above instructions. Just want to know whether I can install Fenics on VIrtual machine ?, Is this possible ?

---

<div class="post-metadata">

**Author:** ![Vikram\_Bharadwaj](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/vikram_bharadwaj/32/7969_2.png) [@Vikram\_Bharadwaj](https://fenicsproject.discourse.group/u/Vikram_Bharadwaj)\
**Post date:** [January 9, 2025, 7:07pm UTC](https://fenicsproject.discourse.group/t/dolfinx-installation-from-source-c-cpp-build/16690/4 "2025-01-09T19:07:21Z")

</div>

![image](https://global.discourse-cdn.com/free1/uploads/fenicsproject1/original/2X/b/ba73a7bfbd59a44864eb69c621edd49f249cae36.png)  
I am getting this error, I have managed to install few dependicies, I am stuck here, I have installed HDF5,  
 ![image](https://global.discourse-cdn.com/free1/uploads/fenicsproject1/original/2X/c/ce65cc3adeda13835d67abe136fdeb66e62afaad.png)

Please verify whether my installation is correct in the above image

---

<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:** [January 9, 2025, 7:19pm UTC](https://fenicsproject.discourse.group/t/dolfinx-installation-from-source-c-cpp-build/16690/5 "2025-01-09T19:19:50Z")

</div>

Yes, it is possible.  
Is there a reason you want to install from source and not use the Debian package, conda, spack or docker on your system?

As far as I can tell from the screenshot, it looks like that you have an mpi build of hdf5 installed.

However, it might be that dolfinx picks up another hdf5 installation on your system. What is your HDF5\_DIR or HDF5\_ROOT variable? And how did you install hdf5?

---

<div class="post-metadata">

**Author:** ![Vikram\_Bharadwaj](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/vikram_bharadwaj/32/7969_2.png) [@Vikram\_Bharadwaj](https://fenicsproject.discourse.group/u/Vikram_Bharadwaj)\
**Post date:** [January 10, 2025, 2:49pm UTC](https://fenicsproject.discourse.group/t/dolfinx-installation-from-source-c-cpp-build/16690/6 "2025-01-10T14:49:41Z")

</div>

> [@dokken](#):
>
> What is your HDF5\_DIR or HDF5\_ROOT variable?

I want to do some open source contributions, so I am building it from source, is there any alternative to do so please let me know, I am kind of exahusted in doing this installation.

I have installed HDF5 from the source. Please help me to set the vairbales, I have attached picture for your reference.

 ![image](https://global.discourse-cdn.com/free1/uploads/fenicsproject1/original/2X/9/9b28fc6922865131a55229c6effa0464d5fb6d38.png)

---

<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:** [January 10, 2025, 3:02pm UTC](https://fenicsproject.discourse.group/t/dolfinx-installation-from-source-c-cpp-build/16690/7 "2025-01-10T15:02:54Z")

</div>

I usually work with DOLFINx through docker (even when developing).  
I start from `ghcr.io/fenics/dolfinx/dev-env:current`  
([Package dolfinx/dev-env · GitHub](https://github.com/FEniCS/dolfinx/pkgs/container/dolfinx%2Fdev-env))  
and only install `ufl`, `basix`, `ffcx` and `dolfinx` from source.

> [@Vikram\_Bharadwaj](#):
>
> I have installed HDF5 from the source. Please help me to set the vairbales, I have attached picture for your reference.

What do you mean by this? What explicit commands did you call when install HDF5?

---

<div class="post-metadata">

**Author:** ![marie-cloet2000](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/marie-cloet2000/32/8349_2.png) [@marie-cloet2000](https://fenicsproject.discourse.group/u/marie-cloet2000)\
**Post date:** [April 3, 2025, 8:42am UTC](https://fenicsproject.discourse.group/t/dolfinx-installation-from-source-c-cpp-build/16690/8 "2025-04-03T08:42:20Z")

</div>

Hi,

I am installing `dolfinx` from source as I am using Manjaro Linux instead of Debian or Ubunto (\*). With the latest release of `dolfinx` (tagged `v0.9.0.post1`) I get the following error message:

```auto
Could not find a configuration file for package "Basix" that is compatible with requested version "0.10".

The following configuration files were considered but not accepted:

/some-path/lib/python3.13/site-packages/basix/lib/cmake/basix/BasixConfig.cmake, version: 0.9.0

```

So it seems like `dolfinx` is looking for a version of `basix` that is not released yet - when I check [the repository](https://github.com/FEniCS/basix) the latest version is tagged `v0.9.0`.

Which version of `dolfinx` should I use to avoid this dependency conflict?

(\*) it would be nice if this software would be released as an Arch or Manjaro package as well 😇

---

<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:** [April 3, 2025, 12:07pm UTC](https://fenicsproject.discourse.group/t/dolfinx-installation-from-source-c-cpp-build/16690/9 "2025-04-03T12:07:41Z")

</div>

Are you sure you are on the correct tag?  
Looking at the source code  
: [dolfinx/cpp/CMakeLists.txt at v0.9.0.post1 · FEniCS/dolfinx · GitHub](https://github.com/FEniCS/dolfinx/blob/v0.9.0.post1/cpp/CMakeLists.txt#L352) it states 0.9

---

<div class="post-metadata">

**Author:** ![marie-cloet2000](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/marie-cloet2000/32/8349_2.png) [@marie-cloet2000](https://fenicsproject.discourse.group/u/marie-cloet2000)\
**Post date:** [April 4, 2025, 8:23am UTC](https://fenicsproject.discourse.group/t/dolfinx-installation-from-source-c-cpp-build/16690/10 "2025-04-04T08:23:36Z")

</div>

Apparantly I was not. I now checked out `git checkout v0.9.0.post1` and the `CMakeList.txt` says indeed version `0.9.0` for basix. Somehow I thought upon cloning the repository it would be at the latest tag by default. My bad.

Thanks for the help!
