forked from LeelaChessZero/lc0
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from LeelaChessZero/master
Update from master
- Loading branch information
Showing
13 changed files
with
154 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,20 +66,48 @@ endif | |
gen = generator(protoc, output: ['@[email protected]', '@[email protected]'], | ||
arguments : ['--proto_path=@CURRENT_SOURCE_DIR@/libs/lczero-common', '--cpp_out=@BUILD_DIR@', '@INPUT@']) | ||
|
||
# Handle submodules. | ||
git = find_program('git', required: false) | ||
if run_command('checkdir.py', 'libs/lczero-common/proto').returncode() != 0 | ||
if run_command('git', 'status').returncode() == 0 | ||
message('updating git submodule libs/lczero-common') | ||
run_command('git', 'submodule', 'update', '--init', '--recursive') | ||
if git.found() | ||
if run_command(git, 'status').returncode() == 0 | ||
message('updating git submodule libs/lczero-common') | ||
run_command(git, 'submodule', 'update', '--init', '--recursive') | ||
else | ||
message('cloning lczero-common.git into libs/lczero-common') | ||
run_command(git, 'clone', '--depth=1', | ||
'https://github.com/LeelaChessZero/lczero-common.git', | ||
'libs/lczero-common/') | ||
endif | ||
else | ||
message('cloning lczero-common.git into libs/lczero-common') | ||
run_command('git', 'clone', '--depth=1', | ||
'https://github.com/LeelaChessZero/lczero-common.git', | ||
'libs/lczero-common/') | ||
error('Please install git to automatically fetch submodules or download the archives manually from GitHub.') | ||
endif | ||
endif | ||
|
||
files += gen.process('libs/lczero-common/proto/net.proto', | ||
preserve_path_from : meson.current_source_dir() + '/libs/lczero-common/') | ||
|
||
# Extract git short revision. | ||
short_rev = 'unknown' | ||
if git.found() | ||
r = run_command(git, 'rev-parse', '--short', 'HEAD') | ||
if r.returncode() == 0 | ||
# Now let's check if the working directory is clean. | ||
if run_command(git, 'diff-index', '--quiet', 'HEAD').returncode() == 0 | ||
short_rev = r.stdout().strip() | ||
else | ||
short_rev = 'dirty' | ||
warning('Cannot extract valid git short revision from dirty working directory.') | ||
endif | ||
else | ||
warning('Failed to parse short revision. Use git clone instead of downloading the archive from GitHub.') | ||
endif | ||
endif | ||
|
||
# Construct build identifier. | ||
build_identifier = 'git.' + short_rev | ||
add_project_arguments('-DBUILD_IDENTIFIER="' + build_identifier + '"', language : 'cpp') | ||
message('Using build identifier "' + build_identifier + '".') | ||
|
||
############################################################################# | ||
## Main files | ||
|
@@ -207,7 +235,6 @@ if get_option('build_backends') | |
has_blas = true | ||
|
||
elif get_option('accelerate') and accelerate_lib.found() | ||
includes += include_directories('/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers') | ||
deps += [ accelerate_lib ] | ||
has_blas = true | ||
|
||
|
@@ -311,7 +338,7 @@ if get_option('build_backends') | |
deps += [ opencl_framework ] | ||
has_opencl = true | ||
|
||
elif opencl_lib.found() | ||
elif opencl_lib.found() and cc.has_header('CL/opencl.h', args: '-I' + get_option('opencl_include')) | ||
|
||
deps += [ opencl_lib ] | ||
has_opencl = true | ||
|
@@ -332,7 +359,9 @@ if get_option('build_backends') | |
'src/neural/shared/winograd_filter.cc', | ||
] | ||
|
||
includes += include_directories(get_option('opencl_include')) | ||
if not opencl_framework.found() | ||
includes += include_directories(get_option('opencl_include')) | ||
endif | ||
files += opencl_files | ||
has_backends = true | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.