Re: [Rcpp-devel] r-forge error: undefined symbol: zgetri_
On 20 August 2010 22:33, Douglas Bates ba...@stat.wisc.edu wrote: On Fri, Aug 20, 2010 at 12:35 PM, baptiste auguie baptiste.aug...@googlemail.com wrote: Hi, On 20 August 2010 19:09, Romain Francois rom...@r-enthusiasts.com wrote: Le 20/08/10 16:07, Dirk Eddelbuettel a écrit : On 20 August 2010 at 09:41, baptiste auguie wrote: | Indeed, I had forgotten to rerun roxygen before my last commit, sorry. | It should be OK now. | | I've also put the source tarball from R CMD BUILD here, | | http://dl.dropbox.com/u/352834/cda_1.0.tar.gz This works for me on Ubuntu 10.4 / amd64 once I drop the Depends: on the package constants which is not on CRAN: e...@max:/tmp/cda$ R CMD INSTALL . * installing to library ‘/usr/local/lib/R/site-library’ * installing *source* package ‘cda’ ... ** libs g++ -I/usr/share/R/include -I/usr/local/lib/R/site-library/Rcpp/include -I/usr/local/lib/R/site-library/RcppArmadillo/include -fpic -O3 -g0 -Wall -pipe -c cda.cpp -o cda.o cda.cpp: In function ‘int progress_bar(double, double)’: cda.cpp:36: warning: no return statement in function returning non-void cda.cpp: In function ‘Rcpp::List linearExtinction(const arma::mat, const arma::cx_mat, double)’: cda.cpp:285: warning: unused variable ‘pi’ g++ -shared -o cda.so cda.o -L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp -Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib -llapack -lblas -lgfortran -lm -L/usr/lib64/R/lib -lR installing to /usr/local/lib/R/site-library/cda/libs ** R ** inst ** preparing package for lazy loading Loading required package: reshape Loading required package: plyr Loading required package: grid Loading required package: proto ** help *** installing help indices ** building package indices ... ** testing if installed package can be loaded * DONE (cda) e...@max:/tmp/cda$ r -lcda -e'cat(Hello cda world\n)' Hello cda world e...@max:/tmp/cda$ FWIW on Debian and Ubuntu R uses external lapack and blas libraries. Dirk That is also why it works on OSX, because here we are using the vecLib framework for blas and lapack. Thank you all for investigating the matter. So you are left with a few options : - don't call inv on your complex matrix i do need this, I feel it would be a waste to convert the matrix back to R format, invert it with R facilities, and then convert it back for Armadillo... On many occasions where people think that they need to calculate a matrix inverse they don't really need to do so. For example you don't need to calculate the inverse explicitly if all you are going to do is to solve a linear system of equations. True, on many occasions. In this particular case, I have to solve many times (typically more than 400 times) the system Ax = b, with different right-hand side b. I haven't checked objectively, but my guess was that calculating the inverse once was to be more efficient than solving the 400 linear systems. It may depend on the size of the matrix, etc. Best, baptiste - negociate with R-core that they include missing lapack bits I wouldn't even know what's missing and where. - write a package that supplies these bits Same here. I'm afraid there is nothing we can really do. That's OK, thankfully it works on the only platform(s) I use. A shame that I can't easily share this work with others though. Thanks, baptiste Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/bzoWrs : Rcpp svn revision 2000 |- http://bit.ly/b8VNE2 : Rcpp at LondonR, oct 5th `- http://bit.ly/aAyra4 : highlight 0.2-2 -- Dr. Baptiste Auguié Departamento de Química Física, Universidade de Vigo, Campus Universitario, 36310, Vigo, Spain tel: +34 9868 18617 http://webs.uvigo.es/coloides ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel -- Dr. Baptiste Auguié Departamento de Química Física, Universidade de Vigo, Campus Universitario, 36310, Vigo, Spain tel: +34 9868 18617 http://webs.uvigo.es/coloides ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
Re: [Rcpp-devel] r-forge error: undefined symbol: zgetri_
Le 20/08/10 10:46, Romain Francois a écrit : Le 20/08/10 09:41, baptiste auguie a écrit : Indeed, I had forgotten to rerun roxygen before my last commit, sorry. It should be OK now. I've also put the source tarball from R CMD BUILD here, http://dl.dropbox.com/u/352834/cda_1.0.tar.gz Best regards, baptiste Ok. It installs and loads fine for me on OSX too. I'll try later on fedora to see what happens. Hmm. I get the same error now on fedora. ** testing if installed package can be loaded Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared library '/usr/local/lib/R/library/cda/libs/cda.so': /usr/local/lib/R/library/cda/libs/cda.so: undefined symbol: zgetri_ ERROR: loading failed * removing ‘/usr/local/lib/R/library/cda’ Is it possible that this is not included in R's lapack ? $ cd R-devel/src $ egrep -R [a-z]getri * include/R_ext/.svn/text-base/Lapack.h.svn-base:F77_NAME(dgetri)(const int* n, double* a, const int* lda, include/R_ext/Lapack.h:F77_NAME(dgetri)(const int* n, double* a, const int* lda, Romain On 20 August 2010 08:42, Romain Francoisrom...@r-enthusiasts.com wrote: Le 20/08/10 07:36, baptiste auguie a écrit : Hi, My Makevars contains the following line, ## Use the R_HOME indirection to support installations of multiple R version PKG_LIBS = $(shell $(R_HOME)/bin/Rscript -e Rcpp:::LdFlags() ) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) That looks ok. I can't R CMD INSTALL your package now because of something else. Some collate issue of the R files, is this a roxygen issue by any chance ? But the compile step -- apart from some minor problems I'm sure you'll fix -- seem fine : $ R CMD INSTALL cda * installing to library ‘/Library/Frameworks/R.framework/Resources/library’ * installing *source* package ‘cda’ ... ** libs *** arch - i386 g++ -arch i386 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/i386 -I/usr/local/include -I/Library/Frameworks/R.framework/Resources/library/Rcpp/include -I/Library/Frameworks/R.framework/Resources/library/RcppArmadillo/include -fPIC -g -O3 -Wall -pipe -c cda.cpp -o cda.o cda.cpp: In function ‘int progress_bar(double, double)’: cda.cpp:36: warning: no return statement in function returning non-void cda.cpp: In function ‘Rcpp::List linearExtinction(const arma::mat, const arma::cx_mat, double)’: cda.cpp:285: warning: unused variable ‘pi’ cda.cpp: In function ‘int progress_bar(double, double)’: cda.cpp:36: warning: control reaches end of non-void function g++ -arch i386 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -o cda.so cda.o /Library/Frameworks/R.framework/Versions/2.12/Resources/library/Rcpp/lib/i386/libRcpp.a -L/Library/Frameworks/R.framework/Resources/lib/i386 -lRlapack -L/Library/Frameworks/R.framework/Resources/lib/i386 -lRblas -lgfortran -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation installation dans /Library/Frameworks/R.framework/Resources/library/cda/libs/i386 *** arch - x86_64 g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -I/usr/local/include -I/Library/Frameworks/R.framework/Resources/library/Rcpp/include -I/Library/Frameworks/R.framework/Resources/library/RcppArmadillo/include -fPIC -g -O3 -Wall -pipe -c cda.cpp -o cda.o cda.cpp: In function ‘int progress_bar(double, double)’: cda.cpp:36: warning: no return statement in function returning non-void cda.cpp: In function ‘Rcpp::List linearExtinction(const arma::mat, const arma::cx_mat, double)’: cda.cpp:285: warning: unused variable ‘pi’ cda.cpp: In function ‘int progress_bar(double, double)’: cda.cpp:36: warning: control reaches end of non-void function g++ -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -o cda.so cda.o /Library/Frameworks/R.framework/Versions/2.12/Resources/library/Rcpp/lib/x86_64/libRcpp.a -L/Library/Frameworks/R.framework/Resources/lib/x86_64 -lRlapack -L/Library/Frameworks/R.framework/Resources/lib/x86_64 -lRblas -lgfortran -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation installation dans /Library/Frameworks/R.framework/Resources/library/cda/libs/x86_64 ** R Error in .install_package_code_files(., instdir) : les fichiers dans '/Users/romain/svn/photonics/pkg/cda/R' sont manquants dans le champ 'Collate' : povray.r ERROR: unable to collate files for package ‘cda’ * removing ‘/Library/Frameworks/R.framework/Resources/library/cda’ * restoring previous ‘/Library/Frameworks/R.framework/Resources/library/cda’ which I obviously took from somewhere, perhaps automatically generated from package.skeleton, I don't remember. Probably from RcppArmadillo.package.skeleton It's worked for me on two different machines (both Macs, though). Best regards,
Re: [Rcpp-devel] r-forge error: undefined symbol: zgetri_
Le 20/08/10 11:05, Romain Francois a écrit : Le 20/08/10 10:46, Romain Francois a écrit : Le 20/08/10 09:41, baptiste auguie a écrit : Indeed, I had forgotten to rerun roxygen before my last commit, sorry. It should be OK now. I've also put the source tarball from R CMD BUILD here, http://dl.dropbox.com/u/352834/cda_1.0.tar.gz Best regards, baptiste Ok. It installs and loads fine for me on OSX too. I'll try later on fedora to see what happens. Hmm. I get the same error now on fedora. ** testing if installed package can be loaded Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared library '/usr/local/lib/R/library/cda/libs/cda.so': /usr/local/lib/R/library/cda/libs/cda.so: undefined symbol: zgetri_ ERROR: loading failed * removing ‘/usr/local/lib/R/library/cda’ Is it possible that this is not included in R's lapack ? $ cd R-devel/src $ egrep -R [a-z]getri * include/R_ext/.svn/text-base/Lapack.h.svn-base:F77_NAME(dgetri)(const int* n, double* a, const int* lda, include/R_ext/Lapack.h:F77_NAME(dgetri)(const int* n, double* a, const int* lda, And also, on the mac : $ nm libRlapack.dylib | grep getri 00097920 T _dgetri_ and on fedora : $ nm libRlapack.so | grep getri 0009c510 T dgetri_ So, zgetri_ seems not to be there at all. Is this perhaps an extension to lapack, or is R not keeping of lapack, or ... Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/bzoWrs : Rcpp svn revision 2000 |- http://bit.ly/b8VNE2 : Rcpp at LondonR, oct 5th `- http://bit.ly/aAyra4 : highlight 0.2-2 ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
Re: [Rcpp-devel] r-forge error: undefined symbol: zgetri_
On 20 August 2010 at 09:41, baptiste auguie wrote: | Indeed, I had forgotten to rerun roxygen before my last commit, sorry. | It should be OK now. | | I've also put the source tarball from R CMD BUILD here, | | http://dl.dropbox.com/u/352834/cda_1.0.tar.gz This works for me on Ubuntu 10.4 / amd64 once I drop the Depends: on the package constants which is not on CRAN: e...@max:/tmp/cda$ R CMD INSTALL . * installing to library ‘/usr/local/lib/R/site-library’ * installing *source* package ‘cda’ ... ** libs g++ -I/usr/share/R/include -I/usr/local/lib/R/site-library/Rcpp/include -I/usr/local/lib/R/site-library/RcppArmadillo/include -fpic -O3 -g0 -Wall -pipe -c cda.cpp -o cda.o cda.cpp: In function ‘int progress_bar(double, double)’: cda.cpp:36: warning: no return statement in function returning non-void cda.cpp: In function ‘Rcpp::List linearExtinction(const arma::mat, const arma::cx_mat, double)’: cda.cpp:285: warning: unused variable ‘pi’ g++ -shared -o cda.so cda.o -L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp -Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib -llapack -lblas -lgfortran -lm -L/usr/lib64/R/lib -lR installing to /usr/local/lib/R/site-library/cda/libs ** R ** inst ** preparing package for lazy loading Loading required package: reshape Loading required package: plyr Loading required package: grid Loading required package: proto ** help *** installing help indices ** building package indices ... ** testing if installed package can be loaded * DONE (cda) e...@max:/tmp/cda$ r -lcda -e'cat(Hello cda world\n)' Hello cda world e...@max:/tmp/cda$ FWIW on Debian and Ubuntu R uses external lapack and blas libraries. Dirk -- Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
Re: [Rcpp-devel] r-forge error: undefined symbol: zgetri_
Le 20/08/10 16:07, Dirk Eddelbuettel a écrit : On 20 August 2010 at 09:41, baptiste auguie wrote: | Indeed, I had forgotten to rerun roxygen before my last commit, sorry. | It should be OK now. | | I've also put the source tarball from R CMD BUILD here, | | http://dl.dropbox.com/u/352834/cda_1.0.tar.gz This works for me on Ubuntu 10.4 / amd64 once I drop the Depends: on the package constants which is not on CRAN: e...@max:/tmp/cda$ R CMD INSTALL . * installing to library ‘/usr/local/lib/R/site-library’ * installing *source* package ‘cda’ ... ** libs g++ -I/usr/share/R/include -I/usr/local/lib/R/site-library/Rcpp/include -I/usr/local/lib/R/site-library/RcppArmadillo/include -fpic -O3 -g0 -Wall -pipe -c cda.cpp -o cda.o cda.cpp: In function ‘int progress_bar(double, double)’: cda.cpp:36: warning: no return statement in function returning non-void cda.cpp: In function ‘Rcpp::List linearExtinction(const arma::mat, const arma::cx_mat, double)’: cda.cpp:285: warning: unused variable ‘pi’ g++ -shared -o cda.so cda.o -L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp -Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib -llapack -lblas -lgfortran -lm -L/usr/lib64/R/lib -lR installing to /usr/local/lib/R/site-library/cda/libs ** R ** inst ** preparing package for lazy loading Loading required package: reshape Loading required package: plyr Loading required package: grid Loading required package: proto ** help *** installing help indices ** building package indices ... ** testing if installed package can be loaded * DONE (cda) e...@max:/tmp/cda$ r -lcda -e'cat(Hello cda world\n)' Hello cda world e...@max:/tmp/cda$ FWIW on Debian and Ubuntu R uses external lapack and blas libraries. Dirk That is also why it works on OSX, because here we are using the vecLib framework for blas and lapack. So you are left with a few options : - don't call inv on your complex matrix - negociate with R-core that they include missing lapack bits - write a package that supplies these bits I'm afraid there is nothing we can really do. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/bzoWrs : Rcpp svn revision 2000 |- http://bit.ly/b8VNE2 : Rcpp at LondonR, oct 5th `- http://bit.ly/aAyra4 : highlight 0.2-2 ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
Re: [Rcpp-devel] r-forge error: undefined symbol: zgetri_
On Fri, Aug 20, 2010 at 12:35 PM, baptiste auguie baptiste.aug...@googlemail.com wrote: Hi, On 20 August 2010 19:09, Romain Francois rom...@r-enthusiasts.com wrote: Le 20/08/10 16:07, Dirk Eddelbuettel a écrit : On 20 August 2010 at 09:41, baptiste auguie wrote: | Indeed, I had forgotten to rerun roxygen before my last commit, sorry. | It should be OK now. | | I've also put the source tarball from R CMD BUILD here, | | http://dl.dropbox.com/u/352834/cda_1.0.tar.gz This works for me on Ubuntu 10.4 / amd64 once I drop the Depends: on the package constants which is not on CRAN: e...@max:/tmp/cda$ R CMD INSTALL . * installing to library ‘/usr/local/lib/R/site-library’ * installing *source* package ‘cda’ ... ** libs g++ -I/usr/share/R/include -I/usr/local/lib/R/site-library/Rcpp/include -I/usr/local/lib/R/site-library/RcppArmadillo/include -fpic -O3 -g0 -Wall -pipe -c cda.cpp -o cda.o cda.cpp: In function ‘int progress_bar(double, double)’: cda.cpp:36: warning: no return statement in function returning non-void cda.cpp: In function ‘Rcpp::List linearExtinction(const arma::mat, const arma::cx_mat, double)’: cda.cpp:285: warning: unused variable ‘pi’ g++ -shared -o cda.so cda.o -L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp -Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib -llapack -lblas -lgfortran -lm -L/usr/lib64/R/lib -lR installing to /usr/local/lib/R/site-library/cda/libs ** R ** inst ** preparing package for lazy loading Loading required package: reshape Loading required package: plyr Loading required package: grid Loading required package: proto ** help *** installing help indices ** building package indices ... ** testing if installed package can be loaded * DONE (cda) e...@max:/tmp/cda$ r -lcda -e'cat(Hello cda world\n)' Hello cda world e...@max:/tmp/cda$ FWIW on Debian and Ubuntu R uses external lapack and blas libraries. Dirk That is also why it works on OSX, because here we are using the vecLib framework for blas and lapack. Thank you all for investigating the matter. So you are left with a few options : - don't call inv on your complex matrix i do need this, I feel it would be a waste to convert the matrix back to R format, invert it with R facilities, and then convert it back for Armadillo... On many occasions where people think that they need to calculate a matrix inverse they don't really need to do so. For example you don't need to calculate the inverse explicitly if all you are going to do is to solve a linear system of equations. - negociate with R-core that they include missing lapack bits I wouldn't even know what's missing and where. - write a package that supplies these bits Same here. I'm afraid there is nothing we can really do. That's OK, thankfully it works on the only platform(s) I use. A shame that I can't easily share this work with others though. Thanks, baptiste Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/bzoWrs : Rcpp svn revision 2000 |- http://bit.ly/b8VNE2 : Rcpp at LondonR, oct 5th `- http://bit.ly/aAyra4 : highlight 0.2-2 -- Dr. Baptiste Auguié Departamento de Química Física, Universidade de Vigo, Campus Universitario, 36310, Vigo, Spain tel: +34 9868 18617 http://webs.uvigo.es/coloides ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
Re: [Rcpp-devel] r-forge error: undefined symbol: zgetri_
On Thu, Aug 19, 2010 at 3:06 PM, baptiste auguie baptiste.aug...@googlemail.com wrote: Dear all, I'm stumped by this error for my cda package on r-forge: Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared library '/tmp/Rinst2710053821/cda/libs/cda.so': /tmp/Rinst2710053821/cda/libs/cda.so: undefined symbol: zgetri_ https://r-forge.r-project.org/R/?group_id=160log=build_srcpkg=cdaflavor=patched I don't have a clue what this means --- is this an incorrect dependency, an error in my C++ code, a known problem with r-forge, something I should have read in a vignette / manual ... ? It compiles fine on my machine (Mac OS 10.6). The package uses RcppArmadillo. The error means that there is a reference to one of the Lapack functions, zgetri, which forms the inverse of a complex matrix using its triangular factorization, and the symbol could not be found. What does your cda/src/Makevars file contain? ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
Re: [Rcpp-devel] r-forge error: undefined symbol: zgetri_
Hi, My Makevars contains the following line, ## Use the R_HOME indirection to support installations of multiple R version PKG_LIBS = $(shell $(R_HOME)/bin/Rscript -e Rcpp:::LdFlags() ) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) which I obviously took from somewhere, perhaps automatically generated from package.skeleton, I don't remember. It's worked for me on two different machines (both Macs, though). Best regards, baptiste On 19 August 2010 23:50, Douglas Bates ba...@stat.wisc.edu wrote: On Thu, Aug 19, 2010 at 3:06 PM, baptiste auguie baptiste.aug...@googlemail.com wrote: Dear all, I'm stumped by this error for my cda package on r-forge: Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared library '/tmp/Rinst2710053821/cda/libs/cda.so': /tmp/Rinst2710053821/cda/libs/cda.so: undefined symbol: zgetri_ https://r-forge.r-project.org/R/?group_id=160log=build_srcpkg=cdaflavor=patched I don't have a clue what this means --- is this an incorrect dependency, an error in my C++ code, a known problem with r-forge, something I should have read in a vignette / manual ... ? It compiles fine on my machine (Mac OS 10.6). The package uses RcppArmadillo. The error means that there is a reference to one of the Lapack functions, zgetri, which forms the inverse of a complex matrix using its triangular factorization, and the symbol could not be found. What does your cda/src/Makevars file contain? ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel