How to install the FLUX7 package on a Unix or Linux system.

Most of the following also applies to the installation on a Windows32 system. For system requirements for that case see win32. See also "INSTALLATION PROBLEMS" in faq

Fortran compiler

FLUX7 is written in Fortran77. Some of the auxiliary programs use modules written in C. Various Fortran compilers have been used in the past to compile the package. Notably the combination gcc - g77 has been found to work well and produce efficient code. This is also the compiler that was used to maintain and update Flux from 2000 until 2013.

However the GNU g77 compiler has been replaced with gfortran. This is a Fortran95 compiler, in which some of the older Fortran77 constructs are not implemented.

In Flux7.9.0 these obsolete Fortran77 constructs have been replaced with Fortran95 features. Another innovation in Flux7.9.0 is the implementation of parallel processing, where the inner loop of the flux simulation is handled by multiple CPU's. The current version is compatible both with gfortran and g77, but parallel processing is only supported in gfortran.

turnaround times

for job 'fluxvelo.bat' (see directory INPUT)

  Hardware: Intel core i5-2500 (4 CPU's) at 3.3 GHz
            Passmark = 6592 (April 2012)

  Flux7:    version 7.9.0

  Fortran  version threads arch      OS        seconds 

  g77      3.4.6      1    32-bits   Linux      360
  g77      3.4.0      1    32-bits   Win7/MinGW 355

  gfortran 4.7.2      4    64-bits   Linux       84 

  gfortran 4.7.2      4    32-bits   Win7/MinGW 129


The following assumes you have installed the PGPLOT graphics package, although some programs, flux7 in particular, will work without it.

To obtain PGPLOT, see "PGPLOT" in flux7 . To install PGPLOT, see "PGPLOT" in faq . I have included a modified PostScript Driver for PGPLOT. This driver enables the use of PosScript fonts in output files. If you want to use this, you should patch and (re-)install the PGPLOT graphics package. For details see "PostScript Fonts in PGPLOT" in psdriver.


For possible problems in the installation procedure, see "INSTALLATION PROBLEMS" in faq

Make FLUX7 your current directory.

In the following this directory is indicated as './'

Make Makefiles

Type './makemake' or './makemake <makedefs_file>' This will edit the Makefiles in this directory, and in the various subdirectories.

If you don't like the result, edit the file for your installation, rather then the individual Makefiles.

Things that might need to be adapted are BINDIR, and the system dependent parameters FFLAGS, CFLAGS, etc. The option -Df77_UNDERSCORE_AFTER in CFLAGS should be set if your Fortran appends an underscore to subroutine names. The makedefs file also selects a few system dependent subroutines.

 'makedefs' files are included for Linux and for MinGW.
  A few versions for other Unix variants are also present. These have
  not be maintained in the last 12 years and are therefore moved to
  directory archive.

If you make one for another system, or have suggestions for improvements to the above, please send me a copy.

attention PC users (Linux as well as MSWindows)

Users may profit from the -march=cpu-type commandline option of gcc to somewhat speed up calculations. Recent versions of gcc support the option -march=native. Older versions require to specify the cpu-type. Check the value of HOSTTYPE in makedefs.linux or makedefs.mingw.

environmental variable FLUX

Define an environment variable with name FLUX and value the full pathname to directory FLUX7.

 example (bash, lines to be included in ~/.profile):
 export FLUX

For other environment variables associated with flux7, see PATH and "TUNING PGPLOT."


Some files containing data tables are grouped together in directory ./TAB ( files COMBIN.FIG,, scoef.88, HFCHARGE.DAT ).

Alternatively, put these files in some other place where they are easily accessible for all potential users e.g. directory /usr/local/tab.

If so, file $FLUX/FLUXLIB/FILE.LOC that contains the locations where these files reside will need some editing.

System dependent features

Check for system dependencies, see section on FLUXLIB A few system dependent features may also be encountered in the INCLUDE directives in different Fortran modules.

The script ./BIN/ini contains some system dependent features and should be edited to suit your site.

If you use a compiler other then gfortran, g77, or the standard HPUX, SGI or Sun f77 compilers, see also cbinding.


You may want to have a look at the special instructions for "Installing rbsim" in rbsiminst


Type 'make'

This will leave the compiled programs in various directories. and also in directory ./BIN.


Include FLUX7/BIN in your PATH variable.

e.g. if your command processor is 'csh':

    setenv PATH $FLUX/BIN:$PATH

or in bash:


($FLUX stands for the directory you have chosen to install FLUX7)

Put the commands used, including the definition of variable FLUX, in your .cshrc or .profile.


Make sure environmental variable PGPLOT_DEV is set (e.g. to /xwin, or, if you want no output, to /null)

Some tests provided may be run by typing:

 'ini -t fluxtest'
 The script 'testall' combines 5 tests that may also be run separately:
    'cd ./TEST; make test'
    'cd ./MISC; make test'
    'cd ./RBSIM; make test'
    'cd ./YIMP; make test'
    'cd ./FITYIM; make test'
 'cd ./INPUT; ./fluxvelo.bat' (takes a while, have a coffee break)
 'cd ./PLOTXY; make test'

Observe the output for error and warning messages!

Examples of input files may also be found in subdirectory INPUT. Various directories have subdirectories named TESTOUTPUT. These give an idea of what to expect when running the test programs.


Remove the object files and other junk by typing 'make clean'


Although PGPLOT is well documented, some details are hard to find.

PGPLOT environmental variables, general

 PGPLOT_DIR directory where to find pgplot stuff (/usr/local/pgplot/)
 PGPLOT_DEV default device driver (/xwin)
 PGPLOT_BACKGROUND=white (default is the other way around!)
 PGPLOT_FONT specify font file, override $PGPLOT_DIR/grfont.dat
 PGPLOT_RGB  specify color-name database, override $PGPLOT_DIR/rgb.txt

environment variables for the Xwindows driver

 PGPLOT_XW_WIDTH (value between 0 and 2)
  may be used to scale the size of the window. Only takes effect
  after restarting the server (icon 'pgxwin').
  A good starting value is something around 0.6.
 This variable has no effect if the pgxwin.Win.geometry is defined !?!
 (See below)

environment variables for the PostScript driver:

 PGPLOT_PS_WIDTH    default  7800
 PGPLOT_PS_HEIGHT   default 10500
 PGPLOT_PS_HOFFSET  default   350
 PGPLOT_PS_VOFFSET  default   250
   If this variable has value MAX,  PGPLOT puts standard (full-page)
   bounding-box information in the header of the PostScript file. If
   the variable is unset or has some other value, PGPLOT puts the
   correct (smallest) bounding box information in the trailer of the
   PostScript file.
   Specify "NO" to suppress use of a PostScript font for the graph
   markers; markers are then emulated by line-drawing.
 PGPLOT_PS_COLOR     if set, use color mode
 PGPLOT_IDENT        if set write user name etc on each page
 PGPLOT_PS_DRAW_BBOX If set, draw bounding box
 PGPLOT_PS_FONT      If set to "NO"` don't use PostScript fonts, or,
                     choose Times/Courier/Helvetica/NewCentury/Zapf

X resources (may be put in your file ~/.Xdefaults):

 pgxwin.Win.geometry: WIDTHxHEIGHT+X+Y
 pgxwin.Win.iconGeometry:  +X+Y
 pgxwin.Win.iconize: If true, iconize inactive windows if persistent
 pgxwin.Win.acceptQuit: True if WM_DELETE_WINDOW events are to be obeyed
 pgxwin.Win.minColors: Min number of colors per colormap
 pgxwin.Win.maxColors: Max number of colors per colormap
 pgxwin.Win.visual: default|monochrome|pseudocolor|directcolor|
 pgxwin.Win.crosshair: If true show crosshair cursor
 pgxwin.server.iconGeometry:  +X+Y
 pgxwin.server.visible: True|False
 pgxwin.server.display: display_name