Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build opensim 45 #36

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 55 additions & 49 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ name: continuous-integration

# syntax https://help.github.com/en/articles/workflow-syntax-for-github-actions
on:
# Run at 2am every night.
schedule:
- cron: '0 2 * * *'
pull_request:
branches:
- '*'
push:
branches:
- master

jobs:
windows38:

windows310:
runs-on: windows-latest

steps:
Expand All @@ -21,11 +20,11 @@ jobs:
- name: Install Python packages
uses: actions/setup-python@v2
with:
python-version: '3.8'
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 @@ -36,15 +35,16 @@ jobs:

- name: Conda build
run: |
chdir $env:GITHUB_WORKSPACE
conda build .
chdir $env:GITHUB_WORKSPACE/opensim
conda build . --python=3.10

- 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:
name: win64-opensim-4.5-py310np121.tar.bz2
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-4.5-py310np121.tar.bz2

windows311:
runs-on: windows-latest

steps:
Expand All @@ -53,11 +53,11 @@ jobs:
- name: Install Python packages
uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.11'

- 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.23

- uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -68,16 +68,16 @@ jobs:

- name: Conda build
run: |
chdir $env:GITHUB_WORKSPACE
conda build .
chdir $env:GITHUB_WORKSPACE/opensim
conda build . --python=3.11

- 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.5-py311np123.tar.bz2
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-4.5-py311np123.tar.bz2

windows310:
windows310-moco:
runs-on: windows-latest

steps:
Expand All @@ -102,15 +102,15 @@ jobs:
- name: Conda build
run: |
chdir $env:GITHUB_WORKSPACE
conda build .
conda build opensim-moco --python=3.10

- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: win64-opensim-4.4-py310np121.tar.bz2
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-4.4-py310np121.tar.bz2
name: win64-opensim-moco-4.5-py310np121.tar.bz2
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-moco-4.5-py310np121.tar.bz2

windows311:
windows311-moco:
runs-on: windows-latest

steps:
Expand All @@ -135,33 +135,37 @@ jobs:
- name: Conda build
run: |
chdir $env:GITHUB_WORKSPACE
conda build .
conda build opensim-moco --python=3.11

- 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
name: win64-opensim-moco-4.5-py311np123.tar.bz2
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-moco-4.5-py311np123.tar.bz2

ubuntu38:
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.8
python-version: '3.10'
channels: conda-forge,defaults
miniconda-version: "latest"

- name: Install Python packages
uses: actions/setup-python@v4
with:
python-version: '3.8'
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.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 @@ -177,33 +181,34 @@ jobs:
- name: Conda build
run: |
cd $GITHUB_WORKSPACE/opensim
conda build .
conda build . --python=3.10

- 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:
name: linux64-opensim-4.5-py310np121.tar.bz2
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.5-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.9
python-version: '3.11'
channels: conda-forge,defaults
miniconda-version: "latest"

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

- name: Install numpy
#Need numpy to use SWIG numpy typemaps.
run: python3 -m pip install numpy==1.20.2
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
Expand All @@ -222,14 +227,15 @@ jobs:
- name: Conda build
run: |
cd $GITHUB_WORKSPACE/opensim
conda build .
conda build . --python=3.11

- 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
ubuntu310:
name: linux64-opensim-4.5-py311np123.tar.bz2
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.5-py311np123.tar.bz2

ubuntu310-moco:
runs-on: ubuntu-20.04

steps:
Expand Down Expand Up @@ -266,16 +272,16 @@ jobs:

- name: Conda build
run: |
cd $GITHUB_WORKSPACE/opensim
conda build .
cd $GITHUB_WORKSPACE/opensim-moco
conda build . --python=3.10

- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: linux64-opensim-4.4-py310np121.tar.bz2
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.4-py310np121.tar.bz2
name: linux64-opensim-moco-4.5-py310np121.tar.bz2
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-moco-4.5-py310np121.tar.bz2

ubuntu311:
ubuntu311-moco:
runs-on: ubuntu-20.04

steps:
Expand Down Expand Up @@ -312,14 +318,14 @@ jobs:

- name: Conda build
run: |
cd $GITHUB_WORKSPACE/opensim
conda build .
cd $GITHUB_WORKSPACE/opensim-moco
conda build . --python=3.11

- 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
name: linux64-opensim-moco-4.5-py311np123.tar.bz2
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-moco-4.5-py311np123.tar.bz2

style:
name: Style
Expand Down
41 changes: 41 additions & 0 deletions opensim-moco/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
mkdir opensim_dependencies_build
cd .\opensim_dependencies_build
cmake ..\dependencies^
-G"Visual Studio 17 2022"^
-DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%"^
-DSUPERBUILD_ezc3d=ON^
-DOPENSIM_WITH_TROPTER=ON^
-DOPENSIM_WITH_CASADI=ON

