[Rcpp-devel] Advice on installing CHOLMOD/Suitesparse
Douglas Bates
bates at stat.wisc.edu
Wed Aug 29 23:43:46 CEST 2012
On Wed, Aug 29, 2012 at 4:42 PM, Douglas Bates <bates at stat.wisc.edu> wrote:
> On Wed, Aug 29, 2012 at 4:32 PM, Rodney Sparapani <rsparapa at mcw.edu> wrote:
>> Hi Gang:
>>
>> I have been using CHOLMOD/Suitesparse, but I'm having an issue
>> coaxing RcppEigen to see it. I have Matrix, inline, Rcpp and
>> RcppEigen installed as well as Suitesparse. But, when I run
You should not need to have Suitesparse installed. All the
Suitesparse code that is used in RcppEigen is included in the Matrix
package.
>> this simple program (that works with Rcpp alone)...
>>
>> require(inline)
>> require(Rcpp)
>> require(RcppEigen)
>>
>> N <- 100
>> p <- 3
>> q <- 10
>>
>> data <- list(X=matrix(NA, N, p), Z=matrix(NA, N, q),
>> t=double(N), y=double(N), v1=integer(N), v2=integer(N),
>> c=integer(N))
>>
>> par.info <- list(beta=list(init=0., prior=list(mean=0., prec=0.001)),
>> mu=list(init=c(0., 0.),
>> prior=list(mean=c(0., 0.), prec=diag(0.001, 2))),
>> theta=list(init=c(rep(0., ncol(data$X)),
>> rep(1., ncol(data$Z)),
>> rep(0., ncol(data$X))),
>> prior=list(mean=rep(0., ncol(data$Z)+2*ncol(data$X)),
>> prec=diag(0.001, ncol(data$Z)+2*ncol(data$X))))
>> )
>>
>> src <- '
>> List list(arg1), beta=list["beta"], mu=list["mu"],
>> theta=list["theta"];
>>
>> return theta["init"];
>> '
>>
>> check1 <- cxxfunction(signature(arg1="list"), src, #plugin="Rcpp")
>> plugin="RcppEigen")
>>
>> I get...
>> In file included from
>> /opt/local/lib64/R/library/RcppEigen/include/RcppEigenForward.h:31,
>> from
>> /opt/local/lib64/R/library/RcppEigen/include/RcppEigen.h:25,
>> from file7289313ed735.cpp:3:
>> /opt/local/include/Eigen/CholmodSupport:9:23: error: cholmod.h: No such file or directory
>
> Perhaps you have an out-of-date version of the RcppEigen package (or
> maybe the Mac version hasn't been built or ...). In any case
> RcppEigenForward should include RcppEigenCholmod.h, not cholmod.h and
> the correct version would be at
> /opt/local/lib64/R/library/RcppEigen/include/RcppEigenCholmod.h
>
>> make: *** [file7289313ed735.o] Error 1
>>
>> ERROR(s) during compilation: source code errors or compiler configuration
>> errors!
>>
>> Program source:
>> 1:
>> 2: // includes from the plugin
>> 3: #include <RcppEigen.h>
>> 4: #include <Rcpp.h>
>> 5:
>> 6:
>> 7: #ifndef BEGIN_RCPP
>> 8: #define BEGIN_RCPP
>> 9: #endif
>> 10:
>> 11: #ifndef END_RCPP
>> 12: #define END_RCPP
>> 13: #endif
>> 14:
>> 15: using namespace Rcpp;
>> 16:
>> 17:
>> 18: // user includes
>> 19:
>> 20:
>> 21: // declarations
>> 22: extern "C" {
>> 23: SEXP file7289313ed735( SEXP arg1) ;
>> 24: }
>> 25:
>> 26: // definition
>> 27:
>> 28: SEXP file7289313ed735( SEXP arg1 ){
>> 29: BEGIN_RCPP
>> 30:
>> 31: List list(arg1), beta=list["beta"], mu=list["mu"],
>> 32: theta=list["theta"];
>> 33:
>> 34: return theta["init"];
>> 35:
>> 36: END_RCPP
>> 37: }
>> 38:
>> 39:
>> Error in compileCode(f, code, language = language, verbose = verbose) :
>> Compilation ERROR, function(s)/method(s) not created! In file included
>> from /opt/local/lib64/R/library/RcppEigen/include/RcppEigenForward.h:31,
>> from
>> /opt/local/lib64/R/library/RcppEigen/include/RcppEigen.h:25,
>> from file7289313ed735.cpp:3:
>> /opt/local/include/Eigen/CholmodSupport:9:23: error: cholmod.h: No such file
>> or directory
>> make: *** [file7289313ed735.o] Error 1
>> In addition: Warning message:
>> running command '/opt/local/lib64/R/bin/R CMD SHLIB file7289313ed735.cpp 2>
>> file7289313ed735.cpp.err.txt' had status 1
>>
>> So, I'm wondering... Where does RcppEigen expect to see cholmod.h?
>> Perhaps, I should re-install RcppEigen from source rather than from
>> CRAN. Or possibly install Suitesparse from source in either
>> /usr/local, or preferably, /opt/local? What works for other? Thanks
>>
>> Compiler Settings:
>> CC="gcc"
>> CFLAGS="-g"
>> CXX="g++"
>> CXXFLAGS="-g"
>> CPP=""
>> CPPFLAGS="-I/opt/local/include"
>> LDFLAGS="-L/opt/local/lib64 -Wl,-rpath -Wl,/opt/local/lib64"
>> LIBS=""
>> PKG_CONFIG_PATH="/opt/local/lib64/pkgconfig"
>> F77="gfortran"
>> FFLAGS="-g -ff2c"
>> FC="gfortran"
>> FCFLAGS=""
>>
>> sessionInfo()
>> R version 2.14.2 (2012-02-29)
>> Platform: x86_64-unknown-linux-gnu (64-bit)
>>
>> locale:
>> [1] LC_CTYPE=en_US.ISO8859-1 LC_NUMERIC=C
>> [3] LC_TIME=en_US.ISO8859-1 LC_COLLATE=en_US.ISO8859-1
>> [5] LC_MONETARY=en_US.ISO8859-1 LC_MESSAGES=en_US.ISO8859-1
>> [7] LC_PAPER=C LC_NAME=C
>> [9] LC_ADDRESS=C LC_TELEPHONE=C
>> [11] LC_MEASUREMENT=en_US.ISO8859-1 LC_IDENTIFICATION=C
>>
>> attached base packages:
>> [1] stats graphics grDevices utils datasets methods base
>>
>> other attached packages:
>> [1] RcppEigen_0.2.0 Rcpp_0.9.10 inline_0.3.8
>>
>> loaded via a namespace (and not attached):
>> [1] compiler_2.14.2 grid_2.14.2 lattice_0.20-6 Matrix_1.0-5
>> [5] tools_2.14.2
>>
>> yum install suitesparse
>> Loaded plugins: auto-update-debuginfo, refresh-packagekit, rhnplugin
>> Setting up Install Process
>> Package suitesparse-3.4.0-2.el6.x86_64 already installed and latest version
>> Nothing to do
>>
>> --
>> Rodney Sparapani, PhD Center for Patient Care and Outcomes Research
>> Sr. Biostatistician http://www.mcw.edu/pcor
>> 4 wheels good, 2 wheels better! Medical College of Wisconsin (MCW)
>> WWLD?: What Would Lombardi Do? Milwaukee, WI, USA
>> _______________________________________________
>> Rcpp-devel mailing list
>> Rcpp-devel at lists.r-forge.r-project.org
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
More information about the Rcpp-devel
mailing list