-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheasy-nrn-install.sh
executable file
·72 lines (59 loc) · 1.83 KB
/
easy-nrn-install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#Tyler Banks
#Grab MPI Neuron and IV, install
#Instructions from https://www.neuron.yale.edu/neuron/download/getstd
#http://www.mpich.org/static/downloads/3.2.1/mpich-3.2.1-installguide.pdf
#https://www.neuron.yale.edu/phpBB/viewtopic.php?t=3062
if [ -z $1 ]; then
echo "Directory to install not specified, exiting."
exit 0
else
echo "Installing Neuron into $1/nrn"
fi
#cmd line arg $1
touch $1/nrnenv
mkdir $1/nrn
echo "export NRN_INSTALL_DIR=$1/nrn" >> $1/nrnenv
echo 'export MPI_DIR=$NRN_INSTALL_DIR/mpi_install' >> $1/nrnenv
echo 'export NRN_DIR=$NRN_INSTALL_DIR/neuron_install' >> $1/nrnenv
source $1/nrnenv
mkdir $MPI_DIR
cd $MPI_DIR
mkdir install
wget http://www.mpich.org/static/downloads/3.2.1/mpich-3.2.1.tar.gz
tar -xf ./mpich-3.2.1.tar.gz
cd mpich-3.2.1/
./configure --prefix=$MPI_DIR/install '--enable-shared' --disable-fortran '--disable-f77' '--disable-fc'
make
make install
export PATH="$MPI_DIR/install/bin:$PATH"
mkdir $NRN_DIR
cd $NRN_DIR
wget https://neuron.yale.edu/ftp/neuron/versions/v7.7/nrn-7.7.tar.gz
wget https://neuron.yale.edu/ftp/neuron/versions/v7.7/iv-19.tar.gz
tar xzf iv-19.tar.gz
tar xzf nrn-7.7.tar.gz
# renaming the new directories iv and nrn makes life simpler later on
mv iv-19 iv
mv nrn-7.7 nrn
#Install IV
cd iv
./configure --prefix=`pwd`
make
make install
#Install neuron
cd ..
cd nrn
./configure --prefix=`pwd` --with-iv=$NRN_DIR/iv --with-nrnpython=`which python` --with-paranrn
make
make install
cd $1
cd nrn/neuron_install/nrn/src/nrnpython/
python setup.py install
#Make it easy to use
echo 'export PATH="$MPI_DIR/install/bin:$PATH"' >> $1/nrnenv
echo 'export IV=$NRN_DIR/iv' >> $1/nrnenv
echo 'export N=$NRN_DIR/nrn' >> $1/nrnenv
echo 'export CPU=x86_64' >> $1/nrnenv
echo 'export PATH="$IV/$CPU/bin:$N/$CPU/bin:$PATH"' >> $1/nrnenv
source $1/nrnenv
echo "source $1/nrnenv" >> $HOME/.bashrc