LeelaChessZero / lc0

The rewritten engine, originally for tensorflow. Now all other backends have been ported here.
GNU General Public License v3.0
2.38k stars 525 forks source link

Guidance on ensuring tensorflow_cc libraries are available when building on macOS #1903

Closed rschwiebert closed 1 year ago

rschwiebert commented 1 year ago

I'm attempting to build lc0 at tag release/0.29 . I've pulled the repo and its submodules as per the README, and followed the advice to make sure xcode is up to date and to export CPATH=xcrun --show-sdk-path/usr/include.

The build output fails with the errors

                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/neural/metal/mps/NetworkGraph.mm:709:51: error: no visible @interface for 'MPSGraph' declares the selector 'splitTensor:splitSizes:axis:name:'
    NSArray<MPSGraphTensor *> * offsets = [_graph splitTensor:keys
                                           ~~~~~~ ^~~~~~~~~~~~~~~~
../../src/neural/metal/mps/NetworkGraph.mm:723:21: error: no visible @interface for 'MPSGraph' declares the selector 'stackTensors:axis:name:'
    promo = [_graph stackTensors:stack axis:3 name:[NSString stringWithFormat:@"%@/offset_broadcast", label]];

During the initial part of the build, I notice what looks like a probable cause for the thing above: Run-time dependency tensorflow_cc found: NO (tried pkgconfig, framework and cmake)

After casting about unsuccessfully to find an easy way to get tensorflow_cc including brew installing tensorflow_cc, I spent a lot of time building the tensorflow_cc project withmake. It was apparently successfully built and installed but I still get the same error message and Run-time dependency tensorflow_cc found: NO (tried pkgconfig, framework and cmake) despite that.

So, this appears to be a big hangup and the docs here don't seem to address it... can I get a little guidance?

Version information: macOS: 12.6.7 ninja: 1.11.1 meson: 1.2.0 openblas: 0.3.23

Steps to Reproduce

  1. ./build.sh -Dgtest=false on macOS 12.6.7
rschwiebert commented 1 year ago

Oh! I think it's a duplicate of https://github.com/LeelaChessZero/lc0/issues/1814