Score:1

Can't install rgdal R package on computing cluster - Linux

in flag

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?

digijay avatar
mx flag
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.
in flag
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?
digijay avatar
mx flag
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.
in flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.