comparison scripts/build_pd_heavy.sh @ 295:e63d35c6ae96 prerelease

Defaulting to gcc compiler (see #1695), updates to build_pd_heavy to make it compile with the new Makefile
author Giulio Moro <giuliomoro@yahoo.it>
date Wed, 25 May 2016 00:18:37 +0100
parents 64e288a3d881
children 9a2a5f14b587
comparison
equal deleted inserted replaced
293:9e5156589124 295:e63d35c6ae96
13 pdpath="" 13 pdpath=""
14 WATCH="0" 14 WATCH="0"
15 FORCE="0" 15 FORCE="0"
16 #make sure the paths have the trailing / . 16 #make sure the paths have the trailing / .
17 projectpath="../projects/heavy/hvtemp/" 17 projectpath="../projects/heavy/hvtemp/"
18 BBB_PATH="~/BeagleRT/" 18 [ -z "$BBB_ADDRESS" ] && BBB_ADDRESS="root@192.168.7.2"
19 BBB_ADDRESS="root@192.168.7.2" 19 [ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/BeagleRT/"
20 [ -z "$BBB_PROJECT_HOME" ] && BBB_PROJECT_HOME="${BBB_BELA_HOME}/projects/"
21 BBB_DEFAULT_PROJECT_NAME="heavyProject"
22 [ -z "$BBB_PROJECT_NAME" ] && BBB_PROJECT_NAME=$BBB_DEFAULT_PROJECT_NAME
20 COMMAND_ARGS= 23 COMMAND_ARGS=
21 RUN_PROJECT=1 24 RUN_PROJECT=1
22 RUN_IN_FOREGROUND=0 25 RUN_IN_FOREGROUND=0
23 RUN_WITHOUT_SCREEN=1 26 RUN_WITHOUT_SCREEN=1
24 BELA_PYTHON27= 27 BELA_PYTHON27=
54 } 57 }
55 58
56 while [ "$1" != "" ]; do 59 while [ "$1" != "" ]; do
57 case $1 in 60 case $1 in
58 -b | --bbb ) shift 61 -b | --bbb ) shift
59 BBB_PATH=$1 62 BBB_BELA_HOME=$1
60 ;; 63 ;;
61 -f | --force) FORCE="1" 64 -f | --force) FORCE="1"
62 ;; 65 ;;
63 -i | --input ) shift 66 -i | --input ) shift
64 pdpath=$1 67 pdpath=$1
143 146
144 cp "hvresources/HvUtils.h" $projectpath/; 147 cp "hvresources/HvUtils.h" $projectpath/;
145 148
146 echo "updating files on board..." 149 echo "updating files on board..."
147 150
148 rsync -c -rv --exclude 'HvContext*' "$projectpath"/ "$BBB_ADDRESS":"$BBB_PATH"/source; 151 BBB_PROJECT_FOLDER=$BBB_PROJECT_HOME"/"$BBB_PROJECT_NAME #make sure there is no trailing slash here
149 # rsync -c -rv "$projectpath"/ "$BBB_ADDRESS":"$BBB_PATH"/source; 152 BBB_NETWORK_TARGET_FOLDER=$BBB_ADDRESS:$BBB_PROJECT_FOLDER
153 rsync -c -rv --exclude 'HvContext*' "$projectpath"/ "$BBB_NETWORK_TARGET_FOLDER";
154 # rsync -c -rv "$projectpath"/ "$BBB_ADDRESS":"$BBB_BELA_HOME"/source;
150 155
151 # for whatever reason these big files used to hang when transferring with rsync 156 # for whatever reason these big files used to hang when transferring with rsync
152 scp "$projectpath"/HvContext* "$BBB_ADDRESS":"$BBB_PATH"/source; 157 scp "$projectpath"/HvContext* $BBB_NETWORK_TARGET_FOLDER
153 158
154 if [ $? -ne 0 ]; then 159 if [ $? -ne 0 ]; then
155 echo ""; 160 echo "";
156 echo ":( :( :( ERROR: while synchronizing files with the BBB. Is the board connected and the correct SD card inserted? :( :( :("; 161 echo ":( :( :( ERROR: while synchronizing files with the BBB. Is the board connected and the correct SD card inserted? :( :( :(";
157 echo ""; 162 echo "";
158 exit 1; 163 exit 1;
159 fi; 164 fi;
160 # exit 165 # exit
161 #produce a list of files which content has changed (not just the date) 166 #produce a list of files which content has changed (not just the date)
162 #TODO: could be made faster (perhaps) by backing up the folder locally instead of bbb 167 #TODO: could be made faster (perhaps) by backing up the folder locally instead of bbb
163 # UPDATED_FILES=`rsync -naic --log-format="%f" "$projectpath" "$BBB_PATH"/source | grep -v "\.$"` 168 # UPDATED_FILES=`rsync -naic --log-format="%f" "$projectpath" "$BBB_BELA_HOME"/source | grep -v "\.$"`
164 # echo "UPDATEDFILES : $UPDATED_FILES" 169 # echo "UPDATEDFILES : $UPDATED_FILES"
165 # exit 2 170 # exit 2
166 # remove old executable and heavy context .o/.d files 171 # remove old executable and heavy context .o/.d files
167 ssh $BBB_ADDRESS "rm -rf $BBB_PATH/BeagleRT $BBB_PATH/build/source/HvContext_bbb.d $BBB_PATH/build/source/HvContext_bbb.o $BBB_PATH/build/source/render.o $BBB_PATH/build/source/render.d"; 172 ssh $BBB_ADDRESS "rm -rf "$BBB_PROJECT_FOLDER/$BBB_PROJECT_NAME;
168 SCREEN_NAME=BeagleRT 173 SCREEN_NAME=BeagleRT
169 KILL_RUNNING_PROCESS="bash -c 'kill -s 2 \`pidof BeagleRT\` 2>/dev/null; screen -r $SCREEN_NAME -X quit 2>/dev/null; sleep 0.5; exit 0'" #always returns true 174 KILL_RUNNING_PROCESS="bash -c 'kill -s 2 \`pidof BeagleRT\` 2>/dev/null; screen -r $SCREEN_NAME -X quit 2>/dev/null; sleep 0.5; exit 0'" #always returns true
170 # Make new BeagleRT executable and run 175 # Make new BeagleRT executable and run
171 # It does not look very nice that we type the same things over and over 176 # It does not look very nice that we type the same things over and over
172 # but that is because each line is an ssh session in its own right 177 # but that is because each line is an ssh session in its own right
173 if [ $RUN_PROJECT -eq 0 ] 178 if [ $RUN_PROJECT -eq 0 ]
174 then 179 then
175 echo "Building project..." 180 echo "Building project..."
176 ssh $BBB_ADDRESS "make all -C $BBB_PATH" 181 ssh $BBB_ADDRESS "make all -C $BBB_BELA_HOME PROJECT=$BBB_PROJECT_NAME"
177 else 182 else
178 echo "Building and running project..." 183 echo "Building and running project..."
179 if [ $RUN_WITHOUT_SCREEN -eq 1 ] 184 if [ $RUN_WITHOUT_SCREEN -eq 1 ]
180 then 185 then
181 ssh -t $BBB_ADDRESS "make all -C $BBB_PATH && $KILL_RUNNING_PROCESS && $BBB_PATH/BeagleRT $COMMAND_ARGS" 186 ssh -t $BBB_ADDRESS "make all -C $BBB_BELA_HOME PROJECT=$BBB_PROJECT_NAME && $KILL_RUNNING_PROCESS && $BBB_PROJECT_FOLDER/$BBB_PROJECT_NAME $COMMAND_ARGS"
182 elif [ $RUN_IN_FOREGROUND -eq 1 ] 187 elif [ $RUN_IN_FOREGROUND -eq 1 ]
183 then 188 then
184 # Run in screen without detaching 189 # Run in screen without detaching
185 ssh -t $BBB_ADDRESS "make all -C $BBB_PATH && $KILL_RUNNING_PROCESS && screen -S $SCREEN_NAME $BBB_PATH/BeagleRT $COMMAND_ARGS" 190 ssh -t $BBB_ADDRESS "make all -C $BBB_BELA_HOME PROJECT=$BBB_PROJECT_NAME&& $KILL_RUNNING_PROCESS && screen -S $SCREEN_NAME $BBB_PROJECT_FOLDER/$BBB_PROJECT_NAME $COMMAND_ARGS"
186 else 191 else
187 # Run in screen and detach 192 # Run in screen and detach
188 ssh $BBB_ADDRESS "make all -C $BBB_PATH && $KILL_RUNNING_PROCESS && screen -dmS $SCREEN_NAME $BBB_PATH/BeagleRT $COMMAND_ARGS" 193 ssh $BBB_ADDRESS "make all -C $BBB_BELA_HOME PROJECT=$BBB_PROJECT_NAME && $KILL_RUNNING_PROCESS && screen -dmS $SCREEN_NAME $BBB_PROJECT_FOLDER/$BBB_PROJECT_NAME $COMMAND_ARGS"
194
189 fi 195 fi
190 fi 196 fi
191 } #checkUploadBuildRun 197 } #checkUploadBuildRun
192 198
193 checkUploadBuildRun 199 checkUploadBuildRun