Issue 1:
Environment info

Operating System: CentOS 6.7

If installed from sources, provide the commit hash: eda89e9

Steps to reproduce

Configure for gcc 4.8.2

./configure

Edit third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc

This is necessary; otherwise gcc can't find as.

In fact, there are notes about this:

# TODO(zhengxq): for some reason, 'gcc' needs this help to find 'as'.

# Need to investigate and fix.

I had to comment their fix to get gcc to find as on my system.

Specifically, # cmd = 'PATH=' + PREFIX_DIR + ' ' + cmd

bazel build -c opt --config=cuda --verbose_failures --genrule_strategy=standalone --spawn_strategy=standalone //tensorflow/tools/pip_package:build_pip_package

What have you tried?

I don't know what else to try.

Logs or other output that would be helpful

Most of the build succeeds, but then I get

INFO: Found 1 target...
ERROR: /home-4/rdipiet2@jhu.edu/install/tensorflow/tensorflow/core/kernels/BUILD:560:1: C++ compilation of rule '//tensorflow/core/kernels:matrix_solve_ls_op' failed: crosstool_wrapper_driver_is_not_gcc failed: error executing command
(cd /home-4/rdipiet2@jhu.edu/.cache/bazel/_bazel_rdipiet2@jhu.edu/549db212089e33b4d213773753834e47/tensorflow && \
exec env - \
PATH=/home-4/rdipiet2@jhu.edu/install/bazel/output:/home-4/rdipiet2@jhu.edu/.usr/bin:/home-4/rdipiet2@jhu.edu/vc/scripts:/home-4/rdipiet2@jhu.edu/.local/bin:/cm/shared/apps/java/JDK_1.8.0_45/bin:/cm/shared/apps/cuda/7.0/bin:/cm/shared/apps/git/2.6.4/bin:/cm/shared/apps/anaconda/2.7.10/bin:/cm/shared/apps/slurm/current/sbin:/cm/shared/apps/slurm/current/bin:/cm/shared/apps/gcc/4.8.2/bin:/cm/shared/apps/Intel/openmpi/1.8.4/bin:/cm/shared/apps/binutils:/cm/shared/apps/binutils/2.25/src/bin:/cm/shared/apps/parallel_studio_xe_2015_update2/composer_xe_2015.2.164/bin/intel64:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/ibutils/bin:/sbin:/usr/sbin:/cm/local/apps/environment-modules/3.2.10/bin:/opt/dell/srvadmin/bin:/home-4/rdipiet2@jhu.edu/bin \
third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++11' -iquote . -iquote bazel-out/local_linux-opt/genfiles -iquote external/bazel_tools -iquote bazel-out/local_linux-opt/genfiles/external/bazel_tools -iquote external/jpeg_archive -iquote bazel-out/local_linux-opt/genfiles/external/jpeg_archive -iquote external/png_archive -iquote bazel-out/local_linux-opt/genfiles/external/png_archive -iquote external/re2 -iquote bazel-out/local_linux-opt/genfiles/external/re2 -iquote external/eigen_archive -iquote bazel-out/local_linux-opt/genfiles/external/eigen_archive -isystem google/protobuf/src -isystem bazel-out/local_linux-opt/genfiles/google/protobuf/src -isystem external/bazel_tools/tools/cpp/gcc3 -isystem external/jpeg_archive/jpeg-9a -isystem bazel-out/local_linux-opt/genfiles/external/jpeg_archive/jpeg-9a -isystem external/png_archive/libpng-1.2.53 -isystem bazel-out/local_linux-opt/genfiles/external/png_archive/libpng-1.2.53 -isystem external/re2 -isystem bazel-out/local_linux-opt/genfiles/external/re2 -isystem third_party/eigen3 -isystem bazel-out/local_linux-opt/genfiles/third_party/eigen3 -isystem external/eigen_archive/eigen-eigen-017cff30cf74 -isystem bazel-out/local_linux-opt/genfiles/external/eigen_archive/eigen-eigen-017cff30cf74 -isystem third_party/gpus/cuda -isystem bazel-out/local_linux-opt/genfiles/third_party/gpus/cuda -isystem third_party/gpus/cuda/include -isystem bazel-out/local_linux-opt/genfiles/third_party/gpus/cuda/include -fno-exceptions -DEIGEN_AVOID_STL_ARRAY '-DGOOGLE_CUDA=1' -pthread '-DGOOGLE_CUDA=1' -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -fno-canonical-system-headers '-frandom-seed=bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/matrix_solve_ls_op/tensorflow/core/kernels/matrix_solve_ls_op.pic.o' -MD -MF bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/matrix_solve_ls_op/tensorflow/core/kernels/matrix_solve_ls_op.pic.d -fPIC -c tensorflow/core/kernels/matrix_solve_ls_op.cc -o bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/matrix_solve_ls_op/tensorflow/core/kernels/matrix_solve_ls_op.pic.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1: crosstool_wrapper_driver_is_not_gcc failed: error executing command
(cd /home-4/rdipiet2@jhu.edu/.cache/bazel/_bazel_rdipiet2@jhu.edu/549db212089e33b4d213773753834e47/tensorflow && \
exec env - \
PATH=/home-4/rdipiet2@jhu.edu/install/bazel/output:/home-4/rdipiet2@jhu.edu/.usr/bin:/home-4/rdipiet2@jhu.edu/vc/scripts:/home-4/rdipiet2@jhu.edu/.local/bin:/cm/shared/apps/java/JDK_1.8.0_45/bin:/cm/shared/apps/cuda/7.0/bin:/cm/shared/apps/git/2.6.4/bin:/cm/shared/apps/anaconda/2.7.10/bin:/cm/shared/apps/slurm/current/sbin:/cm/shared/apps/slurm/current/bin:/cm/shared/apps/gcc/4.8.2/bin:/cm/shared/apps/Intel/openmpi/1.8.4/bin:/cm/shared/apps/binutils:/cm/shared/apps/binutils/2.25/src/bin:/cm/shared/apps/parallel_studio_xe_2015_update2/composer_xe_2015.2.164/bin/intel64:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/ibutils/bin:/sbin:/usr/sbin:/cm/local/apps/environment-modules/3.2.10/bin:/opt/dell/srvadmin/bin:/home-4/rdipiet2@jhu.edu/bin \
third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++11' -iquote . -iquote bazel-out/local_linux-opt/genfiles -iquote external/bazel_tools -iquote bazel-out/local_linux-opt/genfiles/external/bazel_tools -iquote external/jpeg_archive -iquote bazel-out/local_linux-opt/genfiles/external/jpeg_archive -iquote external/png_archive -iquote bazel-out/local_linux-opt/genfiles/external/png_archive -iquote external/re2 -iquote bazel-out/local_linux-opt/genfiles/external/re2 -iquote external/eigen_archive -iquote bazel-out/local_linux-opt/genfiles/external/eigen_archive -isystem google/protobuf/src -isystem bazel-out/local_linux-opt/genfiles/google/protobuf/src -isystem external/bazel_tools/tools/cpp/gcc3 -isystem external/jpeg_archive/jpeg-9a -isystem bazel-out/local_linux-opt/genfiles/external/jpeg_archive/jpeg-9a -isystem external/png_archive/libpng-1.2.53 -isystem bazel-out/local_linux-opt/genfiles/external/png_archive/libpng-1.2.53 -isystem external/re2 -isystem bazel-out/local_linux-opt/genfiles/external/re2 -isystem third_party/eigen3 -isystem bazel-out/local_linux-opt/genfiles/third_party/eigen3 -isystem external/eigen_archive/eigen-eigen-017cff30cf74 -isystem bazel-out/local_linux-opt/genfiles/external/eigen_archive/eigen-eigen-017cff30cf74 -isystem third_party/gpus/cuda -isystem bazel-out/local_linux-opt/genfiles/third_party/gpus/cuda -isystem third_party/gpus/cuda/include -isystem bazel-out/local_linux-opt/genfiles/third_party/gpus/cuda/include -fno-exceptions -DEIGEN_AVOID_STL_ARRAY '-DGOOGLE_CUDA=1' -pthread '-DGOOGLE_CUDA=1' -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -fno-canonical-system-headers '-frandom-seed=bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/matrix_solve_ls_op/tensorflow/core/kernels/matrix_solve_ls_op.pic.o' -MD -MF bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/matrix_solve_ls_op/tensorflow/core/kernels/matrix_solve_ls_op.pic.d -fPIC -c tensorflow/core/kernels/matrix_solve_ls_op.cc -o bazel-out/local_linux-opt/bin/tensorflow/core/kernels/_objs/matrix_solve_ls_op/tensorflow/core/kernels/matrix_solve_ls_op.pic.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
tensorflow/core/kernels/matrix_solve_ls_op.cc: In member function 'void tensorflow::MatrixSolveLsOp<Scalar, SupportsBatchOperationT>::ComputeMatrix(tensorflow::OpKernelContext*, const typename tensorflow::BinaryLinearAlgebraOp<Scalar, SupportsBatchOperationT>::ConstMatrixMap&, const typename tensorflow::BinaryLinearAlgebraOp<Scalar, SupportsBatchOperationT>::ConstMatrixMap&, typename tensorflow::BinaryLinearAlgebraOp<Scalar, SupportsBatchOperationT>::MatrixMap*)':
tensorflow/core/kernels/matrix_solve_ls_op.cc:111:41: error: 'Matrix' is not a class, namespace, or enumeration
(Scalar(l2_regularizer) * Matrix::Ones(cols, 1)).asDiagonal();
^
tensorflow/core/kernels/matrix_solve_ls_op.cc:131:41: error: 'Matrix' is not a class, namespace, or enumeration
(Scalar(l2_regularizer) * Matrix::Ones(rows, 1)).asDiagonal();
^
In file included from ./tensorflow/core/framework/op_kernel.h:22:0,
from tensorflow/core/kernels/matrix_solve_ls_op.cc:23:
./tensorflow/core/framework/allocator.h: In member function 'virtual std::size_t tensorflow::Allocator::RequestedSize(void*)':
./tensorflow/core/framework/allocator.h:152:3: warning: control reaches end of non-void function [-Wreturn-type]
}
^
In file included from ./tensorflow/core/framework/op_kernel.h:25:0,
from tensorflow/core/kernels/matrix_solve_ls_op.cc:23:
./tensorflow/core/framework/device_base.h: In member function 'virtual tensorflow::Allocator* tensorflow::DeviceBase::GetAllocator(tensorflow::AllocatorAttributes)':
./tensorflow/core/framework/device_base.h:150:3: warning: control reaches end of non-void function [-Wreturn-type]
}
^
./tensorflow/core/framework/device_base.h: In member function 'virtual const tensorflow::DeviceAttributes& tensorflow::DeviceBase::attributes() const':
./tensorflow/core/framework/device_base.h:181:3: warning: control reaches end of non-void function [-Wreturn-type]
}
^
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 12.708s, Critical Path: 12.06s

