-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathgetdevlibs.sh
executable file
·69 lines (57 loc) · 1.88 KB
/
getdevlibs.sh
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
#!/bin/bash
if [ "${ARCH}" = "" ];then
ARCH=`arch`
fi
BIDMAT_ROOT="${BASH_SOURCE[0]}"
if [ ! `uname` = "Darwin" ]; then
BIDMAT_ROOT=`readlink -f "${BIDMAT_ROOT}"`
else
while [ -L "${BIDMAT_ROOT}" ]; do
BIDMAT_ROOT=`readlink "${BIDMAT_ROOT}"`
done
fi
BIDMAT_ROOT=`dirname "$BIDMAT_ROOT"`
pushd "${BIDMAT_ROOT}" > /dev/null
BIDMAT_ROOT=`pwd`
BIDMAT_ROOT="$( echo ${BIDMAT_ROOT} | sed s+/cygdrive/c+c:+ )"
source ${BIDMAT_ROOT}/getcudaversion.sh
devdir="dev-cuda${CUDA_VERSION}"
echo "Fetching libs from ${devdir}"
source="http://people.eecs.berkeley.edu/~jfc/biddata"
cd ${BIDMAT_ROOT}/lib
if [ `uname` = "Darwin" ]; then
subdir="osx"
suffix="dylib"
curl -o liblist.txt "${source}/lib/${devdir}/liblist_osx.txt"
elif [ "$OS" = "Windows_NT" ]; then
subdir="win"
suffix="dll"
curl -o liblist.txt "${source}/lib/${devdir}/liblist_win.txt"
else
if [[ "${ARCH}" == arm* || "${ARCH}" == aarch* ]]; then
subdir="linux_arm"
suffix="so"
curl -o liblist.txt "${source}/lib/${devdir}/liblist_linux_arm.txt"
else
subdir="linux"
suffix="so"
curl -o liblist.txt "${source}/lib/${devdir}/liblist_linux.txt"
fi
fi
curl -o exelist.txt ${source}/lib/exelist.txt
while read fname; do
echo -e "\nDownloading ${fname}"
curl --retry 2 -z ${fname} -o ${fname} "${source}/lib/${devdir}/${fname}"
chmod 755 ${fname}
done < liblist.txt
mv ${BIDMAT_ROOT}/lib/BIDMat.jar ${BIDMAT_ROOT}
rm ${BIDMAT_ROOT}/lib/BIDMach.jar
mkdir -p ${BIDMAT_ROOT}/src/main/resources/lib
rm -f ${BIDMAT_ROOT}/src/main/resources/lib/*.${suffix}
cp ${BIDMAT_ROOT}/lib/*bidmat*.${suffix} ${BIDMAT_ROOT}/src/main/resources/lib
cp ${BIDMAT_ROOT}/lib/*iomp5*.${suffix} ${BIDMAT_ROOT}/src/main/resources/lib
cd ${BIDMAT_ROOT}/src/main/resources
libs=`echo lib/*.${suffix}`
cd ${BIDMAT_ROOT}
echo "Packing native libraries in the BIDMat jar"
jar uvf BIDMat.jar $libs