baddstats / polyclip

R package polyclip: a port of the Clipper library for polygon geometry
19 stars 6 forks source link

Can't install on CentOS-7 #17

Closed pstansell closed 4 years ago

pstansell commented 4 years ago

Hello Adrain,

I can't install the polyclip package on R version 3.6.0 running on CentOS-7.

I've tried the following:

  1. install.packages("polyclip")

    which fails with

    Rscript execution error: No such file or directory
    compiling under C++11
    checking whether the C++ compiler works... no
  2. install_github('baddstats/polyclip')

    which fails with

    
    Rscript execution error: No such file or directory
    compiling under C++11
    checking whether the C++ compiler works... no
3. `install_github('baddstats/polyclip@v1.5-7')`

   which gets a little further, but still fails with

checking for g++... g++ checking whether the C++ compiler works... yes

g++ -m64 -std=gnu++11 -I"/usr/include/R" -DNDEBUG -DPOLYCLIP_LONG64="signed long long" -DPOLYCLIP_ULONG64="unsigned long long" -I/usr/local/include ERROR: no information for variable 'CXX1XFLAGS' -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c clipper.cpp -o clipper.o g++: error: ERROR:: No such file or directory g++: error: no: No such file or directory g++: error: information: No such file or directory g++: error: for: No such file or directory g++: error: variable: No such file or directory g++: error: CXX1XFLAGS: No such file or directory

Notice how an error message seems to be contained in the `g++` compile command in failure 3 above.

I downloaded the source to try to configure that.  If I look at the config.log file I find strange things like

configure:2057: g++ -V >&5 g++: error: unrecognized command line option '-V' g++: fatal error: no input files compilation terminated. configure:2068: $? = 4 configure:2057: g++ -qversion >&5 g++: error: unrecognized command line option '-qversion' g++: fatal error: no input files

It seems to be trying to execute `g++ -qversion` instead of `g++ --version`.  I have

g++ --version g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)



Do you have any advice on how I might fix these problems?

Thanks,

Paul
rubak commented 4 years ago

Other people have experienced problems installing from CRAN or GitHub in #14. Did you try a solution from there? E.g:

wget https://cran.r-project.org/src/contrib/polyclip_1.10-0.tar.gz
tar -zxvf polyclip_1.10-0.tar.gz
Rscript -e "library('devtools'); devtools::install('polyclip')"
pstansell commented 4 years ago

Hello Ege,

Thanks for your advice. I tried what you suggested but it didn't work. One of the errors is

Rscript execution error: No such file or directory

I tested Rscript and realised that it was not working. For example, I can successfully run

R --slave --no-restore -e 'date()'
[1] "Sun Apr 19 12:07:48 2020"

but not

Rscript --verbose -e 'date()'
running
  '/usr/lib/R/bin/R --slave --no-restore -e date()'

Rscript execution error: No such file or directory

However, this shows that Rscript is trying to run /usr/lib/R/bin/R which does not exist on either my CentOS-6 or CentOS-7 systems.

An easy fix is to do

mkdir -p /usr/lib/R/bin
ln -s /usr/bin/R /usr/lib/R/bin/R

This fixed the problem. Now your suggestion of

Rscript -e "library('devtools'); devtools::install('polyclip')"

works fine. It was not a problem with polyclip after all!

Thanks,

Paul

dbrookeUAB commented 4 years ago

Other people have experienced problems installing from CRAN or GitHub in #14. Did you try a solution from there? E.g:

wget https://cran.r-project.org/src/contrib/polyclip_1.10-0.tar.gz
tar -zxvf polyclip_1.10-0.tar.gz
Rscript -e "library('devtools'); devtools::install('polyclip')"

This worked perfectly!