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

Use opensim43 #7

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
fbd52f7
Use 4.2 codebase
aymanhab Jan 21, 2021
3bf6ca2
Use VS 2019, 4.2Beta code base dependencies build ok so far
aymanhab Jan 23, 2021
70ad8c7
Add numpy dependency and allow opensim to build to completion on windows
aymanhab Jan 28, 2021
8191f67
Force python 3.7
aymanhab Jan 28, 2021
ef4aa35
Update .travis.yml
aymanhab Jan 28, 2021
f63a136
Successful build on linux ubuntu, packaging in progress
aymanhab Jan 30, 2021
3c9d195
Merge branch 'use_opensim42' of https://github.com/opensim-org/conda-…
aymanhab Jan 30, 2021
e2c88cf
Update rev to commit built with swig 4.0
aymanhab Apr 15, 2021
b5a6384
Refresh variables in build script to correspond to master commit with…
aymanhab Apr 15, 2021
3192284
rename cp to copy in bat file
aymanhab Apr 15, 2021
5ea801f
Add ci file, windows only
aymanhab Apr 19, 2021
b3e8ea4
Update continuous_integration.yml
aymanhab Apr 19, 2021
f2597b3
try different path in ci
aymanhab Apr 19, 2021
19669b5
Update continuous_integration.yml
aymanhab Apr 19, 2021
36b3d6a
Update continuous_integration.yml
aymanhab Apr 19, 2021
472137e
use path for recipe
aymanhab Apr 19, 2021
626d384
Update continuous_integration.yml
aymanhab Apr 19, 2021
1574d1f
Update continuous_integration.yml
aymanhab Apr 19, 2021
4175e7e
Update continuous_integration.yml
aymanhab Apr 19, 2021
1fd2411
Update continuous_integration.yml
aymanhab Apr 19, 2021
4ade724
Update continuous_integration.yml
aymanhab Apr 19, 2021
00c414e
Manual install numpy
aymanhab Apr 21, 2021
a528cd2
Add Mac to script, change version number to 4-2- instead of 4.2. to a…
aymanhab Apr 21, 2021
8c11bdd
Update meta.yaml
aymanhab Apr 21, 2021
6c0e1f5
Update continuous_integration.yml
aymanhab Apr 21, 2021
81b071c
Update continuous_integration.yml
aymanhab Apr 21, 2021
8493f0c
remove py>=37 that triggers bug in conda_build /windows
aymanhab Apr 22, 2021
f90ca93
build on windows 4.3 codebase
aymanhab Feb 4, 2022
5222717
Build without Moco libraries for now
aymanhab Feb 7, 2022
eb11157
Add variants file for python, numpy
aymanhab Feb 9, 2022
4d9295c
Use later commit hash
aymanhab Feb 9, 2022
ffa4341
Update commit hash
aymanhab Feb 10, 2022
06fbaf7
Disable testing for now so the package can be uploaded/tested separately
aymanhab Feb 10, 2022
a1b8092
restrict variants to 3.8 and use cond-forge recommended settings for …
aymanhab Feb 11, 2022
f06549d
Restrict vs specification to windows platform
aymanhab Feb 11, 2022
e4f172b
Layout install per conda recommendation with Lib, Library folders
aymanhab Feb 14, 2022
a2244a5
Use py39 instead of 38 by default until we build variants
aymanhab Feb 14, 2022
2601b30
Create Lib folder and run install scripts
aymanhab Feb 15, 2022
acf979b
no install for now, allow for variants and name package accordingly
aymanhab Feb 16, 2022
09ecc65
freeglut on windows only, use hash from opensim-core master branch
aymanhab Feb 17, 2022
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
82 changes: 82 additions & 0 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
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:
- '*'

jobs:
windows:
name: Windows

runs-on: windows-latest

steps:
- uses: actions/checkout@v1

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

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

- 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 .
mac:
name: Mac

runs-on: macos-latest

steps:
- uses: actions/checkout@v1

