Problems with NEURON-7.4 make

Post Reply
Grado

Problems with NEURON-7.4 make

Post by Grado »

I currently have NEURON-7.3 installed with python support on my mac running 10.10.4, and everything works perfectly. However, I am now starting to do simulations that I wish to parallelize, and I did not enable MPI support with I first built NEURON-7.3.

To kill two birds with one stone, I am trying to upgrade to NEURON-7.4 as well as enable MPI support. I have downloaded iv-19 and nrn-7.4 from http://www.neuron.yale.edu/neuron/download/getstd. What I've done so far:

Created a directory /Applications/nrn74, and copied the iv-19 and nrn-7.4 directories inside, and successfully executed the following steps:

In /Applications/nrn74/iv-19:

Code: Select all

./configure --prefix=`pwd`
make
make install
And in /Applications/nrn74/nrn-7.4/:

Code: Select all

./configure --prefix=`pwd` --with-iv=/Applications/nrn74/iv-19 --with-nrnpython --with-paranrn
After running ./configure in nrn-7.4, when I try to run make, I get the following results: (Obviously this is the result of running 'make' a second time, but the error is the same)

Code: Select all

nrn-7.4 » make                                                              /Applications/nrn74/nrn-7.4 [14:28:06] 2 ↵
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in src
Making all in memacs
make[3]: Nothing to be done for `all'.
Making all in modlunit
make[3]: Nothing to be done for `all'.
Making all in nmodl
make[3]: Nothing to be done for `all'.
Making all in sparse
make[3]: Nothing to be done for `all'.
Making all in sparse13
make[3]: Nothing to be done for `all'.
Making all in scopmath
make[3]: Nothing to be done for `all'.
Making all in Random123
make[3]: Nothing to be done for `all'.
Making all in nrnmpi
make[3]: Nothing to be done for `all'.
Making all in oc
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
Making all in nrnoc
(MODLUNIT=../../share/lib/nrnunits.lib ; \
		export MODLUNIT ; ../nmodl/nocmodl ./hh )
dyld: Library not loaded: @rpath/./libmpi.12.dylib
  Referenced from: /Applications/nrn74/nrn-7.4/src/nrnoc/../nmodl/nocmodl
  Reason: image not found
/bin/sh: line 1: 74656 Trace/BPT trap: 5       ../nmodl/nocmodl ./hh
make[3]: *** [hh.c] Error 133
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Does anyone know what this error is and how to get around it?

Thanks!
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: Problems with NEURON-7.4 make

Post by hines »

That is somewhat puzzling since I would have expected configure to have produced an error if libmpi was not found. Anyway, please try again with configure options
--with-nrnpython=dynamic --with-paranrn=dynamic
That is how I am building on Yosimite (actually 10.7 and greater)
You probably should start with a clean folder.
Grado

Re: Problems with NEURON-7.4 make

Post by Grado »

Thank you, by changing the ./ configure, I was able to install without a problem, and I am now able to launch neuron 7.4.

Code: Select all

bin » ./nrniv                                                  /Applications/nrn74/nrn-7.4/x86_64/bin [13:16:42] 139 ↵
NEURON -- Release 7.4 (1351:8f462ea7e030) 2015-07-21
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015
See http://www.neuron.yale.edu/neuron/credits

oc>quit()
However, launching with the -mpi flag raises an error, and I have not been able to find it anywhere on the web. Do you know what this is and how to fix it?

Code: Select all

bin » ./nrniv -mpi                                                  /Applications/nrn74/nrn-7.4/x86_64/bin [13:16:47] 
[x-10-104-87-40:17346] *** Process received signal ***
[x-10-104-87-40:17346] Signal: Segmentation fault: 11 (11)
[x-10-104-87-40:17346] Signal code: Address not mapped (1)
[x-10-104-87-40:17346] Failing at address: 0x440000b0
[x-10-104-87-40:17346] [ 0] 0   libsystem_platform.dylib            0x00007fff96049f1a _sigtramp + 26
[x-10-104-87-40:17346] [ 1] 0   ???                                 0x0000000000000080 0x0 + 128
[x-10-104-87-40:17346] [ 2] 0   libnrnmpi.dylib                     0x0000000108c1787e f_nrnmpi_init + 254
[x-10-104-87-40:17346] [ 3] 0   nrniv                               0x000000010811f958 main + 136
[x-10-104-87-40:17346] [ 4] 0   libdyld.dylib                       0x00007fff8a6f95c9 start + 1
[x-10-104-87-40:17346] [ 5] 0   ???                                 0x0000000000000002 0x0 + 2
[x-10-104-87-40:17346] *** End of error message ***
[1]    17346 segmentation fault  ./nrniv -mpi
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: Problems with NEURON-7.4 make

