I want to compile the units package in Renjin, which currently does not work in the online repository, see http://packages.renjin.org/package/org.renjin.cran/units/0.6-3/build/5
I created a pom.xml for the current release of udunits, see https://github.com/nuest/renjin-docker/blob/master/geospatial-packages/units/pom.xml
I built a Dockerfile for compiling packages and having the required compilers, see https://github.com/nuest/renjin-docker/blob/master/0.9.2726/Dockerfile.builder
Within a container created from an image built from that Dockerfile, I can run library('org.renjin.cran:Rcpp') in an R session, but when I run mvn clean install on units I get the following error:
[...]
Downloaded: https://nexus.bedatadriven.com/content/groups/public/org/sonatype/aether/aether-impl/1.13.1/aether-impl-1.13.1.jar (128 KB at 7.4 KB/sec)
EXECUTING: -print-file-name=plugin
EXECUTING: -shared -xc++ -I/usr/lib/gcc/x86_64-linux-gnu/4.7/plugin/include -fPIC -fno-rtti -O2 plugin.c -lstdc++ -shared-libgcc -o /packages/units/units/target/bridge.so
configure: units: 0.6-4
Warning: unsupported configuration variable CFLAGS
Warning: unsupported configuration variable CPPFLAGS
Warning: unsupported configuration variable LDFLAGS
Warning: unsupported configuration variable CXXFLAGS
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++-4.7 accepts -g... yes
checking how to run the C++ preprocessor... g++-4.7 -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 for stdbool.h that conforms to C99... yes
checking for _Bool... no
checking for error_at_line... yes
checking for gcc... gcc-4.7
checking whether we are using the GNU C compiler... yes
checking whether gcc-4.7 accepts -g... yes
checking for gcc-4.7 option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... no
checking udunits2.h usability... yes
checking udunits2.h presence... yes
checking for udunits2.h... yes
checking for ut_read_xml in -ludunits2... yes
configure: creating ./config.status
config.status: creating src/Makevars
Checking wether in Makevars CXX_STD is set to CXX11... no
g++-4.7 -I/packages/units/units/target/gnur/include -DNDEBUG -DUDUNITS2_DIR=0 -I"/packages/units/units/target/include" -fpic -m32 -fplugin=/packages/units/units/target/bridge.so -DRENJIN -fno-inline-functions -fdisable-tree-einline -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c udunits.cpp -o udunits.o
cc1plus: note: disable pass tree-einline for functions in the range of [0, 4294967295]
udunits.cpp:11:18: fatal error: Rcpp.h: No such file or directory
compilation terminated.
/packages/units/units/target/gnur/etc/Makeconf:202: recipe for target 'udunits.o' failed
make: *** [udunits.o] Error 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:20 min
[INFO] Finished at: 2019-11-15T15:27:52+00:00
[INFO] Final Memory: 17M/445M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.renjin:renjin-maven-plugin:0.9.2726:gnur-compile (gnur-compile) on project units: Compilation of GNU R sources failed: Failed to execute Makefile -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
root#987c61d45fbf:/packages/units/units# exit
Anyone an idea how to tell Renjin where to find Rcpp.h ?
More details on the resources I consulted are in this GitHub issue: https://github.com/nuest/renjin-docker/issues/4
If you're using Maven to build the package, you also need to add Rcpp headers as a dependency:
<dependency>
<groupId>org.renjin.cran</groupId>
<artifactId>Rcpp</artifactId>
<version>0.12.13-renjin-15</version>
<classifier>headers</classifier>
<scope>provided</scope>
</dependency>
You can use the pom file for plyr as an example.
Note that if you just want to build a package for use with Renjin, the command line tool is far simpler:
renjin build units
This will take care of downloading the required dependencies and producing a jar file.
Do note that Renjin does not support packages which depend on external native libraries. You can see from the automated build logs that the units package will fail because of a dependency on udunits2.
That is the reason that the units packages is labeled as incompatible in our package site.
Related
I'm trying to install sf package from source to run it with latest version of geos/gdal/proj which were installed by homebrew. I'm using an Apple Silicon M1 computer with MacOS BigSur 11.3. and it seems that my issues are linked to this new Apple silicon chip. If any of you already faced the issue and could share some tips that'd be great.
Here is my command in R :
install_github("r-spatial/sf", configure.args = c("--with-proj-lib=/opt/homebrew/bin/", "--with-gdal-config=/opt/homebrew/bin/gdal-config", "--with-geos-config=/opt/homebrew/bin/geos-config"))
and the response is
Downloading GitHub repo r-spatial/sf#HEAD
✓ checking for file ‘/private/var/folders/50/g22y7v993hq6m6r4m3mm05_r0000gn/T/Rtmp5KWH5H/remotesc7c51a94ebf/r-spatial-sf-c99226b/DESCRIPTION’ (418ms)
─ preparing ‘sf’:
✓ checking DESCRIPTION meta-information ...
─ cleaning src
─ running ‘cleanup’
─ checking for LF line-endings in source and make files and shell scripts (629ms)
─ checking for empty or unneeded directories
─ building ‘sf_0.9-9.tar.gz’
* installing *source* package ‘sf’ ...
** using staged installation
configure: CC: clang -mmacosx-version-min=10.13
configure: CXX: clang++ -mmacosx-version-min=10.13 -std=gnu++11
configure: gdal-config set to /opt/homebrew/bin/gdal-config
checking gdal-config exists... yes
checking gdal-config executable... yes
checking gdal-config usability... yes
configure: GDAL: 3.2.2
checking GDAL version >= 2.0.1... yes
checking for gcc... clang -mmacosx-version-min=10.13
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 -mmacosx-version-min=10.13 accepts -g... yes
checking for clang -mmacosx-version-min=10.13 option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -mmacosx-version-min=10.13 -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 gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking GDAL: linking with --libs only... no
checking GDAL: linking with --libs and --dep-libs... no
ld: warning: ignoring file /opt/homebrew/Cellar/gdal/3.2.2_4/lib/libgdal.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
"_GDALAllRegister", referenced from:
_main in gdal_test-e29770.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: warning: directory not found for option '-L/opt/homebrew/Cellar/libdap/3.20.7/lib64'
ld: library not found for -lcrypto
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure: Install failure: compilation and/or linkage problems.
configure: error: GDALAllRegister not found in libgdal.
ERROR: configuration failed for package ‘sf’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/sf’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/sf’
Warning message:
In i.p(...) :
installation of package ‘/var/folders/50/g22y7v993hq6m6r4m3mm05_r0000gn/T//Rtmp5KWH5H/filec7c4271077b/sf_0.9-9.tar.gz’ had non-zero exit status
When I try to do the same for rgdal I get the same result. And if I do it with rgeos, I get the similar error:
...
checking geos: linking with libgeos_c... no
checking geos: linking with -L/opt/homebrew/Cellar/geos/3.9.1/lib -lgeos_c -lgeos -lm... no
ld: warning: ignoring file /opt/homebrew/Cellar/geos/3.9.1/lib/libgeos_c.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/Cellar/geos/3.9.1/lib/libgeos.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
...
I'm a bit new at this so let me know if you need more info.
Thanks,
I am trying to install some packages (mailR) to be able to communicate errors and messages to my users by mail, and connecting to HIVE server via rJdbc but installing rJava dependency is getting convoluted more and more as steps are accomplished.
First error is asking for rJava package, so I tried installing rJava:
install.packages("rJava")
Installing package into ‘/home/joe/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/rJava_0.9-11.tar.gz'
Content type 'application/x-gzip' length 675188 bytes (659 KB)
==================================================
downloaded 659 KB
* installing *source* package ‘rJava’ ...
** package ‘rJava’ successfully unpacked and MD5 sums checked
** using staged installation
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/wait.h that is POSIX.1 compatible... 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 string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether time.h and sys/time.h may both be included... yes
configure: checking whether gcc -std=gnu99 supports static inline...
yes
checking whether setjmp.h is POSIX.1 compatible... yes
checking whether sigsetjmp is declared... yes
checking whether siglongjmp is declared... yes
checking Java support in R... present:
interpreter : '/usr/lib/jvm/default-java/bin/java'
archiver : '/usr/bin/jar'
compiler : '/usr/bin/javac'
header prep.: '/usr/bin/javah'
cpp flags : ''
java libs : ''
configure: error: One or more Java configuration variables are not set.
Make sure R is configured with full Java support (including JDK). Run
R CMD javareconf
as root to add Java support to R.
If you don't have root privileges, run
R CMD javareconf -e
to set all Java-related variables and then install rJava.
ERROR: configuration failed for package ‘rJava’
* removing ‘/home/jmvo/R/x86_64-pc-linux-gnu-library/3.6/rJava’
Warning in install.packages :
installation of package ‘rJava’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpkTvmz8/downloaded_packages’
So I followed the instructions as root and:
sudo R CMD javareconf
Java interpreter : /usr/lib/jvm/default-java/bin/java
Java version : 11.0.3
Java home path : /usr/lib/jvm/default-java
Java compiler : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
trying to compile and link a JNI program
detected JNI cpp flags :
detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fpic -g -O2 -fdebug-prefix-map=/build/r-base-VAQCff/r-base-3.6.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c conftest.c -o conftest.o
conftest.c:1:10: fatal error: jni.h: No such file or directory
#include <jni.h>
^~~~~~~
compilation terminated.
/usr/lib/R/etc/Makeconf:167: recipe for target 'conftest.o' failed
make: *** [conftest.o] Error 1
Unable to compile a JNI program
JAVA_HOME : /usr/lib/jvm/default-java
Java library path:
JNI cpp flags :
JNI linker flags :
Updating Java configuration in /usr/lib/R
Done.
I´ve checked if I have Open JDK installed because many SO answers seems to be related with absence of JDK.
java -version
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-8u212-b03-0ubuntu1.18.04.1-b03)
OpenJDK 64-Bit Server VM (build 25.212-b03, mixed mode)
to be sure, tried installing again JDK with
sudo apt-get install openjdk-8-jdk
Reading package lists... Done
Building dependency tree
Reading state information... Done
openjdk-8-jdk is already the newest version (8u212-b03-0ubuntu1.18.04.1).
0 upgraded, 0 newly installed, 0 to remove and 74 not upgraded.
Some other SO answers suggest installing rJava via apt-get this way
sudo apt-get install r-cran-rjava
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
r-cran-rjava : Depends: r-api-3.4
E: Unable to correct problems, you have held broken packages.o
But i`m using R 3.6, so going back is not an option.
Changing to Oracle java is not an option. Many working apps are OpenJDK dependant.
No success so far. This is a never ending process. Tried many SO answers on the matter to no avail.
I need rJava not only for mail but for many other processes like connecting to Hive , and so on... from R.
Thanks
I am trying to install and older version of R (3.2.1), and am following the instructions on this page: https://www.miskatonic.org/2015/06/23/installing-r-from-source/
As suggested by the webpage, I uninstalled R
usr#ubuntu:/usr/lib/R/R-3.2.1$ R
The program 'R' is currently not installed. You can install it by typing:
sudo apt install r-base-core
And I am fairly positive that "make" is installed:
usr#ubuntu:/usr/lib/R/R-3.2.1$ sudo apt-get install make
Reading package lists... Done
Building dependency tree
Reading state information... Done
make is already the newest version (4.1-6).
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
When I run
$ ./configure
$ make
I get the following (I am not sure what is normal and what is an error message). In addition, the following files are created: Makeconf.in, Makefile.fw, Makefile.in
usr#ubuntu:/usr/lib/R/R-3.2.1$ sudo ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
loading site script './config.site'
loading build-specific script './config.site'
checking for pwd... /bin/pwd
checking whether builddir is srcdir... yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for gawk... gawk
checking whether ln -s works... yes
checking for bison... no
checking for byacc... no
checking for ar... ar
checking for a BSD-compatible install... /usr/bin/install -c
checking for sed... /bin/sed
checking for which... /usr/bin/which
checking for less... /usr/bin/less
checking for gtar... no
checking for gnutar... no
checking for tar... /bin/tar
checking for tex... no
checking for pdftex... no
configure: WARNING: you cannot build PDF versions of the R manuals
checking for pdflatex... no
configure: WARNING: you cannot build PDF versions of vignettes and help pages
checking for makeindex... no
checking for texi2any... no
configure: WARNING: you cannot build info or HTML versions of the R manuals
checking for texi2dvi... no
checking for kpsewhich... no
checking for latex inconsolata package... checking for unzip... /usr/bin/unzip
checking for zip... /usr/bin/zip
checking for gzip... /bin/gzip
checking for bzip2... /bin/bzip2
checking for firefox... /usr/bin/firefox
using default browser ... /usr/bin/firefox
checking for acroread... no
checking for acroread4... no
checking for xdg-open... /usr/bin/xdg-open
checking for notangle... false
checking for realpath... /usr/bin/realpath
checking for pkg-config... /usr/bin/pkg-config
checking for gcc... gcc
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 accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking whether gcc needs -traditional... no
checking how to run the C preprocessor... gcc -E
checking for f95... f95
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether f95 accepts -g... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking whether __attribute__((visibility())) is supported... yes
checking whether gcc accepts -fvisibility... yes
checking whether f95 accepts -fvisibility... yes
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 minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for gcc... gcc
checking whether we are using the GNU Objective C compiler... no
checking whether gcc accepts -g... no
checking for Objective C++ compiler... trying some possibilities
checking whether g++ can compile ObjC++... no
checking whether can compile ObjC++... no
no working ObjC++ compiler found
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for dlfcn.h... yes
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking how to run the C++ preprocessor... g++ -E
checking whether we are using the GNU Fortran 77 compiler... (cached) yes
checking whether f95 accepts -g... (cached) yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for f95 option to produce PIC... -fPIC
checking if f95 PIC flag -fPIC works... yes
checking if f95 static flag -static works... yes
checking if f95 supports -c -o file.o... yes
checking if f95 supports -c -o file.o... (cached) yes
checking whether the f95 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for cos in -lm... yes
checking for sin in -lm... yes
checking for dlopen in -ldl... yes
checking readline/history.h usability... no
checking readline/history.h presence... no
checking for readline/history.h... no
checking readline/readline.h usability... no
checking readline/readline.h presence... no
checking for readline/readline.h... no
checking for rl_callback_read_char in -lreadline... no
checking for main in -lncurses... yes
checking for rl_callback_read_char in -lreadline... no
checking for history_truncate_file... no
configure: error: --with-readline=yes (default) and headers/libs are not available
usr#ubuntu:/usr/lib/R/R-3.2.1$ make
make: *** No targets specified and no makefile found. Stop.
I also tried following the instructions here: Installing older version of R, but the R version 3.2.1 is NOT listed in the directory (xenial).
Does anyone have any suggestions on how I can finish installing this version of R? I appreciate the help - ahhn
EDIT:
I am now receiving the following when I get to the "./configure" step:
usr#ubuntu:~/Downloads/R-3.2.1$ ./configure --prefix=/home/usr/Downloads/R3.2.1_VERSION --enable-R-shlib --with-blas --with-lapack
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
loading site script './config.site'
loading build-specific script './config.site'
checking for pwd... /bin/pwd
checking whether builddir is srcdir... yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for gawk... gawk
checking whether ln -s works... yes
checking for bison... no
checking for byacc... no
checking for ar... ar
checking for a BSD-compatible install... /usr/bin/install -c
checking for sed... /bin/sed
checking for which... /usr/bin/which
checking for less... /usr/bin/less
checking for gtar... no
checking for gnutar... no
checking for tar... /bin/tar
checking for tex... no
checking for pdftex... no
configure: WARNING: you cannot build PDF versions of the R manuals
checking for pdflatex... no
configure: WARNING: you cannot build PDF versions of vignettes and help pages
checking for makeindex... no
checking for texi2any... no
configure: WARNING: you cannot build info or HTML versions of the R manuals
checking for texi2dvi... no
checking for kpsewhich... no
checking for latex inconsolata package... checking for unzip... /usr/bin/unzip
checking for zip... /usr/bin/zip
checking for gzip... /bin/gzip
checking for bzip2... /bin/bzip2
checking for firefox... /usr/bin/firefox
using default browser ... /usr/bin/firefox
checking for acroread... no
checking for acroread4... no
checking for xdg-open... /usr/bin/xdg-open
checking for notangle... false
checking for realpath... /usr/bin/realpath
checking for pkg-config... /usr/bin/pkg-config
checking for gcc... gcc
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 accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking whether gcc needs -traditional... no
checking how to run the C preprocessor... gcc -E
checking for f95... f95
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether f95 accepts -g... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking whether __attribute__((visibility())) is supported... yes
checking whether gcc accepts -fvisibility... yes
checking whether f95 accepts -fvisibility... yes
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 minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for gcc... gcc
checking whether we are using the GNU Objective C compiler... no
checking whether gcc accepts -g... no
checking for Objective C++ compiler... trying some possibilities
checking whether g++ can compile ObjC++... no
checking whether can compile ObjC++... no
no working ObjC++ compiler found
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for dlfcn.h... yes
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking how to run the C++ preprocessor... g++ -E
checking whether we are using the GNU Fortran 77 compiler... (cached) yes
checking whether f95 accepts -g... (cached) yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for f95 option to produce PIC... -fPIC
checking if f95 PIC flag -fPIC works... yes
checking if f95 static flag -static works... yes
checking if f95 supports -c -o file.o... yes
checking if f95 supports -c -o file.o... (cached) yes
checking whether the f95 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for cos in -lm... yes
checking for sin in -lm... yes
checking for dlopen in -ldl... yes
checking readline/history.h usability... no
checking readline/history.h presence... no
checking for readline/history.h... no
checking readline/readline.h usability... no
checking readline/readline.h presence... no
checking for readline/readline.h... no
checking for rl_callback_read_char in -lreadline... no
checking for main in -lncurses... yes
checking for rl_callback_read_char in -lreadline... no
checking for history_truncate_file... no
configure: error: --with-readline=yes (default) and headers/libs are not available
usr#ubuntu:~/Downloads/R-3.2.1$ make
make: *** No targets specified and no makefile found. Stop.
EDIT 2:
I am running into errors when I try to install readline-devel and xorg-dev:
usr#ubuntu:~$ sudo apt-get install readline-devel
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package readline-devel
usr#ubuntu:~$ sudo apt-get install xorg-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
xorg-dev : Depends: libxaw7-dev but it is not going to be installed
Depends: libxcursor-dev but it is not going to be installed
Depends: libxfont-dev but it is not going to be installed
Depends: libxft-dev but it is not going to be installed
Depends: libxpm-dev but it is not going to be installed
Depends: xserver-xorg-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Please try the following steps:
First make sure if you have libxt-dev and jdk.
dpkg -l <package name>
If not do these following commands:
sudo apt -f install && sudo apt update && sudo apt dist-upgrade
sudo apt-get install build-essential
sudo apt-get install fort77
sudo apt-get install xorg-dev
sudo apt-get install liblzma-dev libblas-dev gfortran
sudo apt-get install gcc-multilib
sudo apt-get install gobjc++
sudo apt-get install aptitude
sudo aptitude install libreadline-dev
sudo apt-get install libxt-dev
sudo apt-get install default-jdk
Then download your preferred R version and do as follows:
wget https://cran.r-project.org/src/base/R-3/R-3.2.1.tar.gz
mkdir R-3.2.1
mv R-3.2.1.tar.gz R-3.2.1/
cd R-3.2.1/
tar -xzvf R-3.2.1.tar.gz
Next, make another folder for R's binary version and use the to that folder here:
mkdir <full path>/R3.2.1_VERSION
Build R from source, please make sure to add the full path in prefix
./configure --prefix=<full path>/R3.2.1_OLDERVERSION --enable-R-shlib --with-blas --with-lapack
make
sudo make install
Once, you are finished, please set the environment variable to make sure the right version of R is called
export PATH=<full path>/R3.2.1_VERSION/bin:$PATH
If everything went smoothly then you can see your current R version as 3.2.1 when you run R.
If you want to switch to another version of R then change the environment variable to your preferred version of R package in your account as follows:
export PATH=<full path>/R<your preferred>_VERSION/bin:$PATH
I want to install R in Linux Server. I was going through the site: https://cran.r-project.org/doc/manuals/r-release/R-admin.html.
When I run the ./configure command I am getting the following:
[root#sd-cd1a-b9e0 R-devel]# ./configure
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
loading site script './config.site'
loading build-specific script './config.site'
checking for pwd... /bin/pwd
checking whether builddir is srcdir... yes
checking whether ln -s works... yes
checking for ar... ar
checking for a BSD-compatible install... /usr/bin/install -c
checking for sed... /bin/sed
checking for which... /usr/bin/which
checking for less... /usr/bin/less
checking for gtar... /bin/gtar
checking for tex... no
checking for pdftex... no
configure: WARNING: you cannot build PDF versions of the R manuals
checking for pdflatex... no
configure: WARNING: you cannot build PDF versions of vignettes and help pages
checking for makeindex... no
checking for texi2any... no
configure: WARNING: you cannot build info or HTML versions of the R manuals
checking for texi2dvi... no
checking for kpsewhich... no
checking for latex inconsolata package... checking for unzip...
/usr/bin/unzip
checking for zip... /usr/bin/zip
checking for gzip... /bin/gzip
checking for bzip2... /usr/bin/bzip2
checking for firefox... no
checking for mozilla... no
checking for galeon... no
checking for opera... no
checking for xdg-open... no
checking for kfmclient... no
checking for gnome-moz-remote... no
checking for open... /usr/bin/open
using default browser ... /usr/bin/open
checking for acroread... no
checking for acroread4... no
checking for xdg-open... no
checking for evince... no
checking for xpdf... no
checking for gv... no
checking for gnome-gv... no
checking for ggv... no
checking for okular... no
checking for kpdf... no
checking for open... /usr/bin/open
checking for working aclocal... missing
checking for working autoconf... missing
checking for working autoheader... missing
checking for bison... no
checking for byacc... no
checking for yacc... no
checking for notangle... false
checking for realpath... false
checking for pkg-config... /usr/bin/pkg-config
checking for gcc... gcc
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 accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking whether gcc needs -traditional... no
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 minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking how to run the C preprocessor... gcc -E
checking for gfortran... gfortran
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether gfortran accepts -g... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ -g -O2 can compile C++ code... yes
checking how to run the C++ preprocessor... g++ -E
checking whether __attribute__((visibility())) is supported... yes
checking whether gcc accepts -fvisibility... yes
checking whether gfortran accepts -fvisibility... yes
checking for gcc... gcc
checking whether we are using the GNU Objective C compiler... no
checking whether gcc accepts -g... no
checking whether g++ can compile ObjC++... no
checking whether can compile ObjC++... no
checking for Objective C++ compiler... no working ObjC++ compiler found
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1966080
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu
format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format...
func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver #FILE support... #
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... gawk
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared
libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared
libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared
libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for gfortran option to produce PIC... -fPIC
checking if gfortran PIC flag -fPIC works... yes
checking if gfortran static flag -static works... no
checking if gfortran supports -c -o file.o... yes
checking if gfortran supports -c -o file.o... (cached) yes
checking whether the gfortran linker (/usr/bin/ld -m elf_x86_64) supports
shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for cos in -lm... yes
checking for sin in -lm... yes
checking for dlopen in -ldl... yes
checking readline/history.h usability... no
checking readline/history.h presence... no
checking for readline/history.h... no
checking readline/readline.h usability... no
checking readline/readline.h presence... no
checking for readline/readline.h... no
checking for rl_callback_read_char in -lreadline... no
checking for main in -lncurses... no
checking for main in -ltermcap... no
checking for main in -ltermlib... no
checking for rl_callback_read_char in -lreadline... no
configure: error: --with-readline=yes (default) and headers/libs are not
available
When I run the make command I am getting the following issue:
[root#sd-cd1a-b9e0 R-devel]# make
make: *** No targets specified and no makefile found. Stop.
Can anyone please help how to get rid of this issue?
Your ./configure command failed as you can see at the bottom of the log:
configure: error: --with-readline=yes (default) and headers/libs are not
available
Here's SO answer to the error above:
error: --with-readline=yes (default) and headers/libs are not available
Even though I am a bit late here but I think this is still a quite common problem. What you have seen is that R is complaining about missing dependencies. You need to install A LOT OF packages before you are able to compile it. Here is a full list of them:
https://github.com/Jiefei-Wang/Painless-R-compilation-and-installation-on-Ubuntu
If you are using Ubuntu this is just a matter of copy and paste. Otherwise, you may need to take some time and figure out how to install them on your machine.
Every time I try installing RMySQL I get the following error:
Installing package into ‘/home/ehsan/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
* installing *source* package ‘RMySQL’ ...
** package ‘RMySQL’ 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 ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for compress in -lz... yes
checking for getopt_long in -lc... yes
checking for mysql_init in -lmysqlclient... yes
checking for egrep... 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 mysql.h usability... no
checking mysql.h presence... no
checking for mysql.h... no
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/include/mysql/mysql.h -fpic -O3 -pipe -g -c RS-DBI.c -o RS-DBI.o
cc1: warning: /usr/include/mysql/mysql.h: not a directory [enabled by default]
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/include/mysql/mysql.h -fpic -O3 -pipe -g -c RS-MySQL.c -o RS-MySQL.o
cc1: warning: /usr/include/mysql/mysql.h: not a directory [enabled by default]
In file included from RS-MySQL.c:22:0:
RS-MySQL.h:32:19: fatal error: mysql.h: No such file or directory
#include <mysql.h>
^
compilation terminated.
make: *** [RS-MySQL.o] Error 1
ERROR: compilation failed for package ‘RMySQL’
* removing ‘/home/ehsan/R/x86_64-pc-linux-gnu-library/3.0/RMySQL’
The downloaded source packages are in
‘/tmp/RtmpTRRPqg/downloaded_packages’
Warning message:
In install.packages("RMySQL") :
installation of package ‘RMySQL’ had non-zero exit status**
Seemingly, it cannot find mysql.h and I searched and changed the path to
export PKG_CPPFLAGS="-I/usr/R/include/mysql/mysql.h"
but it was not successful. There're many people who have had the same issue but non of their solutions (if existed) worked for me. I'd appreciate any comment or help.
#Update: Issue Resolved#
The following command seemed to solve the issue:
sudo apt-get install r-cran-rmysql
As said, the following command worked for me:
sudo apt-get install r-cran-rmysql
My this issue was resolved by executing the following command:
sudo apt-get install libmysql++-dev
since #ehsanmo hasn't posted his answer as an answer, then I will, and confirm that his solution works for me too:
sudo apt-get install r-cran-rmysql
(I'm on mint 12)
Well, there are two types of install/make problems. Missing .h files and/or missing .so/.a libs. As you can see from your log, you have a missing .h
The reason for these are multiple:
1.- the package that delivers these is not installed. This means that those files cannot be found anywhere in the /usr tree. The solution is to install right package, make sure the files are there
2.- The includes are not found by the install configurator. This means some environment variable or install option is not properly set. Which variable to set is usually specified in the documentation; in some cases you need to install something outside of R and again, that's usually specified in the documentation.
3.- the libs are not in the LD_LIBRARY_PATH, and hopefully the solution to that is self-explanatory.
4.- There is a deeper compile/link error, meaning the package is not compatible with the rest of the sw, or has not been properly ported.
Setp :1
find / -name mysql.h
If not found headers file is missing
Setp :1
Then install or reinstall mysql-devel or mysql-client
sudo yum (re)install mysql-devel
sudo yum (re)install mysql-client
sudo yum (re)install mysql-community-devel
sudo yum (re)install mysql-community-client