Skip to content

Commit

Permalink
ESMF and MAPL fixes for compatibility with GNU compiler version 6 and…
Browse files Browse the repository at this point in the history
… higher

These updates were submitted by Yanko Davilo (University of Colorado)
during testing of GCHP with GNU Compiler Collection (GCC) version 6.1.0.

Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
  • Loading branch information
lizziel committed Apr 20, 2018
1 parent bfcc105 commit fe5e863
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1795,7 +1795,11 @@ void ESMCI_WebServNetEsmfServer::copyFile(
fstream fin(srcFilename, ios::in | ios::binary);
fstream fout(destFilename, ios::out | ios::binary);

if ((fin == NULL) || (fout == NULL))
// gcc version 6 and later are incompatible with the == comparison
// sign in ESMF v5. Yanko Davilo (U. of Colorado) submitted the
// following fix (ewl, 4/20/18)
//if ((fin == NULL) || (fout == NULL))
if ((!fin.is_open()) || (!fout.is_open()))
{
cerr << "Error copying file" << endl;
return;
Expand Down
2 changes: 1 addition & 1 deletion Shared/Config/ESMA_base.mk
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ ifeq ("$(ESMF_COMPILER)","intel")
else ifeq ("$(ESMF_COMPILER)","gfortran")
FREAL8 = -fdefault-real-8 -fdefault-double-8
FREE = -ffree-form -ffree-line-length-none -Wno-line-truncation -fno-range-check
CPPANSIX = -std=gnu11 -C
CPPANSIX = -std=gnu11 -nostdinc -C
else
FREAL8 =
FREE =
Expand Down

0 comments on commit fe5e863

Please sign in to comment.