Post by hines »

I updated my yosimite installation along with xcode and verified that the distributed tar.gz file builds properly wth the '--with-paranrn' argument to configure. I see in nrn-7.4/src/nmodl that

Code: Select all

otool -L nocmodl
nocmodl:
    /usr/local/lib/libmpi.1.dylib (compatibility version 8.0.0, current version 8.0.0)
...
Since your build is asking for libmpi.12.dylib, I guess i should ask what mpi you installed. I'm using openmpi. but any version you build against should work.
Does libmpi.12.dylib exist on your machine? if not in a standard place, perhaps things will start to work if you specify its location using the DYLD_LIBRARY_PATH environment
variable (LD_LIBRARY_PATH would also likely work)

By the way, on another forum thread you mention that --with-paranrn=dynamic built without error but there was a problem with mpi initialization. It seems likely to me that, assuming you have a valid installation of mpi,
that the above library paths would fix the problem in the dynamic loading context as well. Things can get confusing if you have both mpich and openmpi installed and they are not completely segregated (ie. building with the include files of
one and loading the library of the other, or using an inconsistent mpiexec)
Grado

Re: Problems with NEURON-7.4 make

Post by Grado »

I went to nrn-7.4/src/nmodl and ran tool -L nocmodl with the following results:

Code: Select all

nmodl » otool -L nocmodl                                             /Applications/nrn74/nrn-7.4/src/nmodl [21:05:35] 
nocmodl:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
Interestingly, I do have libmpi.1.dylib, located in /usr/local/lib/

There seems to be something wrong here... I have openmpi (v. 1.10.0) installed in /usr/local/openmpi, and libmpi.12.dylib can be found in /usr/local/openmpi/lib

So, I've tried to set LD_LIBRARY_PATH to both /usr/local/lib/libmpi.1.dylib, and /usr/local/openmpi/lib/libmpi.12.dylib, neither work. Below is the result:

Code: Select all

~ » export LD_LIBRARY_PATH=/usr/local/lib/libmpi.1.dylib                                              ~ [21:21:56] 1 ↵
~ » nrniv -mpi                                                                                           ~ [21:21:59] 
Try loading openmpi
load_mpi: dlopen(libmpi.dylib, 10): no suitable image found.  Did find:
	/usr/local/lib/libmpi.1.dylib/libmpi.dylib: stat() failed with errno=20
	/usr/local/lib/libmpi.1.dylib/libmpi.dylib: stat() failed with errno=20
Is openmpi installed? If not in default location, need a LD_LIBRARY_PATH.
could not dynamically load libmpi.so or libmpich2.so

Code: Select all

~ » export LD_LIBRARY_PATH=/usr/local/openmpi/lib/libmpi.12.dylib                                   ~ [21:21:06] 139 ↵
~ » nrniv -mpi                                                                                           ~ [21:21:06] 
Try loading openmpi
load_mpi: dlopen(libmpi.dylib, 10): no suitable image found.  Did find:
	/usr/local/openmpi/lib/libmpi.12.dylib/libmpi.dylib: stat() failed with errno=20
	/usr/local/openmpi/lib/libmpi.12.dylib/libmpi.dylib: stat() failed with errno=20
Is openmpi installed? If not in default location, need a LD_LIBRARY_PATH.
could not dynamically load libmpi.so or libmpich2.so
Grado

Re: Problems with NEURON-7.4 make

Post by Grado »

I fixed it!

I just had to set the environment variables before configuring and building neuron. Thanks for your help!

Code: Select all

parallel » mpiexec -n 4 nrniv test0.hoc -mpi                      /Applications/nrn74/nrn-7.4/src/parallel [22:16:06] 
numprocs=4
NEURON -- Release 7.4 (1351:8f462ea7e030) 2015-07-21
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015
See http://www.neuron.yale.edu/neuron/credits

I am 3 of 4
I am 2 of 4
I am 0 of 4
I am 1 of 4
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: Problems with NEURON-7.4 make

Post by hines »

Code: Select all

nmodl » otool -L nocmodl                                             /Applications/nrn74/nrn-7.4/src/nmodl [21:05:35]
nocmodl:
   /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
No mention of libmpi because your configure used --with-paranrn=dynamic . This is not a problem.

Code: Select all

export LD_LIBRARY_PATH=/usr/local/openmpi/lib/libmpi.12.dylib
only the folder, not the file should be in the path specfication.
I fixed it!
What were your final environment variables and configure line?
Did you have several versions of mpi installed?
Grado

Re: Problems with NEURON-7.4 make

Post by Grado »

My final configure line was:

Code: Select all

./configure --prefix=`pwd` --with-iv=/Applications/nrn74/iv-19 --with-paranrn=dynamic --with-nrnpython=dynamic
I did mistype when I wrote that I exported the file. I've added the following lines to my .profile:

Code: Select all

export MPI_DIR=/usr/local/openmpi
export PATH=/usr/local/openmpi/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/openmpi/lib:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$LD_LIBARY_PATH
I do now have three versions of MPI installed on my machine. I'm a little nervous about this, but I think it's ok.

Code: Select all

~ » which mpiexec                                                                                        ~ [15:56:54] 
/usr/local/openmpi/bin/mpiexec
~ » where mpiexec                                                                                        ~ [15:57:01] 
/usr/local/openmpi/bin/mpiexec
/Users/Grado/anaconda/bin/mpiexec
/Users/Grado/local/bin/mpiexec
I'm assuming that the mpiexec in anaconda/bin/ is mpi4py. The mpiexec in openmpi/bin/ is obviously openmpi. I am wondering about the mpiexec in local/bin/. From what I understand, this is an MPI version that is used by the system and (probably) should not be messed with.

The above solved my installation and nrniv -mpi issues. I then encountered problems with importing neuron within python viewtopic.php?f=2&t=3238 I had the same problem as this poster, and solved the problem by 1) adding export PYTHONPATH=/Applications/nrn74/nrn-7.4/lib/python:$PYTHONPATH to my .profile, and copying libreadline.6.2.dylib from /anaconda/lib into /usr/lib. Now I am able to import NEURON 7.4 into python without issue.

As seems to be the theme here, however, I now am having a new issue, and I think it may be related to the various installations of mpi on my machine. In python, I can use mpi4py, and I can import neuron, but I cannot do both at the same time:

If I import neuron first, I encounter an error when trying to use MPI (Not while importing it...)

Code: Select all

~ » ipython --pylab                                                                                      ~ [16:01:56] 
Python 2.7.10 |Anaconda 2.3.0 (x86_64)| (default, May 28 2015, 17:04:42) 
Type "copyright", "credits" or "license" for more information.

IPython 3.2.0 -- An enhanced Interactive Python.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.
Using matplotlib backend: MacOSX

In [1]: import neuron
NEURON -- Release 7.4 (1351:8f462ea7e030) 2015-07-21
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015
See http://www.neuron.yale.edu/neuron/credits


In [2]: from mpi4py import MPI

In [3]: comm = MPI.COMM_WORLD

