Howto modify/affect/adapt conan dependencies - conan

I am not a conan expert, so maybe there is an obvious solution for this. But it can't be trivial since I am struggling with this for a while and can't find a solution.
We need parquet for our project, we include this via the conan arrow package like this, conanfile.txt:
[requires]
arrow/2.0.0
[generators]
cmake
[options]
spdlog:=gcc
arrow:shared=False
arrow:parquet=True
arrow:fPIC=False
arrow:with_re2=False
arrow:with_protobuf=False
arrow:with_openssl=False
arrow:with_gflags=False
arrow:with_glog=False
arrow:with_grpc=False
arrow:with_utf8proc=False
arrow:with_zstd=False
arrow:with_bz2=False
(I remove all the other packages, but there are not so many of them)
The problem is on our CI we get the error:
...
Downloading conanmanifest.txt
Downloading conanfile.py
Downloading conan_export.tgz
thrift/0.13.0: Downloaded recipe revision 0
openssl/1.1.1j: Not found in local cache, looking in remotes...
openssl/1.1.1j: Trying with 'conan-center'...
Downloading conanmanifest.txt
Downloading conanfile.py
Downloading conan_export.tgz
openssl/1.1.1j: Downloaded recipe revision 0
ERROR: openssl/1.1.1j: Cannot load recipe.
Error loading conanfile at '/conan/.conan/data/openssl/1.1.1j/_/_/export/conanfile.py': Current Conan version (1.32.1) does not satisfy the defined one (>=1.33.0).
CMake Error at cmake/conan.cmake:368 (message):
Conan install failed='1'
Call Stack (most recent call first):
cmake/conan.cmake:448 (conan_cmake_install)
CMakeLists.txt:137 (conan_cmake_run)
-- Configuring incomplete, errors occurred!
See also "/builds/0/corsika/build/CMakeFiles/CMakeOutput.log".
indicating correctly that on CI we use containers with conan 1.32.1 and this seems to be in conflict with openssl/1.1.1j that wants >= 1.33.0.
I find that annoying because we explicitly don't want and don't need openssl and we switch it off for arrow (see above).
When I run conan info . I can see that:
conanfile.txt
ID: 33d8c2433f5e03548c5229121dbd4f82e354000d
BuildID: None
Requires:
arrow/2.0.0
arrow/2.0.0
ID: cd50fd05198137f0420bf6da1e5029dade26bc93
BuildID: None
Remote: conan-center=https://conan.bintray.com
URL: https://github.com/conan-io/conan-center-index
Homepage: https://arrow.apache.org/
License: Apache-2.0
Description: Apache Arrow is a cross-language development platform for in-memory data
Topics: conan, arrow, memory
Provides: arrow
Recipe: Cache
Binary: Missing
Binary remote: conan-center
Creation date: 2020-11-22 17:53:36 UTC
Required by:
conanfile.txt
Requires:
thrift/0.13.0
boost/1.75.0
ID: d9d3e501899335bccbe5205508f9a4801424ce7d
BuildID: None
Remote: conan-center=https://conan.bintray.com
URL: https://github.com/conan-io/conan-center-index
Homepage: https://www.boost.org
License: BSL-1.0
Description: Boost provides free peer-reviewed portable C++ source libraries
Topics: conan, boost, libraries, cpp
Provides: boost
Recipe: Cache
Binary: Download
Binary remote: conan-center
Creation date: 2021-04-13 19:51:36 UTC
Required by:
thrift/0.13.0
Requires:
zlib/1.2.11
bzip2/1.0.8
libiconv/1.16
bzip2/1.0.8
ID: da606cf731e334010b0bf6e85a2a6f891b9f36b0
BuildID: None
Remote: conan-center=https://conan.bintray.com
URL: https://github.com/conan-io/conan-center-index
Homepage: http://www.bzip.org
License: bzip2-1.0.8
Description: bzip2 is a free and open-source file compression program that uses the Burrows Wheeler algorithm.
Topics: conan, bzip2, data-compressor, file-compression
Provides: bzip2
Recipe: Cache
Binary: Cache
Binary remote: conan-center
Creation date: 2020-09-04 10:44:14 UTC
Required by:
boost/1.75.0
libevent/2.1.12
ID: 6b0981c427aa0eb8bea05add2094df29ed639799
BuildID: None
Remote: conan-center=https://conan.bintray.com
URL: https://github.com/conan-io/conan-center-index
Homepage: https://github.com/libevent/libevent
License: BSD-3-Clause
Description: libevent - an event notification library
Topics: conan, libevent, event
Provides: libevent
Recipe: Cache
Binary: Cache
Binary remote: conan-center
Creation date: 2021-03-18 17:32:39 UTC
Required by:
thrift/0.13.0
Requires:
openssl/1.1.1j
libiconv/1.16
ID: 6af9cc7cb931c5ad942174fd7838eb655717c709
BuildID: None
Remote: conan-center=https://conan.bintray.com
URL: https://github.com/conan-io/conan-center-index
Homepage: https://www.gnu.org/software/libiconv/
License: LGPL-2.1
Description: Convert text to and from Unicode
Topics: libiconv, iconv, text, encoding, locale, unicode, conversion
Provides: libiconv
Recipe: Cache
Binary: Cache
Binary remote: conan-center
Creation date: 2020-10-04 02:46:44 UTC
Required by:
boost/1.75.0
openssl/1.1.1j
ID: 6af9cc7cb931c5ad942174fd7838eb655717c709
BuildID: None
Remote: conan-center=https://conan.bintray.com
URL: https://github.com/conan-io/conan-center-index
Homepage: https://github.com/openssl/openssl
License: OpenSSL
Description: A toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols
Topics: conan, openssl, ssl, tls, encryption, security
Provides: openssl
Recipe: Cache
Binary: Cache
Binary remote: conan-center
Creation date: 2021-03-26 21:05:40 UTC
Required by:
thrift/0.13.0
libevent/2.1.12
thrift/0.13.0
ID: 44b3a17b9712eb98c7cab65c26ec70335992ff20
BuildID: None
Remote: conan-center=https://conan.bintray.com
URL: https://github.com/conan-io/conan-center-index
Homepage: https://github.com/apache/thrift
License: Apache-2.0
Description: Thrift is an associated code generation mechanism for RPC
Topics: conan, thrift, serialization, rpc
Provides: thrift
Recipe: Cache
Binary: Download
Binary remote: conan-center
Creation date: 2021-03-30 05:58:58 UTC
Required by:
arrow/2.0.0
Requires:
boost/1.75.0
openssl/1.1.1j
zlib/1.2.11
libevent/2.1.12
zlib/1.2.11
ID: 6af9cc7cb931c5ad942174fd7838eb655717c709
BuildID: None
Remote: conan-center=https://conan.bintray.com
URL: https://github.com/conan-io/conan-center-index
Homepage: https://zlib.net
License: Zlib
Description: A Massively Spiffy Yet Delicately Unobtrusive Compression Library (Also Free, Not to Mention Unencumbered by Patents)
Topics: conan, zlib, compression
Provides: zlib
Recipe: Cache
Binary: Cache
Binary remote: conan-center
Creation date: 2020-11-15 04:53:34 UTC
Required by:
thrift/0.13.0
boost/1.75.0
and it seem the reason openssl is pulled in is because of thrift and libevent.
So what are solution here given the fact that we cannot change our CI containers because then we basically drop support to platforms that we need to support?
why openssl depends on conan version in the first place? Can't this we fixed or worked around?
can we affect the dependency tree of arrow in a way to avoid any reference to openssl? E.g. provide dedicated versions of thrift/libevent that come without openssl (if this is even possible)?
Are there any other options?
(As a footnote, the containers and systems we use are all not terribly outdated so I believe this problem can easily affect many users. I have not found any solution after search for a while. )

