From 1cc6e2dbfe82ea46ca8f3de2ce7c3456b4a113fd Mon Sep 17 00:00:00 2001
From: Gaelle DELAUTIER <gaelle.delautier@meteo.fr>
Date: Fri, 9 Dec 2016 15:41:51 +0100
Subject: [PATCH] G.Delautier 09/12/2016 : bug compilateur gfortran 4.8.2

---
 src/Rules.LXgfortran.mk | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/Rules.LXgfortran.mk b/src/Rules.LXgfortran.mk
index b5ff15e1f..edb7d41cc 100644
--- a/src/Rules.LXgfortran.mk
+++ b/src/Rules.LXgfortran.mk
@@ -7,6 +7,10 @@
 # Compiler Options                                       #
 #                                                        #
 ##########################################################
+#
+#   Gfortran version
+GFV=$(shell  gfortran --version | grep -E -m1 -o ' [[:digit:]\.]{2,}( |$$)'  | sed 's/\.//g' )
+#
 #OBJDIR_PATH=/home/escj/azertyuiopqsdfghjklm/wxcvbn/azertyuiopqsdfghjklmwxcvbn
 #
 OPT_BASE  =  -g -fno-second-underscore -fpic  -ffpe-trap=overflow,zero,invalid  -fbacktrace
@@ -92,13 +96,16 @@ CNAME_GRIBEX=_gfortran
 #
 HDF_CONF= CFLAGS=-std=c99
 #
-# LIBTOOLS flags
+## LIBTOOLS flags
 #
 #if MNH_TOOLS exists => compile the tools if gfortran >= 5.X
-ifeq ($(shell test $$( gfortran -dumpversion | cut -b1 ) -ge 5 ; echo $$?),0)
-MNH_TOOLS = yes
+#ifeq ($(shell test $$( gfortran -dumpversion | cut -b1 ) -ge 5 ; echo $$?),0)
+ifeq ($(shell test $(GFV) -ge 500 ; echo $$?),0)
+ MNH_TOOLS = yes
 endif
 #
+#
+#
 ##########################################################
 #                                                        #
 # Source of MESONH PACKAGE  Distribution                 #
@@ -126,3 +133,10 @@ OBJS_I4=spll_modd_netcdf.o
 $(OBJS_I4) : OPT = $(OPT_BASE_I4)
 endif
 
+ifeq ($(shell test $(GFV) -le 482 ; echo $$?),0)
+ifneq "$(OPTLEVEL)" "DEBUG"
+OBJS_O0= spll_lima_phillips_integ.o
+$(OBJS_O0) : OPT = $(OPT_BASE) $(OPT_PERF0)
+endif
+endif
+
-- 
GitLab