Developer

From bone.wiki
Revision as of 18:45, 17 November 2009 by Enodwell (talk | contribs) (→Other Development Pages: Added link to C Shell Scripts page)
Jump to navigation Jump to search

Other Development Pages

Here is a list of other development-related pages. (Some material has been moved because this page is getting very long.)

Topics - Software Projects

Topics - Platforms

Topics - Tools

Topics - Misc

Hardware

Used Alpha stations at http://www.islandco.com




C Shell Scripts

These scripts must be executable.

$ chmod 775 myscript.com

Sample 1

This file aim2voi.com shows the use of command line arguments in a CSH script.

#!/bin/csh
#------------------------------------------------------------------------------
onintr end
if ($#argv < 1) goto usage
#------------------------------------------------------------------------------
aix $1.aim > $1.dsc
aic2voi $1.aim $1.voi
goto end
#------------------------------------------------------------------------------
usage:
#
echo ""
echo "Usage:"
echo ""
echo "aim2voi aim_filename (without aim extension)"
echo "will create a voi and dsc file from an aim"
echo ""
#
exit
#------------------------------------------------------------------------------
end:
exit
#------------------------------------------------------------------------------

Sample 2

Similar to above, but aim2bid.com generates a temporary file called stack which is used as input.

#!/bin/csh
#------------------------------------------------------------------------------
onintr end
if ($#argv < 4) goto usage
#------------------------------------------------------------------------------
set i = $3
while ($i <= $4)
  set nr = $i
  if ($nr<10)  set nr = "0"$nr""
  if ($nr<100) set nr = "0"$nr""
#  if ($nr<1000) set nr = "0"$nr""
  echo "XY" >! stack
  echo "$i" >> stack
  echo "$5" >> stack
  if ($6 != "") then
    echo "0" >> stack
    aio $1 "$2"_"$nr".bid 14 < stack
    convert -size "$7" "$2"_"$nr".bid "$2"_"$nr"."$6"
    \rm -f "$2"_"$nr".bid
  else
    echo "2" >> stack
    aio $1 "$2"_"$nr".bid 14 < stack
  endif
  \rm -f stack
  @ i = $i + 1
end
goto end
#------------------------------------------------------------------------------
usage:
#
echo ""
echo "Usage:"
echo ""
echo "aim2bid aim_filename bid_prefix first_slice last_slice scal_factor [form size])"
echo "                                (values are one-based)              gif/tif/..."
echo ""
#
exit
#------------------------------------------------------------------------------
end:
exit
#------------------------------------------------------------------------------

Sample 3

An example where a sequence of commands are executed resulting in an e-mail to let the user know that their job is finished.

#!/bin/csh
# 
nohup faim -s $1; /bin/csh -cbf "Mail -s 'JOB $1 FINISHED' boyd@kin < ~/adm/mailer/faimjob.txt" &

You would run this script called faim.com as follows

$ faim.com inputfile

Sample 4

This example uses two files. One called wrap.com is the base program that is called in a more general program called wrap_all.com so that many different files can be processed by the base script.

  • wrap.com
#!/bin/csh

echo "0" >! stack
echo "0" >> stack
echo "0" >> stack

/home/skb/works/fio/aim_io $1.aim $1_sub.aim minimal 15 < stack

/rm -f stack

exit
  • wrap_all.com
#!/bin/csh

~/works/com/wrap calgary_dog_aclx_03-04_med_fem_left
~/works/com/wrap calgary_dog_aclx_03-04_med_fem_right
~/works/com/wrap calgary_dog_aclx_03-04_med_tib_left
~/works/com/wrap calgary_dog_aclx_03-04_med_tib_right

echo "DONE!"
exit

temple.ucalgary.ca

Configuration Details

I include in the attachments my checklist I use for a Solaris 10 installation, adjusted to show only items particular to yours and not my entire decision tree. I added brief explanations for some of the items that might seem arbitrary otherwise.

Very similar decisions are made when installing any release of Linux, Solaris, MS Windows or yet another operating system - the details vary though.

http://docs.sun.com/ has all (too many) the details.

Install XEmacs

However, I would not install both Emacs and XEmacs at the same time. Nowadays, I highly recommend installing only one of them, with my preference given to XEmacs. Of course, only when there are no specialized Lisp packages that require Emacs.

Then my installation would be like below:

$ cd /cdrom/s10_software_companion/components/sparc/Packages
$ cat > /tmp/nointeraction
  mail=
  instance=unique
  partial=nocheck
  runlevel=nocheck
  idepend=nocheck
  rdepend=nocheck
  space=quit
  setuid=nocheck
  conflict=quit
  action=nocheck
  basedir=default

$ pkgadd -a /tmp/nointeraction -d . -n SFWbdb SFWgcc34l SFWxmacs
  [ Copyright and legal notices omitted for brevity. ]
  21872 blocks

  Installation of <SFWbdb> was successful.
  [ Copyright and legal notices omitted for brevity. ]
  69953 blocks

  Installation of <SFWgcc34l> was successful.
  [Copyright and legal notices omitted for brevity. ]
  264202 blocks

  Installation of <SFWxmacs> was successful.

$ emacs () { /opt/sfw/bin/xemacs $* ; }

$ pkgadd -a /tmp/nointeraction -d . -n SFWddd SFWgbin SFWgdb
  [ To complete installation of the other packages you require. ]

$ pkginfo SFWbdb SFWddd SFWgbin SFWgcc34l SFWgdb SFWxmacs
  system      SFWbdb    berkeleyDB - Berkeley Database Library
  system      SFWddd    ddd - GNU Data Display Debugger
  system      SFWgbin   binutils - GNU binary utilities
  system      SFWgcc34l gcc-3.4.2 - GNU Compiler Collection Runtime Libraries
  system      SFWgdb    gdb - GNU source level debugger
  system      SFWxmacs  XEmacs - text editor

Developing on Duck

Installing GNV (GNU is not VMS)

Downloading GNV

First, download GNV version 1.9 for VMS 7.3-2
http://h71000.www7.hp.com/opensource/gnv.html

Unzip the file on your workstation. FTP the two .pcsi to duck using the "binary" mode (i.e. type bin before you use get. Make sure that all letters in the file name are uppercase, so, for example, if you got the following after unzipping:

dec-axpvms-gnv-v0109-000-1.pcsi$compressed;1
dec-axpvms-gnv-v0109-000-1.pcsi$compressed_esw;1

rename them to

DEC-AXPVMS-GNV-V0109-000-1.PCSI$COMPRESSED;1
DEC-AXPVMS-GNV-V0109-000-1.PCSI$COMPRESSED_ESW;1

Installing GNV

Login as user system to do the installation.

Follow the installation instructions on http://openvms.compaq.com/OpenSource/gnvreadme_first.html, section 6.

$PRODUCT INSTALL GNV /SOURCE=device:[dir.where.pcsi.are]

Setting up GNV

Follow the installation instructions on http://openvms.compaq.com/OpenSource/gnvreadme_first.html, section 7.
The following modifications were made to configuration files on duck:

1. File SYS$MANAGER:SYSTARTUP_VMS.COM: the following line was added

$ @SYS$STARTUP:GNV$STARTUP.COM


2. File LOGIN.COM at the devel account: added the line below

$ @GNU:[LIB]GNV_SETUP.COM

3. As mentioned in http://openvms.compaq.com/OpenSource/gnvreadme_first.html, section 9.3, long file names are enabled on an ODS-5 disk by adding the follwowing line devel's LOGIN.COM file:

$ SET PROCESS/PARSE_STYLE=EXTENDED

Note that you could also make the terminal case sensitive, but this did not work well, so I did not include this command.

Running GNV

Just start bash:

$ ssh -l devel duck.kin.ucalgary.ca
devel@duck.kin.ucalgary.ca's password: 
Welcome to OpenVMS (TM) Alpha Operating System, Version V7.3-2  

DISK1:[DEVEL]
$ bash
bash$ 

See the list of commands available at http://h71000.www7.hp.com/opensource/gnvreadme_first.html, section 5.