Install SAC under Linux, you can install binary package directly, or you can install it from source. The following two installation methods will be introduced separately, and the user can select one according to their needs. For most users, it is recommended to install the binary package directly.
The executable files in the official binary package can be used directly, and several dynamic link libraries are needed at runtime. These dynamic link libraries are installed by default in most Linux distributions. If it is unfortunately not installed or not sure if it is installed, you can install the required software package by the following command.
For Ubuntu/Debian:
$ sudo apt update$ sudo apt install libc6 libsm6 libice6 libxpm4 libx11-6$ sudo apt install zlib1g libncurses5For CentOS/Fedora/RHEL:
$ sudo yum install glibc libSM libICE libXpm libX11$ sudo yum install zlib ncursesUnzip and move the official binary package directly to the installation directory:
$ tar -xvf sac-101.6a-linux_x86_64.tar.gz $ sudo mv sac /usr/local Several packages need to be installed when compiling the source code.
For Ubuntu/Debian:
$ sudo apt update$ sudo apt install build-essential$ sudo apt install libncurses5-dev libsm-dev libice-dev$ sudo apt install libxpm-dev libx11-dev zlib1g-devFor CentOS/Fedora/RHEL:
$ sudo yum install gcc gcc-c++ make$ sudo yum install glibc ncurses-devel libSM-devel libICE-devel$ sudo yum install libXpm-devel libX11-devel zlib-develUnzip, configure, compile, and install the source code as follows:
$ tar -xvf sac-101.6a_source.tar.gz$ cd sac-101.6a$ mkdir build$ cd build$ ../configure --prefix=/usr/local/sac$ make$ sudo make installAdd the following statement to ~/.bashrc[1] to configure environment variables and SAC global variables:
export SACHOME=/usr/local/sacexport SACAUX=${SACHOME}/auxexport PATH=${SACHOME}/bin:${PATH}export SAC_DISPLAY_COPYRIGHT=1export SAC_PPK_LARGE_CROSSHAIRS=1export SAC_USE_DATABASE=0among them,
SACHOME Defines the SAC installation directorySACAUX Defines the directory where the auxiliary files required for SAC operation are locatedPATH For Linux system environment variables, the system can correctly find the SAC executable fileSAC_DISPLAY_COPYRIGHTUsed to control whether version and copyright information is displayed when SAC is activated, generally set to 1. When the SAC is called multiple times in the script, the version and copyright information is repeatedly displayed, which interferes with the normal output of the script, so the value is generally set to 0 in the script. The specific setting method can refer to the related content in " Calling SAC in Script ".SAC_PPK_LARGE_CROSSHAIRSA process for controlling the size of the cursor pickup phases, the phases pickup time will be usedSAC_USE_DATABASE It is used to control whether the SAC format is allowed to be converted to the GSE2.0 format. Generally, this feature is not used, so the value is set to 0.Modify ~/.bashrclater, execute the following command to configure the environment variables take effect:
$ source ~/.bashrcThe terminal types the lowercase sac [2] and the following shows that the SAC installation is successful:
$ sac SEISMIC ANALYSIS CODE [11/11/2013 (Version 101.6a)] Copyright 1995 Regents of the University of CaliforniaSAC>[1] Some distributions need to be modified ~/.bash_profile
[2] Ubuntu's source has a software called sac, which is used to display some information about the login account. The source of CentOS also has a software called sac, which is the Java interface of the CSS parser. So don't try to install sac with the package manager that comes with the distribution!