Closed pbpearman closed 5 years ago
Update. Following this post and adding some links, I got a successful build following this post. I do: `bgppermp$ cd R-package/ uhtred:R-package bgppermp$ R CMD INSTALL --build . --no-multiarch
@pbpearman Did you build the package first using the build_r.R script? (it builds and installs, actually)
@Laurae2 Yes, I tried, but it doesn't complete.
In the second example in the original post, I showed what happened when using that script from within the LightGBM folder. The fairly cryptic error message was:
Error in getDLLRegisteredRoutines.DLLInfo(dll, addNames = FALSE) : must specify DLL via a “DLLInfo” object. See getLoadedDLLs()
This might provide another approach to trouble-shooting, but I looked at the build_r.R script and did not find anything I could relate to the error message. I tried again from a fresh clone, but got the same result.
Tried to install LightGBM; kept on getting "Copying CMakeLists failed" messages
I too am getting this error, on mac osx 10.14.1 running R 3.5.1. Perhaps this is related to #1702?
Bens-MacBook-Pro-2017:LightGBM Ben$ Rscript build_r.R
Updating lightgbm documentation
Updating roxygen version in /Users/Ben/Documents/Projects/R/LightGBM/lightgbm_r/DESCRIPTION
Writing NAMESPACE
Loading lightgbm
Loading required package: R6
Error in getDLLRegisteredRoutines.DLLInfo(dll, addNames = FALSE) :
must specify DLL via a “DLLInfo” object. See getLoadedDLLs()
Calls: <Anonymous> ... assignNativeRoutines -> getDLLRegisteredRoutines.DLLInfo
In addition: Warning message:
roxygen2 requires Encoding: UTF-8
Execution halted
Bens-MacBook-Pro-2017:LightGBM Ben$
Ping @jameslamb : DLL on Mac or generic error?
@pbpearman Can you try lgbdl to see if it provides an another error message? Make sure to use a fresh R session and to close all other R sessions.
Hmm, it seems that the line devtools::document(pkg = "lightgbm_r")
in build_r.R is the culprit. If I run the script without that line, lightgbm appears to install successfully.
@ben519 Sounds like the R session is not cleaned after generating the documentation because this DLL error appears when trying to install a package with a corresponding .so/.dll already loaded in memory (here, installing LightGBM while LightGBM is being used).
@Laurae2, @ben519 Here is what I get when running lgbdl from a fresh R session: `> lgbdl::lgb.dl(compiler = "gcc") Cloning into 'LightGBM'... Submodule 'include/boost/compute' (https://github.com/boostorg/compute) registered for path 'compute' Cloning into '/private/var/folders/bz/h_ys6bjn3h9b201nks55l9bc0000gn/T/Rtmpw8LARd/LightGBM/compute'... Submodule path 'compute': checked out '509ebe4a9282eec8a92c65ce3bbc1925f1fdbe07' Already on 'master' Your branch is up to date with 'origin/master'.
-- Configuring incomplete, errors occurred! See also "/private/var/folders/bz/h_ys6bjn3h9b201nks55l9bc0000gn/T/Rtmpw8LARd/LightGBM/lightgbm_r/src/build/CMakeFiles/CMakeOutput.log". make: *** No rule to make target `_lightgbm'. Stop. Error in eval(ei, envir) : Cannot find lib_lightgbm.so
Also, I note this: bgppermp$ echo |cpp -fopenmp -dM |grep -i open
@pbpearman it looks like clang
is not finding openmp. Can you humor me and try this as we note in the installation guide?
brew install libomp
I also have never tried from within RStudio but given my experience with that tool, I echo @Laurae2 's concern that something is being left behind.
If you run
Rscript build_r.R
from the command line, this would not be a concern because every Rscript
call is a new R session by definition.
I'm getting the same thing both with the command line and with Rstudio. (Windows install)
C:\LightGBM>Rscript build_r.R
Updating lightgbm documentation
Updating roxygen version in C:\LightGBM\lightgbm_r/DESCRIPTION
Writing NAMESPACE
Loading lightgbm
Loading required package: R6
Error in getDLLRegisteredRoutines.DLLInfo(dll, addNames = FALSE) :
must specify DLL via a "DLLInfo" object. See getLoadedDLLs()
Calls:
Update: Ran this on my digital ocean Ubuntu 18.04 server and got exactly the same thing.
$ Rscript build_r.R
Updating lightgbm documentation
Updating roxygen version in /home/pres/LightGBM/lightgbm_r/DESCRIPTION
Writing NAMESPACE
Loading lightgbm
Loading required package: R6
Error in getDLLRegisteredRoutines.DLLInfo(dll, addNames = FALSE) :
must specify DLL via a “DLLInfo” object. See getLoadedDLLs()
Calls:
@1psmith Comment the line 49 of build_r.R, I am also getting the error.
@1psmith You can try also #1868 fix.
git clone --recursive https://github.com/Microsoft/LightGBM
cd LightGBM
git checkout fbd98d5
Rscript build_r.R
Update: Ran this on my digital ocean Ubuntu 18.04 server and got exactly the same thing.
$ Rscript build_r.R
Updating lightgbm documentation
Updating roxygen version in /home/pres/LightGBM/lightgbm_r/DESCRIPTION
Writing NAMESPACE
Loading lightgbm
Loading required package: R6
Error in getDLLRegisteredRoutines.DLLInfo(dll, addNames = FALSE) :
must specify DLL via a “DLLInfo” object. See getLoadedDLLs()
Calls:
@1psmith You can try also #1868 fix.
git clone --recursive https://github.com/Microsoft/LightGBM cd LightGBM git checkout fbd98d5 Rscript build_r.R
Yes! This worked perfectly. Thanks!!!
@Laurae2 @jameslamb @1psmith Here, for entertainment, I installed libomp anew. Then I try @1psmith 's idea. `bgppermp$ brew install libomp Updating Homebrew... ==> Auto-updated Homebrew! Updated 2 taps (homebrew/core and homebrew/cask). ==> Updated Formulae jump laszip mkl-dnn vsts-cli vtk youtube-dl
==> Downloading https://homebrew.bintray.com/bottles/libomp-6.0.1.high_sierra.bo
==> Downloading from https://akamai.bintray.com/04/046f659ad8a2cc336049a1e7f7be0
######################################################################## 100.0%
==> Pouring libomp-6.0.1.high_sierra.bottle.tar.gz
Error: The brew link
step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink lib/libgomp.a
Target /usr/local/lib/libgomp.a
already exists. You may want to remove it:
rm '/usr/local/lib/libgomp.a'
To force the link and overwrite all conflicting files: brew link --overwrite libomp
To list all files that would be deleted: brew link --overwrite --dry-run libomp
Possible conflicting files are: /usr/local/lib/libgomp.a /usr/local/lib/libgomp.dylib -> /usr/local/lib/libomp.dylib /usr/local/lib/libiomp5.dylib -> /usr/local/lib/libomp.dylib /usr/local/lib/libomp.dylib ==> Caveats On Apple Clang, you need to add several options to use OpenMP's front end instead of the standard driver option. This usually looks like -Xpreprocessor -fopenmp -lomp
You might need to make sure the lib and include directories are discoverable if /usr/local is not searched:
-L/usr/local/opt/libomp/lib -I/usr/local/opt/libomp/include
For CMake, the following flags will cause the OpenMP::OpenMP_CXX target to be set up correctly: -DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include" -DOpenMP_CXX_LIB_NAMES="omp" -DOpenMP_omp_LIBRARY=/usr/local/opt/libomp/lib/libomp.dylib ==> Summary 🍺 /usr/local/Cellar/libomp/6.0.1: 12 files, 1.2MB
bgppermp$ brew link --overwrite libomp Linking /usr/local/Cellar/libomp/6.0.1... 8 symlinks created
bgppermp$ git checkout fbd98d5 Note: checking out 'fbd98d5'.
You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example:
git checkout -b
HEAD is now at fbd98d5 Does not need to fix doc. Fixes #1852
bgppermp$ git branch
Worked! Although the link to libomp was present, re-installing and overwriting the old link seems to have fixed the situation. Must have been broken. Thanks!
`
I have been trying to install to Mac, and have tried several possible solutions, but nothing seems to work. Following issue 1407, I tried installing from the RStudio console:
I also tried from within the LightGBM folder and got completely a different error message:
So, I'm at a dead end in both cases. I have tried to set the CXX and CC flags to (g++ or g++-8) and (gcc and gcc-8). Your suggestions would be appreciated because with the differing error messages, this is now beyond me.
Environment info
Operating System: Mac OS X 10.13.6
CPU/GPU model: 3 GHz 8-Core Intel Xeon E5
C++/Python/R version: R v. 3.5.1
Error message
Reproducible examples
Steps to reproduce
1. 2. 3.