2

I am attempting to install rJave / JRI (code that lets you run R commands from within a Java application) on a Linux 13.10 "cloud" / virtual server.

If I try install.packages("rJava") from within R, I get "

* installing *source* package ‘rJava’ ...
** package ‘rJava’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... no
configure: error: in `/tmp/RtmpW6xdRi/R.INSTALLbff775d77a6/rJava':
configure: error: C compiler cannot create executables
See `config.log' for more details

Unfortunately, I have no idea where config.log is, and find / -name "config.log" doesn't find anything. So I downloaded the source and tried to install:

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc -std=gnu99
checking for C compiler default output file name... 
configure: error: C compiler cannot create executables
See `config.log' for more details.

Now, at least, I have a config log. Any explanation on why this is failing would be greatly appreciated:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by JRI configure 0.3, which was
generated by GNU Autoconf 2.61.  Invocation command line was

  $ ./configure 

## --------- ##
## Platform. ##
## --------- ##

hostname = greg1304
uname -m = x86_64
uname -r = 3.8.0-33-generic
uname -s = Linux
uname -v = #48-Ubuntu SMP Wed Oct 23 09:16:58 UTC 2013

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games
PATH: /home/gregd/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1722: checking build system type
configure:1740: result: x86_64-unknown-linux-gnu
configure:1762: checking host system type
configure:1777: result: x86_64-unknown-linux-gnu
configure:1910: checking for gcc
configure:1937: result: gcc -std=gnu99
configure:2175: checking for C compiler version
configure:2182: gcc -std=gnu99 --version >&5
gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2185: $? = 0
configure:2192: gcc -std=gnu99 -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.7.2-2ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-l
anguages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr
/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --ena
ble-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with
-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1) 
configure:2195: $? = 0
configure:2202: gcc -std=gnu99 -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2205: $? = 4
configure:2228: checking for C compiler default output file name
configure:2255: gcc -std=gnu99 -O2 -pipe -g   conftest.c  >&5
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: cannot find -lc
/usr/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
configure:2258: $? = 1
configure:2296: result: 
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME "JRI"
| #define PACKAGE_TARNAME "jri"
| #define PACKAGE_VERSION "0.3"
| #define PACKAGE_STRING "JRI 0.3"
| #define PACKAGE_BUGREPORT "simon.urbanek@r-project.org"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:2303: error: C compiler cannot create executables
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-unknown-linux-gnu
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=x86_64-unknown-linux-gnu
ac_cv_prog_ac_ct_CC='gcc -std=gnu99'

## ----------------- ##
## Output variables. ##
## ----------------- ##

CC='gcc -std=gnu99'
CFLAGS='-O2 -pipe -g'
CPICF=''
CPP='gcc -std=gnu99 -E'
CPPFLAGS=''
DEFFLAGS=''
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
GREP=''
JAR=''
JAVAC=''
JAVAH=''
JAVA_CFLAGS=''
JAVA_HOME='/usr/lib/jvm/java-6-openjdk'
JAVA_INC=''
JAVA_LD_PATH=''
JAVA_LIBS=''
JAVA_PROG=''
JNILD=''
JNIPREFIX=''
JNISO=''
LDFLAGS=''
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
OBJEXT=''
PACKAGE_BUGREPORT='simon.urbanek@r-project.org'
PACKAGE_NAME='JRI'
PACKAGE_STRING='JRI 0.3'
PACKAGE_TARNAME='jri'
PACKAGE_VERSION='0.3'
PATH_SEPARATOR=':'
RINC='-I/usr/share/R/include'
RLD='-L/usr/lib/R/lib -lR'
R_DOC_DIR='/usr/share/R/doc'
R_HOME='/usr/lib/R'
R_INCLUDE_DIR='/usr/share/R/include'
R_SHARE_DIR='/usr/share/R/share'
SHELL='/bin/bash'
ac_ct_CC='gcc -std=gnu99'
bindir='${exec_prefix}/bin'
build='x86_64-unknown-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='unknown'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='x86_64-unknown-linux-gnu'
host_alias=''
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE_NAME "JRI"
#define PACKAGE_TARNAME "jri"
#define PACKAGE_VERSION "0.3"
#define PACKAGE_STRING "JRI 0.3"
#define PACKAGE_BUGREPORT "simon.urbanek@r-project.org"

configure: exit 77
Greg Dougherty
  • 3,281
  • 8
  • 35
  • 58
  • The fact that the build tries a `-V` flag is interesting, it doesn't exist for me either. It's quite possible their build setup is actually broken, or (hopefully) you've tried to do this with the wrong environment setup... – Veltas Jan 30 '14 at 01:21
  • @Veltas just looking through the configure script, that issue is rather harmless if I understand the code correctly. – fvu Jan 30 '14 at 01:24
  • 1
    @GregDougherty have a look at http://stackoverflow.com/questions/6329887/compiling-problems-cannot-find-crt1-o - I think that the missing crt1.o & co files is the central issue, there are a couple of possible solutions and workarounds you can try. However, the rJava version on [GitHub](https://github.com/s-u/rJava) is significantly different from yours, are you sure you have a reasonably recent version? – fvu Jan 30 '14 at 01:29
  • @fvu:$ sudo apt-get install libc0.1-dev Package libc0.1-dev is not available, but is referred to by another package. However the following packages replace it: libc-dev-bin:i386 libc-dev-bin E: Package 'libc0.1-dev' has no installation candidate $ sudo apt-get install libc-dev-bin libc-dev-bin is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. – Greg Dougherty Jan 30 '14 at 20:46
  • @fvu: Thank you for the pointer to GitHub. I got mine from rforge, and they're many versions behind http://www.rforge.net/JRI/svn.html – Greg Dougherty Jan 30 '14 at 20:49

3 Answers3

0

I'm not sure about your C problems, but I don't think you'll get anywhere if it tests your C++ compiler with those flags - I think that -std=gnu99 is invalid for c++ (although it works with c, hence my assumption you already have some other problem)

Edit: Also not sure if this is a versioning thing (my gcc is 4.8.1), although I doubt it, but you have a 64bit target but no 64 bit libraries for gcc, as far as I can see? My output for gcc-std=gnu99 -v includes a couple of flags near the bottom, which you have some but not all of:

--with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu

Perhaps your problem lies here, if the program is checking for 64 bit compiled executables (given your system is x64_86?)

chrisb2244
  • 2,940
  • 22
  • 44
  • Are you trying to say that Greg is compiling on the wrong architecture? – Veltas Jan 30 '14 at 01:16
  • @Veltas My suggestion is if the rJava code is picking up a 64 bit arch, it might try a 64 bit compiler, but I can't see any flags indicating that his gcc includes 64 bit libraries. So I guess, yes, although not for the program he's currently compiling. – chrisb2244 Jan 30 '14 at 01:18
  • Looking at the changelog on Launchpad : [https://launchpad.net/+search?field.text=4.7.2-2ubuntu1&field.actions.search=Search] lists a number of issues with headers, but I'd assume these were patches that fixed issues before it became a part of the software center? @Greg, if you don't need that specific version of gcc, you could try getting a different version? Since it looks like you installed the binaries rather than compiled it yourself, it shouldn't take more than a couple of minutes, right? – chrisb2244 Jan 30 '14 at 01:26
  • Here's what I get when I just run gcc gcc-std=gnu99 -v gcc: error: gcc-std=gnu99: No such file or directory Using built-in specs. Target: x86_64-linux-gnu Configured with: ... --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --libexecdir=/usr/lib --libdir=/usr/lib --with-sysroot=/ --enable-clocale=gnu --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1) – Greg Dougherty Jan 30 '14 at 20:17
0

So I upgraded for 13.04 to 13.10, and that apparently upgraded my gcc from 4.7 to 4.8. So I tried again, and this time everything worked.

So I'm going to call this a gcc 4.7 bug.

Thank you for all the assistance.

Greg Dougherty
  • 3,281
  • 8
  • 35
  • 58
0

For reference: on Ubuntu 16.04 you have to install 'libc6-dev'

Ott Toomet
  • 1,894
  • 15
  • 25