rgdal won't install on AWS RStudio AMI - amazon-ec2

I have managed to successfully launch the most recent RStudio AWS EC2 instance (louisaslett.com, RStudio-1.1383_R-3.4.2…ubuntu-16.04-LTS-64). R operates mostly as expected in this instance, and I can install and open a number of packages. However I get an error if I try to install either of the rgdal of gdalUtils packages.
Below is the console output when I attempt to install rgdal. The output for the gdalUtils install is too long to include here, but both include the text "error: upgrade GDAL to 1.11.4 or later" which I suspect is the problem, but have no idea how to correct.
Any thoughts or advice would be greatly appreciated.
Cheers
> install.packages("rgdal")
Installing package into ‘/home/rstudio/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/rgdal_1.3-3.tar.gz'
Content type 'application/x-gzip' length 1670656 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
checking for g++... g++
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 g++ accepts -g... yes
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: rgdal: 1.3-3
checking for /usr/bin/svnversion... yes
configure: svn revision: 759
checking whether g++ supports C++11 features by default... no
checking whether g++ supports C++11 features with -std=gnu++11... yes
configure: C++11 support available
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 1.11.3
checking GDAL version >= 1.11.4... no
configure: error: upgrade GDAL to 1.11.4 or later
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/rstudio/R/x86_64-pc-linux-gnu-library/3.4/rgdal’
Warning in install.packages :
installation of package ‘rgdal’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpGUxbcA/downloaded_packages’

