Does anybody have a more extensive resource where I might be able to find a detailed description of any of the install commands?
Preferably I would like to run fenincs simply in a python script without extra hassle, I think the source implementation is good for this. However, I have no idea how to install the c++ core. Does anybody have a good resource for this?
I tried the docker install aswell but got stuck at where I see this :fenics@0521831b5f28:~$. I then run cd ~/demo/documented/poisson/python
python3 demo_poisson.py
It then presents an error about files not found.
Lastly I also tried the ubuntu install but here it is unable to find the sudo add-apt-repository ppa:fenics-packages/fenics.
Could anybody point me in the right direction?
mkdir build
cd build
cmake …
make install
and to run this do you need to have al the package requiestes installed or does this do that for you? Cause I do not know how to install a library in C++
Is this your first time using FEniCS? If so, I wouldn’t recommend installing from source.
Do you want to install the current version (FEniCSx/dolfinx) or the legacy version (FEniCS/dolfin)? The legacy version is no longer recommended but can still be installed.
It sounds like your Docker installation is working correctly. The demos are not included inside the Docker container, which is why your cd ~/demo/documented/poisson/python
command failed. Did you download the demos to the machine where you are running docker? If so, you can make the folder available inside the Docker container by mounting it, e.g. using the following command:
docker create -it --name=dolfinx -v ~/demo/documented:/mnt/demo -w /mnt/demo docker.io/dolfinx/dolfinx:nightly
This makes the ~/demo/documented
folder available inside the container at the location /mnt/demo
. Then you can start the container with
docker start --attach dolfinx
You should see that the container starts inside the directory /mnt/demo
. Using ls
, you should be able to see the demos. You can run
cd poisson/python
python3 demo_poisson.py
to run the demo. If you want to use legacy DOLFIN, you will need to adapt the above commands accordingly.
2 Likes
First off thank you very much for replying, I am now one step closer!
Okay now it indeed pulls the contains doflinx into my docker. Then I run the
docker start --attach dolfinx
Which then shows a line starting with root and some numbers, my id?, and :mnt/demo#
But It doesn’t allow me to type at all so I cant use ls
, or cd poisson/python
And if I want to share a folder to the container this is the correct command right?:
docker run -ti -v C:/home/fenicsx/shared docker.io/dolfinx/dolfinx:nightly
I’m not sure why this is happening. What operating system are you running Docker on? I tested the above commands inside WSL on Windows 10, albeit using podman
instead of Docker.
Not quite. The -v
argument needs a colon-separated list of two strings. The first is the folder location on the host machine, and the second is the mount point inside the container. It looks like you are using Windows-style paths (i.e. starting with C:/
), which I think you will have to modify. For example, if I want to access a Windows directory from inside WSL, I have to use the path:
/mnt/c/Users/user-name/path/to/directory
To mount this folder at the location /mnt/demo
inside a container, I have to use
docker run -ti -v /mnt/c/Users/user-name/path/to/directory:/mnt/demo docker.io/dolfinx/dolfinx:nightly
Which Ubuntu version are you working with? add-apt-repository is not available by default in older releases like Ubuntu 20.10 focal. It’s located in a package which needs to be deliberately installed.
But the latest releases of Ubuntu (22.10 jammy) should already have add-apt-repository available. If you’re not already using Ubuntu 22.10 jammy, can you upgrade your system? It will make package access generally easier.