Dolfinx build from source fails at ffcx pip3 install

Hi!

I’m trying to build dolfinx from source. The installation procedure errors out when it tries to install ffcx with the following error:

pip3 install --no-cache-dir git+https://github.com/FEniCS/ffcx.git

Could not find a version that satisfies the requirement fenics-fiat<2019.3,>=2019.2.0.dev0 (from fenics-ffcx==2019.2.0.dev0) (from versions: 2017.1.0.post1, 2017.2.0, 2018.1.0, 2019.1.0)
No matching distribution found for fenics-fiat<2019.3,>=2019.2.0.dev0 (from fenics-ffcx==2019.2.0.dev0)

Does anyone have any suggestions on what I could be doing wrong?

I’ve built all other dependencies from source and set the appropriate environment variables.

Thank you!

How did you install fiat? And what does pip3 list show?

Hi dokken,

I installed fiat using “pip3 install --no-cache-dir git+https://github.com/FEniCS/fiat.git”.

pip3 list shows the following:
asn1crypto (0.24.0)
attrs (17.4.0)
Automat (0.6.0)
backcall (0.1.0)
blinker (1.4)
certifi (2018.1.18)
chardet (3.0.4)
click (6.7)
cloud-init (19.4)
colorama (0.3.7)
command-not-found (0.3)
configobj (5.0.6)
constantly (15.1.0)
cryptography (2.1.4)
cycler (0.10.0)
decorator (4.4.2)
distro-info (0.18ubuntu0.18.04.1)
fenics-dijitso (2019.2.0.dev0)
fenics-ffc (2019.1.0.post0)
fenics-ffcx (2019.2.0.dev0)
fenics-fiat (2019.2.0.dev0)
fenics-ufl (2019.2.0.dev0)
httplib2 (0.9.2)
hyperlink (17.3.1)
idna (2.6)
incremental (16.10.1)
ipython (7.14.0)
ipython-genutils (0.2.0)
jedi (0.17.0)
Jinja2 (2.10)
jsonpatch (1.16)
jsonpointer (1.10)
jsonschema (2.6.0)
keyring (10.6.0)
keyrings.alt (3.0)
language-selector (0.1)
MarkupSafe (1.0)
matplotlib (2.1.1)
mpmath (1.1.0)
netifaces (0.10.4)
numpy (1.18.4)
oauthlib (2.0.6)
olefile (0.45.1)
PAM (0.4.2)
parso (0.7.0)
petsc4py (3.13.0)
pexpect (4.8.0)
pickleshare (0.7.5)
Pillow (5.1.0)
pip (9.0.1)
prompt-toolkit (3.0.5)
ptyprocess (0.6.0)
pyasn1 (0.4.2)
pyasn1-modules (0.2.1)
pybind11 (2.0.1)
pycrypto (2.6.1)
Pygments (2.6.1)
pygobject (3.26.1)
PyJWT (1.5.3)
pyOpenSSL (17.5.0)
pyparsing (2.2.0)
pyserial (3.4)
python-apt (1.6.5+ubuntu0.2)
python-dateutil (2.6.1)
python-debian (0.1.32)
pytz (2018.3)
pyxdg (0.25)
PyYAML (3.12)
requests (2.18.4)
requests-unixsocket (0.1.5)
scipy (0.19.1)
SecretStorage (2.3.1)
service-identity (16.0.0)
setuptools (46.1.3)
six (1.14.0)
slepc4py (3.13.0)
ssh-import-id (5.7)
sympy (1.5.1)
systemd-python (234)
traitlets (4.3.3)
Twisted (17.9.0)
ufw (0.36)
unattended-upgrades (0.1)
urllib3 (1.22)
wcwidth (0.1.9)
wheel (0.30.0)
zope.interface (4.3.2)

Try to remove fiat, and reinstall it and add —upgrade for good measure.

As you had fiat installed previously (with the old dolfin, which might be causing the issue). However, the traditional FEniCS should work with the latest versions of fiat and ufl from github.

I ran the following:

pip3 uninstall fenics-fiat
pip3 install --no-cache-dir git+https://github.com/FEniCS/fiat.git --upgrade
pip3 install --no-cache-dir git+https://github.com/FEniCS/ffcx.git

It failed with the same error.
It seems to be installing the exact same version of fiat as earlier 2019.2.0.dev0.

I wanted complex number support, that’s why I moved to dolfinx from the traditional FEniCS. Do you have any other ideas?

Well, the simplest solution, that I tend to use, is docker. Then you don’t have to think about installation at all (for instance keeping track of real and complex number support PETSc versions.)
Docker image with complex support can be found by
docker pull dolfinx/complex and ran as a container with the usual docker commands.

You can also try without the —no-cache command.

Thanks! I’ll try and get the docker version going.
Please let me know if you do manage to have any ideas that would fix this!

I did try it with --no-cache too, it did not help.

Hi!

I had similar issues when installing ffc or ffcx (“Could not find a version that satisfies the requirement”).

I installed all fenics packages with the following inside the respective package folder:

pip3 -v install --no-deps --no-cache-dir .

So the no-deps did the trick. Of course then you have to assure that all other packages that the respective one depends on are installed.

So, for the whole fenics-x, I executed the installation commands in the following order:

git clone https://github.com/FEniCS/fiat.git
git clone https://bitbucket.org/fenics-project/dijitso
git clone https://github.com/FEniCS/ufl.git
git clone https://github.com/FEniCS/ffcx.git
git clone https://github.com/fenics/dolfinx.git
cd fiat    && pip3 -v install --no-deps --no-cache-dir . && cd ..
cd dijitso && pip3 -v install --no-deps --no-cache-dir . && cd ..
cd ufl     && pip3 -v install --no-deps --no-cache-dir . && cd ..
cd ffcx     && pip3 -v install --no-deps --no-cache-dir . && cd ..
mkdir dolfinx/build && cd dolfinx/build && cmake ../cpp && sudo make install -j 6 && cd ../..
cd dolfinx/python && pip3 -v install --no-deps --no-cache-dir . && cd ../..

under Ubuntu 18.04 LTS gcc-7.5.

Hope this helps.

Bw,
Marc

2 Likes

Yes, that seems to have done it. Thanks a ton!
Best to make sure you have cffi installed via “pip3 install cfi” before you build the python version. :slight_smile:

Hi @marchirschvogel, can you confirm what you’ve got with PETSc on your Ubuntu 18.04 system? Ubuntu 18.04 provides PETSc 3.7 but dolfinx needs PETSc 3.10, so I’m interested to hear how you’ve managed your PETSc versions.

Hi, I haven’t used the Ubuntu-provided PETSc but manually installed latest PETSc 3.13 release with

git clone -b maint https://gitlab.com/petsc/petsc.git

./configure --with-mpi-dir=$HOME/mpich-3.3.2_install --download-mumps --download-scalapack --download-parmetis --download-metis --download-ptscotch --download-scotch --download-blacs --download-fblaslapack --download-hypre --download-suitsparse --download-superlu --download-superlu_dist

where mpich-3.3.2_install is your MPI install folder.

I guess it’s no problem to have different versions, these can be managed by the environment variables PETSC_DIR and PETSC_ARCH which should point to the installation you want to use. After having set these correctly, you should install mpi4py and petsc4py

pip3 install -v --no-deps --no-cache-dir mpi4py
pip3 install -v --no-deps --no-cache-dir petsc4py

and accordingly the dolfin python libs with the --no-deps flag to avoid the error reported above.

Hope that helped.

Bw,
Marc

Thanks @marchirschvogel. Manual installation of PETSc, that explains it!