-
Notifications
You must be signed in to change notification settings - Fork 5
/
build-cmake
executable file
·51 lines (41 loc) · 1.07 KB
/
build-cmake
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
#!/bin/bash
if ! type -p cmake >& /dev/null
then
echo "CMake not available."
exit 1
fi
top_dir="$(cd $(dirname ${BASH_SOURCE[0]}) >&/dev/null && pwd)"
cmake_dir_kokkos=$top_dir/.cmake-kokkos
if [ -z ${WC_GEN_KK_BUILD} ] ; then
build_dir_kokkos=$top_dir/build/kokkos
else
build_dir_kokkos=${WC_GEN_KK_BUILD}
fi
mkdir -p $build_dir_kokkos
#src_rn_dir=$cmake_dir_kokkos/src
#mkdir -p $src_rn_dir
#cd $top_dir/src
#cp *.cxx ${src_rn_dir}
#for file in *.kokkos
#do
# cp $file ${src_rn_dir}/$(basename "$file" .kokkos).kokkos.cxx
#done
build_cmds="$@"
echo
echo "======================="
echo "Building CXX components"
echo "======================="
echo
#cd $build_dir_cxx
#[ ! -f Makefile ] && \
# (cmake $cmake_dir_cxx -DCMAKE_CXX_EXTENSIONS=Off || exit 2)
#make $build_cmds || exit 3
echo
echo "=========================="
echo "Building Kokkos components"
echo "=========================="
echo
cd $build_dir_kokkos
[ ! -f Makefile ] && \
(cmake $cmake_dir_kokkos -DCMAKE_CXX_EXTENSIONS=Off -DCMAKE_CXX_COMPILER=$(type -p nvcc_wrapper) || exit 4)
make $build_cmds || exit 5