Skip to content

Commit 4e931f1

Browse files
authored
Merge pull request #30 from opensim-org/build_apps
Build cross platform including applications, support python 3.10 and 3.11 and numpy 1.21, 1.23
2 parents a21430c + 8c48093 commit 4e931f1

File tree

6 files changed

+159
-47
lines changed

6 files changed

+159
-47
lines changed

.github/workflows/continuous_integration.yml

Lines changed: 143 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@ on:
88
pull_request:
99
branches:
1010
- '*'
11-
11+
push:
12+
branches:
13+
- master
1214
jobs:
13-
windows37:
14-
runs-on: windows-2019
15+
windows38:
16+
runs-on: windows-latest
1517

1618
steps:
1719
- uses: actions/checkout@v1
1820

1921
- name: Install Python packages
2022
uses: actions/setup-python@v2
2123
with:
22-
python-version: '3.7'
24+
python-version: '3.8'
2325

2426
- name: Install numpy
2527
#Need numpy to use SWIG numpy typemaps.
@@ -40,18 +42,18 @@ jobs:
4042
- name: upload artifact
4143
uses: actions/upload-artifact@v2
4244
with:
43-
name: win64-opensim-4.4-py37np120.tar.bz2
44-
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-4.4-py37np120.tar.bz2
45-
windows38:
46-
runs-on: windows-2019
45+
name: win64-opensim-4.4-py38np120.tar.bz2
46+
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-4.4-py38np120.tar.bz2
47+
windows39:
48+
runs-on: windows-latest
4749

4850
steps:
4951
- uses: actions/checkout@v1
5052

5153
- name: Install Python packages
5254
uses: actions/setup-python@v2
5355
with:
54-
python-version: '3.8'
56+
python-version: '3.9'
5557

5658
- name: Install numpy
5759
#Need numpy to use SWIG numpy typemaps.
@@ -72,22 +74,23 @@ jobs:
7274
- name: upload artifact
7375
uses: actions/upload-artifact@v2
7476
with:
75-
name: win64-opensim-4.4-py38np120.tar.bz2
76-
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-4.4-py38np120.tar.bz2
77-
windows39:
78-
runs-on: windows-2019
77+
name: win64-opensim-4.4-py39np120.tar.bz2
78+
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-4.4-py39np120.tar.bz2
79+
80+
windows310:
81+
runs-on: windows-latest
7982

8083
steps:
8184
- uses: actions/checkout@v1
8285

8386
- name: Install Python packages
8487
uses: actions/setup-python@v2
8588
with:
86-
python-version: '3.9'
89+
python-version: '3.10'
8790

8891
- name: Install numpy
8992
#Need numpy to use SWIG numpy typemaps.
90-
run: python -m pip install numpy==1.20
93+
run: python -m pip install numpy==1.21.4
9194

9295
- uses: conda-incubator/setup-miniconda@v2
9396
with:
@@ -104,9 +107,41 @@ jobs:
104107
- name: upload artifact
105108
uses: actions/upload-artifact@v2
106109
with:
107-
name: win64-opensim-4.4-py39np120.tar.bz2
108-
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-4.4-py39np120.tar.bz2
109-
110+
name: win64-opensim-4.4-py310np121.tar.bz2
111+
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-4.4-py310np121.tar.bz2
112+
113+
windows311:
114+
runs-on: windows-latest
115+
116+
steps:
117+
- uses: actions/checkout@v1
118+
119+
- name: Install Python packages
120+
uses: actions/setup-python@v2
121+
with:
122+
python-version: '3.11'
123+
124+
- name: Install numpy
125+
#Need numpy to use SWIG numpy typemaps.
126+
run: python -m pip install numpy==1.23
127+
128+
- uses: conda-incubator/setup-miniconda@v2
129+
with:
130+
auto-update-conda: true
131+
miniconda-version: "latest"
132+
- name: Install conda-build
133+
run: conda install conda-build
134+
135+
- name: Conda build
136+
run: |
137+
chdir $env:GITHUB_WORKSPACE
138+
conda build .
139+
140+
- name: upload artifact
141+
uses: actions/upload-artifact@v2
142+
with:
143+
name: win64-opensim-4.4-py311np123.tar.bz2
144+
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-4.4-py311np123.tar.bz2
110145
mac:
111146
name: Mac
112147

@@ -138,20 +173,25 @@ jobs:
138173
cd $GITHUB_WORKSPACE
139174
conda build .
140175
141-
ubuntu37:
142-
runs-on: ubuntu-18.04
176+
ubuntu38:
177+
runs-on: ubuntu-20.04
143178

