I just saw that fenics is registerd on PyPi https://pypi.org/project/fenics/ which would make installation much more simple via pip.
However this possibility is not even mentioned on the project webpage (something I find strange) and installation via pip does not install dolfin (FFC, FIAT, dijitso, and ufl seem to be installed correctly).
Does anyone know the reason for this behaviour and if it is likely to be fixed soon?
Installing via pip would be great expecially for unexperienced users.
As dolfin as several no -Python dependencies, as well as a C++ backend, you cannot install it via pip. However, you can Get it from PPA for ubuntu, use docker or conda (experimental)
Cannot you (as a project not the already too kind dokken) think about a solution at least for people that want to use just the python API?
I have quite a few python packages based on fenics that I would like to distribute via pypi and the installation would be much smoother if it was possible to download fenics from pip.
This drawback is by the way a good reason for many users to move to another project as nutils.
How does nutils handle the linear algebra and the assembly? These are usually the most time consuming operations that are usually handled by either C/C++ libraries or by Just in Time compilation techniques.
No idea, but I guess they compile part of the code, it cannot be pure python.
The linear algebra backend most people use (including dolfin and firedrake) is PETSc, PETSc cannot be installed through pip and require alot of extra packages.
I have listed every package fenics requires for ubuntu 20.04 here:
Also note that the Python interface of dolfin is basically a wrapper around C++ to make it friendly.
The core classes such as meshes, functionspaces, dofmaps etc are defined in C++ and just binded to Python
Fine. If there is no other way I will share my code putting a link to the fenics installation page.
petsc can be installed now from pip (not sure when it started but its since at least a year)
it works well with fenics (on debian 10 at least)
sudo pip3 -E install petsc slepc slepc4py petsc4py
this has always worked flawlessly for me you can change the PETSC_CONFIGURE_OPTIONS to get different variations - eg this is what I am using
export PETSC_CONFIGURE_OPTIONS=’–download-mumps=1 --download-openblas=1 --download-scalapack=1 --download-hypre=1 --download-suitesparse=1 --download-ptscotch=1 ’
I usually remove the distribution petsc first but in theory you can get them to coexist - I think sudo pip -E is not recommended , pipenv is probably better - but I never had the time to try it
Thats good news. People are of course free to package dolfin as a pypi package, and make a pull request to the dolfin bitbucket repository. I do not have the bandwidth to do this packaging,maintenance and bug-fixing.
Hello, i am working which need to use FEM(in fenics) and PINNs(in pytorch). If fenics can be installed by pip , my work can go on. Can you show the installation process. Or, is there any way to solution my work.
I would suggest using
conda if you are working with legacy FEniCS.
But my computer system is windows.
Then you should use docker. dolfin relies on PETSc, which is tricky to install on windows.