Lc0 - macOS binary requested

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
crem
Posts: 142
Joined: Wed May 23, 2018 7:29 pm

Re: Lc0 - macOS binary requested

Post by crem » Fri Dec 06, 2019 11:17 am

INPUT_112_WITH_CASTLING_PLANE was added into the protobuf which is in the lczero-common sub-repository.

If you're reusing your existing git repo, type `git submodule update` to update it.

If you clone the repository fresh then `git clone --recurse-submodule` will already fetch the latest version.

littlecapa
Posts: 3
Joined: Mon Dec 02, 2019 6:34 pm
Full name: Roger Lorenz

Re: Lc0 - macOS binary requested

Post by littlecapa » Fri Dec 06, 2019 6:38 pm

MikeB wrote:
Fri Dec 06, 2019 6:13 am
MikeB wrote:
Fri Dec 06, 2019 3:46 am
littlecapa wrote:
Thu Dec 05, 2019 6:48 pm
MikeB wrote:
Sat May 25, 2019 5:05 am
Steppenwolf wrote:
Fri May 24, 2019 2:54 pm
I did all the things you mentioned.
Everything worked properly to my feeling.

Please go ahead...

Hi MikeB!

I followed all your steps but it does not work on my Mac Mini 2018 (macOS 10.15.1). The linker always throws this error:

ld: can't map file, errno=22 file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenCL.framework' for architecture x86_64

Any idea how to fix this?
Unchartered waters for me since I see you are on Catalina. Did you pull the most recent committed source or the last stable release? Generally for Lc0, they are different.

As a fyi, Catalina has caused some problems from some users.
Generally speaking, unless you are quite adept at solving Apple issues on your own, if you are compiling your own programs , best to wait ( I would say 6 months) for bugs to be fixed on major releases.

There are few things we can try. First I need to know the source you are trying to compile( date) and the compiler - gcc or clang and which version.

The error description "erron==22" is not very precise, it basically say we can not open a file that is needed, suggesting that a file is missing or is in a different location than expected, or it may be corrupt. In this case, we know it's looking for '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenCL.framework' so , in finder , if you go to folder ( Finder>>Go>>Go to Folder...)
'/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/" is that a valid path on your Mac Mini? If it is, does it include the file OpenCL.framework file?

Things we can try , if you complied a source correctly before without issues., try that "older" source on your Mac Mini. Compare the Mac Mini compiler and version to the compiler version you successfully compiled. We want to rule out differences between the successful compilation and the unsuccessful compilation as much as possible - so try to make everything on your Mac Mini the same as your previous Mac - date of source, complier version etc.
Through the process of elimination, as I was describing above ,I was able to locate the source of the error message - first thing I tried was to build lc0 using the source which built fine before. I got the same error you got above. I then restored the prior OpenCL framework, and to my surprise that also failed. The fact that BOTH gcc and clang were creating the same error , ruled out the possibility it was the compilers at fault, the error was not to due to any changes in the source - so it had to be one of other tools that are using being used to build Lc0. I took a wild guess it was meson ;>) , reactivated the old version ( I use macports, if you use home-brew, you will have to check with their instructions to reactive prior ports)

Code: Select all

  sudo port activate meson @0.51.2_0
--->  Computing dependencies for meson
--->  Activating meson @0.51.2_0
--->  Cleaning meson
 
bingo it worked on the old source. meson 5.2 is the culprit here.

update to the latest source - and you will get this error

