[Rcpp-devel] Compilation and Build Error with R CMD SHLIB and R CMD check

Dirk Eddelbuettel edd at debian.org
Mon Jan 30 21:41:37 CET 2012


On 30 January 2012 at 15:22, Jared Lander wrote:
| I tried a number of suggestions from this thread (such as changing my
| Makevars.win file) but unfortunately nothing seems to work.
|  
| So I tried to install RcppArmadillo by running R CMD INSTALL -l tempdir/
| RcppArmadillo_0.2.34.tar.gz which led to the error below:
| * installing *source* package 'RcppArmadillo' ...
| ** package 'RcppArmadillo' successfully unpacked and MD5 sums checked
| ** libs
| *** arch - i386
| g++  -I"c:/Users/Jared/Documents/R/R-2.14.1/include" -I../inst/include -I.  
| -I"C:/Users/Jared/Documents/R/win-library/2.14/Rcpp/include" -I"d:/RCompile/
| CRANpkg/extralibs/local/include"     -O2 -Wall  -mtune=core2 -c
| RcppArmadillo.cpp -o RcppArmadillo.o
| g++  -I"c:/Users/Jared/Documents/R/R-2.14.1/include" -I../inst/include -I.  
| -I"C:/Users/Jared/Documents/R/win-library/2.14/Rcpp/include" -I"d:/RCompile/
| CRANpkg/extralibs/local/include"     -O2 -Wall  -mtune=core2 -c fastLm.cpp
| -o fastLm.o
| g++ -shared -s -static-libgcc -o RcppArmadillo.dll tmp.def RcppArmadillo.o
| fastLm.o -Ld:/RCompile/CRANpkg/extralibs/local/lib/i386 -Ld:/RCompile/CRANpkg/
| extralibs/local/lib C:/Users/Jared/Documents/R/win-library/2.14/Rcpp/lib/i386/
| libRcpp.a -Lc:/Users/Jared/Documents/R/R-2.14.1/bin/i386 -lRlapack -Lc:/Users/
| Jared/Documents/R/R-2.14.1/bin/i386 -lRblas -lgfortran -Lc:/Users/Jared/
| Documents/R/R-2.14.1/bin/i386 -lR
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/Users/Jared/Documents/R
| /R-2.14.1/bin/i386/Rlapack.dll when searching for -lRlapack
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/Users/Jared/Documents/R
| /R-2.14.1/bin/i386/Rlapack.dll when searching for -lRlapack
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/Users/Jared/Documents/R
| /R-2.14.1/bin/i386/Rlapack.dll when searching for -lRlapack
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/Users/Jared/Documents/R
| /R-2.14.1/bin/i386/Rlapack.dll when searching for -lRlapack
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/Users/Jared/Documents/R
| /R-2.14.1/bin/i386/Rlapack.dll when searching for -lRlapack
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/Users/Jared/Documents/R
| /R-2.14.1/bin/i386/Rlapack.dll when searching for -lRlapack
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: cannot find -lR
| lapack
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/Users/Jared/Documents/R
| /R-2.14.1/bin/i386/Rblas.dll when searching for -lRblas
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/Users/Jared/Documents/R
| /R-2.14.1/bin/i386/Rblas.dll when searching for -lRblas
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/Users/Jared/Documents/R
| /R-2.14.1/bin/i386/Rblas.dll when searching for -lRblas
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/Users/Jared/Documents/R
| /R-2.14.1/bin/i386/Rblas.dll when searching for -lRblas
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/Users/Jared/Documents/R
| /R-2.14.1/bin/i386/Rblas.dll when searching for -lRblas
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/Users/Jared/Documents/R
| /R-2.14.1/bin/i386/Rblas.dll when searching for -lRblas
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: cannot find -lR
| blas
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/Users/Jared/Documents/R
| /R-2.14.1/bin/i386/R.dll when searching for -lR
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/Users/Jared/Documents/R
| /R-2.14.1/bin/i386/R.dll when searching for -lR
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/Users/Jared/Documents/R
| /R-2.14.1/bin/i386/R.dll when searching for -lR
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/Users/Jared/Documents/R
| /R-2.14.1/bin/i386/R.dll when searching for -lR
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/Users/Jared/Documents/R
| /R-2.14.1/bin/i386/R.dll when searching for -lR
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/Users/Jared/Documents/R
| /R-2.14.1/bin/i386/R.dll when searching for -lR
| c:/rtools/gcc-4.5.4/bin64/../lib/gcc/x86_64-w64-mingw32/4.5.4/../../../../
| x86_64-w64-mingw32/bin/ld.exe: cannot find -lR
| collect2: ld returned 1 exit status
| ERROR: compilation failed for package 'RcppArmadillo'
| * removing 'C:/Users/Jared/tempdir/RcppArmadillo'
|  
| Since this is a package that should work that probably means it's my
| environment.  And I was sure to put "C:\Rtools\bin;C:\Rtools\gcc-4.5.4\bin64"
| in the beginning of my PATH variable.

