由University of Texas at Austin的 Sergey Fomel教授等人开发的Madagascar(http://www.ahay.org/wiki/Main_Page)是当今地球物理界比较流行的一款支持多语言交互的数据处理以及文章撰写的开源软件。
环境配置:ubuntu16.04,Texlive2019,Matlab2018a
本次记录从重装的ubuntu系统开始,首先记录一下初始的系统环境调试中出现的问题:
1. 在更换源方面,由于第一次更换了不完整的aliyun源,导致频繁出现"E:安装依赖,安装包无法安装“的问题,随即更换源为:
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
2. 在修改sudoers权限时
sudo gedit /etc/sudoers
输入错误导致终端无法sudo,使用
pkexec visudo /etc/sudoers
修正即可(ctrl+O保存,然后回车,ctrl+X退出)。在root ALL=(ALL:ALL) ALL下方插入 username ALL=(ALL) ALL。
(一) 安装Texlive
本次安装为Texlive2019,百度云网盘 提取码:43tx,也可从清华源中下载 Texlive2020.iso.
安装相对简单,见Texlive2019安装简书,唯一问题就是百度云下载实在太慢,PanDownload等已被禁用,所以...慢慢等吧。
(二) 安装Matlab2018a
安装步骤详见Matlab2018a 简书
(三) 下载Madagascar
两三方法:
1. 从网站下载压缩包 madagascar-**.tar,解压:
tar -xzvf madagascar-**.tar
2. 使用命令下载(推荐):
svn co https://rsf.svn.sourceforge.net/svnroot/rsf/trunk RSFSRC
更新时直接在路径内输入命令 svn update
3. 从 https://github.com/ahay/src下载
第二种方法较为简便,但是依赖网速。本次使用的是第三种方法,使用 gitee 从github上传至仓库下载,速度很快,易于保存。
(四) 依赖环境
下载 texmf https://github.com/SEGTeX/texmf/,同样推荐使用 gitee 。
In /home/username/RSFSRC:
sudo apt-get install libxaw7-dev freeglut3-dev libnetpbm10-dev libgd-dev libplplot-dev \
libavcodec-dev libcairo2-dev libjpeg-dev swig python-dev python-numpy g++ gfortran \
libopenmpi-dev libfftw3-dev libsuitesparse-dev python-epydoc scons
sudo apt-get update
其于ubtun版本见 http://www.ahay.org/wiki/Advanced_Installation#Ubuntu
然后
sudo vim ~/.bashrc
加入:
export PATH=$PATH:/usr/local/MATLAB/R2018a/bin
source .bashrc
按顺序依次输入:
./configure API=c++,matlab,f90 --prefix=~/RSFROOT
scons install -k
sudo chown -R username ~/RSFSRC
sudo chown -R username ~/RSFROOT
打开matlab输入:
addpath(genpath('/home/username/RSFROOT/lib'));savepath
最后
sudo vim ~/.bashrc
加入:
source ~/RSFROOT/share/madagascar/etc/env.sh
source .bashrc
(if used somthing different in the --prefix option to ./configure, use that instead of ~/RSFSRC.) Please be aware that, on some systems, the default value for DATAPATH set in the script above may get automatically cleaned at some intervals, so if you want to keep your data binaries for a long time, set DATAPATH in your resource file to another location where you have write access and that allows large files. Remember that the value of DATAPATH should have a slash at the end. e.g. add
export DATAPATH=~/RSFDATA/
mkdir ~/RSFDATA/
source .bashrc
到这里Madagascar就基本配置好了(在反复的安装中,总会出现不同的问题,例如无法检测到matlab、scons莫名其妙没有安装和空RSFROOT等等,缺啥装啥,啥报错查啥,总会安好的),还有极其重要的一点,系统挂载时千万不要强行关机啥的,挽救几率为零,只能重装系统。多参照 http://www.ahay.org/wiki/Installation
---手动分割线---
In the use of Madagascar, we need to update RSFSRC in time, so that we can reproduce the new paper, the updating steps are as follows:
mv RSFSRC RSFSRC.old
svn co https://github.com/ahay/src/trunk RSFSRC
scons install -k