-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lc0/cmake #552
Open
Error323
wants to merge
12
commits into
next
Choose a base branch
from
lc0/cmake
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Lc0/cmake #552
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
dbe8616
initial cmake configuration
Error323 305af33
add network_cudnn.cu - linking errors
Error323 d1ff39e
Link cudnn - fix linking issues
Error323 f9610c5
add FindCUDNN.cmake
Error323 b180a90
fix compile issues
Error323 ecca6e4
Improve cmake - optional cuda support
Error323 c4c548e
add clang format
Error323 97bbf32
Do not require gtest
Error323 5f99422
Fix various PR review comments
Error323 2500483
Fix UTF-8 problem
Error323 3342976
Merge remote-tracking branch 'origin/next' into lc0/cmake
Error323 d643edb
Simplyfied FindCUDNN.cmake by facebookresearch
Error323 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
--- | ||
Language: Cpp | ||
# BasedOnStyle: Google | ||
AccessModifierOffset: -1 | ||
AlignAfterOpenBracket: Align | ||
AlignConsecutiveAssignments: false | ||
AlignConsecutiveDeclarations: false | ||
AlignEscapedNewlines: Left | ||
AlignOperands: true | ||
AlignTrailingComments: true | ||
AllowAllParametersOfDeclarationOnNextLine: true | ||
AllowShortBlocksOnASingleLine: false | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: All | ||
AllowShortIfStatementsOnASingleLine: true | ||
AllowShortLoopsOnASingleLine: true | ||
AlwaysBreakAfterDefinitionReturnType: None | ||
AlwaysBreakAfterReturnType: None | ||
AlwaysBreakBeforeMultilineStrings: true | ||
AlwaysBreakTemplateDeclarations: true | ||
BinPackArguments: true | ||
BinPackParameters: true | ||
BraceWrapping: | ||
AfterClass: false | ||
AfterControlStatement: false | ||
AfterEnum: false | ||
AfterFunction: false | ||
AfterNamespace: false | ||
AfterObjCDeclaration: false | ||
AfterStruct: false | ||
AfterUnion: false | ||
AfterExternBlock: false | ||
BeforeCatch: false | ||
BeforeElse: false | ||
IndentBraces: false | ||
SplitEmptyFunction: true | ||
SplitEmptyRecord: true | ||
SplitEmptyNamespace: true | ||
BreakBeforeBinaryOperators: None | ||
BreakBeforeBraces: Attach | ||
BreakBeforeInheritanceComma: false | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializersBeforeComma: false | ||
BreakConstructorInitializers: BeforeColon | ||
BreakAfterJavaFieldAnnotations: false | ||
BreakStringLiterals: true | ||
ColumnLimit: 80 | ||
CommentPragmas: '^ IWYU pragma:' | ||
CompactNamespaces: false | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: true | ||
ConstructorInitializerIndentWidth: 4 | ||
ContinuationIndentWidth: 4 | ||
Cpp11BracedListStyle: true | ||
DerivePointerAlignment: true | ||
DisableFormat: false | ||
ExperimentalAutoDetectBinPacking: false | ||
FixNamespaceComments: true | ||
ForEachMacros: | ||
- foreach | ||
- Q_FOREACH | ||
- BOOST_FOREACH | ||
IncludeBlocks: Preserve | ||
IncludeCategories: | ||
- Regex: '^<ext/.*\.h>' | ||
Priority: 2 | ||
- Regex: '^<.*\.h>' | ||
Priority: 1 | ||
- Regex: '^<.*' | ||
Priority: 2 | ||
- Regex: '.*' | ||
Priority: 3 | ||
IncludeIsMainRegex: '([-_](test|unittest))?$' | ||
IndentCaseLabels: true | ||
IndentPPDirectives: None | ||
IndentWidth: 2 | ||
IndentWrappedFunctionNames: false | ||
JavaScriptQuotes: Leave | ||
JavaScriptWrapImports: true | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
MacroBlockBegin: '' | ||
MacroBlockEnd: '' | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: None | ||
ObjCBlockIndentWidth: 2 | ||
ObjCSpaceAfterProperty: false | ||
ObjCSpaceBeforeProtocolList: false | ||
PenaltyBreakAssignment: 2 | ||
PenaltyBreakBeforeFirstCallParameter: 1 | ||
PenaltyBreakComment: 300 | ||
PenaltyBreakFirstLessLess: 120 | ||
PenaltyBreakString: 1000 | ||
PenaltyExcessCharacter: 1000000 | ||
PenaltyReturnTypeOnItsOwnLine: 200 | ||
PointerAlignment: Left | ||
RawStringFormats: | ||
- Delimiter: pb | ||
Language: TextProto | ||
BasedOnStyle: google | ||
ReflowComments: true | ||
SortIncludes: true | ||
SortUsingDeclarations: true | ||
SpaceAfterCStyleCast: false | ||
SpaceAfterTemplateKeyword: true | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeParens: ControlStatements | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 2 | ||
SpacesInAngles: false | ||
SpacesInContainerLiterals: true | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
Standard: Auto | ||
TabWidth: 8 | ||
UseTab: Never | ||
... | ||
|
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# This file is part of Leela Chess Zero. | ||
# Copyright (C) 2018 The LCZero Authors | ||
# | ||
# Leela Chess is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# Leela Chess is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with Leela Chess. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
project (lc0 CXX C) | ||
cmake_minimum_required (VERSION 3.1) | ||
|
||
|
||
#------------------------------------------------------------------------------- | ||
# General Settings | ||
#------------------------------------------------------------------------------- | ||
set (CMAKE_CXX_STANDARD 14) | ||
|
||
if (NOT CMAKE_BUILD_TYPE) | ||
set (CMAKE_BUILD_TYPE "Release") | ||
endif (NOT CMAKE_BUILD_TYPE) | ||
|
||
# See if we can set optimization flags as expected. | ||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") | ||
set (GccSpecificFlags 1) | ||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") | ||
set (GccSpecificFlags 1) | ||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") | ||
set (GccSpecificFlags 1) | ||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") | ||
set (GccSpecificFlags 0) | ||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") | ||
set (GccSpecificFlags 0) | ||
endif() | ||
|
||
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") | ||
|
||
if (GccSpecificFlags) | ||
set (CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -pipe") | ||
set (CMAKE_CXX_FLAGS_DEBUG "-O0 -g") | ||
set (CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -ffast-math -march=native -mtune=native") | ||
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") | ||
set (CMAKE_EXE_LINKER_FLAGS -Wl,--no-as-needed) | ||
endif(GccSpecificFlags) | ||
|
||
|
||
#------------------------------------------------------------------------------- | ||
# Find packages | ||
#------------------------------------------------------------------------------- | ||
find_package (Threads REQUIRED) | ||
find_package (Boost REQUIRED filesystem) | ||
find_package (GTest) | ||
find_package (CUDA) | ||
find_package (CUDNN) | ||
|
||
#------------------------------------------------------------------------------- | ||
# Testing | ||
#------------------------------------------------------------------------------- | ||
if (GTEST_FOUND) | ||
enable_testing () | ||
endif (GTEST_FOUND) | ||
|
||
include_directories( | ||
${PROJECT_SOURCE_DIR}/src | ||
) | ||
|
||
add_subdirectory (src) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
#!/bin/bash | ||
|
||
rm -fr build | ||
CC=clang CXX=clang++ meson build --buildtype release # -Db_ndebug=true | ||
# CC=clang CXX=clang++ meson build --buildtype debugoptimized -Db_asneeded=false | ||
# CC=clang CXX=clang++ meson build --buildtype debug | ||
cp testdata/* build | ||
cd build | ||
ninja | ||
mkdir build | ||
pushd build | ||
cmake .. -DCMAKE_BUILD_TYPE=Release | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW, on Ubuntu 17.10, I had to add |
||
#cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo | ||
#cmake .. -DCMAKE_BUILD_TYPE=Debug | ||
make | ||
popd |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's worth adding comment which other options are possible.
(I need debugoptimized, as that's on what I usually run profiler)
Also is NDEBUG defined by default? It would be nice to have a comment how to control that (it's faster with NDEBUG because there are asserts here and there, but for myself I like to have it)