Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation issues for fenics version (2:0.4.1.2) #154

Open
davidscn opened this issue Sep 1, 2022 · 5 comments
Open

Installation issues for fenics version (2:0.4.1.2) #154

davidscn opened this issue Sep 1, 2022 · 5 comments
Assignees
Labels
help wanted Extra attention is needed usability

Comments

@davidscn
Copy link
Member

davidscn commented Sep 1, 2022

I followed the installation instructions while trying to install fenicsprecice and faced the following issue

pip3 install --user fenicsprecice
Collecting fenicsprecice
  Using cached fenicsprecice-1.3.0.tar.gz (37 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [24 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-0gyp_j_i/fenicsprecice_91477d1d26174fb8919a99fd2ed81df1/setup.py", line 18, in <module>
          from fenics import *
        File "/usr/lib/python3/dist-packages/fenics/__init__.py", line 7, in <module>
          from dolfin import *
        File "/usr/lib/petsc/lib/python3/dist-packages/dolfin/__init__.py", line 138, in <module>
          from . import parameter
        File "/usr/lib/petsc/lib/python3/dist-packages/dolfin/parameter/__init__.py", line 11, in <module>
          from ffc import default_jit_parameters
        File "~/.local/lib/python3.10/site-packages/ffc/__init__.py", line 24, in <module>
          from ffc.compiler import compile_form, compile_element
        File "~/.local/lib/python3.10/site-packages/ffc/compiler.py", line 129, in <module>
          from ffc.codegeneration import generate_code
        File "~/.local/lib/python3.10/site-packages/ffc/codegeneration.py", line 37, in <module>
          import ffc.uflacs.language.cnodes as L
        File "~/.local/lib/python3.10/site-packages/ffc/uflacs/__init__.py", line 23, in <module>
          from ffc.uflacs.uflacsrepresentation import compute_integral_ir
        File "~/.local/lib/python3.10/site-packages/ffc/uflacs/uflacsrepresentation.py", line 26, in <module>
          from ffc.representationutils import initialize_integral_ir
        File "~/.local/lib/python3.10/site-packages/ffc/representationutils.py", line 28, in <module>
          from ufl.cell import cellname2facetname
      ImportError: cannot import name 'cellname2facetname' from 'ufl.cell' (/usr/lib/python3/dist-packages/ufl/cell.py)
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

I'm using Ubuntu 22.04 and the provided fenics version version (2:0.4.1.2~ppa1~jammy1).

@davidscn davidscn added the bug Something isn't working label Sep 1, 2022
@IshaanDesai IshaanDesai self-assigned this Sep 1, 2022
@fsimonis
Copy link
Member

Given a clean jammy container

docker run --rm -it ubuntu:jammy

The following commands succeeded:

apt update
apt-get install software-properties-common
add-apt-repository ppa:fenics-packages/fenics
apt-get update
apt-get install fenics

apt install wget
wget https://github.com/precice/precice/releases/download/v2.5.0/libprecice2_2.5.0_jammy.deb
apt install ./libprecice2_2.5.0_jammy.deb

apt install git pip
git clone https://github.com/precice/fenics-adapter.git
cd fenics-adapter
pip install .
python3 -c "import fenicsprecice"
cd ..

git clone --depth=1 https://github.com/precice/tutorials.git
cd tutorials/partitioned-heat-conduction/fenics
./run.sh -d & ./run.sh -n

@IshaanDesai
Copy link
Member

I also tried out the commands stated above by @fsimonis in a clean Ubuntu 22.04 container and the adapter seems to work. The adapter also works if fenicsprecice is installed directly via pip.

@BenjaminRodenberg
Copy link
Member

I (unintentionally) reproduced the problem on my Ubuntu 20.04 system. After a lot of very messy back and forth I think I got things working now. The solution is similar to the suggestion in this post. There might be some residuals of ffc in /home/username/.local/lib/python3.8/site-packages. Removing them via rm -r ufl ffc should do the trick.

💥 💀 💥
If you want to bring yourself into trouble: Run $ pip3 install --user fenics_ffc==2019.1.0.post0. This should reproduce the error above.
💥 💀 💥

@fsimonis
Copy link
Member

If the pip packages are such a nightmare, couldn't we define conflicts in the setup.py of the fenics adapter?

@BenjaminRodenberg BenjaminRodenberg added the help wanted Extra attention is needed label Oct 11, 2023
@BenjaminRodenberg
Copy link
Member

Would be great to improve the situation with technical means, but I don't have the time to work on this at the moment. But I will reopen this issue and attach the help wanted label.

@BenjaminRodenberg BenjaminRodenberg added usability and removed bug Something isn't working labels Oct 11, 2023
@BenjaminRodenberg BenjaminRodenberg added this to the v2.x.x milestone Feb 12, 2024
@BenjaminRodenberg BenjaminRodenberg modified the milestones: v2.x.x, v2.2.0 Mar 13, 2024
@BenjaminRodenberg BenjaminRodenberg removed this from the v2.2.0 milestone Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed usability
Projects
None yet
Development

No branches or pull requests

4 participants