forked from Benny44/QPALM_vLADEL
-
Notifications
You must be signed in to change notification settings - Fork 4
160 lines (156 loc) · 4.75 KB
/
matlab.yml
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
name: Matlab Package
on:
workflow_dispatch:
push:
tags-ignore:
- '**'
branches:
- '**'
release:
types: ['released', 'prereleased']
jobs:
build-linux:
runs-on: ubuntu-latest
env:
HOST: 'x86_64-centos7-linux-gnu'
TOOLS_VERSION: '0.1.0-beta3'
TOOLS_URL: 'https://github.com/tttapa/cross-python/releases/download'
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up MATLAB
uses: matlab-actions/setup-matlab@5b825d0ad4205ef03dc40ba3b24cad22674e9ca3
with:
release: R2020a
- name: Download toolchain
if: steps.cache-tools.outputs.cache-hit != 'true'
run: wget "${{ env.TOOLS_URL }}/${{ env.TOOLS_VERSION }}/full-${{ env.HOST }}.tar.xz" -O- | sudo tar xJ -C /opt
- name: Configure
run: |
host="${{ env.HOST }}"
staging="/opt/$host"
cmake -B build -S QPALM \
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
-D QPALM_WITH_MEX=On \
-D CMAKE_POSITION_INDEPENDENT_CODE=On \
-D CMAKE_C_COMPILER="$staging/x-tools/$host/bin/$host-gcc" \
-D CMAKE_CXX_COMPILER="$staging/x-tools/$host/bin/$host-g++" \
-D CMAKE_Fortran_COMPILER="$staging/x-tools/$host/bin/$host-gfortran"
env:
CXXFLAGS: "-march=skylake -static-libstdc++ -static-libgcc"
LDFLAGS: "-static-libstdc++ -static-libgcc"
CFLAGS: "-march=skylake -static-libgcc"
- name: Build
run: |
cmake --build build \
--config RelWithDebInfo \
-j
- name: Install
run: |
cmake --install build \
--config RelWithDebInfo \
--component mex_interface \
--prefix staging
- name: Package
run: |
zip -r ../qpalm-matlab-linux.zip ./*
working-directory: staging
- name: Upload
uses: actions/upload-artifact@v3
with:
name: qpalm-matlab-linux
path: qpalm-matlab-linux.zip
- name: Release
if: ${{ github.event.action == 'released' || github.event.action == 'prereleased' }}
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
with:
files: qpalm-matlab-linux.zip
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up MATLAB
uses: matlab-actions/setup-matlab@5b825d0ad4205ef03dc40ba3b24cad22674e9ca3
with:
release: latest
- name: Configure
run: |
cmake -B build -S QPALM \
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
-D QPALM_WITH_MEX=On \
-D CMAKE_POSITION_INDEPENDENT_CODE=On
env:
CXXFLAGS: "-march=skylake"
CFLAGS: "-march=skylake"
- name: Build
run: |
cmake --build build \
--config RelWithDebInfo \
-j
- name: Install
run: |
cmake --install build \
--config RelWithDebInfo \
--component mex_interface \
--prefix staging
- name: Package
run: |
zip -r ../qpalm-matlab-macos.zip ./*
working-directory: staging
- name: Upload
uses: actions/upload-artifact@v3
with:
name: qpalm-matlab-macos
path: qpalm-matlab-macos.zip
- name: Release
if: ${{ github.event.action == 'released' || github.event.action == 'prereleased' }}
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
with:
files: qpalm-matlab-macos.zip
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up MATLAB
uses: matlab-actions/setup-matlab@5b825d0ad4205ef03dc40ba3b24cad22674e9ca3
with:
release: R2021a
- name: Configure
shell: pwsh
run: |
cmake -B build -S QPALM `
-D CMAKE_BUILD_TYPE=RelWithDebInfo `
-D QPALM_WITH_MEX=On `
-D CMAKE_POSITION_INDEPENDENT_CODE=On
- name: Build
shell: pwsh
run: |
cmake --build build `
--config RelWithDebInfo `
-j
- name: Install
shell: pwsh
run: |
cmake --install build `
--config RelWithDebInfo `
--component mex_interface `
--prefix staging
- name: Package
shell: pwsh
run: |
Compress-Archive -Path staging\* qpalm-matlab-windows.zip
- name: Upload
uses: actions/upload-artifact@v3
with:
name: qpalm-matlab-windows
path: qpalm-matlab-windows.zip
- name: Release
if: ${{ github.event.action == 'released' || github.event.action == 'prereleased' }}
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
with:
files: qpalm-matlab-windows.zip