Skip to content

Commit 8172a2d

Browse files
committed
chore: fix build for linux/macos
1 parent 2399f33 commit 8172a2d

File tree

3 files changed

+56
-17
lines changed

3 files changed

+56
-17
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Install GCC and CMake
4444
run: |
4545
sudo apt-get update
46-
sudo apt-get install -y gcc g++ cmake
46+
sudo apt-get install -y gcc g++ cmake automake
4747
- name: Make script executable
4848
run: chmod +x ./tools/build_wheel_linux.sh
4949
- name: Build TA-Lib
@@ -103,6 +103,7 @@ jobs:
103103
gcc
104104
g++
105105
cmake
106+
automake
106107
volumes: ${{ github.workspace }}:/project
107108
- name: Make script executable
108109
run: chmod +x ./tools/build_wheel_linux.sh
@@ -237,6 +238,10 @@ jobs:
237238
- name: Checkout repository
238239
uses: actions/checkout@v4
239240

241+
- name: install automake
242+
run: brew install automake libtool
243+
shell: bash
244+
240245
- name: Make script executable
241246
run: chmod +x ./tools/build_wheel_macos.sh
242247

@@ -287,6 +292,10 @@ jobs:
287292
- name: Checkout repository
288293
uses: actions/checkout@v4
289294

295+
- name: install automake
296+
run: brew install automake libtool
297+
shell: bash
298+
290299
- name: Make script executable
291300
run: chmod +x ./tools/build_wheel_macos.sh
292301

tools/build_wheel_linux.sh

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,30 @@ cd ta-lib-${TALIB_C_VER}
2727
mkdir -p include/ta-lib/
2828
cp include/*.h include/ta-lib/
2929

30-
# Create build directory
31-
mkdir -p _build
32-
cd _build
3330

34-
# Use CMake to configure the build
35-
cmake -G "$CMAKE_GENERATOR" -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DCMAKE_INSTALL_PREFIX=../../ta-lib-install ..
36-
if [ $? -ne 0 ]; then
37-
echo "CMake configuration failed"
38-
exit 1
31+
32+
# for version 0.4.0
33+
if [ $TALIB_C_VER == "0.4.0" ]; then
34+
bash autogen.sh
35+
# Build TA-Lib using autoconf/configure
36+
./configure --prefix=$(pwd)/../ta-lib-install
37+
if [ $? -ne 0 ]; then
38+
echo "Configure failed"
39+
exit 1
40+
fi
41+
42+
else
43+
# for version 0.6.2
44+
45+
# Create build directory
46+
mkdir -p _build
47+
cd _build
48+
# Use CMake to configure the build
49+
cmake -G "$CMAKE_GENERATOR" -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DCMAKE_INSTALL_PREFIX=../../ta-lib-install ..
50+
if [ $? -ne 0 ]; then
51+
echo "CMake configuration failed"
52+
exit 1
53+
fi
3954
fi
4055

4156
# Compile TA-Lib

tools/build_wheel_macos.sh

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,30 @@ cd ta-lib-${TALIB_C_VER}
2727
mkdir -p include/ta-lib/
2828
cp include/*.h include/ta-lib/
2929

30-
# Create build directory
31-
mkdir -p _build
32-
cd _build
3330

34-
# Use CMake to configure the build
35-
cmake -G "$CMAKE_GENERATOR" -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DCMAKE_INSTALL_PREFIX=../../ta-lib-install ..
36-
if [ $? -ne 0 ]; then
37-
echo "CMake configuration failed"
38-
exit 1
31+
32+
# for version 0.4.0
33+
if [ $TALIB_C_VER == "0.4.0" ]; then
34+
bash autogen.sh
35+
# Build TA-Lib using autoconf/configure
36+
./configure --prefix=$(pwd)/../ta-lib-install
37+
if [ $? -ne 0 ]; then
38+
echo "Configure failed"
39+
exit 1
40+
fi
41+
42+
else
43+
# for version 0.6.2
44+
45+
# Create build directory
46+
mkdir -p _build
47+
cd _build
48+
# Use CMake to configure the build
49+
cmake -G "$CMAKE_GENERATOR" -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DCMAKE_INSTALL_PREFIX=../../ta-lib-install ..
50+
if [ $? -ne 0 ]; then
51+
echo "CMake configuration failed"
52+
exit 1
53+
fi
3954
fi
4055

4156
# Compile TA-Lib

0 commit comments

Comments
 (0)