ROI_PAC_3_0_1 in Cygwin

Here I post my trial-and-error approaches in using ROI_PAC_3_0 under Cygwin. I know that ROI_PAC_3_0 works fine or may perform better in Linux, Mac OS X, and other workstations. The reason I prefer cygwin is that I can still use windows environment while running ROI_PAC_3_0. As you probably have experienced, the installation will never be completed in one go. The procedures that I have posted here may work only on my machine. I just want to encourage you to keep going by knowing that someone has gone this far. You can make contribution to this website with your own experience. Good luck to you.

Prof. Hoonyol Lee, Department of Geophysics, Kangwon National University, Chuncheon, Kangwon-do 200-701, Republic of Korea. Email: hoonyol@kangwon.ac.kr, Tel: +82-33-250-8587.

Last updated: 2009-10-23 11:19:07

Cygwin Installation

bullet

Cygwin (2 hours)

Cygwin homepage: http://www.cygwin.com

Setup program: http://www.cygwin.com/setup.exe (Save it to update later.)

Cygwin download sites: http://cygwin.com/mirrors.html

       Examples: ftp://cygwin.osuosl.org/pub/cygwin : Oregon State University

                     ftp://ftp.daum.net : Daum Korea

Installing packages: Install all if you are not sure what to install.

  

bullet

Packages external to Cygwin

    gfortran

        Homepage: http://gcc.gnu.org/wiki/GFortranBinaries 

        Download: http://quatramaran.ens.fr/~coudert/gfortran/gfortran-4.5-Cygwin-i686.tar.bz2

        Instructions for installation: http://gcc.gnu.org/wiki/GFortranBinariesCygwin

            tar -xjvf gfortran-4.4-Cygwin-i686.tar.bz2 -C /

bullet

Desktop links for your convenience

        /usr/X11R6/bin/startx (This initiates the X and brings an X-terminal)

        /usr/bin/xterm (Use this command for additional X-terminals)

   

ROI_PAC_3_0_1 Installation

bullet

Download the ROI_PAC_3_0_1 source code (1.3 MB) and a test data (174 MB) from http://www.openchannelfoundation.org/projects/ROI_PAC.

bullet

Open an xterm. The X-environment can support past-and-copy action with the mouse button.

        startxwin.bat

bullet

Follow the instructions on ROI_PAC/AAREADME_BUILD_ROIPAC. It tries multiple compilation methods and reports you successful attempts if any. Two compilation methods, gfortran and gfortran-g, were successful on my machine. However only the gfortran-g has successfully gone through the test-run. Major keystrokes are as follows.

        which gfortran gcc

        touch aclocal.m4 Makefile.in configure

        ./contrib/install-fftw.sh CC=cc        (5 min)

        export FFTW_LIB_DIR="directory containing libfftw3f.a"   (use copy-and-paste action)

        export FFTW_INC_DIR="directgory containing fftw3.f"

        ./contrib/multibuild.sh

       

        mkdir test-runs

        cd test-runs

        which uncompress

        vi test-runs.x

MULTITEST="/home/hoonyol/ROI_PAC_3_0/ROI_PAC/contrib/multitest.sh"
TESTTAR="/home/hoonyol/ROI_PAC_3_0/roi_pac_testdir.tar"
PERLDIR="/home/hoonyol/ROI_PAC_3_0/ROI_PAC/multibuild-081206-0546/installs/share/roi_pac"

BINDIR="/home/hoonyol/ROI_PAC_3_0/ROI_PAC/multibuild-081206-0546/installs/defaults/bin"
$MULTITEST $TESTTAR $PERLDIR $BINDIR

BINDIR="/home/hoonyol/ROI_PAC_3_0/ROI_PAC/multibuild-081206-0546/installs/gfortran/bin"
$MULTITEST $TESTTAR $PERLDIR $BINDIR

BINDIR="/home/hoonyol/ROI_PAC_3_0/ROI_PAC/multibuild-081206-0546/installs/gfortran-g/bin"
$MULTITEST $TESTTAR $PERLDIR $BINDIR

bullet