In [4]: rank = comm.Get_rank()
[x-10-104-138-110:94582] *** Process received signal ***
[x-10-104-138-110:94582] Signal: Segmentation fault: 11 (11)
[x-10-104-138-110:94582] Signal code: Address not mapped (1)
[x-10-104-138-110:94582] Failing at address: 0x440000b0
[x-10-104-138-110:94582] [ 0] 0   libsystem_platform.dylib            0x00007fff96eaaf1a _sigtramp + 26
[x-10-104-138-110:94582] [ 1] 0   ???                                 0x000000010023b000 0x0 + 4297306112
[x-10-104-138-110:94582] [ 2] 0   MPI.so                              0x0000000106d88eed __pyx_pw_6mpi4py_3MPI_4Comm_13Get_rank + 61
[x-10-104-138-110:94582] [ 3] 0   libpython2.7.dylib                  0x00000001000c39bd PyEval_EvalFrameEx + 24989
[x-10-104-138-110:94582] [ 4] 0   libpython2.7.dylib                  0x00000001000c5ca3 PyEval_EvalCodeEx + 2115
[x-10-104-138-110:94582] [ 5] 0   libpython2.7.dylib                  0x00000001000c5275 PyEval_EvalFrameEx + 31317
[x-10-104-138-110:94582] [ 6] 0   libpython2.7.dylib                  0x00000001000c5ca3 PyEval_EvalCodeEx + 2115
[x-10-104-138-110:94582] [ 7] 0   libpython2.7.dylib                  0x00000001000c3d10 PyEval_EvalFrameEx + 25840
[x-10-104-138-110:94582] [ 8] 0   libpython2.7.dylib                  0x00000001000c5ca3 PyEval_EvalCodeEx + 2115
[x-10-104-138-110:94582] [ 9] 0   libpython2.7.dylib                  0x00000001000c3d10 PyEval_EvalFrameEx + 25840
[x-10-104-138-110:94582] [10] 0   libpython2.7.dylib                  0x00000001000c5ca3 PyEval_EvalCodeEx + 2115
[x-10-104-138-110:94582] [11] 0   libpython2.7.dylib                  0x00000001000c3d10 PyEval_EvalFrameEx + 25840
[x-10-104-138-110:94582] [12] 0   libpython2.7.dylib                  0x00000001000c5ca3 PyEval_EvalCodeEx + 2115
[x-10-104-138-110:94582] [13] 0   libpython2.7.dylib                  0x00000001000c3d10 PyEval_EvalFrameEx + 25840
[x-10-104-138-110:94582] [14] 0   libpython2.7.dylib                  0x00000001000c5ca3 PyEval_EvalCodeEx + 2115
[x-10-104-138-110:94582] [15] 0   libpython2.7.dylib                  0x00000001000c3d10 PyEval_EvalFrameEx + 25840
[x-10-104-138-110:94582] [16] 0   libpython2.7.dylib                  0x00000001000c5ca3 PyEval_EvalCodeEx + 2115
[x-10-104-138-110:94582] [17] 0   libpython2.7.dylib                  0x00000001000c3d10 PyEval_EvalFrameEx + 25840
[x-10-104-138-110:94582] [18] 0   libpython2.7.dylib                  0x00000001000c5ca3 PyEval_EvalCodeEx + 2115
[x-10-104-138-110:94582] [19] 0   libpython2.7.dylib                  0x000000010003e1d0 function_call + 176
[x-10-104-138-110:94582] [20] 0   libpython2.7.dylib                  0x000000010000c7b2 PyObject_Call + 98
[x-10-104-138-110:94582] [21] 0   libpython2.7.dylib                  0x00000001000bea0a PyEval_EvalFrameEx + 4586
[x-10-104-138-110:94582] [22] 0   libpython2.7.dylib                  0x00000001000c5ca3 PyEval_EvalCodeEx + 2115
[x-10-104-138-110:94582] [23] 0   libpython2.7.dylib                  0x00000001000c3d10 PyEval_EvalFrameEx + 25840
[x-10-104-138-110:94582] [24] 0   libpython2.7.dylib                  0x00000001000c5ca3 PyEval_EvalCodeEx + 2115
[x-10-104-138-110:94582] [25] 0   libpython2.7.dylib                  0x00000001000c5dc6 PyEval_EvalCode + 54
[x-10-104-138-110:94582] [26] 0   libpython2.7.dylib                  0x00000001000eb17e PyRun_FileExFlags + 174
[x-10-104-138-110:94582] [27] 0   libpython2.7.dylib                  0x00000001000eb41a PyRun_SimpleFileExFlags + 458
[x-10-104-138-110:94582] [28] 0   libpython2.7.dylib                  0x000000010010248d Py_Main + 3165
[x-10-104-138-110:94582] [29] 0   python                              0x0000000100000f54 start + 52
[x-10-104-138-110:94582] *** End of error message ***
/Users/Grado/anaconda/bin/python.app: line 3: 94582 Segmentation fault: 11  /Users/Grado/anaconda/python.app/Contents/MacOS/python "$@"
The same error is thrown using any comm. function.

And if I import mpi first, I encounter a different error, and this time when trying to import neuron:

Code: Select all

~ » ipython --pylab                                                                                      ~ [16:03:52] 
Python 2.7.10 |Anaconda 2.3.0 (x86_64)| (default, May 28 2015, 17:04:42) 
Type "copyright", "credits" or "license" for more information.

IPython 3.2.0 -- An enhanced Interactive Python.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.
Using matplotlib backend: MacOSX

In [1]: from mpi4py import MPI

