-
Notifications
You must be signed in to change notification settings - Fork 1
/
bdapp
executable file
·140 lines (110 loc) · 3.86 KB
/
bdapp
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
export comp=pgfortran
#Create the directory for the applications
if [ ! -d $WORKSPACE/applications ];then
mkdir $WORKSPACE/applications
fi
cd $WORKSPACE/applications
#assign the extention of libs
#for linux, the extension is "a"; for windows, it is "lib"
OSVER=$(cat /proc/version | head -c 5)
if [ "$OSVER" = "CYGWI" ]; then
cudaxx=cuda8.0
cudacc=cc2x
export LIB_EXT=lib
# the external lib dependence
export dependlibname="curand"
fi
if [ "$OSVER" = "Linux" ]; then
cudaxx=cuda8.0
cudacc=cc3x
export LIB_EXT=a
# the external lib dependence
export dependlibname=""
fi
if [ "$CUDAV" != "" ]; then
cudaxx='cuda'$CUDAV
fi
if [ "$CUDAC" != "" ]; then
cudacc='cc'$CUDAC
fi
# the libs created by MSMPSCU
export libnames="MiniUtilities RandGenerators CudaRanGeneratorC2F LBFGS MATH_LBFGSB MATH90A"
export msmcomlibnames="CommonGPU Common"
# the libs created by MDPSCU
export mdlibnames="CommonGPU Common"
export potlibnames="EAM_NIST \
EM_TB_WangJun_W-HE_2010 \
EM_TB_Ackland_Vitek_PRB41_10324 \
EM_TB_AWB_Phil_Mag_A71_1995_553 \
EM_TB_Cleri_Rosato_PRB48_22 \
EAM_WW_Marinica_JPCM25_2013 \
EAM_WHeH_Bonny_JPCM26_2014 \
EAM_Zr_Mendelev_Phil_Mag_L87_2007 \
EM_TB_WangJun_Ti-HE_2007"
export ltempctlibnames="LocalTempCtrlMeths"
export boostmethslibnames="BoostMeths"
export utilibnames="Analysis Appshell Embedment Deposition"
# the libs created by MCPSCU
export mclibnames="RandWalk"
if [ $# -lt 1 ]; then
echo "Usage: bdapp [-option] projectname"
echo "Options: "
echo " -d degug version"
echo " -r(default) release version"
echo " -dc clear degug version"
echo " -rc clear release version"
fi
#---- for clean
if [ "$1" = "-dc" ]; then
export ConfigName="Debug";
export OBJNAME="$2"
make clean -f $MSMPSCUSOR/makeapp.mk
fi
if [ "$1" = "-rc" ]; then
export ConfigName="Release";
export OBJNAME="$2"
make clean -f $MSMPSCUSOR/makeapp.mk
fi
#---- for compile
#--- for debug version
if [ "$1" = "-d" ]; then
shift
export ConfigName="Debug";
# for debug version, we need to create a Debug subdirectory
if [ ! -d $WORKSPACE/applications/Debug ];then
mkdir $WORKSPACE/applications/Debug
fi
# set the OS dependent compiling config
# the compling option for CYGWI
if [ "$OSVER" = "CYGWI" ]; then
export oflags="-g -Mcuda=$cudaxx,$cudacc,nodebug -D WIN_FILE -D NODEVRAN ";
fi
# the compling option for Linux
if [ "$OSVER" = "Linux" ]; then
export oflags="-g -Mcuda=$cudaxx,$cudacc,nollvm,nodebug";
fi
echo "Debug version to be created"
echo "with comipling option: "$oflags
export OBJNAME="$*"
make -f $MSMPSCUSOR/makeapp.mk
else
#--- for release version
if [ "$1" = "-r" ]; then
shift
fi
export ConfigName="Release"
# the compling option for CYGWI
if [ "$OSVER" = "CYGWI" ]; then
export oflags="-fast -D WIN_FILE -D NODEVRAN -Mvect=sse,simd -Minform=warn -Minfo=all -Mcuda=fastmath,$cudaxx,$cudacc";
fi
# the compling option for Linux
if [ "$OSVER" = "Linux" ]; then
export oflags="-fast -tp sandybridge-64 -Mvect=sse,simd -Minform=warn -Minfo=all -Mcuda=fastmath,$cudaxx,$cudacc,nollvm";
fi
echo "Release version to be created"
echo "with comipling option: "$oflags
export OBJNAME="$1"
shift
export EXOBJS="$*"
make -f $MSMPSCUSOR/makeapp.mk
fi