-
Notifications
You must be signed in to change notification settings - Fork 62
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
Compile successfully but import error #109
Comments
@helsmy Thank you for reporting this issue. This looks mysterious, since the serial install is not supposed to be linked with libmpi.so. As far as I try it from a clean new Docker image of CentOS7 and conda 4.3.21 (not 4.10.3, admittedly), I don't get this error. Do you see something suspicious in your install log? If the entire install log is available, we may be able to further diagnose the issue. |
I uninstall previous mfem package and recompile it again. And errors change to: ImportError Traceback (most recent call last)
<ipython-input-1-bda064bf5c1a> in <module>
----> 1 import mfem.ser as mfem
~/miniconda3/envs/FEM/lib/python3.8/site-packages/mfem/ser.py in <module>
----> 1 from mfem._ser.cpointers import *
2 from mfem._ser.globals import *
3 from mfem._ser.mem_manager import *
4 from mfem._ser.device import *
5 from mfem._ser.hash import *
~/miniconda3/envs/FEM/lib/python3.8/site-packages/mfem/_ser/cpointers.py in <module>
11 # Import the low-level C/C++ module
12 if __package__ or "." in __name__:
---> 13 from . import _cpointers
14 else:
15 import _cpointers
ImportError: libmfem.so.4.3: cannot open shared object file: No such file or directory I log stdout to this file install.log and stderr to errors.log |
Thanks. PyMFEM cloned from git master needs to be linked with MFEM master. According the log, it successfully built MFEM master, but it did not re-build PyMFEM since, perhaps, old built is there. Can you try
--skip-ext is an option not to compile MFEM again. |
I delete everything about previous PyMFEM, and clone it again and rebuild it. ImportError Traceback (most recent call last)
<ipython-input-1-bda064bf5c1a> in <module>
----> 1 import mfem.ser as mfem
~/miniconda3/envs/FEM/lib/python3.8/site-packages/mfem/ser.py in <module>
1 from mfem._ser.cpointers import *
----> 2 from mfem._ser.globals import *
3 from mfem._ser.mem_manager import *
4 from mfem._ser.device import *
5 from mfem._ser.hash import *
~/miniconda3/envs/FEM/lib/python3.8/site-packages/mfem/_ser/globals.py in <module>
11 # Import the low-level C/C++ module
12 if __package__ or "." in __name__:
---> 13 from . import _globals
14 else:
15 import _globals
ImportError: /public3/home/sc52474/miniconda3/envs/FEM/lib/python3.8/site-packages/mfem/_ser/_globals.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN4mfem15MakeParFilenameERKSsiSsi Here is the log for this time |
I think what is happening is that MFEM and PyMFEM is compiled with different compiler. Internally MFEM is build by cmake and cmake find a compiler by itself different from c, c++, which setup.py uses.
|
It works, thanks. Beside there is a duplicated |
Great. Looking back, I think setup.py should check what compiler is used to build MFEM, especially
when it is building both like this case.
… On Nov 18, 2021, at 2:24 AM, 800Coins ***@***.***> wrote:
It works, thanks. Beside there is a duplicated = in command, it would better be -CC=/public3/soft/gcc/8.1.0/bin/cc
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Hi, I try to compile the parallel version with conda, but I got |
Maybe it is necessary to specify the compilers for parallel too. Can you try the following? I suppose you are using a mpi compiler wrapper in conda. Please give a full path to them.
|
I use |
Thanks. This seems due to the fact that conda uses LDFLAGS to set compiler's library path. Setup.py uses CMAKE_SHARED_LINK_FLAG to give an additional search path, but it is initialized with empty. I made PR110 to set it to LDFLAGS. I suppose this is how it should be. Please try this PR. Note that this is PR to master, therefore --mfem-branch=master is necessary. |
I add lines to setup.py as pull 110. It sucessfully link zlib, but it got errors when compile examples under serial. |
Can you try a change I just made in PR111. There is one line, which set DCMAKE_EXE_LINKER_FLAGS. |
It seems that it can not find some thing in stdlibc++ at compiling test on serial part
All of my conda |
Not sure what is going on. Serial build goes thorough with centos7.9.2009 docker image + Anacond3-2021.11-linux-x86_64.sh. There are people reporting a similar issue relating to GLIBC version (data61/MP-SPDZ#1). |
The above source is from the CMake module https://github.com/mfem/mfem/blob/master/config/cmake/modules/FindPOSIXClocks.cmake and it should be fine to fail -- it should continue and test the same source with the For example, if I replace
and the One thing that I find strange in the above is that the compiler is |
@v-dobrev Thank you for comment. Setup.py picks what $CC, $CXX says for compiler to build MFEM and then PyMFEM.
will set $CXX |
Hmm, looking at the lines (from the above): /public3/home/sc52474/miniconda3/envs/FEM2/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /public3/home/sc52474/miniconda3/envs/FEM2/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/lib/../lib/libstdc++.so: undefined reference to `aligned_alloc@GLIBC_2.16'
/public3/home/sc52474/miniconda3/envs/FEM2/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /public3/home/sc52474/miniconda3/envs/FEM2/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/lib/../lib/libstdc++.so: undefined reference to `clock_gettime@GLIBC_2.17' it looks that either |
I try to compile with gcc and mpi provided by system. gcc 9.1.0 and intel mpi 17. Everything but wappers goes fine . I got this |
Hi. @helsmy. The error is happening when the compiler looks for
And, then rebuild it.
Please let us know. |
It's not caused by Pymfem. mpi4py requires |
I compile this project with
python setup.py install --mfem-branch=master
on CentOS sucessfully.But when I try to
import mfem.ser
I gotMy enviroment:
Any possible solution for this? Thanks advance.
The text was updated successfully, but these errors were encountered: