/********************************** GFORTRAN COOK OPTIONS **********************************/ /*if the target platform for gfortran has not been set then figure it out*/ if [not [defined gfortran_arch]] then{ if [in [os machine] x86 i386 i686] then{ gfortran_arch = 32; } /* Not sure why Cygwin is returning i686 for the 32 bit version */ /* Or, is it implying that the OS is 64 bit? */ /* else if [in [os machine] x86_64 i686] then{ */ else if [in [os machine] x86_64] then{ gfortran_arch = 64; } else{ function print ****************************************************; function print "INVALID GFORTRAN COMPILER CONFIGURATION"; function print "Unknown machine type:" [os machine]; function print ****************************************************; fail; } } else if [not [in [gfortran_arch] 32 64]] then{ function print ****************************************************; function print "INVALID GFORTRAN COMPILER CONFIGURATION"; function print "gfortran_arch="[gfortran_arch]; function print "Valid values: 32|64"; function print ****************************************************; fail; } function print "OS type:" [os]; function print "OS system:" [os system]; function print "OS release:" [os release]; function print "machine type:" [os machine]; function print "machine name:" [os name]; function print "gfortran_arch:" [gfortran_arch]; /********************************** COMPILER **********************************/ fc = gfortran; fc_version = [collect_lines [fc] --version | head -1]; skip_mods = "omp_lib"; /* skip omp module file in dependency checks, etc. */ /* Setup the correct default architecture configuration based upon the system the compiler is running on. */ if [ matches [gfortran_arch] 32 ] then { fc_flags = "-m32"; } else if [ matches [gfortran_arch] 64 ] then { fc_flags = "-m64"; } else { fc_flags = ""; } /* add preprocessing for all builds, turn off negative zero */ fc_flags += "-cpp -fno-sign-zero"; fc_compile_flag = "-c "; fc_out_flag = "-o "; fc_fixed = "-ffixed-form"; fc_free = "-ffree-form"; /* default mode flags */ fc_default =; /* debug flags */ fc_debug = "-O0 -g -Wall -Wextra -fimplicit-none -fcheck=all -fbacktrace -fno-automatic -ffpe-trap=invalid,zero,overflow"; fc_debug += "-fno-unsafe-math-optimizations -frounding-math -fsignaling-nans -Wno-missing-include-dirs"; /*fc_debug = "-Og -g -Wall -Wextra -fimplicit-none -fcheck=all -fbacktrace -fno-automatic -ffpe-trap=zero,overflow -fdefault-real-8";*/ /* optimization flags */ /*fc_optimize = "-g -O3 -ffpe-trap=invalid,zero,overflow -fno-omit-frame-pointer";*/ fc_optimize = "-O3"; /*release flags */ fc_release = "-O3"; /* includes */ fc_inc_flag = "-I "; fc_inc_join = [false]; /*if true, the includes are joined into a single argument with the separator */ fc_inc_sep = ; fc_mod_inc_flag = "-I"; /* Cygwin version of gfortran can't have space separating this arg with option */ fc_mod_out_flag = "-J"; /* Specifies path to put "mod" files separately from path to find "mod" files */ /* Case of the module names: lower, upper or mixed*/ fc_mod_case = lower; function print "fc_flags are: " [fc_flags]; /********************************** LINKER **********************************/ ld = [fc]; /*gcc;*/ ld_version = [fc_version]; /*[collect_lines [ld] --version | head -1];*/ /* Setup the correct default architecture configuration based upon the system the compiler (linker) is running on. */ if [ matches [gfortran_arch] 32 ] then { ld_flags = "-m32"; } else if [ matches [gfortran_arch] 64 ] then { ld_flags = "-m64"; } else { ld_flags =; } /* #if [or [in [os system] Linux ] [in [os system] SunOS ] ] */ /* ld_flags += "-static"; */ /* #else */ /* ld_flags += ; */ /* Windows PC's (Cygwin) won't link with the "-static" option for some reason - LEW */ /* #endif */ /* works fine in TDM-GCC-64 version of gcc/gfortran (it is not a cygwin install) */ ld_flags += "-static"; ld_out_flag = "-o "; /* debug flags */ ld_debug =; /* optimization flags */ ld_optimize =; /* includes */ ld_inc_flag = [fc_inc_flag]; ld_inc_join = [fc_inc_join]; /*if true, the includes are joined into a single argument with the separator */ ld_inc_sep = [fc_inc_sep]; ld_lib_prefix = "-Xlinker --start-group "; ld_lib_suffix = " -Xlinker --end-group"; function print "ld_flags are: " [ld_flags]; /********************************** ARCHIVER **********************************/ ar = ar; ar_version = [collect [ar] --version | head -1]; ar_flags = "-cq "; /********************************** DEBUGGER **********************************/ fdb = gdb; fdb_flags =; fdb_exe_flag = "--args "; fdb_args_flag =;