TomHeaven / tensorflow-osx-build

Off-the-shelf python package of tensorflow with CUDA support for Mac OS.
142 stars 20 forks source link

Building 1.14rc0 #12

Closed hoonkai closed 5 years ago

hoonkai commented 5 years ago

Hi

I was wondering if you've had the chance to try building v1.14-rc0. I've been trying to build it with Bazel 0.24, but I keep running into the error:

external/local_config_cuda/cuda/BUILD:168:1: Executing genrule @local_config_cuda//cuda:cuda-include failed (Exit 1): bash failed: error executing command
...
/bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; cp -rLf "/usr/local/cuda/include/." "bazel-out/host/bin/external/local_config_cuda/cuda/cuda/include/" ')
Execution platform: @bazel_tools//platforms:host_platform
cp: the -H, -L, and -P options may not be specified with the -r option.

I could proceed by replacing cp -r with cp -R in the generated BUILD file, but then this error later gets in the way:

ERROR: /Volumes/Data/Projects/tensorflow-1.14/src/tensorflow/tensorflow/core/kernels/BUILD:1766:1: output 'tensorflow/core/kernels/_objs/gather_functor_gpu/gather_functor_gpu.cu.pic.o' was not created

Not sure if you have better luck?

Cheers

TomHeaven commented 5 years ago

I'll try building v1.14-rc0. But v1.14-rc0 is a pre-release, I do not recommend you to use it. In addition, building a pre-release is often more troublesome.

TomHeaven commented 5 years ago

I've found the cause. cp command of osx does not accept rLf as an argument. We need to update third-party/gpus/cuda_configure.bazel. Find the two lines

  cmd = \"""cp -rLf "%s/." "%s/" \""",
)""" % (name, "\n".join(outs), src_dir, out_dir)

and replace it with

cmd = \"""cp -r -f "%s/." "%s/" \""",
)""" % (name, "\n".join(outs), src_dir, out_dir)

Recompile TF and the problem should be solved.

TomHeaven commented 5 years ago

TF 1.14.0rc1 build is available at https://github.com/TomHeaven/tensorflow-osx-build/releases/tag/v1.14.0rc1_cu100.

hoonkai commented 5 years ago

@TomHeaven Thanks for that!