1

I am trying to install the R rgdal package on the HPC at my university. I input the usual command used for any other packages, which were correctly installed, but not for "rgdal".

install.packages("rgdal")

The output error message is the following:

configure: error: gdal-config not found or not executable

I suspect this happens because R looks for gdal-config in the shared R directory of the cluster, but installing packages is only allowed in personal libraries. In fact, when I tried to install other packages (and they worked normally, here I will use "readr" as an example) I received the following warning:

Warning in install.packages("readr") :
'lib = "/cm/shared/oswald-apps/R/gcc/4.1.0/lib64/R/library"' is not writable
Would you like to use a personal library instead? (y/n)

I've said yes to that, and I am asked

Would you like to create a personal library
~/R/x86_64-pc-linux-gnu-library/4.1
to install packages into? (y/n)

After confirming yes, as mentioned before the other packages were installed correctly and work just fine. However, when trying to install "rgdal" there's no warning message and among the other outputs there is

configure: R_HOME: /cm/shared/oswald-apps/R/gcc/4.1.0/lib64/R

So I think that for some reason "rgdal" is looking for gdal-config in the shared library, which is not writable, rather than the personal one. Since gdal-config is not there the installation is aborted.

I've been looking for the same problem and practically all the solutions suggested require using sudo, but I don't have the permission to do that. So, I guess what I'm looking for is a way to tell "rgdal" to do everything in the personal library rather than the shared one.

Any idea about how to do that?

  • 1
    Set the environment variable `GDAL_CONFIG_FILE` to the config file in your home directory and try again. [This link](https://gdal.org/user/configoptions.html) might be helpful. – digijay Oct 30 '21 at 10:25
  • Thanks for the suggestion. I am rather new to this and couldn't find the appropriate way to do so. How do I set the environment variable? – Andrea Cristiano Nov 01 '21 at 13:57
  • it's straight-forward: Open a terminal (ctrl+alt+T) and enter `GDAL_CONFIG_FILE=/path/to/your/gdal-config-file`, then try to start the installation again in that terminal. – digijay Nov 01 '21 at 16:13
  • Thank you again. The problem seemed to be actually different and I had to ask the HPC configuration engineers for support. They installed gdal on the cluster but now apparently there's another issue, GDALAllRegister is not found in libgdal. Will try to keep this topic updated in case anyone has the same issue in future. – Andrea Cristiano Nov 11 '21 at 11:02

0 Answers0