I'm using gfortran from cygwin (x86_64) on windows 7 to compile some old fortran code from NASA. When I use
gfortran cma.f -o cma.exe
the code compiles and works but needs the following four libraries in the same folder to work: cyggcc_s-seh-1.dll, cyggfortran-3.dll, cygquadmath-0.dll, and cygwin1.dll
I'd like to have it run independently so I've tried
gfortran cma.f -static -o cma.exe
But then I get several "relocation truncated to fit: R_X86_64_PC32 against undefined symbol" errors:
/usr/lib/gcc/x86_64-pc-cygwin/4.9.3/libgfortran.a(write.o): In function `write_float':
/usr/src/debug/gcc-4.9.3-1/libgfortran/io/write_float.def:1300:(.text$write_float+0x15c): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `quadmath_snprintf'
/usr/lib/gcc/x86_64-pc-cygwin/4.9.3/libgfortran.a(write.o): In function `determine_en_precision':
/usr/src/debug/gcc-4.9.3-1/libgfortran/io/write_float.def:1213:(.text$write_float+0x7cf): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `quadmath_snprintf'
/usr/lib/gcc/x86_64-pc-cygwin/4.9.3/libgfortran.a(write.o): In function `write_float':
/usr/src/debug/gcc-4.9.3-1/libgfortran/io/write_float.def:1300:(.text$write_float+0x84e): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `quadmath_snprintf'
/usr/lib/gcc/x86_64-pc-cygwin/4.9.3/libgfortran.a(write.o): In function `output_float_FMT_G_16':
/usr/src/debug/gcc-4.9.3-1/libgfortran/io/write_float.def:1140:(.text$write_float+0xf22): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `quadmath_snprintf'
/usr/src/debug/gcc-4.9.3-1/libgfortran/io/write_float.def:1140:(.text$write_float+0x1781): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `quadmath_snprintf'
/usr/lib/gcc/x86_64-pc-cygwin/4.9.3/libgfortran.a(read.o): In function `_gfortrani_convert_real':
/usr/src/debug/gcc-4.9.3-1/libgfortran/io/read.c:175:(.text$_gfortrani_convert_real+0x72): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `strtoflt128'
/usr/lib/gcc/x86_64-pc-cygwin/4.9.3/libgfortran.a(read.o): In function `_gfortrani_convert_infnan':
/usr/src/debug/gcc-4.9.3-1/libgfortran/io/read.c:251:(.text$_gfortrani_convert_infnan+0x53): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `strtoflt128'
collect2: error: ld returned 1 exit status
I'm new to compiling from source, but I have done some programming (mostly in matlab/octave). I don't know Fortran and the code is 4418 lines long and does some complex thermodynamics. So tinkering with the code isn't a very good option for me.
Also I know it can be compiled in a 32 bit windows console app with MS Visual Studio using the Intel Fortran composer XE2013, Update 5, compiler with the following options: 132 column, 32 bit release version, and no runtime array bounds checking. But I don't have the Intel compiler.
So it should just be a matter of what compiler option to use for gfortran. I've tried a lot of different flags and none have done the trick so far. So how can I get the exe to run independently"?
There are some similar questions, however those solutions seem to involve how the code is written. I can't change the code so I need a solution involving how I compile the code.