error in bazel/ tensorflow installation 'external:io_bazel_rules_closure: no such attribute 'urls' in 'http_archive' rule.' - tensorflow

Hi all I am trying to install tensor flow with GPU compatibility using this guide "guide 1" and guide 2 on ubuntu pc (cuda 8). I am stuck at installing tensorflow,
when I use ./configure, I getting this error
ERROR: /home/krishna/tensorflow/WORKSPACE:3:1: //external:io_bazel_rules_closure: no such attribute 'urls' in 'http_archive' rule.
ERROR: /home/krishna/tensorflow/WORKSPACE:3:1: //external:io_bazel_rules_closure: missing value for mandatory attribute 'url' in 'http_archive' rule.
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '': Encountered error while reading extension file 'closure/defs.bzl': no such package '#io_bazel_rules_closure//closure': error loading package 'external': Could not load //external package.
I am new to ubuntu, after reading a lot I understood that, the error has something to do with "version of bazel" (for version above 0.3.1 it does not apper).
When I use the command
$bazel version
Build label: 0.3.0
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Jun 10 11:38:23 2016 (1465558703)
Build timestamp: 1465558703
Build timestamp as int: 1465558703
when i use
$ sudo apt-get install bazel
Reading package lists... Done
Building dependency tree
Reading state information... Done
bazel is already the newest version (0.4.5).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
and
upgraded it using $ sudo apt-get upgrade bazel. Finally I tried
$ bazel version
Build label: 0.3.0
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Jun 10 11:38:23 2016 (1465558703)
Build timestamp: 1465558703
Build timestamp as int: 1465558703
which shows me that I am at version 0.3.0. I even tried compiling tensorflow again,which gave me the same above error.

It looks like you have two versions of Bazel on your system (0.3.0 and 0.4.5). You can see what the current binary is by running which bazel. You can find all of the bazels on your system by running:
$ updatedb # This will take a while.
$ slocate bazel
Assuming this returns something like:
/etc/bazel/bin/bazel
/usr/bin/bazel
you can figure out which bazel is the "right" one (0.4.5) by running /usr/bin/bazel version etc. for each bazel slocate finds.
Once you find the right bazel, you want that to be the default, so you have to make sure Linux searches for Bazel in that directory first. If the right bazel is /usr/local/bin/bazel, you'd run:
$ export PATH="/usr/local/bin:$PATH"
Then you should be able to call "bazel" normally and your system will find the "right" one (you can also delete any old ones you find).
Alternatively, you can install Bazel using the installer which will tell you what directory it got installed in.

Related

spa/meson.build:29:4: ERROR: Dependency "bluez" not found, tried pkgconfig and cmake while installing PIPEWIRE in Ubuntu 16.04

I am trying to install Pipewire in my Ubuntu 16.04 x86 amd64 machine using instructions found here : https://pipewire.org/#getting
./autogen.sh --prefix=$PREFIX
On running the above command, I get this error
spa/meson.build:29:4: ERROR: Dependency "bluez" not found, tried pkgconfig and cmake
I have installed bluez already. This is the output for running
**sudo apt-get install bluez**
Reading package lists... Done
Building dependency tree
Reading state information... Done
bluez is already the newest version (5.37-0ubuntu5.3).
0 upgraded, 0 newly installed, 0 to remove and 19 not upgraded.
The files that are required to do development on top of a package are often separate (since this is really only needed by developers, and would take up too much size for no reason otherwise).
In your case, the package you're looking for is libbluetooth-dev. So you can do sudo apt install libbluetooth-dev

rbenv install 2.6.3 BUILD FAILED

I want to use rbenv for first time, install it and initialize it, after using rbenv install 2.6.3 (this version is in my list. rbenv install --list) I have BUILD FAILED (error about clang3.0 and gcc-4.0) how can I fix it? thank you.
I tried brew update and upgrade and git clone on my rbenv list for 2.6.3 and it is ok, and with gcc --version I get:
Apple LLVM version 10.0.0 (clang-1000.10.44.4)
rbenv install 2.6.3
ruby-build: using openssl from homebrew
Downloading ruby-2.6.3.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.3.tar.bz2
Installing ruby-2.6.3...
ruby-build: using readline from homebrew
BUILD FAILED (OS X 10.13.2 using ruby-build 20190615-7-g0e9094b)
Inspect or clean up the working tree at /var/folders/r2/1kkj8jmd5cz_hcl22vs96pzm0000gn/T/ruby-build.20190720165009.5566
Results logged to /var/folders/r2/1kkj8jmd5cz_hcl22vs96pzm0000gn/T/ruby-build.20190720165009.5566.log
Last 10 log lines:
/var/folders/r2/1kkj8jmd5cz_hcl22vs96pzm0000gn/T/ruby-build.20190720165009.5566/ruby-2.6.3 /var/folders/r2/1kkj8jmd5cz_hcl22vs96pzm0000gn/T/ruby-build.20190720165009.5566 ~
checking for ruby... /usr/local/bin/ruby
tool/config.guess already exists
tool/config.sub already exists
checking build system type... x86_64-apple-darwin17.3.0
checking host system type... x86_64-apple-darwin17.3.0
checking target system type... x86_64-apple-darwin17.3.0
./configure: line 3491: /usr/bin/gcc-4.0: No such file or directory
configure: error: clang version 3.0 or later is required
make: *** No targets specified and no makefile found. Stop.
Fix: RUBY_CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.6.3

Tensorflow Custom Compile on Windows

So, I've installed Bazel via Chocolatey, installed Python 3.5 and 2.7, installed CUDA v8, and cuDNN v6, and installed JDK 8.0, I'm now trying to custom-build TensorFlow on my Windows 10 device, with AVX, AVX 2 and CUDA. TensorFlow-GPU, the pre-built version, does work, I've already tested and run that successfully.
I've followed the instructions of other articles, both on TensorFlows' actual site (trying to adapt some sections from the Linux/Mac installs), and on here. The furthest I've made it is; cloning the Github repository via Msys2, running configure.py, then attempting to build via bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package I receive an error, the header of which is:
Error reading java.io.IOException: CreateProcess(): The system cannot find the file specified.
: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/include/cudnn.h
I've double checked, that file does exist, so I'm not sure why I'm getting this error.
EDIT: Also attempted to run via Powershell, reached the same point.
Any help would be much appreciated.
I had the exact same error while trying to build Tensorflow on Windows (using cuDNN 5.1). I fixed it by launching bazel from the msys2 terminal (instead of from the windows command prompt) and manually setting the BAZEL_SH environment variable before attempting to build.
export BAZEL_SH=c:/tools/msys64/usr/bin/bash.exe
bazel build -c opt --config=win-cuda tensorflow/cc:cc_ops
The following steps helped me to compile Tensorflow on Windows 10.
pacman -Syuu patch
ln -s "c:\python27\python.exe" /usr/bin/python
export BAZEL_SH=c:/tools/msys64/usr/bin/bash.exe
"C:\Documents and Settings\All Users\chocolatey\bin\bazel.exe" build --config=opt --config=win-cuda //tensorflow/tools/pip_package:build_pip_package
But after 1 hour of compilation I got another error:
C:\tools\msys64\tmp_bazel_dmitry\x1e5egqw\execroot\org_tensorflow\external\protobuf_archive\python\google\protobuf\internal\api_implementation.cc
: fatal error C1083: Cannot open compiler generated file: '': Invalid
argument Target //tensorflow/tools/pip_package:build_pip_package
failed to build

Tensorflow with gpu support installation error - the specified --crosstool_top is not a valid cc_toolchain_suite rule

I've been trying to install tensorflow with GPU support using these steps:
http://www.nvidia.com/object/gpu-accelerated-applications-tensorflow-installation.html
and also using:
http://thelazylog.com/install-tensorflow-with-gpu-support-on-sandbox-redhat/
This is the error message that I'm getting when I try to run the bazel build command for building the tensorflow pip package (with the --config-cuda flag set):
The specified --crosstool_top '//third_party/gpus/crosstool:crosstool' is not a valid cc_toolchain_suite rule.
What's strange is that if i remove the --config=cuda flag, I don't get the error message while building and I'm able to install tensorflow successfully - but without GPU support.
I experienced the same issue, using the nvidia instructions. What I did was to drop the git reset line in the instructions, and it works.
Details (from the error message):
Close, reopen terminal
Run git clone (again), and cd tensorflow
Run ./configure
Bazel build, etc
This may be unrelated, but I experienced an issue with the .whl line, the error message was that the wheel cannot be found or something along those lines. This is the "And finally install the TensorFlow pip package" section. To resolve it in my case, I typed in the terminal all the way to "..._pkg/tensorflow", and then pressed tab for auto-completion. The file name that popped up was significantly longer than that in the guide, but it worked. Also, if anyone face a numpy not installed message based on the nvidia instructions, replace the python-pip and dev with python-numpy and run that line again to install.
Configuration: Fresh Ubuntu 16.04, GTX970M, running driver 367.48 (from CUDA installation), CUDA 8.0, CuDNN 5.1
Full setup path:
Fresh Ubuntu, with downloads and 3rd party apps selected during installation.
Control panel => Software and updates => Other Software => Canonical ticked
Install CUDA using nvidia instructions in CUDA documentation, .deb format
CuDNN 5.1 installed, the rest from the nvidia link.
I hope everything works out for you!
(I'm sorry for the poor formatting)
I was going through same problem and recently found the solution. The problem is with the installation of Bazel which leads to this kind of error.
After installation of bazel from installer, make sure that you would give the correct path to ~./bashrc and also activate the path using
source "path-to-your-bin-directory-for-bazel"
Please change the git source version slightly as shown below
$ git clone https://github.com/tensorflow/tensorflow
$ cd tensorflow
// $ git reset --hard 70de76e
$ git reset --hard 287db3a
And please refer the below l
https://github.com/tensorflow/tensorflow/issues/4944
Also, zlib has been updated since this TF build. You need to check http://www.zlib.net/ to get the latest version and SHA-256, then update tensorflow/workspace.bzl with that information (lines 254-266 in this build). At this time, the correct version info would include the following:
url = "http://zlib.net/zlib-1.2.11.tar.gz",
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
strip_prefix = "zlib-1.2.11",

Missing gcc-4.0 error on pip install twisted in virtual env

I'm trying to use Scrapy inside a virtualenv, which requires installation of twisted as well. I did pip install Scrapy with no problems, but when I try pip install twisted, I'm getting the following error multiple times in the output:
unable to execute gcc-4.0: No such file or directory
error: command 'gcc-4.0' failed with exit status 1
I previously had a similar problem when trying to install python packages on my actual system, which is why I started using virtualenv in the first place. Is this an issue of the python version installed on my environment? This is what I currently have:
Django - 1.5 - active
Python - 2.7.3 - active development (/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload)
Scrapy - 0.16.4 - active
pip - 1.2.1 - active
setuptools - 0.6c11 - active
wsgiref - 0.1.2 - active development (/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7)
yolk - 0.4.3 - active
To check which version of gcc I have I typed gcc at the command line and got
i686-apple-darwin11-llvm-gcc-4.2: no input files
I tried export CC=gcc-4.2 before running pip install twisted, and I got:
llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory
lipo: can't figure out the architecture type of: /var/folders/s8/d0f65gc93nbchdk52g2cg5f80000gn/T//ccWQa7cJ.out
error: command 'gcc-4.2' failed with exit status 255
It sort of looks to me like it's looking for powerpc-apple-darwin11-llvm-gcc-4.2, and what I have above is i686-apple-darwin11-llvm-gcc-4.2--are these different and therefore causing the problem?
To give more background info, I installed Python 2.7 from a Python.org installer a long time ago before upgrading from Snow Leopard straight to Mountain Lion. If I simply type in python at the command line I get
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:32:06)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
So I'm guessing that means I'm using Apple's Python? And it's built with gcc-4.0.1? So if that's the case, shouldn't I not need to do the export CC=gcc-4.2? Or do I need to do that AND switch to the Python.org version of Python? (And if the latter, how do I do that?)
Update: I tried this solution for switching Python versions but it didn't work.
Update: I managed to switch Python versions (outside of my virtualenv) using the sudo port select --set python python27 command, but this didn't solve the problem even though I'm now showing:
Python 2.7.3 (default, Nov 17 2012, 19:54:34)
[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
when I type python at the commmand line.
Update: I also found this solution to a question that seemed to have almost the exact same issues as I'm having, but I'm already upgraded to XCode 4.6 and definitely have the Command Line Tools installed as described in the aforementioned solution (Preferences>Downloads tab>Install Command Line Tools). I do also have XCode 3.2.6 installed, however--any chance that's causing my problems?
Have you tried CC="$(type -p clang)" pip install twisted? You don't necessarily need to use gcc to compile Twisted's extensions; selecting clang instead might clear up whatever weird problem seems to be infesting your gcc installation.
If that doesn't work, I would suggest un-installing any Python.org versions of Python and then possibly re-installing both the OS and Xcode, since it looks like something might have corrupted your system Python install. I have no idea how references to powerpc stuff have persisted into Mountain Lion, since Lion removed support for ppc.