Skip to content

Commit 5fb6f96

Browse files
committed
A lot of changes to build and packaging scripts. Fixes #210 (finalizes).
1 parent 30c5fcc commit 5fb6f96

File tree

14 files changed

+202
-234
lines changed

14 files changed

+202
-234
lines changed

devtools/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Tools used by ADDA developers for building, testing, and packaging of ADDA:
2+
* `build` - script to build ADDA with various flags and optionally copy the obtained executables
3+
* `build_degug` - compiles ADDA (in debug mode) with various compilation flags
4+
* `build_misc` - builds misc tools and optionally copies (installs) the obtained executables
5+
* `commit_docs` - script to commit `docs/` and `src/const.h` for release
6+
* `release_sequence.txt` - sequence of tasks to be made during release
7+
* `svg_images.txt` - typical workflow (guidelines) for producing `.svg` images
8+
* `test_new` - simple wrapper to build and test ADDA
9+
* `versions.txt` - note on files that need to be checked prior to release (e.g. contain version number)
10+
* `win_all.sh` - script to perform all Windows-specific tasks during release
11+
* `win_commit.sh` - script to run a sample simulation and commit `sample/` and `win64/`
12+
* `zip_packages` - script to export (archive) source and binary packages for a given version
13+
14+

devtools/build

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
2+
# Builds several versions of ADDA and optionally copies (installs) the obtained executables
23
# First optional parameter is compilation modes: seq, mpi, ocl, spa, any combination of them (separated by space in
34
# quotes, implies cross modes), or all (default). 'spa' is sparse and requires combination with something.
45
# Second optional parameter is destination path to copy executables (otherwise, they are left in compilation folders)
6+
# Compilation is performed silently with (-s flag)
57
#
68
# Copyright (C) ADDA contributors
79
# GNU General Public License version 3
@@ -11,7 +13,7 @@ MODES=${1:-all}
1113
DEST=""
1214
if [ -n "$2" ]; then
1315
if [ -d "$2" ]; then
14-
DEST=`cd "$2"; pwd`
16+
DEST="`cd "$2"; pwd`"
1517
else
1618
echo "ERROR: could not find the directory '$2'" >&2
1719
exit 1
@@ -43,7 +45,7 @@ function check_mode {
4345
}
4446
function compile_copy {
4547
# $1 is mode, $2 - name of executable, $3 - extra options
46-
if ! make $1 $3 $XFL; then
48+
if ! make -s $1 $3 $XFL; then
4749
echo "ERROR during compiling ADDA with options '$1 $3 $XFL'" >&2
4850
exit 1
4951
fi

devtools/build_debug

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
# Compiles ADDA (in debug mode) with various compilation flags - used to find compilation warnings
3+
# Compilation is performed silently with (-s flag)
4+
#
5+
# All warnings and errors go to stderr, so one may look mostly at this stream to catch failures
6+
# (i.e. redirect it to file), however it is commonly colorized by make, so should be OK as is
7+
#
8+
# Copyright (C) ADDA contributors
9+
# GNU General Public License version 3
10+
11+
function compile_debug {
12+
# $1 is mode, $2 - extra options
13+
if ! make -s $1 OPTIONS="DEBUG $2"; then
14+
echo "ERROR during compiling ADDA with options '$1 OPTIONS=\"DEBUG $2\"'" >&2
15+
exit 1
16+
fi
17+
}
18+
19+
# main code; we do not do any special cleaning, since believe that make tracks all dependences
20+
cd ./../src
21+
compile_debug all ""
22+
compile_debug all "DEBUGFULL"
23+
compile_debug all "FFT_TEMPERTON"
24+
compile_debug all "NO_FORTRAN"
25+
compile_debug all "PRECISE_TIMING"
26+
compile_debug all "USE_SSE3"
27+
28+
compile_debug seq "NOT_USE_LOCK"
29+
compile_debug seq "ONLY_LOCKFILE"
30+
compile_debug seq "OVERRIDE_STDC_TEST"
31+
compile_debug seq "NO_GITHASH"
32+
33+
compile_debug ocl "OCL_READ_SOURCE_RUNTIME"
34+
compile_debug ocl "OCL_BLAS"
35+
compile_debug ocl "CLFFT_APPLE"
36+
37+
compile_debug "seq mpi" "SPARSE"
38+
compile_debug "seq mpi" "SPARSE USE_SSE3"

devtools/build_misc

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
# Builds misc tools and optionally copies (installs) the obtained executables
3+
# The only optional parameter is destination path to copy executables (otherwise, they are left in compilation folders)
4+
# Executables of each misc package are copied into a separate directory in this path
5+
#
6+
# Copyright (C) ADDA contributors
7+
# GNU General Public License version 3
8+
9+
# process input variables
10+
MISCDIR="`pwd`/../misc"
11+
DEST="$MISCDIR"
12+
if [ -n "$1" ]; then
13+
if [ -d "$1" ]; then
14+
DEST="`cd "$1"; pwd`"
15+
else
16+
echo "ERROR: could not find the directory '$1'" >&2
17+
exit 1
18+
fi
19+
fi
20+
21+
MISCDIR="`pwd`/../misc"
22+
23+
for dir in `ls "$MISCDIR"`; do
24+
MAKEFILE="$MISCDIR/$dir/Makefile"
25+
if [ -f "$MAKEFILE" ]; then
26+
echo "Processing misc/$dir"
27+
# The following is a bit complicated. Ideally should be replaced by something like
28+
# make install
29+
dest="$DEST/$dir"
30+
if [ ! -d "$dest" ]; then
31+
mkdir "$dest"
32+
fi
33+
cd "$dest"
34+
make -f "$MAKEFILE" srcdir="$MISCDIR/$dir"
35+
if [ $? -ne 0 ]; then
36+
echo "ERROR: compilation in 'misc/$dir' failed"
37+
exit 1
38+
fi
39+
rm -f *.o
40+
fi
41+
done

devtools/commit_docs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
# Commits docs and const.h for release
3+
# Accepts exactly one argument - version number (like 1.4.0)
4+
5+
# Copyright (C) ADDA contributors
6+
# GNU General Public License version 3
7+
8+
# Test arguments
9+
if [ $# -ne 1 ]; then
10+
echo "ERROR: requires 1 argument"
11+
exit 1
12+
fi
13+
14+
git pull
15+
if [ $? -ne 0 ]; then
16+
echo "ERROR: error during git pull"
17+
exit 1
18+
fi
19+
git commit -m "Preparing file for release $1: docs and const.h" ../doc/manual.docx ../doc/manual.pdf ../doc/history ../src/const.h
20+
if [ $? -ne 0 ]; then
21+
echo "ERROR: error during commiting docs"
22+
exit 1
23+
fi

devtools/make_branch

Lines changed: 0 additions & 23 deletions
This file was deleted.

devtools/make_tag

Lines changed: 0 additions & 21 deletions
This file was deleted.

devtools/release_sequence.txt

Lines changed: 51 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,51 @@
1-
1) test the current source (standard tests)
2-
> cd ..../adda/src
3-
> make -s
4-
> cd ../tests/2exec
5-
edit comp2exec to compare against previous version
6-
> sh comp2exec seq, mpi, ocl + mpi_seq, ocl_seq
7-
8-
# extra surface tests (optional, causes a number of false positives)
9-
edit comp2exec to enable SURF_EXT
10-
> sh comp2exec seq, mpi, ocl
11-
edit comp2exec to enable SURF_STANDARD (instead of SURF_EXT) and to compare against adda, etc. in the test directory (.)
12-
> cp ../../src/seq/adda .
13-
> cp ../../src/mpi/adda_mpi .
14-
> cp ../../src/ocl/adda_ocl .
15-
> sh comp2exec seq, mpi, ocl
16-
17-
# sparse tests (first two lines are not required if done above)
18-
#> cp ../../src/seq/adda .
19-
#> cp ../../src/mpi/adda_mpi .
20-
> cd ../../src
21-
> make seq OPTIONS=SPARSE -s
22-
> cd ../tests/2exec
23-
edit comp2exec to enable SPARSE
24-
> sh comp2exec seq, mpi
25-
edit comp2exec to compare against adda and adda_mpi + enable SPARSE_STANDARD
26-
> sh comp2exec seq, mpi
27-
28-
2) make sure that manual.doc/pdf, history, and const.h are up to date. In particular, version number in const.h should
29-
not contain "a" or "b" (if not explicitly making beta release).
30-
31-
3) Update CodeDesign and corresponding schemes in doc/gv/
32-
33-
(on 64-bit Windows)
34-
4) sh win_all.sh #.#
35-
36-
(on Linux)
37-
5) ./zip_packages #.#
38-
39-
6) Upload packages to GoogleCode
40-
7) Update Wiki pages: PackageDescription, ReleaseNotes, Features
41-
8) Send announcement to users.
1+
Use some normal shell, under Windows - this can be MSYS. Then 'sh' can be omitted in the following commands.
2+
3+
1) Test for compiler warnings (about 10 min)
4+
> sh build_debug 2> log_debug
5+
6+
2) Build and test the current source (a few hours)
7+
> sh test_new 2> log_test
8+
Before running the tests, make sure that ../tests/2exec/comp2exec script is properly set up. This includes
9+
the REFPATH (when comparing against previous version) and GUIDIFF. If the latter is used, you generally do
10+
not need to redirect stdout.
11+
It is also possible to separately run build and ../tests/2exec/test_all scripts (see help inside them)
12+
13+
3) If any changes are made to the code or tests, commit them now.
14+
It is also a good idea to repeat some of the above on different systems.
15+
16+
4) make sure that manual.doc/pdf, history, and const.h are up to date. See also versions.txt
17+
- version number in const.h should not contain "alpha" or "beta" (if not explicitly making beta release).
18+
- history should contain version date of the in-progress release.
19+
- manual should have correct version (including links on the first page). Look through the whole manual
20+
(for figure placement, etc.). Update sample outputs in appendices, if needed.
21+
- use doiLink macro in Word and produce pdf (better with Actobat plugin - leads to twice smaller size).
22+
Look through the pdf once more.
23+
24+
5) Update CodeDesign and corresponding schemes in doc/gv/
25+
26+
6) Make sure that the DLLs in win64/ correspond to the latest executables (to be copied there). They can be
27+
staged for commit (including deleted older ones) - then they will be committed together with executables.
28+
29+
7) Run the following aggregate script (on Windows), inserting appropriate version number:
30+
> sh win_all.sh #.#.#
31+
You can also go through it line by line.
32+
33+
8) It is a good idea to test that the resulting executables can be run with given DLLs. For example you can run
34+
'set PATH=""' or 'export PATH=""' in a terminal before running the executables (to make other DLLs on your system
35+
unavailable).
36+
37+
9) Now you are ready to go live (check your commits):
38+
> git push --tags
39+
40+
10) Prepare binary and source packages
41+
> zip_packages #.#.#
42+
43+
11) Create release at GitHub using this tag (Release notes is a shortened version of history). Attach the above
44+
packages to it.
45+
46+
12) Update wiki page Features
47+
48+
13) Send announcement to users.
49+
50+
14) With the next commit update ignore patterns in tests/2exec/comp2exec and, possibly, testing suites to compare
51+
against the latest release

