[R] Avoid symbol naming conflicts with other packages (#7245)
* don't register all R symbols * typo
This commit is contained in:
parent
e48e05e6e2
commit
61a619b5c3
@ -17,7 +17,7 @@ endif
|
||||
$(foreach v, $(XGB_RFLAGS), $(warning $(v)))
|
||||
|
||||
PKG_CPPFLAGS= -I$(PKGROOT)/include -I$(PKGROOT)/dmlc-core/include -I$(PKGROOT)/rabit/include -I$(PKGROOT) $(XGB_RFLAGS)
|
||||
PKG_CXXFLAGS= @OPENMP_CXXFLAGS@ @ENDIAN_FLAG@ -pthread
|
||||
PKG_CXXFLAGS= @OPENMP_CXXFLAGS@ @ENDIAN_FLAG@ -pthread $(CXX_VISIBILITY)
|
||||
PKG_LIBS = @OPENMP_CXXFLAGS@ @OPENMP_LIB@ @ENDIAN_FLAG@ @BACKTRACE_LIB@ -pthread
|
||||
OBJECTS= ./xgboost_R.o ./xgboost_custom.o ./xgboost_assert.o ./init.o \
|
||||
$(PKGROOT)/amalgamation/xgboost-all0.o $(PKGROOT)/amalgamation/dmlc-minimum0.o \
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
#include <Rinternals.h>
|
||||
#include <stdlib.h>
|
||||
#include <R_ext/Rdynload.h>
|
||||
#include <R_ext/Visibility.h>
|
||||
|
||||
/* FIXME:
|
||||
Check these declarations against the C/Fortran source code.
|
||||
@ -89,7 +90,7 @@ static const R_CallMethodDef CallEntries[] = {
|
||||
#if defined(_WIN32)
|
||||
__declspec(dllexport)
|
||||
#endif // defined(_WIN32)
|
||||
void R_init_xgboost(DllInfo *dll) {
|
||||
void attribute_visible R_init_xgboost(DllInfo *dll) {
|
||||
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
|
||||
R_useDynamicSymbols(dll, FALSE);
|
||||
}
|
||||
|
||||
3
R-package/src/xgboost-win.def
Normal file
3
R-package/src/xgboost-win.def
Normal file
@ -0,0 +1,3 @@
|
||||
LIBRARY xgboost.dll
|
||||
EXPORTS
|
||||
R_init_xgboost
|
||||
Loading…
x
Reference in New Issue
Block a user