Installing Flux on an Ubuntu system

CHAPTER 1. Environment

CHAPTER 2. Obtaining gcc and gfortran and other preparations

In Linux, open a terminal window, and give the commands This should install the gfortran compiler.
Now that you are at it, also download some X11 stuff:

Download the latest Flux distribution from http://pjms.nl/FLUXBIN/
Unpack, but do not install yet.
In the following flux7.9.7 is the identifier of the Flux distribution, may change in the future.

tar -jxvf Downloads/flux7.9.7.tar.bz2

Put the following environment variables in $HOME/.profile:
(instead of PGPLOT any other directory name may be chosen)

  export PGPLOT_DIR=${HOME}/PGPLOT
  export PGPLOT_DEV=/xwin
  export PGPLOT_BACKGROUND=white
  export PGPLOT_FOREGROUND=black
  export PGPLOT_XW_WIDTH=0.6
  export FLUX=${HOME}/flux7.9.7/FLUX7 
  PATH=.:$FLUX/BIN:$PATH
You have to reboot for these changes to take effect systemwide.

Note the '.:' may be omitted from the PATH, if you really like the default Ubuntu behaviour of not automatically recognizing commands in the current directory.

CHAPTER 3. Installing PGPLOT

download pgplot5.2.tar.gz from ftp://ftp.astro.caltech.edu/pub/pgplot/pgplot5.2.tar.gz

most likely the following command works:

Alternative.

Unpack the download:

~$ tar -zxvf Downloads/pgplot5.2.tar.gz 
~$ cd pgplot

Copy the 2 PostScript files of FLUX (optional, see: pjms.nl/FLUXHTML/psdriver.html )
~/pgplot$ cd drivers
~/pgplot/drivers$ mv psdriv.f psdriv.f.orig
~/pgplot/drivers$ cp -a $FLUX/PGPLOT.PSDRIV/psdriv.f .  
~/pgplot/src$ cd ../src
~/pgplot/src$ mv grtext.f grtext.f.orig
~/pgplot/src$ cp -a $FLUX/PGPLOT.PSDRIV/grtext.f .
Make destination directory PGPLOT.
~/pgplot/src$ cd ~
~$ mkdir PGPLOT
~$ cd PGPLOT
copy drivers.list to the destination dir, and edit
~/PGPLOT$ cp ~/pgplot/drivers.list .
~/PGPLOT$ vi drivers.list
uncomment the wanted drivers, my choice are:
 PSDRIV 1 /PS        PostScript printers, monochrome, landscape	Std F77
 PSDRIV 2 /VPS       Postscript printers, monochrome, portrait	Std F77
 PSDRIV 3 /CPS       PostScript printers, color, landscape	Std F77
 PSDRIV 4 /VCPS      PostScript printers, color, portrait	Std F77
 XWDRIV 1 /XWINDOW   Workstations running X Window System	C
 XWDRIV 2 /XSERVE    Persistent window on X Window System	C
create makefile:
~/PGPLOT$ ~/pgplot/makemake ~/pgplot linux g77_gcc_aout
~/PGPLOT$ vi makefile
a few changes in the makefile (< = old, > = new):
25,27c25,26
< FCOMPL=g77
< FFLAGC=-Wall -O
---
> FCOMPL=gfortran
> FFLAGC=-Wall -O
remove line 27 (-fno-backslash)
~/PGPLOT$ make
~/PGPLOT$ make cpg
~/PGPLOT$ make clean

Make a test, e.g.

~$ cd $PGPLOT_DIR
~/PGPLOT$ ./pgdemo1
and watch the nice pictures.

CHAPTER 4. BUILDING FLUX

You already downloaded FLUX, extracted the files and set environmental variables FLUX and PATH as described above.

Go to $FLUX

$ cd $FLUX

$ makemake
(For other than Linux or Mingw64 use "makemake makedefs-file") 
If you did not include '.:' in the PATH (see chapter 2) you will now get the error
bash: makemake: command not found
As a work around type:
$ ./makemake
$ make clean
$ make
!Yippee No errors!!

test if flux is working

$ cd $FLUX/INPUT
$ ./fluxvelo.sh
if these don't work, try instead
$ sh cd $FLUX/INPUT
$ sh ./fluxvelo.sh
let it run, takes 1 to 40 minutes depending on system
At the end it will tell you the time used
(on my computer it took 50 seconds, on my notebook over half an hour.)

For some further tests try, e.g.,

$ $FLUX/testall
Further tests and demo's may be found in various subdirectories, such as
cd PLOTXY
demo

Appending: Installing Flux in MSYS2 - MinGW-64

MSYS2 MinGW-w64 is a unix-like environment running under Windows. My experience is that the resulting Flux7 is slower than the Ubuntu versions. It is assumed that you have MSYS2 etc installed, see https://www.msys2.org/ and set up a development environment. In the following a few notes about installing flux7 this way.

GrWin

Unforunately this system does not support XWindows, but an alternative is available: GrWin. see https://grwin.com/grwin/en/