-
Notifications
You must be signed in to change notification settings - Fork 184
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
[one dmlc-core] by default build with dmlc-core from xgboost #91
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ project(rabit VERSION 0.2.0) | |
|
||
option(RABIT_BUILD_TESTS "Build rabit tests" OFF) | ||
option(RABIT_BUILD_MPI "Build MPI" OFF) | ||
option(RABIT_BUILD_DMLC "Include DMLC_CORE in build" ON) | ||
|
||
add_library(rabit src/allreduce_base.cc src/allreduce_robust.cc src/engine.cc src/c_api.cc) | ||
add_library(rabit_base src/allreduce_base.cc src/engine_base.cc src/c_api.cc) | ||
|
@@ -26,13 +27,23 @@ if(RABIT_BUILD_TESTS) | |
list(APPEND rabit_libs rabit_mock) # add to list to apply build settings, then remove | ||
endif() | ||
|
||
foreach(lib ${rabit_libs}) | ||
#include "./internal/utils.h" | ||
target_include_directories(${lib} PUBLIC | ||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>" | ||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/dmlc-core/include>" | ||
) | ||
endforeach() | ||
if(RABIT_BUILD_DMLC) | ||
foreach(lib ${rabit_libs}) | ||
#include "./internal/utils.h" | ||
target_include_directories(${lib} PUBLIC | ||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>" | ||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/dmlc-core/include>" | ||
) | ||
endforeach() | ||
else() | ||
foreach(lib ${rabit_libs}) | ||
#include "./internal/utils.h" | ||
target_include_directories(${lib} PUBLIC | ||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>" | ||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/../dmlc_core/include>" | ||
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. This is a really ugly hack. Don’t assume something outside of your project. This is what cmake is for. Set the correct include dir on the target using cmake. 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. |
||
) | ||
endforeach() | ||
endif() | ||
|
||
if(RABIT_BUILD_TESTS) | ||
list(REMOVE_ITEM rabit_libs "rabit_mock") # remove here to avoid installing it | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,10 @@ | |
#include <vector> | ||
#include <string> | ||
#include "./internal/utils.h" | ||
|
||
#ifndef DMLC_IO_H_ | ||
#include "../../dmlc-core/include/dmlc/io.h" | ||
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. This is a no go. If you do this you can just put the source of dmlc and rabit together in a single project. 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. |
||
#endif // DMLC_IO_H_ | ||
|
||
namespace rabit { | ||
/*! | ||
|
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.
may leave comments here about we assume rabit and dmlc-core are both put in the root path of the project which depends on it?
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.
or we have some way to detect it
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.
nvm, I think they only need to be in the same level of dir which is very likely to be the case