Alternative installations (Not necessary if the previous attempt was successful.)

        export ROI_PAC_3_0_1="select the right path to ROI_PAC_3_0_1"

        cd $ROI_PAC_3_0_1/ROI_PAC

        ./configure

        make

        make install

        mv /usr/local/bin/* $ROI_PAC_3_0/INT_BIN

     Due to an uncertain reason you need to create an empty README file to avoid an error during make. Check the error log during compilation. Here is the log file of a successful installation.  

       

bullet

Configuring ROI_PAC/DOC/SAR_CONFIG file:

        In .bashrc put:

            source $ROI_PAC_3_0_1/ROI_PAC/DOC/SAR_CONFIG

        Edit SAR_CONFIG file containing:

            export ROI_PAC_3_0_1="Full path to ROI_PAC_3_0_1 directory"

            export ROI_PAC="$ROI_PAC_3_0_1/ROI_PAC"

            export INT_BIN="$ROI_PAC/INT_BIN"

            export INT_SCR="$ROI_PAC/INT_SCR"

            export SAR_PRC_DIR="Full path to ERS Preliminary Orbit Data"

            export SAR_ODR_DIR="Full path to ERS Delft Orbit Data"

            export SAR_ODR_ENVI="Full path to Envisat Delft Orbit Data"

            export INS_DIR="Full path to Envisat INS Data"

            export VOR_DIR="Full path to Envisat Verified Orbit Record Data"

            export POR_DIR="Full path to Envisat Preliminary Orbit Record Data"

            export PATH=$PATH:$INT_BIN;$INT_SCR

bullet

    MDX Compilation for visualization of the results

        Download site: https://download.jpl.nasa.gov/ops/request/index.cfm 

Amend Makemdx_g77

XINC = -I/usr/X11R6/include

XLIB = -lXm -L/usr/X11R6/lib  -lXt  -lX11

make -f Makemdx_g77

Running ROI_PAC

    There are several online resources regarding the execution of ROI_PAC.

bullet

D. Schmidt at U. Oregon   http://www.uoregon.edu/~das/WikiRoiPac/doku.php?id=welcome

bullet

ROI_PAC Wiki  http://www.roipac.org/

bullet

Open Channel Foundation ROI_PAC Forum  http://www.openchannelsoftware.com/forum/forum.php?forum_id=99

bullet

Y. Fialko at UC San Diego  http://igpphelp.ucsd.edu/~fialko/roi_pac.html

bullet

M. Pritchard at Cornell University  http://www.geo.cornell.edu/eas/PeoplePlaces/Faculty/matt/roi_pac.html/

Envisat 2-Pass DInSAR Example

    Coming Soon

ALOS PALSAR Processing

bullet

Installation to handle complex variables for cygwin

Download: http://www.netlib.org/cephes/c9x-complex.tgz

Document: http://www.nabble.com/Where-is-complex.h-td5474896.html (see bottom of the messages)

Installation:

Amend makefile:

LIBMCFILES = $(SFILES) $(DFILES) $(LFILES) stubs.o

make  (ignore errors)

mv libmc.a /usr/lib

mv *.h /usr/include

bullet

ALOS Preprocessing Software:

Guideline: http://www.roipac.org/ALOS_PALSAR

Download: http://www-rohan.sdsu.edu/~rmellors/ALOS_preproc.tar.gz

Installation:

tar -xjvf ALOS_preproc.tar.gz

arch  (to find system architecture, i686, for example, and to locate the binary files)

make

bullet

    Edit SAR_CONFIG:

export $MY_BIN="$ROI_PAC_3_0/ALOS/ALOS_preproc_Aug_2008/bin/i686"  (for example)

bullet

make_raw_alos.pl of Zhenhong Li, 19 Oct. 2007 version:

Download: http://www.roipac.org/ALOS_PALSAR?action=AttachFile&do=get&target=make_raw_alos.pl

Replace it with the one in INT_SCR

bullet

Additional compilation of ALOS_fbs2fbd

 cd ALOS_fbd2fbs

 make -f Makefile_fbs2fbd

 cp ALOS_fbs2fbd.exe  ../bin/i686

   

bullet

Out of Memory Problem : Core

ALOS FBS data requires 1.5 GB memory for roi processing. This is due to its large coherent integration lines (more than 6000 lines).

Simply add more memories into your PC (2 GB may not be enough. More than 3 GB recommended). If you have enough memory and the problem persist, then try the following.

In Cygwin, the maximum size of memory that a program can use is set to 384 MB by default. You can increase the limit to 2048 MB by:

    regtool -i set /HKLM/Software/Cygnus\ Solutions/Cygwin/heap_chunk_in_mb 2048

    regtool -v list /HKLM/Software/Cygnus\ Solutions/Cygwin

You need to reboot the system. Try 4096 MB if necessary.

bullet

Out of Memory Problem: stack size

You can check the default stack size by:

    ulimit -a

or

    ulimit -H -a

If the stack size is 2033, for example, you may encounter 'Out of Memory' error in roi. Unix system allows 'ulimit -s unlimited' command to increase the stack size, but cygwin does not. You need to recompile the ROI_PAC with compiler options that increases the stack size. The following example set the stack size to 8 MB during compilation.

    cd ROI_PAC_3_0/ROI_PAC

    export CFLAGS="-g -O2 -Wl,--stack,8388608"

    export FCFLAGS="-g -O2 -Wl,--stack,8388608"

    export FFLAGS="-g -O2 -Wl,--stack,8388608"

    ./configure

    make

    make install

Increase to 16 MB, 32 MB, 64 MB or even more if the problem persists.

bullet

dopav.pl error in opening RscDocDir/SL_AZIMUT_RESOL@dopav.pl:96.txt :

Cygwin does not allow the special character ":" as a filename. You need to edit $INT_SCR/Generic.pm file. In Doc_rsc subroutine, change ":" to a different character such as "_". You can do so by commenting out the line 594 and change as follows:

# $rsc_doc_invariant="$use_rsc_doc{RSC_Keyword}\@$use_rsc_doc{RSC_Source_Filename}:$use_rsc_doc{RSC_Source_Line_Number}";

$rsc_doc_invariant="$use_rsc_doc{RSC_Keyword}\@$use_rsc_doc{RSC_Source_Filename}_$use_rsc_doc{RSC_Source_Line_Number}";

To jump to the line number 594 in vi editor, type 594 followed by Shift-g in command mode.

bullet

Blurred and faint replica precedes the image in range by ~ 1 km. Some suggested the erroneous doppler value and suggested to use the value between -0.5 to 0.5 for doppler centroid by adding or subtracting 1 from the existing value in *.raw.rsc. However this could not solve the problem and I am stuck.