- name: Install Homebrew packages
# Save the gfortran version to a file so we can use it in the cache key.
run: |
brew install cmake pkgconfig autoconf libtool automake wget pcre doxygen
pip3 install numpy==1.19.3

- 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: |
cd $GITHUB_WORKSPACE
conda build .

style:
name: Style

runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v1

- name: Check for tabs
# Ensure that there are no tabs in source code.
# GREP returns 0 (true) if there are any matches, and
# we don't want any matches. If there are matches,
# print a helpful message, and make the test fail by using "false".
# The GREP command here checks for any tab characters in the the files
# that match the specified pattern. GREP does not pick up explicit tabs
# (e.g., literally a \t in a source file).
run: if grep --line-num --recursive --exclude-dir="*dependencies*" --exclude-dir="*snopt*" --include={CMakeLists.txt,*.cpp,*.c,*.h} -P "\t" . ; then echo "Tabs found in the lines shown above. See CONTRIBUTING.md about tabs."; false; fi
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: python
python:
# We don't actually use the Travis Python, but this keeps it organized.
- "2.7"
- "3.7"
install:
- sudo apt-get update
# We do this conditionally because it saves us some downloading if the
Expand All @@ -24,4 +24,4 @@ install:
- conda-build opensim

script:
# Your test script goes here
# Your test script goes here
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# conda-opensim
Unofficial conda recipe for OpenSim 4.0-alpha
Unofficial conda recipe for OpenSim 4.2

Usage:

Expand All @@ -8,4 +8,4 @@ Usage:

For python 3, use the python3 branch and

conda build opensim --python 3.5
conda build opensim --python 3.7
34 changes: 27 additions & 7 deletions opensim/bld.bat
Original file line number Diff line number Diff line change
@@ -1,21 +1,41 @@
mkdir opensim_dependencies_build
cd .\opensim_dependencies_build
cmake ..\dependencies^
-G"Visual Studio 14 2015 Win64"^
-DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%"
-G"Visual Studio 16 2019"^
-DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%"^
-DSUPERBUILD_ezc3d=ON

cmake --build . --config Release -- /maxcpucount:8
cd ..

mkdir opensim_build
cd .\opensim_build
cmake ..\^
-G"Visual Studio 14 2015 Win64"^
-G"Visual Studio 16 2019"^
-DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%"^
-DOPENSIM_DEPENDENCIES_DIR="%LIBRARY_PREFIX%"^
-DCMAKE_INSTALL_INCLUDEDIR="%LIBRARY_PREFIX%/Library/include"^
-DCMAKE_INSTALL_LIBDIR="%LIBRARY_PREFIX%/Library/lib"^
-DCMAKE_INSTALL_DOCDIR="%LIBRARY_PREFIX%/Library/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^
-DWITH_BTK=ON
-DOPENSIM_C3D_PARSER=ezc3d^
-DOPENSIM_PYTHON_STANDALONE=ON^
-DBUILD_TESTING=OFF^
-DBUILD_API_EXAMPLES=OFF^
-DOPENSIM_BUILD_INDIVIDUAL_APPS=OFF^
-DOPENSIM_PYTHON_CONDA=ON
cmake --build . --target install --config Release -- /maxcpucount:8

cp %LIBRARY_PREFIX%\simbody\bin\simbody-visualizer.exe %PREFIX%\simbody-visualizer.exe
cd %LIBRARY_PREFIX%\sdk\python
python setup.py install
Rem copy %LIBRARY_PREFIX%\Library\bin\simbody-visualizer.exe %LIBRARY_PREFIX%\simbody-visualizer.exe
echo "copying from " %LIBRARY_PREFIX%\Library\sdk\Python
echo "copy to " %LIBRARY_PREFIX%\Lib\site-packages
Rem copy %LIBRARY_PREFIX%\sdk\Python %LIBRARY_PREFIX%\..\Lib\site-packages
Rem cd %LIBRARY_PREFIX%\..\Lib\site-packages
Rem python setup_win_python38.py
Rem python setup.py install

20 changes: 13 additions & 7 deletions opensim/build.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
#!/bin/bash

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

# TODO: Dependencies should be separate packages...
mkdir opensim_dependencies_build
cd opensim_dependencies_build
cmake ../dependencies/ \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_BUILD_TYPE=Release \
-DSUPERBUILD_ezc3d=ON \
-DSUPERBUILD_adolc=OFF \
-DSUPERBUILD_casadi=OFF \
-DSUPERBUILD_colpack=OFF \
-DSUPERBUILD_ipopt=OFF
make -j8
cd ..

cp -r $PREFIX/BTK/lib/btk-0.4dev/* $PREFIX/lib/
cp -r $PREFIX/simbody/libexec/simbody/* $PREFIX/bin/

# TODO: Tests are missing!
Expand All @@ -22,9 +24,13 @@ cmake ../ \
-DCMAKE_BUILD_TYPE=Release \
-DOPENSIM_DEPENDENCIES_DIR="$PREFIX" \
-DBUILD_PYTHON_WRAPPING=ON \
-DBUILD_JAVA_WRAPPING=OFF \
-DOPENSIM_PYTHON_CONDA=ON \
-DPYTHON_VERSION_MAJOR=3 \
-DPYTHON_VERSION_MINOR=6 \
-DWITH_BTK=ON
-DOPENSIM_C3D_PARSER=ezc3d \
-DBUILD_TESTING=OFF \
-DTROPTER_WITH_SNOPT=OFF \
-DTROPTER_WITH_OPENMP=OFF \
-DOPENSIM_WITH_TROPTER=OFF \
-DOPENSIM_WITH_CASADI=OFF
make -j8
make install
8 changes: 8 additions & 0 deletions opensim/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
python:
- 3.9
numpy:
- 1.20
c_compiler:
- vs2019 # [win]
cxx_compiler:
- vs2019 # [win]
45 changes: 23 additions & 22 deletions opensim/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
package:
name: opensim
version: "4.0.0"

#source:
# fn: OpenSim-40-source.zip
# url: https://github.com/opensim-org/opensim-core/archive/v4.0.0_alpha.zip
# sha256: dd425e886f394098533142652e246b375c8fb4d69246f0ffffcdd63bbbdb39c3
version: "4.3.1"

source:
# path: /home/kidzik/workspace/opensim-core
git_url: https://github.com/opensim-org/opensim-core.git
git_rev: 399c8d57a779dd5dde2916192f8b92bfc959e269 #beta
git_rev: "73530a8bf87788729be3ff371f75238a1ea50698"

build:
number: 12
# NOTE : For C++11 builds, vc14/VS 2015 are the only acceptable targets
# which only Python 3.5 supports. So skip previous Python versions.
# skip: true # [win and not py35]
number: 0
# NOTE : For C++11 builds, vc16/VS 2019 are the only acceptable targets
features:
- vc14 # [win and py35]
- vc16 # [win and py39]
# NOTE : This is needed to ensure the paths to Simbody's binaries, like
# simbody-visualizer, are corrected.
detect_binary_files_with_prefix: true

string: py{{ CONDA_PY }}np{{ CONDA_NPY }}
requirements:
run:
- python
- openblas
- freeglut
build:
build:
- toolchain 2.4.0 0
- wheel 0.36.2 pyhd3eb1b0_0
- swig
- toolchain
- cmake >=2.8.6
- cmake >=3.15
- numpy {{ numpy }}
- python {{ python }}
- {{ compiler('c') }}
- {{ compiler('cxx') }}

run:
- python
# - python # [win]
- numpy
- freeglut # [win]

test:
# imports:
# - opensim

about:
home: http://opensim.stanford.edu
license: Apache-2.0
Expand All @@ -44,4 +44,5 @@ about:

extra:
recipe-maintainers:
- aymanhab
- kidzik