ERROR: compilation failed for package - Undefined reference to `PackageName_rcpp_hello' - r

I am trying to build a package but the Cpp bit is causing an error. This package is very similar to another one which also has a cpp bit and I do manage to build it without problems.
I have checked usual errors like:
Not having the linkingTo Rccp in the DESCRIPTION as here.
Remove xxx.o and xxx.so files in the src/ and try to compile and also
the RccpExports.R as here.
I tried Compile(".") and
tools::package_native_routine_registration_skeleton(".") although I
do not really understand what they mean...
The error
* installing to library 'C:/Program Files/R/R-3.4.0/library'
* installing *source* package 'PackageName' ...
** libs
c:/Rtools/mingw_64/bin/g++ -I"C:/PROGRA~1/R/R-34~1.0/include" -DNDEBUG -I"C:/Program Files/R/R-3.4.0/library/Rcpp/include" -I"d:/Compiler/gcc-4.9.3/local330/include" -O2 -Wall -mtune=core2 -c RcppExports.cpp -o RcppExports.o
c:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-34~1.0/include" -DNDEBUG -I"C:/Program Files/R/R-3.4.0/library/Rcpp/include" -I"d:/Compiler/gcc-4.9.3/local330/include" -O2 -Wall -std=gnu99 -mtune=core2 -c init.c -o init.o
c:/Rtools/mingw_64/bin/g++ -I"C:/PROGRA~1/R/R-34~1.0/include" -DNDEBUG -I"C:/Program Files/R/R-3.4.0/library/Rcpp/include" -I"d:/Compiler/gcc-4.9.3/local330/include" -O2 -Wall -mtune=core2 -c rcpp_hello.cpp -o rcpp_hello.o
c:/Rtools/mingw_64/bin/g++ -shared -s -static-libgcc -o PackageName.dll tmp.def RcppExports.o init.o rcpp_hello.o -Ld:/Compiler/gcc-4.9.3/local330/lib/x64 -Ld:/Compiler/gcc-4.9.3/local330/lib -LC:/PROGRA~1/R/R-34~1.0/bin/x64 -lR
init.o:init.c:(.rdata+0x28): undefined reference to `PackageName_rcpp_hello'
collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'PackageName'
* removing 'C:/Program Files/R/R-3.4.0/library/PackageName'
Exited with status 1.
Details on my session:
R version 3.4.0 (2017-04-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Rstudio: 1.1.383
Rcpp: Rcpp_0.12.12

Related

R (Mac): installation of `cluster` package is failing

I am trying to set up R on a Mac and the installation of the cluster package is failing, possibly due to gfortran (or its library path). Below is the output for the failing package installation (sorry about the partly german output).
> install.packages("cluster", type = "source")
versuche URL 'https://cran.rstudio.com/src/contrib/cluster_2.1.4.tar.gz'
Content type 'application/x-gzip' length 352076 bytes (343 KB)
==================================================
downloaded 343 KB
* installing *source* package ‘cluster’ ...
** Paket ‘cluster’ erfolgreich entpackt und MD5 Summen überprüft
** using staged installation
** libs
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c clara.c -o clara.o
gfortran -fno-optimize-sibling-calls -fPIC -Wall -g -O2 -c daisy.f -o daisy.o
gfortran -fno-optimize-sibling-calls -fPIC -Wall -g -O2 -c dysta.f -o dysta.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c fanny.c -o fanny.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init.c -o init.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c mona.c -o mona.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c pam.c -o pam.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c sildist.c -o sildist.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c spannel.c -o spannel.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c twins.c -o twins.o
clang -arch arm64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o cluster.so clara.o daisy.o dysta.o fanny.o init.o mona.o pam.o sildist.o spannel.o twins.o -L/usr/local/gfortran/lib -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: -undefined dynamic_lookup may not work with chained fixups
ld: warning: ignoring file dysta.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file daisy.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
installing to /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/00LOCK-cluster/00new/cluster/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: Laden von Paket oder Namensraum für ‘cluster’ in dyn.load(file, DLLpath = DLLpath, ...): fehlgeschlagen
kann shared object '/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/00LOCK-cluster/00new/cluster/libs/cluster.so' nicht laden:
dlopen(/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/00LOCK-cluster/00new/cluster/libs/cluster.so, 0x0006): symbol not found in flat namespace '_dysta_'
Fehler: Laden fehlgeschlagen
Ausführung angehalten
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/cluster’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/cluster’
Warning in install.packages :
Installation des Pakets ‘cluster’ hatte Exit-Status ungleich 0
Die heruntergeladenen Quellpakete sind in
‘/private/var/folders/vg/kjdqgj4j4d949_p782bz80rm0000gn/T/RtmpsJedpT/downloaded_packages’
Could this be related to the architecture arm64?
gfortran is also installed.
Here is the output of sessionInfo() and the setting in ~/.R/Makevars
> sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.1
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib
locale:
[1] de_DE.UTF-8/de_DE.UTF-8/de_DE.UTF-8/C/de_DE.UTF-8/de_DE.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.2.2 tools_4.2.2
# Makevars
FC = gfortran
F77 = gfortran
FLIBS = -L/usr/local/gfortran/lib
I had to set gfortran in ~/.R/Makevars, otherwise R searches in an inconclusive place for gfortran and cannot find it. I checked the FLIBS path with gfortran -print-search-dirs, not sure if this is the correct setting.
Actually, the output seems as the package could be installed but not loaded. Does anybody have any ideas or faced a similar problem?
Thank you!

R openair installation fails after upgrade to MRAN 3.4.1

I've been using the openair package on my mac with Rstudio and MRAN v 3.4 for some time with no problem. I recently upgraded to MRA v 3.4.1 and am now getting the following messages, that ultimately end in an error. Suggestions on how to fix appreciated.
> install_github('davidcarslaw/openair')
Downloading GitHub repo davidcarslaw/openair#master
from URL https://api.github.com/repos/davidcarslaw/openair/zipball/master
Installing openair
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
'/private/var/folders/bv/881_rsvd2kv83c13yywwc_xh0000gn/T/Rtmpz6778s/devtoolscf5234a1e7d/davidcarslaw-openair-b782399' \
--library='/Users/gcn/Library/R/3.4/library' --install-tests
* installing *source* package ‘openair’ ...
** libs
clang-omp++ -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I"/Users/gcn/Library/R/3.4/library/Rcpp/include" -DU_STATIC_IMPLEMENTATION -Wall -mtune=core2 -g -O2 -I/opt/X11/include -fPIC -g -O3 -Wall -pedantic -mtune=native -std=c++11 -c cluster.cpp -o cluster.o
clang-omp -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I"/Users/gcn/Library/R/3.4/library/Rcpp/include" -DU_STATIC_IMPLEMENTATION -Wall -mtune=core2 -g -O2 -I/opt/X11/include -fPIC -g -O3 -Wall -pedantic -mtune=native -std=gnu99 -c init.c -o init.o
init.c:26:2: warning: no newline at end of file [-Wnewline-eof]
}
^
1 warning generated.
clang-omp++ -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I"/Users/gcn/Library/R/3.4/library/Rcpp/include" -DU_STATIC_IMPLEMENTATION -Wall -mtune=core2 -g -O2 -I/opt/X11/include -fPIC -g -O3 -Wall -pedantic -mtune=native -std=c++11 -c rolling.cpp -o rolling.o
clang-omp++ -fopenmp -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/clang4/lib -o openair.so cluster.o init.o rolling.o -framework Accelerate -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0'
installing to /Users/gcn/Library/R/3.4/library/openair/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/Library/Frameworks/R.framework/Versions/3.4.1-MRO/Resources/library/Matrix/libs/Matrix.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.4.1-MRO/Resources/library/Matrix/libs/Matrix.so, 6): Library not loaded: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.4.1-MRO/Resources/library/Matrix/libs/Matrix.so
Reason: image not found
ERROR: lazy loading failed for package ‘openair’
* removing ‘/Users/gcn/Library/R/3.4/library/openair’
Installation failed: Command failed (1)
This problem went away after I uninstalled all R versions and then installed MRAN version 3.4.2 when it came out. According to MRAN software support "You're right, it is a bug in MRO 3.4.1. Because MRO uses the Accelerate libraries for BLAS and LAPACK operations, it does not create the libRblas and libRlapack dylibs; binary packages that use those libraries are currently incompatible with MRO, but the default package type was set in MRO 3.4.1 to "macbinary-el-capitan". This has been changed in the upcoming MRO 3.4.2 back to the original "source". "

R Rcpp install error in R 3.1.0

I want to install Rcpp using install.packages("Rcpp"), but it failed.
The error message:
* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/local/lib64/R/include -DNDEBUG -I../inst/include/ -I/usr/local/include -fpic -g -O2 -c Date.cpp -o Date.o
g++ -I/usr/local/lib64/R/include -DNDEBUG -I../inst/include/ -I/usr/local/include -fpic -g -O2 -c Module.cpp -o Module.o
g++ -I/usr/local/lib64/R/include -DNDEBUG -I../inst/include/ -I/usr/local/include -fpic -g -O2 -c Rcpp_init.cpp -o Rcpp_init.o
g++ -I/usr/local/lib64/R/include -DNDEBUG -I../inst/include/ -I/usr/local/include -fpic -g -O2 -c api.cpp -o api.o
g++ -I/usr/local/lib64/R/include -DNDEBUG -I../inst/include/ -I/usr/local/include -fpic -g -O2 -c attributes.cpp -o attributes.o
g++ -I/usr/local/lib64/R/include -DNDEBUG -I../inst/include/ -I/usr/local/include -fpic -g -O2 -c barrier.cpp -o barrier.o
g++ -shared -L/usr/local/lib64 -o Rcpp.so Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o
installing to /home/sethbrin/R/x86_64-redhat-linux-gnu-library/3.1/Rcpp/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/sethbrin/R/x86_64-redhat-linux-gnu-library/3.1/Rcpp/libs/Rcpp.so':
/home/sethbrin/R/x86_64-redhat-linux-gnu-library/3.1/Rcpp/libs/Rcpp.so: undefined symbol: _ZNSt15basic_streambufIcSt11char_traitsIcEE7seekoffExSt12_Ios_SeekdirSt13_Ios_Openmode
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/sethbrin/R/x86_64-redhat-linux-gnu-library/3.1/Rcpp’
The downloaded source packages are in
‘/tmp/Rtmp6PKB8N/downloaded_packages’
Warning message:
In install.packages("Rcpp") :
installation of package ‘Rcpp’ had non-zero exit status
Then I use
c++fit _ZNSt15basic_streambufIcSt11char_traitsIcEE7seekoffExSt12_Ios_SeekdirSt13_Ios_Openmode
std::basic_streambuf<char, std::char_traits<char> >::seekoff(long long, std::_Ios_Seekdir, std::_Ios_Openmode)
I have searched for some solutions for that. It seems that it is because of the gcc version. But I don't know how to change the gcc version that R uses to compile Rcpp package.
CRAN tests Rcpp just like any other of the (by now) 6700+ package.
You can see the aggregate test report and the test setups includes two Fedora-based machines:
one fedora setup using clang and
one fedora setup using g++.
As such your problems are possibly local, or simply due to using an older setup. In which case the Archive section gives you access to an older version.
I've encountered a similar problem.
And after some searches, here are the solutions to alter the compiler:
1. If you have the root privilege:
I found that the Makeconf file in R directory actually sets all the information that is needed for compilation.
To find the path to it, echo which R in the command line.
e.g. I got like:
/data/apps/R/3.1.2/bin/R
And then the file is in:
/data/apps/R/3.1.2/lib64/R/etc/Makeconf
then sudo edit the file on line CC = XXX and maybe more relative lines.
Problem solved!
2. If you only have local user privilege.
Add your own configurations to ~/.R/Makevars
However, #Dirk is probably right.
For me, I finally solved my problem by adding -Doff_t=__off_t to CFLAGS (My problem was error: unknown type name 'off_t'). And I got the halted error when I manually altered parts of the compilers...

Problems installing development package from either GitHub or local

I've been corresponding with the package author about an error I'm getting in the HLMdiag package. He suggested that I install the development version [https://github.com/aloy/HLMdiag]. So, I'm trying to install the development version from both GitHub and a local version that he sent me. I'm running into errors for both my work computer and personal computer. I'm hoping someone in the user community who is more knowledgeable about such things can help solve this.
My initial thought was that there might be some security protocol on my work machine that was causing problems, which is why I attempted the install on a personal machine. I am getting different error messages on the different machines; but still unable to install on either. Any help would be very much appreciated.
Sorry in advance for the post length. I wanted to give as much of the error messages / log as possible.
Machine 1 -- personal
sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] devtools_1.6.1 tools_3.1.2
Attempt (A) - direct from GitHub
devtools::install_github("aloy/HLMdiag")
Downloading github repo aloy/HLMdiag#master
Installing HLMdiag
"C:/PROGRA~1/R/R-31~1.2/bin/x64/R" --vanilla CMD INSTALL \
"C:\Users\crossfit_al1985\AppData\Local\Temp\Rtmp8o4p3s\devtools24b871ace19\aloy-HLMdiag-3f7977d" \
--library="C:/Users/crossfit_al1985/Documents/R/win-library/3.1" --install-tests
* installing *source* package 'HLMdiag' ...
** libs
*** arch - i386
C:\RBuildTools\3.1\gcc-4.6.3\bin\nm.exe: cooksd_obs.o: File format not recognized
C:\RBuildTools\3.1\gcc-4.6.3\bin\nm.exe: cooksd_subset.o: File format not recognized
C:\RBuildTools\3.1\gcc-4.6.3\bin\nm.exe: covratio.o: File format not recognized
C:\RBuildTools\3.1\gcc-4.6.3\bin\nm.exe: covtrace.o: File format not recognized
C:\RBuildTools\3.1\gcc-4.6.3\bin\nm.exe: linear_algebra_fnc.o: File format not recognized
C:\RBuildTools\3.1\gcc-4.6.3\bin\nm.exe: mdffits_subset.o: File format not recognized
g++ -m32 -shared -s -static-libgcc -o HLMdiag.dll tmp.def cooksd_obs.o cooksd_subset.o covratio.o covtrace.o linear_algebra_fnc.o mdffits_subset.o -LC:/PROGRA~1/R/R-31~1.2/bin/i386 -lRlapack -LC:/PROGRA~1/R/R-31~1.2/bin/i386 -lRblas -lgfortran -Ld:/RCompile/CRANpkg/extralibs64/local/lib/i386 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/PROGRA~1/R/R-31~1.2/bin/i386 -lR
cooksd_obs.o: file not recognized: File format not recognized
collect2: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'HLMdiag'
* removing 'C:/Users/crossfit_al1985/Documents/R/win-library/3.1/HLMdiag'
* restoring previous 'C:/Users/crossfit_al1985/Documents/R/win-library/3.1/HLMdiag'
Error: Command failed (1)
Attempt (B) - via install.packages() from local
setwd(...)
install.packages("./HLMdiag_0.3.0.tar.gz", repos = NULL, type = "source")
Installing package into ‘C:/Users/crossfit_al1985/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
* installing *source* package 'HLMdiag' ...
** libs
*** arch - i386
cygwin warning:
MS-DOS style path detected: C:/PROGRA~1/R/R-31~1.2/etc/i386/Makeconf
Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-31~1.2/etc/i386/Makeconf
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
g++ -m32 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c cooksd_obs.cpp -o cooksd_obs.o
g++ -m32 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c cooksd_subset.cpp -o cooksd_subset.o
g++ -m32 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c covratio.cpp -o covratio.o
g++ -m32 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c covtrace.cpp -o covtrace.o
g++ -m32 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c linear_algebra_fnc.cpp -o linear_algebra_fnc.o
g++ -m32 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c mdffits_subset.cpp -o mdffits_subset.o
g++ -m32 -shared -s -static-libgcc -o HLMdiag.dll tmp.def cooksd_obs.o cooksd_subset.o covratio.o covtrace.o linear_algebra_fnc.o mdffits_subset.o -LC:/PROGRA~1/R/R-31~1.2/bin/i386 -lRlapack -LC:/PROGRA~1/R/R-31~1.2/bin/i386 -lRblas -lgfortran -Ld:/RCompile/CRANpkg/extralibs64/local/lib/i386 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/PROGRA~1/R/R-31~1.2/bin/i386 -lR
installing to C:/Users/crossfit_al1985/Documents/R/win-library/3.1/HLMdiag/libs/i386
*** arch - x64
cygwin warning:
MS-DOS style path detected: C:/PROGRA~1/R/R-31~1.2/etc/x64/Makeconf
Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-31~1.2/etc/x64/Makeconf
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
g++ -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c cooksd_obs.cpp -o cooksd_obs.o
g++ -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c cooksd_subset.cpp -o cooksd_subset.o
g++ -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c covratio.cpp -o covratio.o
g++ -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c covtrace.cpp -o covtrace.o
g++ -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c linear_algebra_fnc.cpp -o linear_algebra_fnc.o
g++ -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c mdffits_subset.cpp -o mdffits_subset.o
g++ -m64 -shared -s -static-libgcc -o HLMdiag.dll tmp.def cooksd_obs.o cooksd_subset.o covratio.o covtrace.o linear_algebra_fnc.o mdffits_subset.o -LC:/PROGRA~1/R/R-31~1.2/bin/x64 -lRlapack -LC:/PROGRA~1/R/R-31~1.2/bin/x64 -lRblas -lgfortran -Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/PROGRA~1/R/R-31~1.2/bin/x64 -lR
installing to C:/Users/crossfit_al1985/Documents/R/win-library/3.1/HLMdiag/libs/x64
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Creating a generic function from function 'adjust_lmList' in package 'HLMdiag'
Error in setMethod("lmList", signature(formula = "formula", data = "data.frame"), :
no existing definition for function 'lmList'
Error : unable to load R code in package 'HLMdiag'
ERROR: lazy loading failed for package 'HLMdiag'
* removing 'C:/Users/crossfit_al1985/Documents/R/win-library/3.1/HLMdiag'
* restoring previous 'C:/Users/crossfit_al1985/Documents/R/win-library/3.1/HLMdiag'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-31~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\crossfit_al1985\Documents\R\win-library\3.1" "./HLMdiag_0.3.0.tar.gz"' had status 1
Warning in install.packages :
installation of package ‘./HLMdiag_0.3.0.tar.gz’ had non-zero exit status
Attempt (C) - via unzipping and devtools::install()
setwd(...)
devtools::install("HLMdiag")
Installing HLMdiag
"C:/PROGRA~1/R/R-31~1.2/bin/x64/R" --vanilla CMD INSTALL \
"C:\Users\crossfit_al1985\Downloads\HLMdiag" \
--library="C:/Users/crossfit_al1985/Documents/R/win-library/3.1" --install-tests
* installing *source* package 'HLMdiag' ...
** libs
*** arch - i386
g++ -m32 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c cooksd_obs.cpp -o cooksd_obs.o
g++ -m32 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c cooksd_subset.cpp -o cooksd_subset.o
g++ -m32 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c covratio.cpp -o covratio.o
g++ -m32 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c covtrace.cpp -o covtrace.o
g++ -m32 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c linear_algebra_fnc.cpp -o linear_algebra_fnc.o
g++ -m32 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c mdffits_subset.cpp -o mdffits_subset.o
g++ -m32 -shared -s -static-libgcc -o HLMdiag.dll tmp.def cooksd_obs.o cooksd_subset.o covratio.o covtrace.o linear_algebra_fnc.o mdffits_subset.o -LC:/PROGRA~1/R/R-31~1.2/bin/i386 -lRlapack -LC:/PROGRA~1/R/R-31~1.2/bin/i386 -lRblas -lgfortran -Ld:/RCompile/CRANpkg/extralibs64/local/lib/i386 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/PROGRA~1/R/R-31~1.2/bin/i386 -lR
installing to C:/Users/crossfit_al1985/Documents/R/win-library/3.1/HLMdiag/libs/i386
*** arch - x64
g++ -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c cooksd_obs.cpp -o cooksd_obs.o
g++ -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c cooksd_subset.cpp -o cooksd_subset.o
g++ -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c covratio.cpp -o covratio.o
g++ -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c covtrace.cpp -o covtrace.o
g++ -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c linear_algebra_fnc.cpp -o linear_algebra_fnc.o
g++ -m64 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/Rcpp/include" -I"C:/Users/crossfit_al1985/Documents/R/win-library/3.1/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c mdffits_subset.cpp -o mdffits_subset.o
g++ -m64 -shared -s -static-libgcc -o HLMdiag.dll tmp.def cooksd_obs.o cooksd_subset.o covratio.o covtrace.o linear_algebra_fnc.o mdffits_subset.o -LC:/PROGRA~1/R/R-31~1.2/bin/x64 -lRlapack -LC:/PROGRA~1/R/R-31~1.2/bin/x64 -lRblas -lgfortran -Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/PROGRA~1/R/R-31~1.2/bin/x64 -lR
installing to C:/Users/crossfit_al1985/Documents/R/win-library/3.1/HLMdiag/libs/x64
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Creating a generic function from function 'adjust_lmList' in package 'HLMdiag'
Error in setMethod("lmList", signature(formula = "formula", data = "data.frame"), :
no existing definition for function 'lmList'
Error : unable to load R code in package 'HLMdiag'
ERROR: lazy loading failed for package 'HLMdiag'
* removing 'C:/Users/crossfit_al1985/Documents/R/win-library/3.1/HLMdiag'
* restoring previous 'C:/Users/crossfit_al1985/Documents/R/win-library/3.1/HLMdiag'
Error: Command failed (1)
Machine 2 -- work
sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] devtools_1.5
loaded via a namespace (and not attached):
[1] digest_0.6.4 evaluate_0.5.5 formatR_0.10 htmltools_0.2.4 httr_0.6.1 knitr_1.6
[7] memoise_0.2.1 parallel_3.1.1 RCurl_1.95-4.1 rmarkdown_0.4.2 stringr_0.6.2 tools_3.1.1
[13] whisker_0.3-2
Attempt (A) -- direct from github
devtools::install_github("aloy/HLMdiag")
Installing github repo HLMdiag/master from aloy
Downloading master.zip from https://github.com/aloy/HLMdiag/archive/master.zip
Installing package from C:\Users\alewit\AppData\Local\Temp\RtmpATVjSy/master.zip
Installing HLMdiag
"C:/PROGRA~1/R/R-31~1.1/bin/x64/R" --vanilla CMD INSTALL \
"C:\Users\alewit\AppData\Local\Temp\RtmpATVjSy\devtoolsc745bf04fbd\HLMdiag-master" \
--library="C:/Users/alewit/Documents/R/win-library/3.1" --install-tests
* installing *source* package 'HLMdiag' ...
** libs
*** arch - i386
Warning: running command 'make -f "Makevars.win" -f "C:/PROGRA~1/R/R-31~1.1/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-31~1.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="HLMdiag.dll" OBJECTS="cooksd_obs.o cooksd_subset.o covratio.o covtrace.o linear_algebra_fnc.o mdffits_subset.o"' had status 127
ERROR: compilation failed for package 'HLMdiag'
* removing 'C:/Users/alewit/Documents/R/win-library/3.1/HLMdiag'
* restoring previous 'C:/Users/alewit/Documents/R/win-library/3.1/HLMdiag'
Error: Command failed (1)
Attempt (B) -- via install.packages() from local
setwd(...)
install.packages("./HLMdiag_0.3.0.tar.gz", repos = NULL, type = "source")
Installing package into ‘C:/Users/alewit/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
* installing *source* package 'HLMdiag' ...
** libs
*** arch - i386
Warning: running command 'make -f "Makevars.win" -f "C:/PROGRA~1/R/R-31~1.1/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-31~1.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="HLMdiag.dll" OBJECTS="cooksd_obs.o cooksd_subset.o covratio.o covtrace.o linear_algebra_fnc.o mdffits_subset.o"' had status 127
ERROR: compilation failed for package 'HLMdiag'
* removing 'C:/Users/alewit/Documents/R/win-library/3.1/HLMdiag'
* restoring previous 'C:/Users/alewit/Documents/R/win-library/3.1/HLMdiag'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-31~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\alewit\Documents\R\win-library\3.1" "C:/Users/alewit/Downloads/HLMdiag_0.3.0.tar.gz"' had status 1
Warning in install.packages :
installation of package ‘C:/Users/alewit/Downloads/HLMdiag_0.3.0.tar.gz’ had non-zero exit status
Attempt (C) -- via devtools::install()
setwd(...)
install("HLMdiag")
Installing HLMdiag
"C:/PROGRA~1/R/R-31~1.1/bin/x64/R" --vanilla CMD INSTALL "C:\Users\alewit\Downloads\HLMdiag" \
--library="C:/Users/alewit/Documents/R/win-library/3.1" --install-tests
* installing *source* package 'HLMdiag' ...
** libs
*** arch - i386
Warning: running command 'make -f "Makevars.win" -f "C:/PROGRA~1/R/R-31~1.1/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-31~1.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="HLMdiag.dll" OBJECTS="cooksd_obs.o cooksd_subset.o covratio.o covtrace.o linear_algebra_fnc.o mdffits_subset.o"' had status 127
ERROR: compilation failed for package 'HLMdiag'
* removing 'C:/Users/alewit/Documents/R/win-library/3.1/HLMdiag'
* restoring previous 'C:/Users/alewit/Documents/R/win-library/3.1/HLMdiag'
Error: Command failed (1)
The .o files in the src directory were messing things up. I submitted a pull request so hopefully Adam will incorporate those fixes soon and your problem should go away. You could test if this works by using
install_github("Dasonk/HLMdiag")
until the pull request is accepted.
Edit: And Adam was quick to merge. Test out installing from github again install_github("aloy/HLMdiag") and it should work for you.

R shiny Ubuntu 12.04 installation instructions fail when installing Rcpp needed by R shiny library in R 3.0.2

I am trying to install an R shiny server on my local Ubuntu 12.04 machine, and I followed the instructions here https://github.com/rstudio/shiny-server/wiki/Ubuntu-step-by-step-install-instructions:
When trying to do a:
install.packages('shiny', repos='http://cran.rstudio.com/')
It goes through the dependencies, but fails to install Rcpp. See error log below:
* installing *source* package 'Rcpp' ...
* package 'Rcpp' successfully unpacked and MD5 sums checked
* libs
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c Date.cpp -o Date.o
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c Module.cpp -o Module.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c Rcpp_init.c -o Rcpp_init.o
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c Timer.cpp -o Timer.o
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c api.cpp -o api.o
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c attributes.cpp -o attributes.o
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c barrier.cpp -o barrier.o
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c exceptions.cpp -o exceptions.o
g++ -shared -o Rcpp.so Date.o Module.o Rcpp_init.o Timer.o api.o attributes.o barrier.o exceptions.o -L/usr/lib/R/lib -lR
g++ -o libRcpp.so Date.o Module.o Rcpp_init.o Timer.o api.o attributes.o barrier.o exceptions.o -shared -L/usr/lib/R/lib -lR
ar qc libRcpp.a Date.o Module.o Rcpp_init.o Timer.o api.o attributes.o barrier.o exceptions.o
cp libRcpp.so ../inst/lib
cp libRcpp.a ../inst/lib
rm libRcpp.so libRcpp.a
installing to /usr/local/lib/R/site-library/Rcpp/libs
* R
* inst
* preparing package for lazy loading
Error : package 'codetools' was built before R 3.0.0: please re-install it
Error : unable to load R code in package 'Rcpp'
ERROR: lazy loading failed for package 'Rcpp'
* removing '/usr/local/lib/R/site-library/Rcpp'
* installing *source* package 'httpuv' ...
* package 'httpuv' successfully unpacked and MD5 sums checked
* libs
g++ -I/usr/share/R/include -DNDEBUG -I./libuv/include -I./http-parser -I./sha1 -I./base64 -I"/usr/lib/R/site-library/Rcpp/include" -fpic -O3 -pipe -g -c RcppExports.cpp -o RcppExports.o
RcppExports.cpp:75:10: error: 'uint32_t' was not declared in this scope
RcppExports.cpp: In function 'SEXPREC* httpuv_run(SEXP)':
RcppExports.cpp:79:5: error: 'uint32_t' was not declared in this scope
RcppExports.cpp:79:14: error: expected ';' before 'timeoutMillis'
RcppExports.cpp:80:25: error: 'timeoutMillis' was not declared in this scope
RcppExports.cpp:80:38: error: 'run' cannot be used as a function
make: * [RcppExports.o] Error 1
ERROR: compilation failed for package 'httpuv'
* removing '/usr/local/lib/R/site-library/httpuv'
ERROR: dependency 'httpuv' is not available for package 'shiny'
* removing '/usr/local/lib/R/site-library/shiny'
EDITED:
Manually downloading and installing Rcpp gives me:
sudo R CMD INSTALL Rcpp_0.10.6.tar.gz
Error : package 'codetools' was built before R 3.0.0: please re-install it
So I manually downloaded and installed codetools and re-tried Rcpp:
sudo R CMD INSTALL codetools_0.2-8.tar.gz
sudo R CMD INSTALL Rcpp_0.10.6.tar.gz
Then followed the instructions again from the Shiny webpage from "Install R" and "Install shiny" and got a similar error but now with caTools, bitops and xtable, so I did the manual installation of each of them. The shiny was installed correctly.
Then followed the next steps in the instructions.
Any ideas why I got this 'was built before R 3.0.0' errors?
Ubuntu 12.04 is a pre-R 3.0.0 release. You have to decide whether you want its long-term support and stability "as is", or if you want newer software.
You can mix and match. Read the CRAN Ubuntu README, adjust your apt settings and enjoy updated r-cran-* packages. With those you can then install shiny and its dependencies.
Manually downloading and installing Rcpp gives me:
sudo R CMD INSTALL Rcpp_0.10.6.tar.gz
Error : package 'codetools' was built before R 3.0.0: please re-install it
So I manually downloaded and installed codetools and re-tried Rcpp:
sudo R CMD INSTALL codetools_0.2-8.tar.gz
sudo R CMD INSTALL Rcpp_0.10.6.tar.gz
Then followed the instructions again from the Shiny webpage from "Install R" and "Install shiny" and got a similar error but now with caTools, bitops and xtable, so I did the manual installation of each of them. The shiny was installed correctly.
Then followed the next steps in the instructions. All went well from there. Not sure why I was getting these was built before 3.0.0 errors.

Resources