Friday, November 4, 2016

Twice as (n)ISCE

UPDATE (August 2020):


In honour of ISCE release 2.4, with the removal of the distasteful terminology that cluttered previous editions, I have been trying to install it on my Windows 10 PC (with Windows Subsystem for Linux 2, running Ubuntu 20.04).

I managed to get a clean clone of the isce2 repo to compile, but not without incident. I had to hack around with several files to get it to work.

Here is what I did...

Get the repo, link the directory:
git clone https://github.com/isce-framework/isce2
ln -s isce2 isce 

Install dependencies:
sudo apt install scons libfftw3-dev libxm4 libmotif-dev python3-dev python3-pip snaphu cython3 libgdal-dev python3-gdal libhdf5-dev opencv-python libopencv-dev

sudo apt install scipy numpy h5py

I had to edit some files (paths from the isce2 directory):

1) contrib/geo_autoRIFT/autoRIFT/bindings/autoriftcoremodule.cpp - insert 
#include "opencv2/imgproc/types_c.h"
after the other include commands

2) components/zerodop/SConscript - commented out statements from line 36 to end
3) PyCuAmpcor/SConscript - commented out statements from line 14 to end
4) test/SConscript - commented out statements from line 23 to end

2) and 3) caused the compilation to crash, as I was not compiling with CUDA. You probably need them if you are. 

My new .isce/SConfigISCE : 

PRJ_SCONS_BUILD = /home/gareth/pkgs/isce/build
PRJ_SCONS_INSTALL = /home/gareth/pkgs/isce/isce

LIBPATH = /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial /usr/local/lib /home/gareth/pkgs/isce/lib /home/gareth/pkgs/isce/lib64 /home/gareth/pkgs/isce/lib32 

CPPPATH = /usr/include/python3.8 /usr/include/python3.8/numpy /usr/include/hdf5/serial /usr/include/gdal /usr/include/opencv4 

FORTRANPATH =  /usr/include
FORTRAN = /usr/bin/gfortran
CC = /usr/bin/gcc
CXX = /usr/bin/g++

MOTIFLIBPATH = /usr/lib/x86_64-linux-gnu
X11LIBPATH = /usr/lib/x86_64-linux-gnu
MOTIFINCPATH = /usr/include  
X11INCPATH = /usr/include  

(substitute 'gareth' for your own username!)

My ISCE_config.sh script is now:

export ISCE_INSTALL_ROOT=/home/gareth/pkgs/isce
export PYTHONPATH=$ISCE_INSTALL_ROOT:$PYTHONPATH
export ISCE_HOME=$ISCE_INSTALL_ROOT/isce
export PATH=$ISCE_HOME/applications:$PATH  

(substitute /home/gareth/pkgs for wherever you cloned the github repo)

I added the following lines to the end of .bashrc to tell the shell about my install:
export SCONS_CONFIG_DIR=/home/gareth/.isce
source /home/gareth/pkgs/isce/ISCE_config.sh
(again, edit to point these to your own directories and script, whatever they are called)

When compiling, scons wasn't finding the dependencies, so 
scons install --config=force
gave it a bit more encouragement. And it ran to the end.

Good luck if you're trying it yourself! I'm off to provide 'feedback' on the process to the developers...