In [2]: import neuron
Fatal error in MPI_Comm_dup: Invalid communicator, error stack:
MPI_Comm_dup(177): MPI_Comm_dup(comm=0x74bef90, new_comm=0x10761a350) failed
MPI_Comm_dup(135): Invalid communicator
I'm wondering if neuron is trying to use openMPI, while python is trying to use mpi4py, and if this is causing the error.
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: Problems with NEURON-7.4 make

Post by hines »

You need to rebuild NEURON against the version of mpi that python is using.
The trick is to figure out what it is. If you're lucky, then all the necessary mpi files are a part of the anaconda installation

Look in the /Users/Grado/anaconda subfolders and see if you can find libmpi* and mpi.h. If there is an mpicc and mpic++/mpicpp
then you can build with those in your PATH. Otherwise you can explicitly set CFLAGS and CXXFLAGS on the configure line with an extra
'-I/Users/Grado/anaconda/...... item
Grado

Re: Problems with NEURON-7.4 make

Post by Grado »

I'm not entirely sure what do do from your last instruction. I did run several find commands in the ~/anaconda directory for the files you mentioned. They are all present. Should I go back and configure neuron with a new flag (such as --with-paranrn=~/anaconda/?)?

Code: Select all

anaconda » find ./ -name "libmpi*"                                                              ~/anaconda [20:20:06] 
.//envs/py3k/lib/python3.3/site-packages/sympy/mpmath/libmp/__pycache__/libmpi.cpython-33.pyc
.//envs/py3k/lib/python3.3/site-packages/sympy/mpmath/libmp/libmpi.py
.//lib/libmpi.1.dylib
.//lib/libmpi.12.dylib
.//lib/libmpi.a
.//lib/libmpi.dylib
.//lib/libmpi.la
.//lib/libmpi_cxx.1.dylib
.//lib/libmpi_cxx.dylib
.//lib/libmpi_cxx.la
.//lib/libmpi_f77.1.dylib
.//lib/libmpi_f77.dylib
.//lib/libmpi_f77.la
.//lib/libmpich.dylib
.//lib/libmpichcxx.dylib
.//lib/libmpicxx.12.dylib
.//lib/libmpicxx.a
.//lib/libmpicxx.dylib
.//lib/libmpicxx.la
.//lib/python2.7/site-packages/mpi4py/include/mpi4py/libmpi.pxd
.//lib/python2.7/site-packages/mpi4py/libmpi.pxd
.//lib/python2.7/site-packages/sympy/mpmath/libmp/libmpi.py
.//lib/python2.7/site-packages/sympy/mpmath/libmp/libmpi.pyc
.//pkgs/mpi4py-2.0.0a0-py27_mpich_0/lib/python2.7/site-packages/mpi4py/include/mpi4py/libmpi.pxd
.//pkgs/mpi4py-2.0.0a0-py27_mpich_0/lib/python2.7/site-packages/mpi4py/libmpi.pxd
.//pkgs/mpich-3.1.4-0/lib/libmpi.12.dylib
.//pkgs/mpich-3.1.4-0/lib/libmpi.a
.//pkgs/mpich-3.1.4-0/lib/libmpi.dylib
.//pkgs/mpich-3.1.4-0/lib/libmpi.la
.//pkgs/mpich-3.1.4-0/lib/libmpich.dylib
.//pkgs/mpich-3.1.4-0/lib/libmpichcxx.dylib
.//pkgs/mpich-3.1.4-0/lib/libmpicxx.12.dylib
.//pkgs/mpich-3.1.4-0/lib/libmpicxx.a
.//pkgs/mpich-3.1.4-0/lib/libmpicxx.dylib
.//pkgs/mpich-3.1.4-0/lib/libmpicxx.la
.//pkgs/openmpi-1.6.3-0/lib/libmpi.1.dylib
.//pkgs/openmpi-1.6.3-0/lib/libmpi.dylib
.//pkgs/openmpi-1.6.3-0/lib/libmpi.la
.//pkgs/openmpi-1.6.3-0/lib/libmpi_cxx.1.dylib
.//pkgs/openmpi-1.6.3-0/lib/libmpi_cxx.dylib
.//pkgs/openmpi-1.6.3-0/lib/libmpi_cxx.la
.//pkgs/openmpi-1.6.3-0/lib/libmpi_f77.1.dylib
.//pkgs/openmpi-1.6.3-0/lib/libmpi_f77.dylib
.//pkgs/openmpi-1.6.3-0/lib/libmpi_f77.la
.//pkgs/sympy-0.7.5-py27_0/lib/python2.7/site-packages/sympy/mpmath/libmp/libmpi.py
.//pkgs/sympy-0.7.5-py27_0/lib/python2.7/site-packages/sympy/mpmath/libmp/libmpi.pyc
.//pkgs/sympy-0.7.6-py27_0/lib/python2.7/site-packages/sympy/mpmath/libmp/libmpi.py
.//pkgs/sympy-0.7.6-py27_0/lib/python2.7/site-packages/sympy/mpmath/libmp/libmpi.pyc
.//pkgs/sympy-0.7.6-py33_0/lib/python3.3/site-packages/sympy/mpmath/libmp/__pycache__/libmpi.cpython-33.pyc
.//pkgs/sympy-0.7.6-py33_0/lib/python3.3/site-packages/sympy/mpmath/libmp/libmpi.py
anaconda » find ./ -name "mpi.h"                                                                ~/anaconda [20:20:16] 
.//include/mpi.h
.//pkgs/mpich-3.1.4-0/include/mpi.h
.//pkgs/openmpi-1.6.3-0/include/mpi.h
anaconda » find ./ -name "mpicc"                                                                ~/anaconda [20:20:54] 
.//bin/mpicc
.//pkgs/mpich-3.1.4-0/bin/mpicc
.//pkgs/openmpi-1.6.3-0/bin/mpicc
anaconda » find ./ -name "mpicpp"                                                               ~/anaconda [20:21:08] 
anaconda » find ./ -name "mpic++"                                                               ~/anaconda [20:21:21] 
.//bin/mpic++
.//pkgs/mpich-3.1.4-0/bin/mpic++
.//pkgs/openmpi-1.6.3-0/bin/mpic++
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: Problems with NEURON-7.4 make

Post by hines »

On my mavericks os, I happened to have anaconda 2.1.0 installed but not mpi4py. I installed the latter via
conda install mpi4py
and see that I got an apparently complete version of openmpi 1.6.3 along with it. I now see that on this machine there is a
/Users/michaelhines/anaconda/bin that contains mpiexec, mpicc, mpicxx, etc,
So I believe you should rebuild neuron (using --with-paranrn=dynamic) but with
export PATH=$HOME/anaconda/bin:$PATH

a DYLD_LIBRARY_PATH into the anaconda/lib can't hurt but I don't know if that is necessary when you use mpiexec to launch python and import neuron.
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: Problems with NEURON-7.4 make

Post by hines »

I installed anaconda and mip on my Yosimite partition to see if I could get everything working.
A couple more details. The anaconda mpicc has a hardwired path and a work around is

Code: Select all

sudo ln -s $HOME/anaconda /opt/anaconda1anaconda2anaconda3
I was seeing some errors during installation have to do with compiling some rx3d files generated by python. I avoided those with the configure option
--disable-rx3d
If you need the rx3d module, I can look into that. So the build process was

Code: Select all

./configure --prefix=`pwd` --with-iv=/Applications/NEURON-7.4/iv --with-paranrn=dynamic --with-nrnpython=dynamic --disable-rx3d --with-readline=yes
make -j 2 install
To avoid a readline library problem, I really do need a
export DYLD_LIBRARY_PATH="/Users/hines/anaconda/lib"

Now I successfully:

Code: Select all

mpiexec -n 4 nrniv -mpi -python src/parallel/test0.py
numprocs=4
NEURON -- Release 7.4 (1351:8f462ea7e030) 2015-07-21
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015
See http://www.neuron.yale.edu/neuron/credits

I am 2 of 4
I am 0 of 4
I am 1 of 4
I am 3 of 4
Also copying the above test0.py to test.py and prepending the line
from mpi4py import MPI
the following works

Code: Select all

Michaels-MacBook-Air:nrn-7.4 hines$ mpiexec -n 4 python test.py
numprocs=4
NEURON -- Release 7.4 (1351:8f462ea7e030) 2015-07-21
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015
See http://www.neuron.yale.edu/neuron/credits

I am 3 of 4
I am 1 of 4
I am 0 of 4
I am 2 of 4
FInally, if you comment out the 'from mpi4py import MPI' in the test.py file, you can still launch python and have the neuron module initialize mpi by

Code: Select all

