Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sac 環境參數設定可以添加官方建議的方式 #97

Closed
likueimo opened this issue Jul 14, 2016 · 1 comment
Closed

sac 環境參數設定可以添加官方建議的方式 #97

likueimo opened this issue Jul 14, 2016 · 1 comment

Comments

@likueimo
Copy link
Collaborator

likueimo commented Jul 14, 2016

本文手冊上使用以下設定環境參數(舉linux部份)

export SACHOME=/usr/local/sac
export SACAUX=${SACHOME}/aux
export PATH=${SACHOME}/bin:${PATH}

export SAC_DISPLAY_COPYRIGHT=1
export SAC_PPK_LARGE_CROSSHAIRS=1
export SAC_USE_DATABASE=0}

而在sac安裝檔申請完收到後解壓縮,資料夾裡面的 README
在 * Environment Setup 部份
提供下列建議

If SACHOME is /usr/local/sac and the sacinit file is modified accordingly,
to set the path and other options for SAC, do the following:

  For csh and tcsh, edit ~/.cshrc adding the lines
        setenv SACHOME /usr/local/sac
        source ${SACHOME}/bin/sacinit.csh

     After saving and exiting the file, enter
        source ~/.cshrc

  For bash, edit ~/.bashrc adding the lines
        export SACHOME=/usr/local/sac
        . ${SACHOME}/bin/sacinit.sh

    After saving and exiting the file, enter
        . ~/.bashrc```

而比如說我sac安裝在/opt/sac,在Linux的bash環境
我會修改/opt/sac/bin/sacinit.sh 裡面一行
export SACHOME=/usr/local/sac
export SACHOME=/opt/sac

之後在bash環境參數添加

export SACHOME=/opt/sac
. ${SACHOME}/bin/sacinit.sh

而在官方的wiki上也是提供類似建議
https://seiscode.iris.washington.edu/projects/sac/wiki/Binary_Installation


If you received a binary distribution of SAC, it expects to be installed at /usr/local/sac.

tar -zxf sac-101.6_linux_x86_64.tar.gz -C /usr/local
Environment setup

SAC comes with a set of scripts to add the correct directories to your path and setup the environment variables properly. They are located in the bin directory within sac distribution. Follow the instructions based on the shell you are running.

sh / bash

To your ~/.profile or ~/.bashrc add:

source /usr/local/sac/bin/sacinit.sh
csh / tcsh

To your ~/.cshrc or ~/.tcshrc add:

source /usr/local/sac/bin/sacinit.csh

個人覺得添加官方說明部份也好讓使用者有個尋找安裝根據
sacinit.sh 內文有參數詳細配置選項
而在 sac 底下 README 文件還提到
Matlab Interface 怎麼設定環境參數 (本手冊好像沒包含?)
使用者翻閱 README 也可以知道更多可以控制地方

除了安裝之外,sac目錄底下還有四份 README

sac/README
sac/doc/examples/README
sac/doc/README
sac/macros/README  

其中在 sac/doc/examples
有很多有趣script 和 fortran 跟 c 程式
未來也可以介紹在手冊裡面

謝謝這麼詳細SAC手冊!

@seisman
Copy link
Owner

seisman commented Jul 14, 2016

  1. 关于配置环境变量的问题。目前手册中的写的6行与 sacinit.sh 中去掉注释之后的6行是完全一样的。所以二者本质上没有区别。当初之所以不选择 sacinit.sh 这种方式,是因为介绍起来稍微比较麻烦一点:首先需要修改 sacinit.sh 文件,然后需要修改 ~/.bashrc,最后还要介绍一下 sacinit.sh 中每个语句的含义。而按照手册中目前的做法,只需要修改 ~/.bashrc 即可。虽然要写入 ~/.bashrc 中的语句的行数变多了,但是可以更连贯地介绍每个参数的含义。所以我才选择了目前所使用的表述方式。
  2. 关于 matlab 接口,印象中是很久没更新,所以无法使用。我记得我以前试过编译 matlab 接口,但是失败了,所以整个手册中与 matlab 相关的都没有提及。
  3. 关于 script、Fortran和 C,在手册的第7、8、9三章都有介绍。

@seisman seisman closed this as completed Jul 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants