Converting GEOS code from SLES 11 to SLES 12
This page will try and detail the changes needed to move a code base from SLES 11 to SLES 12.
If you have questions, please contact the SI Team.
g5_modules
The first challenge is trying to get a g5_modules file that works with your tag. The first thing to do is look at the version of Baselibs being used.
Baselibs 4
If your Baselibs is based on version 4 (say, 4.0.6), the best one to try is:
/gpfsm/dhome/mathomp4/GitG5Modules/SLES12/4.0.11/g5_modules.intel1805.impi1910
Yes, it may not be an exact version match but it is essentially equivalent (has the same version of ESMF), with newer versions of some libraries that needed updating for newer OSs and Intel 18+.
Baselibs 5
Baselibs 6
src/Config
Many of the major build changes needed will be in src/Config. The reason is that older tags of GEOS don't handle Intel 18+ and Intel MPI 19+ well due to differences in flags and library names.
Heracles
For a Heracles-based tag, you can start with updating these files to bw_Heracles-5_4_p3-SLES12:
ESMA_arch.mk fdp
Icarus
For an Icarus-based tag, try updating these files to Icarus-3_2_p9-SLES12:
ESMA_arch.mk fdp
Jason
I think most
f2py
One large challenge will be f2py based files. Any f2py build that depends on $(LIB_SDF) will need updating due to GEOSpyD (the Python stack on SLES12). The fix can be demonstrated with GFIO_.so. It was originally built as:
GFIO_.$(F2PYEXT): GFIO_py.F90 r4_install $(F2PY) -c -m GFIO_ $(M). $(M)$(INC_SDF) \ GFIO_py.F90 r4/libGMAO_gfio_r4.a $(LIB_SDF) $(LIB_SYS) \ only: gfioopen gfiocreate gfiodiminquire gfioinquire\ gfiogetvar gfiogetvart gfioputvar gfiogetbegdatetime\ gfiointerpxy gfiointerpnn gfiocoordnn gfioclose :</nowiki>
Notice how we pass in $(LIB_SDF) to f2py? The fix for this is to define a new $(XLIBS) and add that:
XLIBS = ifeq ($(wildcard /etc/os-release/.*),) XLIBS = -L/usr/lib64 -lssl -lcrypto endif
GFIO_.$(F2PYEXT): GFIO_py.F90 r4_install $(F2PY) -c -m GFIO_ $(M). $(M)$(INC_SDF) \ GFIO_py.F90 r4/libGMAO_gfio_r4.a $(LIB_SDF) $(LIB_SYS) $(XLIBS)\ only: gfioopen gfiocreate gfiodiminquire gfioinquire\ gfiogetvar gfiogetvart gfioputvar gfiogetbegdatetime\ gfiointerpxy gfiointerpnn gfiocoordnn gfioclose : </nowiki>
Here we use the fact that the file /etc/os-release doesn't exist on SLES 11.
Hardcoded -openmp in make
Build time error
Another common theme is the inclusion of a hardcoded -openmp flag in GNUmakefile. Examples can be seen in GEOSgcs_GridComp/GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Shared/Raster/src/GNUmakefile:
RASTER_OMPFLAG = ifeq ($(ESMA_FC), ifort) # RASTER_OMPFLAG = -openmp endif OPENMP_FLAG = -openmp
This flag was changed by Intel to be -qopenmp but a better change is to use the generic OMPFLAG alias:
RASTER_OMPFLAG = ifeq ($(ESMA_FC), ifort) # RASTER_OMPFLAG = $(OMPFLAG) endif OPENMP_FLAG = $(OMPFLAG)
Link-time error
If, when you build, your executable has an issue saying things like kmp... not found, this can often be an issue with either trying to link with -openmp or not linking to it at all. An example is Applications/NCEP_Etc/NCEP_enkf/GNUmakefile_in in GEOSadas-5_17_0p5B:
USER_LDFLAGS = -openmp
which should become:
USER_LDFLAGS = $(OMPFLAG)
Use of #QSUB pragmas in run scripts
With SLES 12, NCCS has removed support for using #QSUB pragmas in SLURM sbatch scripts. You will need to convert them to the appropriate #SBATCH pragmas. You can find various pages about this on the web, such as this one.