Installation from source

From CARMA
(Difference between revisions)
Jump to: navigation, search
(Hacking Miriad)
(Installation from Source)
Line 13: Line 13:
 
   miriad_cvs/install/install.miriad
 
   miriad_cvs/install/install.miriad
  
This shell script does have some optional arguments, but you should not need to supply any.  
+
This shell script does have some optional arguments, but you should not need to supply any. If things look bad, you can have a look at some known [[installation problems]] or suggestions how to fix them.
  
 
'''Step 2-new''': If you really want to be experimental and try the new autoconf based install, you can also try this hack:
 
'''Step 2-new''': If you really want to be experimental and try the new autoconf based install, you can also try this hack:

Revision as of 20:45, 2 June 2008

Installation from Source

In a nutshell grab the (CVS enabled) source code, and run the install script. If that fails, you should consult the more detailed installation guidelines. You can also follow the new Autoconf based installation.

Step 1: grab the source code

  curl ftp://ftp.astro.umd.edu/progs/bima/miriad.tar.gz | tar zxf -
 or
  wget -O - ftp://ftp.astro.umd.edu/progs/bima/miriad.tar.gz | tar zxf -

Step 2-old: install using your own default compiler

  miriad_cvs/install/install.miriad

This shell script does have some optional arguments, but you should not need to supply any. If things look bad, you can have a look at some known installation problems or suggestions how to fix them.

Step 2-new: If you really want to be experimental and try the new autoconf based install, you can also try this hack:

  miriad_cvs/install/test_a_new_miriad_cvs rootdir=miriad_cvs reuse=1 auto=1

Step 3: Source the appropriate startup file, depending on your shell, and miriad should now be usable in your shell. You can also make this permanent by adding this to your ~/.cshrc or ~/.bashrc file.

For example, for a csh style shell in the old build style:

  source miriad_cvs/miriad_start.csh

will add miriad to your current (csh) shell. Or if you were using the new build system:

  source miriad_cvs/automiriad.csh

Hacking Miriad (old build style)

An example of hacking a routine where a user ran into a program that had some kind of obvious problem. In this example we assume the user has write permission in the $MIR tree.

 % smauvspec ....                         # oh oh ... program crashes for probably simple reason
 ### Fatal Error:  Buffer overflow(points), when accumulating plots
 % mirboss                                # become more powerful miriad boss (to make mods)
 % cd $MIRPROG/sma                        # go to where the action is (yes, you'll have to know that)
 % cvs -nq update smauvspec.for           # for sanity, check if there is no update
 % cvs update smauvspec.for               # if there was, probably good idea to update
 % mir.prog smauvspec                     # sanity check: make sure it still compiles
 % edit smauvspec.for                     # make your changes in your favorite editor
 % mir.prog smauvspec                     # compile your version, it will be in $MIRBIN
 % cd-                                    # go to where you were working....
 % smauvspec vis=.....                    # check it out

If the user had no permission to write inside the $MIR tree, you could still work around this if your local friendly miriad hacker is not available:

 % cp $MIRPROG/sma/smauvspec.*  .         # make a local copy of the two files you need
 % edit smauvspec.for                     # edit it
 % mirmake smauvspec                      # uses template makefile. The "debug" command ok as well
 % ./smauvspec vis=...                    # test your local version explicitly

The next time when you update miriad (e.g. cvs update, or the more rigorous mirupdate command) it will attempt to merge your modification with any possible modification that were made in the official miriad release. This merge usually works, and you should check this by recopiling that program manually. Or simply use the cvs diff command:

 % cd $MIRPROG/sma                        # go to where the action is
 % cvs -nq update                         # watch if smauvspec.for or .h have any C's or U's 
 % cvs diff smauvspec.for                 # difference yours with the CVS master version
 % cvs diff -Dnow smauvspec.for           # difference if you saw a 'U' in the update test
Personal tools