Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
571cad7e
Unverified
Commit
571cad7e
authored
Sep 14, 2020
by
Nikita Titov
Committed by
GitHub
Sep 14, 2020
Browse files
[R-package] mark CMake option for building R package as private (#3397)
* Update install.libs.R * Update CMakeLists.txt
parent
164818b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
CMakeLists.txt
CMakeLists.txt
+7
-7
R-package/src/install.libs.R
R-package/src/install.libs.R
+1
-1
No files found.
CMakeLists.txt
View file @
571cad7e
...
@@ -14,7 +14,7 @@ OPTION(USE_HDFS "Enable HDFS support (EXPERIMENTAL)" OFF)
...
@@ -14,7 +14,7 @@ OPTION(USE_HDFS "Enable HDFS support (EXPERIMENTAL)" OFF)
OPTION
(
USE_TIMETAG
"Set to ON to output time costs"
OFF
)
OPTION
(
USE_TIMETAG
"Set to ON to output time costs"
OFF
)
OPTION
(
USE_DEBUG
"Set to ON for Debug mode"
OFF
)
OPTION
(
USE_DEBUG
"Set to ON for Debug mode"
OFF
)
OPTION
(
BUILD_STATIC_LIB
"Build static library"
OFF
)
OPTION
(
BUILD_STATIC_LIB
"Build static library"
OFF
)
OPTION
(
BUILD_FOR_R
"Set to ON if building lib_lightgbm for use with the R package"
OFF
)
OPTION
(
__
BUILD_FOR_R
"Set to ON if building lib_lightgbm for use with the R package"
OFF
)
if
(
APPLE
)
if
(
APPLE
)
OPTION
(
APPLE_OUTPUT_DYLIB
"Output dylib shared library"
OFF
)
OPTION
(
APPLE_OUTPUT_DYLIB
"Output dylib shared library"
OFF
)
...
@@ -67,7 +67,7 @@ if(USE_SWIG)
...
@@ -67,7 +67,7 @@ if(USE_SWIG)
endif
()
endif
()
endif
(
USE_SWIG
)
endif
(
USE_SWIG
)
if
(
BUILD_FOR_R
)
if
(
__
BUILD_FOR_R
)
list
(
APPEND CMAKE_MODULE_PATH
"
${
PROJECT_SOURCE_DIR
}
/cmake/modules"
)
list
(
APPEND CMAKE_MODULE_PATH
"
${
PROJECT_SOURCE_DIR
}
/cmake/modules"
)
find_package
(
LibR REQUIRED
)
find_package
(
LibR REQUIRED
)
message
(
STATUS
"LIBR_EXECUTABLE:
${
LIBR_EXECUTABLE
}
"
)
message
(
STATUS
"LIBR_EXECUTABLE:
${
LIBR_EXECUTABLE
}
"
)
...
@@ -75,7 +75,7 @@ if(BUILD_FOR_R)
...
@@ -75,7 +75,7 @@ if(BUILD_FOR_R)
message
(
STATUS
"LIBR_CORE_LIBRARY:
${
LIBR_CORE_LIBRARY
}
"
)
message
(
STATUS
"LIBR_CORE_LIBRARY:
${
LIBR_CORE_LIBRARY
}
"
)
include_directories
(
${
LIBR_INCLUDE_DIRS
}
)
include_directories
(
${
LIBR_INCLUDE_DIRS
}
)
ADD_DEFINITIONS
(
-DLGB_R_BUILD
)
ADD_DEFINITIONS
(
-DLGB_R_BUILD
)
endif
(
BUILD_FOR_R
)
endif
(
__
BUILD_FOR_R
)
if
(
USE_TIMETAG
)
if
(
USE_TIMETAG
)
ADD_DEFINITIONS
(
-DTIMETAG
)
ADD_DEFINITIONS
(
-DTIMETAG
)
...
@@ -235,9 +235,9 @@ list(APPEND SOURCES "src/c_api.cpp")
...
@@ -235,9 +235,9 @@ list(APPEND SOURCES "src/c_api.cpp")
# Only build the R part of the library if building for
# Only build the R part of the library if building for
# use with the R package
# use with the R package
if
(
BUILD_FOR_R
)
if
(
__
BUILD_FOR_R
)
list
(
APPEND SOURCES
"src/lightgbm_R.cpp"
)
list
(
APPEND SOURCES
"src/lightgbm_R.cpp"
)
endif
(
BUILD_FOR_R
)
endif
(
__
BUILD_FOR_R
)
if
(
BUILD_STATIC_LIB
)
if
(
BUILD_STATIC_LIB
)
add_library
(
_lightgbm STATIC
${
SOURCES
}
)
add_library
(
_lightgbm STATIC
${
SOURCES
}
)
...
@@ -315,13 +315,13 @@ if(WIN32 AND (MINGW OR CYGWIN))
...
@@ -315,13 +315,13 @@ if(WIN32 AND (MINGW OR CYGWIN))
TARGET_LINK_LIBRARIES
(
_lightgbm IPHLPAPI
)
TARGET_LINK_LIBRARIES
(
_lightgbm IPHLPAPI
)
endif
()
endif
()
if
(
BUILD_FOR_R
)
if
(
__
BUILD_FOR_R
)
if
(
MSVC
)
if
(
MSVC
)
TARGET_LINK_LIBRARIES
(
_lightgbm
${
LIBR_MSVC_CORE_LIBRARY
}
)
TARGET_LINK_LIBRARIES
(
_lightgbm
${
LIBR_MSVC_CORE_LIBRARY
}
)
else
()
else
()
TARGET_LINK_LIBRARIES
(
_lightgbm
${
LIBR_CORE_LIBRARY
}
)
TARGET_LINK_LIBRARIES
(
_lightgbm
${
LIBR_CORE_LIBRARY
}
)
endif
(
MSVC
)
endif
(
MSVC
)
endif
(
BUILD_FOR_R
)
endif
(
__
BUILD_FOR_R
)
install
(
TARGETS lightgbm _lightgbm
install
(
TARGETS lightgbm _lightgbm
RUNTIME DESTINATION
${
CMAKE_INSTALL_PREFIX
}
/bin
RUNTIME DESTINATION
${
CMAKE_INSTALL_PREFIX
}
/bin
...
...
R-package/src/install.libs.R
View file @
571cad7e
...
@@ -170,7 +170,7 @@ if (!use_precompile) {
...
@@ -170,7 +170,7 @@ if (!use_precompile) {
if
(
use_gpu
)
{
if
(
use_gpu
)
{
cmake_args
<-
c
(
cmake_args
,
"-DUSE_GPU=ON"
)
cmake_args
<-
c
(
cmake_args
,
"-DUSE_GPU=ON"
)
}
}
cmake_args
<-
c
(
cmake_args
,
"-DBUILD_FOR_R=ON"
)
cmake_args
<-
c
(
cmake_args
,
"-D
__
BUILD_FOR_R=ON"
)
# Pass in R version, used to help find R executable for linking
# Pass in R version, used to help find R executable for linking
R_version_string
<-
paste
(
R_version_string
<-
paste
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment