Here we provide guidelines on how to build GDAL 3.0+ and PROJ 4 (6.X.X) from source for Linux machines.
For Mac see the respective installation instructions provided on the ARIA-tools page.
- PROJ 4 SETUP
- GDAL SETUP
- Jupyter Notebooks SETUP
- Setting of environment variables
- Return to back to ARIA-tools page
Clone the PROJ 4 repository from github and install at least the version 6 release (i.e. main branch).
git clone https://github.com/OSGeo/proj.4 proj
Build the PROJ package.
cd proj
./autogen.sh
setenv CXXFLAGS "-DPROJ_RENAME_SYMBOLS -O2"
setenv CFLAGS "-DPROJ_RENAME_SYMBOLS -O2"
./configure --prefix=/my/proj/install/directory --disable-static
make -j4
make install
Clone the GDAL repository from github with a version of at least 3.0 (i.e. main branch).
git clone https://github.com/OSGeo/gdal
Build the GDAL package with the python bindings:
cd gdal/gdal/
./configure --without-libtool --with-proj=/my/proj/install/directory --prefix=/my/gdal/install/directory --with-python
make -j4
make install
Instructions to install jupyter notebooks in a conda environment
conda install -c conda-forge jupyterlab jupyter_contrib_nbextensions rise --yes
Conda will install all required jupyter packages plus contributed notebook extensions, configurator, hide code and RISE to turn notebooks into slideshow.
Edit your private module or start-up shell and add the PROJ and GDAL environment variables.
For example for csh do:
vi ~/.cshrc
Add the following and update my to the location where you installed the packages.
setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH:/my/proj/install/directory/lib:/my/gdal/install/directory/lib
setenv PROJ_LIB /my/proj/install/directory/share/proj
setenv PYTHONPATH $PYTHONPATH:/my/gdal/install/directory/lib/python3.7/site-packages
set path = ('/my/gdal/install/directory/bin' $path)