Nick Matzke
2011-Oct-25 21:11 UTC
[R] Installing rgeos on Mac OS X 10.4 (was Re: "package 'stringr' does not have a name space"
I figured it out, at least enough to get rgeos's gSimplify function to work, which was my original goal; the stringr problem was with 0.2, however I got stringr 0.5 to install by changing the minimum version in DESCRIPTION from R2.11 to R 2.10. ... Thanks for the help! ############# # This is how I got rgeos to install in R GUI on my Intel Mac OS X 10.4: ############# # stringr download source 0.5 from CRAN # change DESCRIPTION, change R 2.11 to R 2.10 # install with: install.packages("/Users/nick/Desktop/downloads/stringr", "/Library/Frameworks/R.framework/Resources/library/", NULL, type='source') # Update sp to 0.9-91 (manual download from CRAN; my default server didn't have it) remove.packages("sp") install.packages("/Users/nick/Desktop/downloads/sp_0.9-91.tar.gz", "/Library/Frameworks/R.framework/Resources/library/", NULL, type='source') # Manual install of GEOS 3.3 # Download GEOS 3.3 from: http://www.kyngchaos.com/macosx/build/geos http://trac.osgeo.org/geos/ ./configure make sudo make install # This installs to /usr/local/bin/geo-config which is an input to the rgeos install # To find, in Terminal type: locate geos-config # I got a crash based on a missing definition of GEOSUnaryUnion_r, so... # To get rgeos to install, # delete from rgeos_topology.c this bit (line 33): ===============================#ifdef HAVEUNARYUNION SEXP rgeos_unaryunion(SEXP env, SEXP obj, SEXP id, SEXP byid ) { return( rgeos_topologyfunc(env, obj, id, byid, &GEOSUnaryUnion_r) ); } #endif =============================== # And this from line 35 of init.c ===============================#ifdef HAVEUNARYUNION {"rgeos_unaryunion", (DL_FUNC) &rgeos_unaryunion, 4}, #endif =============================== # Then remove failed installs if any remove.packages("rgeos") install.packages("/Users/nick/Desktop/downloads/rgeos", "/Library/Frameworks/R.framework/Resources/library/", NULL, type='source', configure.args="--with-geos-config=/usr/local/bin/geos-config") library(rgeos) # (You may have to remove old .o and .so files from previous install attempts...) On 10/25/11 1:09 PM, Nick Matzke wrote:> Hi all, > > I have almost gotten rgeos to install, however I'm getting a > peculiar error about a (successfully installed) other > package, stringr: > > "Error : package 'stringr' does not have a name space" > > I have asked the r-sig-geo list, but this error looks like a > more generic one, perhaps there is some simple command I > could add to stringr to get the namespace correct? > > Any ideas much appreciated! > > Cheers, > Nick > > > PS Full error message below...yes, I'm still on Intel Mac OS > X 10.4 and thus R 2.10.1, can't be helped at the moment... > > ========================================> > sessionInfo() > R version 2.10.1 (2009-12-14) > i386-apple-darwin8.11.1 > > locale: > [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 > > attached base packages: > [1] stats grDevices utils datasets graphics methods base > > other attached packages: > [1] stringr_0.2 plyr_0.1.9 > > loaded via a namespace (and not attached): > [1] tools_2.10.1 > > >> install.packages("/Users/nick/Desktop/downloads/rgeos", > "/Library/Frameworks/R.framework/Resources/library/", NULL, > type='source', > + > configure.args="--with-geos-config=/usr/local/bin/geos-config") > WARNING: ignoring environment value of R_HOME > Loading ~/.Rprofile... > Currently viewed PATH: > /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/Applications/dssp:/Library/Frameworks/PROJ.framework/:/Library/Frameworks/PROJ.framework/Programs:/Library/Frameworks/PROJ.framework/Versions/4.6/Headers:/Library/Frameworks/GDAL.framework/Versions/1.6/Programs:/usr/texbin:/Applications/dssp:/Library/Frameworks/PROJ.framework/:/Library/Frameworks/PROJ.framework/Programs:/Library/Frameworks/PROJ.framework/Versions/4.6/Headers:/Library/Frameworks/GDAL.framework/Versions/1.6/Programs > > * installing *source* package ?rgeos? ... > geos-config: /usr/local/bin/geos-config > GEOS: 3.2.3 > CPPFLAGS: -DHAVEUNARYUNION -I/usr/local/include > LIBS: -L/usr/local/lib -lgeos > configure: creating ./config.status > config.status: creating src/Makevars > ** libs > ** arch - i386 > make: Nothing to be done for `all'. > ** R > ** inst > ** preparing package for lazy loading > Loading required package: plyr > Error : package 'stringr' does not have a name space > ERROR: lazy loading failed for package ?rgeos? > * removing > ?/Library/Frameworks/R.framework/Versions/2.10/Resources/library/rgeos? > > Warning message: > In install.packages("/Users/nick/Desktop/downloads/rgeos", > "/Library/Frameworks/R.framework/Resources/library/", : > installation of package > '/Users/nick/Desktop/downloads/rgeos' had non-zero exit status > > >-- ===================================================Nicholas J. Matzke Ph.D. Candidate, Graduate Student Researcher Huelsenbeck Lab Center for Theoretical Evolutionary Genomics 4151 VLSB (Valley Life Sciences Building) Department of Integrative Biology University of California, Berkeley Graduate Student Instructor, IB200B Principles of Phylogenetics: Ecology and Evolution http://ib.berkeley.edu/courses/ib200b/ http://phylo.wikidot.com/ Lab websites: http://ib.berkeley.edu/people/lab_detail.php?lab=54 http://fisher.berkeley.edu/cteg/hlab.html Dept. personal page: http://ib.berkeley.edu/people/students/person_detail.php?person=370 Lab personal page: http://fisher.berkeley.edu/cteg/members/matzke.html Lab phone: 510-643-6299 Dept. fax: 510-643-6264 Cell phone: 510-301-0179 Email: matzke at berkeley.edu Mailing address: Department of Integrative Biology 3060 VLSB #3140 Berkeley, CA 94720-3140 ----------------------------------------------------- "[W]hen people thought the earth was flat, they were wrong. When people thought the earth was spherical, they were wrong. But if you think that thinking the earth is spherical is just as wrong as thinking the earth is flat, then your view is wronger than both of them put together." Isaac Asimov (1989). "The Relativity of Wrong." The Skeptical Inquirer, 14(1), 35-44. Fall 1989. http://chem.tufts.edu/AnswersInScience/RelativityofWrong.htm