Skip to content

Commit 648919e

Browse files
authored
Merge pull request #19 from SpiNNakerManchester/update_install_scripts
Update install scripts
2 parents bf67ebe + db039bd commit 648919e

File tree

6 files changed

+150
-115
lines changed

6 files changed

+150
-115
lines changed

automatic_make.sh

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,38 @@
1-
# This script assumes it is run from the directory holding all github projects in parellel
2-
# sh SupportScripts/automatic_make.sh
1+
# This script assumes it is run from the directory holding all github projects in parallel
2+
# bash SupportScripts/automatic_make.sh
33

4-
cd spinnaker_tools
5-
source $PWD/setup
6-
make clean
7-
make || exit $?
8-
cd ..
9-
cd spinn_common
10-
make clean
11-
make install-clean
12-
make || exit $?
13-
make install
14-
cd ..
15-
cd SpiNNFrontEndCommon/c_common/
16-
cd front_end_common_lib/
17-
make install-clean
18-
cd ..
19-
make clean
20-
make || exit $?
21-
make install
22-
cd ../..
23-
cd sPyNNaker/neural_modelling/
24-
source $PWD/setup.bash
25-
make clean
26-
make || exit $?
27-
cd ../../SpiNNakerGraphFrontEnd/spinnaker_graph_front_end/examples/
28-
make clean
29-
make || exit $?
30-
echo "completed"
4+
do_make() {
5+
if [ -d "$1" ]; then
6+
# Control will enter here if DIRECTORY exists.
7+
# Run setup.bash if it exists
8+
if [ -f "$1/setup.bash" ]; then
9+
cd $1
10+
source setup.bash || exit $?
11+
cd -
12+
fi
13+
if [ -f "$1/setup" ]; then
14+
cd $1
15+
source setup || exit $?
16+
cd -
17+
fi
18+
# Clean
19+
make -C $1 clean || exit $?
20+
# Clean installation; ignore error if install-clean doesn't work
21+
# (probably because there is no install clean for most targets)
22+
make -C $1 install-clean || true
23+
# Make
24+
make -C $1 || exit $?
25+
# Install if needed
26+
if [ "$2" == "install" ]; then
27+
make -C $1 install || exit $?
28+
fi
29+
fi
30+
}
31+
32+
do_make spinnaker_tools
33+
do_make spinn_common install
34+
do_make SpiNNFrontEndCommon/c_common/front_end_common_lib install
35+
do_make SpiNNFrontEndCommon/c_common/ install
36+
do_make sPyNNaker/neural_modelling/
37+
do_make sPyNNaker8NewModelTemplate/c_models/
38+
do_make SpiNNakerGraphFrontEnd/spinnaker_graph_front_end/examples/

automatic_make_debug.sh

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,38 @@
1-
# This script assumes it is run from the directory holding all github projects in parellel
2-
# sh SupportScripts/automatic_make.sh
1+
# This script assumes it is run from the directory holding all github projects in parallel
2+
# bash SupportScripts/automatic_make_debug.sh
33

