2017-01-03 1 views
0

CentOS 7이 있고 mpicc가 설치되어 있습니다 (C로 openmpi 용으로 컴파일되고 작동합니다). 나는 또한 python 2.7.5를 가지고 있고 방금 pip를 설치했다. 나는이 명령을 실행하고 다음과 같은 오류를 얻을 수있어 :CentOS 7에 mpi4py를 설치할 수 없습니다.

sudo pip install mpi4py 

Collecting mpi4py Using cached mpi4py-2.0.0.tar.gz Installing 
> collected packages: mpi4py Running setup.py install for mpi4py ... 
> error 
>  Complete output from command /usr/bin/python2 -u -c "import setuptools, 
> tokenize;__file__='/tmp/pip-build-x5jD4O/mpi4py/setup.py';exec(compile(getattr(tokenize, 
> 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 
> 'exec'))" install --record /tmp/pip-mpMoZO-record/install-record.txt 
> --single-version-externally-managed --compile: 
>  running install 
>  running build 
>  running build_src 
>  running build_py 
>  creating build 
>  creating build/lib.linux-x86_64-2.7 
>  creating build/lib.linux-x86_64-2.7/mpi4py 
>  copying src/__main__.py -> build/lib.linux-x86_64-2.7/mpi4py 
>  copying src/__init__.py -> build/lib.linux-x86_64-2.7/mpi4py 
>  creating build/lib.linux-x86_64-2.7/mpi4py/include 
>  creating build/lib.linux-x86_64-2.7/mpi4py/include/mpi4py 
>  copying src/include/mpi4py/mpi4py.MPI.h -> build/lib.linux-x86_64-2.7/mpi4py/include/mpi4py 
>  copying src/include/mpi4py/mpi4py.MPI_api.h -> build/lib.linux-x86_64-2.7/mpi4py/include/mpi4py 
>  copying src/include/mpi4py/mpi4py.h -> build/lib.linux-x86_64-2.7/mpi4py/include/mpi4py 
>  copying src/include/mpi4py/__init__.pxd -> build/lib.linux-x86_64-2.7/mpi4py/include/mpi4py 
>  copying src/include/mpi4py/libmpi.pxd -> build/lib.linux-x86_64-2.7/mpi4py/include/mpi4py 
>  copying src/include/mpi4py/MPI.pxd -> build/lib.linux-x86_64-2.7/mpi4py/include/mpi4py 
>  copying src/include/mpi4py/__init__.pyx -> build/lib.linux-x86_64-2.7/mpi4py/include/mpi4py 
>  copying src/include/mpi4py/mpi.pxi -> build/lib.linux-x86_64-2.7/mpi4py/include/mpi4py 
>  copying src/include/mpi4py/mpi4py.i -> build/lib.linux-x86_64-2.7/mpi4py/include/mpi4py 
>  copying src/MPI.pxd -> build/lib.linux-x86_64-2.7/mpi4py 
>  copying src/libmpi.pxd -> build/lib.linux-x86_64-2.7/mpi4py 
>  running build_clib 
>  MPI configuration: [mpi] from 'mpi.cfg' 
>  checking for library 'lmpe' ... 
>  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c _configtest.c -o _configtest.o 
>  gcc -pthread _configtest.o -llmpe -o _configtest 
>  /bin/ld: cannot find -llmpe 
>  collect2: error: ld returned 1 exit status 
>  failure. 
>  removing: _configtest.c _configtest.o 
>  building 'mpe' dylib library 
>  creating build/temp.linux-x86_64-2.7 
>  creating build/temp.linux-x86_64-2.7/src 
>  creating build/temp.linux-x86_64-2.7/src/lib-pmpi 
>  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c src/lib-pmpi/mpe.c -o build/temp.linux-x86_64-2.7/src/lib-pmpi/mpe.o 
>  creating build/lib.linux-x86_64-2.7/mpi4py/lib-pmpi 
>  gcc -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/src/lib-pmpi/mpe.o -o 
> build/lib.linux-x86_64-2.7/mpi4py/lib-pmpi/libmpe.so 
>  checking for library 'vt-mpi' ... 
>  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c _configtest.c -o _configtest.o 
>  gcc -pthread _configtest.o -lvt-mpi -o _configtest 
>  /bin/ld: cannot find -lvt-mpi 
>  collect2: error: ld returned 1 exit status 
>  failure. 
>  removing: _configtest.c _configtest.o 
>  checking for library 'vt.mpi' ... 
>  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c _configtest.c -o _configtest.o 
>  gcc -pthread _configtest.o -lvt.mpi -o _configtest 
>  /bin/ld: cannot find -lvt.mpi 
>  collect2: error: ld returned 1 exit status 
>  failure. 
>  removing: _configtest.c _configtest.o 
>  building 'vt' dylib library 
>  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c src/lib-pmpi/vt.c -o build/temp.linux-x86_64-2.7/src/lib-pmpi/vt.o 
>  gcc -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/src/lib-pmpi/vt.o -o 
> build/lib.linux-x86_64-2.7/mpi4py/lib-pmpi/libvt.so 
>  checking for library 'vt-mpi' ... 
>  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c _configtest.c -o _configtest.o 
>  gcc -pthread _configtest.o -lvt-mpi -o _configtest 
>  /bin/ld: cannot find -lvt-mpi 
>  collect2: error: ld returned 1 exit status 
>  failure. 
>  removing: _configtest.c _configtest.o 
>  checking for library 'vt.mpi' ... 
>  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c _configtest.c -o _configtest.o 
>  gcc -pthread _configtest.o -lvt.mpi -o _configtest 
>  /bin/ld: cannot find -lvt.mpi 
>  collect2: error: ld returned 1 exit status 
>  failure. 
>  removing: _configtest.c _configtest.o 
>  building 'vt-mpi' dylib library 
>  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c src/lib-pmpi/vt-mpi.c -o build/temp.linux-x86_64-2.7/src/lib-pmpi/vt-mpi.o 
>  gcc -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/src/lib-pmpi/vt-mpi.o -o 
> build/lib.linux-x86_64-2.7/mpi4py/lib-pmpi/libvt-mpi.so 
>  checking for library 'vt-hyb' ... 
>  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c _configtest.c -o _configtest.o 
>  gcc -pthread _configtest.o -lvt-hyb -o _configtest 
>  /bin/ld: cannot find -lvt-hyb 
>  collect2: error: ld returned 1 exit status 
>  failure. 
>  removing: _configtest.c _configtest.o 
>  checking for library 'vt.ompi' ... 
>  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c _configtest.c -o _configtest.o 
>  gcc -pthread _configtest.o -lvt.ompi -o _configtest 
>  /bin/ld: cannot find -lvt.ompi 
>  collect2: error: ld returned 1 exit status 
>  failure. 
>  removing: _configtest.c _configtest.o 
>  building 'vt-hyb' dylib library 
>  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c src/lib-pmpi/vt-hyb.c -o build/temp.linux-x86_64-2.7/src/lib-pmpi/vt-hyb.o 
>  gcc -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/src/lib-pmpi/vt-hyb.o -o 
> build/lib.linux-x86_64-2.7/mpi4py/lib-pmpi/libvt-hyb.so 
>  running build_ext 
>  MPI configuration: [mpi] from 'mpi.cfg' 
>  checking for MPI compile and link ... 
>  gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c _configtest.c -o _configtest.o 
>  _configtest.c:2:17: fatal error: mpi.h: No such file or directory 
>  #include <mpi.h> 
>     ^
>  compilation terminated. 
>  failure. 
>  removing: _configtest.c _configtest.o 
>  error: Cannot compile MPI programs. Check your configuration!!! 

은 내가 지금까지 발견 된 모든 솔루션을 시도하고 아무도, 아무도이 문제에 대한 어떤 생각을하시기 바랍니다가 작동하는 것 같았다? 당신이 openmpi-devel (또는 동급) yum을 통해 당신이해야 설치해야

_configtest.c:2:17: fatal error: mpi.h: No such file or directory 
    #include <mpi.h> 

: 당신이를 CentOS에 키가 여기에있는 라인을 OpenMPI 실행의 development 파일을 설치 놓친 것 같다 당신에게

+0

OpenMPI를 설치했다고 가정 해보십시오. 그러나 그것은 당신의 길에 있습니까? 제 말은, 새로운 쉘에서 호출하거나 mpirun 명령을 자동 완료 할 수 있습니까? 또한 OpenMPI 개발 헤더가 설치되어 있다고 가정합니다. – fedepad

+0

mpirun -np 4 program.o 명령을 ac 프로그램 용으로 실행하면 작동하고 mpirun -np를 실행할 때 16 python program.py에 대한 python program.py , 그것은 내가 mpi4py 모듈을 놓치고 있다고 말합니다. – Logofatu114

+0

"내가 OpenMPI 개발 헤더를 설치했다고 가정합니다."라고 대답했을 때 내 의견을 지적한 부분에 대한 답변이 게시되었습니다. 답변에서 말했듯이, 그것들을 확인하고 거기에 주어진 조리법으로 그들을 설치하십시오! – fedepad

답변

0

감사 mpi4py 모듈을 다시 설치하는 것이 좋습니다.

+0

나는 이미 그랬다. sudo yum은 openmpi-devel을 설치했다. 이것은 CentOS를 설치 한 후 내가 한 첫번째 일이었다. OpenMPI는 C로 작성된 프로그램에서 작동합니다. openmpi를 사용하여 C로 작성된 프로그램을 작성, 컴파일 및 실행할 수 있습니다. – Logofatu114

+0

'mpi4py'는 다른 의존성'yum install mpich-devel mpich-autoload'를 사용하는 것으로 보입니다. 출처 : https://bitbucket.org/mpi4py/mpi4py/issues/5/help-desired-to-install-mpi4py –

+0

뭔가 이상한 일이 생겼어. 내가 말했듯이 내가 openmpi를 설치했는데, 나는 그것을 mpirun으로 테스트했다. mpi4py를 설치하려고 시도한 후 mpirun이라고 입력하면 명령을 찾을 수 없습니다. – Logofatu114

관련 문제