NOAA-EMC / NCEPLIBS-grib_util

This is a collection of NCEP GRIB related utilities.
Other
19 stars 11 forks source link

release/public-v1: linking to static libgfortran #6

Closed climbfuji closed 4 years ago

climbfuji commented 4 years ago

For release/public-v1: The following linker flags in NCEPLIBS-grib_util/sorc/copygb2.fd/CMakeLists.txt are requiring a static libgfortran:

if(IntelComp)
  set(fortran_flags "-g" "-O3" "-r8" "-convert" "big_endian" "-auto" "-fpp" "${OpenMP_Fortran_FLAGS}")
  set(link_flags "-static-intel")
elseif(GNUComp)
  set(fortran_flags "-g" "-O3" "-fdefault-real-8" "-fconvert=big-endian" "-cpp" 
    "${OpenMP_Fortran_FLAGS}")
  set(link_flags "-static-libgfortran")
else()
  message("unknown compiler!")
  exit()
endif()

This is not something modern Linux distributions are good at. I commented it out and could build the library on Redhat 8 (which has a broken libgfortran.a, i.e. the packages that "provide" it just have symbolic links to a place where no version exists).

Is it really necessary to use static linking for this? Does anyone know? Thanks.

climbfuji commented 4 years ago

This was apparently solved in the process of creating the UFS MRW App v1.0.0 release version