Add CMake flag to log C API invocations, to aid debugging (#5925)

* Add CMake flag to log C API invocations, to aid debugging

* Remove unnecessary parentheses
This commit is contained in:
Philip Hyunsu Cho
2020-07-30 19:24:28 -07:00
committed by GitHub
parent 3b88bc948f
commit 3fcfaad577
6 changed files with 18 additions and 1 deletions

View File

@@ -21,7 +21,8 @@ CONFIG = {
"USE_CUDA": "OFF",
"USE_NCCL": "OFF",
"JVM_BINDINGS": "ON"
"JVM_BINDINGS": "ON",
"LOG_CAPI_INVOCATION": "OFF"
}
@@ -70,6 +71,7 @@ def normpath(path):
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--log-capi-invocation', type=str, choices=['ON', 'OFF'], default='OFF')
parser.add_argument('--use-cuda', type=str, choices=['ON', 'OFF'], default='OFF')
cli_args = parser.parse_args()
@@ -93,6 +95,9 @@ if __name__ == "__main__":
else:
maybe_parallel_build = ""
if cli_args.log_capi_invocation == 'ON':
CONFIG['LOG_CAPI_INVOCATION'] = 'ON'
if cli_args.use_cuda == 'ON':
CONFIG['USE_CUDA'] = 'ON'
CONFIG['USE_NCCL'] = 'ON'

View File

@@ -38,6 +38,7 @@
<scala.version>2.12.8</scala.version>
<scala.binary.version>2.12</scala.binary.version>
<hadoop.version>2.7.3</hadoop.version>
<log.capi.invocation>OFF</log.capi.invocation>
<use.cuda>OFF</use.cuda>
</properties>
<repositories>

View File

@@ -84,6 +84,8 @@
<executable>python</executable>
<arguments>
<argument>create_jni.py</argument>
<argument>--log-capi-invocation</argument>
<argument>${log.capi.invocation}</argument>
<argument>--use-cuda</argument>
<argument>${use.cuda}</argument>
</arguments>