4-
cd spinnaker_tools
5-
source $PWD/setup
6-
make clean
7-
make || exit $?
8-
cd ..
9-
cd spinn_common
10-
make clean
11-
make install-clean
12-
make || exit $?
13-
make install
14-
cd ..
15-
cd SpiNNFrontEndCommon/c_common/
16-
cd front_end_common_lib/
17-
make install-clean
18-
cd ..
19-
make clean
20-
make FEC_DEBUG=DEBUG || exit $?
21-
make install
22-
cd ../..
23-
cd sPyNNaker/neural_modelling/
24-
source $PWD/setup.bash
25-
make clean
26-
make SPYNNAKER_DEBUG=DEBUG || exit $?
27-
cd ../../SpiNNakerGraphFrontEnd/spinnaker_graph_front_end/examples/
28-
make clean
29-
make || exit $?
30-
echo "completed"
4+
do_make() {
5+
if [ -d "$1" ]; then
6+
# Control will enter here if DIRECTORY exists.
7+
# Run setup.bash if it exists
8+
if [ -f "$1/setup.bash" ]; then
9+
cd $1
10+
source setup.bash || exit $?
11+
cd -
12+
fi
13+
if [ -f "$1/setup" ]; then
14+
cd $1
15+
source setup || exit $?
16+
cd -
17+
fi
18+
# Clean
19+
make -C $1 clean || exit $?
20+
# Clean installation; ignore error if install-clean doesn't work
21+
# (probably because there is no install clean for most targets)
22+
make -C $1 install-clean || true
23+
# Make
24+
make -C $1 $3 || exit $?
25+
# Install if needed
26+
if [ "$2" == "install" ]; then
27+
make -C $1 install || exit $?
28+
fi
29+
fi
30+
}
31+
32+
do_make spinnaker_tools
33+
do_make spinn_common install
34+
do_make SpiNNFrontEndCommon/c_common/front_end_common_lib install FEC_DEBUG=DEBUG
35+
do_make SpiNNFrontEndCommon/c_common/ install
36+
do_make sPyNNaker/neural_modelling/ noinstall SPYNNAKER_DEBUG=DEBUG
37+
do_make sPyNNaker8NewModelTemplate/c_models/ noinstall SPYNNAKER_DEBUG=DEBUG
38+
do_make SpiNNakerGraphFrontEnd/spinnaker_graph_front_end/examples/

install.sh

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
yes_to_all=""
4+
35
check_or_install() {
46
if [ -d "$1" ]; then
57
# Control will enter here if DIRECTORY exists.
@@ -12,7 +14,12 @@ check_or_install() {
1214
fi
1315
else
1416
while true; do
15-
read -p "Do you wish to install $2 to $(pwd)/$1" yn
17+
yn="y"
18+
echo "$yes_to_all"
19+
if [ "$yes_to_all" == "" ]; then
20+
read -p "Do you wish to install $2 to $(pwd)/$1 [y]? " yn
21+
yn=${yn:-y}
22+
fi
1623
case $yn in
1724
[Yy]* ) echo instaling $2;
1825
git clone $2
@@ -26,30 +33,33 @@ check_or_install() {
2633
fi
2734
}
2835

29-
install_seven(){
30-
check_or_install sPyNNaker7 https://github.com/SpiNNakerManchester/sPyNNaker7.git ;
31-
check_or_install sPyNNaker7NewModelTemplate https://github.com/SpiNNakerManchester/sPyNNaker7NewModelTemplate.git
32-
check_or_install PyNN7Examples https://github.com/SpiNNakerManchester/PyNN7Examples.git
33-
}
34-
3536
install_eight(){
37+
check_or_install sPyNNaker https://github.com/SpiNNakerManchester/sPyNNaker.git
3638
check_or_install sPyNNaker8 https://github.com/SpiNNakerManchester/sPyNNaker8.git ;
3739
check_or_install sPyNNaker8NewModelTemplate https://github.com/SpiNNakerManchester/sPyNNaker8NewModelTemplate.git
3840
check_or_install PyNN8Examples https://github.com/SpiNNakerManchester/PyNN8Examples.git
3941
}
4042

43+
install_gfe(){
44+
check_or_install SpiNNakerGraphFrontEnd https://github.com/SpiNNakerManchester/SpiNNakerGraphFrontEnd.git
45+
}
46+
4147
case $1 in
42-
*7 ) echo "Installing for PyNN7";
43-
break;;
44-
*8 ) echo "Installing for PyNN8";
45-
break;;
48+
*8 ) echo "Installing for PyNN8";;
49+
gfe) echo "Installing Graph Front End";;
4650
man ) echo "Installing special manchester repositories";;
47-
all ) echo "Installing All the main repositories8";
48-
break;;
49-
* ) echo "Please specifiy if you wish to install for PyNN7, PyNN8, or all? ";
51+
all ) echo "Installing All the main repositories";;
52+
* ) echo "Please specifiy if you wish to install for PyNN8, gfe or all:";
5053
exit;;
5154
esac
5255

