stan-dev/pystan2

distutils.errors.CompileError: command 'gcc_linux-64' failed with exit status 1

pzhao28 opened this issue · 3 comments

Summary:

Please provide a short couple sentence summary.
I'm trying to install the mujoco_py following the instructions. It seems successfully installed, but when I try to import mujoco_py in python, it comes out the following error:
"distutils.errors.DistutilsExecError: command 'gcc_linux-64' failed with exit status 1
"

Description:

I have the following error:

running build_ext
building 'mujoco_py.cymj' extension
gcc_linux-64 -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/pzhao28/anaconda3/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/pzhao28/anaconda3/include -fPIC -Imujoco_py -I/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py -I/home/pzhao28/.mujoco/mujoco200/include -I/home/pzhao28/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/vendor/egl -I/home/pzhao28/anaconda3/include/python3.7m -c /home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/cymj.c -o /home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/generated/_pyxbld_2.0.2.10_37_linuxgpuextensionbuilder/temp.linux-x86_64-3.7/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/cymj.o -fopenmp -w
unable to execute 'gcc_linux-64': No such file or directory
Traceback (most recent call last):
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/unixccompiler.py", line 118, in _compile
extra_postargs)
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/spawn.py", line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'gcc_linux-64' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/init.py", line 3, in
from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
File "/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/builder.py", line 510, in
cymj = load_cython_ext(mujoco_path)
File "/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/builder.py", line 105, in load_cython_ext
cext_so_path = builder.build()
File "/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/builder.py", line 221, in build
built_so_file_path = self._build_impl()
File "/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/builder.py", line 291, in _build_impl
so_file_path = super()._build_impl()
File "/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/builder.py", line 244, in _build_impl
dist.run_commands()
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/pzhao28/anaconda3/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/builder.py", line 144, in build_extensions
build_ext.build_extensions(self)
File "/home/pzhao28/anaconda3/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
_build_ext.build_ext.build_extensions(self)
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/command/build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/command/build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/command/build_ext.py", line 534, in build_extension
depends=ext.depends)
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/unixccompiler.py", line 120, in _compile
raise CompileError(msg)
distutils.errors.CompileError: command 'gcc_linux-64' failed with exit status 1

gcc Version:

gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609

Python Version:

3.7.4

Operating System:

ubuntu 16.04 LTS

Hi, I think there might be a bit misleading bits on the docs

unable to execute 'gcc_linux-64': No such file or directory

Have you done

conda install gcc_linux-64 gxx_linux-64 -c anaconda

And then test the compiler with (write x86_64 and press tab to see the correct name) << this on a command line

x86_64-conda_cos6-linux-gnu-gcc --version

Then do

export CC=x86_64-conda_cos6-linux-gnu-gcc
export CXX=x86_64-conda_cos6-linux-gnu-g++

Hi, I think there might be a bit misleading bits on the docs

unable to execute 'gcc_linux-64': No such file or directory

Have you done

conda install gcc_linux-64 gxx_linux-64 -c anaconda

And then test the compiler with (write x86_64 and press tab to see the correct name) << this on a command line

x86_64-conda_cos6-linux-gnu-gcc --version

Then do

export CC=x86_64-conda_cos6-linux-gnu-gcc
export CXX=x86_64-conda_cos6-linux-gnu-g++

Thank you for your response. I've done this, but the errors are still there:

running build_ext
building 'mujoco_py.cymj' extension
x86_64-conda_cos6-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/pzhao28/anaconda3/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/pzhao28/anaconda3/include -fPIC -Imujoco_py -I/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py -I/home/pzhao28/.mujoco/mujoco200/include -I/home/pzhao28/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/vendor/egl -I/home/pzhao28/anaconda3/include/python3.7m -c /home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/cymj.c -o /home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/generated/_pyxbld_2.0.2.10_37_linuxgpuextensionbuilder/temp.linux-x86_64-3.7/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/cymj.o -fopenmp -w
x86_64-conda_cos6-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/pzhao28/anaconda3/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/pzhao28/anaconda3/include -fPIC -Imujoco_py -I/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py -I/home/pzhao28/.mujoco/mujoco200/include -I/home/pzhao28/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/vendor/egl -I/home/pzhao28/anaconda3/include/python3.7m -c /home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/gl/eglshim.c -o /home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/generated/_pyxbld_2.0.2.10_37_linuxgpuextensionbuilder/temp.linux-x86_64-3.7/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/gl/eglshim.o -fopenmp -w
In file included from /home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/gl/egl.h:39:0,
from /home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/gl/eglshim.c:2:
/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/gl/eglplatform.h:99:10: fatal error: X11/Xlib.h: No such file or directory
#include <X11/Xlib.h>
^~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/unixccompiler.py", line 118, in _compile
extra_postargs)
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/spawn.py", line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'x86_64-conda_cos6-linux-gnu-gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/init.py", line 3, in
from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
File "/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/builder.py", line 510, in
cymj = load_cython_ext(mujoco_path)
File "/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/builder.py", line 105, in load_cython_ext
cext_so_path = builder.build()
File "/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/builder.py", line 221, in build
built_so_file_path = self._build_impl()
File "/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/builder.py", line 291, in _build_impl
so_file_path = super()._build_impl()
File "/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/builder.py", line 244, in _build_impl
dist.run_commands()
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/pzhao28/anaconda3/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/home/pzhao28/Documents/Research/Software/deep-RL/mujoco-py-master/mujoco_py/builder.py", line 144, in build_extensions
build_ext.build_extensions(self)
File "/home/pzhao28/anaconda3/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
_build_ext.build_ext.build_extensions(self)
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/command/build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/command/build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/command/build_ext.py", line 534, in build_extension
depends=ext.depends)
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/home/pzhao28/anaconda3/lib/python3.7/distutils/unixccompiler.py", line 120, in _compile
raise CompileError(msg)
distutils.errors.CompileError: command 'x86_64-conda_cos6-linux-gnu-gcc' failed with exit status 1

New error

fatal error: X11/Xlib.h: No such file or directory
#include <X11/Xlib.h>

Try

sudo apt install libx11-dev

I think that error is not coming from pystan anymore.