../../src/neural/encoder.cc:67:37: error: no member named 'INPUT_112_WITH_CASTLING_PLANE' in 'pblczero::NetworkFormat'
case pblczero::NetworkFormat::INPUT_112_WITH_CASTLING_PLANE: {

an error like this should never happen, it tells me that this code is not being used, how it got comitted, I don't know.

Comment out lines 67 through 82 ( I used /* and */ below in encoder.cc , making the code inactive , my guess is this is related to FRC castling code without taking a real hard look at it.
code above references , "INPUT_CLASSICAL_112_PLANE" which is probably classical/standard chess.

Code: Select all

/*
      case pblczero::NetworkFormat::INPUT_112_WITH_CASTLING_PLANE: {
        // - Plane 104 for positions of rooks (both white and black) which have
        // a-side (queenside) castling right.
        // - Plane 105 for positions of rooks (both white and black) which have
        // h-side (kingside) castling right.
        const auto& cast = board.castlings();
        result[kAuxPlaneBase + 0].mask =
            ((cast.we_can_000() ? ChessBoard::A1 : 0) |
             (cast.they_can_000() ? ChessBoard::A8 : 0))
            << cast.queenside_rook();
        result[kAuxPlaneBase + 1].mask =
            ((cast.we_can_00() ? ChessBoard::A1 : 0) |
             (cast.they_can_00() ? ChessBoard::A8 : 0))
            << cast.kingside_rook();
        break;
      }
*/
bingo again, it compiles

Code: Select all

[100/100] Linking target encoder_test.
~/Github/LeelaChessZero
good luck!
Hi MikeB!

Great work analyzing the problem in such detail and providing a solution. Kudos to you!

I am still stuck with meson 5.2. It looks like that brew does not provide older versions of meson. And switching from brew to port on the fly is also not possible. But I am confident, that I will manage in the end.

Kind regards,
Littlecapa

MikeB
Posts: 3657
Joined: Thu Mar 09, 2006 5:34 am
Location: Pen Argyl, Pennsylvania

Re: Lc0 - macOS binary requested

Post by MikeB » Fri Dec 06, 2019 6:41 pm

crem wrote:
Fri Dec 06, 2019 11:17 am
INPUT_112_WITH_CASTLING_PLANE was added into the protobuf which is in the lczero-common sub-repository.

If you're reusing your existing git repo, type `git submodule update` to update it.

If you clone the repository fresh then `git clone --recurse-submodule` will already fetch the latest version.
Thanks, I was not aware of your solution.

MikeB
Posts: 3657
Joined: Thu Mar 09, 2006 5:34 am
Location: Pen Argyl, Pennsylvania

Re: Lc0 - macOS binary requested

Post by MikeB » Fri Dec 06, 2019 6:45 pm

littlecapa wrote:
Fri Dec 06, 2019 6:38 pm
MikeB wrote:
Fri Dec 06, 2019 6:13 am
MikeB wrote:
Fri Dec 06, 2019 3:46 am
littlecapa wrote:
Thu Dec 05, 2019 6:48 pm
MikeB wrote:
Sat May 25, 2019 5:05 am
Steppenwolf wrote:
Fri May 24, 2019 2:54 pm
I did all the things you mentioned.
Everything worked properly to my feeling.

Please go ahead...

Hi MikeB!

I followed all your steps but it does not work on my Mac Mini 2018 (macOS 10.15.1). The linker always throws this error:

ld: can't map file, errno=22 file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenCL.framework' for architecture x86_64

Any idea how to fix this?
Unchartered waters for me since I see you are on Catalina. Did you pull the most recent committed source or the last stable release? Generally for Lc0, they are different.

As a fyi, Catalina has caused some problems from some users.
Generally speaking, unless you are quite adept at solving Apple issues on your own, if you are compiling your own programs , best to wait ( I would say 6 months) for bugs to be fixed on major releases.

There are few things we can try. First I need to know the source you are trying to compile( date) and the compiler - gcc or clang and which version.

The error description "erron==22" is not very precise, it basically say we can not open a file that is needed, suggesting that a file is missing or is in a different location than expected, or it may be corrupt. In this case, we know it's looking for '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenCL.framework' so , in finder , if you go to folder ( Finder>>Go>>Go to Folder...)
'/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/" is that a valid path on your Mac Mini? If it is, does it include the file OpenCL.framework file?

Things we can try , if you complied a source correctly before without issues., try that "older" source on your Mac Mini. Compare the Mac Mini compiler and version to the compiler version you successfully compiled. We want to rule out differences between the successful compilation and the unsuccessful compilation as much as possible - so try to make everything on your Mac Mini the same as your previous Mac - date of source, complier version etc.
Through the process of elimination, as I was describing above ,I was able to locate the source of the error message - first thing I tried was to build lc0 using the source which built fine before. I got the same error you got above. I then restored the prior OpenCL framework, and to my surprise that also failed. The fact that BOTH gcc and clang were creating the same error , ruled out the possibility it was the compilers at fault, the error was not to due to any changes in the source - so it had to be one of other tools that are using being used to build Lc0. I took a wild guess it was meson ;>) , reactivated the old version ( I use macports, if you use home-brew, you will have to check with their instructions to reactive prior ports)

Code: Select all

  sudo port activate meson @0.51.2_0
--->  Computing dependencies for meson
--->  Activating meson @0.51.2_0
--->  Cleaning meson
 
bingo it worked on the old source. meson 5.2 is the culprit here.

update to the latest source - and you will get this error

../../src/neural/encoder.cc:67:37: error: no member named 'INPUT_112_WITH_CASTLING_PLANE' in 'pblczero::NetworkFormat'
case pblczero::NetworkFormat::INPUT_112_WITH_CASTLING_PLANE: {

an error like this should never happen, it tells me that this code is not being used, how it got comitted, I don't know.

Comment out lines 67 through 82 ( I used /* and */ below in encoder.cc , making the code inactive , my guess is this is related to FRC castling code without taking a real hard look at it.
code above references , "INPUT_CLASSICAL_112_PLANE" which is probably classical/standard chess.

Code: Select all

/*
      case pblczero::NetworkFormat::INPUT_112_WITH_CASTLING_PLANE: {
        // - Plane 104 for positions of rooks (both white and black) which have
        // a-side (queenside) castling right.
        // - Plane 105 for positions of rooks (both white and black) which have
        // h-side (kingside) castling right.
        const auto& cast = board.castlings();
        result[kAuxPlaneBase + 0].mask =
            ((cast.we_can_000() ? ChessBoard::A1 : 0) |
             (cast.they_can_000() ? ChessBoard::A8 : 0))
            << cast.queenside_rook();
        result[kAuxPlaneBase + 1].mask =
            ((cast.we_can_00() ? ChessBoard::A1 : 0) |
             (cast.they_can_00() ? ChessBoard::A8 : 0))
            << cast.kingside_rook();
        break;
      }
*/
bingo again, it compiles

Code: Select all

[100/100] Linking target encoder_test.
~/Github/LeelaChessZero
good luck!
Hi MikeB!

Great work analyzing the problem in such detail and providing a solution. Kudos to you!

I am still stuck with meson 5.2. It looks like that brew does not provide older versions of meson. And switching from brew to port on the fly is also not possible. But I am confident, that I will manage in the end.

Kind regards,
Littlecapa
I think you can remove Meson from brew and just compile 5.1.2 from the source on GitHub and you should be good. I did raise it as an issue on the meson Github site - if I see it gets addressed , I will post here.

smcracraft
Posts: 694
Joined: Wed Mar 08, 2006 7:08 pm
Location: Orange County California
Full name: Stuart Cracraft
Contact:

Re: Lc0 - macOS binary requested

Post by smcracraft » Sat Dec 07, 2019 7:36 pm

Very unfortunately on a macOS Mojave v10.14.6 MacBook Pro, the build, given
the above set of commands in a virtualenv virtual environment (for isolation from the OS)
gives this show-stopping error:

Code: Select all

./build.sh
~/src/leela/src/leela/lc0 ~/src/leela/src/leela/lc0
The Meson build system
Version: 0.52.0
Source dir: /Users/stuartcracraft/src/leela/src/leela/lc0
Build dir: /Users/stuartcracraft/src/leela/src/leela/lc0/build/release
Build type: native build
Project name: lc0
Project version: undefined
C++ compiler for the host machine: c++ (clang 10.0.1 "Apple LLVM version 10.0.1 (clang-1001.0.46.4)")
C++ linker for the host machine: APPLE ld 450.3
Host machine cpu family: x86_64
Host machine cpu: x86_64
WARNING: Consider using the builtin warning_level option instead of adding warning flags by hand.
Library libprotobuf found: NO
Did not find pkg-config by name 'pkg-config'
Found Pkg-config: NO
Found CMake: /usr/local/bin/cmake (3.15.5)
Run-time dependency protobuf found: YES 
Program protoc found: YES (/usr/local/bin/protoc)
Program git found: YES (/usr/bin/git)
Message: updating git submodule libs/lczero-common
Message: Using build identifier "git.97cae9a".
Library pthread found: YES
Library dl found: YES
Library libtensorflow_cc found: NO
Run-time dependency accelerate found: YES (/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Accelerate.framework)
Library mkl_rt found: NO
Library mklml found: NO
Library dnnl found: NO
Library openblas.dll found: NO
Library openblas found: NO
Program ispc found: NO
Library OpenCL found: NO
Run-time dependency opencl found: YES 1.2
Library cublas found: NO
Library cudnn found: NO
Library cudart found: NO
Program nvcc found: NO
Program /usr/local/cuda/bin/nvcc found: NO
Program /opt/cuda/bin/nvcc found: NO
Run-time dependency zlib found: YES 1.2.11
Run-time dependency GTest found: NO (tried pkgconfig and system)
Looking for a fallback subproject for the dependency gtest
Downloading gtest source from https://github.com/google/googletest/archive/release-1.8.1.zip
Downloading file of unknown size.
Downloading gtest patch from https://wrapdb.mesonbuild.com/v1/projects/gtest/1.8.1/1/get_zip
Download size: 2084
Downloading: ..........

|Executing subproject gtest method meson 
|
|Project name: gtest
|Project version: 1.8.1
|C++ compiler for the host machine: c++ (clang 10.0.1 "Apple LLVM version 10.0.1 (clang-1001.0.46.4)")
|C++ linker for the host machine: APPLE ld 450.3
|Run-time dependency threads found: YES 
|Dependency threads found: YES (cached)
|Dependency threads found: YES (cached)
|Dependency threads found: YES (cached)
|Build targets in project: 1
|Subproject gtest finished.

Dependency gtest from subproject subprojects/gtest found: YES
Build targets in project: 8
Found ninja-1.9.0 at /usr/local/bin/ninja
[1/130] Generating source from 'libs/lczero-common/proto/net.proto'.
[2/130] Generating source from 'libs/lczero-common/proto/net.proto'.
[3/130] Generating source from 'libs/lczero-common/proto/net.proto'.
[4/130] Compiling C++ object 'lc0_lib@sha/src_version.cc.o'.
[5/130] Compiling C++ object 'lc0_lib@sha/src_chess_bitboard.cc.o'.
[6/130] Compiling C++ object 'lc0@exe/src_neural_cache.cc.o'.
[7/130] Compiling C++ object 'lc0@exe/src_neural_encoder.cc.o'.
[8/130] Compiling C++ object 'lc0_lib@sha/src_chess_board.cc.o'.
[9/130] Compiling C++ object 'lc0_lib@sha/src_mcts_node.cc.o'.
[10/130] Compiling C++ object 'lc0@exe/src_version.cc.o'.
[11/130] Compiling C++ object 'lc0_lib@sha/meson-generated_proto_net.pb.cc.o'.
In file included from lc0_lib@sha/proto/net.pb.cc:4:
In file included from lc0_lib@sha/proto/net.pb.h:26:
In file included from /usr/local/include/google/protobuf/generated_message_table_driven.h:34:
In file included from /usr/local/include/google/protobuf/map.h:49:
In file included from /usr/local/include/google/protobuf/map_type_handler.h:34:
In file included from /usr/local/include/google/protobuf/parse_context.h:43:
In file included from /usr/local/include/google/protobuf/metadata_lite.h:37:
/usr/local/include/google/protobuf/generated_message_util.h:227:14: warning: zero size arrays are an extension [-Wzero-length-array]
  void* deps[PROTOBUF_ARRAY_SIZE(N)];
             ^~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/google/protobuf/generated_message_util.h:212:32: note: expanded from macro 'PROTOBUF_ARRAY_SIZE'
#define PROTOBUF_ARRAY_SIZE(n) (n)
                               ^~~
lc0_lib@sha/proto/net.pb.cc:79:47: note: in instantiation of template class 'google::protobuf::internal::SCCInfo<0>' requested here
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_EngineVersion_proto_2fnet_2eproto =
                                              ^
1 warning generated.
[12/130] Compiling C++ object 'lc0@exe/meson-generated_proto_net.pb.cc.o'.
In file included from lc0@exe/proto/net.pb.cc:4:
In file included from lc0@exe/proto/net.pb.h:26:
In file included from /usr/local/include/google/protobuf/generated_message_table_driven.h:34:
In file included from /usr/local/include/google/protobuf/map.h:49:
In file included from /usr/local/include/google/protobuf/map_type_handler.h:34:
In file included from /usr/local/include/google/protobuf/parse_context.h:43:
In file included from /usr/local/include/google/protobuf/metadata_lite.h:37:
/usr/local/include/google/protobuf/generated_message_util.h:227:14: warning: zero size arrays are an extension [-Wzero-length-array]
  void* deps[PROTOBUF_ARRAY_SIZE(N)];
             ^~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/google/protobuf/generated_message_util.h:212:32: note: expanded from macro 'PROTOBUF_ARRAY_SIZE'
#define PROTOBUF_ARRAY_SIZE(n) (n)
                               ^~~
lc0@exe/proto/net.pb.cc:79:47: note: in instantiation of template class 'google::protobuf::internal::SCCInfo<0>' requested here
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_EngineVersion_proto_2fnet_2eproto =
                                              ^
1 warning generated.
[13/130] Compiling C++ object 'lc0@exe/src_main.cc.o'.
[14/130] Compiling C++ object 'lc0@exe/src_chess_position.cc.o'.
[15/130] Compiling C++ object 'lc0@exe/src_chess_bitboard.cc.o'.
[16/130] Compiling C++ object 'lc0_lib@sha/src_benchmark_benchmark.cc.o'.
[17/130] Compiling C++ object 'lc0_lib@sha/src_engine.cc.o'.
[18/130] Compiling C++ object 'lc0@exe/src_chess_board.cc.o'.
[19/130] Compiling C++ object 'lc0@exe/src_mcts_node.cc.o'.
[20/130] Compiling C++ object 'lc0@exe/src_mcts_stoppers_timemgr.cc.o'.
[21/130] Compiling C++ object 'lc0@exe/src_engine.cc.o'.
[22/130] Compiling C++ object 'lc0@exe/src_chess_uciloop.cc.o'.
[23/130] Compiling C++ object 'lc0@exe/src_mcts_stoppers_stoppers.cc.o'.
[24/130] Compiling C++ object 'lc0@exe/src_benchmark_benchmark.cc.o'.
[25/130] Compiling C++ object 'lc0@exe/src_mcts_params.cc.o'.
[26/130] Compiling C++ object 'lc0@exe/src_mcts_stoppers_factory.cc.o'.
[27/130] Compiling C++ object 'lc0@exe/src_neural_network_legacy.cc.o'.
[28/130] Compiling C++ object 'lc0@exe/src_neural_loader.cc.o'.
../../src/neural/loader.cc:91:16: warning: 'SetTotalBytesLimit' is deprecated: Please use the single parameter version of SetTotalBytesLimit(). The second parameter is ignored. [-Wdeprecated-declarations]
  input_stream.SetTotalBytesLimit(2000 * 1000000, 500 * 1000000);
               ^
/usr/local/include/google/protobuf/io/coded_stream.h:394:3: note: 'SetTotalBytesLimit' has been explicitly marked deprecated here
  PROTOBUF_DEPRECATED_MSG(
  ^
/usr/local/include/google/protobuf/port_def.inc:153:53: note: expanded from macro 'PROTOBUF_DEPRECATED_MSG'
#define PROTOBUF_DEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
                                                    ^
1 warning generated.
[29/130] Compiling C++ object 'lc0@exe/src_utils_configfile.cc.o'.
[30/130] Compiling C++ object 'lc0@exe/src_mcts_search.cc.o'.
[31/130] Compiling C++ object 'lc0@exe/src_neural_network_random.cc.o'.
[32/130] Compiling C++ object 'lc0@exe/src_neural_factory.cc.o'.
[33/130] Compiling C++ object 'lc0@exe/src_neural_writer.cc.o'.
[34/130] Compiling C++ object 'lc0@exe/src_neural_network_demux.cc.o'.
[35/130] Compiling C++ object 'chessboard_test@exe/subprojects_googletest-release-1.8.1_googletest_src_gtest-all.cc.o'.
[36/130] Compiling C++ object 'lc0@exe/src_utils_esc_codes.cc.o'.
[37/130] Compiling C++ object 'lc0@exe/src_neural_network_mux.cc.o'.
[38/130] Compiling C++ object 'lc0@exe/src_neural_network_rr.cc.o'.
[39/130] Compiling C++ object 'lc0@exe/src_utils_commandline.cc.o'.
[40/130] Compiling C++ object 'lc0@exe/src_utils_histogram.cc.o'.
[41/130] Compiling C++ object 'lc0@exe/src_neural_network_check.cc.o'.
[42/130] Compiling C++ object 'lc0@exe/src_utils_logging.cc.o'.
[43/130] Compiling C++ object 'lc0@exe/src_utils_random.cc.o'.
[44/130] Compiling C++ object 'lc0@exe/src_utils_transpose.cc.o'.
[45/130] Compiling C++ object 'lc0@exe/src_neural_blas_fully_connected_layer.cc.o'.
[46/130] Compiling C++ object 'lc0@exe/src_utils_string.cc.o'.
[47/130] Compiling C++ object 'lc0@exe/src_syzygy_syzygy.cc.o'.
[48/130] Compiling C++ object 'lc0@exe/src_neural_blas_se_unit.cc.o'.
[49/130] Compiling C++ object 'lc0@exe/src_utils_filesystem.posix.cc.o'.
[50/130] Compiling C++ object 'lc0@exe/src_utils_weights_adapter.cc.o'.
[51/130] Compiling C++ object 'lc0@exe/src_selfplay_loop.cc.o'.
[52/130] Compiling C++ object 'lc0@exe/src_selfplay_game.cc.o'.
[53/130] Compiling C++ object 'lc0@exe/src_utils_optionsdict.cc.o'.
[54/130] Compiling C++ object 'lc0@exe/src_neural_shared_activation.cc.o'.
[55/130] Compiling C++ object 'lc0@exe/src_neural_shared_winograd_filter.cc.o'.
[56/130] Compiling C++ object 'lc0@exe/src_neural_blas_convolution1.cc.o'.
[57/130] Compiling C++ object 'lc0@exe/src_utils_optionsparser.cc.o'.
[58/130] Compiling C++ object 'lc0_lib@sha/src_chess_position.cc.o'.
[59/130] Compiling C++ object 'lc0@exe/src_neural_blas_winograd_convolution3.cc.o'.
[60/130] Compiling C++ object 'lc0@exe/src_neural_opencl_OpenCLBuffers.cc.o'.
[61/130] Compiling C++ object 'lc0@exe/src_selfplay_tournament.cc.o'.
[62/130] Compiling C++ object 'lc0@exe/src_neural_blas_network_blas.cc.o'.
[63/130] Compiling C++ object 'lc0@exe/src_neural_opencl_OpenCL.cc.o'.
[64/130] Compiling C++ object 'lc0_lib@sha/src_mcts_stoppers_timemgr.cc.o'.
[65/130] Compiling C++ object 'lc0_lib@sha/src_chess_uciloop.cc.o'.
[66/130] Compiling C++ object 'lc0_lib@sha/src_mcts_stoppers_stoppers.cc.o'.
[67/130] Compiling C++ object 'lc0@exe/src_neural_opencl_network_opencl.cc.o'.
[68/130] Compiling C++ object 'lc0_lib@sha/src_mcts_params.cc.o'.
[69/130] Compiling C++ object 'lc0_lib@sha/src_mcts_stoppers_factory.cc.o'.
[70/130] Compiling C++ object 'lc0@exe/src_neural_opencl_OpenCLTuner.cc.o'.
[71/130] Compiling C++ object 'lc0_lib@sha/src_neural_encoder.cc.o'.
[72/130] Compiling C++ object 'lc0_lib@sha/src_neural_cache.cc.o'.
[73/130] Linking target lc0.
FAILED: lc0 
c++  -o lc0 'lc0@exe/meson-generated_proto_net.pb.cc.o' 'lc0@exe/src_main.cc.o' 'lc0@exe/src_engine.cc.o' 'lc0@exe/src_version.cc.o' 'lc0@exe/src_benchmark_benchmark.cc.o' 'lc0@exe/src_chess_bitboard.cc.o' 'lc0@exe/src_chess_board.cc.o' 'lc0@exe/src_chess_position.cc.o' 'lc0@exe/src_chess_uciloop.cc.o' 'lc0@exe/src_mcts_node.cc.o' 'lc0@exe/src_mcts_params.cc.o' 'lc0@exe/src_mcts_search.cc.o' 'lc0@exe/src_mcts_stoppers_factory.cc.o' 'lc0@exe/src_mcts_stoppers_stoppers.cc.o' 'lc0@exe/src_mcts_stoppers_timemgr.cc.o' 'lc0@exe/src_neural_cache.cc.o' 'lc0@exe/src_neural_encoder.cc.o' 'lc0@exe/src_neural_factory.cc.o' 'lc0@exe/src_neural_loader.cc.o' 'lc0@exe/src_neural_network_check.cc.o' 'lc0@exe/src_neural_network_demux.cc.o' 'lc0@exe/src_neural_network_legacy.cc.o' 'lc0@exe/src_neural_network_mux.cc.o' 'lc0@exe/src_neural_network_random.cc.o' 'lc0@exe/src_neural_network_rr.cc.o' 'lc0@exe/src_neural_writer.cc.o' 'lc0@exe/src_selfplay_game.cc.o' 'lc0@exe/src_selfplay_loop.cc.o' 'lc0@exe/src_selfplay_tournament.cc.o' 'lc0@exe/src_syzygy_syzygy.cc.o' 'lc0@exe/src_utils_commandline.cc.o' 'lc0@exe/src_utils_configfile.cc.o' 'lc0@exe/src_utils_esc_codes.cc.o' 'lc0@exe/src_utils_histogram.cc.o' 'lc0@exe/src_utils_logging.cc.o' 'lc0@exe/src_utils_optionsdict.cc.o' 'lc0@exe/src_utils_optionsparser.cc.o' 'lc0@exe/src_utils_random.cc.o' 'lc0@exe/src_utils_string.cc.o' 'lc0@exe/src_utils_transpose.cc.o' 'lc0@exe/src_utils_weights_adapter.cc.o' 'lc0@exe/src_utils_filesystem.posix.cc.o' 'lc0@exe/src_neural_blas_convolution1.cc.o' 'lc0@exe/src_neural_blas_fully_connected_layer.cc.o' 'lc0@exe/src_neural_blas_se_unit.cc.o' 'lc0@exe/src_neural_blas_network_blas.cc.o' 'lc0@exe/src_neural_blas_winograd_convolution3.cc.o' 'lc0@exe/src_neural_opencl_network_opencl.cc.o' 'lc0@exe/src_neural_opencl_OpenCL.cc.o' 'lc0@exe/src_neural_opencl_OpenCLTuner.cc.o' 'lc0@exe/src_neural_opencl_OpenCLBuffers.cc.o' 'lc0@exe/src_neural_shared_activation.cc.o' 'lc0@exe/src_neural_shared_winograd_filter.cc.o' -Wl,-dead_strip_dylibs -Wl,-undefined,error -Wl,-headerpad_max_install_names /usr/local/lib/libprotobuf.dylib -lpthread -F/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks -framework Accelerate /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenCL.framework /usr/lib/libz.dylib
ld: can't map file, errno=22 file '/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenCL.framework' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[74/130] Compiling C++ object 'lc0_lib@sha/src_utils_logging.cc.o'.
[75/130] Compiling C++ object 'lc0_lib@sha/src_neural_network_legacy.cc.o'.
[76/130] Compiling C++ object 'lc0_lib@sha/src_neural_loader.cc.o'.
../../src/neural/loader.cc:91:16: warning: 'SetTotalBytesLimit' is deprecated: Please use the single parameter version of SetTotalBytesLimit(). The second parameter is ignored. [-Wdeprecated-declarations]
  input_stream.SetTotalBytesLimit(2000 * 1000000, 500 * 1000000);
               ^
/usr/local/include/google/protobuf/io/coded_stream.h:394:3: note: 'SetTotalBytesLimit' has been explicitly marked deprecated here
  PROTOBUF_DEPRECATED_MSG(
  ^
/usr/local/include/google/protobuf/port_def.inc:153:53: note: expanded from macro 'PROTOBUF_DEPRECATED_MSG'
#define PROTOBUF_DEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
                                                    ^
1 warning generated.
[77/130] Compiling C++ object 'lc0_lib@sha/src_mcts_search.cc.o'.
[78/130] Compiling C++ object 'lc0_lib@sha/src_neural_factory.cc.o'.
[79/130] Compiling C++ object 'lc0_lib@sha/src_neural_network_random.cc.o'.
[80/130] Compiling C++ object 'lc0_lib@sha/src_neural_network_demux.cc.o'.
[81/130] Compiling C++ object 'lc0_lib@sha/src_neural_network_mux.cc.o'.
[82/130] Compiling C++ object 'lc0_lib@sha/src_neural_network_check.cc.o'.
ninja: build stopped: subcommand failed.

** Yet the directory the linker can't map is there

ls /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenCL.framework
Headers
Modules
OpenCL.tbd
Versions


smcracraft
Posts: 694
Joined: Wed Mar 08, 2006 7:08 pm
Location: Orange County California
Full name: Stuart Cracraft
Contact:

Re: Lc0 - macOS binary requested

Post by smcracraft » Sat Dec 07, 2019 7:41 pm

This seems to be relevant, an error number of 22 when the linker tries to load a directory rather than a file for linking.

https://stackoverflow.com/questions/164 ... ure-x86-64

Looks like there is an error in the build.sh for Leela...

MikeB
Posts: 3657
Joined: Thu Mar 09, 2006 5:34 am
Location: Pen Argyl, Pennsylvania

Re: Lc0 - macOS binary requested

Post by MikeB » Sat Dec 07, 2019 8:35 pm

smcracraft wrote:
Sat Dec 07, 2019 7:36 pm
Very unfortunately on a macOS Mojave v10.14.6 MacBook Pro, the build, given
the above set of commands in a virtualenv virtual environment (for isolation from the OS)
gives this show-stopping error:

Code: Select all

./build.sh
~/src/leela/src/leela/lc0 ~/src/leela/src/leela/lc0
The Meson build system
Version: 0.52.0
Source dir: /Users/stuartcracraft/src/leela/src/leela/lc0
Build dir: /Users/stuartcracraft/src/leela/src/leela/lc0/build/release
Build type: native build
Project name: lc0
Project version: undefined
C++ compiler for the host machine: c++ (clang 10.0.1 "Apple LLVM version 10.0.1 (clang-1001.0.46.4)")
C++ linker for the host machine: APPLE ld 450.3
Host machine cpu family: x86_64
Host machine cpu: x86_64
WARNING: Consider using the builtin warning_level option instead of adding warning flags by hand.
Library libprotobuf found: NO
Did not find pkg-config by name 'pkg-config'
Found Pkg-config: NO
Found CMake: /usr/local/bin/cmake (3.15.5)
Run-time dependency protobuf found: YES 
Program protoc found: YES (/usr/local/bin/protoc)
Program git found: YES (/usr/bin/git)
Message: updating git submodule libs/lczero-common
Message: Using build identifier "git.97cae9a".
Library pthread found: YES
Library dl found: YES
Library libtensorflow_cc found: NO
Run-time dependency accelerate found: YES (/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Accelerate.framework)
Library mkl_rt found: NO
Library mklml found: NO
Library dnnl found: NO
Library openblas.dll found: NO
Library openblas found: NO
Program ispc found: NO
Library OpenCL found: NO
Run-time dependency opencl found: YES 1.2
Library cublas found: NO
Library cudnn found: NO
Library cudart found: NO
Program nvcc found: NO
Program /usr/local/cuda/bin/nvcc found: NO
Program /opt/cuda/bin/nvcc found: NO
Run-time dependency zlib found: YES 1.2.11
Run-time dependency GTest found: NO (tried pkgconfig and system)
Looking for a fallback subproject for the dependency gtest
Downloading gtest source from https://github.com/google/googletest/archive/release-1.8.1.zip
Downloading file of unknown size.
Downloading gtest patch from https://wrapdb.mesonbuild.com/v1/projects/gtest/1.8.1/1/get_zip
Download size: 2084
Downloading: ..........

|Executing subproject gtest method meson 
|
|Project name: gtest
|Project version: 1.8.1
|C++ compiler for the host machine: c++ (clang 10.0.1 "Apple LLVM version 10.0.1 (clang-1001.0.46.4)")
|C++ linker for the host machine: APPLE ld 450.3
|Run-time dependency threads found: YES 
|Dependency threads found: YES (cached)
|Dependency threads found: YES (cached)
|Dependency threads found: YES (cached)
|Build targets in project: 1
|Subproject gtest finished.

Dependency gtest from subproject subprojects/gtest found: YES
Build targets in project: 8
Found ninja-1.9.0 at /usr/local/bin/ninja
[1/130] Generating source from 'libs/lczero-common/proto/net.proto'.
[2/130] Generating source from 'libs/lczero-common/proto/net.proto'.
[3/130] Generating source from 'libs/lczero-common/proto/net.proto'.
[4/130] Compiling C++ object 'lc0_lib@sha/src_version.cc.o'.
[5/130] Compiling C++ object 'lc0_lib@sha/src_chess_bitboard.cc.o'.
[6/130] Compiling C++ object 'lc0@exe/src_neural_cache.cc.o'.
[7/130] Compiling C++ object 'lc0@exe/src_neural_encoder.cc.o'.
[8/130] Compiling C++ object 'lc0_lib@sha/src_chess_board.cc.o'.
[9/130] Compiling C++ object 'lc0_lib@sha/src_mcts_node.cc.o'.
[10/130] Compiling C++ object 'lc0@exe/src_version.cc.o'.
[11/130] Compiling C++ object 'lc0_lib@sha/meson-generated_proto_net.pb.cc.o'.
In file included from lc0_lib@sha/proto/net.pb.cc:4:
In file included from lc0_lib@sha/proto/net.pb.h:26:
In file included from /usr/local/include/google/protobuf/generated_message_table_driven.h:34:
In file included from /usr/local/include/google/protobuf/map.h:49:
In file included from /usr/local/include/google/protobuf/map_type_handler.h:34:
In file included from /usr/local/include/google/protobuf/parse_context.h:43:
In file included from /usr/local/include/google/protobuf/metadata_lite.h:37:
/usr/local/include/google/protobuf/generated_message_util.h:227:14: warning: zero size arrays are an extension [-Wzero-length-array]
  void* deps[PROTOBUF_ARRAY_SIZE(N)];
             ^~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/google/protobuf/generated_message_util.h:212:32: note: expanded from macro 'PROTOBUF_ARRAY_SIZE'
#define PROTOBUF_ARRAY_SIZE(n) (n)
                               ^~~
lc0_lib@sha/proto/net.pb.cc:79:47: note: in instantiation of template class 'google::protobuf::internal::SCCInfo<0>' requested here
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_EngineVersion_proto_2fnet_2eproto =
                                              ^
1 warning generated.
[12/130] Compiling C++ object 'lc0@exe/meson-generated_proto_net.pb.cc.o'.
In file included from lc0@exe/proto/net.pb.cc:4:
In file included from lc0@exe/proto/net.pb.h:26:
In file included from /usr/local/include/google/protobuf/generated_message_table_driven.h:34:
In file included from /usr/local/include/google/protobuf/map.h:49:
In file included from /usr/local/include/google/protobuf/map_type_handler.h:34:
In file included from /usr/local/include/google/protobuf/parse_context.h:43:
In file included from /usr/local/include/google/protobuf/metadata_lite.h:37:
/usr/local/include/google/protobuf/generated_message_util.h:227:14: warning: zero size arrays are an extension [-Wzero-length-array]
  void* deps[PROTOBUF_ARRAY_SIZE(N)];
             ^~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/google/protobuf/generated_message_util.h:212:32: note: expanded from macro 'PROTOBUF_ARRAY_SIZE'
#define PROTOBUF_ARRAY_SIZE(n) (n)
                               ^~~
lc0@exe/proto/net.pb.cc:79:47: note: in instantiation of template class 'google::protobuf::internal::SCCInfo<0>' requested here
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_EngineVersion_proto_2fnet_2eproto =
                                              ^
1 warning generated.
[13/130] Compiling C++ object 'lc0@exe/src_main.cc.o'.
[14/130] Compiling C++ object 'lc0@exe/src_chess_position.cc.o'.
[15/130] Compiling C++ object 'lc0@exe/src_chess_bitboard.cc.o'.
[16/130] Compiling C++ object 'lc0_lib@sha/src_benchmark_benchmark.cc.o'.
[17/130] Compiling C++ object 'lc0_lib@sha/src_engine.cc.o'.
[18/130] Compiling C++ object 'lc0@exe/src_chess_board.cc.o'.
[19/130] Compiling C++ object 'lc0@exe/src_mcts_node.cc.o'.
[20/130] Compiling C++ object 'lc0@exe/src_mcts_stoppers_timemgr.cc.o'.
[21/130] Compiling C++ object 'lc0@exe/src_engine.cc.o'.
[22/130] Compiling C++ object 'lc0@exe/src_chess_uciloop.cc.o'.
[23/130] Compiling C++ object 'lc0@exe/src_mcts_stoppers_stoppers.cc.o'.
[24/130] Compiling C++ object 'lc0@exe/src_benchmark_benchmark.cc.o'.
[25/130] Compiling C++ object 'lc0@exe/src_mcts_params.cc.o'.
[26/130] Compiling C++ object 'lc0@exe/src_mcts_stoppers_factory.cc.o'.
[27/130] Compiling C++ object 'lc0@exe/src_neural_network_legacy.cc.o'.
[28/130] Compiling C++ object 'lc0@exe/src_neural_loader.cc.o'.
../../src/neural/loader.cc:91:16: warning: 'SetTotalBytesLimit' is deprecated: Please use the single parameter version of SetTotalBytesLimit(). The second parameter is ignored. [-Wdeprecated-declarations]
  input_stream.SetTotalBytesLimit(2000 * 1000000, 500 * 1000000);
               ^
/usr/local/include/google/protobuf/io/coded_stream.h:394:3: note: 'SetTotalBytesLimit' has been explicitly marked deprecated here
  PROTOBUF_DEPRECATED_MSG(
  ^
/usr/local/include/google/protobuf/port_def.inc:153:53: note: expanded from macro 'PROTOBUF_DEPRECATED_MSG'
#define PROTOBUF_DEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
                                                    ^
1 warning generated.
[29/130] Compiling C++ object 'lc0@exe/src_utils_configfile.cc.o'.
[30/130] Compiling C++ object 'lc0@exe/src_mcts_search.cc.o'.
[31/130] Compiling C++ object 'lc0@exe/src_neural_network_random.cc.o'.
[32/130] Compiling C++ object 'lc0@exe/src_neural_factory.cc.o'.
[33/130] Compiling C++ object 'lc0@exe/src_neural_writer.cc.o'.
[34/130] Compiling C++ object 'lc0@exe/src_neural_network_demux.cc.o'.
[35/130] Compiling C++ object 'chessboard_test@exe/subprojects_googletest-release-1.8.1_googletest_src_gtest-all.cc.o'.
[36/130] Compiling C++ object 'lc0@exe/src_utils_esc_codes.cc.o'.
[37/130] Compiling C++ object 'lc0@exe/src_neural_network_mux.cc.o'.
[38/130] Compiling C++ object 'lc0@exe/src_neural_network_rr.cc.o'.
[39/130] Compiling C++ object 'lc0@exe/src_utils_commandline.cc.o'.
[40/130] Compiling C++ object 'lc0@exe/src_utils_histogram.cc.o'.
[41/130] Compiling C++ object 'lc0@exe/src_neural_network_check.cc.o'.
[42/130] Compiling C++ object 'lc0@exe/src_utils_logging.cc.o'.
[43/130] Compiling C++ object 'lc0@exe/src_utils_random.cc.o'.
[44/130] Compiling C++ object 'lc0@exe/src_utils_transpose.cc.o'.
[45/130] Compiling C++ object 'lc0@exe/src_neural_blas_fully_connected_layer.cc.o'.
[46/130] Compiling C++ object 'lc0@exe/src_utils_string.cc.o'.
[47/130] Compiling C++ object 'lc0@exe/src_syzygy_syzygy.cc.o'.
[48/130] Compiling C++ object 'lc0@exe/src_neural_blas_se_unit.cc.o'.
[49/130] Compiling C++ object 'lc0@exe/src_utils_filesystem.posix.cc.o'.
[50/130] Compiling C++ object 'lc0@exe/src_utils_weights_adapter.cc.o'.
[51/130] Compiling C++ object 'lc0@exe/src_selfplay_loop.cc.o'.
[52/130] Compiling C++ object 'lc0@exe/src_selfplay_game.cc.o'.
[53/130] Compiling C++ object 'lc0@exe/src_utils_optionsdict.cc.o'.
[54/130] Compiling C++ object 'lc0@exe/src_neural_shared_activation.cc.o'.
[55/130] Compiling C++ object 'lc0@exe/src_neural_shared_winograd_filter.cc.o'.
[56/130] Compiling C++ object 'lc0@exe/src_neural_blas_convolution1.cc.o'.
[57/130] Compiling C++ object 'lc0@exe/src_utils_optionsparser.cc.o'.
[58/130] Compiling C++ object 'lc0_lib@sha/src_chess_position.cc.o'.
[59/130] Compiling C++ object 'lc0@exe/src_neural_blas_winograd_convolution3.cc.o'.
[60/130] Compiling C++ object 'lc0@exe/src_neural_opencl_OpenCLBuffers.cc.o'.
[61/130] Compiling C++ object 'lc0@exe/src_selfplay_tournament.cc.o'.
[62/130] Compiling C++ object 'lc0@exe/src_neural_blas_network_blas.cc.o'.
[63/130] Compiling C++ object 'lc0@exe/src_neural_opencl_OpenCL.cc.o'.
[64/130] Compiling C++ object 'lc0_lib@sha/src_mcts_stoppers_timemgr.cc.o'.
[65/130] Compiling C++ object 'lc0_lib@sha/src_chess_uciloop.cc.o'.
[66/130] Compiling C++ object 'lc0_lib@sha/src_mcts_stoppers_stoppers.cc.o'.
[67/130] Compiling C++ object 'lc0@exe/src_neural_opencl_network_opencl.cc.o'.
[68/130] Compiling C++ object 'lc0_lib@sha/src_mcts_params.cc.o'.
[69/130] Compiling C++ object 'lc0_lib@sha/src_mcts_stoppers_factory.cc.o'.
[70/130] Compiling C++ object 'lc0@exe/src_neural_opencl_OpenCLTuner.cc.o'.
[71/130] Compiling C++ object 'lc0_lib@sha/src_neural_encoder.cc.o'.
[72/130] Compiling C++ object 'lc0_lib@sha/src_neural_cache.cc.o'.
[73/130] Linking target lc0.
FAILED: lc0 
c++  -o lc0 'lc0@exe/meson-generated_proto_net.pb.cc.o' 'lc0@exe/src_main.cc.o' 'lc0@exe/src_engine.cc.o' 'lc0@exe/src_version.cc.o' 'lc0@exe/src_benchmark_benchmark.cc.o' 'lc0@exe/src_chess_bitboard.cc.o' 'lc0@exe/src_chess_board.cc.o' 'lc0@exe/src_chess_position.cc.o' 'lc0@exe/src_chess_uciloop.cc.o' 'lc0@exe/src_mcts_node.cc.o' 'lc0@exe/src_mcts_params.cc.o' 'lc0@exe/src_mcts_search.cc.o' 'lc0@exe/src_mcts_stoppers_factory.cc.o' 'lc0@exe/src_mcts_stoppers_stoppers.cc.o' 'lc0@exe/src_mcts_stoppers_timemgr.cc.o' 'lc0@exe/src_neural_cache.cc.o' 'lc0@exe/src_neural_encoder.cc.o' 'lc0@exe/src_neural_factory.cc.o' 'lc0@exe/src_neural_loader.cc.o' 'lc0@exe/src_neural_network_check.cc.o' 'lc0@exe/src_neural_network_demux.cc.o' 'lc0@exe/src_neural_network_legacy.cc.o' 'lc0@exe/src_neural_network_mux.cc.o' 'lc0@exe/src_neural_network_random.cc.o' 'lc0@exe/src_neural_network_rr.cc.o' 'lc0@exe/src_neural_writer.cc.o' 'lc0@exe/src_selfplay_game.cc.o' 'lc0@exe/src_selfplay_loop.cc.o' 'lc0@exe/src_selfplay_tournament.cc.o' 'lc0@exe/src_syzygy_syzygy.cc.o' 'lc0@exe/src_utils_commandline.cc.o' 'lc0@exe/src_utils_configfile.cc.o' 'lc0@exe/src_utils_esc_codes.cc.o' 'lc0@exe/src_utils_histogram.cc.o' 'lc0@exe/src_utils_logging.cc.o' 'lc0@exe/src_utils_optionsdict.cc.o' 'lc0@exe/src_utils_optionsparser.cc.o' 'lc0@exe/src_utils_random.cc.o' 'lc0@exe/src_utils_string.cc.o' 'lc0@exe/src_utils_transpose.cc.o' 'lc0@exe/src_utils_weights_adapter.cc.o' 'lc0@exe/src_utils_filesystem.posix.cc.o' 'lc0@exe/src_neural_blas_convolution1.cc.o' 'lc0@exe/src_neural_blas_fully_connected_layer.cc.o' 'lc0@exe/src_neural_blas_se_unit.cc.o' 'lc0@exe/src_neural_blas_network_blas.cc.o' 'lc0@exe/src_neural_blas_winograd_convolution3.cc.o' 'lc0@exe/src_neural_opencl_network_opencl.cc.o' 'lc0@exe/src_neural_opencl_OpenCL.cc.o' 'lc0@exe/src_neural_opencl_OpenCLTuner.cc.o' 'lc0@exe/src_neural_opencl_OpenCLBuffers.cc.o' 'lc0@exe/src_neural_shared_activation.cc.o' 'lc0@exe/src_neural_shared_winograd_filter.cc.o' -Wl,-dead_strip_dylibs -Wl,-undefined,error -Wl,-headerpad_max_install_names /usr/local/lib/libprotobuf.dylib -lpthread -F/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks -framework Accelerate /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenCL.framework /usr/lib/libz.dylib
ld: can't map file, errno=22 file '/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenCL.framework' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[74/130] Compiling C++ object 'lc0_lib@sha/src_utils_logging.cc.o'.
[75/130] Compiling C++ object 'lc0_lib@sha/src_neural_network_legacy.cc.o'.
[76/130] Compiling C++ object 'lc0_lib@sha/src_neural_loader.cc.o'.
../../src/neural/loader.cc:91:16: warning: 'SetTotalBytesLimit' is deprecated: Please use the single parameter version of SetTotalBytesLimit(). The second parameter is ignored. [-Wdeprecated-declarations]
  input_stream.SetTotalBytesLimit(2000 * 1000000, 500 * 1000000);
               ^
/usr/local/include/google/protobuf/io/coded_stream.h:394:3: note: 'SetTotalBytesLimit' has been explicitly marked deprecated here
  PROTOBUF_DEPRECATED_MSG(
  ^
/usr/local/include/google/protobuf/port_def.inc:153:53: note: expanded from macro 'PROTOBUF_DEPRECATED_MSG'
#define PROTOBUF_DEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
                                                    ^
1 warning generated.
[77/130] Compiling C++ object 'lc0_lib@sha/src_mcts_search.cc.o'.
[78/130] Compiling C++ object 'lc0_lib@sha/src_neural_factory.cc.o'.
[79/130] Compiling C++ object 'lc0_lib@sha/src_neural_network_random.cc.o'.
[80/130] Compiling C++ object 'lc0_lib@sha/src_neural_network_demux.cc.o'.
[81/130] Compiling C++ object 'lc0_lib@sha/src_neural_network_mux.cc.o'.
[82/130] Compiling C++ object 'lc0_lib@sha/src_neural_network_check.cc.o'.
ninja: build stopped: subcommand failed.

** Yet the directory the linker can't map is there

ls /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenCL.framework
Headers
Modules
OpenCL.tbd
Versions

You have to use Meson 5.1.2 - not 5.2. Meson 5.2 breaks lc0 builds on any Mac. Read the immediate posts prior to your post, it discusses the error you received in detail.

littlecapa
Posts: 3
Joined: Mon Dec 02, 2019 6:34 pm
Full name: Roger Lorenz

Re: Lc0 - macOS binary requested

Post by littlecapa » Sat Jan 18, 2020 1:12 pm

MikeB wrote:
Fri Dec 06, 2019 6:45 pm
littlecapa wrote:
Fri Dec 06, 2019 6:38 pm
MikeB wrote:
Fri Dec 06, 2019 6:13 am
MikeB wrote:
Fri Dec 06, 2019 3:46 am
littlecapa wrote:
Thu Dec 05, 2019 6:48 pm
MikeB wrote:
Sat May 25, 2019 5:05 am
Steppenwolf wrote:
Fri May 24, 2019 2:54 pm
I did all the things you mentioned.
Everything worked properly to my feeling.

Please go ahead...

Hi MikeB!

I followed all your steps but it does not work on my Mac Mini 2018 (macOS 10.15.1). The linker always throws this error:

ld: can't map file, errno=22 file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenCL.framework' for architecture x86_64

Any idea how to fix this?
Unchartered waters for me since I see you are on Catalina. Did you pull the most recent committed source or the last stable release? Generally for Lc0, they are different.

As a fyi, Catalina has caused some problems from some users.
Generally speaking, unless you are quite adept at solving Apple issues on your own, if you are compiling your own programs , best to wait ( I would say 6 months) for bugs to be fixed on major releases.

There are few things we can try. First I need to know the source you are trying to compile( date) and the compiler - gcc or clang and which version.

The error description "erron==22" is not very precise, it basically say we can not open a file that is needed, suggesting that a file is missing or is in a different location than expected, or it may be corrupt. In this case, we know it's looking for '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenCL.framework' so , in finder , if you go to folder ( Finder>>Go>>Go to Folder...)
'/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/" is that a valid path on your Mac Mini? If it is, does it include the file OpenCL.framework file?

Things we can try , if you complied a source correctly before without issues., try that "older" source on your Mac Mini. Compare the Mac Mini compiler and version to the compiler version you successfully compiled. We want to rule out differences between the successful compilation and the unsuccessful compilation as much as possible - so try to make everything on your Mac Mini the same as your previous Mac - date of source, complier version etc.
Through the process of elimination, as I was describing above ,I was able to locate the source of the error message - first thing I tried was to build lc0 using the source which built fine before. I got the same error you got above. I then restored the prior OpenCL framework, and to my surprise that also failed. The fact that BOTH gcc and clang were creating the same error , ruled out the possibility it was the compilers at fault, the error was not to due to any changes in the source - so it had to be one of other tools that are using being used to build Lc0. I took a wild guess it was meson ;>) , reactivated the old version ( I use macports, if you use home-brew, you will have to check with their instructions to reactive prior ports)

Code: Select all

  sudo port activate meson @0.51.2_0
--->  Computing dependencies for meson
--->  Activating meson @0.51.2_0
--->  Cleaning meson
 
bingo it worked on the old source. meson 5.2 is the culprit here.

update to the latest source - and you will get this error

../../src/neural/encoder.cc:67:37: error: no member named 'INPUT_112_WITH_CASTLING_PLANE' in 'pblczero::NetworkFormat'
case pblczero::NetworkFormat::INPUT_112_WITH_CASTLING_PLANE: {

an error like this should never happen, it tells me that this code is not being used, how it got comitted, I don't know.

Comment out lines 67 through 82 ( I used /* and */ below in encoder.cc , making the code inactive , my guess is this is related to FRC castling code without taking a real hard look at it.
code above references , "INPUT_CLASSICAL_112_PLANE" which is probably classical/standard chess.

Code: Select all

/*
      case pblczero::NetworkFormat::INPUT_112_WITH_CASTLING_PLANE: {
        // - Plane 104 for positions of rooks (both white and black) which have
        // a-side (queenside) castling right.
        // - Plane 105 for positions of rooks (both white and black) which have
        // h-side (kingside) castling right.
        const auto& cast = board.castlings();
        result[kAuxPlaneBase + 0].mask =
            ((cast.we_can_000() ? ChessBoard::A1 : 0) |
             (cast.they_can_000() ? ChessBoard::A8 : 0))
            << cast.queenside_rook();
        result[kAuxPlaneBase + 1].mask =
            ((cast.we_can_00() ? ChessBoard::A1 : 0) |
             (cast.they_can_00() ? ChessBoard::A8 : 0))
            << cast.kingside_rook();
        break;
      }
*/
bingo again, it compiles

Code: Select all

[100/100] Linking target encoder_test.
~/Github/LeelaChessZero
good luck!
Hi MikeB!

Great work analyzing the problem in such detail and providing a solution. Kudos to you!

I am still stuck with meson 5.2. It looks like that brew does not provide older versions of meson. And switching from brew to port on the fly is also not possible. But I am confident, that I will manage in the end.

Kind regards,
Littlecapa
I think you can remove Meson from brew and just compile 5.1.2 from the source on GitHub and you should be good. I did raise it as an issue on the meson Github site - if I see it gets addressed , I will post here.
Now Meson 5.3 is out. After upgrading to this version and updating the git rep, I was finally able to compile the sources.

Thanks for your support MikeB!

KR, Littlecapa

Daniel Shawul
Posts: 3810
Joined: Tue Mar 14, 2006 10:34 am
Location: Ethiopia
Contact:

Re: Lc0 - macOS binary requested

Post by Daniel Shawul » Mon Jan 20, 2020 9:02 pm

One easy option is to use docker on mac.
TensorRT is not supported on mac, and maybe other NN libs from nvidia too, so I use docker to run scorpio on mac.
CCCC also configures all GPU engines with docker and there doesn't seem to be any performance loss from it.

Post Reply