56+
if [ $# -gt 1 ]; then
57+
if [ "$2" == "-y" ]; then
58+
echo "Installing without prompt"
59+
yes_to_all="y"
60+
fi
61+
fi
62+
5363
check_or_install spinnaker_tools https://github.com/SpiNNakerManchester/spinnaker_tools.git
5464
check_or_install spinn_common https://github.com/SpiNNakerManchester/spinn_common.git
5565
check_or_install SpiNNUtils https://github.com/SpiNNakerManchester/SpiNNUtils.git
@@ -59,42 +69,35 @@ check_or_install PACMAN https://github.com/SpiNNakerManchester/PACMAN.git
5969
check_or_install SpiNNMan https://github.com/SpiNNakerManchester/SpiNNMan.git
6070
check_or_install DataSpecification https://github.com/SpiNNakerManchester/DataSpecification.git
6171
check_or_install SpiNNFrontEndCommon https://github.com/SpiNNakerManchester/SpiNNFrontEndCommon.git
62-
check_or_install SpiNNakerGraphFrontEnd https://github.com/SpiNNakerManchester/SpiNNakerGraphFrontEnd.git
63-
check_or_install sPyNNaker https://github.com/SpiNNakerManchester/sPyNNaker.git
64-
check_or_install sPyNNakerExternalDevicesPlugin https://github.com/SpiNNakerManchester/sPyNNakerExternalDevicesPlugin.git
65-
check_or_install sPyNNakerExtraModelsPlugin https://github.com/SpiNNakerManchester/sPyNNakerExtraModelsPlugin.git
6672
check_or_install sPyNNakerVisualisers https://github.com/SpiNNakerManchester/sPyNNakerVisualisers.git
6773
check_or_install IntroLab https://github.com/SpiNNakerManchester/IntroLab.git
6874
check_or_install spalloc https://github.com/SpiNNakerManchester/spalloc.git
6975

7076
case $1 in
71-
*7 )g
72-
install_seven
73-
echo "Please insure your locally install PyNN is version 7"
74-
break;;
7577
*8 )
7678
install_eight
77-
echo "Please insure your locally install PyNN is version 8"
78-
break ;;
79+
echo "Please ensure your locally installed PyNN is version 8"
80+
;;
81+
gfe )
82+
install_gfe
83+
;;
7984
man )
80-
install_seven
8185
install_eight
86+
install_gfe
8287
check_or_install IntegrationTester https://github.com/SpiNNakerManchester/IntegrationTester.git
8388
check_or_install sphinx7 https://github.com/SpiNNakerManchester/sphinx7.git
8489
check_or_install sphinx8 https://github.com/SpiNNakerManchester/sphinx8.git ;
8590
check_or_install SupportScripts https://github.com/SpiNNakerManchester/SupportScripts.git
8691
check_or_install spalloc_server https://github.com/SpiNNakerManchester/spalloc_server.git
8792
check_or_install SpiNNakerManchester.github.io https://github.com/SpiNNakerManchester/SpiNNakerManchester.github.io.git
8893
check_or_install lab_answers https://github.com/SpiNNakerManchester/lab_answers.git
89-
echo "Warning you will need to use virtual machines or reinstall PyNN each time you switch Pynn version"
90-
break ;;
94+
echo "Warning you will need to use virtual machines or reinstall PyNN each time you switch PyNN version"
95+
;;
9196
all )
92-
install_seven
9397
install_eight
94-
echo "Warning you will need to use virtual machines or reinstall PyNN each time you switch Pynn version"
95-
break;;
96-
* ) echo "Please specifiy if you wish to install for PyNN7, PyNN8, or All. ";
98+
install_gfe
99+
echo "Warning you will need to use virtual machines or reinstall PyNN each time you switch PyNN version"
100+
;;
101+
* ) echo "Please specifiy if you wish to install for PyNN8, gfe or all:";
97102
exit;;
98103
esac
99-
100-

