INSTALL

Prerequisite

Pasteup is written in C and Tcl, and uses 3 Tcl extensions ( Tk, BLT, TkTable. In addition, pasteup requires GD library. All the above languages and libraeis are mandatory for installing and running Pasteup. The current Pasteup is not dependent on the tkImge extension.

The required versions are,

All these softwares are open source and you can freely use them.

BLT is a very famous and useful extension of Tcl/Tk. However, the original BLT is not compatible with Tcl/Tk 8.5 and later. The wize version of BLT and The Refactored BLT COmponents (RBC) are two different projects to adapt BLT with Tcl/Tk 8.5. However, at least curretly, both of wize and RBC are not compatible with Tcl/Tk 8.6. To compile BLT (wize) with Tcl/Tk 8.6, you have to modify some sources in BLT. The enclosed patch file (blt-2.5.3+tcltk8.6.patch) will help you to modify the source. The patch file will modify the following points.

Besides, in most cases, you have to specify "-fPIC" to CFLAGS. If you experience segmentation fault, try to add "-O1" to the CFLAGS, because aggressive optimization (O2) causes some segmentation error in some version of GCC (I found it on GCC-4.6.3). Current pasteup is adapted to the BLT-2.5.3 (wize) but, if you wish, the pasteup can be adapted to the RBC after a little modification.

You can use several external seismic analysis application softwares, such as SU, raytracing and traveltime mapping, through the Pasteup. But these external seismic applications are not mandatory, and you can install Pasteup without these applications. If needed, you can add these external seismic applications after installing the Pasteup.

Build

After installing mandatory softwares, you can build the pasteup by the following procedure.
In this document, "$" represents a shell prompt.

  1. Generate "Makefile" and "pasteup.tcl" files for your system.
     $ ./configure
     
  2. Build a library "libpasteup.so" and a main script "pasteup".
     $ make
     
  3. Install pasteup under "/usr/local" tree.
     $ make install
     

Probably you need "root" privilege in the last step.
If you want to install pasteup in other directories, or if you have some troubles, see below.

some more configurations

Use pasteup in the build directory

To use pasteup in the build directory, type

$ ./configure
$ make packagedir=`pwd`

You don't have to run "make install".

Give some information to the "./configure" scripts

See the following example.

  1. Change install directory from "/usr/local" to your home directory.
     $ ./configure --prefix=$(HOME)
          
  2. Change C compiler flags. Default CFLAGS="-g -O2 -fPIC -L$(prefix)/lib -I$(prefix)/include".
     $ CFLAGS="-O1" ./configure
          
  3. Specify paths for libraries and header files.
     $ ./configure --libdir=/foo/bar/lib --includedir=/foo/bar/include
          
  4. a little complex example...
     $ LD_LIBRARY_PATH=/foo/bar/lib ./configure --libdir=/foo/bar/lib --includedir=/foo/bar/include
          
  5. if you have several versions of BLT,
    $ ./configure --with-bltinclude=$HOME/local/include
          

Typical environment variables associated to the configurations are,

For detail, type

$ ./configure --help

or see the autoconf manual.

If the "configure" fails...

There are plenty of possible reasons why the "configure" script fails.
First, consult "config.log" file, which is a result of "configure". This file contains the reason of failure.

If necessary, edit the "configure.in" file and re-generate the "configure" script by

$ autoconf

The "configure.in" file is written for autoconf version 2.61. Therefore, if your system has older version of "autoconf", "autoconf" might fail. In such a case, edit the configure.in, or upgrade your autoconf.

When you cannot execute pasteup...

If you cannot execute the pateup, check the "pkgIndex.tcl" file. The file should contain one uncommented line, like the following.
package ifneeded pasteup 2.1.4 [list load [file join $dir libpasteup.so]]
This line is generated automatically by tclsh during the build. However, in some cases, tclsh fails to generate this line because tclsh cannot recognize the "libpasteup.so" file. A quick but dirty remedy for this situation is to add the above line into "pkgIndex.tcl" by using an editor you like. If you are lucky, you can use pasteup with this approach (but keep it in your mind that your tclsh cannot correctly recognize your compiled "libpasteup.so"; this implies your pasteup might not be consistent with the tclsh of your environment). Note the "2.1.4" in the above example is the version number of the "libpasteup.so". The version number of "libpasteup.so" may be different from the version number of "pasteup". The version number of "libpasteup.so" is stored in the end of the "libpasteup.c" file, like the following.
    return Tcl_PkgProvide(interp, "pasteup", "2.1.4");
So, first examine the version number in the "libpasteup.c" file. Then append the above "package ifneeded ..." line to your pkgIndex.tcl file. Finally, execute "make install" to install all the files including "pkgIndex.tcl" file.