0%

念念不忘,必有回响 的 echo

echo命令用于在终端设备上输出字符串或变量的值,类似于PythonprintC语言的printf,是Linux系统中最常用的命令之一。

其中输出字符串主要在shell脚本中使用,常用的还是输出变量的值。

命令格式为:echo [参数] [字符串]

其中常用的参数为:

  • -n 不输出结尾的换行符
  • -e “\a”发出警告音
  • -e “\n”换行,光标移至行首
  • -e “\r”光标移至行首,但不换行、主用用在打印循环的情况下

几个示例

输出一段字符串:

1
2
$  echo "Hello Linux" 
Hello Linux

输出变量提取后的值:

1
2
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

一般使用在变量前加上 $ 符号的方式提取出变量的值,例如:$ PATH,然后再用echo命令予以输出。或者直接使用echo命令输出一段字符串到屏幕上,起到给用户提示的作用。

其中的PATH与Windows的环境变量类似

几个Linux命令来输出:

1
2
$ echo `date`
Sat 12 Feb 2011 22:19:03 PM CST

查询上一次的执行结果

1
$echo $?

$?是Shell中的一个特殊变量,表示上一条命令的退出状态,0表示成功。

Linux 的 echo 命令

echo命令用于在终端设备上输出字符串或变量的值,类似于PythonprintC语言的printf,是Linux系统中最常用的命令之一。

其中输出字符串主要在shell脚本中使用,常用的还是输出变量的值。

命令格式为:echo [参数] [字符串]

其中常用的参数为:

  • -n 不输出结尾的换行符
  • -e “\a”发出警告音
  • -e “\n”换行,光标移至行首
  • -e “\r”光标移至行首,但不换行、主用用在打印循环的情况下

几个示例

输出一段字符串:

1
2
$  echo "Hello Linux" 
Hello Linux

输出变量提取后的值:

1
2
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

一般使用在变量前加上$符号的方式提取出变量的值,例如:$PATH,然后再用echo命令予以输出。或者直接使用echo命令输出一段字符串到屏幕上,起到给用户提示的作用。

其中的PATH与Windows的环境变量类似

几个Linux命令来输出:

1
2
$ echo `date`
Sat 12 Feb 2011 22:19:03 PM CST

查询上一次的执行结果

1
$echo $?

$?是Shell中的一个特殊变量,表示上一条命令的退出状态,0表示成功。

aips初步安装与尝试

最近准备开始处理一些VLA观测的数据,于是装了aips。本身aips的安装十分简单,到NRAO网站上下载一个安装脚本 
ftp://ftp.aoc.nrao.edu/pub/software/aips/31DEC10/install.pl 

1
[XXX@XXX]perl install.pl -n 

(切记,这里一定要加上-n参数,如果你自己下下来一个tar包安装,就等着欲哭无泪吧。哈哈。^_^,经验之谈)
安装就自动进行了,过程中选择一些目录(比如,主目录),基本不需要改什么东西。 
装完了在主目录里会有一个脚本LOGIN.SH,运行一下 

1
[XXX@XXX]$ . LOGIN.SH 

然后就可以用aips了。
(不过我遇到的问题是index不能生成,不晓得怎么回事??) 

1
[XXX@XXX]$ aips 

但是还是有一些问题,我迷糊了好几天,终于在NRAO的网站上找到一点信息 
http://www.aips.nrao.edu/aipsmgr/ 
我遇到的问题和tape server有关,我按照上面网页上说的在/etc/services里加了几行内容

1
2
3
4
5
6
7
8
9
10
11
12
sssin           5000/tcp        SSSIN      # AIPS TV server
ssslock 5002/tcp SSSLOCK # AIPS TV Lock
msgserv 5008/tcp MSGSERV # AIPS Message Server
tekserv 5009/tcp TEKSERV # AIPS TekServer
aipsmt0 5010/tcp AIPSMT0 # AIPS remote FITS disk access
aipsmt1 5011/tcp AIPSMT1 # AIPS remote tape 1
aipsmt2 5012/tcp AIPSMT2 # AIPS remote tape 2
aipsmt3 5013/tcp AIPSMT3
aipsmt4 5014/tcp AIPSMT4
aipsmt5 5015/tcp AIPSMT5
aipsmt6 5016/tcp AIPSMT6
aipsmt7 5017/tcp AIPSMT7

然后就正常了。后来在另外一台机器上也装了aips,但是老是出错。后来想明白,这个机器上装了不只一个aips(另一个是管理员装的),我用了其中的一个(管理员装的),但是把数据放在了另一个aips对应的文件夹(我自己装的)里,于是就死活找不到文件。这个错误太低级了,但是也算是找到并改正了。 
关于如何开始使用aips,网上有两个简单的教程不错
(这两个都有找到) 
http://www-astro.physics.ox.ac.uk/~hrk/AIPS_TUTORIAL/HRK_AIPS_1.html

http://veraserver.mtk.nao.ac.jp/VERA/kurayama/WinterSchool/aips2.htm

参考 http://blog.sciencenet.cn/blog-117333-328076.html
代码参考 https://www.github.com/shaoguangleo/radio_astronomy

最适合学习C语言的开发环境

感觉编程从一开始走的路子就不对。
大学的时候老师醉心于调bug,Windows上用着Borland公司的Turbo C,无法自拔,经常自言自语,留下一脸懵逼的学生们。
这个时候Linux已经发展的如火如荼并发布了稳定版的2.6版本的内核,Ubuntu横空出世。

研究生的时候老师醉心于编写界面,拿着Visual C++动辄自动生成的上万行代码来一步一步的来查找bug,编写界面。

正式工作后工作环境完全转移到Linux,正式开始真正意义上的编程。

如何开始编程,最简单的开始就是搭建开发环境了,这里一定要指出,一定使用类Unix系统,一定使用类Unix系统,一定使用类Unix系统,重要的话说3遍。

当然Windows系统可以使用Oracle公司的开源虚拟机VirtualBox来搞定或者使用Cygwin来搞定。

我的开发环境是Fedora 6,给个界面看看

Fedora 6

如果使用其他的系统,开发环境可以通过下面的命令来准备

Linux

Debian系

Debain系列为基于Debian开发的发行版,比如著名的Ubuntu,只需要打开终端输入下列命令即可:

1
$ sudo apt-get install build-essential

此时输入Y同意,即可安装相关的环境。

流行度很广的Ubuntu10.04系统

Ubuntu 10.04

Redhat系

Redhat系列为基于Redhat开发的发行版,比如著名的CentOS和Fedora,只需要打开终端输入下列命令即可:

1
$ sudo yum groupinstall "Development Tools"

MacOSX

MacOSX号称最好用最稳定的系统,俺还没有这个平台,不过据说只要安装上Xcode,基本上就具备开发环境了。土豪们可以试一试了。

Xcode{width=30%}

Windows

Cygwin是一个在windows平台上运行的类UNIX模拟环境,是cygnus solutions公司开发的自由软件,只要下载一下安装包,然后安装选定需要的开发环境即可,搜索一下就有很多的教程,此处不在阐述,这里还是推荐,在机器性能比较好的情况下,还是使用VirtualBox来个全功能版本的Linux吧。

Vim命令行导航

当从命令行打开一个文件,你可以通过指定命令行参数来导航到一个特殊的位置,如下:

导航键 描述
$ vim +142 打开文件到143行
$ vim +/search-term 打开文件移动到向下搜索到指定词语的位置
$ vim +?search-term 打开文件移动到向上搜索到指定词语的位置
$ vim -t TAG 移动到指定的TAG处

AIPS 详细安装攻略

下载脚本

1
2
3
4
# 下载安装脚本
wget ftp://ftp.aoc.nrao.edu/pub/software/aips/31DEC23/install.pl
# 更改可执行权限
chmod +x install.pl

开始安装

1
2
3
4
perl install.pl -n # 二进制安装

# 选择cnSRC group,对于实例来讲
设置为prjg9600014

具体安装步骤

AIPS安装步骤 黑体部分特别注意

预备工作

We assume that you have followed the instructions and retrieved the Latest version of AIPS (or the frozen, released version). This means you have:

  • Downloaded the latest version of the Install Wizard (install.pl);
  • If you are doing a binary installation from a CD, downloaded the latest version of the CD set-up procedure (CDSETUP) (Both of these are on the CD, so the download is only a precaution.);
  • Binary installations are offered for MacIntosh PPC computers (using the IBM xlf compiler), MacIntosh Intel computers (using the Intel compiler), Solaris Ultra computers (using the SUNWspro compiler), and Linux computers (using the Intel compiler). These are also available from CDrom for the frozen version of AIPS. If you are not doing a binary installation, you must have downloaded the “tarball” (.tar.gz) file for the release;
  • Placed install.pl and the tar file (if appropriate) or CDSETUP in what will be your AIPS_ROOT area.
  • Moved any old $HOME/.AIPSRC to a new name for reference. An old file may confuse the new installation.
  • Alternatively, you may edit the old $HOME/.AIPSRC for use by the new installation. Delete the lines showing DOWNLOADED and UNPACKED and correct the CCOMOPT line to refer to the new version rather than the old one.
    You should also make sure you have perl installed (it is, in /usr/bin on Linux systems) as that is a pre-requisite of running the wizard.
    If you are installing from CDrom, you should now transfer to the guide to CDSETUP.

进行二进制安装而不是解压文本并编译它,请在调用中添加-n选项。
如果对于安装过程超级感兴趣,可以加上-d选项进入详细模式(并在菜单之间禁用清除屏幕功能)。

How the Menus work

The “install wizard” is really just a simple, albeit large, perl script that walks you through a series of menus. This is not a “GUI” or graphical wizard; it only uses text, and can be run in any terminal emulator (or even on an old fashioned VT100 if you have one). At each menu, the screen is cleared, some brief explanatory text will appear at the top of the screen, and a menu or other question will be presented. You then enter whatever text is appropriate and press or to continue.
At each menu prompt, you will have several universal options:
- Back to go back to the previous menu;
- Quit to exit immediately
- On most menus/queries, pressing will cause a default sensible action to occur.
In addition, you can use the interrupt () sequence to stop the install at any time. If you do, or if you use the Quit option, the details of what you have already entered will be saved. This information is stored in a /.AIPSRC file (the tilde “/“ means the file is in your login area) and is re-read on subsequent invocations of the install wizard. The .AIPSRC file is plain text, with keyword=value pairs so it is easy to understand.
The remainder of this document will describe – in more detail than the script itself does – what is occuring at each of the menus, and what options you have. Note that menus 1, 2, 3, and 10 will be skipped when doing a binary installation from the network or from CD.

Screen 0: INTRODUCTION

Before it does anything, the script looks around for a “tarball”, i.e., the 31DEC03.tar.gz file. It checks the current working directory, the AIPS_ROOT area if this is defined, and finally if these fail, your home directory. Then it shows you the welcome screen:

Screen 0: INTRODUCTION

Welcome to the new AIPS Install Wizard (AipsWiz)!
It will do the following:

  1. Look for (and/or download) the ‘tarball’ for 31DEC03
  2. Unpack it wherever you specify
  3. Ask you for various settings through a set of menus
  4. Review your settings, and
  5. Do the installation with no further input needed.

Things can go wrong (!) so this procedure is not perfect,
but it saves state in a file .AIPSRC in your home area.
So you can easily restart an interrupted install attempt,
without re-entering all your settings. You can also go
back a screen by typing ‘B’ to most prompts, or you
can Quit at any menu by entering ‘Q’.

     [You may also type B for back, or Q to Quit]

AipsWiz: ===> Press or to get started:

回车即可开始安装。

只要确保你在正确的目录下,目前我的目录为~/aips/,且有31DEC23.tar.gz文件即可。
如果没有,脚本会提示你下载。

If you have run the wizard before from this account, and have let it unpack the tarball, you will get a different menu:
## Screen 0: Re-Introduction

Welcome back to the AIPS Install Wizard (AipsWiz).
It would appear you’ve been here before.

If you REALLY want to start over, you may want to remove
the .AIPSRC file in this account’s home directory.

Otherwise, you can skip forward to a specific screen by
entering its number at the prompt. The default action
is to simply start at screen 1. Screens are:

  1. Optionally download 31DEC03 tarball

  2. Confirm that tarball is correct

  3. Choose AIPS_ROOT, optionally unpack tarball

  4. Group ownership, group write enable/disable

  5. Site name, Architecture

  6. Additional hosts

  7. Data area definition

  8. Printer setup

  9. Tape drives

  10. Choose Unix or INET services (for TV, etc)

  11. Advanced settings

  12. Final check before doing the install

    [You may also type B for back, or Q to Quit]

AipsWiz: ===> Press or , or enter a screen number:
So if you interrupted a previous install attempt at, say, the adding additional hosts step, you can go directly to that screen and continue as if nothing had happened.

Screen 1: DOWNLOAD

Screen 1: DOWNLOAD

Found a ‘tarball’ /opt/aips/31DEC03.tar.gz
………………Dated 2003.01.24:05:22.42 (UT)
……… downloaded on 2003.01.24:18:34.24 (UT)
……. current time is 2003.01.24:18:49.26 (UT)

You can:

(G) Get a newer copy from NRAO’s ftp site,
(the file is generated nightly)
(S) Skip the download and use the existing tarball, or
(Q) Quit now.

NOTE: if by some chance the automatic ftp fetch fails, you
may want to fetch it yourself by hand, from

  ftp.aoc.nrao.edu/pub/software//aips/31DEC03/31DEC03.tar.gz


     [You may also type B for back, or Q to Quit]

AipsWiz: ===> What do you want to do? [default S]
What goes on behind the scenes here is some exploration: looking for the “tarball”, and checking the .AIPSRC file for when it thinks this was downloaded (note: if the wizard finds the tarball but does not download it itself, it applies the “now” date to the “downloaded” time).
Most of the time you will simply want to use the Skip option; it’s usually only worth getting a new tarball if the one you have is more than a month or two out of date. Let’s assume that you’ve skipped ahead.

Screen 2: CONFIRMATION

Proceeding with 31DEC03 install/upgrade. Please check:

-rw-r–r– 1 aipsmgr aipspgmr 46290244 Jan 24 00:22 /opt/aips/31DEC03.tar.gz

that this is the file you want (should be >30 Mbytes)

     [You may also type B for back, or Q to Quit]

AipsWiz: ===> Proceed [Y/N, default Y]
As you can see, this is just a confirmation step that gives you yet another chance to bail out if necessary. Let’s assume you proceed.

Screen 3: Where to unpack

Please tell me where to unpack the 31DEC03 version of AIPS
(This is the so-called AIPS_ROOT area).

The default is /home/aips/AIPS

     [You may also type B for back, or Q to Quit]