setup.sh

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
# This script assumes it is run from the directory holding all github projects in parellel
2-
# sh SupportScripts/settip.sh a_branch_name
1+
# This script assumes it is run from the directory holding all github projects in parallel
2+
# bash SupportScripts/setup.sh a_branch_name
33

4-
do_setup(){
5-
cd $1 || exit $?
6-
python setup.py develop --no-deps || exit $1
7-
cd ..
4+
do_setup() {
5+
if [ -d $1 ]; then
6+
cd $1
7+
if [ -z "$VIRTUAL_ENV" ] && [ -z "$CONDA_PREFIX" ]; && [ -z "$ASROOT" ]; then
8+
python setup.py develop --user || exit $1
9+
else
10+
python setup.py develop || exit $1
11+
fi
12+
cd ..
13+
echo "Finished setup of $1"
14+
fi
815
}
916

1017
do_setup SpiNNUtils
@@ -15,9 +22,7 @@ do_setup PACMAN
1522
do_setup DataSpecification
1623
do_setup spalloc
1724
do_setup SpiNNFrontEndCommon
25+
do_setup SpiNNakerGraphFrontEnd
1826
do_setup sPyNNaker
19-
# do_setup sPyNNaker7
2027
do_setup sPyNNaker8
21-
do_setup sPyNNaker8NewModelTemplate
2228
do_setup sPyNNakerVisualisers
23-

setup_install.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
# This script assumes it is run from the directory holding all github projects in parellel
2-
# sh SupportScripts/settip.sh a_branch_name
1+
# This script assumes it is run from the directory holding all github projects in parallel
2+
# bash SupportScripts/setup_install.sh a_branch_name
33

4-
do_setup(){
5-
cd $1 || exit $?
6-
python setup.py install || exit $1
7-
cd ..
4+
do_setup() {
5+
if [ -d $1 ]; then
6+
cd $1
7+
if [ -z "$VIRTUAL_ENV" ] && [ -z "$CONDA_PREFIX" ]; && [ -z "$ASROOT" ]; then
8+
python setup.py install --user || exit $1
9+
else
10+
python setup.py install || exit $1
11+
fi
12+
cd ..
13+
echo "Finished setup of $1"
14+
fi
815
}
916

1017
do_setup SpiNNUtils
@@ -15,7 +22,7 @@ do_setup PACMAN
1522
do_setup DataSpecification
1623
do_setup spalloc
1724
do_setup SpiNNFrontEndCommon
25+
do_setup SpiNNakerGraphFrontEnd
1826
do_setup sPyNNaker
19-
do_setup sPyNNaker7
2027
do_setup sPyNNaker8
2128
do_setup sPyNNakerVisualisers

setup_sudo.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
# This script assumes it is run from the directory holding all github projects in parellel
2-
# sh SupportScripts/settip.sh a_branch_name
1+
# This script assumes it is run from the directory holding all github projects in parallel
2+
# bash SupportScripts/setup_sudo.sh a_branch_name
33

4-
do_setup(){
5-
cd $1 || exit $?
6-
sudo python setup.py develop --no-deps --user || exit $1
7-
cd ..
4+
do_setup() {
5+
if [ -d $1 ]; then
6+
cd $1
7+
sudo python setup.py develop || exit $1
8+
cd ..
9+
echo "Finished setup of $1"
10+
fi
811
}
912

1013
do_setup SpiNNUtils
@@ -13,8 +16,9 @@ do_setup SpiNNStorageHandlers
1316
do_setup SpiNNMan
1417
do_setup PACMAN
1518
do_setup DataSpecification
19+
do_setup spalloc
1620
do_setup SpiNNFrontEndCommon
21+
do_setup SpiNNakerGraphFrontEnd
1722
do_setup sPyNNaker
18-
do_setup sPyNNaker7
1923
do_setup sPyNNaker8
20-
do_setup sPyNNakerVisualisers
24+
do_setup sPyNNakerVisualisers

0 commit comments

Comments
 (0)