-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnvccWmakeAll
executable file
·66 lines (47 loc) · 1.61 KB
/
nvccWmakeAll
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
#!/bin/sh
#this is a compilation script to make the shared object for the cuda solver
# run with ./nvccWmakeAll <arch> > make.log 2>&1
compileCufflink ()
{
myArch=$1
#remove existing libraries that were previously compiled
rm $FOAM_LIBBIN/libCuspSolvers.so $FOAM_LIBBIN/libCufflink.so
#change to the solver directory to compile the cufflink solvers
cd lduMatrix/solvers
#clean the OpenFOAM solvers
wclean
#remove the include directory
rm -r lnInclude
# a newer, much shorter compilation command that has faster compilation time
nvcc --shared -o $FOAM_LIBBIN/libCuspSolvers.so cufflink.cu -I$MPI_HOME/include -L$MPI_HOME/lib -lmpi -lmpi_cxx -lpthread --compiler-options -fPIC -arch $myArch
#make the libcufflink.so shared object
wmake libso
#change the test directory
cd ../../cufflinkTest/testCufflinkFoam
#make the solver for the test cases
wmake
return 0
}
if [ $# -lt 1 ]
then
echo Incorrect number of arguments
echo "Usage: $0 <arch argument>"
echo "where <arch argument> is sm_10 for single precision, sm_13 for double precision, or sm_20 for double precision Fermi architecture"
exit 1
fi
if [ "$1" = sm_10 ]
then
echo Compiling parallel and serial cufflink with single precision with $1
compileCufflink $1
elif [ "$1" = sm_13 ]
then
echo Compiling parallel and serial cufflink with double precision with $1
compileCufflink $1
elif [ "$1" = sm_20 ]
then
echo Compiling parallel and serial cufflink with double precision for Fermi architecture with $1
compileCufflink $1
else
echo "invalid architecture choice"
fi
# ----------------------------------------------------------------- end-of-file