in mujoco_py/builder.py [0:0]
def _build_impl(self):
if not os.environ.get('CC'):
# Known-working versions of GCC on mac (prefer latest one)
c_compilers = [
'/usr/local/bin/gcc-9',
'/usr/local/bin/gcc-8',
'/usr/local/bin/gcc-7',
'/usr/local/bin/gcc-6',
'/opt/local/bin/gcc-mp-9',
'/opt/local/bin/gcc-mp-8',
'/opt/local/bin/gcc-mp-7',
'/opt/local/bin/gcc-mp-6',
]
available_c_compiler = None
for c_compiler in c_compilers:
if distutils.spawn.find_executable(c_compiler) is not None:
available_c_compiler = c_compiler
break
if available_c_compiler is None:
raise RuntimeError(
'Could not find supported GCC executable.\n\n'
'HINT: On OS X, install GCC 9.x with '
'`brew install gcc@9`. or '
'`port install gcc9`.')
os.environ['CC'] = available_c_compiler
so_file_path = super()._build_impl()
del os.environ['CC']
else: # User-directed c compiler
so_file_path = super()._build_impl()
return manually_link_libraries(self.mujoco_path, so_file_path)