Compiler SIGSEGV due to long filename?

I think this is a compiler bug, but it could just be a lack of compiler flag or environment setting.

In a rather large package, one file seems to have issues compiling. This file, constants.F90 is pretty innocuous and is essentially just a bunch of PARAMETERs, yet it fails to compile during the make stage. I think it might have to do with a very long filename (i.e., lots of subdirectories):

mpif90 -DMAPL_MODE -DEIGHT_BYTE -DSPMD -DTIMING -Duse_libMPI -Duse_netCDF  -I/home/mathomp4/GMAO-Baselibs-3_1_5/Linux/include/netcdf/include -i4 -r8 -Ktrap=fp -Mallocatable=03 -D_F2000 -fast -Mcray=pointer -g -traceback   -c      /home/mathomp4/Fortuna-1_5_UNSTABLE/GEOSagcm/src/GEOSgcs_GridComp/GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSsuperdyn_GridComp/FVdycoreCubed_GridComp/fvdycore/../fvdycore/shared/constants/constants.F90
pgf90-Fatal-/opt/pgi/linux86-64/9.0-2/bin/pgf901 TERMINATED by signal 11
(extra output trimmed)

It dumped core, but I figured there could be a bad flag or some such. So:

 mpif90 -i4 -r8 -c /home/mathomp4/Fortuna-1_5_UNSTABLE/GEOSagcm/src/GEOSgcs_GridComp/GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSsuperdyn_GridComp/FVdycoreCubed_GridComp/fvdycore/../fvdycore/shared/constants/constants.F90
pgf90-Fatal-/opt/pgi/linux86-64/9.0-2/bin/pgf901 TERMINATED by signal 11
Arguments to /opt/pgi/linux86-64/9.0-2/bin/pgf901
(extra output trimmed)

And core is dumped again. Since I suspected the long filename, I copied constants.F90 to a new directory and:

> mpif90 -i4 -r8 -c constants.F90
NOTE: your trial license will expire in 0 days, 13.2 hours.
NOTE: your trial license will expire in 0 days, 13.2 hours.
> ls
constants.F90  constants_mod.mod  constants.o

So this does seem have something to do with a long filename. Note this filename is set by GNUmakefile fun with aliases/variables so that this large package can be managed.

Is there a limit in PGI (or Linux?) to how long the filename reference can be? And is there an environment variable or setting I can change to allow longer? (Oh, and I know the license is about to expire. I’m at the mercy of the purchasing office at the moment…)

Hi Matt,

Thanks for the report. I was able to recreate the issue here by trying to compile a file with a full path name of length greater than ~190 characters. What appears to be happening is that the preprocessor inserts a "# " at the start of the post-process files (this is required), but the compiler is choking on this really long line.

In Fortran, the max line length is 132 characters. Though, even if the 132 character limit applied here (I don’t think it should since this is post-processed code), the compiler should give you an error and not segv. Interestingly, if I save the post-processed file first (using the -E flag) and then compile the file, it works fine.

I’ve sent a report to our engineers (TPR#16013) for further investigation. Unfortunately, I don’t have good work around for you, other then shortening the file name. You might try using the “-E” flag or cpp to pre-process the files first, but it will require you to add this step to your makefile. If the file does not need to be preprocessed, change the extension to “f90”.

Also, you can request a extension to the trial period from our Sales department (



TPR 16013 has been corrected in the 9.0-4 release, out now.

Thanks again for your submission.