knausb / vcfR

Tools to work with variant call format files
248 stars 54 forks source link

getDLLRegisteredRoutine issue #119

Closed knausb closed 5 years ago

knausb commented 5 years ago

On my Ubuntu 16.04 workstation I am generating the below error.

==> devtools::check(args = c('--as-cran'))

Updating vcfR documentation
Writing NAMESPACE
Loading vcfR
Creating a generic function for ‘rbind’ from package ‘base’ in package ‘vcfR’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘vcfR’
Error in getDLLRegisteredRoutine.DLLInfo(dll, addNames = FALSE) : 
  must specify DLL via a “DLLInfo” object. See getLoadedDLLs()
Calls: <Anonymous> ... assignNativeRoutines -> getDLLRegisteredRoutines.DLLInfo
Execution halted

Exited with status 1.

This does not appear on my Mac, Travis, or Appveyor. So I'm going to assume this is application specific.

Similar behaviour has been reported at #https://github.com/r-lib/devtools/issues/1940#issue-388565090 #https://github.com/tidyverse/readxl/issues/520#issue-383945791 and #https://github.com/Microsoft/LightGBM/issues/1830#issue-378437664.

knausb commented 5 years ago

Help for

?getDLLRegisteredRoutines.DLLInfo

seems to indicate that this has something to do with calling compiled code. I tried removing and reinstalling Rcpp, but that did not change anything.

knausb commented 5 years ago

Tried

sudo apt-get purge --remove r-base
sudo apt-get purge --remove r-base-core 
sudo apt-get install r-base

and it did not resolve the issue.

knausb commented 5 years ago

If I start from scratch

git clone git@github.com:knausb/vcfR.git
R CMD build vcfR
R CMD check --as-cran vcfR_1.8.0.9000.tar.gz 

it builds fine. So its something that's happening once its on my system.

knausb commented 5 years ago

Our issue appears as an issue on roxygen2.

knausb commented 5 years ago

My solution appears to be the following.

devtools::load_all()
devtools::document()

Now I can go back to building as usual.

knausb commented 5 years ago

Okay, that did not work when I went home and tried it on my home computer. I added

Settings from /etc/R/Makeconf with "non-portable flag(s):"
# ‘-Wdate-time’ ‘-Werror=format-security’ ‘-Wformat’ replaced by -Wall -pedantic
# and without -fdebug-prefix-map=... 
CFLAGS = -g -O2 -Wall -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2 $(LTO)
CXXFLAGS = -g -O2 -Wall -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2 $(LTO)
CXX98FLAGS = -g -O2 -Wall -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2
CXX11FLAGS = -g -O2 -Wall -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2
CXX14FLAGS = -g -O2 -Wall -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2

to ~/.R/Makevars. I got this tip at this SO post. And

devtools::load_all()
devtools::document()

and it now builds fine on all my machines.