本文共 3160 字,大约阅读时间需要 10 分钟。
根据gmt首先安装所需的库
tar -zxvf cmake-3.13.0-rc1.tar.gz
make build
, cd build
, ../configure --prefix=/usr/local
make
make install
安装 sudo apt-get install m4
tar xvf hdf5-1.8.20.tar
mkdir build
cd build
../configure --prefix=/usr/local
make
... 等待 ....make install
or sudo make install
因为编译netcdf需要用到curl的源码,我喜欢从源码安装。如果后面make netcdf的时候出现错误,可以尝试将从apt-get安装的curl卸载掉:
sudo apt-get autoremove curl
tar -zxvf curl-7.61.1.tar.gz
mkdir build
cd build
../configure --prefix=/usr/local
make
make install
此时如果再不提示缺什么库的话,应该会顺利通过。如果缺什么库,编译过程中会提示缺什么,继续安装所缺库即可
tar -zxvf netcdf-4.6.1.tar.gz
mkdir build
mkdir bin
cd build
../configure --prefix=/usr/local
或者其他的什么你想安装到的目录make
... 等待 ...make install
tar -zxvf gdal-2.3.2.tar.gz
cd gdal-2.3.2
../configure --prefix=/usr/local
注意:直接在主目录下面配置和make,不要创建build目录,不然会出现没有make目标的错误。make
此过程等待时间非常长....make install
tar -zxvf pcre-8.42.tar.gz
mkdir build
cd build
../configure --prefix=/usr/local
make
make install
出现了几个警告:
libtool: warning: relinking 'libpcreposix.la'
,libtool: warning: relinking 'libpcrecpp.la'
先不管
tar -zxvf blas-3.8.0.tgz
gfortran -shared -O2 *.f -o libblas.so -fPIC
~/.zshrc
: export LIBPATH=/mnt/d/Research/gmt/library/BLAS-3.8.0/libblas.so:$LIBPATH
tar -zxvf lapack-3.8.0.tar.gz
cp make.inc.example make.inc
-fPIC
到OPTS
和NOOPT
OPTS = -O2 -frecursive fPICDRVOPTS = $(OPTS)NOOPT = -O0 -frecursive fPIC
BLASLIB = ../../librefblas.soLAPACKLIB = liblapack.so
../$(LAPACKLIB): $(ALLOBJ) $(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ) $(RANLIB) $@
改为
../$(LAPACKLIB): $(ALLOBJ) $(LOADER) $(LOADOPTS) -shared -Wl,-soname,liblapack.so -o $@ $(ALLOBJ) ../librefblas.so
$(BLASLIB): $(ALLOBJ) $(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ) $(RANLIB) $@
改为
$(BLASLIB): $(ALLOBJ) $(LOADER) $(LOADOPTS) -z muldefs -shared -Wl,-soname,librefblas.so -o $@ $(ALLOBJ)
如果你没有g77编译器,请将第2步拷贝的make.inc文件中的两个
g77
更换为你的fortran编译器比如gfortran
make blaslibmake lapacklib
export LIBPATH=/mnt/d/Research/gmt/library/BLAS-3.8.0/libblas.so:/mnt/d/Research/gmt/library/lapack-3.8.0/liblapack.so:$LIBPATH
sudo apt-get install libomp-dev
tar -zxvf fftw-3.3.8.tar.gz
make build
, cd build
, ../configure --prefix=/usr/local
make
make install
sudo apt-get update
sudo apt-get install ghostscript
下载
设置路径: 环境变量
GSHHG_PATH
DCW_PATH
mkdir buildcd buildcmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=RelWithDebInfo ..make -j
git remote -v
git remote add upstream https://github.com/GenericMappingTools/gmt.git
其中upstream是官方仓库,orgin是你fock之后存在你自己的github账户里的仓库git fetch upstream
git checkout master
git merge upstream/master
git remote set-url origin xxxx.git
git remote rm origin
如果发现在终端不能直接用
gmt
命令,那是因为安装了git的插件的原因。一般这个是由于on my zsh引起的,gmt这个词被定义为了 alias g./home/zguo/.oh-my-zsh/plugins/git/git,定义的文件为:/home/zguo/.oh-my-zsh/plugins/git/git.plugin.zsh
,找到这个文件打开之后把这一行注释掉,然后重新source一下或者重新打开一下终端就好了。
转载地址:http://wpfga.baihongyu.com/