Hey all,
I can't figure out how to correctly install the headers. When building
the pip_package it grabs the headers somehow and puts them in
site-pacakges/tensorflow/include/. I also need to be able to build the
C/C++ libraries and their header files and put them in /usr/include/
without building the python stuff. (ChromeOS wants to be able to build
without all the python parts, they only need the libs).
djenkins has been helping test the gentoo package and pointed out that I
was missing the *.pb.h files, but I am still not clear on the Eigen
headers.
I currently do roughly this (not exactly, we have helper methods):
# Install c c++ and core header files
for i in $(find tensorflow/{c,cc,core} -name "*.h"); do
mkdir -p /usr/include/tensorflow/${i%/*}
cp ${i} /usr/include/tensorflow/${i%/*}
done
# Installing generated headers
pushd bazel-genfiles/ > /dev/null || die
for i in $(find tensorflow/{cc,core} -name "*.h"); do
mkdir -p /usr/include/tensorflow/${i%/*}
cp ${i} /usr/include/tensorflow/${i%/*}
done
popd > /dev/null || die
# Installing Eigen headers
cp third_party/eigen3/{Eigen,unsupported}/* /usr/include/tensorflow/third_party/eigen3/
Doing all that gets me here:
g++ -o/dev/null -E -I/usr/include/tensorflow /usr/include/tensorflow/tensorflow/core/public/session.h
In file included from /usr/include/tensorflow/tensorflow/core/framework/tensor.h:19:0,
from /usr/include/tensorflow/tensorflow/core/public/session.h:24:
/usr/include/tensorflow/third_party/eigen3/unsupported/Eigen/CXX11/Tensor:1:10: fatal error: unsupported/Eigen/CXX11/Tensor: No such file or directory
#include "unsupported/Eigen/CXX11/Tensor"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
I am missing the ones from external/eigen_archive.
The problem is the BUILD file for that has a target with what I need:
https://github.com/tensorflow/tensorflow/blob/master/third_party/eigen.BUILD
but I cant figure out how to get those files isolated so I can copy them
over. I can't just copy everything in external/eigen_archive because
they are licensed differently so I only want some. Copying the glob
patterns from the BUILD file is asking for a maintenance nightmare so
there has to be a better way.
$ bazel build --config=opt @eigen_archive//:eigen
INFO: Analysed target @eigen_archive//:eigen (7 packages loaded).
INFO: Found 1 target...
Target @eigen_archive//:eigen up-to-date (nothing to build)
INFO: Elapsed time: 2.102s, Critical Path: 0.01s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
Is there a way to make bazel put this stuff in a dir anywhere so I can
copy it? I've searched and grepped through the files but no dice :(.
Can someone thats better at bazel help?
-- Jason