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

The new release of MuJoCo wants the build library to be /path/to/mujo… #667

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
18 changes: 9 additions & 9 deletions mujoco_py/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ def __init__(self, mujoco_path):
join(mujoco_path, 'include'),
np.get_include(),
],
libraries=['mujoco210'],
library_dirs=[join(mujoco_path, 'bin')],
libraries=['mujoco'],
library_dirs=[join(mujoco_path, 'lib')],
extra_compile_args=[
'-fopenmp', # needed for OpenMP
'-w', # suppress numpy compilation warnings
Expand Down Expand Up @@ -272,12 +272,12 @@ def __init__(self, mujoco_path):
self.extension.sources.append(
join(self.CYMJ_DIR_PATH, "gl", "osmesashim.c"))
self.extension.libraries.extend(['glewosmesa', 'OSMesa', 'GL'])
self.extension.runtime_library_dirs = [join(mujoco_path, 'bin')]
self.extension.runtime_library_dirs = [join(mujoco_path, 'lib')]

def _build_impl(self):
so_file_path = super()._build_impl()
# Removes absolute paths to libraries. Allows for dynamic loading.
fix_shared_library(so_file_path, 'libmujoco210.so', 'libmujoco210.so')
fix_shared_library(so_file_path, 'libmujoco.so', 'libmujoco.so')
fix_shared_library(so_file_path, 'libglewosmesa.so', 'libglewosmesa.so')
return so_file_path

Expand All @@ -290,13 +290,13 @@ def __init__(self, mujoco_path):
self.extension.sources.append(self.CYMJ_DIR_PATH + "/gl/eglshim.c")
self.extension.include_dirs.append(self.CYMJ_DIR_PATH + '/vendor/egl')
self.extension.libraries.extend(['glewegl'])
self.extension.runtime_library_dirs = [join(mujoco_path, 'bin')]
self.extension.runtime_library_dirs = [join(mujoco_path, 'lib')]

def _build_impl(self):
so_file_path = super()._build_impl()
fix_shared_library(so_file_path, 'libOpenGL.so', 'libOpenGL.so.0')
fix_shared_library(so_file_path, 'libEGL.so', 'libEGL.so.1')
fix_shared_library(so_file_path, 'libmujoco210.so', 'libmujoco210.so')
fix_shared_library(so_file_path, 'libmujoco.so', 'libmujoco.so')
fix_shared_library(so_file_path, 'libglewegl.so', 'libglewegl.so')
return so_file_path

Expand All @@ -309,7 +309,7 @@ def __init__(self, mujoco_path):
self.extension.sources.append(self.CYMJ_DIR_PATH + "/gl/dummyshim.c")
self.extension.libraries.extend(['glfw.3'])
self.extension.define_macros = [('ONMAC', None)]
self.extension.runtime_library_dirs = [join(mujoco_path, 'bin')]
self.extension.runtime_library_dirs = [join(mujoco_path, 'lib')]

def _build_impl(self):
if not os.environ.get('CC'):
Expand Down Expand Up @@ -482,8 +482,8 @@ def build_callback_fn(function_string, userdata_names=[]):
# Link against mujoco so we can call mujoco functions from within callback
ffibuilder.set_source(name, source_string,
include_dirs=[join(mujoco_path, 'include')],
library_dirs=[join(mujoco_path, 'bin')],
libraries=['mujoco210'])
library_dirs=[join(mujoco_path, 'lib')],
libraries=['mujoco'])
# Catch compilation exceptions so we can cleanup partial files in that case
try:
library_path = ffibuilder.compile(verbose=True)
Expand Down