diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 3ef01a6..4941e85 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -2,81 +2,14 @@ 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: - runs-on: windows-latest - - steps: - - uses: actions/checkout@v1 - - - name: Install Python packages - uses: actions/setup-python@v2 - with: - python-version: '3.8' - - - 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 - 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: 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 - 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 +jobs: windows310: runs-on: windows-latest @@ -84,13 +17,13 @@ jobs: - uses: actions/checkout@v1 - name: Install Python packages - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.10' - name: Install numpy #Need numpy to use SWIG numpy typemaps. - run: python -m pip install numpy==1.21.4 + run: python -m pip install numpy==1.25 - uses: conda-incubator/setup-miniconda@v2 with: @@ -101,29 +34,29 @@ jobs: - name: Conda build run: | - chdir $env:GITHUB_WORKSPACE + chdir $env:GITHUB_WORKSPACE/opensim conda build . - 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-4.5.1-py310np121.tar.bz2 + path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-4.5.1-py310np125.tar.bz2 - windows311: + windows310-moco: runs-on: windows-latest steps: - uses: actions/checkout@v1 - name: Install Python packages - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: '3.10' - name: Install numpy #Need numpy to use SWIG numpy typemaps. - run: python -m pip install numpy==1.23 + run: python -m pip install numpy==1.25 - uses: conda-incubator/setup-miniconda@v2 with: @@ -134,101 +67,15 @@ jobs: - name: Conda build run: | - chdir $env:GITHUB_WORKSPACE + chdir $env:GITHUB_WORKSPACE/opensim-moco 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 - - 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: win64-opensim-moco-4.5.1-py310np125.tar.bz2 + path: C:/Miniconda3/envs/test/conda-bld/win-64/opensim-moco-4.5.1-py310np125.tar.bz2 - - 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.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: - 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 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-py39np120.tar.bz2 - path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.4-py39np120.tar.bz2 ubuntu310: runs-on: ubuntu-20.04 @@ -248,7 +95,7 @@ jobs: - name: Install numpy #Need numpy to use SWIG numpy typemaps. - run: python3 -m pip install numpy==1.21 + run: python3 -m pip install numpy==1.25 - 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 @@ -256,8 +103,8 @@ jobs: - 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 + wget https://github.com/swig/swig/archive/refs/tags/v4.1.1.tar.gz + tar xzf v4.1.1.tar.gz && cd swig-4.1.1 sh autogen.sh && ./configure --prefix=$HOME/swig --disable-ccache make && make -j4 install @@ -272,10 +119,10 @@ jobs: - 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-4.5-py310np121.tar.bz2 + path: /usr/share/miniconda3/conda-bld/linux-64/opensim-4.5.1-py310np125.tar.bz2 - ubuntu311: + ubuntu310-moco: runs-on: ubuntu-20.04 steps: @@ -283,18 +130,18 @@ jobs: - uses: conda-incubator/setup-miniconda@v2 with: auto-update-conda: true - python-version: '3.11' + python-version: '3.10' channels: conda-forge,defaults miniconda-version: "latest" - name: Install Python packages uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: '3.10' - name: Install numpy #Need numpy to use SWIG numpy typemaps. - run: python3 -m pip install numpy==1.23 + run: python3 -m pip install numpy==1.25 - 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 @@ -302,8 +149,8 @@ jobs: - 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 + wget https://github.com/swig/swig/archive/refs/tags/v4.1.1.tar.gz + tar xzf v4.1.1.tar.gz && cd swig-4.1.1 sh autogen.sh && ./configure --prefix=$HOME/swig --disable-ccache make && make -j4 install @@ -312,14 +159,14 @@ jobs: - name: Conda build run: | - cd $GITHUB_WORKSPACE/opensim + cd $GITHUB_WORKSPACE/opensim-moco 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 + name: linux64-opensim-moco-4.5.1-py310np125.tar.bz2 + path: /usr/share/miniconda3/conda-bld/linux-64/opensim-moco-4.5.1-py310np125.tar.bz2 style: name: Style diff --git a/opensim-moco/bld.bat b/opensim-moco/bld.bat new file mode 100644 index 0000000..90e0433 --- /dev/null +++ b/opensim-moco/bld.bat @@ -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 + diff --git a/opensim-moco/build.sh b/opensim-moco/build.sh new file mode 100644 index 0000000..50d9b43 --- /dev/null +++ b/opensim-moco/build.sh @@ -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.1.1 +else + SWIG_DIR_SPEC=/home/runner/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=/home/runner/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 diff --git a/opensim-moco/conda_build_config.yaml b/opensim-moco/conda_build_config.yaml new file mode 100644 index 0000000..ae7f3b4 --- /dev/null +++ b/opensim-moco/conda_build_config.yaml @@ -0,0 +1,19 @@ +MACOSX_DEPLOYMENT_TARGET: '10.10' +python: + - 3.10 +numpy: + - 1.25.* +zip_keys: + - python + - numpy +c_compiler: + - vs2019 # [win] + - clang # [osx] + - gcc # [linux] +cxx_compiler: + - vs2019 # [win] + - clangxx # [osx] + - gxx # [linux] +fortran_compiler: + - gfortran # [linux] + diff --git a/opensim-moco/meta.yaml b/opensim-moco/meta.yaml new file mode 100644 index 0000000..332f9b5 --- /dev/null +++ b/opensim-moco/meta.yaml @@ -0,0 +1,53 @@ +{% set version = "4.5.1" %} + +package: + name: opensim-moco + version: {{ version }} + +source: + git_url: https://github.com/opensim-org/opensim-core.git + git_rev: main +build: + number: 1 + # NOTE : For C++11 builds, vc16/VS 2019 are the only acceptable targets + features: + - 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: + host: + - openblas # [not win] + build: + - toolchain 2.4.0 0 # [win] + #- wheel 0.36.2 pyhd3eb1b0_0 + # - swig 4.1.1 + - {{ compiler("cxx") }} + - {{ compiler('fortran') }} + - cmake + - numpy {{ numpy }} + - python {{ python }} + - openblas # [not win] + - make # [not win] + + run: + - numpy {{ numpy }} + - python {{ python }} + - freeglut # [win] + - openblas # [not win] + +test: + imports: + - opensim + +about: + home: http://opensim.stanford.edu + license: Apache-2.0 + summary: > + OpenSim is software that lets users develop models of musculoskeletal + structures and create dynamic simulations of movement. + +extra: + recipe-maintainers: + - aymanhab diff --git a/opensim/build.sh b/opensim/build.sh index a14f9d3..47b06dc 100644 --- a/opensim/build.sh +++ b/opensim/build.sh @@ -7,7 +7,7 @@ cmake ../dependencies/ -LAH \ -DCMAKE_INSTALL_LIBDIR=lib \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_OSX_SYSROOT=${CONDA_BUILD_SYSROOT} \ - -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=\ -DSUPERBUILD_docopt=ON \ -DSUPERBUILD_simbody=ON \ -DSUPERBUILD_spdlog=ON \ @@ -23,7 +23,7 @@ cd .. if [ "$(uname)" == "Darwin" ]; then SWIG_DIR_SPEC=/usr/local/Cellar/swig/4.0.2 else - SWIG_DIR_SPEC=~/swig/share/swig + SWIG_DIR_SPEC=/home/runner/swig/ fi # TODO: Tests are missing! mkdir opensim_build @@ -34,9 +34,9 @@ cmake ../ \ -DCMAKE_BUILD_TYPE=Release \ -DOPENSIM_DEPENDENCIES_DIR="$PREFIX" \ -DCMAKE_OSX_SYSROOT=${CONDA_BUILD_SYSROOT} \ - -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \ + -DCMAKE_OSX_DEPLOYMENT_TARGET= \ -DSWIG_DIR=${SWIG_DIR_SPEC} \ - -DSWIG_EXECUTABLE=~/swig/bin/swig \ + -DSWIG_EXECUTABLE=/home/runner/swig/bin/swig \ -DBUILD_PYTHON_WRAPPING=ON \ -DOPENSIM_DISABLE_LOG_FILE=ON \ -DOPENSIM_C3D_PARSER=ezc3d \ diff --git a/opensim/conda_build_config.yaml b/opensim/conda_build_config.yaml index 3462e25..0f176d3 100644 --- a/opensim/conda_build_config.yaml +++ b/opensim/conda_build_config.yaml @@ -1,13 +1,14 @@ -MACOSX_DEPLOYMENT_TARGET: '10.10' +MACOSX_DEPLOYMENT_TARGET: '12' python: - - 3.10 - - 3.11 + - 3.10 + numpy: - - 1.21 - - 1.23 + - 1.25 + zip_keys: - python - numpy + c_compiler: - vs2019 # [win] - clang # [osx] @@ -16,10 +17,3 @@ 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 - diff --git a/opensim/meta.yaml b/opensim/meta.yaml index 951de43..818376c 100644 --- a/opensim/meta.yaml +++ b/opensim/meta.yaml @@ -1,4 +1,4 @@ -{% set version = "4.4" %} +{% set version = "4.5.1" %} package: name: opensim @@ -6,9 +6,9 @@ package: source: git_url: https://github.com/opensim-org/opensim-core.git - git_rev: branch_4.4_conda + git_rev: main build: - number: 2 + number: 1 # NOTE : For C++11 builds, vc16/VS 2019 are the only acceptable targets features: - vc16 # [win and py39] @@ -22,7 +22,6 @@ requirements: build: - toolchain 2.4.0 0 # [win] #- wheel 0.36.2 pyhd3eb1b0_0 - - swig 4.0.2 - cmake >=3.15,<3.25 - numpy {{ numpy }} - python {{ python }} @@ -38,8 +37,8 @@ requirements: - openblas # [not win] test: - # imports: - # - opensim + imports: + - opensim about: home: http://opensim.stanford.edu