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?