Skip to content

Commit

Permalink
Merge branch 'marshallward-ac_ncflag_fix' into dev/gfdl
Browse files Browse the repository at this point in the history
  • Loading branch information
adcroft committed Nov 30, 2020
2 parents be00c67 + 5f05737 commit 70382ed
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 17 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/documentation-and-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
continue-on-error: true

- name: Install packages used when generating documentation
run: >
sudo apt-get install
python3-sphinx python3-lxml perl
texlive-binaries texlive-base bibtool tex-common texlive-bibtex-extra
graphviz
run: |
sudo apt-get update
sudo apt-get install python3-sphinx python3-lxml perl
sudo apt-get install texlive-binaries texlive-base bibtool tex-common texlive-bibtex-extra
sudo apt-get install graphviz
- name: Build doxygen HTML
run: |
Expand Down
20 changes: 14 additions & 6 deletions ac/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,20 @@ AX_FC_CHECK_MODULE([mpi],


# netCDF configuration
AC_PATH_PROG([NC_CONFIG], [nc-config])
AS_IF([test -n "$NC_CONFIG"],
[CPPFLAGS="$CPPFLAGS -I$($NC_CONFIG --includedir)"
FCFLAGS="$FCFLAGS -I$($NC_CONFIG --includedir)"
LDFLAGS="$LDFLAGS -L$($NC_CONFIG --libdir)"],
[AC_MSG_ERROR([Could not find nc-config.])])

# NOTE: `nf-config --flibs` combines library paths (-L) and libraries (-l),
# even though these ought to be separated in the invocation of `ld`.
#
# We use `sed` to strip the -l and pass the -L to LDFLAGS, and rely on autoconf
# to configure the -l flags.
AC_PROG_SED

AC_PATH_PROG([NF_CONFIG], [nf-config])
AS_IF([test -n "$NF_CONFIG"],
[CPPFLAGS="$CPPFLAGS $($NF_CONFIG --fflags)"
FCFLAGS="$FCFLAGS $($NF_CONFIG --fflags)"
LDFLAGS="$LDFLAGS $($NF_CONFIG --flibs | $SED -e 's/-l[[^ ]]*//g')"],
[AC_MSG_ERROR([Could not find nf-config.])])

AX_FC_CHECK_MODULE([netcdf],
[], [AC_MSG_ERROR([Could not find netcdf module.])])
Expand Down
20 changes: 14 additions & 6 deletions ac/deps/configure.fms.ac
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,20 @@ AC_DEFINE([use_libMPI])


# netCDF configuration
AC_PATH_PROG([NC_CONFIG], [nc-config])
AS_IF([test -n "$NC_CONFIG"],
[CPPFLAGS="$CPPFLAGS -I$($NC_CONFIG --includedir)"
FCFLAGS="$FCFLAGS -I$($NC_CONFIG --includedir)"
LDFLAGS="$LDFLAGS -L$($NC_CONFIG --libdir)"],
[AC_MSG_ERROR([Could not find nc-config.])])

# NOTE: `nf-config --flibs` combines library paths (-L) and libraries (-l),
# even though these ought to be separated in the invocation of `ld`.
#
# We use `sed` to strip the -l and pass the -L to LDFLAGS, and rely on autoconf
# to configure the -l flags.
AC_PROG_SED

AC_PATH_PROG([NF_CONFIG], [nf-config])
AS_IF([test -n "$NF_CONFIG"],
[CPPFLAGS="$CPPFLAGS $($NF_CONFIG --fflags)"
FCFLAGS="$FCFLAGS $($NF_CONFIG --fflags)"
LDFLAGS="$LDFLAGS $($NF_CONFIG --flibs | $SED -e 's/-l[[^ ]]*//g')"],
[AC_MSG_ERROR([Could not find nf-config.])])

AX_FC_CHECK_MODULE([netcdf],
[], [AC_MSG_ERROR([Could not find netcdf module.])])
Expand Down

0 comments on commit 70382ed

Please sign in to comment.