ISCE开源软件Linux系统配置-小白从头到尾篇

  1. 虚拟机+Ubuntu系统安装
  2. 安装Anaconda
    清华大学Anaconda镜像
    官网历史版本Anaconda镜像
    python和Anaconda的版本对应关系

查询python版本
在这里插入图片描述
安装Anaconda
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
ISCE开源软件Linux系统配置-小白从头到尾篇_第1张图片
是否添加环境变量,yes
在这里插入图片描述
在这里插入图片描述
打开一个新终端,检查是否安装成功
ISCE开源软件Linux系统配置-小白从头到尾篇_第2张图片
不成功则执行

sudo gedit ~/.bashrc

txt末尾添加

export PATH="/home/xupp/anaconda3/bin:$PATH"

更新环境变量

source ~/.bashrc
  1. 配置Anaconda中的python环境

3.1 下载源码
ISCEgithub地址

conda install git
git clone https://github.com/isce-framework/isce2.git

3.2 在anaconda中配置所需要的python环境

cd Downloads
cd isce2
conda list -e > requirements.txt

修改文件内容
ISCE开源软件Linux系统配置-小白从头到尾篇_第3张图片
配置依赖环境

conda install --yes --file requirements.txt

【注】安装时总是出错,最终选择conda install一个包一个包的安装orz,时间有限就不寻根溯源了

3.3 building ISCE
逐个安装,避免出错

apt install -y 
		gfortran 
		libmotif-dev 
		libhdf5-dev 
		libfftw3-dev 
		libgdal-dev 
		scons 
		python3 
		cython3 
		python3-scipy 
		python3-matplotlib 
		python3-h5py 
		python3-gdal 
		python3-pip 
		wget 
		curl 
		gdal-bin 
		libx11-dev
		libxt-dev
		libmotif-dev(为了Xm.h)

设置shell环境变量SCONS_CONFIG_DIR并查看

sudo gedit ~/.bashrc

在文档末尾添加

export SCONS_CONFIG_DIR=/home/lll/isce2

更新变量

source gedit ~/.bashrc

ISCE开源软件Linux系统配置-小白从头到尾篇_第4张图片
在isce2/docker中找到SConfigISCE,复制到SConstruct同目录下txt,按照提示编辑内容
编辑结果 因为是虚拟机所以将cuda注释掉了,注意build目录和install目录都以isce结尾,否则import包和调用时会出现问题

# The directory in which ISCE will be built
PRJ_SCONS_BUILD = /home/lll/isce2/build/isce

# The directory into which ISCE will be installed
PRJ_SCONS_INSTALL = /home/lll/isce2/install/isce

# The location of libraries, such as libstdc++, libfftw3 (for most system
# it's /usr/lib and/or /usr/local/lib/ and/or /opt/local/lib) /usr/lib/x86_64-linux-gnu
LIBPATH = /home/lll/anaconda3/lib 

# The location of Python.h. If you have multiple installations of python
# make sure that it points to the right one /usr/include/hdf5/serial
CPPPATH = /home/lll/anaconda3/include/python3.6m /home/lll/anaconda3/lib/python3.6/site-packages/numpy/core/include /home/lll/anaconda3/include 

# The location of the fftw3.h (most likely something like /usr/include or
# /usr/local/include /opt/local/include
FORTRANPATH =  /usr/include 

# The location of your Fortran compiler. If not specified it will use the system one
FORTRAN = /usr/bin/gfortran

# The location of your C compiler. If not specified it will use the system one
CC = /usr/bin/gcc

# The location of your C++ compiler. If not specified it will use the system one
CXX = /usr/bin/g++


#libraries needed for mdx display utility
MOTIFLIBPATH = /usr/lib64       # path to libXm.dylib
X11LIBPATH = /usr/lib           # path to libXt.dylib
MOTIFINCPATH = /usr/include     # path to location of the Xm
                                # directory with various include files (.h)
X11INCPATH = /usr/include       # path to location of the X11 directory
                                # with various include files
# list of paths to search for shared libraries when running programs
RPATH = /opt/conda/lib /usr/lib64 /usr/lib

#Explicitly enable cuda if needed
ENABLE_CUDA = False
#CUDA_TOOLKIT_PATH = $YOUR_CUDA_INSTALLATION  #/usr/local/cuda

开始编译

cd isce2
scons

如果编译报错,应该是配置文件路径问题,根据报错内容,利用以下命令进行查找包的位置和修改路径

locate 
find
whereis

3.4 添加环境变量
ISCE开源软件Linux系统配置-小白从头到尾篇_第5张图片

如果不小心改错了PATH,导致terminal无法使用命令

export PATH=/bin:/usr/bin
sudo gedit ~/.bashrc

就可以打开文件修改回来了

3.5 测试是否成功
ISCE开源软件Linux系统配置-小白从头到尾篇_第6张图片

你可能感兴趣的:(ISCE开源软件,InSAR,linux,anaconda)