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_py support for latest GCC compiler #254

Closed
JulianYG opened this issue May 12, 2018 · 20 comments
Closed

Mujoco_py support for latest GCC compiler #254

JulianYG opened this issue May 12, 2018 · 20 comments

Comments

@JulianYG
Copy link

In mujoco_py/builder.py line 302, in _build_impl 'Could not find GCC 6 or GCC 7 executable.\n\n'
RuntimeError: Could not find GCC 6 or GCC 7 executable.
Since I've updated my gcc to 8.1.0.

@TCtobychen
Copy link

same issue

@cassanolucas
Copy link

Same issue. Any known solutions?

@TeaPearce
Copy link

snap

@JulianYG
Copy link
Author

JulianYG commented Jun 4, 2018

I solved it by copying out the error commands and manually forcing it to use another gcc 7 compiler. However, it would be great if we can have gcc 8 support, thanks!

@iandanforth
Copy link

Another work around on OSX is to use brew to install another version of GCC

brew install gcc@6

This worked for me with other versions installed as well. Note gcc@7 did not work immediately so I went with 6.

@xiyacao
Copy link

xiyacao commented Aug 14, 2018

Another solution works very well with macOS:

brew install gcc@6
or
brew install gcc@7

pip uninstall mujoco_py
pip install mujoco_py

it will help you get the correct directory of gcc7 or gcc6 when you first import mujoco_py cause it writes the .so files for you when you import mujoco_py the first time

@arpit15
Copy link

arpit15 commented Aug 14, 2018

To add support for gcc 8 change this line to

c_compilers = ['/usr/local/bin/gcc-6', '/usr/local/bin/gcc-7','/usr/local/bin/gcc-8']

@JulianYG @TCtobychen @cassanolucas @TeaPearce

@pavyedav
Copy link

At @arpit15 , what were the steps you took after adding gcc-8 to c_compilers? I still get the error:

>>> import mujoco_py Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.6/site-packages/mujoco_py/__init__.py", line 1, in <module> from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException File "/usr/local/lib/python3.6/site-packages/mujoco_py/builder.py", line 468, in <module> cymj = load_cython_ext(mjpro_path) File "/usr/local/lib/python3.6/site-packages/mujoco_py/builder.py", line 90, in load_cython_ext cext_so_path = builder.build() File "/usr/local/lib/python3.6/site-packages/mujoco_py/builder.py", line 202, in build built_so_file_path = self._build_impl() File "/usr/local/lib/python3.6/site-packages/mujoco_py/builder.py", line 302, in _build_impl 'Could not find GCC 6 or GCC 7 executable.\n\n' RuntimeError: Could not find GCC 6 or GCC 7 executable.

Seems like I need to do something (like a compile) after saving that change.

@phaniram-sayapaneni
Copy link

brew install gcc@6
or
brew install gcc@7

pip uninstall mujoco_py
pip install mujoco_py

Did not work for me, any suggestions please? I get the following error:
istutils.errors.CompileError: command '/usr/local/bin/gcc-6' failed with exit status 1

@phaniram-sayapaneni
Copy link

Also tried to set the compilers to gcc-8
Still getting the error:
CompileError: command '/usr/local/bin/gcc-8' failed with exit status 1

@machinaut
Copy link
Contributor

Merged a fix to this, latest mujoco-py works with latest homebrew GCC!

@phaniram-sayapaneni
Copy link

Great!

Thanks a lot!!

@ali-chaudhry8
Copy link

Hi, I am getting this error:
"distutils.errors.CompileError: command '/usr/local/bin/gcc-6' failed with exit status 1"
Tried re installing Mujoco, installed GCC7 and 8, but this issue persists. Please help...

@marjanin
Copy link

Hi, I am getting this error:
"distutils.errors.CompileError: command '/usr/local/bin/gcc-6' failed with exit status 1"
Tried re installing Mujoco, installed GCC7 and 8, but this issue persists. Please help...

Hi,
I am getting the same error on Mac. Did you find a solution?

@marjanin
Copy link

It worked once I installed the pkg mentioned here:
https://stackoverflow.com/questions/51274905/brew-install-on-mojave

@dmalpica
Copy link

dmalpica commented Aug 8, 2019

It's August 2019. Had this issue with gcc-9

brew install gcc@8 worked for me

@newuhe
Copy link

newuhe commented Nov 22, 2019

To add support for gcc 8 change this line to

c_compilers = ['/usr/local/bin/gcc-6', '/usr/local/bin/gcc-7','/usr/local/bin/gcc-8']

@JulianYG @TCtobychen @cassanolucas @TeaPearce

this works for me, gcc9

@emimarz
Copy link

emimarz commented Dec 17, 2019

same issue gcc 9
RuntimeError: Could not find GCC executable.

@imrancharania
Copy link

Using gcc 8 seems to have resolved this issue for me.

@wookayin
Copy link
Contributor

wookayin commented Dec 7, 2021

Another workaround (perhaps most the easiest solution) is to use CC environment variable. (see #651 as well)

export CC=/usr/local/bin/gcc-11 
python -c "import mujoco_py"     # to initiate Cython build_ext

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests