R calling user path to clang+llvm - r

how do we reset the paths that R uses to call clang:
When trying to compile R package from source I get the the following error:
* installing *source* package ‘sf’ ...
** package ‘sf’ successfully unpacked and MD5 sums checked
configure: CC: /Users/user_name/opt/clang+llvm-4.0.1-x86_64-apple-macosx10.9.0/bin/clang
configure: CXX: /Users/user_name/opt/clang+llvm-4.0.1-x86_64-apple-macosx10.9.0/bin/clang++
checking for gdal-config... /opt/local/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.2.4
checking GDAL version >= 2.0.0... yes
checking for gcc... /Users/user_name/opt/clang+llvm-4.0.1-x86_64-apple-macosx10.9.0/bin/clang
checking whether the C compiler works... no
configure: error: in `/private/var/folders/gk/2c8jpk7d63z66990tsly0wzr0000gn/T/RtmpCtBrqR/R.INSTALLb2c5342f3e/sf':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘sf’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/sf’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/sf’
Warning in install.packages :
installation of package ‘sf’ had non-zero exit status
In the 3rd line above it reads:
configure: CC: /Users/user_name/opt/clang+llvm-4.0.1-x86_64-apple-macosx10.9.0/bin/clang
It has a genertic name for account, how do we change this a real account name:
/Users/realaccountname/opt/clang+llvm-4.0.1-x86_64-apple-macosx10.9.0/bin/clang
P

Related

Cannot install Stringi for R (R-studio 1.1.456, OS X 10.15.2 Catalina)

I get the following error when trying to install stringi:
trying URL 'https://cran.rstudio.com/src/contrib/stringi_1.4.5.tar.gz'
Content type 'application/x-gzip' length 7284255 bytes (6.9 MB)
==================================================
downloaded 6.9 MB
* installing *source* package ‘stringi’ ...
** package ‘stringi’ successfully unpacked and MD5 sums checked
** using staged installation
checking for R_HOME... /Users/USER/Anaconda3/anaconda3/lib/R
checking for R... /Users/USER/Anaconda3/anaconda3/lib/R/bin/R
checking for endianness... little
checking for R >= 3.1.0 for C++11 use... yes
checking for R < 3.4.0 for CXX1X flag use... no
checking for cat... /bin/cat
checking for local ICUDT_DIR... icu61/data
checking for gcc... x86_64-apple-darwin13.4.0-clang
checking whether the C compiler works... no
configure: error: in `/private/var/folders/fy/d14lc6rd5nq827m06zkkb1_h0000gn/T/RtmpWRiuI3/R.INSTALL116de6e601bb4/stringi':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘stringi’
* removing ‘/Users/USER/Anaconda3/anaconda3/lib/R/library/stringi’
* restoring previous ‘/Users/USER/Anaconda3/anaconda3/lib/R/library/stringi’
Warning in install.packages :
installation of package ‘stringi’ had non-zero exit status
I have seen that this has been an issue in the past, eg. here where there is a clash with Makevars, but I don't have Makevars installed so that cannot be it. (I tried to install the package as a binary but got: "package ‘stringi’ is available as a source package but not as a binary").
Thanks!
Edit: I changed the title to install from update. The package was somehow removed and now I can't install it, or run rmarkdown...

Unable to install warbleR package using Mac OS

When trying to install the warbleR package, I keep getting this error message:
> install.packages("warbleR")
also installing the dependency ‘bioacoustics’
There is a binary version available but the source version is later:
binary source needs_compilation
warbleR 1.1.14 1.1.15 FALSE
Package which is only available in source form, and may need compilation of C/C++/Fortran:
‘bioacoustics’
Do you want to attempt to install these from sources? (Yes/no/cancel) Yes
installing the source packages ‘bioacoustics’, ‘warbleR’
trying URL 'https://cran.rstudio.com/src/contrib/bioacoustics_0.1.5.tar.gz'
Content type 'application/x-gzip' length 834645 bytes (815 KB)
==================================================
downloaded 815 KB
trying URL 'https://cran.rstudio.com/src/contrib/warbleR_1.1.15.tar.gz'
Content type 'application/x-gzip' length 2348150 bytes (2.2 MB)
==================================================
downloaded 2.2 MB
* installing *source* package ‘bioacoustics’ ...
** package ‘bioacoustics’ successfully unpacked and MD5 sums checked
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ -std=gnu++11 accepts -g... yes
configure: CXX: clang++ -std=gnu++11
checking for cmake... not found
configure: error: Could not find cmake
ERROR: configuration failed for package ‘bioacoustics’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/bioacoustics’
Warning in install.packages :
installation of package ‘bioacoustics’ had non-zero exit status
ERROR: dependency ‘bioacoustics’ is not available for package ‘warbleR’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/warbleR’
Warning in install.packages :
installation of package ‘warbleR’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/z9/6d_1kkxd0jxcj0r88hng7crm0000gn/T/RtmpSUXFDU/downloaded_packages’
>
As #neilfws pointed out, this could be solved with homebrew running brew install cmake.