Michaels-MacBook-Air:nrn-7.4 hines$ export NEURON_INIT_MPI=0
Michaels-MacBook-Air:nrn-7.4 hines$ mpiexec -n 4 python test.py
numprocs=4
NEURON -- Release 7.4 (1351:8f462ea7e030) 2015-07-21
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015
See http://www.neuron.yale.edu/neuron/credits

I am 0 of 4
I am 3 of 4
I am 2 of 4
I am 1 of 4
Grado

Re: Problems with NEURON-7.4 make

Post by Grado »

So after your last post, I was still having plenty of trouble. So I decided to start fresh. I wiped my hard drive and installed OS 10.10.5. (Hence my disappearance from the forums for a few days). I've installed openmpi and anaconda-3, and today I'm trying to install neuron.

I was able to configure, make, and install inter-views with no issues.

I configured neuron with the following line:

Code: Select all

./configure --prefix=`pwd` --with-iv=/Applications/Neuron-7.4/iv --with-nrnpython=/Applications/Anaconda-3/bin/python --with-paranrn
I decided to not set paranrn=dynamic since I only have one mip installation now. I also committed --disable-rx3d and --with-readline=yes. I wanted to troubleshoot with a simpler ./configure before adding more options.

I did set python to point to my anaconda installation. I was able to configure, make, and make install without throwing errors. However, I did see this in the ./configure output, which may be the source of the problem I'll describe below.

Code: Select all

RefactoringTool: Refactored src/nrnpython/setup.py
--- src/nrnpython/setup.py	(original)
+++ src/nrnpython/setup.py	(refactored)
@@ -25,8 +25,8 @@
 
 if nrnpython_pyver!=get_python_version():
     print("Error:")
-    print("NEURON configure time python: "+nrnpython_exec+"  "+ nrnpython_pyver)
-    print("Python presently executing setup.py: "+sys.executable+"   "+ get_python_version())
+    print(("NEURON configure time python: "+nrnpython_exec+"  "+ nrnpython_pyver))
+    print(("Python presently executing setup.py: "+sys.executable+"   "+ get_python_version()))
     print("These do not match, and they should!")
     sys.exit(1)
 
RefactoringTool: Files that were modified:
RefactoringTool: src/nrnpython/setup.py
After installation, this is the result of running nrniv (I already added the nrn/x86_64/bin to my path):

Code: Select all

~ » nrniv                                                         ~ [12:11:49] 
dyld: Library not loaded: libpython3.4m.dylib
  Referenced from: /Applications/Neuron-7.4/nrn/x86_64/bin/nrniv
  Reason: image not found
[1]    3572 trace trap  nrniv
Having seen this before, I added the following to my .profile.

Code: Select all

export DYLD_LIBRARY_PATH=/Applications/Anaconda-3/lib:$DYLD_LIBRARY_PATH
Now, running nrniv yields:

Code: Select all

~ » nrniv                                                         ~ [12:12:43] 
NEURON -- Release 7.4 (1351:8f462ea7e030) 2015-07-21
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015
See http://www.neuron.yale.edu/neuron/credits

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: unable to load the file system codec
ImportError: No module named 'encodings'
[1]    5096 abort      nrniv
In digging through the internet, I was able to find a few posts that suggested this resulted from an error in my PYTHONHOME environment variable. So I added the following to my .profile:

Code: Select all

export PYTHONHOME=/Applications/Anaconda-3/bin
The results of running nrniv are now:

Code: Select all

~ » nrniv                                                         ~ [12:13:43] 
NEURON -- Release 7.4 (1351:8f462ea7e030) 2015-07-21
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015
See http://www.neuron.yale.edu/neuron/credits

Fatal Python error: Py_Initialize: unable to load the file system codec
ImportError: No module named 'encodings'
[1]    6736 abort      nrniv
From what I understand with this, there seems to be a problem with the python interpreter finding the NEURON-7.4-py3.4.egg-info file. I already ran python setup.py install in nrn/src/nrnpython, and it said the file was copied into /Applications/Anaconda-3/lib. I tried to add /Applications/Anaconda-3/lib to my PYTHONPATH, and nothing changed. I've also tried adding /Applications/Neuron-7.4/nrn/lib (as well as /Applications/Neuron-7.4/nrn/lib/python) to my PYTHONPATH, and again no change. So now that's where I am. Any insight?
Post Reply