666 字
3 分钟
安装基础地震常用软件脚本

安装基础地震常用软件脚本#

Terminal window
sudo apt update
sudo apt upgrade
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm ~/miniconda3/miniconda.sh
source ~/miniconda3/bin/activate
conda init --all
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --set show_channel_urls yes
pip install pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip install numpy scipy pandas matplotlib seaborn
pip install numpy pandas matplotlib
pip install scipy
pip install tqdm
pip install jupyter
pip install matplotlib
pip install scons
sudo apt install python3 python-is-python3 python3-dev python-dev-is-python3 python3-pip python3-numpy libxaw7-dev freeglut3-dev libnetpbm10-dev libgd-dev libplplot-dev libcairo2-dev libjpeg-dev swig g++ gfortran libopenmpi-dev libfftw3-dev libsuitesparse-dev git
sudo apt update
sudo apt install -y build-essential gfortran libx11-dev libxt-dev libxaw7-dev xorg-dev libmotif-dev libxmu-dev libxext-dev libpng-dev libjpeg-dev libgif-dev libtiff-dev libfftw3-dev libblas-dev liblapack-dev ghostscript gv
sudo apt install x11-apps
sudo apt install libtirpc-dev
sudo apt-get install imagemagick

安装seismic Unix#

Terminal window
cd ~/Software/seismic_unix
tar -xvf cwp_su_all_44R28.tgz
echo '# Seismic Unix
export CWPROOT=~/Software/seismic_unix
export PATH=$PATH:$CWPROOT/bin' >> ~/.bashrc
~/.bashrc
cp ~/Software/seismic_unix/Makefile.config ~/Software/seismic_unix/src/Makefile.config
cd ~/Software/seismic_unix/src
make install
make xtinstall
make finstall
make utils
make xminstall
make mglinstall
suplane |suximage
#=======================================================================
# Makefile.config for Gnu/Linux
#=======================================================================
#-----------------------------------------------------------------------
# pick up the Make rules (Gnu make required)
#-----------------------------------------------------------------------
include $(CWPROOT)/src/Rules/gnumake.rules
include $(CWPROOT)/src/Rules/abbrev.rules
include $(CWPROOT)/src/Rules/cflags.rules
include $(CWPROOT)/src/Rules/suffix.rules
include $(CWPROOT)/src/Rules/misc.rules
include $(CWPROOT)/src/Rules/opengl.rules
#-----------------------------------------------------------------------
# CWP feature options
#-----------------------------------------------------------------------
#
# LINEHDRFLAG=SU_LINEHEADER - adds 3200 byte text & 400 byte SEG-Y
# style line headers to output. CWP/SU
# always reads either format unless SUXDR
# has been selected.
#
# XDRFLAG=-DSUXDR - forces all SU data to be big endian
# independent of processor architecture
#
# LARGE_FILE_FLAG - controls access to files > 2 GB on
# some systems.
#
# -DSLTSU_SEGY_H - if defined selects SLT/SU trace header
# layout so both packages are compatible
#-----------------------------------------------------------------------
LINEHDRFLAG =
# if the include files are under /usr/include/rpc use this for XDR
# whether or not you had to install libtrpc.a
# make sure
XDRFLAG = -DSUXDR
XDRLFLAGS =
XDRIFLAGS =
# else if you had to install libtirpc and the rpc include files are under
# /usr/include/tirpc/rpc or if you get an error about <types.h> not found,
# and you want to use XDR, then make sure the next three lines are uncommented
XDRFLAG = -DSUXDR -DSUTIRPC
XDRIFLAGS = -I/usr/include/tirpc/rpc -I/usr/include/tirpc
XDRLFLAGS = -ltirpc
# else if you do not want to use XDR, uncomment the next three lines
#XDRFLAG =
#XDRLFLAGS =
#XDRIFLAGS =
# Most systems are LITTLE_ENDIAN these days
ENDIANFLAG = -DCWP_LITTLE_ENDIAN
LARGE_FILE_FLAG = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
CWP_FLAGS = $(LARGE_FILE_FLAG) $(ENDIANFLAG) $(XDRFLAG) $(XDRIFLAGS) $(LINEHDRFLAG)
#-----------------------------------------------------------------------
# system stuff
#-----------------------------------------------------------------------
SHELL = /bin/sh
ROOT = $(CWPROOT)
LN = ln # this needs to be changed to cp for FAT32 filesystems
AR = ar
ARFLAGS = rv
RANLIB = ranlib
RANFLAGS =
ICHMODLINE = chmod 644 $@
MCHMODLINE = chmod 755 $@
POSTLFLAGS = $(XDRLFLAGS)
#-----------------------------------------------------------------------
# use both X11 path conventions
#-----------------------------------------------------------------------
IX11 = /usr/X11/include
LX11 = /usr/X11/lib
IMOTIF = /usr/X11R6/include
LMOTIF = /usr/X11R6/lib
LD_LIBRARY_PATH += $(CWPROOT)/lib:${LX11}:${LMOTIF}
#-----------------------------------------------------------------------
# Sun/Oracle compilers comment out the Gnu compiler section to use
#-----------------------------------------------------------------------
CPP = cpp
CC = cc
#OPTC = -g -Xc -xc99
OPTC = -O -Xc -xc99
#CFLAGS = -I$I $(OPTC) $(CWP_FLAGS) -D_BSD_SOURCE -D_POSIX_SOURCE
CFLAGS = -I$I $(OPTC) $(CWP_FLAGS) -D_DEFAULT_SOURCE -D_POSIX_SOURCE
FC = f90 -f77
OPTF = -g
FFLAGS =
C++FLAGS = -I$I $(OPTC) $(CWP_FLAGS)
#-----------------------------------------------------------------------
# Gnu compilers by default just because they are the most common
#-----------------------------------------------------------------------
CPP = cpp
#CC = clang
CC = gcc
#OPTC = -g -std=c99 -Wall -pedantic -Wno-long-long
OPTC = -O -std=c99 -Wall -pedantic -Wno-long-long
#CFLAGS = -I$I $(OPTC) $(CWP_FLAGS) -D_BSD_SOURCE -D_POSIX_SOURCE
CFLAGS = -I$I $(OPTC) $(CWP_FLAGS) -D_DEFAULT_SOURCE -D_POSIX_SOURCE
FC = gfortran
FOPTS = -g
FFLAGS = $(FOPTS) -ffixed-line-length-none
C++FLAGS = -I$I $(OPTC) $(CWP_FLAGS)

安装Madagascar#

Terminal window
sudo apt install unzip
sudo apt install -y libavcodec-dev
cd ~/Software/madagascar
unzip src-master.zip
cd src-master
./configure --prefix=~/Software/madagascar/src-master API=c++,fortran-90
scons
make
make install
echo '# madagascar
source ~/Software/madagascar/src-master/env.sh' >>~/.bashrc
~/.bashrc
安装基础地震常用软件脚本
https://tuoyuangui.github.io/website/posts/typora/linux系统/快速ubuntu软件安装/
作者
椭圆规/tuoyuangui
发布于
2025-06-12
许可协议
CC BY-NC-SA 4.0