I'm hoping very much to get this running on a CentOS cluster – any help will be very appreciated. Thanks.

Issue 2:
I have been trying to compile tensorflow from source without success.

I could compile version 0.6.0 with no trouble, but trying to compile 0.7.1 produces the following error:

tensorflow/core/kernels/matrix_solve_ls_op.cc: In member function 'void tensorflow::MatrixSolveLsOp::ComputeMatrix(tensorflow::OpKernelContext*, const typename tensorflow::BinaryLinearAlgebraOp::ConstMatrixMap&, const typename tensorflow::BinaryLinearAlgebraOp::ConstMatrixMap&, typename tensorflow::BinaryLinearAlgebraOp::MatrixMap*)':
tensorflow/core/kernels/matrix_solve_ls_op.cc:111:41: error: 'Matrix' is not a class, namespace, or enumeration
(Scalar(l2_regularizer) * Matrix::Ones(cols, 1)).asDiagonal();
^
tensorflow/core/kernels/matrix_solve_ls_op.cc:131:41: error: 'Matrix' is not a class, namespace, or enumeration
(Scalar(l2_regularizer) * Matrix::Ones(rows, 1)).asDiagonal();
^
In file included from ./tensorflow/core/framework/op_kernel.h:22:0,
from tensorflow/core/kernels/matrix_solve_ls_op.cc:23:
./tensorflow/core/framework/allocator.h: In member function 'virtual std::size_t tensorflow::Allocator::RequestedSize(void*)':
./tensorflow/core/framework/allocator.h:128:3: warning: control reaches end of non-void function [-Wreturn-type]
}
^
In file included from ./tensorflow/core/framework/op_kernel.h:25:0,
from tensorflow/core/kernels/matrix_solve_ls_op.cc:23:
./tensorflow/core/framework/device_base.h: In member function 'virtual tensorflow::Allocator* tensorflow::DeviceBase::GetAllocator(tensorflow::AllocatorAttributes)':
./tensorflow/core/framework/device_base.h:149:3: warning: control reaches end of non-void function [-Wreturn-type]
}
^
./tensorflow/core/framework/device_base.h: In member function 'virtual const tensorflow::DeviceAttributes& tensorflow::DeviceBase::attributes() const':
./tensorflow/core/framework/device_base.h:179:3: warning: control reaches end of non-void function [-Wreturn-type]
}
^

