-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall_BMTK_Lewis.sh
executable file
·110 lines (92 loc) · 3.61 KB
/
install_BMTK_Lewis.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/bash
#Uncomment the following two lines to debug script line by line
#set -x
#trap read debug
# Adapted from Songjie Wang's script located here: https://github.com/wangso/BMTK_Lewis/blob/master/Lewis_setup.sh
if [ -z $1 ]; then
echo "Directory to install not specified, exiting."
echo "Usage: install_BMTK_Lewis.sh [install directory]"
echo "Ex: install_BMTK_Lewis.sh ."
exit 0
else
echo "Installing into `realpath $1`"
fi
installdir=`realpath $1`
echo "loading Lewis system libraries (ignore some of the error messages)"
module load automake/automake-1.16.1-gcc-4.9.2
module load autoconf/autoconf-2.69-gcc-4.9.2
export OMPI_MCA_btl_openib_if_include='mlx5_3:1'
module load libtool/libtool-2.4.6-gcc-4.9.2
#module load gcc/gcc-5.4.0
module load gcc/gcc-4.9.4
module load bison/bison-3.0.4
module load flex/flex-2.6.4
module load python/python-3.6.5
cd $installdir
echo "Installing pip"
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py --user
cd $installdir
echo "Installing openmpi" #(I had to install this myself as the Lewis library won't work, at least for me)
echo "Downloading..."
mkdir openmpi-install
wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.1.tar.gz
tar -xzvf openmpi-4.0.1.tar.gz
cd openmpi-4.0.1
#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=$installdir/openmpi-install #--enable-shared --disable-fortran --disable-f77 --disable-fc
make -j install
echo "Adding openmpi to .bashrc"
echo "#BEGIN TYLER'S INSTALL SCRIPT" >> ~/.bashrc
export PATH=$installdir/openmpi-install/bin:$PATH
echo "export PATH=$installdir/openmpi-install/bin:\$PATH" >> ~/.bashrc
cd $installdir
echo "Installing mpi4py"
echo "Downloading..."
wget https://bitbucket.org/mpi4py/mpi4py/downloads/mpi4py-3.0.2.tar.gz
tar -zxf mpi4py-3.0.2.tar.gz
cd mpi4py-3.0.2
#nano mpi.cfg
# under [openmpi]
# change mpi_dir=$installdir/opoenmpi-4.0.1-install
sed -i "s|mpi_dir.*=.*|mpi_dir=$installdir/openmpi-install|" $installdir/mpi4py-3.0.2/mpi.cfg
python3 setup.py build --mpi=openmpi
python3 setup.py install --user
cd $installdir
echo "installing neuron with openmpi"
mkdir neuron
cd neuron
git clone http://github.com/neuronsimulator/nrn
cd nrn
sh build.sh
./configure --prefix=`pwd` --without-x --with-paranrn --with-nrnpython=python --disable-rx3d
make -j install
# Put these lines in your ~/.bashrc file
export PYTHONPATH=$installdir/neuron/nrn/lib/python:$PYTHONPATH
export PATH=$installdir/neuron/nrn/x86_64/bin:$PATH
echo "export PYTHONPATH=$installdir/neuron/nrn/lib/python:\$PYTHONPATH" >> ~/.bashrc
echo "export PATH=$installdir/neuron/nrn/x86_64/bin:\$PATH" >> ~/.bashrc
cd $installdir
echo "Installing bmtk"
git clone https://github.com/AllenInstitute/bmtk.git
cd bmtk
python3 setup.py install --user
#BMTK versions fix
#See https://github.com/AllenInstitute/bmtk/issues/66
pip install pandas==0.20.3 h5py==2.7.0 --user
echo "Adding load module python3 to .bashrc, type python3 to use python"
echo "module load python/python-3.6.5" >> ~/.bashrc
echo "module load gcc/gcc-4.9.4" >> ~/.bashrc
echo "#END TYLER'S INSTALL SCRIPT" >> ~/.bashrc
echo ""
echo "DONE."
echo "Log out then log back in for a working installation, or type:"
echo "source ~/.bashrc"
# in Lewis sbatch files, remove "source activate bmtk_env" and "source deactivate"
# in Lewis sbatch files, remove "module load openmpi/openmpi-2.0.0" and "module unload openmpi/openmpi-2.0.0"
# for batch_lewis_run.sh to run correctly, run the following
#cd SPWR_BMTK/biophys_components/mechanisms/
#rm -rf x86_64/
#nrnivmodl modfiles