Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can Not Install sf package on FastR #116

Closed
ismailsunni opened this issue Nov 20, 2019 · 5 comments
Closed

Can Not Install sf package on FastR #116

ismailsunni opened this issue Nov 20, 2019 · 5 comments

Comments

@ismailsunni
Copy link

I tried to install sf package on FastR on a docker container based on this Dockerfile https://github.com/ismailsunni/dockeRs/blob/master/fastr-3.4.0-debian-geospatial/Dockerfile

As shown in the Dockerfile, I have installed the system dependencies of sf. Then I tried to install it but I got a problem in this part:

* installing *source* package ?sf? ...
** package ?sf? successfully unpacked and MD5 sums checked
configure: CC: gcc
configure: CXX: g++
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.4.3
checking GDAL version >= 2.0.0... yes
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... /usr/bin/grep
checking for egrep... /usr/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 gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking GDAL: linking with --libs only... yes
checking GDAL: /usr/share/gdal/pcs.csv readable... yes
checking GDAL: checking whether PROJ.4 is available for linking:... yes
checking GDAL: checking whether PROJ.4 is available fur running:... yes
configure: pkg-config proj exists, will use it
checking proj_api.h usability... no
checking proj_api.h presence... no
checking for proj_api.h... no
configure: error: proj_api.h not found in standard or given locations.
ERROR: configuration failed for package ?sf?
* removing ?/fastr/library/sf?


The downloaded source packages are in
	?/tmp/Rtmp1Dcnc6/downloaded_packages?
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("sf") :
  installation of package ?sf? had non-zero exit status

Checking the proj_api.h, it is there

root@62b92254f4e4:/fastr# ls /usr/include/ | grep proj
org_proj4_PJ.h
proj
proj.h
proj_api.h
proj_constants.h
proj_experimental.h
proj_json_streaming_writer.hpp
proj_symbol_rename.h
root@62b92254f4e4:/fastr#

Any idea how to fix this problem?

Thanks!

PS: I am working on a project to do benchmark a geospatial workflow across R implementation.

@steve-s
Copy link
Member

steve-s commented Nov 20, 2019

Hello Ismail,

what does pkg-config --cflags proj output? It should show the include directory. Can you try installing GNU-R (apt install base-r should work) and installing the same package in GNU-R to see if this is FastR specific?

The nuest/fastr Docker image has not been updated in a while. Maybe you can try extending this Dockerfile.

If you do not need to build FastR from sources, you can just download the GraalVM binary, install FastR using $GRAALVM_HOME/bin/gu install R and this should get you all FastR dependencies and most common dependencies of R packages:

RUN apt-get update && \
  apt-get install -y --no-install-recommends software-properties-common && \
  add-apt-repository universe && \
  apt-get update && \
  apt-get install -y --no-install-recommends libgfortran3 build-essential gfortran libxml2 libc++-dev

Finally, you can use the official GraalVM Docker image and install FastR dependencies and FastR using gu:

yum -y groupinstall 'Development Tools' && yum -y install gcc-gfortran
gu install R

@steve-s
Copy link
Member

steve-s commented Dec 9, 2019

Feel free to re-open if the suggested steps did not help.

@steve-s steve-s closed this as completed Dec 9, 2019
@ismailsunni
Copy link
Author

hi @steve-s

I manage to install FastR, but it was installing it from an interactive container. I want to create a docker image for it. Unfortunately, when I run gu install R, it takes a long time and in the end, it stuck and stopped and the docker image build fails.

After a little bit checking, I found out that it tries to download from https://github.com/oracle/fastr/releases/download/vm-19.3.0/r-installable-java8-linux-amd64-19.3.0.jar. I try to download it manually using Chrome and wget. It gives me the same problem.

My internet connection is not bad, but the download speed of it is only around 100-200KB/s.

I wonder if it is from GitHub or not. Or perhaps my internet connection. I am still trying again currently...

Thanks!

@ismailsunni
Copy link
Author

ok, it seems my network for some reason. I got it downloaded from my friend with another network.

@ismailsunni
Copy link
Author

ismailsunni commented Jan 2, 2020

Hi @steve-s
I have tried two options, that you mentioned:

The nuest/fastr Docker image has not been updated in a while. Maybe you can try extending this Dockerfile.

I tried this one, but I got a problem as I mentioned in this issue. @zslajchrt gave another Dockerfile in here

I modified a little bit and put it here. Then, I tried to install geospatial packages, but sf is still not installable. I have the dockerfile in here. The problem is still the same

configure: pkg-config proj exists, will use it
checking proj_api.h usability... no
checking proj_api.h presence... no
checking for proj_api.h... no
configure: error: proj_api.h not found in standard or given locations.
ERROR: configuration failed for package ?sf?
* removing ?/fastr/library/sf?


The downloaded source packages are in
	?/tmp/RtmpLSILKK/downloaded_packages?
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("sf") :
  installation of package ?sf? had non-zero exit status

I also tried to install r-base and see if I can install sf in the same docker container. I go it installed.

apt install r-base
/usr/bin/R

Then install sf:

> install.packages('sf')
> library('sf')
Linking to GEOS 3.8.0, GDAL 2.4.3, PROJ 6.2.1

So, it works with GNU R but not in FastR.

what does pkg-config --cflags proj output? It should show the include directory. Can you try installing GNU-R (apt install base-r should work) and installing the same package in GNU-R to see if this is FastR specific?

It doesn't show anything

root@4119df872198:/home/docker# pkg-config --cflags proj 

root@4119df872198:/home/docker# 

Finally, you can use the official GraalVM Docker image and install FastR dependencies and FastR using gu:

yum -y groupinstall 'Development Tools' && yum -y install gcc-gfortran
gu install R

I tried this one, but it seems Oracle Linux Server has outdated (?) packages, for example, I need to build GDAl since from EPEL I got version 1.9 (iirc). Then I need to install Pandoc (for my script), which seems not easy to install according to this gist, assuming Oracle Linux and CentOS has similar/same packages. It's my first time using Oracle Linux, so perhaps I am wrong.

For this one:

If you do not need to build FastR from sources, you can just download the GraalVM binary, install FastR using $GRAALVM_HOME/bin/gu install R and this should get you all FastR dependencies and most common dependencies of R packages:

RUN apt-get update && \
 apt-get install -y --no-install-recommends software-properties-common && \
  add-apt-repository universe && \
 apt-get update && \
 apt-get install -y --no-install-recommends libgfortran3 build-essential gfortran libxml2 libc++-dev

I haven't checked it yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants