Issue Installing Neuron in Ubuntu 16.04 LTS

Post Reply
JEGHC20
Posts: 3
Joined: Wed May 11, 2016 8:23 am

Issue Installing Neuron in Ubuntu 16.04 LTS

Post by JEGHC20 »

Hi, I have looked around and so far failed to find anyone else with this problem, however if this is a duplicate post please do let me know and ill head over there.

I'm trying to install Neuron for use with pyNN in a fresh install of Ubuntu 16.04 LTS and thus far have had no success.

I have downloaded the nrn.tar.gz and iv.tar.gz files and tried running:

Code: Select all

./configure --prefix=`pwd` --with-nrnpython --with-paranrn
However this yields the following warning:

Code: Select all

...
checking for X... no
configure: error: cannot find X11
I have noticed that if I try to call X11 it tells me that it needs installing but on running the following to install it, the system also tells me that 'x11-common is already the newest version (1:7.7+13ubuntu3)' and therefore doesn't install.

Code: Select all

sudo apt-get install x11-common
I have also tried building the alpha version however this yielded the following when running './build.sh':

Code: Select all

libtoolize -c -f -i
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './config.guess'
libtoolize: copying file './config.sub'
libtoolize: copying file './install-sh'
libtoolize: copying file './ltmain.sh'
libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.in,
libtoolize: and rerunning libtoolize and aclocal.
libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
aclocal: warning: autoconf input should be named 'configure.ac', not 'configure.in'
The .deb file also seems to fail... however there is no output when using that.

Has anyone managed to get neuron to work with python on Ubuntu 16.04 LTS or seen this X11 issue before?

Many thanks,
Jon.
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Issue Installing Neuron in Ubuntu 16.04 LTS

Post by ted »

On that machine have you ever successfully compiled any program that requires X11? If not, the problem is lack of the X11 libraries that are needed for software development. Default installation of previous Ubuntu versions would set up a machine that is configured to run programs that have already been compiled, but lacked most or all of what is necessary for software development. It seems unlikely that 16.x would do otherwise. I can't give you a specific fix because I rarely use Ubuntu and have no experience at all with its 16.x versions. However, Ubuntu has lots of official online documentation and a large and active user community, so poking around online ought to turn up what you need.

You might also try using the Forum's "advanced search" feature to do this particular search:
+ubuntu +x11
That should turn up lots of hits, some of which may be helpful.

Please post the solution when you discover it.
JEGHC20
Posts: 3
Joined: Wed May 11, 2016 8:23 am

Re: Issue Installing Neuron in Ubuntu 16.04 LTS

Post by JEGHC20 »

Thanks Ted. I believe that the system is working now... however I am uncertain if InterViews has properly installed - I can run nrngui or nrndemo however I cannot find/run nrniv. I'm uncertain what InterViews is used for so not certain what to test. Is there an easy way to test its install?

Here is the whole process as an 'auto-neuron.sh' file for anyone else who needs to install neuron on a fresh Ubuntu install. It should be mentioned that this install is designed to work with the Python interpreter and was intended for use with PyNN. Hope it helps. USE THE CODE IN THE LATER POST SINCE THIS ONE HAS ERRORS... LEFT HERE FOR FUTURE READERS REFERENCE.

Code: Select all

# Install the relevent system requirements

sudo apt-get install -y libx11-dev
sudo apt-get install -y libxext-dev
sudo apt-get install -y mpich
sudo apt-get install -y libncurses-dev

sudo apt-get install python-pip
pip install --upgrade pip
pip install mpi4pi
pip install neo
pip install numpy
pip install lazyarray

#sudo apt-get install -y python-numpy
#sudo apt-get install -y python-lazyarray
#sudo apt-get install -y python-neo

# Make neuron directory
mkdir ~/neuron
cd ~/neuron/

# Pull files for installing Neuron
wget http://www.neuron.yale.edu/ftp/neuron/versions/v7.4/nrn-7.4.tar.gz
wget http://www.neuron.yale.edu/ftp/neuron/versions/v7.4/iv-19.tar.gz

# Unzip neuron install packages
tar xzf ./iv-19.tar.gz
tar xzf ./nrn-7.4.tar.gz

# Rename folders for ease of use
mv iv-19 iv
mv nrn-7.4 nrn

# Configure, make and install InverViews
cd ./iv
./configure --prefix=`pwd`
make
make install

# Configure, make and install Neuron
cd ../nrn
./configure --prefix=`pwd` --with-nrnpython --with-paranrn --with-iv
make
make install

# Allow importing of neuron into python
cd src/nrnpython
sudo python setup.py install

# Add IV and NEURON to PATH
sudo echo "# Add Neuron and IV to path variable" >> ~/.bashrc
sudo echo 'export PATH="$HOME/neuron/nrn/bin:$PATH"' >> ~/.bashrc
#sudo echo 'export PATH="$HOME/neuron/iv/bin:$PATH"' >> ~/.bashrc

source ~/.bashrc

# Make built modules executable
chmod +x ~/neuron/nrn/bin/nrngui
chmod +x ~/neuron/nrn/bin/nrnivmodl
chmod +x ~/neuron/nrn/bin/neurondemo
Just incase it proves useful, here is the 'auto-pynn.sh' file I have made to also install PyNN and allow use of NEURON.

Code: Select all

# Dependencies

sudo apt-get install python-pip
pip install --upgrade pip

# Install PyNN

pip install pyNN
pip install mpi4pi
pip install neo
pip install numpy

# Setup NeuronIV
cd ~/.local/lib/python2.7/site-packages/pyNN/neuron/nmodl
nrnivmodl
--
Jon
Last edited by JEGHC20 on Mon May 23, 2016 5:32 am, edited 1 time in total.
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Issue Installing Neuron in Ubuntu 16.04 LTS

