diff --git a/src/mlpack/bindings/R/mlpack/inst/include/mlpack.h.in b/src/mlpack/bindings/R/mlpack/inst/include/mlpack.h.in index 0862610a84..cb277d3e1f 100644 --- a/src/mlpack/bindings/R/mlpack/inst/include/mlpack.h.in +++ b/src/mlpack/bindings/R/mlpack/inst/include/mlpack.h.in @@ -14,6 +14,11 @@ #include +#undef MLPACK_PRINT_INFO +#define MLPACK_PRINT_INFO +#undef MLPACK_PRINT_WARN +#define MLPACK_PRINT_WARN + // Rcpp has its own stream object which cooperates more nicely with R's i/o // And as of armadillo and mlpack, we can use this stream object as well. #if !defined(ARMA_COUT_STREAM) diff --git a/src/mlpack/bindings/cli/CMakeLists.txt b/src/mlpack/bindings/cli/CMakeLists.txt index 486f551ae0..ea99c844e7 100644 --- a/src/mlpack/bindings/cli/CMakeLists.txt +++ b/src/mlpack/bindings/cli/CMakeLists.txt @@ -20,7 +20,7 @@ if (BUILD_CLI_EXECUTABLES) # Make sure that we set BINDING_TYPE to cli so the command-line program is # compiled with the correct int main() call. set_target_properties(mlpack_${name} PROPERTIES COMPILE_FLAGS - -DBINDING_TYPE=BINDING_TYPE_CLI) + -DBINDING_TYPE=BINDING_TYPE_CLI -DMLPACK_PRINT_INFO -DMLPACK_PRINT_WARN) install(TARGETS mlpack_${name} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") # If man documentation is being generated, make sure this is a dependency. diff --git a/src/mlpack/bindings/go/CMakeLists.txt b/src/mlpack/bindings/go/CMakeLists.txt index d49b49615d..efc5396a3b 100644 --- a/src/mlpack/bindings/go/CMakeLists.txt +++ b/src/mlpack/bindings/go/CMakeLists.txt @@ -141,7 +141,10 @@ if (BUILD_GO_SHLIB) ${CMAKE_SOURCE_DIR}/src/mlpack/bindings/go/mlpack/capi/arma_util.cpp ${CMAKE_SOURCE_DIR}/src/mlpack/bindings/go/mlpack/capi/io_util.cpp) target_link_libraries(mlpack_go_util ${MLPACK_LIBRARIES}) - target_compile_definitions(mlpack_go_util PUBLIC "BINDING_TYPE=BINDING_TYPE_GO") + target_compile_definitions(mlpack_go_util PUBLIC + -DBINDING_TYPE=BINDING_TYPE_GO + -DMLPACK_PRINT_INFO + -DMLPACK_PRINT_WARN) set_target_properties(mlpack_go_util PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src/mlpack/bindings/go/src/mlpack.org/v1/mlpack/) @@ -240,6 +243,8 @@ if(BUILD_GO_SHLIB) add_library(mlpack_go_${name} SHARED ${CMAKE_BINARY_DIR}/src/mlpack/bindings/go/build/${name}.cpp) target_link_libraries(mlpack_go_${name} mlpack_go_util) + target_compile_definitions(mlpack_go_${name} PUBLIC + -DMLPACK_PRINT_INFO -DMLPACK_PRINT_WARN) set_target_properties(mlpack_go_${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/src/mlpack/bindings/go/src/mlpack.org/v1/mlpack/") diff --git a/src/mlpack/bindings/julia/CMakeLists.txt b/src/mlpack/bindings/julia/CMakeLists.txt index f33831c1fe..003b5113ab 100644 --- a/src/mlpack/bindings/julia/CMakeLists.txt +++ b/src/mlpack/bindings/julia/CMakeLists.txt @@ -54,6 +54,8 @@ if (BUILD_JULIA_BINDINGS) julia_util.h julia_util.cpp) target_link_libraries(mlpack_julia_util ${MLPACK_LIBRARIES}) + target_compile_definitions(mlpack_julia_util PUBLIC + -DMLPACK_PRINT_INFO -DMLPACK_PRINT_WARN) set_target_properties(mlpack_julia_util PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/src/mlpack/bindings/julia/mlpack/src/") add_dependencies(julia mlpack_julia_util) @@ -188,6 +190,8 @@ if (BUILD_JULIA_BINDINGS) ${CMAKE_BINARY_DIR}/src/mlpack/bindings/julia/mlpack/build/julia_${name}.h ${CMAKE_BINARY_DIR}/src/mlpack/bindings/julia/mlpack/build/julia_${name}.cpp) target_link_libraries(mlpack_julia_${name} mlpack_julia_util) + target_compile_definitions(mlpack_julia_${name} PUBLIC + -DMLPACK_PRINT_INFO -DMLPACK_PRINT_WARN) set_target_properties(mlpack_julia_${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/src/mlpack/bindings/julia/mlpack/src/") diff --git a/src/mlpack/bindings/python/CMakeLists.txt b/src/mlpack/bindings/python/CMakeLists.txt index 3de8d53ba2..a2d370288b 100644 --- a/src/mlpack/bindings/python/CMakeLists.txt +++ b/src/mlpack/bindings/python/CMakeLists.txt @@ -26,7 +26,7 @@ macro (post_python_bindings) -D OpenMP_CXX_FLAGS="${OpenMP_CXX_FLAGS}" -D DISABLE_CFLAGS="${DISABLE_CFLAGS}" -D CYTHON_INCLUDE_DIRECTORIES="${CYTHON_INCLUDE_DIRECTORIES}" - -D CMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} + -D CMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -DMLPACK_PRINT_INFO -DMLPACK_PRINT_WARN" -D OUTPUT_DIR=${CMAKE_BINARY_DIR} -P "${CMAKE_SOURCE_DIR}/CMake/ConfigureFile.cmake" BYPRODUCTS "${CMAKE_BINARY_DIR}/src/mlpack/bindings/python/setup.py"