microsoft / microsoft-r-open

Microsoft R Open Source
212 stars 74 forks source link

Unable to Install `sf` on Fedora. #112

Closed ismailsunni closed 4 years ago

ismailsunni commented 4 years ago

I know that Fedora is not officially supported, but it turns out it just work with the same installer as RHEL/CentOS installer. See here

Now, I want to install one of my favorites package, sf. Unfortunately, I got this error:

> install.packages('sf')
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 7975k  100 7975k    0     0  83569      0  0:01:37  0:01:37 --:--:--  175k
* installing *source* package ‘sf’ ...
** package ‘sf’ successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++ -std=gnu++11
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.3.2
checking GDAL version >= 2.0.0... yes
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... /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 is available for linking:... yes
checking GDAL: checking whether PROJ 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’

And here is how to reproduce it (I have docker image for this): To replicate, go to the docker container:

# To open new R session
docker run  -it --rm ismailsunni/mro-3.5.3-fedora-geospatial R

or

# Run shell in the docker container
docker run -it --rm ismailsunni/mro-3.5.3-fedora-geospatial /bin/bash
# Open MRO session
R

The second way is probably more useful if you want to investigate the docker container.

Then install sf

install.packages('sf')

And it will give the same error as above

I tried to install GNU R in the same docker container, and it is possible to install sf on GNU R. So, I am thinking that this is not the package-specific.

Any recommendations or pointer on how to fix this issue?

Thanks

Related issue: https://github.com/ismailsunni/dockeRs/issues/39

ismailsunni commented 4 years ago

After switching to Fedora 30, it works fine. See my docker image here: https://github.com/ismailsunni/dockeRs/blob/master/mro-3.5.3-fedora-30-geospatial/Dockerfile which is based on this Docker image https://github.com/ismailsunni/dockeRs/blob/master/mro-3.5.3-fedora-30/Dockerfile