Problem with building mpi4py

579 views
Skip to first unread message

mashiyat

unread,
Dec 7, 2009, 2:45:56 PM12/7/09
to mpi4py
Hi,
I am new in both linux and mpi4py. May be its a quick fix for an
experienced guy. While i am trying to install mpi4py i am getting the
following error. I don't have the root user permission, i am trying to
install this under my profile.

python setup.py build --mpi=openmpi
running build
running build_py
running build_ext
MPI configuration: from section 'openmpi' in file/s 'mpi.cfg'
MPI C compiler: /usr/local/openmpi/bin/mpicc
MPI C++ compiler: /usr/local/openmpi/bin/mpicxx
MPI linker: /usr/local/openmpi/bin/mpicc
building 'mpi4py.MPI' extension
/usr/local/openmpi/bin/mpicc -fno-strict-aliasing -DNDEBUG -g -fwrapv -
O3 -Wall -Wstrict-prototypes -fPIC -I/home/amashiya/Thesis/tool1/
Python-2.6/Include -I/home/amashiya/Thesis/tool1/Python-2.6 -c src/
MPI.c -o build/temp.linux-x86_64-2.6/src/MPI.o
pgcc-Error-Unknown switch: -fno-strict-aliasing
pgcc-Error-Unknown switch: -fwrapv
pgcc-Error-Unknown switch: -Wall
pgcc-Error-Unknown switch: -Wstrict-prototypes
error: command '/usr/local/openmpi/bin/mpicc' failed with exit status
1

Any help will me much appreciated.

Lisandro Dalcin

unread,
Dec 7, 2009, 3:11:12 PM12/7/09
to mpi...@googlegroups.com
The issue here is that your Python is built with GCC and some of the
flags being used for building Python extension modules are
GCC-specific. But your Open MPI is built with Portland Group
compilers, and this compiler does not accept these GCC-specific
switches like -fno-strict-aliasing.

You should ask mpicc compiler wrapper to use another compiler, I mean,
GCC. For the case of Open MPI, you have instructions on your mpicc(1)
manpage (read online here http://linux.die.net/man/1/mpicc, or do "man
mpicc" on your console). In short, you have to do this:

$ export OMPI_CC=gcc

now if you do

$ mpicc -showme

you should see something like:

gcc -I/usr/local/openmpi/1.3.3/include -pthread
-L/usr/local/openmpi/1.3.3/lib -lmpi -lopen-rte -lopen-pal -ldl
-Wl,--export-dynamic -lnsl -lutil -lm -ldl


I mean, you should see "gcc" the very beginning.

Now try to build mpi4py as before.

If this does not work, come back; we will need to use a more low level
hackery (i.e. adjusting stuff in the file mpi.cfg)


--
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594

mashiyat

unread,
Dec 8, 2009, 10:21:32 AM12/8/09
to mpi4py
Thanks for the quick reply. It worked.
But while i am trying to run the test example i got the following
error:

mpirun -np 5 python demo/helloworld.py

Error: in routine alloca() there is a
Error: in routine alloca() there is a
stack overflow: thread 0, max 10228KB, used 0KB, request 48B
stack overflow: thread 0, max 10228KB, used 0KB, request 48B
Error: in routine alloca() there is a
stack overflow: thread 0, max 10228KB, used 0KB, request 48B
Error: in routine alloca() there is a
stack overflow: thread 0, max 10228KB, used 0KB, request 48B
Error: in routine alloca() there is a
stack overflow: thread 0, max 10228KB, used 0KB, request 48B

Thanks got the help.

Lisandro Dalcin

unread,
Dec 8, 2009, 10:29:13 PM12/8/09
to mpi...@googlegroups.com
Mmm... perhaps this is related to your Open MPI being built with PGI?

Could you try to add the line below in your ".bashrc" file at the home
directory of the front-end node of your cluster?

ulimit -s unlimited

Next log-out and login again to your cluster.

If that do not work, we will need to try to build mpi4py with PGI, but
this will require to replace a file from the one at the SVN repo. As
that is a bit harder, let's try the above tip first. NOTE: If the
ulimit tip does not work, DO NOT FORGET to remove that line from
.bashrc

mashiyat

unread,
Dec 9, 2009, 10:24:21 AM12/9/09
to mpi4py
After adding the line in .bashrc i execute the following command
and ended up with the following error:

mpirun -np 3 python demo/helloworld.py
Error: in routine alloca() there is a
stack overflow: thread 0, max 535822321KB, used 0KB, request 48B
Error: in routine alloca() there is a
stack overflow: thread 0, max 535822321KB, used 0KB, request 48B
Error: in routine alloca() there is a
stack overflow: thread 0, max 535822321KB, used 0KB, request 48B

I removed the line from the .bashrc. How to build mpi4py with PGI?
thanks.

Lisandro Dalcin

unread,
Dec 9, 2009, 10:33:12 AM12/9/09
to mpi...@googlegroups.com
This will require you to download this file:
http://mpi4py.googlecode.com/svn/trunk/conf/mpidistutils.py and use it
for replace the one inside the directory mpi4py-1.1.0/conf/

After that, you should try to build like this:

$ export BASEFLAGS=
$ export OPTCFLAGS='-DNDEBUG -O3'
$ python setup.py build

If this still does not work, please accept my chat invitation I've
just sent to you and let's proceed off-list.
Reply all
Reply to author
Forward
0 new messages