I am working on a cluster where I do not have sudo permissions. I need to use "gdal". I installed it by compiling from source on a user-defined folder, and then added the path to my user .bash_profile to use this version of gdal instead of the one installed on the cluster for all users (which is an older version). Does someone see where am I failing?

How I installed gdal:

wget http://download.osgeo.org/gdal/2.4.1/gdal241.zip
unzip gdal241.zip
cd gdal-2.4.1
./configure --prefix=/home/rjb/jfajardo/gdal241  # I installed gdal in this custom folder; jfajardo is my user
make install
export PATH=$PATH://home/rjb/jfajardo/gdal241/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/rjb/jfajardo/gdal241/lib

Then, this is my .bash_profile:

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
    . ~/.bashrc

# User specific environment and startup programs
# R

# gdal
  • Can you run the application if you use the full path? what is the output of "which gdal", and "echo $PATH" – Fitz Apr 4 at 16:57
  • 2
    When setting PATH make sure you add /home/rjb/jfajardo/gdal241/bin to the front of the list PATH=/home/rjb/jfajardo/gdal241/bin:$PATH – Fitz Apr 4 at 17:00
  • Also remember that .bash_profile will only be read if bash is invoked as a login shell; if you're running things from a GUI terminal emulator, that may not be the case – steeldriver Apr 4 at 17:12
  • Thank you all! It seemed to be with the order... When I added the parth to the biggining, as in @Fitz second comment, it worked! – Javier Fajardo Apr 4 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.