Skip to content
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

Failed to build R package. #5894

Closed
trivialfis opened this issue Jul 15, 2020 · 2 comments · Fixed by #5895
Closed

Failed to build R package. #5894

trivialfis opened this issue Jul 15, 2020 · 2 comments · Fixed by #5895

Comments

@trivialfis
Copy link
Member

After #5871 I can't build R package on my local machine with link time error:

/usr/bin/ld: ../../R-package/CMakeFiles/xgboost-r.dir/src/init.c.o: in function `R_init_xgboost':
/home/fis/Workspace/XGBoost/xgboost/R-package/src/init.c:83: undefined reference to `R_registerRoutines'
/usr/bin/ld: /home/fis/Workspace/XGBoost/xgboost/R-package/src/init.c:84: undefined reference to `R_useDynamicSymbols'
/usr/bin/ld: ../../R-package/CMakeFiles/xgboost-r.dir/src/xgboost_R.cc.o: in function `XGCheckNullPtr_R':
/home/fis/Workspace/XGBoost/xgboost/R-package/src/xgboost_R.cc:41: undefined reference to `R_ExternalPtrAddr'
/usr/bin/ld: /home/fis/Workspace/XGBoost/xgboost/R-package/src/xgboost_R.cc:41: undefined reference to `Rf_ScalarLogical'
/usr/bin/ld: ../../R-package/CMakeFiles/xgboost-r.dir/src/xgboost_R.cc.o: in function `_DMatrixFinalizer(SEXPREC*)':

...

R: 3.6.1
CMake: 3.13.4
GCC: gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008

@hcho3
Copy link
Collaborator

hcho3 commented Jul 15, 2020

That's strange. The build works on my machine.

  • R: 3.6.3
  • CMake: 3.18.0
  • GCC: 7.5.0

On the other hand, I launched a VM with Ubuntu 19.10, R 3.6.1, CMake 3.13.4, and GCC 9.2.1, and the issue is reproduced.

This might have to do with CMake version.

@hcho3
Copy link
Collaborator

hcho3 commented Jul 15, 2020

Indeed, CMake is the culprit here. I upgrade CMake from 3.13.4 to 3.14.0 on my Ubuntu 19.10 VM, and the build now works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants