Compile-time warnings and errors

From Geos-chem
Jump to: navigation, search

We have migrated bug reports and support requests to our Github issue tracker.



Previous | Next | Guide to GEOS-Chem error messages

  1. Understanding the different categories of errors
  2. Compile-time warnings and errors
  3. Run-time crashes and abnormal exits
  4. Segmentation faults
  5. Other less-common errors


Overview

In this section we discuss some compilation warnings that you may encounter when building GEOS-Chem.

  • Warnings are not generally fatal—GEOS-Chem will usually continue to compile while an informational message is displayed.
  • Errors, on the other hand, will halt the GEOS-Chem compilation process.

Compile-time warnings

TBD

Compile-time errors related to Unix environment settings

Number found where operator expected

Make error.png

This error can occur when you compile GEOS-Chem with gfortran. The error appears to come from these lines in the Makefile_header.mk in the top-level source-code folder:

###############################################################################
###                                                                         ###
###  Define settings for the GNU FORTRAN COMPILER (aka gfortran)            ###
###                                                                         ###
###############################################################################

ifeq ($(COMPILER_FAMILY),GNU)  

  # Get the GNU Fortran version
  GNU_VERSION        :=$(shell $(FC) -dumpversion)
  GNU_VERSION        :=$(subst .,,$(GNU_VERSION))
  NEWER_THAN_447     :=$(shell perl -e "print ($(GNU_VERSION) gt 447)")
  IS_GNU_8           :=$(shell perl -e "print ($(GNU_VERSION) ge 800)")

This can happen if you are using a gfortran version prior to 4.8. This is because the Makefile relies on the -dumpversion option which appears to have been added in gfortran 4.8. This option is used to return just the version number, e.g.:

$ gfortran -dumpversion
4.8.5

instead of the whole version information, which you can get with the -version option:

$gfortran --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The extra text in the full version output confuses the build process, and results in this error.

If you’ve loaded gfortran with a module, then also make sure to define the proper environment variables to point to the version of gfortran that you loaded. Otherwise the system might be resolving the default gfortran version on your system (usually stored in /usr/bin), which may not have the -dumpversion option enabled.

--Bob Yantosca (talk) 20:47, 20 August 2019 (UTC)

Cannot open include file netcdf.inc

Netcdf inc not found.png

This error indicates one of two things:

(1) GEOS-Chem does not know where the netCDF and netCDF-Fortran libraries are installed. If your system uses the Lmod module system, you might first have to execute a command (such as module load netcdf) to initialize netCDF in your Unix shell. (Ask your sysadmin or IT staff.) You will also need to set some environment variables so that GEOS-Chem will be able to find the netCDF library paths. Please see our Setting Unix environment variables for GEOS-Chem wiki page for more information.

(2) The netCDF library has not been installed on your computer system. If this is the case, then you (or your IT staff) will have to install the netCDF libraries. For more information, please see our Guide to netCDF in GEOS-Chem.

Also see these related issues on the GEOS-Chem Github repository:

  1. geoschem/geos-chem:#80
  2. geoschem/geos-chem:#54
  3. geoschem/geos-chem:#28

--Bob Yantosca (talk) 14:49, 8 October 2019 (UTC)

KPP error: Cannot find -lfl

Flexerror.png

The error shown above can occur when compiling the Kinetic Pre-Processor (KPP) source code, which is required to generate new GEOS-Chem mechanisms. This error indicates that you do not have the "Flex" library on your system, and because it is missing, KPP cannot be compiled.

Flex is a software dependency of the KPP code. Ask your IT helpdesk if the Flex library is installed on your system, and how to access it. If your system uses a software management system like Lmod, then you can load Flex into your Unix environment with a command such as:

module load flex

If your system does not have Flex installed, ask your IT helpdesk to install it for you. If this is not possible, you can try using the Spack package manager to install it on your system.

--Bob Yantosca (talk) 20:53, 15 July 2019 (UTC)

f77: command not found

/bin/bash: f77: command not found
...
make[1]: Leaving directory 'merra2_05x0625_CH4_na'
../Makefile_header.mk:321: *** "Select a compiler: COMPILER=ifort, COMPILER=pgi, COMPILER=gfortran".  Stop.
make[1]: *** [all] Error 2
make: *** [mp] Error 2

The above error happens when GEOS-Chem cannot determine the name of your Fortran compiler. To fix this issue, make sure to specify the proper Unix environment variables in your .bashrc or .cshrc startup script. For complete instructions, please see our Environment variables that specify compiler names wiki post.

--Bob Yantosca (talk) 17:23, 10 March 2017 (UTC)

Compile-time errors related to Fortran modules

Error in opening the compiled module file

RnPbBe_mod.F(118): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [CHEMGRID_MOD]
      USE CHEMGRID_MOD,       ONLY : ITS_IN_THE_STRATMESO
----------^
RnPbBe_mod.F(118): error #6580: Name in only-list does not exist.   [ITS_IN_THE_STRATMESO]
      USE CHEMGRID_MOD,       ONLY : ITS_IN_THE_STRATMESO
-------------------------------------^
compilation aborted for RnPbBe_mod.F (code 1)

This error message usually indicates indicates a typo in the Makefile dependencies section. For example, the above error was caused by this Makefile code

rnpbbe_mod.o               : RnPbBe_mod.F                                   \
                             chemgrid_mod.o          diag_mod.o             \
                             hco_interface_mod.o

because the capitalization of the object file name did not exactly correspond to the source code file name. The compilation process died with the above error because it was expecting to find a module file named RnPbBe_mod.o but could not.

--Bob Yantosca (talk) 16:19, 27 February 2017 (UTC)

Module file cannot be read

If you should encounter this type of error:

ifort -cpp -w -O2 -auto -noalign -convert big_endian -openmp -Dmultitask -c time_mod.f
fortcom: Error: time_mod.f, line 259: This module file was generated for a different 
platform or by an incompatible compiler or compiler release. It cannot be read.   [JULDAY_MOD]
      USE JULDAY_MOD, ONLY : JULDAY, CALDATE 

Then this means that you are trying to link to previously-created *.mod files that were generated by a different compiler. Making clean and re-compiling from scratch should solve this problem.

--Bob Y. 13:39, 1 July 2008 (EDT)

Intel Fortran 17 compilation error (also can happen with GNU Fortran)

Ifort 17 error.png

If you are using GEOS-Chem v10-01 with the Intel Fortran Compiler version 17 (or with any recent version of the GNU Fortran compiler) then you might encounter the above error. These newer compilers are much stricter in their interpretations of the Fortran standard, and thus do not like the way that a couple of routines in the NcdfUtil and HEMCO/ folders have been written.

The best way to solve this error is to upgrade to the GEOS-Chem v11-01 public release. In this version, the offending code has been rewritten in such a way that it is compatible with the newest versions of the Intel Fortran Compiler and GNU Fortran Compiler. For complete instructions on how to downloaad GEOS-Chem v11-01, please visit the GEOS-Chem Online User's Guide.

For more information about this bug, please see this post on our Intel Fortran Compiler wiki page.

--Bob Yantosca (talk) 16:17, 28 February 2017 (UTC)

Compiler-specific errors

Internal threshold was exceeded

This warning is specific to the Intel Fortran Compiler. It usually happens when you try to optimize a complex module or subroutine. Please see this post on the software.intel.com site for a full explanation.

--Bob Y. 15:32, 22 August 2012 (EDT)

GNU Fortran internal compiler error

f951: internal compiler error: in read_module, at fortran/module.c:5090
0x6251ee read_module
        ../.././gcc/fortran/module.c:5090
0x6251ee gfc_use_module
        ../.././gcc/fortran/module.c:6980
0x626896 gfc_use_modules()
       ../.././gcc/fortran/module.c:7104 
 
 ... etc ...

Please submit a full bug report,
 with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[6]: *** [flexchem_mod.o] Error 1
make[6]: *** Waiting for unfinished jobs....

If you should encounter an error similar to the one shown above when using the GNU Fortran compiler, the easiest solution is to rebuild GEOS-Chem from scratch.

Type:

make realclean

which will remove all previously compiled modules and object files. If you are compiling from a GEOS-Chem run directory, you can also type:

make superclean

which will also remove any output files generated by GEOS-Chem. (Use this option with caution!)

--Bob Yantosca (talk) 22:00, 20 November 2017 (UTC)

A few GEOS-Chem errors have been traced to bugs in the compiler that was used to build the GEOS-Chem executable. For your convenience, we have collated a list of these issues. Please see our our Known issues caused by compiler bugs wiki page for more information.

--Bob Yantosca (talk) 19:13, 13 April 2016 (UTC)

Seg fault in HEMCO with Intel Fortran 12, 13, or 14

In GEOS-Chem versions from v10-01 up to v11-01j, this error can occur with versions 12, 13, and 14 of the Intel Fortran Compiler.

  forrtl: severe (174): SIGSEGV, segmentation fault occurred
  Image              PC                Routine            Line        Source             
  ...
  geos               0000000000ADDCF4  hcoio_dataread_mo        2810  hcoio_dataread_mod.F90
  geos               0000000000AD84DE  hcoio_dataread_mo        2499  hcoio_dataread_mod.F90
  geos               0000000000AB8971  hco_readlist_mod_         438  hco_readlist_mod.F90
  geos               0000000000AB8398  hco_readlist_mod_         267  hco_readlist_mod.F90
  geos               0000000000AA99A6  hco_driver_mod_mp         138  hco_driver_mod.F90
  geos               0000000000844C07  hcoi_gc_main_mod_         546  hcoi_gc_main_mod.F90
  geos               0000000000801A2E  emissions_mod_mp_         172  emissions_mod.F90
  geos               00000000006720B7  MAIN__                    834  main.F

For a workaround, please see this post on our HEMCO wiki page.

NOTE: A similar workaround has been introduced into the v11-01 public release, which uses a newer version of HEMCO.

--Bob Yantosca (talk) 21:50, 6 January 2017 (UTC)

Other compile-time errors

Failed in XMAP_R4R4 error

If you are using the Intel Fortran Compiler 15, then you may encounter an error such as this:

forrtl: severe (408): fort: (2): Subscript #1 of the array LON2 has value 1 which is greater than the upper bound of -1

Image              PC                Routine            Line        Source             
libifcoremt.so.5   00002B9EFA2188D3  Unknown               Unknown  Unknown
geos.mp            00000000011FCE35  regrid_a2a_mod_mp        1914  regrid_a2a_mod.F90
libiomp5.so        00002B9EFB70A8A3  Unknown               Unknown  Unknown

Cause: A compiler bug in Intel Fortran Compiler version 15.

Solution: If you are using array-out-of-bounds checking, make sure to compile GEOS-Chem with these flags: BOUNDS=y DEBUG=y. For more information, see this post on our HEMCO wiki page.

--Bob Yantosca (talk) 17:18, 25 January 2016 (UTC)



Previous | Next | Guide to GEOS-Chem error messages