-
Notifications
You must be signed in to change notification settings - Fork 1
167 lines (141 loc) · 6.21 KB
/
build.yaml
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: Build
permissions:
contents: read
on: [push]
jobs:
build-ubuntu:
runs-on: ubuntu-latest
steps:
- name: Get repo
uses: actions/checkout@v4
- name: Install Cpp build tools
run: |
sudo apt-get install build-essential checkinstall m4 g++ cmake
- name: Install GMP and MPFR
run: |
sudo apt-get install libgmp3-dev
sudo apt-get install libmpfr-dev libmpfr-doc
- name: Install Boost
run: |
mkdir -p ${{ github.workspace }}/fdml_deps/
cd ${{ github.workspace }}/fdml_deps/
wget -O boost_1_79_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.gz/download
tar xzf boost_1_79_0.tar.gz
rm boost_1_79_0.tar.gz
cd boost_1_79_0
./bootstrap.sh
./b2 --build-dir=./build --stagedir=./bin architecture=x86 address-model=64 link=static,shared --variant=debug,release --without-python
- name: Install CGAL
run: |
git clone --depth 1 --branch v5.5.3 https://github.com/CGAL/cgal.git ${{ github.workspace }}/fdml_deps/cgal
mkdir -p ${{ github.workspace }}/fdml_deps/cgal/build
cd ${{ github.workspace }}/fdml_deps/cgal/build
cmake ..
- name: Install nanobind
run: |
git clone https://github.com/wjakob/nanobind.git ${{ github.workspace }}/fdml_deps/nanobind
cd ${{ github.workspace }}/fdml_deps/nanobind
git submodule update --init
- name: Setup | Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Python dependencies
run: |
pip install -r ${{ github.workspace }}/fdmlpy/requirements.txt
- name: Build FDML with bindings
run: |
export BOOST_INCLUDEDIR=${{ github.workspace }}/fdml_deps/boost_1_79_0
export BOOST_LIBRARYDIR=${{ github.workspace }}/fdml_deps/boost_1_79_0/bin/lib
export CGAL_DIR=${{ github.workspace }}/fdml_deps/cgal/build
export nanobind_DIR=${{ github.workspace }}/fdml_deps/nanobind/
mkdir ${{ github.workspace }}/fdml_build/
cd ${{ github.workspace }}/fdml_build/
cmake -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_BUILD_TYPE=Release -DFDML_WITH_PYBINDINGS:BOOL=ON ${{ github.workspace }}
make -j
- name: Zip build artifacts
run: |
tar -czf ${{ github.workspace }}/build.tar.gz ${{ github.workspace }}/fdml_build/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-ubuntu
path: ${{ github.workspace }}/build.tar.gz
build-windows:
runs-on: windows-latest
steps:
- name: Get repo
uses: actions/checkout@v4
- name: Create dependencies dir
run: |
mkdir ${{ github.workspace }}\fdml_deps\
- name: Install GMP and MPFR (download)
uses: suisei-cn/[email protected]
id: gmp_mpfr_zip_download
with:
url: "https://github.com/CGAL/cgal/releases/download/v5.4/CGAL-5.4-win64-auxiliary-libraries-gmp-mpfr.zip"
target: ${{ github.workspace }}\fdml_deps\
- name: Install GMP and MPFR (extract)
run: |
cd ${{ github.workspace }}\fdml_deps\
mv CGAL-5.4-win64-auxiliary-libraries-gmp-mpfr.zip gmp-mpfr.zip
Expand-Archive -LiteralPath gmp-mpfr.zip -DestinationPath gmp_mpfr_parent
rm gmp-mpfr.zip
mv gmp_mpfr_parent\auxiliary\gmp gmp_mpfr
rmdir gmp_mpfr_parent\auxiliary
rmdir gmp_mpfr_parent
- name: Install Boost (download)
uses: suisei-cn/[email protected]
id: boost_zip_download
with:
url: "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.zip"
target: ${{ github.workspace }}\fdml_deps\
- name: Install Boost (extract and build)
run: |
cd ${{ github.workspace }}\fdml_deps\
Expand-Archive -LiteralPath boost_1_79_0.zip -DestinationPath boost_1_79_0
rm boost_1_79_0.zip
mv boost_1_79_0 boost_1_79_0_parent
mv boost_1_79_0_parent\boost_1_79_0 boost_1_79_0
rmdir boost_1_79_0_parent
cd boost_1_79_0
.\bootstrap.bat
.\b2 --build-dir=.\build --stagedir=.\bin architecture=x86 address-model=64 link=static,shared runtime-link=static,shared --variant=debug,release --without-python
- name: Install CGAL
run: |
git clone --depth 1 --branch v5.5.3 https://github.com/CGAL/cgal.git ${{ github.workspace }}\fdml_deps\cgal
mkdir ${{ github.workspace }}\fdml_deps\cgal\build
cd ${{ github.workspace }}\fdml_deps\cgal\build
cmake ..
- name: Install nanobind
run: |
git clone https://github.com/wjakob/nanobind.git ${{ github.workspace }}\fdml_deps\nanobind
cd ${{ github.workspace }}\fdml_deps\nanobind
git submodule update --init
- name: Setup | Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Python dependencies
run: |
python3 -m pip install -r ${{ github.workspace }}\fdmlpy\requirements.txt
- name: Build FDML with bindings
run: |
$env:GMP_DIR="${{ github.workspace }}\fdml_deps\gmp_mpfr"
$env:MPFR_DIR="${{ github.workspace }}\fdml_deps\gmp_mpfr"
$env:BOOST_INCLUDEDIR="${{ github.workspace }}\fdml_deps\boost_1_79_0"
$env:BOOST_LIBRARYDIR="${{ github.workspace }}\fdml_deps\boost_1_79_0\bin\lib"
$env:CGAL_DIR="${{ github.workspace }}\fdml_deps\cgal\build"
$env:nanobind_DIR="${{ github.workspace }}\fdml_deps\nanobind"
mkdir ${{ github.workspace }}\fdml_build\
cd ${{ github.workspace }}\fdml_build\
cmake -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_BUILD_TYPE=Release -DFDML_WITH_PYBINDINGS:BOOL=ON ${{ github.workspace }}
cmake --build . -j
- name: Zip build artifacts
run: |
Compress-Archive -Path ${{ github.workspace }}\fdml_build\ -DestinationPath ${{ github.workspace }}\build.zip
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-windows
path: ${{ github.workspace }}\build.zip