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

mujoco v2.3.0 #10

Merged
merged 25 commits into from
Nov 29, 2022
Merged
Changes from 17 commits
Commits
Show all changes
25 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
2 changes: 1 addition & 1 deletion .azure-pipelines/azure-pipelines-win.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .ci_support/linux_64_.yaml
Original file line number Diff line number Diff line change
@@ -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:
2 changes: 0 additions & 2 deletions .ci_support/linux_aarch64_.yaml
Original file line number Diff line number Diff line change
@@ -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:
4 changes: 1 addition & 3 deletions .ci_support/osx_64_.yaml
Original file line number Diff line number Diff line change
@@ -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:
2 changes: 0 additions & 2 deletions .ci_support/win_64_.yaml
Original file line number Diff line number Diff line change
@@ -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:
2 changes: 1 addition & 1 deletion .circleci/config.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .scripts/build_steps.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions .scripts/run_osx_build.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions recipe/bld_cxx.bat
Original file line number Diff line number Diff line change
@@ -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

1 change: 1 addition & 0 deletions recipe/bld_py.bat
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions recipe/build_cxx.sh
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions recipe/build_py.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -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]
51 changes: 48 additions & 3 deletions recipe/disable_copy_cxx_files_in_python_package.patch
Original file line number Diff line number Diff line change
@@ -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,46 @@ 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,10 @@ target_link_options(
${MUJOCO_MACOS_LINK_OPTIONS}
${EXTRA_LINK_OPTIONS}
)
+
+if(MUJOCO_INSTALL_PLUGINS)
+ 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()
13 changes: 13 additions & 0 deletions recipe/macosmin1014.patch
Original file line number Diff line number Diff line change
@@ -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,
5 changes: 3 additions & 2 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{% set name = "mujoco" %}
{% set namecxx = "mujoco-cxx" %}
{% set namepython = "mujoco-python" %}
{% set version = "2.2.2" %}
{% set version = "2.3.0" %}

package:
name: {{ name }}
version: {{ version }}

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: