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

Issue with installing certain geospatial packages in R on notebook server #1132

Open
mladd052 opened this issue May 27, 2022 · 3 comments
Open
Labels
kind/bug Something isn't working

Comments

@mladd052
Copy link

Describe the bug

The issue is installing certain geospatial packages in R such as sf and others. For this issue I will just focus on the issue with the sf package. Once that is working I can test the installation of the other packages. I tried running conda install r-sf before but that did not solve the issue. I ran conda install r-raster for the raster package before but not sure if the same approach works for sf.

Environment info

Namespace: matthew-ladd

Notebook/server: ml-working

Steps to reproduce

I connect to my JupyterLab notebook and in the terminal window start R. I run my R script which checks if certain geospatial packages are installed and loads them. If they are not installed, the script will install them. The first package is sf and the output I get is shown below.

Expected behaviour

I expect that the sf package should be installed along with the dependencies (if not already installed) when running my script.

Output from R console

source("geoprocessing_v2.r")
Loading required package: sf
also installing the dependency ‘units’
trying URL 'http://jfrog-platform-artifactory-ha.jfrog-system:8081/artifactory/dev-cran-remote/src/contrib/units_0.8-0.tar.gz'
Content type 'application/x-gzip' length 866695 bytes (846 KB)

downloaded 846 KB
trying URL 'http://jfrog-platform-artifactory-ha.jfrog-system:8081/artifactory/dev-cran-remote/src/contrib/sf_1.0-7.tar.gz'
Content type 'application/x-gzip' length 3529597 bytes (3.4 MB)

downloaded 3.4 MB

  • installing source package ‘units’ ...
    ** package ‘units’ successfully unpacked and MD5 sums checked
    ** using staged installation
    configure: units: 0.8-0
    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 x86_64-conda-linux-gnu-c++ -std=gnu++14 accepts -g... yes
    checking how to run the C++ preprocessor... x86_64-conda-linux-gnu-c++ -std=gnu++14 -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 for stdbool.h that conforms to C99... no
    checking for _Bool... no
    checking for error_at_line... yes
    checking for gcc... x86_64-conda-linux-gnu-cc
    checking whether we are using the GNU C compiler... yes
    checking whether x86_64-conda-linux-gnu-cc accepts -g... yes
    checking for x86_64-conda-linux-gnu-cc option to accept ISO C89... none needed
    checking for XML_ParserCreate in -lexpat... no
    checking udunits2.h usability... no
    checking udunits2.h presence... no
    checking for udunits2.h... no
    checking udunits2/udunits2.h usability... no
    checking udunits2/udunits2.h presence... no
    checking for udunits2/udunits2.h... no
    checking for ut_read_xml in -ludunits2... no
    configure: error: in `/tmp/RtmpvegYSD/R.INSTALL18406f255d11/units':
    configure: error:

Configuration failed because libudunits2.so was not found. Try installing:
* deb: libudunits2-dev (Debian, Ubuntu, ...)
* rpm: udunits2-devel (Fedora, EPEL, ...)
* brew: udunits (OSX)
If udunits2 is already installed in a non-standard location, use:
--configure-args='--with-udunits2-lib=/usr/local/lib'
if the library was not found, and/or:
--configure-args='--with-udunits2-include=/usr/include/udunits2'
if the header was not found, replacing paths with appropriate values.
You can alternatively set UDUNITS2_INCLUDE and UDUNITS2_LIBS manually.

See `config.log' for more details
ERROR: configuration failed for package ‘units’

  • removing ‘/opt/conda/lib/R/library/units’
    ERROR: dependency ‘units’ is not available for package ‘sf’
  • removing ‘/opt/conda/lib/R/library/sf’
    The downloaded source packages are in
    ‘/tmp/RtmpxazPjN/downloaded_packages’
    Updating HTML index of packages in '.Library'
    Making 'packages.html' ... done
    Error in library(sf) : there is no package called ‘sf’

Additional context

I found some info on the error above at https://stackoverflow.com/questions/61234169/how-to-solve-error-libudunits2-a-not-found-when-installing-udunits2-in-r-3

Also, the other geospatial packages that my script will check for are rgdal, raster, terra and ncdf4, so once sf is installed I can test the installation of these packages.

@mladd052 mladd052 added the kind/bug Something isn't working label May 27, 2022
@chuckbelisle
Copy link
Contributor

Reviewed ticket and prioritized it to next sprint. Will offer a solution at that time.

@Jose-Matsuda
Copy link
Contributor

Jose-Matsuda commented Jun 24, 2022

(Will be updating this comment as information becomes clear to me)
Initially I was afraid that this could be a little bit bigger than a small because in my exploration I found this older issue where we uninstalled libpdffox-java StatCan/aaw-kubeflow-containers#249 (comment) due to a vulnerability.

This appears to have been resolved as when I trivy image localimage then the CVE does not appear. I will try seeing what Matthew provided above, as these packages are gis specific. The total size of this image is 9.42 GB (an additional 500 Mb)

I did find this might be more minimal but I will see how much the image size increases. The size of this image is 8.94 Gb (40 Mb bigger than regular)

I got this
image
but sf does not appear when I run installed.packages()

@chuckbelisle
Copy link
Contributor

@mladd052 as Jose mentioned, the issue has been resolved. Could you please confirm?

@bryanpaget bryanpaget assigned bryanpaget and unassigned bryanpaget Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants