-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_linux.sh
71 lines (58 loc) · 1.51 KB
/
build_linux.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
69
70
71
#!/bin/bash
# TALIB_C_VER=0.6.2
# TALIB_PY_VER=0.5.2
CMAKE_GENERATOR="Unix Makefiles"
CMAKE_BUILD_TYPE=Release
CMAKE_CONFIGURATION_TYPES=Release
# Download TA-Lib C Library
curl -L -o talib-c.zip https://github.com/TA-Lib/ta-lib/archive/refs/tags/v${TALIB_C_VER}.zip
if [ $? -ne 0 ]; then
echo "Failed to download TA-Lib C library"
exit 1
fi
# Download TA-Lib Python
curl -L -o talib-python.zip https://github.com/TA-Lib/ta-lib-python/archive/refs/tags/TA_Lib-${TALIB_PY_VER}.zip
if [ $? -ne 0 ]; then
echo "Failed to download TA-Lib Python library"
exit 1
fi
# Unzip TA-Lib C
unzip -q talib-c.zip
if [ $? -ne 0 ]; then
echo "Failed to extract TA-Lib C library"
exit 1
fi
# Unzip TA-Lib Python
unzip -q talib-python.zip -d ta-lib-python
if [ $? -ne 0 ]; then
echo "Failed to extract TA-Lib Python library"
exit 1
fi
mv ta-lib-python/ta-lib-python-TA_Lib-${TALIB_PY_VER}/* .
rm -r ta-lib-python
# cd to TA-Lib C
cd ta-lib-${TALIB_C_VER}
# Copy TA-Lib C headers to TA-Lib Python
mkdir -p include/ta-lib/
cp include/*.h include/ta-lib/
# Create build directory
mkdir -p _build
cd _build
# Use CMake to configure the build
cmake -G "$CMAKE_GENERATOR" -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DCMAKE_INSTALL_PREFIX=../../ta-lib-install ..
if [ $? -ne 0 ]; then
echo "CMake configuration failed"
exit 1
fi
# Compile TA-Lib
make
if [ $? -ne 0 ]; then
echo "Build failed"
exit 1
fi
make install
if [ $? -ne 0 ]; then
echo "Install failed"
exit 1
fi
echo "TA-Lib build completed successfully!"