-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgenerator.sh
More file actions
executable file
·111 lines (99 loc) · 2.47 KB
/
generator.sh
File metadata and controls
executable file
·111 lines (99 loc) · 2.47 KB
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
111
#!/bin/bash
function setup
{
# Define here the installation path for your platform
echo "============================= Platform identification ============================="
case "$HOSTNAME" in
Arcteryx) echo "$HOSTNAME is registered. Compiling with specific parameters."
install_path="$PWD/install"
options="-Ddebug=ON -Doptimize=OFF -Dtransport_mpi=ON"
echo -n "MPI library [openmpi]/mpich : "
read a
case "$a" in
mpich) echo "Compiling with using MPICH transport link"
mpi_path_overide="/home/amxx/Work/Argonne/Libs/mpich-3.1.3/install/"
;;
*) echo "Compiling with using OPENMPI transport link"
;;
esac
;;
*) echo "Your platform is not defined in $0."
install_path="$PWD/install"
options="-Ddebug=OFF -Doptimize=OFF -Dtransport_mpi=ON"
echo -n "Path MPI library [default]/path : "
read mpi_path_overide
;;
esac
# Setting links to executables
if [ -n "$mpi_path_overide" ];
then
export PATH=$mpi_path_overide/bin:$PATH
export LD_LIBRARY_PATH=$mpi_path_overide/lib:$LD_LIBRARY_PATH
fi
mpi_c=`which mpicxx`
mpi_r=`which mpiexec`
# Summary
echo "============================== Configuration summary =============================="
echo "MPI compiler : $mpi_c"
echo "MPI runner : $mpi_r"
echo "Options $options"
echo "==================================================================================="
}
function build
{
setup &&
mkdir -p build &&
cd build &&
cmake -DCMAKE_CXX_COMPILER=$mpi_c \
-DCMAKE_INSTALL_PREFIX:PATH=$install_path \
$options \
.. &&
# make install &&
make &&
cd ..
}
function launch
{
echo "================================ RUNNING EXAMPLES ================================="
echo "command : $mpi_r -n 10 build/examples/direct"
$mpi_r -n 10 build/examples/direct
}
function remove
{
rm -rfv $1
}
function help
{
echo "Project generator"
echo "Options are:"
echo " -h, --help show brief help"
echo " -b, --build build the project"
echo " -c, --clean clean the project"
echo " --clear clear the project (remove binaries)"
}
############################################
# MAIN #
############################################
if test $# -gt 0; then
case "$1" in
-h|--help)
help
exit 0
;;
-b|--build)
build
exit 0
;;
-c|--clean)
remove "build"
exit 0
;;
*)
echo "invalid option -- '$1'"
help
exit 0
;;
esac
fi
build && launch
#help