The obvious recommendation: Update Conan to the latest version (1.35.1).
pip install -U conan
Packages in Conan Center Index (all official) are not blocked by any old version, actually it's mandatory testing them with latest Conan version available. Conan Center Index assumes you are running latest Conan client version too:
https://github.com/conan-io/conan-center-index/blob/41d4fbb8c218f9d938ccb8b9d888bff52002e62e/.github/PULL_REQUEST_TEMPLATE.md#L9
https://github.com/conan-io/conan-center-index/blob/c060f7086f3745361795fb6379bd6f0bac000bab/docs/how_to_add_packages.md#L57
why openssl depends on conan version in the first place? Can't this we fixed or worked around?
New Conan features are introduces for every new release. You can't simply change a recipe because you are consuming them. Even if you download the recipe and remove that check, it will fail, because your Conan client version doesn't support some method/feature in that recipe.
can we affect the dependency tree of arrow in a way to avoid any reference to openssl? E.g. provide dedicated versions of thrift/libevent that come without openssl (if this is even possible)?
Yes, but is not recommended. You can declare other package versions consumed by arrow in your conanfile.txt, it will force Conan to use your versions.
Are there any other options?
Yes, don't try workarounds, do the right thing, update your client version.

Related

Building libjpeg-turbo with conan fails on windows