cmake --build . --config Release -- /maxcpucount:8
cd ..
mkdir opensim_build
cd .\opensim_build
cmake ..\^
-G"Visual Studio 17 2022"^
-DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%"^
-DOPENSIM_DEPENDENCIES_DIR="%LIBRARY_PREFIX%"^
-DCMAKE_INSTALL_INCLUDEDIR="%LIBRARY_PREFIX%/include"^
-DCMAKE_INSTALL_LIBDIR="%LIBRARY_PREFIX%/lib"^
-DCMAKE_INSTALL_DOCDIR="%LIBRARY_PREFIX%/doc"^
-DCMAKE_INSTALL_SYSCONFDIR="%LIBRARY_PREFIX%/Library"^
-DOPENSIM_INSTALL_PYTHONDIR="%LIBRARY_PREFIX%/Lib/site-packages"^
-DOPENSIM_INSTALL_SIMBODYDIR="%LIBRARY_PREFIX%/Library/Simbody"^
-DOPENSIM_INSTALL_SPDLOGDIR="%LIBRARY_PREFIX%/Library/spdlog"^
-DOPENSIM_INSTALL_CASADIDIR="%LIBRARY_PREFIX%/Library"^
-DBUILD_PYTHON_WRAPPING=ON^
-DOPENSIM_C3D_PARSER=ezc3d^
-DOPENSIM_PYTHON_STANDALONE=ON^
-DOPENSIM_WITH_CASADI=ON^
-DOPENSIM_WITH_TROPTER=ON^
-DBUILD_TESTING=OFF^
-DBUILD_API_EXAMPLES=OFF^
-DOPENSIM_BUILD_INDIVIDUAL_APPS=ON^
-DOPENSIM_PYTHON_CONDA=ON
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
python setup.py install

53 changes: 53 additions & 0 deletions opensim-moco/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash
# TODO: Dependencies should be separate packages...
mkdir opensim_dependencies_build
cd opensim_dependencies_build
cmake ../dependencies/ -LAH \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_OSX_SYSROOT=${CONDA_BUILD_SYSROOT} \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
-DSUPERBUILD_docopt=ON \
-DSUPERBUILD_simbody=ON \
-DSUPERBUILD_spdlog=ON \
-DSUPERBUILD_ezc3d=ON \
-DOPENSIM_WITH_TROPTER=ON \
-DOPENSIM_WITH_CASADI=ON

make -j8
cd ..

# cp -r $PREFIX/simbody/libexec/simbody/* $PREFIX/bin/

if [ "$(uname)" == "Darwin" ]; then
SWIG_DIR_SPEC=/usr/local/Cellar/swig/4.0.2
else
SWIG_DIR_SPEC=~/swig/share/swig
fi
# TODO: Tests are missing!
mkdir opensim_build
cd opensim_build
cmake ../ \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_BUILD_TYPE=Release \
-DOPENSIM_DEPENDENCIES_DIR="$PREFIX" \
-DCMAKE_OSX_SYSROOT=${CONDA_BUILD_SYSROOT} \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
-DSWIG_DIR=${SWIG_DIR_SPEC} \
-DSWIG_EXECUTABLE=~/swig/bin/swig \
-DBUILD_PYTHON_WRAPPING=ON \
-DOPENSIM_DISABLE_LOG_FILE=ON \
-DOPENSIM_C3D_PARSER=ezc3d \
-DOPENSIM_PYTHON_STANDALONE=ON \
-DOPENSIM_INSTALL_UNIX_FHS=ON \
-DBUILD_API_ONLY=OFF \
-DBUILD_API_EXAMPLES=OFF \
-DBUILD_TESTING=OFF \
-DOPENSIM_BUILD_INDIVIDUAL_APPS=ON \
-DOPENSIM_COPY_DEPENDENCIES=ON \
-DOPENSIM_WITH_TROPTER=ON \
-DOPENSIM_WITH_CASADI=ON
make -j8
make install
27 changes: 27 additions & 0 deletions opensim-moco/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
MACOSX_DEPLOYMENT_TARGET: '10.10'
python:
- 3.9
- 3.10
- 3.11
numpy:
- 1.20
- 1.21
- 1.23
zip_keys:
- python
- numpy
c_compiler:
- vs2019 # [win]
- clang # [osx]
- gcc # [linux]
cxx_compiler:
- vs2019 # [win]
- clangxx # [osx]
- gxx # [linux]
c_compiler_version:
- 7.5.0 # [linux]
cxx_compiler_version:
- 7.5.0 # [linux]
CONDA_BUILD_SYSROOT:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk

Loading
Loading