ClonedOne
ClonedOne

Reputation: 599

CentOS 7 undefined symbol: ompi_mpi_logical8

I'm trying to install a python(3) package which depends on mpi4py on a CentOS 7 machine.

I have tried multiple ways of doing everything, even start from clean virtualenvs but I keep getting:

ImportError: $PATH_TO_VENV/lib/python3.6/site-packages/mpi4py/MPI.cpython-36m-x86_64-linux-gnu.so: undefined symbol: ompi_mpi_logical8

This comes up even if, after a successful installation through pip, I just write in the interpreter:

>>> import mpi4py
>>> from mpi4py import MPI

Has anyone got a solution for this?

Upvotes: 8

Views: 3183

Answers (4)

RobbieTheK
RobbieTheK

Reputation: 198

In addition to this I had to NOT use OpenMPI 4.0.0 nor 4.0.3 but we have mpich 3.2.1 as a module available and that worked, i.e., the undefined symbol error went away.

Upvotes: 0

Li Ang
Li Ang

Reputation: 21

I met this problem today, this is how I solve it: conda install mpi4py

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
mpi-1.0                    |          openmpi           4 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
mpi4py-3.0.3               |   py37hbfacf26_1         647 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
openmpi-4.0.3              |       hdf1f1ad_1         3.9 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
------------------------------------------------------------
                                       Total:         4.6 MB

I think either missing mpi-1.0 or an out-dated openmpi will cause the problem.

Upvotes: 2

gncs
gncs

Reputation: 480

I had the same problem and I found that I have to install the library using the env MPICC= prefix.

env MPICC=/usr/lib64/openmpi/bin/mpicc pip install --no-cache-dir mpi4py

Upvotes: 3

F.M.F.
F.M.F.

Reputation: 2292

The problem is that mpi4py was installed while a different than the current version of MPI was used.

pip uninstall mpi4py
pip install --no-cache-dir mpi4py

The above should resolve the problem. Maybe resourcing the virtualenv is neccessary.

Upvotes: 1

Related Questions