Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct failure to compile on some mpi systems. #210

Merged
merged 4 commits into from
Jan 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -632,17 +632,18 @@ IF(NF_HAS_PNETCDF)
ENDIF()

IF(NF_HAS_PNETCDF OR NF_HAS_PARALLEL4)
CHECK_FUNCTION_EXISTS(MPI_File_open HAVE_MPI_IO)
IF(NOT HAVE_MPI_IO)
FIND_PACKAGE(MPI REQUIRED)
IF(NOT MPI_Fortran_FOUND)
MESSAGE(FATAL_ERROR
" -----------------------------------------------------------------------\n"
" The NetCDF C library is built with parallel I/O feature enabled, but\n"
" the Fortran compiler 'gfortran' supplied in this configure command\n"
" the Fortran compiler supplied in this configure command\n"
" does not support MPI-IO. Please use one that does. If parallel I/O\n"
" feature is not desired, please use a NetCDF C library with parallel\n"
" I/O feature disabled. Abort.\n"
" -----------------------------------------------------------------------")
ENDIF(NOT HAVE_MPI_IO)
ENDIF(NOT MPI_Fortran_FOUND)
INCLUDE_DIRECTORIES(${MPI_Fortran_INCLUDE_PATH})
SET(BUILD_PARALLEL ON)
SET(HAVE_NC_USE_PARALLEL_ENABLED TRUE)
ELSE(NF_HAS_PNETCDF OR NF_HAS_PARALLEL4)
Expand Down
10 changes: 10 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ Release Notes {#nf_release_notes}
This file contains a high-level description of this package's evolution.
Entries are in reverse chronological order (most recent first).

## 4.5.3 - TBD

### Requirements

* netCDF-C: 4.6.0+

### Changes

* Corrected an issue where parallel netCDF-Fortran builds would fail despite the presense of MPI libraries/compiler/infrastructure. See [Github #208](https://github.com/Unidata/netcdf-fortran/issues/208) for more information.

## 4.5.2 - September 18, 2019

### Requirements
Expand Down
31 changes: 15 additions & 16 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ AC_INIT([netCDF-Fortran], [4.5.3-development], [support-netcdf@unidata.ucar.edu]
# AC_INIT.
echo -n AC_PACKAGE_VERSION>VERSION
AC_SUBST(PACKAGE_VERSION)

AC_MSG_NOTICE([netCDF-Fortran AC_PACKAGE_VERSION])

# Keep libtool macros in an m4 directory.
Expand Down Expand Up @@ -367,21 +366,21 @@ AC_SEARCH_LIBS([dlopen], [dl dld], [], [])

# When the underneath NetCDF C library was built with parallel I/O enables,
# check if the Fortran compiler supports parallel I/O. Abort if not.
if test "x$nc_has_parallel4" = xyes -o "x$nc_has_pnetcdf" = xyes; then
AC_LANG_PUSH([Fortran])
AC_CHECK_FUNC([MPI_File_open], [],
[AC_SEARCH_LIBS([MPI_File_open], [], [],
[AC_MSG_ERROR([
-----------------------------------------------------------------------
The NetCDF C library is built with parallel I/O feature enabled, but
the Fortran compiler '$FC' supplied in this configure command
does not support MPI-IO. Please use one that does. If parallel I/O
feature is not desired, please use a NetCDF C library with parallel
I/O feature disabled. Abort.
-----------------------------------------------------------------------])
])])
AC_LANG_POP([Fortran])
fi
#if test "x$nc_has_parallel4" = xyes -o "x$nc_has_pnetcdf" = xyes; then
# AC_LANG_PUSH([Fortran])
# AC_CHECK_FUNC([MPI_File_open], [],
# [AC_SEARCH_LIBS([MPI_File_open], [], [],
# [AC_MSG_ERROR([
# -----------------------------------------------------------------------
# The NetCDF C library is built with parallel I/O feature enabled, but
# the Fortran compiler '$FC' supplied in this configure command
# does not support MPI-IO. Please use one that does. If parallel I/O
# feature is not desired, please use a NetCDF C library with parallel
# I/O feature disabled. Abort.
# -----------------------------------------------------------------------])
# ])])
# AC_LANG_POP([Fortran])
#fi

# Find the netCDF header and library.
AC_CHECK_HEADERS([netcdf.h], [], [AC_MSG_ERROR([netcdf.h could not be found. Please set CPPFLAGS.])])
Expand Down