e1071 install R 3.1.2 - r

I am trying to install e1071 package in R 3.1.2. My system is linux 3.10.0-123.13.1.el7.x86_64. I tried to install from source with install.packages("e1071", type = "source"), but it did not help. Does anyone have suggestions?
* installing *source* package 'e1071' ...
** package 'e1071' successfully unpacked and MD5 sums checked
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
** libs
gcc -std=gnu99 -I/opt/local/stow/R-3.1.2/lib64/R/include -DNDEBUG -I/usr/local/include -fpic -g -O2 -c Rsvm.c -o Rsvm.o
gcc -std=gnu99 -I/opt/local/stow/R-3.1.2/lib64/R/include -DNDEBUG -I/usr/local/include -fpic -g -O2 -c cmeans.c -o cmeans.o
gcc -std=gnu99 -I/opt/local/stow/R-3.1.2/lib64/R/include -DNDEBUG -I/usr/local/include -fpic -g -O2 -c cshell.c -o cshell.o
gcc -std=gnu99 -I/opt/local/stow/R-3.1.2/lib64/R/include -DNDEBUG -I/usr/local/include -fpic -g -O2 -c floyd.c -o floyd.o
g++ -I/opt/local/stow/R-3.1.2/lib64/R/include -DNDEBUG -I/usr/local/include -fpic -g -O2 -c svm.cpp -o svm.o
In file included from /usr/include/stdio.h:934:0,
from /opt/local/stow/R-3.1.2/lib64/R/include/R.h:29,
from svm.cpp:1:
/usr/include/bits/stdio.h: In function '__ssize_t getline(char**, size_t*, FILE*)':
/usr/include/bits/stdio.h:117:52: error: '__getdelim' was not declared in this scope
make: *** [svm.o] Error 1
ERROR: compilation failed for package 'e1071'
Warning message:
In install.packages("e1071", dep = T) :
installation of package 'e1071' had non-zero exit status

Try
sudo yum install R-devel
or
sudo apt-get install R-devel
first

Related

Problem with installation of vegan package - cannot find -lgfortran

I was installing another package called vcfR where it says vegan is source package and needs to be installed, then it showed errors when installing. So I decided to install vegan package first.
This is an online R studio, the package I need to analyse is too big to be done on my laptop. The online R studio is by my school server, which was in-built in a ssh server account.
below is the error message:
Installing package into ‘/home/joyzheng/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/vegan_2.5-7.tar.gz'
Content type 'application/x-gzip' length 2074611 bytes (2.0 MB)
==================================================
downloaded 2.0 MB
* installing *source* package ‘vegan’ ...
** package ‘vegan’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -std=gnu99 -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -c data2hill.c -o data2hill.o
gfortran -fpic -g -O2 -c decorana.f -o decorana.o
gcc -std=gnu99 -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -c getF.c -o getF.o
gcc -std=gnu99 -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -c goffactor.c -o goffactor.o
gcc -std=gnu99 -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -c init.c -o init.o
gfortran -fpic -g -O2 -c monoMDS.f -o monoMDS.o
gcc -std=gnu99 -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -c nestedness.c -o nestedness.o
gfortran -fpic -g -O2 -c ordering.f -o ordering.o
gcc -std=gnu99 -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -c pnpoly.c -o pnpoly.o
gcc -std=gnu99 -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -c stepacross.c -o stepacross.o
gcc -std=gnu99 -I"/opt/R/4.0.3/lib/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -c vegdist.c -o vegdist.o
gcc -std=gnu99 -shared -L/opt/R/4.0.3/lib/R/lib -L/usr/local/lib -o vegan.so data2hill.o decorana.o getF.o goffactor.o init.o monoMDS.o nestedness.o ordering.o pnpoly.o stepacross.o vegdist.o -L/opt/R/4.0.3/lib/R/lib -lRlapack -L/opt/R/4.0.3/lib/R/lib -lRblas -lgfortran -lm -lquadmath -lgfortran -lm -lquadmath -L/opt/R/4.0.3/lib/R/lib -lR
/usr/bin/ld: cannot find -lgfortran
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
make: *** [vegan.so] Error 1
ERROR: compilation failed for package ‘vegan’
* removing ‘/home/joyzheng/R/x86_64-pc-linux-gnu-library/4.0/vegan’
Warning in install.packages :
installation of package ‘vegan’ had non-zero exit status```

Unable to install a package on R

I'm getting an issue when I try to install Bioconductor for R. I've searched everywhere for solutions however nothing is really working for me. Please, any advice?
The downloaded binary packages are in
/var/folders/74/y92tqhzj0l98l6syjjl7vtcr0000gn/T//RtmpNYOkbZ/downloaded_packages
Old packages: 'nlme'
Update all/some/none? [a/s/n]:
a
Warning: unable to access index for repository https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6:
cannot open URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/PACKAGES'
Package which is only available in source form, and may need compilation of
C/C++/Fortran: ‘nlme’
Do you want to attempt to install these from sources? (Yes/no/cancel) Yes
installing the source package ‘nlme’
trying URL 'https://cran.rstudio.com/src/contrib/nlme_3.1-144.tar.gz'
Content type 'application/x-gzip' length 778660 bytes (760 KB)
==================================================
downloaded 760 KB
* installing *source* package ‘nlme’ ...
** package ‘nlme’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran -fPIC -Wall -g -O2 -c chol.f -o chol.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c corStruct.c -o corStruct.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c gnls.c -o gnls.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c init.c -o init.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c matrix.c -o matrix.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c nlOptimizer.c -o nlOptimizer.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c nlme.c -o nlme.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c nlmefit.c -o nlmefit.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c pdMat.c -o pdMat.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c pythag.c -o pythag.o
gfortran -fPIC -Wall -g -O2 -c rs.f -o rs.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o nlme.so chol.o corStruct.o gnls.o init.o matrix.o nlOptimizer.o nlme.o nlmefit.o pdMat.o pythag.o rs.o -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0'
ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [nlme.so] Error 1
ERROR: compilation failed for package ‘nlme’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/nlme’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/nlme’
The downloaded source packages are in
‘/private/var/folders/74/y92tqhzj0l98l6syjjl7vtcr0000gn/T/RtmpNYOkbZ/downloaded_packages’
Warning message:
In install.packages(update[instlib == l, "Package"], l, repos = repos, :
installation of package ‘nlme’ had non-zero exit status
I've tried to reinstall R and it didn't work.
The code I am using to install bioconductor is:
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(version = "3.10")
I had the same problem. This happens since I updated to R4.0. I've seen that in Mac (and maybe Windows) can be related to missing Rtools. In Linux, I tried to install the package from other mirrors (this solved my problem in the past), but no success. Finally, I realized that the initial error is "make: gfortran: No such file or directory"
Therefore, I installed gcc & gcc-fortran and that solved it!
In Manjaro, Arch linux:
pacman -S gcc
pacman -S gcc-fortran
In Debian or Ubuntu should be:
sudo apt update
sudo apt install build-essential
sudo apt-get install manpages-dev
gcc --version
Check here for more information:
https://linuxize.com/post/how-to-install-gcc-compiler-on-debian-10/
https://linuxize.com/post/how-to-install-gcc-compiler-on-ubuntu-18-04/
https://linuxhostsupport.com/blog/how-to-install-gcc-on-ubuntu-18-04/
Because now the new version of Bioconductor is BiocManager, try to use this one: install.packages("BiocManager")
Apparently, it is trying to install package nlme as a dependency and fails doing that. Did you try installing that one manually before installing Bioconductor ? That could give us more info on the issue.
Just as a heads up for someone who encounters similar issue. I was presented with a choice of installing a binary or compiling from scratch. As I chose compilation option, it was failing to install nlme. However, installation of binary was successful and there was a minor version difference between the source and the binary.

RcppArmadillo: failing to install on Ubuntu16.04

I am trying to install Rcpp on Ubuntu. Here are some environment details:
R version:3.4.0
g++ --version: Ubuntu 5.4.0-6ubuntu1~16.04.4
If I have a blank Makevars file, RcppArmadillo can be installed but with some warnings about OpenMp
g++ -I/usr/share/R/include -DNDEBUG -I"/home/march/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I../inst/include -fopenmp -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppArmadillo.cpp -o RcppArmadillo.o
In file included from ../inst/include/armadillo:52:0,
from ../inst/include/RcppArmadilloForward.h:46,
from ../inst/include/RcppArmadillo.h:31,
from RcppArmadillo.cpp:22:
../inst/include/armadillo_bits/compiler_setup.hpp:487:118: note: #pragma message: WARNING: support for OpenMP requires C++11/C++14; add -std=c++11 or -std=c++14 to compiler flags
#pragma message ("WARNING: support for OpenMP requires C++11/C++14; add -std=c++11 or -std=c++14 to compiler flags")
^
g++ -I/usr/share/R/include -DNDEBUG -I"/home/march/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I../inst/include -fopenmp -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
In file included from ../inst/include/armadillo:52:0,
from ../inst/include/RcppArmadilloForward.h:46,
from ../inst/include/RcppArmadillo.h:31,
from RcppExports.cpp:4:
../inst/include/armadillo_bits/compiler_setup.hpp:487:118: note: #pragma message: WARNING: support for OpenMP requires C++11/C++14; add -std=c++11 or -std=c++14 to compiler flags
#pragma message ("WARNING: support for OpenMP requires C++11/C++14; add -std=c++11 or -std=c++14 to compiler flags")
^
g++ -I/usr/share/R/include -DNDEBUG -I"/home/march/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I../inst/include -fopenmp -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c fastLm.cpp -o fastLm.o
In file included from ../inst/include/armadillo:52:0,
from ../inst/include/RcppArmadilloForward.h:46,
from ../inst/include/RcppArmadillo.h:31,
from fastLm.cpp:22:
../inst/include/armadillo_bits/compiler_setup.hpp:487:118: note: #pragma message: WARNING: support for OpenMP requires C++11/C++14; add -std=c++11 or -std=c++14 to compiler flags
#pragma message ("WARNING: support for OpenMP requires C++11/C++14; add -std=c++11 or -std=c++14 to compiler flags")
^
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o RcppArmadillo.so RcppArmadillo.o RcppExports.o fastLm.o -fopenmp -llapack -lblas -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
installing to /home/march/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (RcppArmadillo)
After I added PKG_CXXFLAGS=-std=c++11 to Makevars, I got a error message as following:
g++ -I/usr/share/R/include -DNDEBUG -I"/home/march/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -std=c++11 -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppArmadillo.cpp -o RcppArmadillo.o
RcppArmadillo.cpp:22:27: fatal error: RcppArmadillo.h: No such file or directory
compilation terminated.
/usr/lib/R/etc/Makeconf:168: recipe for target 'RcppArmadillo.o' failed
make: *** [RcppArmadillo.o] Error 1
ERROR: compilation failed for package ‘RcppArmadillo’
* removing ‘/home/march/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo’
* restoring previous ‘/home/march/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo’
Warning in install.packages :
installation of package ‘RcppArmadillo’ had non-zero exit status
The wield thing is that when I tried to re-install RcppArmadillo on my mac(10.11), the same problem occurred. Could anybody enlighten me?
This is 16.10 which I have here at hone, if you wish I can repeat it at work tomorrow with 16.04:
edd#bud:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.10
Release: 16.10
Codename: yakkety
edd#bud:~$ Rscript -e 'install.packages("RcppArmadillo")'
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/RcppArmadillo_0.7.960.1.1.tar.gz'
Content type 'application/x-gzip' length 1115539 bytes (1.1 MB)
==================================================
downloaded 1.1 MB
* installing *source* package ‘RcppArmadillo’ ...
** package ‘RcppArmadillo’ successfully unpacked and MD5 sums checked
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 ccache g++ accepts -g... yes
checking how to run the C++ preprocessor... ccache g++ -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether ccache g++ accepts -g... (cached) yes
checking whether g++ version is sufficient... (6.2.0) yes
checking LAPACK_LIBS... system LAPACK found
checking for OpenMP... found
configure: creating ./config.status
config.status: creating inst/include/RcppArmadilloLapack.h
** libs
ccache g++ -I/usr/share/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -I../inst/include -fopenmp -fpic -g -O3 -Wall -pipe -Wno-unused -pedantic -Werror -march=native -c RcppArmadillo.cpp -o RcppArmadillo.o
ccache g++ -I/usr/share/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -I../inst/include -fopenmp -fpic -g -O3 -Wall -pipe -Wno-unused -pedantic -Werror -march=native -c RcppExports.cpp -o RcppExports.o
ccache g++ -I/usr/share/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -I../inst/include -fopenmp -fpic -g -O3 -Wall -pipe -Wno-unused -pedantic -Werror -march=native -c fastLm.cpp -o fastLm.o
ccache g++ -Wl,-S -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o RcppArmadillo.so RcppArmadillo.o RcppExports.o fastLm.o -fopenmp -llapack -lblas -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/RcppArmadillo/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (RcppArmadillo)
The downloaded source packages are in
‘/tmp/Rtmp2hQNrn/downloaded_packages’
edd#bud:~$
That I usee ccache is not material. This. Just. Works.

unable to install rgdal in ubuntu 14.04 (undefined to reference to 'pj_ctx_fclose')

I tried to install rgdal with configure.args but no luck.
Installed gdal version:
gdal-config --version
1.11.2
ogrinfo --version
GDAL 1.11.2, released 2015/02/10
found gdal binary tools:
ls /usr/bin | grep gdal
gdal2tiles.py
gdal2xyz.py
gdaladdo
gdal_auth.py
gdalbuildvrt
gdal_calc.py
gdalchksum.py
gdalcompare.py
gdal-config
gdal_contour
gdaldem
gdal_edit.py
gdalenhance
gdal_fillnodata.py
gdal_grid
gdalident.py
gdalimport.py
gdalinfo
gdallocationinfo
gdalmanage
gdal_merge.py
gdalmove.py
gdal_polygonize.py
gdal_proximity.py
gdal_rasterize
gdal_retile.py
gdalserver
gdal_sieve.py
gdalsrsinfo
gdaltindex
gdaltransform
gdal_translate
gdalwarp
found proj header files:
ls /usr/include | grep proj
libprojectM
libprojectM-qt
org_proj4_Projections.h
proj_api.h
projects.h
found proj lib files:
ls /usr/lib | grep proj
libproj.a
libprojectM-qt.so
libprojectM-qt.so.1
libprojectM-qt.so.1.10
libprojectM.so
libprojectM.so.2
libprojectM.so.2.1.0
libproj.la
libproj.so
libproj.so.0
libproj.so.0.7.0
installed packages about gdal:
dpkg -l | grep gdal
ii gdal-bin 1.11.2+dfsg-1~exp2~trusty amd64 Geospatial Data Abstraction Library - Utility programs
ii libgdal-dev 1.11.2+dfsg-1~exp2~trusty amd64 Geospatial Data Abstraction Library - Development files
ii libgdal1-dev 1.11.2+dfsg-1~exp2~trusty all Geospatial Data Abstraction Library - Transitional package
ii libgdal1h 1.11.2+dfsg-1~exp2~trusty amd64 Geospatial Data Abstraction Library
ii python-gdal 1.11.2+dfsg-1~exp2~trusty amd64 Python bindings to the Geospatial Data Abstraction Library
dpkg -l | grep proj
ii libgeo-proj4-perl 1.05-1 amd64 PROJ.4 library for cartographic projections
ii libproj-dev 4.8.0-2ubuntu2 amd64 Cartographic projection library (development files)
ii libproj0 4.8.0-2ubuntu2 amd64 Cartographic projection library
ii libprojectm-dev 2.1.0+dfsg-1build2 amd64 Advanced Milkdrop-compatible music visualization library - dev
ii libprojectm-qt-dev 2.1.0+dfsg-1build2 amd64 projectM Qt4 (development files)
ii libprojectm-qt1 2.1.0+dfsg-1build2 amd64 projectM Qt4 bindings
ii libprojectm2 2.1.0+dfsg-1build2 amd64 Advanced Milkdrop-compatible music visualization library
ii proj-bin 4.8.0-2ubuntu2 amd64 Cartographic projection library (tools)
ii proj-data 4.8.0-2ubuntu2 amd64 Cartographic projection filter and library (datum package)
ii projectm-data 2.1.0+dfsg-1build2 all Advanced Milkdrop-compatible music visualization library - data
ii xfwm4 4.11.1-2ubuntu2 amd64 window manager of the Xfce project
install.packages('rgdal',type='source',
configure.args = paste('--with-gdal-config=/usr/bin/gdal-config',
'--with-proj-lib=/usr/lib',
'--with-proj-include=/usr/include') )
Installing package into ‘/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2’
(as ‘lib’ is unspecified)
trying URL 'http://mirrors.ustc.edu.cn/CRAN/src/contrib/rgdal_0.9-2.tar.gz'
Content type 'application/gzip' length 1627386 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: rgdal: 0.9-2
checking for /usr/bin/svnversion... no
configure: svn revision: 526
configure: gdal-config set to /usr/bin/gdal-config
checking gdal-config exists... yes
checking gdal-config executable... yes
checking gdal-config usability... yes
configure: GDAL: 1.11.2
checking GDAL version >= 1.6.3... yes
checking GDAL version < 2... yes
checking for gcc... gcc -std=gnu99
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 gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... 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 gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking gdal: linking with --libs only... yes
checking GDAL: /usr/share/gdal/1.11/pcs.csv readable... yes
checking proj_api.h usability... yes
checking proj_api.h presence... yes
checking for proj_api.h... yes
checking for pj_init_plus in -lproj... yes
configure: PROJ.4 version: > 4.8.0
/tmp/ccsGVxP9.o: In function `main':
/tmp/RtmpOqwz92/R.INSTALL23317ae38fc4/rgdal/proj_conf_test.c:20: undefined reference to `pj_ctx_fclose'
collect2: error: ld returned 1 exit status
./configure: line 3735: ./proj_conf_test: No such file or directory
checking PROJ.4: epsg found and readable... yes
/tmp/ccaNfCUo.o: In function `main':
/tmp/RtmpOqwz92/R.INSTALL23317ae38fc4/rgdal/proj_conf_test.c:20: undefined reference to `pj_ctx_fclose'
collect2: error: ld returned 1 exit status
./configure: line 3810: ./proj_conf_test: No such file or directory
checking PROJ.4: conus found and readable... yes
configure: Package CPP flags: -I/usr/include/gdal -I/usr/include
configure: Package LIBS: -L/usr/lib -lgdal -L/usr/lib -lproj
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c OGR_write.cpp -o OGR_write.o
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c gdal-bindings.cpp -o gdal-bindings.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c init.c -o init.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c local_stubs.c -o local_stubs.o
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c ogr_geom.cpp -o ogr_geom.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c ogr_polygons.c -o ogr_polygons.o
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c ogr_proj.cpp -o ogr_proj.o
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c ogrdrivers.cpp -o ogrdrivers.o
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c ogrsource.cpp -o ogrsource.o
g++ -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I/usr/include -I"/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c projectit.cpp -o projectit.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o rgdal.so OGR_write.o gdal-bindings.o init.o local_stubs.o ogr_geom.o ogr_polygons.o ogr_proj.o ogrdrivers.o ogrsource.o projectit.o -L/usr/lib -lgdal -L/usr/lib -lproj -L/usr/lib/R/lib -lR
installing to /home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/rgdal/libs
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/rgdal/libs/rgdal.so':
/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/rgdal/libs/rgdal.so: undefined symbol: pj_ctx_fgets
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/rgdal’
Warning in install.packages :
installation of package ‘rgdal’ had non-zero exit status
EDIT:
I have tried install.packages('rgdal') without any configure.args. I got the same error.
Now, I am tring to install rgdal with a compiled proj4 4.9.1 and export LD_LIBRARY_PATH to proj4 4.9.1. Unfortunately, it failed again.
Here is my new script.sh:
export LD_LIBRARY_PATH=/home/wangchl/R-scripting/R-install/proj-4.9.1/ccc/lib:/usr/lib:$LD_LIBRARY_PATH
sudo R CMD REMOVE rgdal
R CMD INSTALL rgdal_0.9-2.tar.gz --byte-compile --configure-args='--with-gdal-config=/usr/bin/gdal-config --with-proj-lib=/home/wangchl/R-scripting/R-install/proj-4.9.1/ccc/lib --with-proj-include=/home/wangchl/R-scripting/R-install/proj-4.9.1/ccc/include --with-proj-share=/home/wangchl/R-scripting/R-install/proj-4.9.1/ccc/share/proj'
Everything is fine but failed when testing:
installing to /home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/rgdal/libs
** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/rgdal/libs/rgdal.so':
/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/rgdal/libs/rgdal.so: undefined symbol: pj_ctx_fgets
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/wangchl/R/x86_64-pc-linux-gnu-library/3.2/rgdal’
Update:
Finally, I sovled this issue . Firstly, removing proj4-4.8 by apt-get.
sudo apt-get remove libproj-dev
Secondly, adding my compiled proj4-4.9 lib path into a new conf file (such as rgdal.conf) under the path of '/etc/ld.so.conf.d/'.
cd /etc/ld.so.conf.d
sudo touch rgdal.conf
echo 'the lib path of proj4-4.9' | sudo tee -a rgdal.conf
And then, installing rgdal with configure.args referencing the compiled lib path of proj4-4.9.
export LD_LIBRARY_PATH=the lib path of proj4-4.9:$LD_LIBRARY_PATH
sudo R CMD REMOVE rgdal
R CMD INSTALL rgdal_0.9-2.tar.gz --byte-compile --configure-args='--with-gdal-config=/usr/bin/gdal-config --with-proj-lib=compiled path of proj4-4.9/lib --with-proj-include=compiled path of proj4-4.9/include --with-proj-share=compiled path of proj4-4.9/share/proj'
Right now, everything is fine. But I am failed to install any version of rgdal with proj4-4.8 and default configure.args. I have already cleaned files of proj4 following the suggestion of #Pascal . So I am not sure the exact reason about this issue.
Do you have libgdal-dev and libproj-dev installed?
In terminal:
sudo apt-get update && sudo apt-get install libgdal-dev libproj-dev
Then in R try and install rgdal again.
Finally, I sovled this issue . Firstly, removing proj4-4.8 by apt-get.
sudo apt-get remove libproj-dev
Secondly, adding my compiled proj4-4.9 lib path into a new conf file (such as rgdal.conf) under the path of '/etc/ld.so.conf.d/'.
cd /etc/ld.so.conf.d
sudo touch rgdal.conf
echo 'the lib path of proj4-4.9' | sudo tee -a rgdal.conf
And then, installing rgdal with configure.args referencing the compiled lib path of proj4-4.9.
export LD_LIBRARY_PATH=the lib path of proj4-4.9:$LD_LIBRARY_PATH
sudo R CMD REMOVE rgdal
R CMD INSTALL rgdal_0.9-2.tar.gz --byte-compile --configure-args='--with-gdal-config=/usr/bin/gdal-config --with-proj-lib=compiled path of proj4-4.9/lib --with-proj-include=compiled path of proj4-4.9/include --with-proj-share=compiled path of proj4-4.9/share/proj'
Right now, everything is fine. But I am failed to install any version of rgdal with proj4-4.8 and default configure.args. I have already cleaned files of proj4 following the suggestion of #Pascal . So I am not sure the exact reason about this issue.

R shiny Ubuntu 12.04 installation instructions fail when installing Rcpp needed by R shiny library in R 3.0.2

I am trying to install an R shiny server on my local Ubuntu 12.04 machine, and I followed the instructions here https://github.com/rstudio/shiny-server/wiki/Ubuntu-step-by-step-install-instructions:
When trying to do a:
install.packages('shiny', repos='http://cran.rstudio.com/')
It goes through the dependencies, but fails to install Rcpp. See error log below:
* installing *source* package 'Rcpp' ...
* package 'Rcpp' successfully unpacked and MD5 sums checked
* libs
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c Date.cpp -o Date.o
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c Module.cpp -o Module.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c Rcpp_init.c -o Rcpp_init.o
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c Timer.cpp -o Timer.o
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c api.cpp -o api.o
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c attributes.cpp -o attributes.o
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c barrier.cpp -o barrier.o
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c exceptions.cpp -o exceptions.o
g++ -shared -o Rcpp.so Date.o Module.o Rcpp_init.o Timer.o api.o attributes.o barrier.o exceptions.o -L/usr/lib/R/lib -lR
g++ -o libRcpp.so Date.o Module.o Rcpp_init.o Timer.o api.o attributes.o barrier.o exceptions.o -shared -L/usr/lib/R/lib -lR
ar qc libRcpp.a Date.o Module.o Rcpp_init.o Timer.o api.o attributes.o barrier.o exceptions.o
cp libRcpp.so ../inst/lib
cp libRcpp.a ../inst/lib
rm libRcpp.so libRcpp.a
installing to /usr/local/lib/R/site-library/Rcpp/libs
* R
* inst
* preparing package for lazy loading
Error : package 'codetools' was built before R 3.0.0: please re-install it
Error : unable to load R code in package 'Rcpp'
ERROR: lazy loading failed for package 'Rcpp'
* removing '/usr/local/lib/R/site-library/Rcpp'
* installing *source* package 'httpuv' ...
* package 'httpuv' successfully unpacked and MD5 sums checked
* libs
g++ -I/usr/share/R/include -DNDEBUG -I./libuv/include -I./http-parser -I./sha1 -I./base64 -I"/usr/lib/R/site-library/Rcpp/include" -fpic -O3 -pipe -g -c RcppExports.cpp -o RcppExports.o
RcppExports.cpp:75:10: error: 'uint32_t' was not declared in this scope
RcppExports.cpp: In function 'SEXPREC* httpuv_run(SEXP)':
RcppExports.cpp:79:5: error: 'uint32_t' was not declared in this scope
RcppExports.cpp:79:14: error: expected ';' before 'timeoutMillis'
RcppExports.cpp:80:25: error: 'timeoutMillis' was not declared in this scope
RcppExports.cpp:80:38: error: 'run' cannot be used as a function
make: * [RcppExports.o] Error 1
ERROR: compilation failed for package 'httpuv'
* removing '/usr/local/lib/R/site-library/httpuv'
ERROR: dependency 'httpuv' is not available for package 'shiny'
* removing '/usr/local/lib/R/site-library/shiny'
EDITED:
Manually downloading and installing Rcpp gives me:
sudo R CMD INSTALL Rcpp_0.10.6.tar.gz
Error : package 'codetools' was built before R 3.0.0: please re-install it
So I manually downloaded and installed codetools and re-tried Rcpp:
sudo R CMD INSTALL codetools_0.2-8.tar.gz
sudo R CMD INSTALL Rcpp_0.10.6.tar.gz
Then followed the instructions again from the Shiny webpage from "Install R" and "Install shiny" and got a similar error but now with caTools, bitops and xtable, so I did the manual installation of each of them. The shiny was installed correctly.
Then followed the next steps in the instructions.
Any ideas why I got this 'was built before R 3.0.0' errors?
Ubuntu 12.04 is a pre-R 3.0.0 release. You have to decide whether you want its long-term support and stability "as is", or if you want newer software.
You can mix and match. Read the CRAN Ubuntu README, adjust your apt settings and enjoy updated r-cran-* packages. With those you can then install shiny and its dependencies.
Manually downloading and installing Rcpp gives me:
sudo R CMD INSTALL Rcpp_0.10.6.tar.gz
Error : package 'codetools' was built before R 3.0.0: please re-install it
So I manually downloaded and installed codetools and re-tried Rcpp:
sudo R CMD INSTALL codetools_0.2-8.tar.gz
sudo R CMD INSTALL Rcpp_0.10.6.tar.gz
Then followed the instructions again from the Shiny webpage from "Install R" and "Install shiny" and got a similar error but now with caTools, bitops and xtable, so I did the manual installation of each of them. The shiny was installed correctly.
Then followed the next steps in the instructions. All went well from there. Not sure why I was getting these was built before 3.0.0 errors.

Resources