Skip to content

Commit

Permalink
Merge pull request #30 from opensim-org/build_apps
Browse files Browse the repository at this point in the history
Build cross platform including applications, support python 3.10 and 3.11 and numpy 1.21, 1.23
  • Loading branch information
aymanhab authored May 17, 2023
2 parents a21430c + 8c48093 commit 4e931f1
Show file tree
Hide file tree
Showing 6 changed files with 159 additions and 47 deletions.
178 changes: 143 additions & 35 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@ on:
pull_request:
branches:
- '*'

push:
branches:
- master
jobs:
windows37:
runs-on: windows-2019
windows38:
runs-on: windows-latest

steps:
- uses: actions/checkout@v1

- name: Install Python packages
uses: actions/setup-python@v2
with:
python-version: '3.7'
python-version: '3.8'

- name: Install numpy
#Need numpy to use SWIG numpy typemaps.
Expand All @@ -40,18 +42,18 @@ jobs:
- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: win64-opensim-4.4-py37np120.tar.bz2
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-4.4-py37np120.tar.bz2
windows38:
runs-on: windows-2019
name: win64-opensim-4.4-py38np120.tar.bz2
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-4.4-py38np120.tar.bz2
windows39:
runs-on: windows-latest

steps:
- uses: actions/checkout@v1

- name: Install Python packages
uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: '3.9'

- name: Install numpy
#Need numpy to use SWIG numpy typemaps.
Expand All @@ -72,22 +74,23 @@ jobs:
- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: win64-opensim-4.4-py38np120.tar.bz2
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-4.4-py38np120.tar.bz2
windows39:
runs-on: windows-2019
name: win64-opensim-4.4-py39np120.tar.bz2
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-4.4-py39np120.tar.bz2

windows310:
runs-on: windows-latest

steps:
- uses: actions/checkout@v1

- name: Install Python packages
uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.10'

- name: Install numpy
#Need numpy to use SWIG numpy typemaps.
run: python -m pip install numpy==1.20
run: python -m pip install numpy==1.21.4

- uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -104,9 +107,41 @@ jobs:
- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: win64-opensim-4.4-py39np120.tar.bz2
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-4.4-py39np120.tar.bz2

name: win64-opensim-4.4-py310np121.tar.bz2
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-4.4-py310np121.tar.bz2

windows311:
runs-on: windows-latest

steps:
- uses: actions/checkout@v1

- name: Install Python packages
uses: actions/setup-python@v2
with:
python-version: '3.11'

- name: Install numpy
#Need numpy to use SWIG numpy typemaps.
run: python -m pip install numpy==1.23

- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
miniconda-version: "latest"
- name: Install conda-build
run: conda install conda-build

- name: Conda build
run: |
chdir $env:GITHUB_WORKSPACE
conda build .
- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: win64-opensim-4.4-py311np123.tar.bz2
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-4.4-py311np123.tar.bz2
mac:
name: Mac

Expand Down Expand Up @@ -138,20 +173,25 @@ jobs:
cd $GITHUB_WORKSPACE
conda build .
ubuntu37:
runs-on: ubuntu-18.04
ubuntu38:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.7
python-version: 3.8
channels: conda-forge,defaults
miniconda-version: "latest"

- name: Install Python packages
uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Install packages
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
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

- name: Install SWIG
run: |
Expand All @@ -172,20 +212,31 @@ jobs:
- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: linux64-opensim-4.4-py37np120.tar.bz2
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.4-py37np120.tar.bz2
ubuntu38:
runs-on: ubuntu-18.04
name: linux64-opensim-4.4-py38np120.tar.bz2
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.4-py38np120.tar.bz2
ubuntu39:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.9
channels: conda-forge,defaults
miniconda-version: "latest"

- name: Install Python packages
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install numpy
#Need numpy to use SWIG numpy typemaps.
run: python3 -m pip install numpy==1.20.2

- name: Install packages
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
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

- name: Install SWIG
run: |
Expand All @@ -206,18 +257,29 @@ jobs:
- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: linux64-opensim-4.4-py38np120.tar.bz2
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.4-py38np120.tar.bz2
ubuntu39:
runs-on: ubuntu-18.04
name: linux64-opensim-4.4-py39np120.tar.bz2
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.4-py39np120.tar.bz2
ubuntu310:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: '3.10'
channels: conda-forge,defaults
miniconda-version: "latest"

