CMPR Unix installation

CMPR should run on any platform where Tcl/Tk? and BLT compile, which means just about any Unix environment. In addition one will need the Bwidget package. In theory CMPR should run with any recent version of Tcl/Tk?, but (as of Jan 2010) there are definitely some bugs in an early version of BLT patched to work with Tcl/Tk? 8.5 packages. Note that the source code for the DICVOL06 program is not distributed, so that cannot be used on platforms other than linux, mac and windows without the involvement of the program authors. All other source code used in CMPR is supplied. At present the GNU !GFortran compiler (and gcc for a few C subroutines) has been used to compile the programs, but in the past g77 has worked and most likely any modern commercial Fortran compiler should also work, possibly with some changes to options listed below.

To obtain the CMPR source code use the static linux package and delete the executable images:

or (better, IMHO) use subversion to download the stable and development versions:

svn co ~/myApps/CMPR` svn switch ~/myApps/CMPR/cmprdev

if this is done, command svn up ~/myApps/CMPR can be used to obtain the latest updates to CMPR.

Compile the CMPR programs

Select compilation options by creating file src/ editing as needed the Makefile vars (see below) in an editor.

Then compile the programs using

     make all

You can find some examples to work against, such as

Note that the script used by make (Makefile) use some conditional features of GNU make. If you only have access to your local system's version of make, you may need to uncomment the definition of SYSTEM and set the value of INSDIR manually. See Makefile.sgi

Makefile variables

The following Makefile variables may need to be set, to adapt compilation to suit your flavor of Unix.

Symbols in file src/

FORTRAN compiler name (gfortran, g77, f77, etc.)
C compiler (gcc, cc, etc.)
FORTRAN compiler command-line options
suffix on executable files (.EXE for windows and usually blank in Unix)

(depreciated) Symbols in file logic/

FORTRAN compiler name (g77, f77, etc.)
C compiler (gcc, cc, etc.)
extra libraries needed by FORTRAN programs, if any
FORTRAN compiler command-line options
C compiler command-line options
name of logic subroutine library, usually ../logic.a
suffix on executable files (.EXE for windows and usually blank in Unix)
set to ranlib, if needed with ar; set to echo otherwise
Compiler flags that determine the naming conventions used in C for FORTRAN subroutines. (See below)

Options for the NAMEOPTION variable

There are differences the naming and length conventions by different FORTRAN and C compilers. To allow the code to be used on different platforms, several C macros must be defined to within a C header file (srclogic/logicmap.h and encode/logicmap.h). One of each set of values must be passed to the compiler (for example, "NAMEOPTION = -DTWOSCORE -DBIT32").

Three different methods are defined to map between FORTRAN and C names, according the value of NAMEOPTION:

where one _ character is appended. (The SGI f77 compilier adds an underscore (_) to the names of FORTRAN subroutines.)
where one or two _ characters are appended. (The GNU g77 compilier adds an underscore to the names of FORTRAN subroutines except in the case of names that already contain an underscore, g77 adds two.)
where no _ are appended (The HP fort77 compilier does not add any underscores.)

If you see error messages of with undefined references to subroutines named ps_* or psl_* you have likely selected the wrong option here.

Variable types

Three options are defined for the mapping of variable types between FORTRAN and C (for example, does INTEGER*4 correspond to long or int or even short in C).

used for 16 bit operating systems (are there any left?)

used for 32 bit operating systems
used for 64 bit operating systems (none have been tested)
Last modified 9 years ago Last modified on Sep 6, 2012 1:59:35 PM