I am trying to compile a build for c++ and Fortran using GNU make. On some machines the build works, on others I get the error undefined reference to '_gfortran_stop_numeric_f08'
. I reckon there is some issue with the fortran library, and I am trying to figure this out.
On the machines where the compilation works, the gfortran version is "GNU Fortran (SUSE Linux) 4.8.5". In /usr/lib64/
I have the following library files:
libgfbgraph-0.2.so.0 libgfortran.so.3 libgfortran.so.4 libgfbgraph-0.2.so.0.0.0 libgfortran.so.3.0.0 libgfortran.so.4.0.0
On these machines, compiling with the LDFlag -lgfortran
works fine. However, compiling with either -L/usr/lib64/libgfortran.so.4
or -L/usr/lib64/libgfortran.so.3
gives a long list of errors, of the form
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: io.f90:(.text+0x888d): undefined reference to `_gfortran_st_write'
It seems then that using the flag -lgfortran
I am not pointing to either -L/usr/lib64/libgfortran.so.4
or -L/usr/lib64/libgfortran.so.3
. Howe can I figure out the library which is actually pointed to?
On the other machines, the compilation does not work even with the flag -lgfortran
. This is where I get the error undefined reference to '_gfortran_stop_numeric_f08'
. On these machines, the gfortran version is GNU Fortran (SUSE Linux) 7.5.0". In /usr/lib64/
I have the following library files:
libgfortran.so.4 libgfortran.so.4.0.0
Any ideas about how to resolve this?