Harsha
June 20, 2025, 12:06pm
1
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
dokken
June 20, 2025, 7:30pm
2
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
then ./configure --build=amd64-unknown-linux-gnu --with-blas="-lblas -llapack" --with-lapack="-llapack" --prefix="/usr/local" --enable-debug --enable-shared --with-mumps-incdir="${PETSC_DIR}/${PETSC_ARCH}/include -I/usr/include/x86_64-linux-gnu/mpich/" --with-mumps-lib="${PETSC_DIR}/${PETSC_ARCH}/lib" ; \
make install; \
else echo "Unknown TARGETPLATFORM: ${TARGETPLATFORM}, it should be either 'linux/amd64' or 'linux/arm64'"; \
fi
# Build pyipopt
ENV LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}
WORKDIR /src
RUN python3 -m pip install --no-cache cython && \
python3 -m pip install --no-cache ipopt
# Install moola
RUN python3 -m pip install --no-cache git+https://github.com/funsim/moola@${MOOLA_BRANCH}
# Install dolfin-adjoint
COPY . /src/dolfin-adjoint
WORKDIR /src/dolfin-adjoint
RUN python3 -m pip install --no-cache -e .[test]
# Install ROL
and the previous lines for how ipopt is installed in the docker images.
Harsha
June 20, 2025, 8:52pm
3
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
dokken
June 20, 2025, 9:13pm
4
So what you are saying is:
you are using the docker image (that already has ipopt installed)
from pyadjoint import ipopt
works
import cyipopt
doesnt
or am I misunderstanding?
Harsha
June 21, 2025, 12:28pm
5
Yes ,you are right the import from cyipopt is not working
dokken
June 22, 2025, 4:29pm
6
I’ve uncovered an issue with the IPOPT installation. This should be resolved with the PR:
main
← dokken/fix-docker
opened 04:29PM - 22 Jun 25 UTC
Now uses up to date IPOPT with correct mumps flags (no fixes needed any longer).
and I will make a new release of dolfin-adjoint (2025.0.0) once I’ve verified it works.
Harsha
June 24, 2025, 7:52pm
7
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#
dokken
June 24, 2025, 7:56pm
8
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
Harsha
June 24, 2025, 9:06pm
9
Well its working now thank you but still strange