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

Building failed on Ubuntu14.04 #35

Closed
jingweiz opened this issue Jan 17, 2017 · 7 comments
Closed

Building failed on Ubuntu14.04 #35

jingweiz opened this issue Jan 17, 2017 · 7 comments

Comments

@jingweiz
Copy link

Hey,
I'm trying to build lab on my machine by bazel build :deepmind_lab.so --define headless=glx --verbose_failures but failed so far. I came across these errors so far:

  1. "mount" permission denied
    fixed by: adding build --spawn_strategy=standalone to /etc/bazel.bazelrc
  2. python/dmlab_module.c:29:31: fatal error: numpy/arrayobject.h: No such file or directory
    fixed by: adding the following to copt in BUILD: "-I/usr/local/lib/python2.7/dist-packages/numpy/core/include",
  3. configure: error: cannot run C compiled programs.
    have no clue how to fix... below I paste the complete error message below:
INFO: Found 1 target...
ERROR: /home/zhang/.cache/bazel/_bazel_zhang/2f9f084266361be2ea70187ad5c14f49/external/glib_archive/BUILD:1:1: Executing genrule @glib_archive//:gen_configure failed: bash failed: error executing command /bin/bash -c ... (remaining 1 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '12104' is supported by ustar format... yes
checking whether GID '1371' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether to enable maintainer-specific portions of Makefiles... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/home/zhang/.cache/bazel/_bazel_zhang/2f9f084266361be2ea70187ad5c14f49/execroot/lab':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Target //:deepmind_lab.so failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 3.759s, Critical Path: 3.14s

I don't have any experience with bazel so I've got really no clue as how to fix it, any help would be appreciated!
My compiler: gcc (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5

Thanks in advance!

@tkoeppe
Copy link
Collaborator

tkoeppe commented Jan 17, 2017

Did you install the Numpy development headers? See https://github.com/deepmind/lab/blob/master/docs/build.md for details.

@jingweiz
Copy link
Author

jingweiz commented Jan 18, 2017

Hey,
thanks for the reply!
Yes I was following that more detailed instruction and did:
sudo apt-get install python-dev python-numpy if that's what you mean?
And also somehow I'm now getting error 2 again:
If I modify the the cops in BUILD for deepmind_lab.so as follows:

    copts = [
        "-fno-strict-aliasing",  ## ick ick ick
        "-std=c99",
        "-DDEEPMIND_LAB_MODULE_RUNFILES_DIR",
        "-I/usr/local/lib/python2.7/dist-packages/numpy/core/include",
    ],

then I'm now getting: /BUILD:986:1: in cc_binary rule //:deepmind_lab.so: The include path '/usr/local/lib/python2.7/dist-packages/numpy/core/include' references a path outside of the execution root.
If I delete the numpy include path then I'm getting again: python/dmlab_module.c:29:31: fatal error: numpy/arrayobject.h: No such file or directory

My python configurations:

python --version
Python 2.7.6
>>> numpy.version.version
'1.12.0'
>>> numpy.get_include()
'/usr/local/lib/python2.7/dist-packages/numpy/core/include'

@tkoeppe
Copy link
Collaborator

tkoeppe commented Jan 18, 2017

Hm, is it python-numpy or python-numpy-dev? I have a feeling you may need the numpy headers, too. Maybe the documentation is wrong about that.

@jingweiz
Copy link
Author

Hey,
I tried to do sudo apt-get install python-numpy-dev but this is what I get:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'python-numpy' instead of 'python-numpy-dev'
python-numpy is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

@tkoeppe
Copy link
Collaborator

tkoeppe commented Jan 19, 2017

I'm not sure what's going on. You definitely cannot add rogue -I flags to the copts, since Bazel only performs hermetic builds. You'll need to provide (or modify) the external dependencies through the Bazel workspace mechanism, see the WORKSPACE file.

@jingweiz jingweiz changed the title Building failed at Ubuntu14.04 Building failed on Ubuntu14.04 Jan 27, 2017
@frankcarey
Copy link

The Dockerfile builds in #24 on 14.04, so it's not that. You might look at that Dockerfile script though to see exactly what it does for all the dependencies.

@tkoeppe
Copy link
Collaborator

tkoeppe commented Nov 28, 2017

I'm not sure there's anything meaningful we can add here. Please feel free to reopen with more specific information.

@tkoeppe tkoeppe closed this as completed Nov 28, 2017
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

3 participants