diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index 8a0bcae..13e526a 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -35,7 +35,7 @@ jobs: - script: | call activate base - mamba.exe install 'python=3.9' conda-build conda pip boa 'conda-forge-ci-setup=3' -c conda-forge --strict-channel-priority --yes + mamba.exe install "python=3.9" conda-build conda pip boa conda-forge-ci-setup=3 "py-lief<0.12" -c conda-forge --strict-channel-priority --yes displayName: Install conda-build - script: set PYTHONUNBUFFERED=1 diff --git a/.ci_support/linux_64_.yaml b/.ci_support/linux_64_.yaml index 2b4cb1e..8c286d9 100644 --- a/.ci_support/linux_64_.yaml +++ b/.ci_support/linux_64_.yaml @@ -20,7 +20,6 @@ numpy: - '1.21' - '1.20' - '1.20' -- '1.20' pin_run_as_build: python: min_pin: x.x @@ -29,7 +28,6 @@ pybind11_abi: - '4' python: - 3.10.* *_cpython -- 3.7.* *_cpython - 3.8.* *_cpython - 3.9.* *_cpython target_platform: diff --git a/.ci_support/linux_aarch64_.yaml b/.ci_support/linux_aarch64_.yaml index cf6c107..6729dea 100644 --- a/.ci_support/linux_aarch64_.yaml +++ b/.ci_support/linux_aarch64_.yaml @@ -24,7 +24,6 @@ numpy: - '1.21' - '1.20' - '1.20' -- '1.20' pin_run_as_build: python: min_pin: x.x @@ -33,7 +32,6 @@ pybind11_abi: - '4' python: - 3.10.* *_cpython -- 3.7.* *_cpython - 3.8.* *_cpython - 3.9.* *_cpython target_platform: diff --git a/.ci_support/osx_64_.yaml b/.ci_support/osx_64_.yaml index d9abf0e..9009f7f 100644 --- a/.ci_support/osx_64_.yaml +++ b/.ci_support/osx_64_.yaml @@ -1,5 +1,5 @@ MACOSX_DEPLOYMENT_TARGET: -- '10.9' +- '10.14' MACOSX_SDK_VERSION: - '10.15' abseil_cpp: @@ -22,7 +22,6 @@ numpy: - '1.21' - '1.20' - '1.20' -- '1.20' pin_run_as_build: python: min_pin: x.x @@ -31,7 +30,6 @@ pybind11_abi: - '4' python: - 3.10.* *_cpython -- 3.7.* *_cpython - 3.8.* *_cpython - 3.9.* *_cpython target_platform: diff --git a/.ci_support/win_64_.yaml b/.ci_support/win_64_.yaml index 7e1c0f5..5559f13 100644 --- a/.ci_support/win_64_.yaml +++ b/.ci_support/win_64_.yaml @@ -12,7 +12,6 @@ numpy: - '1.21' - '1.20' - '1.20' -- '1.20' pin_run_as_build: python: min_pin: x.x @@ -21,7 +20,6 @@ pybind11_abi: - '4' python: - 3.10.* *_cpython -- 3.7.* *_cpython - 3.8.* *_cpython - 3.9.* *_cpython target_platform: diff --git a/.circleci/config.yml b/.circleci/config.yml index 3e61aa2..8b4ef2f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,6 @@ # This file was generated automatically from conda-smithy. To update this configuration, # update the conda-forge.yml and/or the recipe/meta.yaml. -# -*- mode: yaml -*- +# -*- mode: jinja-yaml -*- version: 2 diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index a6b09f6..84431a6 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -33,9 +33,9 @@ CONDARC mamba install --update-specs --yes --quiet --channel conda-forge \ - conda-build pip boa conda-forge-ci-setup=3 + conda-build pip boa conda-forge-ci-setup=3 "py-lief<0.12" mamba update --update-specs --yes --quiet --channel conda-forge \ - conda-build pip boa conda-forge-ci-setup=3 + conda-build pip boa conda-forge-ci-setup=3 "py-lief<0.12" # set up the condarc setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index 736a39a..b3abaeb 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -23,11 +23,10 @@ bash $MINIFORGE_FILE -b -p ${MINIFORGE_HOME} source ${MINIFORGE_HOME}/etc/profile.d/conda.sh conda activate base -echo -e "\n\nInstalling ['conda-forge-ci-setup=3'] and conda-build." mamba install --update-specs --quiet --yes --channel conda-forge \ - conda-build pip boa conda-forge-ci-setup=3 + conda-build pip boa conda-forge-ci-setup=3 "py-lief<0.12" mamba update --update-specs --yes --quiet --channel conda-forge \ - conda-build pip boa conda-forge-ci-setup=3 + conda-build pip boa conda-forge-ci-setup=3 "py-lief<0.12" diff --git a/README.md b/README.md index 4f61e9d..4eab779 100644 --- a/README.md +++ b/README.md @@ -30,42 +30,42 @@ Current build status linux_64 - variant + variant linux_aarch64 - variant + variant linux_ppc64le - variant + variant osx_64 - variant + variant osx_arm64 - variant + variant win_64 - variant + variant diff --git a/recipe/bld_cxx.bat b/recipe/bld_cxx.bat index 068477d..ffa9b1d 100644 --- a/recipe/bld_cxx.bat +++ b/recipe/bld_cxx.bat @@ -16,6 +16,7 @@ cmake ^ -DMUJOCO_ENABLE_AVX:BOOL=OFF ^ -DMUJOCO_ENABLE_AVX_INTRINSICS:BOOL=OFF ^ -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=OFF ^ + -DMUJOCO_INSTALL_PLUGINS:BOOL=ON ^ %SRC_DIR% if errorlevel 1 exit 1 @@ -30,3 +31,5 @@ if errorlevel 1 exit 1 :: Test. ctest --output-on-failure -C Release if errorlevel 1 exit 1 + + diff --git a/recipe/bld_py.bat b/recipe/bld_py.bat index 5902d0e..b0b66b1 100644 --- a/recipe/bld_py.bat +++ b/recipe/bld_py.bat @@ -19,5 +19,6 @@ mkdir %SRC_DIR%\tempbuilddir set TEMP=%SRC_DIR%\tempbuilddir cd dist set MUJOCO_PATH=%PREFIX%\Library +set MUJOCO_PLUGIN_PATH=%MUJOCO_PATH%\bin\mujoco_plugin python -m pip install --no-deps mujoco-%PKG_VERSION%.tar.gz if errorlevel 1 exit 1 diff --git a/recipe/build_cxx.sh b/recipe/build_cxx.sh index 3db6f92..21dc121 100644 --- a/recipe/build_cxx.sh +++ b/recipe/build_cxx.sh @@ -14,6 +14,7 @@ cmake ${CMAKE_ARGS} -GNinja .. \ -DMUJOCO_ENABLE_AVX:BOOL=OFF \ -DMUJOCO_ENABLE_AVX_INTRINSICS:BOOL=OFF \ -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=ON \ + -DMUJOCO_INSTALL_PLUGINS:BOOL=ON \ .. cmake --build . --config Release diff --git a/recipe/build_py.sh b/recipe/build_py.sh index 0f22608..484f1dd 100644 --- a/recipe/build_py.sh +++ b/recipe/build_py.sh @@ -1,7 +1,13 @@ #!/bin/sh +if [[ "${target_platform}" == osx-* ]]; then + # See https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk + CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" +fi + cd $SRC_DIR/python bash make_sdist.sh cd dist export MUJOCO_PATH=$PREFIX +export MUJOCO_PLUGIN_PATH=$PREFIX/bin/mujoco_plugin python -m pip install --no-deps mujoco-*.tar.gz diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index 1c0fe4e..6c24ad9 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -1,2 +1,4 @@ MACOSX_SDK_VERSION: # [osx and x86_64] - "10.15" # [osx and x86_64] +MACOSX_DEPLOYMENT_TARGET: # [osx and x86_64] + - "10.14" # [osx and x86_64] diff --git a/recipe/disable_copy_cxx_files_in_python_package.patch b/recipe/disable_copy_cxx_files_in_python_package.patch index ddc9f43..5054794 100644 --- a/recipe/disable_copy_cxx_files_in_python_package.patch +++ b/recipe/disable_copy_cxx_files_in_python_package.patch @@ -1,21 +1,23 @@ diff --git a/python/setup.py b/python/setup.py -index d6291fd..653f3c6 100644 +index 2327f35cb..f8015a21b 100644 --- a/python/setup.py +++ b/python/setup.py -@@ -146,8 +146,8 @@ def run(self): +@@ -156,9 +156,9 @@ def run(self): assert ext.name.startswith(EXT_PREFIX) assert '.' not in ext.name[len(EXT_PREFIX):] self.build_extension(ext) - self._copy_external_libraries() - self._copy_mujoco_headers() +- self._copy_plugin_libraries() + #self._copy_external_libraries() + #self._copy_mujoco_headers() ++ #self._copy_plugin_libraries() def _find_mujoco(self): if MUJOCO_PATH not in os.environ: diff --git a/python/mujoco/__init__.py b/python/mujoco/__init__.py -index e33a132..1aa6559 100644 +index 5fb63ec44..3db713d28 100644 --- a/python/mujoco/__init__.py +++ b/python/mujoco/__init__.py @@ -22,7 +22,7 @@ @@ -27,3 +29,53 @@ index e33a132..1aa6559 100644 from mujoco._callbacks import * from mujoco._constants import * +@@ -53,8 +53,13 @@ + else: + from mujoco.glfw import GLContext + +-HEADERS_DIR = os.path.join(os.path.dirname(__file__), 'include/mujoco') +-PLUGINS_DIR = os.path.join(os.path.dirname(__file__), 'plugin') ++if _SYSTEM == 'Windows': ++ _MJ_INSTALL_DIR = os.path.join(os.environ.get('CONDA_PREFIX'), 'Library') ++else: ++ _MJ_INSTALL_DIR = os.environ.get('CONDA_PREFIX') ++ ++HEADERS_DIR = os.path.join(_MJ_INSTALL_DIR, 'include/mujoco') ++PLUGINS_DIR = os.path.join(_MJ_INSTALL_DIR, 'bin/mujoco_plugin') + + PLUGIN_HANDLES = [] + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f7473cf3c..75f29a143 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -42,6 +42,7 @@ option(MUJOCO_BUILD_EXAMPLES "Build samples for MuJoCo" ON) + option(MUJOCO_BUILD_SIMULATE "Build simulate library for MuJoCo" ON) + option(MUJOCO_BUILD_TESTS "Build tests for MuJoCo" ON) + option(MUJOCO_TEST_PYTHON_UTIL "Build and test utility libraries for Python bindings" ON) ++option(MUJOCO_INSTALL_PLUGINS "Install MuJoCo plugins" OFF) + + if(APPLE AND (MUJOCO_BUILD_EXAMPLES OR MUJOCO_BUILD_SIMULATE)) + enable_language(OBJC) +diff --git a/plugin/elasticity/CMakeLists.txt b/plugin/elasticity/CMakeLists.txt +index 7d25ffcf5..2be85c56a 100644 +--- a/plugin/elasticity/CMakeLists.txt ++++ b/plugin/elasticity/CMakeLists.txt +@@ -39,3 +39,17 @@ target_link_options( + ${MUJOCO_MACOS_LINK_OPTIONS} + ${EXTRA_LINK_OPTIONS} + ) ++ ++if(MUJOCO_INSTALL_PLUGINS) ++ if(WIN32) ++ install(TARGETS cable ++ ARCHIVE DESTINATION "$ENV{TEMP}" ++ LIBRARY DESTINATION "$ENV{TEMP}" ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}/mujoco_plugin") ++ else() ++ install(TARGETS cable ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_BINDIR}/mujoco_plugin" ++ LIBRARY DESTINATION "${CMAKE_INSTALL_BINDIR}/mujoco_plugin" ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}/mujoco_plugin") ++ endif() ++endif() diff --git a/recipe/macosmin1014.patch b/recipe/macosmin1014.patch new file mode 100644 index 0000000..e2e02b2 --- /dev/null +++ b/recipe/macosmin1014.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/MujocoMacOS.cmake b/cmake/MujocoMacOS.cmake +index d2f378f6a..ce1a55dc9 100644 +--- a/cmake/MujocoMacOS.cmake ++++ b/cmake/MujocoMacOS.cmake +@@ -14,7 +14,7 @@ + + if(APPLE) + # 10.12 is the oldest version of macOS that supports C++17, launched 2016. +- set(MUJOCO_MACOSX_VERSION_MIN 10.12) ++ set(MUJOCO_MACOSX_VERSION_MIN 10.14) + + # We are setting the -mmacosx-version-min compiler flag directly rather than using the + # CMAKE_OSX_DEPLOYMENT_TARGET variable since we do not want to affect choice of SDK, diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 36c3607..1154d70 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,7 +1,7 @@ {% set name = "mujoco" %} {% set namecxx = "mujoco-cxx" %} {% set namepython = "mujoco-python" %} -{% set version = "2.2.2" %} +{% set version = "2.3.0" %} package: name: {{ name }} @@ -9,7 +9,7 @@ package: source: url: https://github.com/deepmind/mujoco/archive/refs/tags/{{ version }}.tar.gz - sha256: 7aad590d2ec6056f0235021e493db014784452538e45513c4c022de22d8270b0 + sha256: a9cc2c09c0d462c270d895cb06ffc1a78897117430f88efa978ec3b7bb454488 patches: - python_remove_avx.patch - python_remove_werror.patch @@ -18,6 +18,7 @@ source: - ccd_vec3_origin_link_problem.patch - disable_copy_cxx_files_in_python_package.patch - do_not_install_via_pip.patch + - macosmin1014.patch build: @@ -57,9 +58,13 @@ outputs: commands: - test -f ${PREFIX}/include/mujoco/mujoco.h # [not win] - test -f ${PREFIX}/lib/libmujoco${SHLIB_EXT} # [unix] + - test -f ${PREFIX}/bin/mujoco_plugin/libcable${SHLIB_EXT} # [unix] - if not exist %LIBRARY_INC%\\mujoco\\mujoco.h exit 1 # [win] - if not exist %LIBRARY_LIB%\\mujoco.lib exit 1 # [win] - if not exist %LIBRARY_BIN%\\mujoco.dll exit 1 # [win] + - if not exist %LIBRARY_BIN%\\mujoco_plugin\\cable.dll exit 1 # [win] + - if exist %LIBRARY_BIN%\\mujoco_plugin\\cable.lib exit 1 # [win] + - name: {{ namepython }} build: