Alan W. Irwin
2017-04-15 03:54:30 UTC
Hi Arjen:
I had to rework (commit 58dc757) the suggestion in README.developers
about the recommended gfortran compiler options because the prior
suggestion
export FFLAGS='-std=f95 -O3 -fall-intrinsics -fvisibility=hidden -pedantic -Wall -Wextra'
did not work with our new fortran binding.
(As an aside, in my tests I dropped -fvisibility=hidden because I
believe that makes no sense for Fortran code. I also dropped
-fall-intrinsics since I prefer using Wintrinsics-std which is
automatically deployed with -Wall if -fall-intrinsics is not
specified.) So here are the actual flags I tried.
1. export FFLAGS='-O3 -std=f95 -pedantic -Wall -Wextra'
Those options generated a build error (as expected) because the
Fortran 95 standard does not include support for the ISO_C_BINDING
module that we use to implement the new fortran binding.
2. export FFLAGS='-O3 -std=f2003 -pedantic -Wall -Wextra'
Those options generated the following type of build error:
included_plplot_real_interfaces.f90:2601.25:
Included at /home/software/plplot/HEAD/plplot.git/bindings/f95/plplot_double.f90:117:
c_loc(plotentries), size(plotentries, kind=private_plint) )
1
Error: Fortran 2008: Array of interoperable type at (1) to C_LOC which is nonallocatable and neither assumed size nor explicit size
for what I consider to be a spurious reason (see the revised
README.developers for further discussion).
3. export FFLAGS='-O3 -std=f2008 -pedantic -Wall -Wextra'
got rid of the above type of error message, but also generated a
whole new set of build errors.
4. export FFLAGS='-O3 -Wall -Wextra'
does work without any build errors so this is now what I recommend
in README.developers.
To summarize, if you discovered a standards-compliant change
to our new Fortran binding implementation that would allow use of
export FFLAGS='-O3 -std=f2003 -pedantic -Wall -Wextra'
with gfortran, then that would allow our users/developers to at least
do minimal standards compliance checking with gfortran. But if you
feel that is too much trouble and/or the fix would obfuscate our
fortran binding code too much simply to quiet a gfortran build error
that is likely spurious, then I am content with the current
recommendation
export FFLAGS='-O3 -Wall -Wextra'
Of course, the (significant) downside of the current recommendation is
it means our users/developers cannot check Fortran standards
compliance with gfortran and must rely on NAG instead for such
checking.
Alan
__________________________
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________
Linux-powered Science
__________________________
I had to rework (commit 58dc757) the suggestion in README.developers
about the recommended gfortran compiler options because the prior
suggestion
export FFLAGS='-std=f95 -O3 -fall-intrinsics -fvisibility=hidden -pedantic -Wall -Wextra'
did not work with our new fortran binding.
(As an aside, in my tests I dropped -fvisibility=hidden because I
believe that makes no sense for Fortran code. I also dropped
-fall-intrinsics since I prefer using Wintrinsics-std which is
automatically deployed with -Wall if -fall-intrinsics is not
specified.) So here are the actual flags I tried.
1. export FFLAGS='-O3 -std=f95 -pedantic -Wall -Wextra'
Those options generated a build error (as expected) because the
Fortran 95 standard does not include support for the ISO_C_BINDING
module that we use to implement the new fortran binding.
2. export FFLAGS='-O3 -std=f2003 -pedantic -Wall -Wextra'
Those options generated the following type of build error:
included_plplot_real_interfaces.f90:2601.25:
Included at /home/software/plplot/HEAD/plplot.git/bindings/f95/plplot_double.f90:117:
c_loc(plotentries), size(plotentries, kind=private_plint) )
1
Error: Fortran 2008: Array of interoperable type at (1) to C_LOC which is nonallocatable and neither assumed size nor explicit size
for what I consider to be a spurious reason (see the revised
README.developers for further discussion).
3. export FFLAGS='-O3 -std=f2008 -pedantic -Wall -Wextra'
got rid of the above type of error message, but also generated a
whole new set of build errors.
4. export FFLAGS='-O3 -Wall -Wextra'
does work without any build errors so this is now what I recommend
in README.developers.
To summarize, if you discovered a standards-compliant change
to our new Fortran binding implementation that would allow use of
export FFLAGS='-O3 -std=f2003 -pedantic -Wall -Wextra'
with gfortran, then that would allow our users/developers to at least
do minimal standards compliance checking with gfortran. But if you
feel that is too much trouble and/or the fix would obfuscate our
fortran binding code too much simply to quiet a gfortran build error
that is likely spurious, then I am content with the current
recommendation
export FFLAGS='-O3 -Wall -Wextra'
Of course, the (significant) downside of the current recommendation is
it means our users/developers cannot check Fortran standards
compliance with gfortran and must rely on NAG instead for such
checking.
Alan
__________________________
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________
Linux-powered Science
__________________________