/*********************************************************************** 
    Module:  Readme
 
    Copyright (C) 1996 Harold Youngren, Mark Drela 
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public
    License along with this library; if not, write to the Free
    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

    Report problems to:    guppy@maine.com 
                        or drela@mit.edu  
***********************************************************************/ 

C     Version 4.51 Updated 2/7/17


To make the plotlib under Unix/Linux with X-Windows graphics:

  If you have a Linux/OSX or Windows with MinGW there are make options to
  build for those environments

Simply typing make gives the options:

Usage:
  type: make <MACHINE>
   where <MACHINE> is one of the following:
   gfortran - Linux/OSX/Cygwin using gcc toolset
   ifort    - Linux/OSX with ifort/gcc
   mingw    - Windows using MinGW
   gfortranDP - Linux/OSX/Cygwin using gcc toolset, dbleprecision
   ifortDP    - Linux/OSX with ifort/gcc, dblprecision
   mingwDP    - Windows using MinGW, dblprecision
   clean    - cleanup directory

  The config.make.xxx files control the options.  These are supplied for
  xxx = gfortran/ifort on Linux or OSX or xxx=mingw for Windows with the
  MinGW tools installed. If the baseline options do not work you may need
  change the config.make files to reflect your compiler and library options.

  Several versions of config.make are supplied for the GNU gfortran/gcc and 
  the Intel ifort and gcc compilers. 

  A config.make for MinGW is provided to make a Windows Win32 executable (see
  below).  Separate Makefile.NT makefiles for Windows with Visual C are also 
  included though these are not updated very often (see below).

  The config.make files are supplied for single and double precision 
  versions of the plotlib.  Note that there are also optional declarations 
  for GNU 32 bit or 64 bit architectures in the config.make's, these may be 
  needed if your system has 64 bit libraries and your gcc or gfortran defaults
  to 32 bit executables.  This shows up as an incompatible link message as a 
  rule, check the make output.   Comment or uncomment options for your machine.

  The Makefile simply links one of the config.make.xxx files to config.make and
  then calls Makefile.all to do the work.
  

To make the plotlib under Windows there are three choices:

1) The best (free) option is the MinGW GNU development environment that
provides the compiler and libraries to develop programs to run under Windows.
MinGW is free, from (http://www.mingw.org/). MinGW comes with a Bash shell 
environment and a range of Unix-like tools for development and running 
programs (a useful addition if you learn to use them).  

Compiling the library and programs under MingGW is done from a MinGW shell 
using what is basically the same Unix style build process.  The only difference
is that the programs are linked against the MSYS libraries as well as the 
native Win32 libraries. 

Note that the MinGW Windows executables will need to be linked using
static linking (using a -static flag to the GNU compilers) if you want to make
an executable that is portable without having to similarly install the MingGW 
environment and libraries.  Static linking adds these MSYS libraries into the 
binary file so they should run on any Windows computer (XP...Win7/8)

To compile and link under MinGW:
  Enter make mingw or make mingwDP (for double precision library). The options
  are set in config.make.mingw which is linked to config.make.
  This should compile the fortran and a C interface library (W32win2.c in
  /win32 directory to make a workable plot library for Windows.

2) These programs can be built using the Cygwin toolset which provides a 
Unix-like environment (including X-Windows) on Windows.  This requires getting
and installing Cygwin (free from Cygwin (http://www.cygwin.com/) and then 
compiling using the Unix options and running under X-Windows.

This works but has several disadvantages. The X Windows server must be started 
before a plotlib program is called in order to get a plot window.  Also, the 
executable is not stand alone, requiring the cygwin.dll to be present to 
function. The need to install Cygwin/X and the cygwin.dll makes it hard to 
distribute these executables with other users.



3) use Intel Fortran and C or Intel Fortran and Visual C compiler.  
You should check the options in Makefile.NT to ensure that
these options match your system.  The supplied files match the Intel 
Fortran and Visual C compiler and use the Microsoft "nmake" utility.

Compile and link with command in DOS window: 
C:\Xfoil\plotlib: cd win32
C:\Xfoil\plotlib\win32: nmake /f Makefile.NT

This places all the .obj files in the win32 directory and copies libPltxx.lib
to the parent plotlib directory.

Alternatively you could load all the files into a Visual Studio project and
create the library that way.

#========================================================================#
Odd bits:

RE multiple precision libraries (if you wanted to support a code
compiled with higher precision for "reals" in fortran).

To create plot library libPlt.a you can normally just type:
  % make
  provided the file config.make matches your machine. The supplied config.make
  matches the config.make.SP single precision options file.

If you want to create a double precision version of the library:
  Link or copy one of the files config.make.xxxDP to config.make and check that 
  the options match your machine.  Set any names and compile options for double
  precision.  Then type:
  % make

If you don't have a file config.make.DP your alternative is to to this:
  go into the config.make and uncomment or add the line 
#PLTLIB = libPltDP.a
  set the DP flag for your compiler (uncomment appropriate line) and then:
  % make

For Unix, if you have set the INSTALLDIR variable you can install the plot 
  library libPlt.a to that location using the install option.  Before running
  this check the config.make and Makefile for proper install options and 
  destination for your system
  % make install


#========================================================================#
Graphics and windows:

The X-Windows environment may support automatic window refresh (when uncovered)
through the use of a "backing store".  If you do not have automatic window 
refresh (they stay blanked after uncovering) then a backing store can be set 
up using an option in the X config file (now Xorg.conf, usually in /etc/X11 
on Unix/Linux).  Check your X Windows documentation "man X" or "man Xorg.conf"
pages for further information. 

To set black-on-white video, define Unix variable as follows:
  % setenv XPLOT11_BACKGROUND white

To restore white-on-black video:
  % unsetenv XPLOT11_BACKGROUND

Windows versions of this require an environment variable to be defined to 
change the background (defaults to black)
  XPLOT11_BACKGROUND white


#========================================================================#
Plotlib test and examples:

There is a test directory to check the operation of the plotlib in ./examples
To create the test example and color selection programs (all optional):
  % make test

OR, go into the examples directory and do a:
  % make

To create the test and examples under Windoze:
  .\plotlib: cd examples
For MinGW this uses the plotlib ..\config.make setup:
  .\plotlib\examples: make
For Intel/Visual C use the nmake command on the special Makefile:   
  .\plotlib\examples: nmake /f Makefile.NT




See the following files for more info:

 Doc           Discussion, sample application calls, some routine descriptions
 pltlib.inc    Description of all global plot data (for tinkering with source)

 plt_base.f    Routine headers describe call lists
 plt_font.f     "
 plt_util.f     "
 plt_color.f    "
 plt_3D.f       "

 sym/Readme    Description of vector font generation and/or modification

 Readme-examples    Description of test and example programs		
 Readme.absoft      Info on Absoft Linux f77 for Xplot11 compile

examples/Readme-examples

