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

interference between Timer and R_useDynamicSymbols #846

Closed
romainfrancois opened this issue Apr 25, 2018 · 5 comments · Fixed by #847
Closed

interference between Timer and R_useDynamicSymbols #846

romainfrancois opened this issue Apr 25, 2018 · 5 comments · Fixed by #847

Comments

@romainfrancois
Copy link
Contributor

romainfrancois commented Apr 25, 2018

I have a very simple 📦 here https://github.com/romainfrancois/testtimer to demonstrate this issue.

The relevant thing is that it includes Timer.h in its _types.h file :

#include <Rcpp.h>
#include <Rcpp/Benchmark/Timer.h>

and so when I install it I get:

> install_github("romainfrancois/testtimer")
Downloading GitHub repo romainfrancois/testtimer@master
from URL https://api.github.com/repos/romainfrancois/testtimer/zipball/master
Installing testtimer
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL  \
  '/private/var/folders/r_/1b2gjtsd7j92jbbpz4t7ps340000gn/T/Rtmpz9TfM1/devtools40674e600f2/romainfrancois-testtimer-cd72001'  \
  --library='/Library/Frameworks/R.framework/Versions/3.4/Resources/library' --with-keep.source --install-tests 

* installing *source* packagetesttimer...
** libs
clang++  -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -Wno-unused-result -Wno-c++11-inline-namespace -O3 -c RcppExports.cpp -o RcppExports.o
RcppExports.cpp:26:5: error: no matching function for call to 'R_useDynamicSymbols'
    R_useDynamicSymbols(dll, FALSE);
    ^~~~~~~~~~~~~~~~~~~
/Library/Frameworks/R.framework/Resources/include/R_ext/Rdynload.h:84:10: note: candidate function not viable: no known conversion from 'int' to 'Rboolean' for 2nd argument
Rboolean R_useDynamicSymbols(DllInfo *info, Rboolean value);
         ^
1 error generated.
make: *** [RcppExports.o] Error 1
ERROR: compilation failed for packagetesttimer* removing/Library/Frameworks/R.framework/Versions/3.4/Resources/library/testtimerInstallation failed: Command failed (1)
@eddelbuettel
Copy link
Member

Could that be a clang issue?

edd@rob:~$ installGithub.r romainfrancois/testtimer
Downloading GitHub repo romainfrancois/testtimer@master
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
* installing *source* package ‘testtimer’ ...
** libs
ccache g++ -I/usr/share/R/include -DNDEBUG  -I"/usr/local/lib/R/site-library/Rcpp/include"    -fpic  -g -O3 -Wall -pipe  -Wno-misleading-indentation -Wno-unused -Wno-ignored-attributes -Wno-deprecated-declarations -march=native -c RcppExports.cpp -o RcppExports.o
ccache g++ -I/usr/share/R/include -DNDEBUG  -I"/usr/local/lib/R/site-library/Rcpp/include"    -fpic  -g -O3 -Wall -pipe  -Wno-misleading-indentation -Wno-unused -Wno-ignored-attributes -Wno-deprecated-declarations -march=native -c testtimer.cpp -o testtimer.o
ccache g++ -Wl,-S -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o testtimer.so RcppExports.o testtimer.o -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/testtimer/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (testtimer)
edd@rob:~$ 

@eddelbuettel
Copy link
Member

Also works for me with clang if I select that compiler in ~/.R/Makevars:

edd@rob:~/git/testtimer(master)$ install.r testtimer_0.1.0.tar.gz 
* installing *source* package ‘testtimer’ ...
** libs
ccache clang++ -I/usr/share/R/include -DNDEBUG  -I"/usr/local/lib/R/site-library/Rcpp/include"    -fpic  -Wall -O3  -c RcppExports.cpp -o RcppExports.o
ccache clang++ -I/usr/share/R/include -DNDEBUG  -I"/usr/local/lib/R/site-library/Rcpp/include"    -fpic  -Wall -O3  -c testtimer.cpp -o testtimer.o
clang -Wl,-S -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o testtimer.so RcppExports.o testtimer.o -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/testtimer/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (testtimer)
edd@rob:~/git/testtimer(master)$ 