- name: Install Python packages
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install numpy
#Need numpy to use SWIG numpy typemaps.
run: python3 -m pip install numpy==1.21

- name: Install packages
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

Expand All @@ -240,13 +302,59 @@ jobs:
- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: linux64-opensim-4.4-py39np120.tar.bz2
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.4-py39np120.tar.bz2

name: linux64-opensim-4.4-py310np121.tar.bz2
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.4-py310np121.tar.bz2

ubuntu311:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: '3.11'
channels: conda-forge,defaults
miniconda-version: "latest"

- name: Install Python packages
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install numpy
#Need numpy to use SWIG numpy typemaps.
run: python3 -m pip install numpy==1.23

- name: Install packages
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

- name: Install SWIG
run: |
mkdir ~/swig-source && cd ~/swig-source
wget https://github.com/swig/swig/archive/refs/tags/rel-4.0.2.tar.gz
tar xzf rel-4.0.2.tar.gz && cd swig-rel-4.0.2
sh autogen.sh && ./configure --prefix=$HOME/swig --disable-ccache
make && make -j4 install
- name: Install conda-build
run: conda install conda-build

- name: Conda build
run: |
cd $GITHUB_WORKSPACE/opensim
conda build .
- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: linux64-opensim-4.4-py311np123.tar.bz2
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.4-py311np123.tar.bz2

style:
name: Style

runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v1
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Usage:
conda build opensim

Only python 3 is supported. Default settings/package doesn't include Moco
Packages with Moco are in a separate opensim-with-moco packages
1 change: 0 additions & 1 deletion opensim/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,5 @@ cmake --build . --target install --config Release -- /maxcpucount:8
Rem move Library\sdk\Python Lib
move %LIBRARY_PREFIX%\sdk\Python %LIBRARY_PREFIX%\..\Lib
cd %LIBRARY_PREFIX%\..\Lib
Rem python setup_win_python38.py conda
python setup.py install

7 changes: 4 additions & 3 deletions opensim/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ cmake ../ \
-DBUILD_PYTHON_WRAPPING=ON \
-DOPENSIM_DISABLE_LOG_FILE=ON \
-DOPENSIM_C3D_PARSER=ezc3d \
-DBUILD_TESTING=OFF \
-DOPENSIM_PYTHON_STANDALONE=ON \
-DOPENSIM_INSTALL_UNIX_FHS=ON \
-DBUILD_API_ONLY=ON \
-DOPENSIM_BUILD_INDIVIDUAL_APPS_DEFAULT=ON \
-DBUILD_API_ONLY=OFF \
-DBUILD_API_EXAMPLES=OFF \
-DBUILD_TESTING=OFF \
-DOPENSIM_BUILD_INDIVIDUAL_APPS=ON \
-DOPENSIM_COPY_DEPENDENCIES=ON \
-DOPENSIM_WITH_TROPTER=OFF \
-DOPENSIM_WITH_CASADI=OFF
Expand Down
15 changes: 9 additions & 6 deletions opensim/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
MACOSX_DEPLOYMENT_TARGET: '10.10'
python:
- 3.7
- 3.8
- 3.9
- 3.10
- 3.11
numpy:
- 1.20
- 1.21
- 1.23
zip_keys:
- python
- numpy
c_compiler:
- vs2019 # [win]
- vs2019 # [win]
- clang # [osx]
- gcc # [linux]
cxx_compiler:
- vs2019 # [win]
- vs2019 # [win]
- clangxx # [osx]
- gxx # [linux]
c_compiler_version:
Expand Down
4 changes: 2 additions & 2 deletions opensim/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ requirements:
- openblas # [not win]
build:
- toolchain 2.4.0 0 # [win]
- wheel 0.36.2 pyhd3eb1b0_0
#- wheel 0.36.2 pyhd3eb1b0_0
- swig 4.0.2
- cmake >=3.15
- cmake >=3.15,<3.25
- numpy {{ numpy }}
- python {{ python }}
- {{ compiler('c') }}
Expand Down

0 comments on commit 4e931f1

Please sign in to comment.