More trouble Installing rgdal on ubuntu 16.04

This problem installing rgdal is not resolved in other similar questions already posted. I installed gdal using the advice on http://www.sarasafavi.com/installing-gdalogr-on-ubuntu.html and also decribed in other answers like this trouble in installing rgdal on ubuntu 16.04 that means from ppa:ubuntugis.
Then when I try to install rgdal the following error appears
> install.packages("rgdal")
Installing package into ‘/home/leonardo/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/rgdal_1.3-4.tar.gz'
Content type 'application/x-gzip' length 1664774 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: R_HOME: /usr/lib/R
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: C++11 support available
configure: rgdal: 1.3-4
checking for /usr/bin/svnversion... no
configure: svn revision: 766
checking for gdal-config... /home/leonardo/anaconda3/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.2.2
checking GDAL version >= 1.11.4... yes
checking gdal: linking with --libs only... no
checking gdal: linking with --libs and --dep-libs... no
/usr/bin/x86_64-linux-gnu-ld: warning: libproj.so.12, needed by /home/leonardo/anaconda3/lib/libgdal.so, not found (try using -rpath or -rpath-link)
/usr/bin/x86_64-linux-gnu-ld: warning: libpoppler.so.71, needed by /home/leonardo/anaconda3/lib/libgdal.so, not found (try using -rpath or -rpath-link)
/usr/bin/x86_64-linux-gnu-ld: warning: libxerces-c-3.2.so, needed by /home/leonardo/anaconda3/lib/libgdal.so,
...
500 lines more
...
/home/leonardo/anaconda3/lib/libgeos_c.so: undefined reference to `geos::geom::PrecisionModel::PrecisionModel(double)'
collect2: error: ld returned 1 exit status
configure: Install failure: compilation and/or linkage problems.
configure: error: GDALAllRegister not found in libgdal.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/leonardo/R/x86_64-pc-linux-gnu-library/3.5/rgdal’
Warning in install.packages :
installation of package ‘rgdal’ had non-zero exit status
It seems to be a problem with python anaconda that I have previously installed, I removed the anaconda python gdal package using
conda remove gdal
But the problems persist
The only way to solve this was to completely remove anaconda installation, following the instructions on https://conda.io/docs/user-guide/install/linux.html#uninstalling-anaconda-or-miniconda with some minor modifications for ubuntu 16.04, you have to open a terminal and remove the anaconda install directory:
rm -rf ~/anaconda3
rm -rf ~/.condarc ~/.conda ~/.continuum
Edit ~/.bashrc to remove the anaconda directory from your PATH environment variable.
After that the installation of rgdal
install.packages("rgdal")
goes without problems.

Cannot install packages to R after brew install

I've spent about an hour trying to debug this, but I think it's best to assume I haven't tried anything except brew install r and install.packages("tidycensus") and a few other packages to check if it was tidycensus specifically.
Let me know if there's any information I can provide. I recently wiped the hard drive of my fairly new Mac and started fresh.
The output of install.packages("tidycensus"):
> install.packages("tidycensus")
Installing package into ‘/usr/local/lib/R/3.5/site-library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘rgdal’, ‘sf’, ‘tigris’, ‘units’
trying URL 'https://cloud.r-project.org/src/contrib/rgdal_1.3-4.tar.gz'
Content type 'application/x-gzip' length 1664774 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
trying URL 'https://cloud.r-project.org/src/contrib/sf_0.6-3.tar.gz'
Content type 'application/x-gzip' length 7973054 bytes (7.6 MB)
==================================================
downloaded 7.6 MB
trying URL 'https://cloud.r-project.org/src/contrib/tigris_0.7.tar.gz'
Content type 'application/x-gzip' length 72980 bytes (71 KB)
==================================================
downloaded 71 KB
trying URL 'https://cloud.r-project.org/src/contrib/units_0.6-0.tar.gz'
Content type 'application/x-gzip' length 912393 bytes (891 KB)
==================================================
downloaded 891 KB
trying URL 'https://cloud.r-project.org/src/contrib/tidycensus_0.4.6.tar.gz'
Content type 'application/x-gzip' length 1615516 bytes (1.5 MB)
==================================================
downloaded 1.5 MB
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: R_HOME: /usr/local/Cellar/r/3.5.1/lib/R
configure: CC: clang
configure: CXX: clang++
configure: C++11 support available
configure: rgdal: 1.3-4
checking for /usr/bin/svnversion... yes
configure: svn revision: 766
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/usr/local/lib/R/3.5/site-library/rgdal’
* installing *source* package ‘units’ ...
** package ‘units’ successfully unpacked and MD5 sums checked
configure: units: 0.6-0
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking how to run the C++ preprocessor... clang++ -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdbool.h that conforms to C99... no
checking for _Bool... no
checking for error_at_line... no
checking for gcc... clang
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... yes
checking udunits2.h usability... no
checking udunits2.h presence... no
checking for udunits2.h... no
checking udunits2/udunits2.h usability... no
checking udunits2/udunits2.h presence... no
checking for udunits2/udunits2.h... no
checking for ut_read_xml in -ludunits2... no
configure: error: in `/private/var/folders/69/wy4n7cc10n5fg5_bc8glmms80000gn/T/RtmpPtsVPP/R.INSTALLf8694f0bf387/units':
configure: error:
--------------------------------------------------------------------------------
libudunits2.so not found!
If the udunits2 library is installed in a non-standard location, use:
--configure-args='--with-udunits2-lib=/usr/local/lib'
for example, if the library was not found, and/or
--configure-args='--with-udunits2-include=/usr/include/udunits2'
if the header was not found, replacing paths with appropriate values for your
installation. You can alternatively use the UDUNITS2_INCLUDE and UDUNITS2_LIBS
environment variables.
If udunits2 is not installed, please install it.
It is required for this package.
--------------------------------------------------------------------------------
See `config.log' for more details
ERROR: configuration failed for package ‘units’
* removing ‘/usr/local/lib/R/3.5/site-library/units’
ERROR: dependency ‘units’ is not available for package ‘sf’
* removing ‘/usr/local/lib/R/3.5/site-library/sf’
ERROR: dependencies ‘rgdal’, ‘sf’ are not available for package ‘tigris’
* removing ‘/usr/local/lib/R/3.5/site-library/tigris’
ERROR: dependencies ‘sf’, ‘tigris’, ‘units’ are not available for package ‘tidycensus’
* removing ‘/usr/local/lib/R/3.5/site-library/tidycensus’
The downloaded source packages are in
‘/private/var/folders/69/wy4n7cc10n5fg5_bc8glmms80000gn/T/Rtmp8iit6a/downloaded_packages’
Warning messages:
1: In install.packages("tidycensus") :
installation of package ‘rgdal’ had non-zero exit status
2: In install.packages("tidycensus") :
installation of package ‘units’ had non-zero exit status
3: In install.packages("tidycensus") :
installation of package ‘sf’ had non-zero exit status
4: In install.packages("tidycensus") :
installation of package ‘tigris’ had non-zero exit status
5: In install.packages("tidycensus") :
installation of package ‘tidycensus’ had non-zero exit status
> install.packages('tidycensus')
Installing package into ‘/usr/local/lib/R/3.5/site-library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘rgdal’, ‘sf’, ‘tigris’, ‘units’
trying URL 'https://cloud.r-project.org/src/contrib/rgdal_1.3-4.tar.gz'
Content type 'application/x-gzip' length 1664774 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
trying URL 'https://cloud.r-project.org/src/contrib/sf_0.6-3.tar.gz'
Content type 'application/x-gzip' length 7973054 bytes (7.6 MB)
==================================================
downloaded 7.6 MB
trying URL 'https://cloud.r-project.org/src/contrib/tigris_0.7.tar.gz'
Content type 'application/x-gzip' length 72980 bytes (71 KB)
==================================================
downloaded 71 KB
trying URL 'https://cloud.r-project.org/src/contrib/units_0.6-0.tar.gz'
Content type 'application/x-gzip' length 912393 bytes (891 KB)
==================================================
downloaded 891 KB
trying URL 'https://cloud.r-project.org/src/contrib/tidycensus_0.4.6.tar.gz'
Content type 'application/x-gzip' length 1615516 bytes (1.5 MB)
==================================================
downloaded 1.5 MB
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: R_HOME: /usr/local/Cellar/r/3.5.1/lib/R
configure: CC: clang
configure: CXX: clang++
configure: C++11 support available
configure: rgdal: 1.3-4
checking for /usr/bin/svnversion... yes
configure: svn revision: 766
checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/usr/local/lib/R/3.5/site-library/rgdal’
* installing *source* package ‘units’ ...
** package ‘units’ successfully unpacked and MD5 sums checked
configure: units: 0.6-0
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking how to run the C++ preprocessor... clang++ -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdbool.h that conforms to C99... no
checking for _Bool... no
checking for error_at_line... no
checking for gcc... clang
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... yes
checking udunits2.h usability... no
checking udunits2.h presence... no
checking for udunits2.h... no
checking udunits2/udunits2.h usability... no
checking udunits2/udunits2.h presence... no
checking for udunits2/udunits2.h... no
checking for ut_read_xml in -ludunits2... no
configure: error: in `/private/var/folders/69/wy4n7cc10n5fg5_bc8glmms80000gn/T/RtmpuOGf6j/R.INSTALLfdd5361d965a/units':
configure: error:
--------------------------------------------------------------------------------
libudunits2.so not found!
If the udunits2 library is installed in a non-standard location, use:
--configure-args='--with-udunits2-lib=/usr/local/lib'
for example, if the library was not found, and/or
--configure-args='--with-udunits2-include=/usr/include/udunits2'
if the header was not found, replacing paths with appropriate values for your
installation. You can alternatively use the UDUNITS2_INCLUDE and UDUNITS2_LIBS
environment variables.
If udunits2 is not installed, please install it.
It is required for this package.
--------------------------------------------------------------------------------
See `config.log' for more details
ERROR: configuration failed for package ‘units’
* removing ‘/usr/local/lib/R/3.5/site-library/units’
ERROR: dependency ‘units’ is not available for package ‘sf’
* removing ‘/usr/local/lib/R/3.5/site-library/sf’
ERROR: dependencies ‘rgdal’, ‘sf’ are not available for package ‘tigris’
* removing ‘/usr/local/lib/R/3.5/site-library/tigris’
ERROR: dependencies ‘sf’, ‘tigris’, ‘units’ are not available for package ‘tidycensus’
* removing ‘/usr/local/lib/R/3.5/site-library/tidycensus’
The downloaded source packages are in
‘/private/var/folders/69/wy4n7cc10n5fg5_bc8glmms80000gn/T/Rtmp8iit6a/downloaded_packages’
Warning messages:
1: In install.packages("tidycensus") :
installation of package ‘rgdal’ had non-zero exit status
2: In install.packages("tidycensus") :
installation of package ‘units’ had non-zero exit status
3: In install.packages("tidycensus") :
installation of package ‘sf’ had non-zero exit status
4: In install.packages("tidycensus") :
installation of package ‘tigris’ had non-zero exit status
5: In install.packages("tidycensus") :
installation of package ‘tidycensus’ had non-zero exit status
Worked fine for me. Possible solutions:
Check that you have ggplot installed via github install_github("tidyverse/ggplot2")
Confirm that your R-Version is ≥ 3.3.0
Install package via github install_github("walkerke/tidycensus")
Check other dependencies
My problem was that I had a few stray python3 config files floating around after a non-brew install of python3. I removed python3 and reinstalled with brew.
My recommendation to users having the same problem is to run brew doctor. If you are having the same problem I was, your python3 config files will be displayed as issues, and you can uninstall python3 and reinstall it with brew install python3.
I then had a few dependencies I had to work through, some in R, and some in brew.
#comfort eagle 's suggestion of using install_github() after installing and importing devtools was also helpful.

Unable to install rgdal and rgeos R libraries on Red hat linux

I have error while compiling rgdal adn rgoes package on our redhat linux machine. I tried to do some research but couldn't find a possible solution. Could you please help me with this as this is very important for me to solve.
**ERROR WHILE COMPILING RGDAL in R 3.0**
**strong text**
* installing *source* package ârgdalâ ...
** package ârgdalâ successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: rgdal: 0.8-10
checking for /usr/bin/svnversion... yes
configure: svn revision: 496
configure: gdal-config: gdal-config
checking gdal-config usability... ./configure: line 1397: gdal-config: command not found
no
Error: gdal-config not found
The gdal-config script distributed with GDAL could not be found.
If you have not installed the GDAL libraries, you can
download the source from http://www.gdal.org/
If you have installed the GDAL libraries, then make sure that
gdal-config is in your path. Try typing gdal-config at a
shell prompt and see if it runs. If not, use:
--configure-args='--with-gdal-config=/usr/local/bin/gdal-config'
with appropriate values for your installation.
ERROR: configuration failed for package ârgdalâ
*****ERROR WHILE COMPILING RGEOS:*****
**strong text**
* installing *source* package ârgeosâ ...
** package ârgeosâ successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: rgeos: 0.2-17
checking for /usr/bin/svnversion... yes
configure: svn revision: 413M
checking geos-config usability... ./configure: line 1385: geos-config: command not found
no
configure: error: geos-config not usable
ERROR: configuration failed for package ârgeosâ
On fedora 20 you need to install geos and geos-devel !
sudo yum install geos geos-devel
After that the compilation in R work well!
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (gstat)
The downloaded source packages are in
‘/tmp/Rtmp9ciIzG/downloaded_packages’
I'm not on redhat (I'm on Ubuntu) so someone who is may be able to give better package names.. . But, when installing packages from source, you need the dev of the required libraries. In this case, you probably need to install:
libgdal1-dev
libgeos-dev
So:
yum install libgdal1 libgdal1-dev libgeos libgeos-dev
Then in R:
install.packages('gdal')
this is untested, since I don't want all the extra packages associated with those two!

Resources