# $Id: README.Fujitsu 2713 2016-12-16 20:32:36Z wkliao $

This file is for users who will edit file "configure.in" and run command
"autoreconf" to regenerate file "configure".

Autoconf 2.69 has a problem of checking the version of the Fujitsu Fortran
compiler, which causes errors for building PnetCDF at the configure time.

The fix and patch have been discussed and provided in the link below. PnetCDF
users/developers are encouraged to apply to patch to their autoconf utility.

Subject: Support Fujitsu in _AC_PROG_FC_V
https://lists.gnu.org/archive/html/autoconf-patches/2013-11/msg00001.html

----------------------------------------------------------------------
Once the patch is applied and autoconf rebuilt, PnetCDF can be built with
one of the following configure commands.

  # for non-cross-compiling
  ./configure --prefix=/path/to/install \
              --with-mpi=/path/to/MPI/installation

or
  # for cross-compiling
  ./configure --prefix=/path/to/install \
              --with-mpi=/path/to/MPI/installation
              cross_compiling="yes"

or
  # for cross-compiling and wth explicit MPI compiler names
  ./configure --prefix=/path/to/install \
              cross_compiling="yes" \
              MPICC=/path/to/MPI/installation/mpifccpx \
              MPICXX=/path/to/MPI/installation/mpiFCCpx \
              MPIF77=/path/to/MPI/installation/mpifrtpx \
              MPIF90=/path/to/MPI/installation/mpifrtpx

or
  # for cross-compiling and wth explicit MPI compiler names
  # and optimization flags
  ./configure --prefix=/path/to/install \
              --host=sparc64-unknown-linux-gnu \
              --build=x86_64-redhat-linux \
              MPICC=mpifccpx \
              MPICXX=mpiFCCpx \
              MPIF77=mpifrtpx \
              MPIF90=mpifrtpx \
              CFLAGS="-Kfast" \
              CXXFLAGS="-Kfast" \
              FFLAGS="-Kfast" \
              FCFLAGS="-Kfast" \
              TEST_MPIRUN="mpiexec -n NP" \
              TEST_SEQRUN="mpiexec -n 1"


----------------------------------
If the above patch is not (or unable to) applied to the autoconf utility,
please add LDFLAGS="-L." to the command line when running configure. This is
necessary to prevent the failure of building PnetCDF Fortran interfaces, due to
Fujitsu Fortran compiler requires no "-L" for linking internal libraries.
Adding "-L." to force the linker to use this flag.

