roboticslab-uc3m / installation-guides

Centralized administration of dependency installation guides.
https://robots.uc3m.es/installation-guides/
70 stars 35 forks source link

[tensorflow_cc] Problems installing tensorflow_cc #62

Closed davidvelascogarcia closed 5 years ago

davidvelascogarcia commented 5 years ago

I´m trying to install FloopCZ/tensorflow_cc project to use tensorflow C++ API without using Bazel and using cmake. Following the installation guide everything seems right but at the end i get the next error:

...
compile_linux_protobuf.sh finished successfully!!!
tensorflow/contrib/makefile/downloads/nsync/builds/default.linux.c++11/nsync.a
CUDA support disabled
WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown".
INFO: Invocation ID: ec41b930-ee7a-41d8-9e58-553ddacda548
You have bazel 0.21.0 installed.
Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See .bazelrc for more details.
    --config=mkl            # Build with MKL support.
    --config=monolithic     # Config for mostly static monolithic build.
    --config=gdr            # Build with GDR support.
    --config=verbs          # Build with libverbs support.
    --config=ngraph         # Build with Intel nGraph support.
    --config=dynamic_kernels    # (Experimental) Build kernels into separate shared objects.
Preconfigured Bazel build configs to DISABLE default on features:
    --config=noaws          # Disable AWS S3 filesystem support.
    --config=nogcp          # Disable GCP support.
    --config=nohdfs         # Disable HDFS support.
    --config=noignite       # Disable Apacha Ignite support.
    --config=nokafka        # Disable Apache Kafka support.
    --config=nonccl         # Disable NVIDIA NCCL support.
Configuration finished
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 2e09799f-cc6c-4b88-87b5-4c824c389a2a
INFO: Analysed target //tensorflow:libtensorflow_cc.so (134 packages loaded, 14261 targets configured).
INFO: Found 1 target...
Target //tensorflow:libtensorflow_cc.so up-to-date:
  bazel-bin/tensorflow/libtensorflow_cc.so
INFO: Elapsed time: 116.583s, Critical Path: 3.72s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Invocation ID: 66bfa3e9-0d7a-489b-983c-77c5aa4870de
Replacing links with the copies of their targets.
This may take a while...
/home/tiagoentrenamiento/repos/tensorflow_cc/tensorflow_cc/cmake/copy_links.sh: línea 18: realpath: orden no encontrada
make[2]: *** [tensorflow-stamp/tensorflow_shared-configure] Error 1
make[1]: *** [CMakeFiles/tensorflow_shared.dir/all] Error 2
make: *** [all] Error 2

The installation guide use ubuntu 18.04, but i´m using ubuntu 14.04 because TIAGo use ROS indigo. tensorflow_cc project use gcc7. To install gcc7, i used the following guide. peterhanneman post 9 JUN 2017 how-to-install-latest-gcc-on-ubuntu-lts.txt

sudo apt-get update -y && \
sudo apt-get upgrade -y && \
sudo apt-get dist-upgrade -y && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
sudo apt-get update -y && \
sudo apt-get install gcc-7 g++-7 -y && \
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7 && \
sudo update-alternatives --config gcc

PD: The same error building static and shared library.

davidvelascogarcia commented 5 years ago

With sudo apt-get install realpath it´s solved. Now i can build, install and use tensorflow_cc. I´ve tested example project and work correcty. Example:

~/Escritorio/prueba_tensorflow/program/build$ ./example 
2019-01-29 13:56:23.188455: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-01-29 13:56:23.199270: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3000075000 Hz
2019-01-29 13:56:23.199502: I tensorflow/compiler/xla/service/service.cc:161] XLA service 0x178a0e0 executing computations on platform Host. Devices:
2019-01-29 13:56:23.199537: I tensorflow/compiler/xla/service/service.cc:168]   StreamExecutor device (0): <undefined>, <undefined>
Session successfully created.
davidvelascogarcia commented 5 years ago

It´s solved. Issue closed.