I tried to find the definition of Matrix::Ones in all folders, but couldn't find anything. In fact

grep "Ones" tensorflow/* -R

returns

core/kernels/matrix_solve_ls_op.cc: (Scalar(l2_regularizer) * Matrix::Ones(cols, 1)).asDiagonal();
core/kernels/matrix_solve_ls_op.cc: (Scalar(l2_regularizer) * Matrix::Ones(rows, 1)).asDiagonal();
python/kernel_tests/constant_op_test.py:class OnesTest(tf.test.TestCase):
python/kernel_tests/constant_op_test.py: def _Ones(self, shape):
python/kernel_tests/constant_op_test.py: self.assertTrue(np.array_equal(self._Ones([2, 3]), np.array([[1] * 3] * 2)))
python/kernel_tests/constant_op_test.py:class OnesLikeTest(tf.test.TestCase):
python/kernel_tests/constant_op_test.py: def testOnesLike(self):
python/kernel_tests/constant_op_test.py: def testOnesLikePartialShape(self):
python/kernel_tests/shape_ops_test.py: def testSqueezeAllOnes(self):
python/kernel_tests/shape_ops_test.py: def testSqueezeOnlyOnes(self):

Environment info

OS : CentOS 6.6, but I have gcc 4.8.2 installed.

Steps to reproduce

./configure

say yes to GPU, cuda 7.5, cudnn 4

bazel build --config=cuda --jobs 6 --verbose_failures --linkopt="-lrt" --linkopt="-lm" --genrule_strategy=standalone --spawn_strategy=standalone -c opt //tensorflow/tools/pip_package:build_pip_package