I am trying to build libjpeg-turbo package with conan on Windows:
conan install libjpeg-turbo/1.5.2#bincrafters/stable
But it fails with:
libjpeg-turbo/1.5.2#bincrafters/stable: Not found in local cache, looking in remotes...
libjpeg-turbo/1.5.2#bincrafters/stable: Trying with 'conan-center'...
Downloading conanmanifest.txt
Downloading conanfile.py
Downloading conan_export.tgz
....
ERROR: libjpeg-turbo/1.5.2#bincrafters/stable: Error in configure() method, line 43
if self.settings.os == "Emscripten":
ConanException: Invalid setting 'Emscripten' is not a valid 'settings.os' value.
Possible values are ['Android', 'Arduino', 'FreeBSD', 'Linux', 'Macos', 'SunOS', 'Windows', 'WindowsStore', 'iOS', 'tvOS', 'watchOS']
Read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-invalid-setting"
The same command on Linux works fine.
On both system I have conan in version 1.21.0
I cannot find any clue about this error.
EDIT
Here is full output of libjpeg-turbo in version 2.0.2 installation:
>conan install -r conan-center libjpeg-turbo/2.0.2#
Configuration:
[settings]
arch=x86
arch_build=x86
build_type=Release
compiler=Visual Studio
compiler.runtime=MD
compiler.version=15
os=Windows
os_build=Windows
[options]
[build_requires]
[env]
ERROR: libjpeg-turbo/2.0.2: Error in configure() method, line 49
if self.settings.os == "Emscripten":
ConanException: Invalid setting 'Emscripten' is not a valid 'settings.os
' value.
Possible values are ['Android', 'Arduino', 'FreeBSD', 'Linux', 'Macos', 'SunOS',
'Windows', 'WindowsStore', 'iOS', 'tvOS', 'watchOS']
Read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-invalid-sett
ing"
The Conan package libjpeg-turbo/1.5.2#bincrafters/stable is obsolete and has been replaced by libjpeg-turbo/2.0.2#. You can obtain that package from Conan Center as well:
conan install -r conan-center libjpeg-turbo/2.0.2#
Now about your error:
ConanException: Invalid setting 'Emscripten' is not a valid 'settings.os' value.
As you can see, your current settings.os is configured as Emscripten which is not supported by that recipe. As the FAQ link indicates, you should customize your current settings, thus you can try:
conan install -r conan-center libjpeg-turbo/2.0.2# -s os=Windows
Thus, you should:
Update your current package to libjpeg-turbo/2.0.2# (it requires Conan >=1.18)
Update your current profile to Windows:
conan profile update settings.os=Windows default
If you really need Emscripten, so open an issue to Conan Center Index requesting such feature.
Regards!

How is the correct syntax/call to get the sls-file working - salt

