mercurial changeset 266 openmpi+python problem

Post Reply
eacheon
Posts: 97
Joined: Wed Jan 18, 2006 2:20 pm

mercurial changeset 266 openmpi+python problem

Post by eacheon »

A while ago NEURON was able to be compiled with python and openmpi, but not in the newest mercurial repository, nrniv compiles fine though:

Code: Select all

$ python setup.py build
...
creating build/temp.linux-i686-2.5
mpicc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I../../../src/oc -I../oc -I/usr/include/python2.5 -c inithoc.cpp -o build/temp.linux-i686-2.5/inithoc.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from /usr/include/c++/4.3/ios:48,
                 from /usr/include/c++/4.3/ostream:45,
                 from /usr/include/c++/4.3/iostream:45,
                 from /usr/lib/openmpi/include/openmpi/ompi/mpi/cxx/mpicxx.h:50,
                 from /usr/lib/openmpi/include/mpi.h:1795,
                 from inithoc.cpp:14:
/usr/include/c++/4.3/bits/ios_base.h:189: error: ?SEEK_CUR? was not declared in this scope
/usr/include/c++/4.3/bits/ios_base.h:190: error: ?SEEK_END? was not declared in this scope
inithoc.cpp:32: warning: deprecated conversion from string constant to ?char*?
inithoc.cpp:32: warning: deprecated conversion from string constant to ?char*?
inithoc.cpp:32: warning: deprecated conversion from string constant to ?char*?
inithoc.cpp:37: warning: deprecated conversion from string constant to ?char*?
inithoc.cpp:37: warning: deprecated conversion from string constant to ?char*?
error: command 'mpicc' failed with exit status 1

Code: Select all

$ dpkg -l *openmpi*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name                     Version                  Description
+++-========================-========================-================================================================
ii  libopenmpi-dev           1.2.8-3                  high performance message passing library -- header files
ii  libopenmpi1              1.2.8-3                  high performance message passing library -- shared library
ii  openmpi-bin              1.2.8-3                  high performance message passing library -- binaries
ii  openmpi-common           1.2.8-3                  high performance message passing library -- common files
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: mercurial changeset 266 openmpi+python problem

Post by hines »

I'm not able to reproduce the problem on my machine. I did not use openmpi but it appears to be a gcc problem and
I did use gcc version 4.3.2. My compile line is very similar to yours with the same warnings but no errors.

Code: Select all

mpicc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I../../../nrn/src/oc -I../oc -I/usr/include/python2.5 -c inithoc.cpp -o build/temp.linux-x86_64-2.5/inithoc.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
inithoc.cpp:32: warning: deprecated conversion from string constant to ‘char*’
...
I do not know what is going wrong with your equivalent of include/c++/4.3.2/bits/ios_base.h
You might try a fresh build of NEURON in a objdir different from the srcdir. For my test I used

Code: Select all

../nrn/configure '--prefix=/home/hines/neuron/nrn-gcc4.3' '--srcdir=../nrn' '--with-paranrn' '--with-nrnpython'
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: mercurial changeset 266 openmpi+python problem

Post by hines »

I'm surprised. I installed openmpi-1.2.8 and got the same error. I'll look into it further and get back to you.

Code: Select all

/home/hines/gnu/lib/gcc/x86_64-unknown-linux-gnu/4.3.2/../../../../include/c++/4.3.2/bits/ios_base.h:189: error: ‘SEEK_CUR’ was not declared in this scope
/home/hines/gnu/lib/gcc/x86_64-unknown-linux-gnu/4.3.2/../../../../include/c++/4.3.2/bits/ios_base.h:190: error: ‘SEEK_END’ was not declared in this scope
eacheon
Posts: 97
Joined: Wed Jan 18, 2006 2:20 pm

Re: mercurial changeset 266 openmpi+python problem

Post by eacheon »

I tried using an objdir in the same directory level with the srcdir, but get the same error. I was doing the build in an objdir different from srcdir, configured with

Code: Select all

../configure --prefix=/path/to/nrnhg/nrnmpi --with-iv=/path/to/nrnhg/iv --srcdir=.. --with-nrnpython --with-paranrn
in a subdirectory under srcdir.

This looks like an MPI problem to me. I have no experience with MPI, but from the source it seems MPI2 will be moving away from defining SEEK_*, favoring defining MPI_SEEK_* (https://svn.mpi-forum.org/trac/mpi-forum-web/ticket/20), and looks like openmpi has implemented this already, so the undefining of SEEK_* in inithoc.cpp might be causing problem when compiling with openmpi (I have 1.2.8 installed at this moment). Some extra logic might need to be added in inithoc.cpp in order to cope with new MPI2 change.
hines wrote:I'm not able to reproduce the problem on my machine. I did not use openmpi but it appears to be a gcc problem and
I did use gcc version 4.3.2. My compile line is very similar to yours with the same warnings but no errors.

Code: Select all

mpicc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I../../../nrn/src/oc -I../oc -I/usr/include/python2.5 -c inithoc.cpp -o build/temp.linux-x86_64-2.5/inithoc.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
inithoc.cpp:32: warning: deprecated conversion from string constant to ‘char*’
...
I do not know what is going wrong with your equivalent of include/c++/4.3.2/bits/ios_base.h
You might try a fresh build of NEURON in a objdir different from the srcdir. For my test I used

Code: Select all

../nrn/configure '--prefix=/home/hines/neuron/nrn-gcc4.3' '--srcdir=../nrn' '--with-paranrn' '--with-nrnpython'
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: mercurial changeset 266 openmpi+python problem

Post by hines »

The problem seems to be fixed (and building with mpich continues to work) by including
mpi.h before stdio.h. Do an hg pull;hg update to get the change.
eacheon
Posts: 97
Joined: Wed Jan 18, 2006 2:20 pm

Re: mercurial changeset 266 openmpi+python problem

Post by eacheon »

Yes, you fixed it. Thanks a lot for this quick fix!
hines wrote:The problem seems to be fixed (and building with mpich continues to work) by including
mpi.h before stdio.h. Do an hg pull;hg update to get the change.
Post Reply