LinuxUbuntu20.04版本下安装GAMMA2020版安装步骤安装教程GAMMA 2020版安装步骤安装教程
1. 解压GAMMA⽂件,设置环境变量
1.1 解压压缩包
选择解压压缩包的路径,建议的⽂件路径为 /usr/local, 从terminal进⼊该路径:
cd /usr/local
GAMMA安装包⼀般是以 gzip和tar打包的,将安装包拷贝到上⼀步的路径中:
cp GAMMA_SOFTWARE-yymmdd. /usr/local
cd /usr/local
解压⽂件:
gunzip -从GAMMA_SOFTWARE-yyyymmdd. > GAMMA_SOFTWARE-yyyymmdd.src.tar
tar -xuf GAMMA_SOFTWARE-yyyymmdd.src.tar
或者直接⽤下⾯代码⼀步解压:
ubuntu安装教程
sudo tar -zxvf GAMMA_
1.2 设置环境变量
默认的运⾏shell是bash,环境变量可以在bashrc中进⾏设置,先打开bashrc⽂件
sudo gedit ~/.bashrc
将下⾯的内容复制到bashrc中
export GAMMA_HOME=/usr/local/GAMMA_SOFTWARE-yyyymmdd
export MSP_HOME=$GAMMA_HOME/MSP
export ISP_HOME=$GAMMA_HOME/ISP
export DIFF_HOME=$GAMMA_HOME/DIFF
export DISP_HOME=$GAMMA_HOME/DISP
export LAT_HOME=$GAMMA_HOME/LAT
export IPTA_HOME=$GAMMA_HOME/IPTA
export GEO_HOME=$GAMMA_HOME/GEO
export PATH=$PATH:.:$MSP_HOME/bin:$ISP_HOME/bin:$DIFF_HOME/bin:$LAT_HOME/bin:$DISP_HOME/bin:$IPTA_HOME/bin:\ $MSP_HOME/scripts:$ISP_HOME/scripts:$DIFF_HOME/scripts:$LAT_HOME/scripts:$IPTA_HOME/scripts:$DISP_HOME/scripts
export OS=linux64
#This adds the Gamma Software main directory to the Python path
export PYTHONPATH=.:$GAMMA_HOME:$PYTHONPATH
#This command disables version checking for HDF5
export HDF5_DISABLE_VERSION_CHECK=1
#This sets the Gnuplot default terminal type to be QT
export GNUTERM=qt
#Alternately, this sets the default terminal type to be WXT
#export GNUTERM=wxt
#set default raster format to BMP
export GAMMA_RASTER="BMP"
第⼀⾏代码中的yyyymmdd修改为你⾃⼰的安装包⽇期
1.3选择默认的栅格图⽚格式
默认的栅格图⽚格式可以被设置,默认的是bitmap(BMP)格式。
SUN_RASTER (file extension: ras)
BMP (file extension: bmp)
TIFF (file extension: tif)
选择BMP则在bashrc中修改为
export GAMMA_RASTER="BMP"
选择TIFF格式则修改为
export GAMMA_RASTER="TIFF"
选择Sun raster (不建议)则修改为
export GAMMA_RASTER="SUN_RASTER"
注意:
Compilation of the software is carried out using the make utility and associated makefiles.
The directory structure includes a set of subdirectories for each of the Gamma packages MSP, ISP, DIFF, DISP, GEO, LAT, and IPTA. Each of the package subdirectories contains a src, bin, html subdirectories. The executable binaries are located in the bin directories of each package and source code is in the src directories. In each src directory there are several makefiles for different platforms:
makefile_static Linux build (default)
makefile_static_mingw64-2 Windows build
makefile_static_macOS MacOS build
The GCC compiler is used on all platforms. On Linux, use gcc 4.6 or later.
2 安装FFTW3
Linux系统((Debian, Ubuntu … have packages for FFTW3))下安装代码为
sudo apt-get install libfftw3-dev
基于Rdehat或者更⽼的版本请参考⽂章末尾的附录
3 安装Gnuplot和GIMP
Linux系统下的Gnuplot默认使⽤QT和WXT⼩⼯具集:
sudo apt install gnuplot gnuplot-data gimp
可以画sin(x)来测试Gnup,⾸先将下⾯⼀⾏代码确认添加到了bashrc中
export GNUTERM=wxt
然后在terminal中分别输⼊
gnuplot
plot sin(x)
如果打不开gnuplot,可以重启终端再尝试
4 安装GTK 2+开发者包
sudo apt -y install libgtk2.0-dev
5 安装GDAL
sudo apt install gdal-bin libgdal-dev libgdal20
6 安装HDF5 library (COSMO/SKYMED数据需要)
sudo apt -y install libhdf5-dev libhdf5-100
7 安装LAPACK和BLAS
sudo apt -y install libblas-dev libblas3 liblapack-dev liblapack3
8 编译GAMMA软件
在每个源⽂件⽬录下都有(DISP/src, ISP/src, MSP/src, DIFF/src, IPTA/src, and LAT/src),编译时要每个⽂件都执⾏⼀遍,因为$DISP_HOME等的环境变量都已经设置好了,所以以下代码可以在任意⽬录下执⾏。
cd $DISP_HOME/src
make -f makefile_static
9 测试软件
可以输⼊disras快速检查GAMMA软件和library的path设置是否正确
10 附录
(1)个⼈
安装libgdal20和libhdf5-100两个library时出错
(2)(官⽅安装说明)
Installing the software requires the following steps:
1. Expanding of the Gamma Software gzipped tar file and setup environment variables
2. Unpack the Gamma Software archive
3. Set Environment variables
4. Select and Set Default Raster Image Format
Notes
5. Install the FFTW3 libraries for data that are 32-bit floating point numbers (libfftw3f.so)
6. Install Gnuplot and GIMP programs
7. Install the GTK 2+ library developer packages
8. Install the GDAL library (required for Terrasar-X PRI and geocoded data, both binary and development on Linux)
9. Install the HDF5 library (required for COSMO/SKYMED data, both binary and development)
10. Install LAPACK and BLAS libraries if you have the LAT package (both binary and development on Linux)
11. Compile Gamma Software
12. Test the software installation
13. Gamma Software documentation
14. Installation of Anaconda Python3 including Scipy/Numpy/Matplotlib
Note: Ubuntu LTS configuration for running Gamma Software
15. Expanding of the Gamma software gzipped tar file and setup environment variables
1.1 Unpack the Gamma Software archive
Select the directory where you would like to unpack the Gamma Software. The suggested location is /usr/local. Go to this directory:
cd /usr/local
The software is delivered as a gzipped tar file. Place this file in the directory selected in step 1.
cp GAMMA_SOFTWARE-yyyymmdd. /usr/local/
cd /usr/local
Unpack the distribution using gunzip and tar:
gunzip -c GAMMA_SOFTWARE-yyyymmdd. > GAMMA_SOFTWARE-yyyymmdd.src.tar
tar -xvf GAMMA_SOFTWARE-yyyymmdd.src.tar
1.2 Set Environment Variables
The default shell to run the software is bash. The environment variables for compilation and running the software can be set in the .bashrc file located in your home directory.
export GAMMA_HOME=/usr/local/GAMMA_SOFTWARE-yyyymmdd
export MSP_HOME=$GAMMA_HOME/MSP
export ISP_HOME=$GAMMA_HOME/ISP
export DIFF_HOME=$GAMMA_HOME/DIFF
export DISP_HOME=$GAMMA_HOME/DISP
export LAT_HOME=$GAMMA_HOME/LAT
export IPTA_HOME=$GAMMA_HOME/IPTA
export GEO_HOME=$GAMMA_HOME/GEO
export PATH=$PATH:.:$MSP_HOME/bin:$ISP_HOME/bin:$DIFF_HOME/bin:$LAT_HOME/bin:$DISP_HOME/bin:$IPTA_HOME/bin:\
$MSP_HOME/scripts:$ISP_HOME/scripts:$DIFF_HOME/scripts:$LAT_HOME/scripts:$IPTA_HOME/scripts:$DISP_HOME/scripts
export OS=linux64
#This adds the Gamma Software main directory to the Python path
export PYTHONPATH=.:$GAMMA_HOME:$PYTHONPATH
#This command disables version checking for HDF5
export HDF5_DISABLE_VERSION_CHECK=1
#This sets the Gnuplot default terminal type to be QT
export GNUTERM=qt
Alternately, this sets the default terminal type to be WXT
#export GNUTERM=wxt
#set default raster format to BMP
export GAMMA_RASTER="BMP"
1.3 Select and Set Default Raster Image Format
The default raster image format can be set. By default it is bitmap (BMP) on all platforms. The environment variable GAMMA_RASTER can be set to change the default format for your installation:
SUN_RASTER (file extension: ras)
BMP (file extension: bmp)
TIFF (file extension: tif)
To select BMP as the default raster format, then enter:
export GAMMA_RASTER="BMP"
export GAMMA_RASTER="TIFF"
will set the default format to TIFF
export GAMMA_RASTER="SUN_RASTER"
will set the default format to Sun raster (not recommended)
To make the command permanent, add the export command to your .bashrc file.
Notes
Compilation of the software is carried out using the make utility and associated makefiles.
The directory structure includes a set of subdirectories for each of the Gamma packages MSP, ISP, DIFF, DISP, GEO, LAT, and IPTA. Each of the package subdirectories contains a src, bin, html subdirectories. The executable binaries are located in the bin directories of each package and source code is in the src directories. In each src directory there are several makefiles for different platforms:
- makefile_static Linux build (default)
- makefile_static_mingw64-2 Windows build
- makefile_static_macOS MacOS build
The GCC compiler is used on all platforms. On Linux, use gcc 4.6 or later.