Installation error with UFCx

I’m having trouble building dolfinx from source.

I’ve cloned the source from:

git clone https://github.com/FEniCS/dolfinx

Then I create a new directory within that folder with mkdir -p build

Change directory then build with:

cd build
cmake ..

I get error:

CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find UFCx: Found unsuitable version “0.4.2”, but required is at
least “0.5” (found /usr/lib/python3/dist-packages/ffcx/codegeneration)

Reason given by package: UFCx could not be found.

Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:592 (_FPHSA_FAILURE_MESSAGE)
cmake/modules/FindUFCx.cmake:63 (find_package_handle_standard_args)
CMakeLists.txt:215 (find_package)

I tried to update the version for UFCx but it’s included with fenics-ffcx which latest version is 0.4.2. Why is the dolfinx build trying to demand a version that doesn’t exist yet and how can I change it? Is there a separate installation for UFCx?

Did you install fenics-ffcx with pip install fenics-ffcx? If so, try to install ffcx from source with pip install .

It seems that ffcx has not been updated yet on PyPI with the latest version of few days ago.

The repository for fenics-ffcx still seems to be version 0.4.2, version 0.5 doesn’t seem to exist that I can find.

I am not totally sure, but I guess your error is not complaining about the ffcx version but about the ufcx version, which is defined in the ufcx.h file as 0.5.1 to date.

Anyway, ffcx has been just updated with the 0.5.0 release, so a local build of ffcx should solve the problem.

I tried reinstalling from source and now I’m getting:

Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from fenics-ffcx==0.5.1.dev0) (59.6.0)
ERROR: Could not find a version that satisfies the requirement fenics-ufl<2022.4.0,>=2022.3.0.dev0 (from fenics-ffcx) (from versions: 2017.1.0.post1, 2017.2.0, 2018.1.0, 2019.1.0, 2022.1.0.post0)
ERROR: No matching distribution found for fenics-ufl<2022.4.0,>=2022.3.0.dev0

I tried pulling and reinstalling fenics-ufl from source but the latest version seems to be 2022.1.0 is there a later version between 2022.3.0<=version<=2022.4.0?

Since the dolfinx version was updated 2 hours ago I seem to have managed to get everything to be compatible now.

  • So the solution seemed to be:
  • Uninstall and remove ufl, fffx and dolfinx.
  • clone the repositories (the ufl documentation took me to a bitbucket link but this seemed to be behind the git repository so removing that and clone from github gave me the latest verion. All of them are at Fenics-Github
  • build each module and pip install . inside each source directory.
  • Pull dolfinx and build inside the cpp directory of the dolfinx source.
  • install dolfinx.

Commands:

git clone --recursive https://github.com/FEniCS/ffcx .ffcx
git clone --recursive https://github.com/FEniCS/ufl .ufl
git clone --recursive https://github.com/FEniCS/basix .basix
git clone --recursive https://github.com/FEniCS/dolfinx .dolfinx
mkdir -p .basix/cpp/build
mkdir -p .dolfinx/cpp/build
cd ~/.basix/cpp/build
cmake ..
make install 
cd ~/.basix
pip install .
cd .ffcx/
pip install .
cd ~/.ufl
pip install .
cd ~/.dolfinx/cpp/build
cmake ..
make install

My intial problem was that I was trying to install the latest versions but the packages were clashing. This seemed to get rectified but removing all the packages that had clashes then reinstalling, since the updating one by one wasn’t working with the old versions there.

Hope this helps anyone else with a similar problem.

Thank you @CastriMik for your help.

1 Like