AipsWiz: ===> AIPS Root area: /opt/aips
NOTE WELL: This screen will set where you want the AIPS_ROOT area to be. It defaults to the current directory. The example above shows the user entering (in red) the desired area.
You may want to remove any existing TEXT area in the specified directory before proceeding. Once you enter the AIPS_ROOT value, the wizard proceeds to unpack the tarball with this dialog:
AipsWiz: Unpacking the ‘tarball’ /home/myname/tmp/31DEC03.tar.gz
AipsWiz: in the /opt/aips directory
AipsWiz: This may generate some errors if you are overwriting, but
AipsWiz: these (‘Cannot unlink: directory not empty’) are benign.
AipsWiz: (printing a dot every 100 files for your amusement…
………………………………………………….

AipsWiz: Unpacking apparently worked (total of 5769 files)
AipsWiz: ==> Press to continue::
The “dot printing” will not be at a uniform speed, as of course the size of each chunk of 100 files will vary. It will be slow near the end as the TEXT area has some very large files therein. If you have an existing TEXT area, you’ll likely get the “Cannot unlink” error mentioned in the menu.

Screen 4: Group Ownership

If more than one account is going to be using AIPS, you should
select a ‘Unix group’ for these accounts. This can,
but need not be, their primary group.

     [You may also type B for back, or Q to Quit]

AipsWiz: ===> What group should be used for AIPS? [aipspgmr]
It’s important that you set your AIPS site up so that everyone who needs access to it can use it. As read/write privilege is required on some (but not all) of the system files, you need to decide now which mode of operation you are going to use:
• Either disallow “group write” and only allow “you” access; or
• Allow “group write” and set up a Unix group for AIPS users.
Here “you” refers to the account you’re using to install AIPS. So the first thing to decide is whether you want to allow others to run your AIPS installation, and if so, you should have your systems administrator set up a Unix group for them. Here at NRAO we call this group aipsuser, but you can call it anything you want. Whatever name you choose, you should enter here. If you do not plan on allowing others access to your AIPS environment, just press .
This menu is halfway smart: if you enter “foobar”, it will check if “foobar” is one of the groups that you are in (Unix users have one primary group and can be in many secondary groups as specified in /etc/group or the NIS or LDAP group map). If you enter a bad group, it will show you a list of valid groups, pause for a few seconds, then repaint the menu and ask again for a group name.
Once you enter a valid group, a second menu appears:

在这里选择 prjg9600014

Screen 4b: Group Write

If more than one account will use AIPS, and you are using
a group (aipsuser) to permit filesharing, you should also allow
this group write access to certain AIPS files.

     [You may also type B for back, or Q to Quit]

AipsWiz: ===> Allow aipsuser to have write access? [YES]
Don’t panic if you get here and realize you meant to specify a different group. The wizard does nothing (other than unpack the tarball) with your new AIPS installation until after screen 12, so you can easily go back, interrupt, restart, etc. until you are happy with the settings. So if you got the group wrong, just type Back now and you’ll be at Screen 4 again (not 4b).
Othewise, just enter Yes or No, depending on your needs, and proceed.

Screen 5: Site Name

Please enter a single word to describe your AIPS site.
This may be used as a directory name. Example: at NRAO we use
names such as NRAOCV, NRAOAOC, etc.

     [You may also type B for back, or Q to Quit]

AipsWiz: ===> Your site name: [required, no default]
The “Site Name” is used by AIPS for several purposes, most of which are associated with allowing multiple computers run AIPS from the same area on a shared (NFS) disk. All AIPS machines in a given “site” have to be the same endian flavour (byte order), so you can mix and match Intel/Linux, Intel/Solaris, Alpha/Linux, Alpha/OSF1, and Max/Intel systems in a single site as these are all little-endian architecture. Likewise you can mix and match Sparc/Solaris, HP-UX, SGI, IBM RS/6000, and Mac PPC systems in a single site as they are all big endian. But you cannot have both little and big endian systems in the same AIPS site.
It’s really an advanced topic beyond the scope of this document, but you can have different endian systems sharing the same AIPS_ROOT area. The trick is to assign each group of endian systems a different SITE name.
Anyway, you should enter a site name like NRAOCV here. Choose a single word that best describes your installation. Once you do this, the wizard will now try to figure out your architecture by looking at various clues in its environment:

这里定义为 SHAO

Screen 5a: Site type:

If your site consists of a single portable computer
which may get different names at different times,
it is best to force the name for AIPS to LOCALHOST.

     [You may also type B for back, or Q to Quit]

AipsWiz: ===> If you want this, enter Y or y [N]
AIPS depends on the computer’s name since it often runs in environments with 10’s of computers all sharing a single AIPS installation. The name is used to find the architecture and site name from HOSTS.LIST, to select the data areas to include from DADEVS.LIST, and to find the control files for that computer. Laptop computers often do not have a fixed name. Instead thay are assigned a dynamic name each time they are plugged in to the local area network. In this case, it is better to have AIPS use a a fixed name (LOCALHOST) for the computer rather than the changing name (returned by uname -n). If you are installing AIPS for use on a single computer which might have its name change, enter Y or y at this point. The LOGIN.SH and LOGIN.CSH files will be changed to reflect this choice and the computer and its data areas will be found under the name LOCALHOST.

Screen 5b: Architecture Confirmation

If this is correct, press RETURN or ENTER.
If not, enter the correct architecture (or ? for a list)

     [You may also type B for back, or Q to Quit]

AipsWiz: ===> Enter the architecture for this system [LINUX]
The script is pretty good about figuring this out, so you’ll likely just have to press here. If by some chance you enter something silly like SOL for a Linux machine, this will be stored in the .AIPSRC file and will come back to haunt you later! The known architectures are: LINUX, AXLINUX for Alpha Linux, ALPHA for Alpha OSF1 (Tru64) systems,SOL for older Suns, SUL for Solaris on Sparc Ultras, SOL86 for Solaris on Intel, HP for older HP systems running HP-UX, HP2 for newer HP’s, SGI for SGI systems running Irix, MACPPC for MacIntosh computers with the PPC G3, G4, and G5 chips, and MACINT for MacIntosh computers with the Intel chips.
A future feature of the wizard will be consistency checking of the specified architecture against what it thinks is right, and a dialog to query the user in an “are you sure?” manner.

Screen 6:Additional Hosts

Screen 6: Additional hosts if any

You may configure your installation so it runs on many systems,
sharing the AIPS ROOT area via NFS. The list of host(s) is now:

ORANGUTAN

Any new hosts will initially be set to arch=LINUX, but you can
change this by editing HOSTS.LIST in /home/aips/tmp
when the install is finished.

     [You may also type B for back, or Q to Quit]

AipsWiz: ===> Enter new hosts (no commas!) or ORANGUTAN to reset:
This menu is pretty simple. If you are only installing AIPS on a single system, just press to continue to the next screen, as there’s nothing to do here. If you intend on allowing several other hosts to your AIPS installation, you can pre-populate the HOSTS.LIST configuration file (kept in your AIPS_ROOT area) right here.

Screen 7: User Data Areas

AIPS Manages the astronomical data users will read and write internally in “catalogs” which are stored in “disks”. In reality, each “disk” is simply a directory somewhere in the Unix file system hierarchy. These are specified in two or maybe three configuration files, all of which are kept in the $NET0 area (which is $AIPS_ROOT/DA00/). The purpose of this menu is to provide an easier, faster way of setting these files up.

Screen 7: User Data Areas


At least one data area needs to be defined for AIPS user data.
It is important that the host name in caps appear in the data area
name. Currently these area(s) are defined:

(no data areas have been defined yet)

You can add to this list after installing by editing the two files
DADEVS.LIST and NETSP in the /opt/aips/DA00/ directory.

Please enter (additional) data area(s) now as a space-separated
list, or the word RESET to re-set the list.

(If you want to use symlinks, use the notation

   actual_directory_location:symbolic_link_location

instead of a simple directory location.)

The suggested data area is /opt/aips/DATA/ORANGUTAN_1

     [You may also type B for back, or Q to Quit]

AipsWiz: ===> Data Areas:

这里设置为 /groups/vlbi_group/home/share/aips/data/

OK, there’s a lot to digest here, mainly because the menu tries to be both concise and flexible at the same time. Suppose you just wanted to add one area, and you like the suggested value. You can either type it in, or cut/paste it and then press . That’s it.
When AIPS starts up it reads the DADEVS.LIST file to decide which disk areas to include. It will include all required areas and any area which has the current host name (in capital letters) in the disk area name, e.g. /DATA/ORANGUTAN_1. Normally, one only wants to include disk data areas local to the current host. Required areas on another computer will slow everything down quite remarkably. Note that the data area may be something like $AIPS_ROOT/DATA/ORANGUTAN_1 on the server computer, so long as that file is a link file to a real data area on orangutan itself.
If you want to add more than one area, just enter all the areas on one line separated by spaces. If you want to wipe out all the disks defined and start over, just enter the magic string RESET and press . Poof! The definitions are gone.
Finally, if you want to do something more sophisticated, such as putting entries in the configuration files that refer to $AIPS_ROOT/DATA/ and have symbolic links there pointing to actual directories elsewhere, you can do that. Just enter a series of areas separated by spaces, with each area actually being in the form mentioned, with a colon (:) separating the actual location from the symbolic link’s name. This feature is pretty esoteric and probably few people will want to use it.
Here’s an example of what you might add:
AipsWiz: ===> Data Areas: /opt/aips/DATA/MINE_1 /tmp:/opt/aips/DATA/MINE_2
This example shows adding two data areas. The first is a simple directory, while the second is a symbolic link pointing to /tmp but that will appear to the AIPS user as /opt/aips/DATA/MINE_2. We don’t recommend using /tmp to store AIPS data other than as a scratch disk; it’s just shown here as a nice concise example.
Remember that you can always edit the text files such as $AIPS_ROOT/HOSTS.LIST, $NET0/DADEVS.LIST, $NET0/NETSP, $NET0/PRDEVS.LIST etc. later in order to add more computers running aips, more disk areas and printers, etc. You may find the old Postscript installation guide of use in this regard. In particular, it devotes some space to SYSETUP and other tools used to install additional computers, disks, and the like.

Screen 8: Printers

One of the things you’ll surely do in AIPS is generate printout. AIPS will allow you to define many printers, and the users refer to them by number. The available printers will be presented to the user as a menu when they start AIPS itself up, and it’s up to you, the intrepid AIPS installer, to configure sensible AIPS names for these printers. This is fairly easy so don’t panic.
This screen will do two things: first, get the printers and their types; and second, figure what size paper you’ll be using.

Screen 8: Printers

You may define several printers for use with AIPS.
These will appear on startup as numbered choices to the user
At least one printer must be defined. Currently defined:

(no printers are defined yet)

Paper Format: A

You can modify printer definitions after the install by
editing the file /home/aips/tmp/DA00/PRDEVS.LIST .

Please indicate whether you want to

  • add (N)ew printers
  • (D)iscover your system’s printers (may not work),
  • (A)ccept the current settings as is, or
  • (R)eset to clear the list.

(Paper format - A or A4 - will come next)

     [You may also type B for back, or Q to Quit]

AipsWiz: ===> Your choice (default: Accept):
The “(D)iscovery” option is one you’ll probably want to try. It’s actually pretty good about trying things, including looking at printcap and lpstat information. It will balk somewhat, however, if it finds more than 15 printers and revert to the “(N)ew” mode instead.
Suppose we find that there are 34 printers available, and we only want to add three of them to the AIPS printer configuration. Here’s what that session might look like:
AipsWiz: Configuring 3 printers. For each, you will be asked if you
AipsWiz: want to configure AIPS to use it, its type, options, and a
AipsWiz: description. AIPS priner types are:

AipsWiz: PS Black-and-white PostScript printer
AipsWiz: COLOR (or COLOUR) Color/Colour PostScrip printert
AipsWiz: TEXT Plain text printers (including line printers)
AipsWiz: QMS QUIC format (QMS [not QMS PS!], Talaris) printers
AipsWiz: PREVIEW Screen Previewers, e.g. gv, ghostview, pageview

AipsWiz: And the valid AIPS printer options are:

AipsWiz: NONE (default), nothing special.
AipsWiz: DUP Printer will print on both sides of the paper
AipsWiz: DEF This will be the default AIPS printer
AipsWiz: BIG=nnn Force use of this printer for jobs > nnn lines

AipsWiz: If you want to specify multiple options for a printer,
AipsWiz: separate them with commas (NO SPACES!)

AipsWiz: ==> –Name (‘xxx’ in ‘lpr -Pxxx’) for printer 1: ps1
AipsWiz: ==> Printer type for ps1 (N to skip) [PS]:
AipsWiz: ==> Printer options for ps1 (N to skip) [NONE]: DUP
AipsWiz: ==> Description for ps1 (N to skip): Main printer (duplex)
AipsWiz: ==> –Name (‘xxx’ in ‘lpr -Pxxx’) for printer 2: ps2
AipsWiz: ==> Printer type for ps2 (N to skip) [PS]:
AipsWiz: ==> Printer options for ps2 (N to skip) [NONE]: DUP,DEF
AipsWiz: ==> Description for ps2(N to skip): 2nd floor printer
AipsWiz: ==> –Name (‘xxx’ in ‘lpr -Pxxx’) for printer 3: pscolor
AipsWiz: ==> Printer type for pscolor (N to skip) [PS]: COLOR
AipsWiz: ==> Printer options for pscolor (N to skip) [NONE]:
AipsWiz: ==> Description for pscolor (N to skip): Color printer
Right after entering your printer information, you will be asked:
AipsWiz: ==> Do your printer(s) use A or A4 paper? [A]:
For reference, US “A” standard size paper is 8.5 by 11 inches, and the European and Australian standard “A4” size is about 8.25 x 11.75 inches.

Screen 9: Tape Drives

If you use AIPS, you’ll almost certainly want it to read and write data to/from at least one type of tape drive. This is where you specify the details of the drives and set the device names (AIPS users refer to tapes by AIPS tape number).
## Screen 9: Tape Drives

If your network has any tape drives you would like to use for AIPS,
you can specify those now. You need to configure each tape drive
machine to run AIPS (or a subset of it). Current definitions:

(no tape drives are defined yet)

You can add to this list after the install by editing TPDEVS.LIST
in the /home/aips/tmp/DA00 area.
Please indicate whether you want to

    add (N)ew tape drive(s)
    (D)iscover tape drives on ORANGUTAN (may not work)
    (A)ccept the current settings as is, or
    (R)eset to clear the list.

     [You may also type B for back, or Q to Quit]

AipsWiz: ===> Your choice (default: Accept):
The “(D)iscovery” option is limited and for the most part will “sniff” out SCSI tape drives on various platforms. On some (e.g., Linux) it will find files in /dev/ if they have been configured, even if you don’t have any physical drive attached (or even a SCSI card). For each one it finds, it asks you for a description of it, or you press “N” to skip and not include it. Here’s a typical dialog:
AipsWiz: ===> Your choice (default: Accept):D

AipsWiz: Found SCSI tape drive /dev/nst0
AipsWiz: Found SCSI tape drive /dev/nst1
AipsWiz: Found SCSI tape drive /dev/nst2
AipsWiz: Found SCSI tape drive /dev/nst3
AipsWiz: Found SCSI tape drive /dev/nst4
AipsWiz: Found SCSI tape drive /dev/nst5
AipsWiz: Found SCSI tape drive /dev/nst6
AipsWiz: Found SCSI tape drive /dev/nst7
AipsWiz: Found 8 possible tape drives on this host

AipsWiz: ==> Description for nst0 (or N to skip): 4mm DDS-4 DAT
AipsWiz: ==> Description for nst1 (or N to skip): N
AipsWiz: ==> Description for nst2 (or N to skip): N
AipsWiz: ==> Description for nst3 (or N to skip): N
AipsWiz: ==> Description for nst4 (or N to skip): N
AipsWiz: ==> Description for nst5 (or N to skip): N
AipsWiz: ==> Description for nst6 (or N to skip): N
AipsWiz: ==> Description for nst7 (or N to skip): N
(Note: the text above has been shortened here for readability and clarity; the wizard actually spells out, e.g., Description for ORANGUTAN tape drive /dev/nst0).
After this comes an important section. It’s long, and the screen occupies almost 40 lines, but you need to read and understand it. It affects who can access your AIPS resources over the network. Here is the screen:

Screen 9B: Tape Hosts


THIS IS IMPORTANT: READ ME!

The TPMON daemons that are automatically started or restarted
with each AIPS session are servers that give remote systems
access to your local tape drives (TPMON2,3,…) and FITS
disk area (TPMON1). There is a mechanism to restrict connections
to a set of hosts and/or IP addresses. You need to indicate what
remote system(s) if any are allowed to use your tapes
and FITS disk area. The default configuration is to ONLY allow
your local host (127.0.0.1). The list of hosts and/or IP addresses
is currently set to:


127.0.0.1

You can modify this list after the install by editing file TPHOSTS
in the /home/aips/tmp/DA00 area. Each line in the
file can be

    - an IP address, e.g. 192.33.115.11
    - a fully qualified domain name, e.g. orangutan.cv.nrao.edu,
    - a limited IP address wildcard, e.g. 192.33.115.\*, or
    - a limited domain name wildcard, e.g. \*.cv.nrao.edu.

Please indicate whether you want to

    add (N)ew entries
    (A)ccept the current settings as is, or
    (R)eset to the default.

     [You may also type B for back, or Q to Quit]

AipsWiz: ===> Your choice (default: Accept):
The default setting is the most secure, as it limits remote access to the local host. If you are in any doubt at all, use our default. The danger is in opening up your systems and networks too widely. System Administrators should refer to the next section for a brief discussion about TCP ports used by AIPS for additional security measures.

Unix/Internet service discussion
AIPS uses “sockets” so the main AIPS engine can talk to the image display (called the “TV”), a lock daemon for the TV, a graphics display, message display, and remote TPMON tape servers. For all except the last, you have the choice of whether to use INET (network based) sockets, or UNIX (file based) sockets. This menu allows you to choose what the default will be; your users can always override this on the command line when they start AIPS itself.
Between screens 9 and 10, install.pl does a quick check on whether some of the AIPS services are already defined, either in /etc/services, or in a NIS (YP) services map. It found they were, so no warning was issued. If you are going to be running AIPS on a single machine, and not accessing it over a network from other AIPS machines, then you may want to use UNIX sockets. Doing so means you don’t have to edit the services file or map, and it also allows AIPS users to have multiple TV’s on screen if they want. You must add tv=local to the aips command line every time you start AIPS. The default is always Inet sockets.
For sysadmins, the TCP ports used by the TPMON tape/disk servers (daemons) are usually 5010 through 5017. In addition, if INET sockets are chosen in this menu, AIPS will use four ports in the range 5000-5009 as well. If you do not want remote AIPS access to your site, you may want to block these (or permit them to defined systems or networks) at your router or firewall.

增加以下内容到 /etc/services

1
2
3
4
5
6
7
8
9
10
11
12
sssin		5000/tcp	SSSIN		# AIPS TV
ssslock 5002/tcp SSSLOCK # AIPS TV Lock
msgserv 5008/tcp MSGSERV # AIPS Message Server
tekserv 5009/tcp TEKSERV # AIPS TekServer
aipsmt0 5010/tcp AIPSMT0
aipsmt1 5011/tcp AIPSMT1
aipsmt2 5012/tcp AIPSMT2
aipsmt3 5013/tcp AIPSMT3
aipsmt4 5014/tcp AIPSMT4
aipsmt5 5015/tcp AIPSMT5
aipsmt6 5016/tcp AIPSMT6
aipsmt7 5017/tcp AIPSMT7

Screen 10: Advanced Settings

In most cases, you will simply want to scan through this screen and accept the defaults. This is a smorgasbord of options that covers all sorts of AIPS settings, but they are usually rather esoteric and not of much interest to the Astronomer who just wants to run the system and analyse their data. The location of an acceptable compiler (e.g. version 2.95.3 of gcc and g77) may force you to modify some of the defaults. Note that the .AIPSRC file retains this information; if you are installing a later release all will be known. Screen 10 is skipped for binary installations since you will not be recompiling AIPS.

Screen 10: Advanced Settings


In general, the default settings for these advanced options will be OK.
Please review the settings, and then decide if you want to change them.

    AP settings are in PAPC.INC (cf $SYSLOCAL/INCS.SH)
    Fortran settings are in $SYSLOCAL/FDEFAULT.SH
    C settings are in $SYSLOCAL/CCOPTS.SH, and
    Link settings are stored in $SYSLOCAL/LDOPTS.SH

Current settings of advanced parameters:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
AP Size (MB): 5 (for your memory size 127792 KB, use 20 MB)
FORTRAN Compiler: /usr/bin/g77 (default /usr/bin/g77)
and options: -c -fno-automatic -fno-globals -Wno-globals \
-malign-double -Wimplicit -Wall
default options: -c -fno-automatic -fno-globals -Wno-globals \
-malign-double -Wimplicit -Wall
Linker: /usr/bin/g77 (default /usr/bin/g77)
C Compiler: /usr/bin/gcc (default /usr/bin/gcc)
and options: -c -O3 -fomit-frame-pointer -funroll-loops \
-I/opt/aips/31DEC03/INC -DHAVE_LINUX_GLIBC
default options: -c -O3 -fomit-frame-pointer -funroll-loops \
-I/opt/aips/31DEC03/INC -DHAVE_LINUX_GLIBC
Readline Library: /usr/lib/libreadline.a
Debug Libs too: NO

[You may also type B for back, or Q to Quit]

AipsWiz: ===> [M]odify or [A]ccept (default Accept):
Let’s look briefly at some of these settings:
- AP Size: Size of an internal “buffer” or array in AIPS that simulates the old array processor. Some tasks benefit significantly from making this larger. Changing it requires a (re)compile of AIPS. It is therefore not offered for binary installations either from the network or CD. Here the wizard recommends an increase based on the (Linux) system’s available memory.
- Compilers and Options: These are pre-set for most common architectures. You should only have to alter them if (a) you are recompiling [e.g., for a different AP size]; and (b) you have a different compiler. Solaris (SOL, SUL) defaults assume the Sun Compilers so if you use gcc/g77 on Solaris, you need to change the settings. The linker should be the same as the Fortran compiler. The only “gotcha” here might be that the procedure expands the $INC setting in the configuration files; this is for the most part benign. If you have installed a compiler such as GNU 2.95.3 to avoid the defective 2.96 and 3.0+ compilers, then you must enter the path to this compiler in FORT, LINK, and CCOM.
- Readline Library: If you have a Linux system, the wizard will tell AIPS to use your library for any recompiles. Otherwise, unless the system detects a libreadline.a in an obvious place, it will default to the LIBR/GNU/ location and will be built (or used if pre-supplied, e.g. on CD).
- Debug Libs too: If you are doing code development in AIPS, you may want to have two sets of AIPS libraries: one with optimized routines, the other with non-optimized and debug (-g) capabilities. Only set this to YES if you need to use a debugger like dbx or gdb in AIPS tasks.
If you choose to change any of these, you will get a dialog like this:
AipsWiz: ===> [M]odify or [A]ccept (default Accept):M

AipsWiz: ==> Change item [APSIZE, FORT, FORTOPT, LINK, CCOM, CCOMOPT,
DEBUGLIBS, READLINE, or (default) END]: APSIZE
AipsWiz: ==> AP Size in MB (1-512):: 20
AipsWiz: ==> Change item [APSIZE, FORT, FORTOPT, LINK, CCOM, CCOMOPT,
DEBUGLIBS, READLINE, or (default) END]:
This shows the installer changing the AP Size to 20 Megabytes from its default value of 5. After finishing this, you are brought back to screen 11 so you can double-check your changes.

Screen 11: Final Review

Screen 11: FINAL REVIEW before installing!


This is your last, best hope for checking the settings before
committing to the install. Please check thesesettings, and
make sure they are what you want:

AIPS_ROOT (screen 3): /opt/aips
Group (screen 4): aipsuser
Group Write (screen 4): YES
Architecture (screen 5): LINUX
Site name (screen 5): CVTEST
AIPS hosts (screen 6): ORANGUTAN
Data areas (screen 7): /DATA/ORANGUTAN_1
Printers (screen 8): pscolor PS-CMYK NONE Color printer
ps1dup PS DUP Main printer
ps2dup PS DUP,DEF 2nd floor printer
Paper type (screen 8): A
Tape drives (screen 9): host ORANGUTAN, tape drive /dev/nst0: 4mm DDS-4
Tape hosts (screen 9): 127.0.0.1
Advanced (screen 10): (not listed here)

You can skip back to a previous menu by entering its number,
or use the phrase ‘start over’ to go back to the beginning.
[You may also type B for back, or Q to Quit]

AipsWiz: ===> [A]ccept (default) or menu number:
This screen attempts to give a review of the main settings you have entered, and allows you to back up to any given screen so you can fix things. The only annoying feature is that once you go back to a screen, the only way to get back to screen 11 is to advance one screen at a time. In effect this just means pressing at each intervening screen. A shortcut mechanism will likely be added to the wizard in the near future.

Applying the Settings

You will be given one last chance to change your mind after accepting the values in the menu. Then the script proceeds to deploy the decisions you have made by altering various system files, creating directories, and so on. From a non-binary installation, a typical session might look like this:
AipsWiz: ==> Confirm: start the install with these settings [Y]:
AipsWiz: =====> Creating or updating HOSTS.LIST file
AipsWiz: – Done.
AipsWiz: =====> Configuring your AIPS_ROOT area…
AipsWiz: =====> Running 31DEC03/SYSTEM/UNIX/AIPSROOT.DEFINE
/home/aips/tmp
AipsWiz: – Done.
AipsWiz: =====> changing LOGIN.SH to LAPTOP=”YES”
AipsWiz: =====> changing LOGIN.CSH to LAPTOP=”YES”
AipsWiz: – Done.
AipsWiz: =====> Adjusting AP size to 20 MBytes
AipsWiz: No /opt/aips/31DEC03/INC/NOTST/LINUX/PAPC.INC found
AipsWiz: - trying /opt/aips/31DEC03/INC/PAPC.INC
AipsWiz: – Done.
AipsWiz: =====> Setting up LINUX-specific areas and SYSLOCAL…
AipsWiz: – Done.
AipsWiz: =====> Configuring AIPS for your printers…
AipsWiz: Text printing set up for ‘A’ size paper
AipsWiz: – done
AipsWiz: =====> Configure AIPS data areas …
AipsWiz: – done
AipsWiz: =====> Configure AIPS Tape drives…
AipsWiz: – done
AipsWiz: =====> Create DA00/hostname/ directories…
AipsWiz: – done.
AipsWiz: =====> Deploying your compiler options in script files…
AipsWiz: CCOPTS.SH done (C Compiler and options)
AipsWiz: LDOPTS.SH done (Linker)
AipsWiz: FDEFAULT.SH done (Fortran compiler and options)
WARNING! The structure of /opt/aips/31DEC03/SYSTEM/UNIX/FDEFAULT.SH
is very complex, and while this wizard install
tries VERY hard to change the right section,
it may have failed. Please, PLEASE inspect the
file and compare it to the original (saved as
FDEFAULT.SH.dist in /opt/aips/31DEC03/SYSTEM/UNIX)
to make sure the settings are right. Do this
BEFORE you proceed any further.
THIS IS REQUIRED FOR THE 2.95.3 COMPILER IN LINUX
AipsWiz: ==> Press after you have verified FDEFAULT.SH::
(The messages about LOGIN.SH appear only if you ask to change the host name to LOCALHOST for a single-computer installation.) Note the pause here, asking for the OK to proceed. If you haven’t changed the settings, don’t worry about it. Even if you have, chances are that it will get the changes made in the right place. However, doing this sort of change automatically in as complex a file as FDEFAULT.SH is tricky, so it can’t hurt to look at the architecture-specific section for your system and make sure it’s not totally messed up! In the worst case scenario, you can always restore the original from the FDEFAULT.SH.dist file.
Linux sites may have to modify the $SYSLOCAL/FDEFAULT.SH file. It is now set for the GNU 3.2 and later compilers, with OPT2=”-O2”. If you are using the GNU 2.95.3 compiler, a different set of OPT2 options is present in the file. Comment out the -O2 one and remove the comment symbols from the 3 lines of OPT2’s designed for 2.95.3. Note “-O2” works with 2.95.3 but produces somewhat slower code.
The process will then continue (after you press , of course):
AipsWiz: ==> Press after you have verified FDEFAULT.SH::
AipsWiz: =====> Compile Utility Programs in
/opt/aips/31DEC03/LINUX/SYSTEM/CVTEST…
AipsWiz: Compiling F2PS…
AipsWiz: Compiling F2TEXT…
AipsWiz: Compiling NEWEST…
AipsWiz: Compiling PRINTENV…
AipsWiz: Compiling PWD…
AipsWiz: Compiling REVENV…
AipsWiz: - Compiling ZTRLOP.c…
AipsWiz: - that seemed to work.
AipsWiz: =====> Make the XAS TV Server from source…
AipsWiz: About to unpack the XAS.SHR archive.
AipsWiz: Building the UNSHR program for LINUX…
AipsWiz: UNSHR.LINUX built in pwd
AipsWiz: About to run XAS.SHR through UNSHR (ignore the prompt)…
Enter the name of the archive:
AipsWiz: Done.
AipsWiz: About to try to make XAS…
All of this is reasonably routine and automatic. The messages that follow have to do with building XAS (note: if your install freezes after announcing that it’s going to make the XAS server, you need a newer version of install.pl).
Extra messages reporting intermediate steps are likely to appear. On a binary installation, you will see something like:
AipsWiz: ==> Confirm: start the install with these settings [Y]:
AipsWiz: =====> Creating or updating HOSTS.LIST file
AipsWiz: – Done.
AipsWiz: =====> Configuring your AIPS_ROOT area…
AipsWiz: =====> Running 31DEC03/SYSTEM/UNIX/AIPSROOT.DEFINE
/home/aips/tmp
AipsWiz: – Done.
AipsWiz: =====> changing LOGIN.SH to LAPTOP=”YES”
AipsWiz: =====> changing LOGIN.CSH to LAPTOP=”YES”
AipsWiz: – Done.
AipsWiz: =====> Setting up LINUX-specific areas and SYSLOCAL…
AipsWiz: – Done.
AipsWiz: =====> Configuring AIPS for your printers…
AipsWiz: Text printing set up for ‘A’ size paper
AipsWiz: – done
AipsWiz: =====> Configure AIPS data areas …
AipsWiz: – done
AipsWiz: =====> Configure AIPS Tape drives…
AipsWiz: – done
AipsWiz: =====> Create DA00/hostname/ directories…
AipsWiz: – done.
AipsWiz: =====> and populating area for $THISHOST from rsync server

The Midnight Job

Once the utility programs and XAS are built, the wizard will start preparing for a possible recompile and for the Midnight Job. You do not need to actually run one (though we recommend it if you wish to stay current with the latest bug fixes), but setting up the infrastructure to support a midnight job is now a standard feature of the AIPS install process. Here’s what the dialog will tell you:
AipsWiz: =====> Preparing for INSTEP2 and INSTEP4 (building AIPS)…
AipsWiz: =====> Preparing for the “Midnight Job”…

The AIPS Midnight Job is a way to keep your AIPS installation up to
date. It is secure, relatively easy, and can be done on demand or in
a cron job (i.e. periodically, daily or weekly or whenever). It does
require that you have the code versioning system (cvs) installed on
your system. The MNJ is of no use with AIPS versions that are
already frozen when you install them and is useful only once after we
freeze a particular version. When installing a frozen version - or
maintaining a version that is now frozen, you should periodically
check the patches that may have been issued for
that release.

This script will set up the infrastructure for you to be able to run
the Midnight Job (MNJ), but you have the power to make it run or not.

Should you choose to run the Midnight Job, the ‘begin date’ will be
set to YYYYMMDD, which is ONE day before the generation time of the
31DEC03.tar.gz file.

AipsWiz: ==> If you want a different date, enter it now::
This date is used by the midnight job as the zero point for incremental updates, so it should be before the timestamp on the file. Due to possible timezone ambiguities, it’s best to accept the one-day-before default the wizard offers.
For binary installations, it is a bit simpler:
AipsWiz: =====> Preparing for the “Midnight Job”…

The AIPS Midnight Job is a way to keep your AIPS installation up to
date. It is secure, relatively easy, and can be done on demand or in
a cron job (i.e. periodically, daily or weekly or whenever). It does
require that you have the code versioning system (cvs) installed on
your system. The MNJ is of no use with AIPS versions that are
already frozen when you install them and is useful only once after we
freeze a particular version. When installing a frozen version - or
maintaining a version that is now frozen, you should periodically
check the patches that may have been issued for
that release.

This script will set up the infrastructure for you to be able to run
the Midnight Job (MNJ), but you have the power to make it run or not.
At this stage, the wizard hands off control temporarily to the MAKE.MNJ script which will compile some programs, set up some .OLD and .DAT files, and set up the mailing lists for midnight job output and error messages. It gives you a chance to examine these settings and change them by hand before proceeding.
The midnight job only runs under the code versioning system (cvs) now. You no longer need to contact us to ask about running a midnight job. The MAKE.MNJ script will attempt to “prime” the cvs setup by accessing our server. When it asks for a password, simply hit Enter. The process creates a file .cvspass in your home directory enabling cvs to run without passwords henceforth.

Registration

The registration system has fallen into disuse. It required special database software which the CV Computer Division no longer maintains. As a consequence, the wizard no longer runs the REGISTER script. You may run this fairly primitive script after the installation if you want. It will obtain registration information from you, and put it in the REGISTER.INFO file in your home directory. You have the option of sending this information to NRAO, but we now just file it. Registration is no longer a requirement to receive help with AIPS. Usage statistics are now obtained only via monitors of tarball downloads and cvs accesses.

Compiling - INSTEP2, INSTEP4

If you are doing a binary installation (from CD or network), you will not be prompted for this step. Otherwise, the wizard will ask if you want it to start INSTEP2, which compiles all AIPS subroutines, and INSTEP4, which builds all the programs. This can take several hours, even on fairly fast hardware. If you choose to defer this, the script gives simple instructions on what to do next. If you go ahead at this point, the script will not only do INSTEP2 and INSTEP4, but also run the programs described below.
If you are installing a frozen version of AIPS, you should check the patches page for the release before telling INSTEP2 and INSTEP4 to begin. 31DEC02 at least has patches that need to be applied at this point on RedHat version 8 and 9 systems.

Running FILAIP, POPSGN, SETPAR

Finally, you may need or want to run these. If building from source, FILAIP and POPSGN have to be run. This is done for you, if you opt to run INSTEP2 and INSTEP4 from the install.pl script. If you are doing a re-installation, you may be prompted for a password when running install.pl. The default password is AMANAGER which can be changed in AIPS, but is usually left as it is shipped. If installing from CD, FILAIP and POPSGN should not need to be run. In either case, you may want to examine system defaults with SETPAR. All of these are run by defining the AIPS environment and using the RUN shell script. What follows here is a typical session with the recommended values, with some text omitted for clarity (the GPL notice, and the disk selection dialog in RUN):

bash$ . ./LOGIN.SH
bash$ $CDTST
AIPS_VERSION=/opt/aips/31DEC03
bash$ RUN FILAIP
(GNU Copyleft shows up here - also a prompt for a password when
re-installing a new version)
Password: (default is AMANAGER)

disks, # cat entries/disk (<0 => private catlgs) (2 I)

35 -100

interactive AIPS, # batch queues (2 I)

8 2

tape drives (I)

4
FILAI1: Init POPS memory files 1 through 12 with program POPSGN
FILAI1: Done!
bash$ RUN POPSGN
Enter Idebug, Mname, Version (1 I, 2 A’s) (NO COMMAS)
0 POPSDAT TST

                            (press <RETURN> here)

POPSG1: Popsgen complete
POPSG1: orangutan 31DEC03 TST: Cpu= 0.2 Real= 74
bash$ RUN SETPAR
Starting up SETPAR (RELEASE OF 31DEC03)
Enter: 1=Start Over, 2=Change parameters, 3=Change DEVTAB, 4=Quit
2
(many options shown, including this:)
35 Computer speed rating (AIPSmarks) 1.00
Enter number to change or 0 = Print, -1 = Return
35
35 Computer speed rating (AIPSmarks) 1.00
20
Enter number to change or 0 = Print, -1 = Return
-1
Password: (default is AMANAGER)
Enter: 1=Start Over, 2=Change parameters, 3=Change DEVTAB, 4=Quit
4
SETPA1: orangutan 31DEC03 TST: Cpu= 0.0 Real= 106
bash$
The above dialog shows an installer running all three utility programs, so that the system files are created (FILAIP), initialized (POPSGN), and customized (SETPAR). The customization shown is to set the “speed” parameter to something close to the actual expected performance of the machine. This parameter is used to figure out reasonable delays in task startup, termination and management, and can make quite a (bad) difference if set too low or too high. Refer to the AIPS Benchmark page for some tests we’ve done and to figure out what value to use for your system. For most newer (modest) machines, 20 is probably a good starting point.
There are a couple of things that may need to be done to your operating system controls files in order to run AIPS. You probably need to be root to do these. The first is to add to /etc/services the lines
sssin 5000/tcp SSSIN # AIPS TV server
ssslock 5002/tcp SSSLOCK # AIPS TV Lock
msgserv 5008/tcp MSGSERV # AIPS Message Server
tekserv 5009/tcp TEKSERV # AIPS TekServer
aipsmt0 5010/tcp AIPSMT0 # AIPS remote FITS disk access
aipsmt1 5011/tcp AIPSMT1 # AIPS remote tape 1
aipsmt2 5012/tcp AIPSMT2 # AIPS remote tape 2
aipsmt3 5013/tcp AIPSMT3
aipsmt4 5014/tcp AIPSMT4
aipsmt5 5015/tcp AIPSMT5
aipsmt6 5016/tcp AIPSMT6
aipsmt7 5017/tcp AIPSMT7
Comment out the obsolete “radio free ethernet” (5002) service. Your X Windows needs to operate in either 8-bit PseudoColor or 24-bit TrueColor mode. The 16-bit TrueColor mode that is the default on many systems does not have enough dynamic range for scientific imaging. The file /etc/X11/XF86Config-4 is used to control this in RedHat installations.
The AIPS Manager FAQ may be of help in solving residual installation problems.
That’s about all we can cover here. The installation wizard is a vast improvement over the old INSTEP1 way of doing things, and we welcome feedback on it, both for bug reports and suggested improvements.
Patches to frozen versions
After a version of AIPS is “frozen”, no more changes will be made to the code. If a serious bug is found, a “patch” for the bug will be announced and made available through the patches web page. You must download the files from the page for your version of AIPS and follow the instructions to apply the patches, even if you fetched the tar ball for your version of AIPS long after the patch was announced.
When a patch is made available, it is usually announced on the “bananas” mail list. This is a closed, moderated mailing list that serves as a conduit for important announcements pertaining to AIPS, as well as an occasional forum for questions and discussion about the software. You can subscribe yourself to this list on-line.
Rarely, a patch may need to be applied before the installation will work. The one case so far is a set of changes to Z routines caused by changes to Linux appearing in the RedHat versions 8 and 9. The installation script stops before starting INSTEP2 and INSTEP4, giving a convenient point to do the file downloads. See the 31DEC02 patch page for details.

=============================

参考网址

http://www.aips.nrao.edu/Mac.shtml

http://www.aips.nrao.edu/dec20.shtml

installation details

http://www.aips.nrao.edu/install.shtml

MacOSX

On Macs, you may need to create an /etc/sysctl.conf file
Put in it the following lines

 kern.sysv.shmmax=10485760
 kern.sysv.shmmin=1
 kern.sysv.shmmni=32
 kern.sysv.shmseg=8
 kern.sysv.shmall=4096

重启后可以使用 sysctl kern.sysv来查看状态。

代码参考 https://www.github.com/shaoguangleo/radio_astronomy

AIPS 简略安装说明

下载脚本

1
2
wget ftp://ftp.aoc.nrao.edu/pub/software/aips/31DEC23/install.pl
chmod +x install.pl

开始安装

1
perl install.pl -n

其中需要注意的是:

  • 安装脚本选择在~/aips/中
  • group owenrship 设置为 prjg9600014
  • Site name 为 SHAO
  • Data Area 设置为 : /groups/vlbi_group/home/share/aips/data/
  • Printer 设为为 A4

安装完成后添加下列信息到/etc/service

1
2
3
4
5
6
7
sssin           5000/tcp        SSSIN      # AIPS TV server
ssslock 5002/tcp SSSLOCK # AIPS TV Lock
msgserv 5008/tcp MSGSERV # AIPS Message Server
tekserv 5009/tcp TEKSERV # AIPS TekServer
aipsmt0 5010/tcp AIPSMT0 # AIPS remote FITS disk access
aipsmt1 5011/tcp AIPSMT1 # AIPS remote tape 1
aipsmt2 5012/tcp AIPSMT2 # AIPS remote tape 2

代码参考 https://www.github.com/shaoguangleo/radio_astronomy

AIPS trouble shooting

如果你选择将AIPS的tar包下载下来安装,可能会碰到诸多问题,譬如编辑器的问题,这里就涉及到了你必须要安装Intel的FORTRAN编辑器和C、C++编辑器,并且这些都不是免费的,虽然有30天的试用评估版本,还是会有很多的问题的,所以这种方式不推荐。
两者的安装与Intel IPP类似,方法雷同,见:
http://guoshaoguang.com/blog/2011/05/10/如何下载-intel-integrated-performance-primitives-intel-ipp/

START_AIPS: AIPS_ROOT is not a directory; cannot start AIPS.

The solutions

1
2
3
4
5
6
$ cd /the/directory/of/aips     
$ . LOGIN.SH
$ AIPSROOT.DEFINE

The current directory is /the/directory/of/aips
— is this what you want to be AIPS_ROOT? (y/n) y

还有一种情况是对比一下两个文件,估计AIPS_ROOT不一致,修改即可

1
2
3
4
5
$ vim /home/aips/LOGIN.SH
# and
$ vim /home/aips/START_AIPS

# check what is the AIPS_ROOT area.

AIPS troubleshooting, Data directory undefined

默认情况在AIPS/DA00/DADEVS.LIST是可以看到这个信息的,不过如果希望使用不同的,或者有这个问题,可以通过创建文件$HOME/.dadevs.always进行解决,内容如下:

1
2
+  /the/path/you/want/to/store/AIPS/LUSTRE_1
- /the/path/you/want/to/store/AIPS/LUSTRE_2

FILAIP / POPSDAT 出错

解决方法为

1
2
3
4
$ source LOGIN.SH
$ RUN FILAIP # 然后输入YES,输入8 2

$ RUN POPSGN # 然后输入YES,输入0 POPSDAT TST

参考

参考 https://www.github.com/shaoguangleo/radio_astronomy

使用CTRL-o和CTRL-I跳转

Vim使用跳转列表来跟踪你的导航,你可以通过这个列表来向前或者向后导航。

跳转列表保留所有地方的轨迹,它可以跟踪文件名、行号和列号。

查看调整列表::jumps

导航键 描述
CTRL-o 跳转到上一个位置点
CTRL-I 跳转到下一个位置点
5CTRL-o 跳转到显示在位置0上面的位置5
5CTRL-I 跳转到显示在位置0下面的位置5

其余类推即可。

** Linux NTP**详细配置及使用方法

实际配置

目前连续谱的两台机子已经配置好ntp服务。

其中服务器IP为192.168.135.8,客户端IP为192.168.135.7,使用eth1进行直连。

在客户端只需要执行

ntpdate 192.168.135.8

hwclock –w

即可。

Linux NTP Introduction

The Network Time Protocol (NTP) is a protocol used to help synchronize your Linux system’s clock with an accurate time source.

Linux NTP客户端的使用

如果时间服务器端已经配置好,直接执行下面两条命令就可以。

如果时间服务器端还未配置好,参考下述服务器端的配置

1.执行ntpdate *.*.*.* #...是NTP服务器的IP
2.执行
*hwclock –w***把时间信息写入BIOS

将上述文件写入.bashrc中就可以每次开启终端的时候进行时间同步。

Linux NTP服务器端的配置

一般而言,安装系统的时候已经自带了ntp软件包,可以通过rpm -q ntp命令来查询是否已经安装ntp。

如果没有安装,终端中使用yum install ntp即可进行安装。(适用于redhat系列平台)
具体步骤为添加配置文件信息到/etc/ntp.conf。

每次配置好后,都需要重启一下ntp服务,service ntpd restart。

附: ntp.conf配置文件实例:

设置要求:不对 Internet 提供服务,仅对内部子网 .../24 提供服务,内部子网的客户端不能修改NTP服务器的时间参数。

在ntp.conf中增加以下内容:(有些)

restrict default ignore # 关闭所有的 NTP 要求封包
restrict 127.0.0.1   # 开启内部递归网络接口 lo
restrict 192.168.135.0 mask 255.255.255.0 nomodify notrap #在内部子网里面的客户端可以 进行网络校时,但不能修改NTP服务器的时间参数。

(192.168.135.0就可以保证在这个网段的255个地址都可以同步使用)

可能出现的问题

如果出现htpd:the NTP socket is in used , exiting,需要在/etc/rc.d/init.d下运行./ntpd stop即可解决。另外还需要注意防火墙有可能屏蔽掉ntp使用的端口。