I am trying to make software install to a specific directory. I found several ways, but not sure what are the differences between them.
./configure --pre
This can help illustrating the use of DESTDIR and --prefix (from here):
Multiple installs using --prefix and DESTDIR:
Sepcify a different --prefix location/option for each build - at configure time. For eg:
untar petsc tar ball ./configure --prefix=/opt/petsc/petsc-3.9.0-mpich --with-mpi-dir=/opt/mpich make make install DESTDIR=/tmp/petsc-pkg untar petsc tar ball ./configure --prefix=/opt/petsc/petsc-3.9.0-openmpi --with-mpi-dir=/opt/openmpi make make install DESTDIR=/tmp/petsc-pkg