I have since run into the same issue running Rstudio on the google cloud. In both cases a solution was relatively simple - install a recent but older rgdal package from cran (https://cran.r-project.org/src/contrib/Archive/rgdal/) which wasnt dependent on the most recent gdal libraries, and therefore installed without throwing the error about upgrading GDAL.

Related

How can I install System.Console.Readline for Haskell GHCi on Windows?

I am trying to run a haskell file from command prompt. I get the following error :
Failed to load interface for `System.Console.Readline'
Perhaps you meant System.Console.Haskeline (from haskeline-0.7.2.3)
Locations searched:
System\Console\Readline.hs
System\Console\Readline.lhs
System\Console\Readline.hsig
System\Console\Readline.lhsig
I thought readline came as part of cabal when you installed the full version of haskell? (which I have done) Does anyone have any idea how I can fix this?
EDIT: I tried >cabal update, followed by >cabal install readline, and I now get this:
Resolving dependencies...
Configuring readline-1.0.3.0...
Failed to install readline-1.0.3.0
Build log ( C:\Users\Dan\AppData\Roaming\cabal\logs\readline-1.0.3.0.log ):
Configuring readline-1.0.3.0...
bash.exe: warning: could not find /tmp, please create!
checking for gcc... C:\PROGRA~1\HASKEL~1\802E01~1.1\mingw\bin\gcc.exe
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether C:\PROGRA~1\HASKEL~1\802E01~1.1\mingw\bin\gcc.exe accepts -g... yes
checking for C:\PROGRA~1\HASKEL~1\802E01~1.1\mingw\bin\gcc.exe option to accept ISO C89... none needed
checking for GNUreadline.framework... checking for readline... no
checking for tputs in -lncurses... no
checking for tputs in -ltermcap... no
checking for tputs in -lcurses... no
checking for rl_readline_version... no
configure: error: readline not found, so this package cannot be built
See `config.log' for more details.
cabal: Leaving directory 'C:\Users\Dan\AppData\Local\Temp\cabal-tmp-884\readline-1.0.3.0'
cabal: Error: some packages failed to install:
readline-1.0.3.0 failed during the configure step. The exception was:
ExitFailure 1

Cannot compile gearman - configure script fails

My system is Red Hat Enterprise Linux Server release 5.7 (Tikanga).
I am trying to run the configure script , and I am getting the following error:
checking for the toolset name used by Boost for g++... gcc41 -gcc
configure: Detected BOOST_ROOT; continuing with --with-boost=/raid/users/andrey/3rdParty/boost_1_47/
checking for Boost headers version >= 1.39.0... /users/andrey/3rdParty/boost_1_47/
checking for Boost's header version... 1_47
checking boost/program_options.hpp usability... no
checking boost/program_options.hpp presence... no
checking for boost/program_options.hpp... no
configure: error: cannot find boost/program_options.hpp
The documentation of configure says that boost is an optional package. So I tried to build it without boost:
configure -with-boost=no
This does not run as well and returns the following error:
checking for assert... no
checking for the toolset name used by Boost for g++... gcc41 -gcc
configure: Detected BOOST_ROOT=/users/andrey/3rdParty/boost_1_47/, but overridden by --with-boost=no
checking for Boost headers version >= 1.39.0... no
I've seen this question already, but it does not seem to help me.
Any idea?
in debian/ubuntu/mint you can use :
apt-get install libboost-all-dev
I have met the same issue when building the gearmand from source. The issue was fixed after I installed the package boost-devel, which will place needed headers into /usr/include/boost. Thanks and hope this may help.
Step "Installing Cygwin Package Dependencies needed for Gearman".
In addition to these packages:
gcc
gcc-c++
gcc-g++
make
libuuid1-devel
libiconv
if you did this you can:
reinstall cygwin and install this :
libuuid
boost
You can use following command to solve this issue.
yum install boost*
If you are using centos or fedora or redhat then above command will work.

Compiling PHP + Libpuzzle to Windows

I got the libpuzzle source here: http://www.pureftpd.org/project/libpuzzle/download.
I read I need MinGW to compile any C programs on windows, so I got that alot with C, C++ and mins options. Using mins I was followed: http://wiki.openttd.org/Compiling_on_MinGW
I downloaded the .tar.gz and unpacked it, executed the ./configure command and got:
libgd2 development files are not found
Makes sense given in the readme:
In order to load images, the library relies on the GD2 library.
You need to install gdlib2 and its development headers before compiling
libpuzzle.
The GD2 library is available as a pre-built package for most operating systems.
Debian and Ubuntu users should install the "libgd2-dev" or the "libgd2-xpm-dev"
package.
Gentoo users should install "media-libs/gd".
OpenBSD, NetBSD and DragonflyBSD users should install the "gd" package.
MacPorts users should install the "gd2" package.
X11 support is not required for the Puzzle library.
Once GD2 has been installed, configure the Puzzle library as usual:
My problem at this time is finding a libgd2-dev or like file to compile. I found this: http://mldonkey.sourceforge.net/Windows and downloaded http://www.boutell.com/gd/http/gd-2.0.33.tar.gz and it installed fine. Running gdlib-config outputs typical man. However, libpuzzle still says I need the "libgd2 development files", so I assume the gd I downloaded was "libgd" but just "gd" or the file I had didn't have development files. Where can I found what I need?
Here is mingw output:
Brian#2500K ~/libpuzzle-0.11
$ gdlib-config
Print information on GD library's version, configuration, and use.
Usage: gdlib-config [options]
Options:
--libdir # directory where GD library is installed
--includedir # directory where GD library headers are installed
--version # complete GD library version string
--majorversion # GD library major version number
--minorversion # GD library minor version number
--revision # GD library revision version number
--ldflags # options required for linking against GD library
--libs # libs required for linking against GD library
--cflags # options required for compiling GD library apps
--includes # same as --cflags
--features # lists optional features compiled into gd, separated
# by spaces. Currently (as of 2.0.26) the optional
# features are GD_PNG, GD_JPEG, GD_XPM, and
# GD_FREETYPE. When these features are reported by
# --features, it is safe to include calls to the
# related functions in your code.
--all # print a summary of all GD library configure options
Brian#2500K ~/libpuzzle-0.11
$ gdlib-config --includedir
/usr/local/include
Brian#2500K ~/libpuzzle-0.11
$ ./configure
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.exe
checking for suffix of executables... .exe
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 g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking whether ln -s works... no, using cp -p
checking whether make sets $(MAKE)... (cached) yes
checking for gdlib-config... /usr/local/bin/gdlib-config
checking for gdImageCreateFromGd2 in -lgd... no
configure: error: libgd2 development files not found
Edit: Started a bounty. I am looking for either compile the libpuzzle for me so it works on WAMP (skipping the complicated middle stuff). Or help on getting each requirement needed so that I can compile it. My end goal is having libpuzzle run on wamp
Edit 2: Just an update, it seems libgd2 has problems with mingw. Even if I was to get libgd2 to finally work then I still need phpize for mingw as well, which also doesn't work for mingw. It seems it's not possible to use libpuzzle for windows
It sounds like the program is just not finding the headers for libgd. If you look at that tarbar, it's a source tarball that includes the headers. When you compiled and installed it, it installed the library and the headers somewhere. You need to figure out where.
Run ./configure --help
There should be an option like --with-gd=, that option lets you tell it the path where libgd is installed. Specify the path where it is installed, and it should work.
Encountered the same error when compiled GD2 myself.
Using old precompiled version from GnuWin32 solved the problem:
http://sourceforge.net/projects/gnuwin32/files/gd/2.0.33-1/

rj package compilation failure

Thanks a lot for taking a look. There's a previous post on here with the same error message "cannot compile a simple JNI program" and the solution was to update to R 1.15. But I've already had everything in the newest version. Although it says "see config.log for details", it doesn't give a location, and "find / -name config.log" at the terminal returns nothing.
It's be an exhausting and frustrating process trying to get this to work. Any help will be much appreciated.
R version 2.15.1, 64-bit (I used Homebrew install, but it shouldn't be the problem)
Eclipse 4.2 Cocoa, 64-bit (tried 3.7 as well, didn't work either)
OSX 10.7.5
Here's the error message:
install.packages(c("rj"), repos="http://download.walware.de/rj-1.1")
Installing package(s) into '/Library/Frameworks/R.framework/Versions/2.15/Resources/library'
(as 'lib' is unspecified)
trying URL 'http://download.walware.de/rj-1.1/src/contrib/rj_1.1.0-4.tar.gz'
Content type 'application/x-tar' length 314501 bytes (307 Kb)
opened URL
==================================================
downloaded 307 Kb
* installing *source* package 'rj' ...
checking R config... found
R_HOME : /usr/local/Cellar/r/2.15.1/R.framework/Resources
checking for gcc... cc
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 cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking Java support in R... ok
JAVA_HOME: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
JAVA : /usr/bin/java
JAVAC : /usr/bin/javac
JAVAH : /usr/bin/javah
JAVA_CPPFLAGS: -I/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/include
JAVA_LIBS: -framework JavaVM
JAR : /usr/bin/jar
configure: creating ./config.status
config.status: creating src/Makevars
=== configuring in jri (/private/var/folders/7p/q7qb1n2d277c9tqt65s5wy_c0000gn/T/RtmpVlP2YK/R.INSTALL2c9175fac4e/rj/jri)
configure: running /bin/sh ./configure --disable-option-checking '--prefix=/usr/local' --cache-file=/dev/null --srcdir=.
checking build system type... i386-apple-darwin11.4.2
checking host system type... i386-apple-darwin11.4.2
checking for gcc... cc
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 cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -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 whether Java interpreter works... checking whether JNI programs can be compiled... configure: error: Cannot compile a simple JNI program. See config.log for details.
configure: error: ./configure failed for jri
ERROR: configuration failed for package 'rj'
* removing '/Library/Frameworks/R.framework/Versions/2.15/Resources/library/rj'
* restoring previous '/Library/Frameworks/R.framework/Versions/2.15/Resources/library/rj'
The downloaded source packages are in
'/private/var/folders/7p/q7qb1n2d277c9tqt65s5wy_c0000gn/T/RtmpNM4Pyx/downloaded_packages'
Warning message:
In install.packages(c("rj"), repos = "http://download.walware.de/rj-1.1") :
installation of package 'rj' had non-zero exit status
Here is the session info.
sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: x86_64-apple-darwin11.4.0 (64-bit)
locale:
[1] C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tcltk_2.15.1 tools_2.15.1
I faced the same issue and below Solution worked for me. Please follow the steps
1.) You need to run this command on the terminal - R CMD javareconf
2.) After that check the compatibility of StatET with rJ package which is in below order.
For RJ 2.0 (StatET 3.4 - 3.5):
install.packages(c("rj", "rj.gd"), repos="http://download.walware.de/rj-2.0")
For RJ 1.1 (StatET 3.0 - 3.3):
install.packages(c("rj", "rj.gd"), repos="http://download.walware.de/rj-1.1")
For RJ 1.0 (StatET 2.0):
install.packages(c("rj", "rj.gd"), repos="http://download.walware.de/rj-1.0")
For RJ 0.5 (StatET 0.10):
install.packages("rj", repos="http://download.walware.de/rj-0.5")
3.) Once you know your compatible version in accordance with StatET then run the package installation command.
for example. I am using a StatET 3.5 thus for me RJ 2.0 will work and not others .
So command would be
{install.packages(c("rj", "rj.gd"), repos="http://download.walware.de/rj-2.0")}
4.) Once your installation is done then do check the environmental variable are set correctly in case you are using any IDE ( Like Eclipse ). Library paths should be set in Eclipse or any other IDE.
Follow this link in case of any issues - http://www.walware.de/?page=/it/statet/installation.html