Post by ted »

JEGHC20 wrote:I am uncertain if InterViews has properly installed - I can run nrngui or nrndemo however I cannot find/run nrniv.
Despite its suggestive name, nrniv does not use InterViews--it starts NEURON without a GUI. Unless you specify that it read a hoc or Python file, it just prints NEURON's typical banner to the terminal, then sits there with the interpreter's prompt
oc>
waiting for you to do something.

There is no nrndemo--the program you're thinking of is neurondemo. It should start NEURON's demonstration program, which has a graphical user interface that allows selection and execution of several different models. If InterViews has not been properly installed, neurondemo will not work properly. Another test to see if InterViews is working correctly is to launch idraw from the command line. idraw is a bit like MacDraw--it's a vector graphics program that is very useful for editing vector graphics files that can be generated by the Print and File Window Manager (read about that in the FAQ list--see the Documentation page at http://www.neuron.yale.edu). Those are encapsulated PostScript files in a format that can be read and written by Adobe Illustrator and Corel Draw.

WRT your installation strategy--it puts the executables and related libraries into
~/neuron/iv
and
~/neuron/nrn
so I'd expect there to be an x86_64 somewhere under each of these two directories, which contain the InterViews and NEURON executables, respectively. For example, on my own hardware, after configuring compilation of NEURON with
--prefix=~/bin/nrn
and completing installation,
ls ~/bin/nrn/
reveals the following directories
x86_64 include lib share
and it's x86_64 that contains NEURON's executables.

So I'm surprised that on your PC
(1) there is anything in
~/neuron/nrn/bin
that can be made executable, other than directories
(which in any case aren't named nrngui, nrnivmodl, or neurondemo)
and that
(2) the statements
chmod +x ~/neuron/nrn/bin/nrngui
chmod +x ~/neuron/nrn/bin/nrnivmodl
chmod +x ~/neuron/nrn/bin/neurondemo
do anything useful--shouldn't each of these produce an error message?
JEGHC20
Posts: 3
Joined: Wed May 11, 2016 8:23 am

Re: Issue Installing Neuron in Ubuntu 16.04 LTS

Post by JEGHC20 »

Thanks for your help with this. You're correct I did indeed mean 'neurondemo' and this appears to work correctly.

The files previously mentioned can be found in '~/neuron/nrn/bin', however I see what has happened. It seems I accidentally linked to the bin folders produced during the build, not the final output. Here is the final build code for anyone else who would like to use neuron on Ubuntu 16.04:

Code: Select all

# Install the relevant system requirements

sudo apt-get install -y libx11-dev
sudo apt-get install -y libxext-dev
sudo apt-get install -y mpich
sudo apt-get install -y libncurses-dev

sudo apt-get install python-pip
pip install --upgrade pip
pip install mpi4pi
pip install neo
pip install numpy
pip install lazyarray

#sudo apt-get install -y python-numpy
#sudo apt-get install -y python-lazyarray
#sudo apt-get install -y python-neo

# Make neuron directory
mkdir ~/neuron
cd ~/neuron/

# Pull files for installing Neuron
wget http://www.neuron.yale.edu/ftp/neuron/versions/v7.4/nrn-7.4.tar.gz
wget http://www.neuron.yale.edu/ftp/neuron/versions/v7.4/iv-19.tar.gz

# Unzip neuron install packages
tar xzf ./iv-19.tar.gz
tar xzf ./nrn-7.4.tar.gz

# Rename folders for ease of use
mv iv-19 iv
mv nrn-7.4 nrn

# Configure, make and install InverViews
cd ./iv
./configure --prefix=`pwd`
make
make install

# Configure, make and install Neuron
cd ../nrn
./configure --prefix=`pwd` --with-nrnpython --with-paranrn --with-iv
make
make install

# Allow importing of neuron into python
cd src/nrnpython
sudo python setup.py install

# Add IV and NEURON to PATH
sudo echo "# Add Neuron and IV to path variable" >> ~/.bashrc
sudo echo 'export PATH="$HOME/neuron/nrn/x86_64/bin:$PATH"' >> ~/.bashrc
sudo echo 'export PATH="$HOME/neuron/iv/x86_64/bin:$PATH"' >> ~/.bashrc

source ~/.bashrc
Thanks for all the help with this Ted.
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Issue Installing Neuron in Ubuntu 16.04 LTS

Post by ted »

Thanks for posting your solution. Ubuntu is very convenient in many ways--but what is not always so convenient is making sure that one has the development environment needed to compile NEURON's source code. And sometimes the necessary steps differ between major versions of Ubuntu.
shailesh
Posts: 104
Joined: Thu Mar 10, 2011 12:11 am

Re: Issue Installing Neuron in Ubuntu 16.04 LTS

Post by shailesh »

Thanks JEGHC20 for posting those installation instructions. Really useful!

Just to add to the potential pitfalls:
> The above installation procedure failed (gave errors) when the system already had Anaconda.
some of the errors were:
collect2: error: ld returned 1 exit status
Makefile:716: recipe for target 'nrniv' failed
> I repeated the same installation procedure on a fresh ubuntu install and it worked.

So if you are facing issues with the installation, do consider this being the problem. Apparently the same problems don't arise when having Miniconda (based on a colleague's experience).

p.s. I didn't try uninstalling Anaconda and checking it out.
p.p.s. I would recommend using this software called 'Timeshift'. It allows you to save the system state, and restore to an older stable state it if things go downhill. That's how I narrowed down on Anaconda being the (potential) problem.
Post Reply