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 441 #34

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
212 changes: 43 additions & 169 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ on:
branches:
- master
jobs:
windows38:

windows31011:
runs-on: windows-latest

steps:
Expand All @@ -21,11 +22,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 @@ -37,47 +38,21 @@ jobs:
- name: Conda build
run: |
chdir $env:GITHUB_WORKSPACE
conda build .
conda build opensim

- name: upload artifact
- name: upload artifact 310
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-latest

steps:
- uses: actions/checkout@v1

- name: Install Python packages
uses: actions/setup-python@v2
with:
python-version: '3.9'
name: win64-opensim-4.4-py310np121.tar.bz2
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-4.4-py310np121.tar.bz2

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

- 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
- name: upload artifact 311
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-py311np123.tar.bz2
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-4.4-py311np123.tar.bz2

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

steps:
Expand All @@ -102,108 +77,40 @@ jobs:
- name: Conda build
run: |
chdir $env:GITHUB_WORKSPACE
conda build .
conda build opensim-moco

- name: upload artifact
- name: upload artifact 310-moco
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

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

- 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
- name: upload artifact 311-moco
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

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

- name: Install Python packages
uses: actions/setup-python@v4
with:
python-version: '3.8'
name: win64-opensim-moco-4.4-py311np123.tar.bz2
path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-moco-4.4-py311np123.tar.bz2

- 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

- 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-py38np120.tar.bz2
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.4-py38np120.tar.bz2
ubuntu39:
ubuntu31011:
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.10'
channels: conda-forge,defaults
miniconda-version: "latest"

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

- 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.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 @@ -222,14 +129,21 @@ jobs:
- name: Conda build
run: |
cd $GITHUB_WORKSPACE/opensim
conda build .
conda build opensim

- name: upload artifact ubuntu310
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: upload artifact
- name: upload artifact ubuntu311
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.4-py311np123.tar.bz2
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.4-py311np123.tar.bz2

ubuntu31011-moco:
runs-on: ubuntu-20.04

steps:
Expand Down Expand Up @@ -266,60 +180,20 @@ jobs:

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

- name: upload artifact
- name: upload artifact ubuntu310-moco
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

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

- name: upload artifact
- name: upload artifact ubuntu311-moco
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.4-py311np123.tar.bz2
path: /usr/share/miniconda3/conda-bld/linux-64/opensim-moco-4.4-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
Loading