Installing RPostgresql on a Mac with OSX 10.7.2

I'm trying to install rpostgresql on a mac. I want to be able to connect to a server using an IP address and read the data into a dataframe. I downloaded the package from CRAN, and ran the following line:
install.packages('/Users/celenius/Downloads/RPostgreSQL_0.2-1.tar.gz', type='source')
This started to compile the package but resulted with the following error message:
> install.packages('/Users/celenius/Downloads/RPostgreSQL_0.2-1.tar.gz', type='source')
Installing package(s) into ‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library’
(as ‘lib’ is unspecified)
inferring 'repos = NULL' from the file name
* installing *source* package ‘RPostgreSQL’ ...
** package ‘RPostgreSQL’ successfully unpacked and MD5 sums checked
checking for gcc... gcc
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 gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for pg_config... /usr/bin/pg_config
checking for "/usr/include/libpq-fe.h"... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
*** arch - x86_64
gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -I/usr/include -I/usr/local/include -fPIC -g -O2 -c RS-DBI.c -o RS-DBI.o
make: gcc-4.2: No such file or directory
make: *** [RS-DBI.o] Error 1
ERROR: compilation failed for package ‘RPostgreSQL’
* removing ‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library/RPostgreSQL’
Warning in install.packages :
installation of package ‘/Users/celenius/Downloads/RPostgreSQL_0.2-1.tar.gz’ had non-zero exit status
I've looked through advice on the rpostgresql webpage (1, 2) but a lot of the suggestions are more than a year old so I thought there might be more recent advice on how to install this package.
If you want to connect to a postgre db, you also can use RODBC. Just install an ODBC driver (Lion should already include that for postgres) and you are ready to go.
I do that for conecting to my local postgre / postgis server and it works just fine.
You need Xcode installed in order to compile. Go into the Mac app store and search for, then install Xcode. It's free.
you can tell whether you already have gcc by doing a quick which gcc-4.2. My guess is that you do not. After installing Xcode, you should get /usr/bin/gcc-4.2 in response.
****EDIT****
After the comments about how you installed Xcode and still don't have gcc-4.2, I did a little bit of reading and it looks like you need to do one of the options listed in this Stack Overflow question: Setting GCC 4.2 as the default compiler on Mac OS X Leopard
This makes me wonder where my gcc-4.2 came from. Probably some fortuitous accident when I first got my MBP.
Since postgresql is required to build the package from source, you will need to install it. The easiest way to do so, if you use homebrew, is to simply do the following in a Terminal:
## install postgresql
brew install postgresql
## install the R package
Rscript -e "install.packages('RPostgreSQL', type = 'source')"
## remove postgresql (optional)
brew remove postgresql

Resources