Stephen Henderson
Stephen Henderson

Reputation: 6532

building R from source: make error 1

I am trying to build R from source in a directory that I have read,write exec access (on unix server). I've tried googling about for this particular error and searching SO to no avail. I feel it is something daft.

I have unpacked the source (R-3.0.2) changed to that directory /home/rmgzshd/R-3.0.2 and run ./configure --prefix=$HOME/R-3.0.2 successfully (I think) and I have the dependencies required, e.g. the ./configure messages end with:

R is now configured for x86_64-unknown-linux-gnu
  Source directory:          .
  Installation directory:    /home/rmgzshd/R-3.0.2
  C compiler:                gcc -std=gnu99  -g -O2
  Fortran 77 compiler:       gfortran  -g -O2
  C++ compiler:              g++  -g -O2
  Fortran 90/95 compiler:    gfortran -g -O2
  Obj-C compiler:
  Interfaces supported:      X11
  External libraries:        readline
  Additional capabilities:   PNG, JPEG, NLS
  Options enabled:           shared BLAS, R profiling
  Recommended packages:      yes

and I seem to have the correct directory structure and Makefiles in the same ./configure directory:

ChangeLog      configure     etc      m4           Makefile.bak  Makefrag.cc_lo  NEWS.0    po      SVN-REVISION  VERSION-NICK
config.log     configure.ac  INSTALL  Makeconf     Makefile.fw   Makefrag.cxx    NEWS.1    README  tests
config.site    COPYING       lib64    Makeconf.in  Makefile.in   Makefrag.m      NEWS.2    share   tools
config.status  doc           libtool  Makefile     Makefrag.cc   NEWS            NEWS.pdf  src     VERSION 

However the make command is failing with a message that seems just wrong...(as m4 exists)

/bin/sh: line 1: cd: m4: No such file or directory

I have also tried just a simpler ./configure without the --prefix followed by make but that makes my Installation directory /usr/bin and fails with the same error.

Has anyone come across this problem? Should Source directory: be . for instance?

thx

EDIT following the suggestion below I tried make distclean but clearly the paths are borked somehow, and despite what the ./configure message says as I get:

make distclean
/bin/sh: line 1: cd: tests: No such file or directory
/bin/sh: line 1: cd: src: No such file or directory
/bin/sh: line 1: cd: share: No such file or directory
/bin/sh: line 1: cd: etc: No such file or directory
/bin/sh: line 1: cd: doc: No such file or directory
/bin/sh: line 1: cd: tools: No such file or directory
/bin/sh: line 1: cd: m4: No such file or directory

but they are all there in /home/rmgzshd/R-3.0.2 where I execute the command...

Upvotes: 0

Views: 2414

Answers (1)

fra
fra

Reputation: 852

I solved this exactly same problem by changing the value of CDPATH from CDPATH=/some/location to CDPATH=. Alternatively if you need to retain the value in the CDPATH, simply add . to it CDPATH=.:/some/location.

If you want to read more about this behaviour, visit https://unix.stackexchange.com/questions/112363/is-cdpath-behavior-broken-in-bourne-shell-bin-sh

Upvotes: 1

Related Questions