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

CMake R package build fails #10086

Closed
meztez opened this issue Mar 4, 2024 · 1 comment · Fixed by #10087
Closed

CMake R package build fails #10086

meztez opened this issue Mar 4, 2024 · 1 comment · Fixed by #10087

Comments

@meztez
Copy link
Contributor

meztez commented Mar 4, 2024

Hi, might be related to change here? : a730c7e

In the meantime, using the latest tagged release compiles/installs fine.

Ubuntu jammy
R 4.3.3
cmake version 3.22.1
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
git submodule init; git submodule update
mkdir build; cd build
cmake .. -DR_LIB=ON
make -j$(nproc)
make install
...
-- Installing: /.../test/xgboost/build/R-package-install/R-package/CMakeLists.txt
-- Installing: /.../test/xgboost/build/R-package-install/R-package/inst
-- Installing: /.../test/xgboost/build/R-package-install/R-package/inst/make-r-def.R
-- Installing: /.../test/xgboost/build/R-package-install/R-package/data
-- Installing: /.../test/xgboost/build/R-package-install/R-package/data/agaricus.test.rda
-- Installing: /.../test/xgboost/build/R-package-install/R-package/data/agaricus.train.rda
-- Installing: /.../test/xgboost/build/R-package-install/R-package/src/xgboost.so
-- Set runtime path of "/.../test/xgboost/build/R-package-install/R-package/src/xgboost.so" to ""
Command: /usr/bin/R -q -e deps = setdiff(c('data.table', 'jsonlite', 'Matrix'), rownames(installed.packages()))\  if(length(deps)>0) install.packages(deps, repo = 'https://cloud.r-project.org/')
Command: /usr/bin/R CMD INSTALL --no-multiarch --build /.../test/xgboost/build/R-package-install/R-package
CMake Error at RPackageInstall.cmake:16 (message):
  out: make[1]: Entering directory
  '/.../test/xgboost/build/R-package-install/R-package/src'


  make[1]: Nothing to be done for 'all'.

  make[1]: Leaving directory
  '/.../test/xgboost/build/R-package-install/R-package/src'


  Error: package or namespace load failed for ‘xgboost’ in dyn.load(file,
  DLLpath = DLLpath, ...):

   unable to load shared object '/.../R/x86_64-pc-linux-gnu-library/4.3/00LOCK-R-package/00new/xgboost/libs/xgboost.so':
    /.../R/x86_64-pc-linux-gnu-library/4.3/00LOCK-R-package/00new/xgboost/libs/xgboost.so: undefined symbol: _ZN7xgboost6common24CustomGlobalRandomEngine4seedEj

  Error:

  ! loading failed

  Backtrace:

      ▆
   1. └─tools:::.test_load_package("xgboost", "/.../R/x86_64-pc-linux-gnu-library/4.3/00LOCK-R-package/00new")

  Execution halted

  , err: * installing to library
  ‘/.../R/x86_64-pc-linux-gnu-library/4.3’

  * installing *source* package ‘xgboost’ ...

  ** using staged installation

  ** libs

  installing to
  /.../R/x86_64-pc-linux-gnu-library/4.3/00LOCK-R-package/00new/xgboost/libs


  ** R

  ** data

  ** demo

  ** inst

  ** byte-compile and prepare package for lazy loading

  ** help

  *** installing help indices

  ** building package indices

  ** installing vignettes

  ** testing if installed package can be loaded from temporary location

  ERROR: loading failed

  * removing
  ‘/.../R/x86_64-pc-linux-gnu-library/4.3/xgboost’


  , res: 1
Call Stack (most recent call first):
  RPackageInstall.cmake:34 (check_call)
  cmake_install.cmake:114 (include)

unable to load shared object '/.../R/x86_64-pc-linux-gnu-library/4.3/00LOCK-R-package/00new/xgboost/libs/xgboost.so':
/.../R/x86_64-pc-linux-gnu-library/4.3/00LOCK-R-package/00new/xgboost/libs/xgboost.so: undefined symbol: _ZN7xgboost6common24CustomGlobalRandomEngine4seedEj

@meztez meztez changed the title CMake build fails without OPENMP after setting USE_OPENMP=OFF CMake R package build fails Mar 4, 2024
@hcho3
Copy link
Collaborator

hcho3 commented Mar 4, 2024

Thanks! #10087 should fix the issue.

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