Could it be something else? Case on the filesystem? I am a little lost.

@coatless
Copy link
Contributor

macOS specific I fear:

devtools::install_github("romainfrancois/testtimer")
Downloading GitHub repo romainfrancois/testtimer@master
from URL https://api.github.com/repos/romainfrancois/testtimer/zipball/master
Installing testtimer
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save  \
  --no-restore --quiet CMD INSTALL  \
  '/private/var/folders/b0/vt_1hj2d6yd8myx9lwh81pww0000gn/T/RtmpjLr5Qf/devtoolsf2ae3b74c003/romainfrancois-testtimer-cd72001'  \
  --library='/Library/Frameworks/R.framework/Versions/3.4/Resources/library' --install-tests 

* installing *source* package ‘testtimer’ ...
** libs
/usr/local/clang4/bin/clang++ -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I/usr/local/include   -fPIC  -Wall -g -O2  -c RcppExports.cpp -o RcppExports.o
RcppExports.cpp:26:5: error: no matching function for call to 'R_useDynamicSymbols'
    R_useDynamicSymbols(dll, FALSE);
    ^~~~~~~~~~~~~~~~~~~
/Library/Frameworks/R.framework/Resources/include/R_ext/Rdynload.h:84:10: note: candidate function not viable: no known conversion from 'int' to 'Rboolean' for 2nd argument
Rboolean R_useDynamicSymbols(DllInfo *info, Rboolean value);
         ^
1 error generated.
make: *** [RcppExports.o] Error 1
ERROR: compilation failed for package ‘testtimer’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/testtimer’
Installation failed: Command failed (1)

@eddelbuettel
Copy link
Member

Thanks for confirming. If either one of you could poke and see what may go wrong when __APPLE__ is defined I'd appreciate it. Maybe mach/mach_time.h declares FALSE as an int so that we get the

no known conversion from 'int' to 'Rboolean' for 2nd argument

error.

@eddelbuettel
Copy link
Member

For good measure I also tossed it at WinBuilder and it fails there too:

* installing *source* package 'testtimer' ...
** libs

*** arch - i386
d:/Compiler/gcc-4.9.3/mingw_32/bin/g++  -I"D:/RCompile/recent/R-3.5.0/include" -DNDEBUG  -I"d:/RCompile/CRANpkg/lib/3.5/Rcpp/include"   -I"d:/Compiler/gcc-4.9.3/local330/include"     -O2 -Wall  -mtune=core2 -c RcppExports.cpp -o RcppExports.o
RcppExports.cpp: In function 'void R_init_testtimer(DllInfo*)':
RcppExports.cpp:26:35: error: invalid conversion from 'int' to 'Rboolean' [-fpermissive]
     R_useDynamicSymbols(dll, FALSE);
                                   ^
In file included from D:/RCompile/recent/R-3.5.0/include/Rinternals.h:51:0,
                 from d:/RCompile/CRANpkg/lib/3.5/Rcpp/include/Rcpp/r/headers.h:53,
                 from d:/RCompile/CRANpkg/lib/3.5/Rcpp/include/RcppCommon.h:38,
                 from d:/RCompile/CRANpkg/lib/3.5/Rcpp/include/Rcpp.h:27,
                 from ../inst/include/testtimer_types.h:1,
                 from RcppExports.cpp:4:
D:/RCompile/recent/R-3.5.0/include/R_ext/Rdynload.h:84:10: note: initializing argument 2 of 'Rboolean R_useDynamicSymbols(DllInfo*, Rboolean)'
 Rboolean R_useDynamicSymbols(DllInfo *info, Rboolean value);
          ^
make: *** [RcppExports.o] Error 1
ERROR: compilation failed for package 'testtimer'
* removing 'd:/RCompile/CRANguest/R-release/lib/testtimer'
In R CMD INSTALL

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.

3 participants