I'm trying to build a reactor sls file, which starts running when an event occurs.
The content of the sls file should be as the following cli commands:
sudo salt minion git.add /srv/salt .
sudo salt minion git.commit /srv/salt test
sudo salt minion git.push /srv/salt origin master identity=/home/autogit/.ssh/id_rsa
If i run the code bellow triggered by the reactor. I get the following error message.
[DEBUG ] Reactor is populating module client cache
[ERROR ] An un-handled exception from the multiprocessing process 'Reactor-9:1' was caught:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/utils/process.py", line 765, in _run
return self._original_run()
File "/usr/lib/python2.7/dist-packages/salt/utils/reactor.py", line 271, in run
self.call_reactions(chunks)
File "/usr/lib/python2.7/dist-packages/salt/utils/reactor.py", line 228, in call_reactions
self.wrap.run(chunk)
File "/usr/lib/python2.7/dist-packages/salt/utils/reactor.py", line 330, in run
self.populate_client_cache(low)
File "/usr/lib/python2.7/dist-packages/salt/utils/reactor.py", line 324, in populate_client_cache
self.reaction_class[reaction_type](self.opts['conf_file'])
KeyError: u'module'
[CRITICAL] Engine 'reactor' could not be started!
I've tried different syntax (old style and new style) but couldn't figure out what the problem is. Always getting an KeyError: u'module' or u'git'.
Also tried it with runner function to run it locally on the master.
git pull:
module.run:
- git.pull:
- cwd: /srv/salt
- remote: git#git.xyz.com:user/sbt.git
- identity: /home/autogit/.ssh/id_rsa
- git.add:
- cwd: /srv/salt
- filename: .
- git.commit:
- cwd: /srv/salt
- remote: git#git.xyz.com:user/sbt.git
- git.push:
- cwd: /srv/salt
- remote: git#git.xyz.com:user/sbt.git
- identity: /home/autogit/.ssh/id_rsa
salt --versions-report
Salt Version:
Salt: 2019.2.0
Dependency Versions:
cffi: Not Installed
cherrypy: unknown
dateutil: 2.6.1
docker-py: Not Installed
gitdb: 2.0.3
gitpython: 2.1.8
ioflo: Not Installed
Jinja2: 2.10
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: 1.0.7
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
python-gnupg: 0.4.1
PyYAML: 3.12
PyZMQ: 16.0.2
RAET: Not Installed
smmap: 2.0.3
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.2.5
System Versions:
dist: Ubuntu 18.04 bionic
locale: UTF-8
machine: x86_64
release: 4.15.0-46-generic
system: Linux
version: Ubuntu 18.04 bionic
Since i'm quite new to Salt, hopefully you can give me a hint what i'm doing wrong:
You didn't provide the master config.
About module.run confusion: add in your settings (minion and maybe to master since I don't know your use-case)
use_superseded:
- module.run
That will enable your syntax, more doc about this here: https://docs.saltstack.com/en/latest/ref/states/all/salt.states.module.html#salt.states.module.run
In general: you are executing execution modules from the place that state modules are allowed only (the term module is heavily overused in salt...)
You didn't provide the full Master config. Reactor requires dedicated config to match events to sls files:
https://docs.saltstack.com/en/latest/ref/configuration/master.html#master-reactor-settings
You can also check the doc I've written some time ago about events and reactors:
https://github.com/kiemlicz/util/wiki/Salt-Events-and-Reactor
Assuming you've configured your events-to-sls-files-matching in master config, your provided sls:
git pull:
module.run:
- git.pull:
- cwd: /srv/salt
- remote: git#git.xyz.com:user/
...
will not work.
Mind that reaction happens on Salt Master thus the reaction sls file need to provide type of reaction (local, runner etc.) since it's no longer 'view of one minion' but possibly of tons of minions!
First create runner reaction type (which delegates to some orchestration sls file which will contain your logic wrapped with (I think) salt.function )
Help yourself with aforementioned github link to my attempt of explaining Reactor.
Refer to official doc as well: https://docs.saltstack.com/en/latest/topics/reactor/index.html

Spinnaker: How to bring custom boms into spinnaker pod to be able to deploy it with hal?

I would like to provide a custom BOM (Bill of Materials) to spinnaker so that I can configure the repos according to my needs. I am new to k8s, helm and spinnaker and altought reading the docu there are some things not entirely clear how to do that...
Problem
I do not have access to the gcs store nor do I have direct access to external repos. So I need to configure the artifactSources accordingly
According to the docu I guess I should provide a custom bom in a way that they be read from the filesystem - so inside the container spinnaker-spinnaker-halyard-0
My steps
Prepare kubernetes cluster
I do the initial deployment with helm something like
helm install stable/spinnaker --name=spinnaker --namespace=spinnaker -f values.yml
After I connect to the spinnaker-spinnaker-halyard-0 pod and run
$ kubectl.exe exec -it spinnaker-spinnaker-halyard-0 -n spinnaker bash
Deploy Spinnaker
According to the docu here and here I would do do something like
$ hal config version edit --version local:1.11.6
$ hal deploy apply
Which fails obviously cause there is no local bom file
Problems in Global:
! ERROR Unable to retrieve the Spinnaker bill of materials for
version "local:1.11.6": /home/spinnaker/.hal/.boms/bom/1.11.6.yml (No such file
or directory)
- Failed to prep Spinnaker deployment
Question: How to provide custom BOM?
According to the docu the boms are expected to be in a specific directory and structure ${HALCONFIG_DIR}/.boms/boms/${VERSION}.yml
So how to I get my custom POM there? When I look at the helm-chart I don't see (or understand) how I could do that e.g. via additional-config-maps
I found a way but it is manually done, working within the spinnaker-spinnaker-halyard container. I'm sure there is a better way...
I add a custom bom as additionalConfigMap to the values.yml file
...
additionalConfigMaps:
create: true
data:
# https://storage.googleapis.com/halconfig/bom
bom_1.12.4.yml: |
version: 1.12.4
timestamp: '2019-03-01 08:06:24'
services:
echo:
version: 2.3.1-20190214121429
commit: 5db9d437ca7f2fa374dcada17f77bbbb2965bd67
clouddriver:
version: 4.3.4-20190301030607
commit: b5539c47aad309e24428abb8f8303aff45323b43
deck:
version: 2.7.4-20190228030607
commit: dccdd730886a6beb0388e3622581d8da1ed8edbb
fiat:
version: 1.3.2-20190128153726
commit: daf21b24330a5f22866601559aa0f7ac99590274
front50:
version: 0.15.2-20190222161456
commit: 3105e86b8c084ad6ad78507e3a5e5a427f290b99
gate:
version: 1.5.2-20190301030607
commit: b238ab993ab25381ce907260879548ed74a4953f
igor:
version: 1.1.1-20190213190226
commit: 63d06a5c5d55f07443dd60a81035b35cf96238e7
kayenta:
version: 0.6.1-20190221030610
commit: 81d906bf8307143f40fe88f8554baa318de25ef1
orca:
version: 2.3.1-20190220030610
commit: bad45e78566449117b678a3317552cf53d0dd14e
rosco:
version: 0.9.0-20190123170846
commit: 42f81a2501de6d40676d47661579a6106b5c3e8a
defaultArtifact: {}
monitoring-third-party:
version: 0.11.2-20190222030609
commit: 232c84a8a87cecbc17f157dd180643a8b2e6067a
monitoring-daemon:
version: 0.11.2-20190222030609
commit: 232c84a8a87cecbc17f157dd180643a8b2e6067a
dependencies:
redis:
version: 2:2.8.4-2
consul:
version: 0.7.5
vault:
version: 0.7.0
artifactSources:
debianRepository: https://nexus.intra/repository/spinnaker-releases/
dockerRegistry: nexus.intra:5000/spinnaker-marketplace
googleImageProject: marketplace-spinnaker-release
gitPrefix: https://scm.intra/scm/SPIN/repos
Then link the custom bom in the halyard container, configure the version and run the deployment
mkdir -p ~/.hal/.boms/bom
ln -s /opt/halyard/additionalConfigMaps/bom_1.12.4.yml ~/.hal/.boms/bom/1.12.4.yml
hal config version edit --version local:1.12.4
hal deploy apply

TensorFlow Serving Error

I have installed Tensorflow Serving as outlined on the install page at https://tensorflow.github.io/serving/setup. However, when I follow the build instruction on the page I get the following error:
$ bazel build tensorflow_serving/...
ERROR: /home/**PATH**/external/org_tensorflow/third_party/py/python_configure.bzl:183:20: unexpected keyword 'environ' in call to repository_rule(implementation: function, *, attrs: dict or NoneType = None, local: bool = False).
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '': Extension file 'third_party/py/python_configure.bzl' has errors.
INFO: Elapsed time: 0.623s
I am running on Ubuntu and TensorFlow 1.0.1 build. I am using Python 2.7 and have set up a virtualenv.
I can successfully build the bazel hello example and also am able to complete the gRPC quick start found at http://www.grpc.io/docs/quickstart/python.html.
Any suggestions?
-Dave
The trouble was an old copy of bazel. To determine your version
$ bazel version
Build label: 0.4.5
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Mar 16 12:19:38 2017 (1489666778)
Build timestamp: 1489666778
Build timestamp as int: 1489666778
In my case it required a manual removal of the old version
rm -fr ~/.bazel ~/.bazelrc
Next, I chose the install using the installer for ubuntu.
$ ./bazel-0.4.5-installer-linux-x86_64.sh
Bazel installer
---------------
Bazel is bundled with software licensed under the GPLv2 with Classpath exception.
You can find the sources next to the installer on our release page:
https://github.com/bazelbuild/bazel/releases
# Release 0.4.5 (2017-03-16)
There was still another trick to getting it to work.
$cd ..
$ bazel test tensorflow_serving/...
Python Configuration Error: 'PYTHON_BIN_PATH' environment variable is not set
This error is also related to versioning, but in this case it was an issue with serving. The solution was to revert to an earlier version and update the submodule from git (I had previously cloned the repository). From the serving directory:
$ git checkout 0.5.1
M tensorflow
M tf_models
Note: checking out '0.5.1'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 51bb356... Merge pull request #325 from kirilg/0.5.1
(tensorflow) $ git submodule update
Submodule path 'tensorflow': checked out '07bb8ea2379bd459832b23951fb20ec47f3fdbd4'
Submodule path 'tf_models': checked out '2fd3dcf3f31707820126a4d9ce595e6a1547385d'
(tensorflow) $ bazel test tensorflow_serving/...
Serving now reports success:
INFO: Found 199 targets and 57 test targets...
[1,299 / 4,037] Still waiting for 200 jobs to complete:
Running (standalone):

TF installation failure on ubuntu 14.04

I'm getting this weird config error I cannot decipher. It doesn't seem any other ppl has encountered this. CUDA is correctly config'ed. What is this 'repository_rule' and 'external' package thing?
(tensorflow)weiwe#weiwe:~/tensorflow$ ./configure
Please specify the location of python. [Default is /home/weiwe/tensorflow/bin/python]:
Do you wish to build TensorFlow with Google Cloud Platform support? [y/N]
No Google Cloud Platform support will be enabled for TensorFlow
Traceback (most recent call last):
File "<stdin>", line 18, in <module>
TypeError: can only concatenate list (not "str") to list
Found possible Python library paths:
Please input the desired Python library path to use. Default is []
/home/weiwe/tensorflow/lib/python2.7/site-packages
Do you wish to build TensorFlow with GPU support? [y/N] y
GPU support will be enabled for TensorFlow
Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]:
Please specify the Cuda SDK version you want to use, e.g. 7.0. [Leave empty to use system default]:
Please specify the location where CUDA toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:
Please specify the Cudnn version you want to use. [Leave empty to use system default]:
Please specify the location where cuDNN library is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:
libcudnn.so resolves to libcudnn.4
Please specify a list of comma-separated Cuda compute capabilities you want to build with.
You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus.
Please note that each additional compute capability significantly increases your build time and binary size.
[Default is: "3.5,5.2"]:
INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.
.........
ERROR: /home/weiwe/tensorflow/third_party/gpus/cuda_configure.bzl:415:18: function 'repository_rule' does not exist.
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package 'external': Extension file '#local_config_cuda//cuda:build_defs.bzl' may not be loaded from a WORKSPACE file since the extension file is located in an external repository.
Configuration finished
(tensorflow)weiwe#weiwe:~/tensorflow$ bazel build -c opt --config=cuda \
> //tensorflow/tools/pip_package:build_pip_package
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package 'external': Extension file '#local_config_cuda//cuda:build_defs.bzl' may not be loaded from a WORKSPACE file since the extension file is located in an external repository.
INFO: Elapsed time: 0.380s
(tensorflow)weiwe#weiwe:~/tensorflow$ bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package 'external': Extension file '#local_config_cuda//cuda:build_defs.bzl' may not be loaded from a WORKSPACE file since the extension file is located in an external repository.
INFO: Elapsed time: 0.109s
(tensorflow)weiwe#weiwe:~/tensorflow$ bazel clean
INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.
(tensorflow)weiwe#weiwe:~/tensorflow$ bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package 'external': Extension file '#local_config_cuda//cuda:build_defs.bzl' may not be loaded from a WORKSPACE file since the extension file is located in an external repository.
INFO: Elapsed time: 0.242s
There was a patch recently to the cuda build layer. Once you get that error
Error loading package 'external': Extension file '#local_config_cuda//cuda:build_defs.bzl' may not be loaded from a WORKSPACE file since the extension file is located in an external repository.
You have to re-run ./configure again to re-create that target.
This can become tiresome and a way to skip through the configuration process is to provide the variable settings from command line
PYTHON_BIN_PATH=$HOME/anaconda2/bin/python CUDA_TOOLKIT_PATH="/usr/local/cuda" CUDNN_INSTALL_PATH="/usr/local/cuda" TF_NEED_CUDA=1 TF_CUDA_COMPUTE_CAPABILITIES="6.1" TF_CUDNN_VERSION="5" TF_CUDA_VERSION="8.0" TF_CUDA_VERSION_TOOLKIT=8.0 ./configure
Hope it helps