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

Module conflict with c++ mfem in pyMFEM==4.5.2.1 #191

Open
dreamer2368 opened this issue Aug 2, 2023 · 2 comments
Open

Module conflict with c++ mfem in pyMFEM==4.5.2.1 #191

dreamer2368 opened this issue Aug 2, 2023 · 2 comments

Comments

@dreamer2368
Copy link

dreamer2368 commented Aug 2, 2023

I'm forwarding this issue from pylibROM. Since this is a private repo, I copied it below:

A library conflict is observed for pyMFEM>=4.5.2.1.

When importing pyMFEM after pylibROM,

Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylibROM
>>> import mfem.ser as mfem
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/dist-packages/mfem/ser.py", line 2, in <module>
    from  mfem._ser.globals import *
  File "/usr/local/lib/python3.10/dist-packages/mfem/_ser/globals.py", line 10, in <module>
    from . import _globals
ImportError: /usr/local/lib/python3.10/dist-packages/mfem/_ser/_globals.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZTIN4mfem14ErrorExceptionE

On the other way around (pylibROM after pyMFEM):

Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mfem.ser as mfem
>>> import pylibROM
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /home/test/pylibROM/extern/libROM/build/lib/libROM.so: undefined symbol: _ZTVN4mfem15ParGridFunctionE

NOTE this does not happen with pyMFEM==4.5.2.0.

The reason is not clear why the conflict occurs in the new version, but not in the old version. One difference between them is their mfem commit:

  • 4.5.2.0: 00b2a07 (Commit on Mar 23, 2023)
  • 4.5.2.1: 962774d (Commit on May 10, 2023)

However, matching our mfem commit to 962774d did not resolve the issue. Based on the release history, version 4.5.2.1 seems to be a only 2-week-old pre-release.

Until the issue is sorted out, we should enforce users to use pyMFEM==4.5.2.0.

In essence, we're working on python wrapper project for libROM, which links/includes c++ mfem library. When we import both pyMFEM and pylibROM in python, it returns the error messages as reported above.

This issue does not happen with version 4.5.2.0. Also note that we tried to use the same commit of c++ mfem as for 4.5.2.1, though it did not resolve the issue. In the case of 4.5.2.0, our c++ mfem and pyMFEM can be on different commits. So it is suspected to be a pyMFEM-side issue.

I know this probably does not have enough information, but I'm wondering if the error messages in the issue gives you any hint on what is causing this issue.

@sshiraiwa
Copy link
Member

@dreamer2368, thank you for reaching out. Some of the links you put above is not accessible for me. Perhaps, they
are private? Anyhow, I suspect that the cause of this is the version of MFEM library linked with libROM and PyMFEM.
If they are different, this kind of problem could easily happen. For the moment, I would agree to the solution you suggested.
I am happy to discuss this more off-line about how we can address this in a long run.

@dreamer2368
Copy link
Author

Thank you for the reply @sshiraiwa . I'd be glad to discuss this in a more long run.

Some of the links you put above is not accessible for me. Perhaps, they
are private?

The repo is currently private, so I copied the issue in a quote.

Anyhow, I suspect that the cause of this is the version of MFEM library linked with libROM and PyMFEM.
If they are different, this kind of problem could easily happen.

When we matched the c++ mfem commit as for that in pymfem 4.5.2.1, the issue was not resolved. However, I just realize that my pymfem has only serial parts.

Currently, I'm not able to install parallel pymfem, due to the issue #188 . Once this issue is sorted out. I may check once again with matching parallel mfem version.

If the issue is really the c++ mfem version difference, I'm wondering if there is a way for us to import c++ mfem from pymfem side, not our own compiled one. This would be ideal because in this way users wouldn't have to worry about their version compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants