[netcdfgroup] Fortran compiler settings - ifort

  • To: "netcdfgroup@xxxxxxxxxxxxxxxx" <netcdfgroup@xxxxxxxxxxxxxxxx>
  • Subject: [netcdfgroup] Fortran compiler settings - ifort
  • From: Bart Brashers <bbrashers@xxxxxxxxxxx>
  • Date: Tue, 20 Nov 2018 03:00:35 +0000
  • Authentication-results: spf=pass (sender IP is 195.137.178.73) smtp.mailfrom=ramboll.com; unidata.ucar.edu; dkim=none (message not signed) header.d=none;unidata.ucar.edu; dmarc=bestguesspass action=none header.from=ramboll.com;
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:99
Hi all,

I have a code compiled with ifort, the intel Fortran compiler. The flags it 
uses look like this, though -traceback is probably temporary for debugging:

FCFLAGS = -c -names lowercase -O2 -fp-model strict -fpic -assume byterecl 
-mixed-str-len-arg -align sequence -traceback

I've compiled zlib-1.2.8, hdf5-1.8.11, and netcdf-4.1.2* using these FCLAGS 
(FFLAGS).

When I run my compiled code I get a Segmentation Fault immediately as the code 
calls nf_create(). That's not a particularly complicated subroutine, so I'm 
puzzled.

If instead I use extremely minimal flags for zlib, hdf5, and netcdf:

FFLAGS = -g

and these flags for the main code:

FCFLAGS = -c -g -traceback -check bounds -align dcommons -extend_source 
-static_intel

Then I can compile and run the code, and create a netCDF file using 
nf_create(), and add attributes, variables, etc. But the main code behaves 
erratically and crashes for other reasons that seem mostly related to indexing 
of arrays.

Can someone suggest either a "standard" set of FCFLAGS I should be using for 
zlib, hdf5, and netcdf; or a sub-set of the flags above for the main code that 
might work with netCDF? The main hint is the immediate SegFault after calling 
nf_create(). CFLAGS in both cases is simple, just "-g". Extra hint: using 
pgfortran for everything works just fine.

Platform: CentOS 7.4
ifort is the latest (2019) using a trial license.

* I'm very aware that I should be using a newer version of the netcdf libs, but 
this version is being used by the code authors. I suspect they like the unified 
C and Fortran compilation.

Bart
  • 2018 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: