Pyadjoint cyipopt import wrapper error

I am getting the following error when trying to use ipopt solver

Traceback (most recent call last):
  File "/app/data/t.py", line 3, in <module>
    import cyipopt
  File "/usr/lib/python3/dist-packages/cyipopt/__init__.py", line 14, in <module>
    from ipopt_wrapper import *
ImportError: /usr/local/lib/libipopt.so.1: undefined symbol: MPI_Comm_rank

You would have to specify how you installed FEniCS and dolfin-adjoint for us to be of any help.

This specifically seems to be an issue with how you install cyipopt.
See for instance

and the previous lines for how ipopt is installed in the docker images.

I am using this Package dolfin-adjoint · GitHub version of dolfin adjoint in Windows via docker, and i directly installed ipopt using the pip install command, but the pyadjoint version of ipopt is working perfectly fine for pde constrained optimization.

Kind Regards

So what you are saying is:

  1. you are using the docker image (that already has ipopt installed)
  2. from pyadjoint import ipopt works
  3. import cyipopt doesnt

or am I misunderstanding?

Yes ,you are right the import from cyipopt is not working

I’ve uncovered an issue with the IPOPT installation. This should be resolved with the PR:

and I will make a new release of dolfin-adjoint (2025.0.0) once I’ve verified it works.

Thank you but this time I am getting another error like

Traceback (most recent call last):
  File "/app/data/t.py", line 3, in <module>
    import cyipopt
  File "/usr/lib/python3/dist-packages/cyipopt/__init__.py", line 14, in <module>
    from ipopt_wrapper import *
ImportError: /usr/local/lib/libipopt.so.3: undefined symbol: dmumps_c
root@2ab039c55459:/app/data#

If you import dolfin_adjoint prior to cyipopt this is resolved (strangely), i.e.

root@dokken-XPS-15-9560:~/shared# python3 -c "import cyipopt"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/cyipopt/__init__.py", line 14, in <module>
    from ipopt_wrapper import *
ImportError: /usr/local/lib/libipopt.so.3: undefined symbol: dmumps_c

while

root@dokken-XPS-15-9560:~/shared# python3 -c "import dolfin_adjoint; import cyipopt"
1 Like

Well its working now thank you but still strange