[mvapich-discuss] Error while compiling mpi4py with MVAPICH

Jonathan Perkins perkinjo at cse.ohio-state.edu
Tue Oct 5 12:50:20 EDT 2010


That's great to hear.  Let us know if you run across any more issues
have any questions.

On Tue, Oct 5, 2010 at 12:22 PM,  <senthil.natesan at ndsu.edu> wrote:
>
> Hi Jonathan,
>
> Thank you very much for the information. Yes it worked now. I am able to
> install mpi4py, after compiling mvapich2 with the mentioned options.
>
> Thanks very much for your support and time.
>
> Senthil
>
>
>
>> Hello Senthil,
>>
>> I just tried building mpi4py using python-pip and it compiled and
>> installed successfully for me.  I downloaded mvapich2-1.5.1p1 from
>> http://mvapich.cse.ohio-state.edu/download/mvapich2/mvapich2-1.5.1p1.tgz
>> and configured using the following options...
>>
>> --with-prefix=$PWD/install --enable-sharedlibs=gcc
>>
>> I then used make followed by make install.  In order to use python-pip
>> I did the following as root (I tried as a normal user at first but the
>> install step fails)...
>>
>> env MPICC=/home/jonathan/Documents/mvapich2-1.5.1p1/install/bin/mpicc
>> python-pip install mpi4py
>>
>> This completes successfully for me.  When looking at the information
>> that you sent in the last email I think the problem that you're facing
>> is due to trying to link against the static library and not the
>> shared.  Did you use the --enable-sharedlibs=gcc option when building
>> mvapich2?  If not I think adding this will resolve the issue for you.
>> Please let me know if this helps.
>>
>> On Thu, Sep 30, 2010 at 7:00 PM,  <senthil.natesan at ndsu.edu> wrote:
>>>
>>> Hi Jonathan,
>>>
>>> Thanks for the suggestion. I was running an application using mvapich2,
>>> so
>>> I didn't want to disturb until it finished now. Today I installed the
>>> recommended latest version. But still it is showing the same error when
>>> I
>>> am trying to compile mpi4py.
>>>
>>> -----------------------------------------------------------------------
>>> [root at craycx1 mpi4py-1.2.1]# python2.7 setup.py build
>>> running build
>>> running build_py
>>> creating build
>>> creating build/lib.linux-x86_64-2.7
>>> creating build/lib.linux-x86_64-2.7/mpi4py
>>> copying src/rc.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.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/mpi_c.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__.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
>>> running build_ext
>>> MPI C compiler:    /usr/mpi/gcc/mvapich2-1.5.1p1/bin/mpicc
>>> MPI C++ compiler:  /usr/mpi/gcc/mvapich2-1.5.1p1/bin/mpicxx
>>> MPI linker:        /usr/mpi/gcc/mvapich2-1.5.1p1/bin/mpicc
>>> checking for MPI compile and link ...
>>> /usr/mpi/gcc/mvapich2-1.5.1p1/bin/mpicc -fPIC -fno-strict-aliasing
>>> -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
>>> -I/usr/local/include/python2.7 -c _configtest.c -o _configtest.o
>>> /usr/mpi/gcc/mvapich2-1.5.1p1/bin/mpicc _configtest.o -o _configtest
>>> success!
>>> removing: _configtest.c _configtest.o _configtest
>>> checking for MPE availability ...
>>> checking for header 'mpe.h' ...
>>> /usr/mpi/gcc/mvapich2-1.5.1p1/bin/mpicc -fPIC -fno-strict-aliasing
>>> -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
>>> -I/usr/local/include/python2.7 -c _configtest.c -o _configtest.o
>>> success!
>>> removing: _configtest.c _configtest.o
>>> succes!
>>> checking for function 'MPE_Init_log' ...
>>> /usr/mpi/gcc/mvapich2-1.5.1p1/bin/mpicc -fPIC -fno-strict-aliasing
>>> -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
>>> -I/usr/local/include/python2.7 -c _configtest.c -o _configtest.o
>>> /usr/mpi/gcc/mvapich2-1.5.1p1/bin/mpicc _configtest.o -lmpe -o
>>> _configtest
>>> success!
>>> removing: _configtest.c _configtest.o _configtest
>>> building 'mpi4py.MPI' extension
>>> creating build/temp.linux-x86_64-2.7
>>> creating build/temp.linux-x86_64-2.7/src
>>> /usr/mpi/gcc/mvapich2-1.5.1p1/bin/mpicc -fPIC -fno-strict-aliasing
>>> -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
>>> -I/usr/local/include/python2.7 -c src/MPI.c -o
>>> build/temp.linux-x86_64-2.7/src/MPI.o
>>> /usr/mpi/gcc/mvapich2-1.5.1p1/bin/mpicc -shared
>>> build/temp.linux-x86_64-2.7/src/MPI.o -o
>>> build/lib.linux-x86_64-2.7/mpi4py/MPI.so
>>> /usr/bin/ld:
>>> /usr/mpi/gcc/mvapich2-1.5.1p1/lib/libmpich.a(comm_create_keyval.o):
>>> relocation R_X86_64_32 against `MPID_Keyval_mem' can not be used when
>>> making a shared object; recompile with -fPIC
>>> /usr/mpi/gcc/mvapich2-1.5.1p1/lib/libmpich.a: could not read symbols:
>>> Bad
>>> value
>>> collect2: ld returned 1 exit status
>>> error: command '/usr/mpi/gcc/mvapich2-1.5.1p1/bin/mpicc' failed with
>>> exit
>>> status 1
>>>
>>> ----------------------------------------------------------------
>>>
>>> As I mentioned earlier, I was able to compile with MPICH2.
>>> It would be great if you can suggest any way out.
>>>
>>> thanks,
>>>
>>> Senthil
>>>
>>>
>>> Jonathan wrote:
>>>
>>>> It looks like you're trying to create a shared library using objects
>>>> that were not compiled with -fPIC in the static libmpich.a library.
>>>> You may have a bug that was fixed with the mvapich2-1.5.1p1 release.
>>>> Please install this version and see if you still encounter this issue.
>>>>
>>>> For your convenience:
>>>> http://mvapich.cse.ohio-state.edu/download/mvapich2/mvapich2-1.5.1p1.tgz
>>>>
>>>> --
>>>> Jonathan Perkins
>>>> http://www.cse.ohio-state.edu/~perkinjo
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>> --
>> Jonathan Perkins
>> http://www.cse.ohio-state.edu/~perkinjo
>>
>>
>
>
>



-- 
Jonathan Perkins
http://www.cse.ohio-state.edu/~perkinjo



More information about the mvapich-discuss mailing list