Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 728
ClonedOne Avatar asked Mar 12 '19 19:03

ClonedOne


2 Answers

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
like image 111
gncs Avatar answered Nov 06 '22 23:11

gncs


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.

like image 26
Li Ang Avatar answered Nov 06 '22 22:11

Li Ang