Skip to content

Commit

Permalink
fixed libpio for autotools builds with fortran info, added FCFLAGS
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhartnett committed Jul 29, 2020
1 parent 903fc75 commit cdb24f5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
27 changes: 24 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,27 @@ fi
# Find and learn about the Fortran compiler.
AC_PROG_FC

# Compiler with version information. This consists of the full path
# name of the compiler and the reported version number.
AC_SUBST([FC_VERSION])
# Strip anything that looks like a flag off of $FC
FC_NOFLAGS=`echo $FC | sed 's/ -.*//'`

if `echo $FC_NOFLAGS | grep ^/ >/dev/null 2>&1`; then
FC_VERSION="$FC"
else
FC_VERSION="$FC";
for x in `echo $PATH | sed -e 's/:/ /g'`; do
if test -x $x/$FC_NOFLAGS; then
FC_VERSION="$x/$FC"
break
fi
done
fi
if test -n "$fc_version_info"; then
FC_VERSION="$FC_VERSION ( $fc_version_info)"
fi

# Always use malloc in autotools builds.
AC_DEFINE([PIO_USE_MALLOC], [1], [use malloc for memory])

Expand Down Expand Up @@ -363,10 +384,10 @@ AC_SUBST([enable_shared])
AC_SUBST([enable_static])
AC_SUBST([CFLAGS])
AC_SUBST([CPPFLAGS])
AC_SUBST([FFLAGS])
AC_SUBST([FCFLAGS])
AC_SUBST([LDFLAGS])
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_LDFLAGS])
AC_SUBST([FPPFLAGS]) # ignored by autotools
AC_SUBST(HAS_PNETCDF,[$enable_pnetcdf])
AC_SUBST(HAS_LOGGING, [$enable_logging])
AC_SUBST(HAS_SZIP_WRITE, [$have_szip_write])
Expand Down
1 change: 1 addition & 0 deletions libpio.settings.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Extra libraries: @LIBS@

Fortran Compiler: @FC_VERSION@
FFLAGS: @FFLAGS@
FCFLAGS: @FCFLAGS@
FPPFLAGS: @FPPFLAGS@

# Features
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ set(CPPFLAGS ${CPPFLAGS} PARENT_SCOPE)
if (PIO_ENABLE_FORTRAN)
add_subdirectory (flib)
set(FFLAGS ${FFLAGS} PARENT_SCOPE)
set(FCFLAGS ${FCFLAGS} PARENT_SCOPE)
set(FPPFLAGS ${FPPFLAGS} PARENT_SCOPE)
endif ()

0 comments on commit cdb24f5

Please sign in to comment.