devtools/test_new

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function test_error {
2626
fi
2727
}
2828

29-
# uncomment any of the following for quicker tests
29+
# comment out any of the following for quicker tests
3030
test_error prev
3131
test_error cross
3232
test_error extra

devtools/win_all.sh

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#!/bin/bash
2-
# Master script to builds and commit Windows executables, all functionality is inside child scripts
3-
# Accepts exactly one argument - version number (like 1.0)
4-
# Should be executed on Windows 64-bit
2+
# Master script to builds and commit Windows executables, most functionality is inside child scripts
3+
# Accepts exactly one argument - version number (like 1.4.0)
4+
# Should be executed on Windows
5+
#
6+
# Copyright (C) ADDA contributors
7+
# GNU General Public License version 3
58

69
# Test arguments
710
if [ $# -ne 1 ]; then
@@ -11,33 +14,27 @@ fi
1114

1215
SHELL=/bin/bash
1316

14-
$SHELL win_build_adda.sh 64
17+
$SHELL commit_docs $1
1518
if [ $? -ne 0 ]; then
16-
echo "ERROR: error during building 64-bit ADDA"
19+
echo "ERROR: error during commiting docs"
1720
exit 1
1821
fi
19-
$SHELL win_build_adda.sh 32
22+
$SHELL build all ../win64
2023
if [ $? -ne 0 ]; then
21-
echo "ERROR: error during building 32-bit ADDA"
24+
echo "ERROR: error during building ADDA"
2225
exit 1
2326
fi
24-
$SHELL win_build_misc.sh 64
27+
$SHELL build_misc ../win64/misc
2528
if [ $? -ne 0 ]; then
26-
echo "ERROR: error during building 64-bit misc tools"
29+
echo "ERROR: error during building misc tools"
2730
exit 1
2831
fi
29-
$SHELL win_build_misc.sh 32
30-
if [ $? -ne 0 ]; then
31-
echo "ERROR: error during building 32-bit misc tools"
32-
exit 1
33-
fi
34-
3532
$SHELL win_commit.sh $1
3633
if [ $? -ne 0 ]; then
37-
echo "ERROR: error during commit"
34+
echo "ERROR: error during commit of binaries"
3835
exit 1
3936
fi
40-
$SHELL make_tag $1
37+
git tag -a v$1 -m "New release $1"
4138
if [ $? -ne 0 ]; then
4239
echo "ERROR: creating tag failed"
4340
exit 1

0 commit comments

Comments
 (0)