144179
steps:
145180
- uses: actions/checkout@v2
146181
- uses: conda-incubator/setup-miniconda@v2
147182
with:
148183
auto-update-conda: true
149-
python-version: 3.7
184+
python-version: 3.8
150185
channels: conda-forge,defaults
151186
miniconda-version: "latest"
152187

188+
- name: Install Python packages
189+
uses: actions/setup-python@v4
190+
with:
191+
python-version: '3.8'
192+
153193
- name: Install packages
154-
run: sudo apt-get update && sudo apt-get install --yes build-essential libtool autoconf pkg-config gfortran libopenblas-dev liblapack-dev freeglut3-dev libxi-dev libxmu-dev doxygen python3.7 python3-dev python3-numpy python3-setuptools
194+
run: sudo apt-get update && sudo apt-get install --yes build-essential libtool autoconf pkg-config gfortran libopenblas-dev liblapack-dev freeglut3-dev libxi-dev libxmu-dev doxygen python3.8 python3-dev python3-numpy python3-setuptools
155195

156196
- name: Install SWIG
157197
run: |
@@ -172,20 +212,31 @@ jobs:
172212
- name: upload artifact
173213
uses: actions/upload-artifact@v2
174214
with:
175-
name: linux64-opensim-4.4-py37np120.tar.bz2
176-
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.4-py37np120.tar.bz2
177-
ubuntu38:
178-
runs-on: ubuntu-18.04
215+
name: linux64-opensim-4.4-py38np120.tar.bz2
216+
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.4-py38np120.tar.bz2
217+
ubuntu39:
218+
runs-on: ubuntu-20.04
179219

180220
steps:
181221
- uses: actions/checkout@v2
182222
- uses: conda-incubator/setup-miniconda@v2
183223
with:
184224
auto-update-conda: true
225+
python-version: 3.9
226+
channels: conda-forge,defaults
185227
miniconda-version: "latest"
186228

229+
- name: Install Python packages
230+
uses: actions/setup-python@v4
231+
with:
232+
python-version: '3.9'
233+
234+
- name: Install numpy
235+
#Need numpy to use SWIG numpy typemaps.
236+
run: python3 -m pip install numpy==1.20.2
237+
187238
- name: Install packages
188-
run: sudo apt-get update && sudo apt-get install --yes build-essential libtool autoconf pkg-config gfortran libopenblas-dev liblapack-dev freeglut3-dev libxi-dev libxmu-dev doxygen python3.8 python3-dev python3-numpy python3-setuptools
239+
run: sudo apt-get update && sudo apt-get install --yes build-essential libtool autoconf pkg-config gfortran libopenblas-dev liblapack-dev freeglut3-dev libxi-dev libxmu-dev doxygen python3 python3-dev python3-numpy python3-setuptools
189240

190241
- name: Install SWIG
191242
run: |
@@ -206,18 +257,29 @@ jobs:
206257
- name: upload artifact
207258
uses: actions/upload-artifact@v2
208259
with:
209-
name: linux64-opensim-4.4-py38np120.tar.bz2
210-
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.4-py38np120.tar.bz2
211-
ubuntu39:
212-
runs-on: ubuntu-18.04
260+
name: linux64-opensim-4.4-py39np120.tar.bz2
261+
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.4-py39np120.tar.bz2
262+
ubuntu310:
263+
runs-on: ubuntu-20.04
213264

214265
steps:
215266
- uses: actions/checkout@v2
216267
- uses: conda-incubator/setup-miniconda@v2
217268
with:
218269
auto-update-conda: true
270+
python-version: '3.10'
271+
channels: conda-forge,defaults
219272
miniconda-version: "latest"
220273

274+
- name: Install Python packages
275+
uses: actions/setup-python@v4
276+
with:
277+
python-version: '3.10'
278+
279+
- name: Install numpy
280+
#Need numpy to use SWIG numpy typemaps.
281+
run: python3 -m pip install numpy==1.21
282+
221283
- name: Install packages
222284
run: sudo apt-get update && sudo apt-get install --yes build-essential libtool autoconf pkg-config gfortran libopenblas-dev liblapack-dev freeglut3-dev libxi-dev libxmu-dev doxygen python3 python3-dev python3-numpy python3-setuptools
223285

@@ -240,13 +302,59 @@ jobs:
240302
- name: upload artifact
241303
uses: actions/upload-artifact@v2
242304
with:
243-
name: linux64-opensim-4.4-py39np120.tar.bz2
244-
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.4-py39np120.tar.bz2
245-
305+
name: linux64-opensim-4.4-py310np121.tar.bz2
306+
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.4-py310np121.tar.bz2
307+
308+
ubuntu311:
309+
runs-on: ubuntu-20.04
310+
311+
steps:
312+
- uses: actions/checkout@v2
313+
- uses: conda-incubator/setup-miniconda@v2
314+
with:
315+
auto-update-conda: true
316+
python-version: '3.11'
317+
channels: conda-forge,defaults
318+
miniconda-version: "latest"
319+
320+
- name: Install Python packages
321+
uses: actions/setup-python@v4
322+
with:
323+
python-version: '3.11'
324+
325+
- name: Install numpy
326+
#Need numpy to use SWIG numpy typemaps.
327+
run: python3 -m pip install numpy==1.23
328+
329+
- name: Install packages
330+
run: sudo apt-get update && sudo apt-get install --yes build-essential libtool autoconf pkg-config gfortran libopenblas-dev liblapack-dev freeglut3-dev libxi-dev libxmu-dev doxygen python3 python3-dev python3-numpy python3-setuptools
331+
332+
- name: Install SWIG
333+
run: |
334+
mkdir ~/swig-source && cd ~/swig-source
335+
wget https://github.com/swig/swig/archive/refs/tags/rel-4.0.2.tar.gz
336+
tar xzf rel-4.0.2.tar.gz && cd swig-rel-4.0.2
337+
sh autogen.sh && ./configure --prefix=$HOME/swig --disable-ccache
338+
make && make -j4 install
339+
340+
- name: Install conda-build
341+
run: conda install conda-build
342+
343+
- name: Conda build
344+
run: |
345+
cd $GITHUB_WORKSPACE/opensim
346+
conda build .
347+
348+
- name: upload artifact
349+
uses: actions/upload-artifact@v2
350+
with:
351+
name: linux64-opensim-4.4-py311np123.tar.bz2
352+
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.4-py311np123.tar.bz2
353+
246354
style:
247355
name: Style
248356

249-
runs-on: ubuntu-18.04
357+
runs-on: ubuntu-20.04
250358

251359
steps:
252360
- uses: actions/checkout@v1

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ Usage:
77
conda build opensim
88

99
Only python 3 is supported. Default settings/package doesn't include Moco
10+
Packages with Moco are in a separate opensim-with-moco packages

opensim/bld.bat

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,5 @@ cmake --build . --target install --config Release -- /maxcpucount:8
3737
Rem move Library\sdk\Python Lib
3838
move %LIBRARY_PREFIX%\sdk\Python %LIBRARY_PREFIX%\..\Lib
3939
cd %LIBRARY_PREFIX%\..\Lib
40-
Rem python setup_win_python38.py conda
4140
python setup.py install
4241

opensim/build.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ cmake ../ \
4040
-DBUILD_PYTHON_WRAPPING=ON \
4141
-DOPENSIM_DISABLE_LOG_FILE=ON \
4242
-DOPENSIM_C3D_PARSER=ezc3d \
43-
-DBUILD_TESTING=OFF \
4443
-DOPENSIM_PYTHON_STANDALONE=ON \
4544
-DOPENSIM_INSTALL_UNIX_FHS=ON \
46-
-DBUILD_API_ONLY=ON \
47-
-DOPENSIM_BUILD_INDIVIDUAL_APPS_DEFAULT=ON \
45+
-DBUILD_API_ONLY=OFF \
46+
-DBUILD_API_EXAMPLES=OFF \
47+
-DBUILD_TESTING=OFF \
48+
-DOPENSIM_BUILD_INDIVIDUAL_APPS=ON \
4849
-DOPENSIM_COPY_DEPENDENCIES=ON \
4950
-DOPENSIM_WITH_TROPTER=OFF \
5051
-DOPENSIM_WITH_CASADI=OFF

opensim/conda_build_config.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
MACOSX_DEPLOYMENT_TARGET: '10.10'
22
python:
3-
- 3.7
4-
- 3.8
5-
- 3.9
3+
- 3.10
4+
- 3.11
65
numpy:
7-
- 1.20
6+
- 1.21
7+
- 1.23
8+
zip_keys:
9+
- python
10+
- numpy
811
c_compiler:
9-
- vs2019 # [win]
12+
- vs2019 # [win]
1013
- clang # [osx]
1114
- gcc # [linux]
1215
cxx_compiler:
13-
- vs2019 # [win]
16+
- vs2019 # [win]
1417
- clangxx # [osx]
1518
- gxx # [linux]
1619
c_compiler_version:

opensim/meta.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ requirements:
2121
- openblas # [not win]
2222
build:
2323
- toolchain 2.4.0 0 # [win]
24-
- wheel 0.36.2 pyhd3eb1b0_0
24+
#- wheel 0.36.2 pyhd3eb1b0_0
2525
- swig 4.0.2
26-
- cmake >=3.15
26+
- cmake >=3.15,<3.25
2727
- numpy {{ numpy }}
2828
- python {{ python }}
2929
- {{ compiler('c') }}

0 commit comments

Comments
 (0)