-
Notifications
You must be signed in to change notification settings - Fork 2
/
build_maca_analyse_wrapper.sh
56 lines (45 loc) · 1.47 KB
/
build_maca_analyse_wrapper.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
#!/usr/bin/env bash
#TODO: Use CMake to build wrappers
swig -python -c++ maca_analyse.i
g++ -O2 -fPIC -c $(pkg-config --cflags --libs python3) maca_analyse.cpp maca_analyse_wrap.cxx
LIB_Boost=$(ldconfig -p | grep libboost_program_options.so$ | awk '{print $4}')
LIB_Icuuc=$(ldconfig -p | grep libicuuc.so$ | awk '{print $4}')
LIB_PwrUtils=$(ldconfig -p | grep libpwrutils.so$ | awk '{print $4}')
LIB_Toki=$(ldconfig -p | grep libtoki.so$ | awk '{print $4}')
LIB_Corpus2=$(ldconfig -p | grep libcorpus2.so$ | awk '{print $4}')
LIB_Maca=$(ldconfig -p | grep libmaca.so$ | awk '{print $4}')
if [ -z $LIB_Boost ];
then
echo 'Boost library has not been found!'
exit 1
fi
if [ -z $LIB_Icuuc ];
then
echo 'Icuuc library has not been found!'
exit 1
fi
if [ -z $LIB_PwrUtils ];
then
echo 'Pwr_Utils library has not been found!'
exit 1
fi
if [ -z $LIB_Toki ];
then
echo 'Toki library has not been found!'
exit 1
fi
if [ -z $LIB_Corpus2 ];
then
echo 'Corpus2 library has not been found!'
exit 1
fi
if [ -z $LIB_Maca ];
then
echo 'Maca library has not been found!'
exit 1
fi
LIBS=$( echo $LIB_Boost $LIB_Icuuc $LIB_PwrUtils $LIB_Toki $LIB_Corpus2 $LIB_Maca )
g++ -O2 -shared -o _maca_analyse.so maca_analyse.o maca_analyse_wrap.o $LIBS
Python_Path=$(python3 -c "import sys; print('/usr/local/lib/python' + sys.version[:3] + '/dist-packages/')")
cp _maca_analyse.so ${Python_Path}
cp maca_analyse.py ${Python_Path}