Your compilation step works, your linking step fails. There seems to be some
confusion between the versions, are you mixing 32 and 64 bit by chance?

Look closely at the errors: you have the 64 bit tools complaining that they
find only (ill-suiting) 32 bit libs.  Maybe you built Rcpp only in 32 bits or
something? 

Dirk
  
| Sorry for the error dump, but I am just lost now.  But aside from building the
| package I am making great strides in using Rcpp and have built some cool (to me
| at least) stuff, so that's great.
| Jared P. Lander
| http://www.jaredlander.com
| 
| 
| 
| On Fri, Jan 20, 2012 at 4:15 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
| 
| 
|     On 20 January 2012 at 15:57, Jared Lander wrote:
|     | Replies are inline.
| 
|     Likewise but I'll chop some dead wood too.
| 
|     | On Thu, Jan 19, 2012 at 2:31 PM, Dirk Eddelbuettel <edd at debian.org>
|     wrote:
|     |
|     |     Lastly, the very question 'how do I use "R CMD SHLIB"' has its own
|     entry in
|     |     the Rcpp-FAQ vignette.
|     |
|     | I get that package skeleton is meant for R CMD INSTALL.  But while
|     testing
|     | individual files I use R CMD SHLIB, which depending on the directory I am
|     | calling it from sometimes works and sometimes doesn't.  And this isn't
|     a path
|     | issue as I the problem occurs based on how deep in subdirectories I
|     go. 
| 
|     Ok. It simply is harder because of the need for the env vars.
| 
|     |     | "The filename, directory name, or volume label syntax is
|     incorrect."
|     |
|     |     Never seen this "The filename, directory name, or volume label
|     syntax is
|     |     incorrect."
|     |     Where does it come from?
|     |
|     |  No clue where that is coming from.  That's the error given when trying
|     to
|     | run R CMD SHLIB.
| 
|     Odd. I have seen (and suppressed) the recent Cygwin noise.
| 
|     I wonder if there is something in your path that messes this up.  Recall
|     the
|     dire warning in the R-windows FAQ to make sure that Rtools et al come
|     first.
| 
|     |     The linker tells you it doesn't find the Rcpp library.
|     |
|     | What could be causing that?  I did export PKG_LIBS=`Rscript -e
|     | "RCPP:::LdFlags()"` and export PKG_CXXFLAGS=`Rscript -e "Rcpp:::CxxFlags
|     ()"`.
| 
|     Not sure. "Works for me and other" as they say.
| 
|     | I will try again with another package and try on a Mac I have to see if
|     that
|     | helps me out.
| 
|     Sounds good.  In general, this works.  Windows is by far the most tedious
|     platform but it should work even here.
|    
|     Dirk
|    
|     --
|     "Outside of a dog, a book is a man's best friend. Inside of a dog, it is
|     too
|     dark to read." -- Groucho Marx
| 
| 

-- 
"Outside of a dog, a book is a man's best friend. Inside of a dog, it is too
dark to read." -- Groucho Marx


More information about the Rcpp-devel mailing list