-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Microsoft/LightGBM into p…
…onnuswami-dcgPositionLimit
- Loading branch information
Showing
29 changed files
with
799 additions
and
78 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
Validating CODEOWNERS rules …
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Set appropriate compiler and linker flags for sanitizers. | ||
# | ||
# Usage of this module: | ||
# enable_sanitizers("address;leak") | ||
|
||
# Add flags | ||
macro(enable_sanitizer sanitizer) | ||
if(${sanitizer} MATCHES "address") | ||
find_package(ASan REQUIRED) | ||
set(SAN_COMPILE_FLAGS "${SAN_COMPILE_FLAGS} -fsanitize=address") | ||
link_libraries(${ASan_LIBRARY}) | ||
|
||
elseif(${sanitizer} MATCHES "thread") | ||
find_package(TSan REQUIRED) | ||
set(SAN_COMPILE_FLAGS "${SAN_COMPILE_FLAGS} -fsanitize=thread") | ||
link_libraries(${TSan_LIBRARY}) | ||
|
||
elseif(${sanitizer} MATCHES "leak") | ||
find_package(LSan REQUIRED) | ||
set(SAN_COMPILE_FLAGS "${SAN_COMPILE_FLAGS} -fsanitize=leak") | ||
link_libraries(${LSan_LIBRARY}) | ||
|
||
elseif(${sanitizer} MATCHES "undefined") | ||
find_package(UBSan REQUIRED) | ||
set(SAN_COMPILE_FLAGS "${SAN_COMPILE_FLAGS} -fsanitize=undefined -fno-sanitize-recover=undefined") | ||
link_libraries(${UBSan_LIBRARY}) | ||
|
||
else() | ||
message(FATAL_ERROR "Santizer ${sanitizer} not supported.") | ||
endif() | ||
endmacro() | ||
|
||
macro(enable_sanitizers SANITIZERS) | ||
# Check sanitizers compatibility. | ||
foreach ( _san ${SANITIZERS} ) | ||
string(TOLOWER ${_san} _san) | ||
if (_san MATCHES "thread") | ||
if (${_use_other_sanitizers}) | ||
message(FATAL_ERROR | ||
"thread sanitizer is not compatible with ${_san} sanitizer.") | ||
endif() | ||
set(_use_thread_sanitizer 1) | ||
else () | ||
if (${_use_thread_sanitizer}) | ||
message(FATAL_ERROR | ||
"${_san} sanitizer is not compatible with thread sanitizer.") | ||
endif() | ||
set(_use_other_sanitizers 1) | ||
endif() | ||
endforeach() | ||
|
||
message(STATUS "Sanitizers: ${SANITIZERS}") | ||
|
||
foreach( _san ${SANITIZERS} ) | ||
string(TOLOWER ${_san} _san) | ||
enable_sanitizer(${_san}) | ||
endforeach() | ||
message(STATUS "Sanitizers compile flags: ${SAN_COMPILE_FLAGS}") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SAN_COMPILE_FLAGS}") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SAN_COMPILE_FLAGS}") | ||
endmacro() |
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,9 @@ | ||
set(ASan_LIB_NAME ASan) | ||
|
||
find_library(ASan_LIBRARY | ||
NAMES libasan.so libasan.so.5 libasan.so.4 libasan.so.3 libasan.so.2 libasan.so.1 libasan.so.0 libasan.so.0.0.0 | ||
PATHS ${SANITIZER_PATH} /usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib ${CMAKE_PREFIX_PATH}/lib) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(ASan DEFAULT_MSG | ||
ASan_LIBRARY) |
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,9 @@ | ||
set(LSan_LIB_NAME lsan) | ||
|
||
find_library(LSan_LIBRARY | ||
NAMES liblsan.so liblsan.so.0 liblsan.so.0.0.0 | ||
PATHS ${SANITIZER_PATH} /usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib ${CMAKE_PREFIX_PATH}/lib) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(LSan DEFAULT_MSG | ||
LSan_LIBRARY) |
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,9 @@ | ||
set(TSan_LIB_NAME tsan) | ||
|
||
find_library(TSan_LIBRARY | ||
NAMES libtsan.so libtsan.so.0 libtsan.so.0.0.0 | ||
PATHS ${SANITIZER_PATH} /usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib ${CMAKE_PREFIX_PATH}/lib) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(TSan DEFAULT_MSG | ||
TSan_LIBRARY) |
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,9 @@ | ||
set(UBSan_LIB_NAME UBSan) | ||
|
||
find_library(UBSan_LIBRARY | ||
NAMES libubsan.so libubsan.so.1 libubsan.so.0 libubsan.so.0.0.0 | ||
PATHS ${SANITIZER_PATH} /usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib ${CMAKE_PREFIX_PATH}/lib) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(UBSan DEFAULT_MSG | ||
UBSan_LIBRARY) |
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.