Juan 6/02/2019: For CDFAUTO & Forefire , add compilation of netcdf-cxx-4.2
authorJuan Escobar <escj@aero.obs-mip.fr>
Thu, 14 Feb 2019 15:41:49 +0000 (16:41 +0100)
committerJuan Escobar <escj@aero.obs-mip.fr>
Fri, 15 Feb 2019 14:29:11 +0000 (15:29 +0100)
conf/profile_mesonh.ihm
src/Makefile
src/Makefile.MESONH.mk
src/Rules.LXgfortran.mk
src/Rules.LXifort.mk
src/configure

index 576185e..ca9d6bb 100755 (executable)
@@ -67,6 +67,7 @@ export CONF_DOLLAR=${CONF_DOLLAR}
 #
 export VER_CDF=${VER_CDF}
 export VERSION_CDFC=${VERSION_CDFC}
+export VERSION_CDFCXX=${VERSION_CDFCXX}
 export VERSION_CDFF=${VERSION_CDFF}
 export VERSION_HDF=${VERSION_HDF}
 export VERSION_LIBAEC=${VERSION_LIBAEC}
@@ -125,7 +126,7 @@ export VERSION_NCL=${VERSION_NCL}
 ##########################################################
 ##########################################################
 #
-export XYZ="-\${ARCH}-R\${MNH_REAL}I\${MNH_INT}-\${VERSION_XYZ}\${MNH_ECRAD:+-ECRAD}\${VER_USER:+-\${VER_USER}}-\${VER_MPI}-\${OPTLEVEL}"
+export XYZ="-\${ARCH}-R\${MNH_REAL}I\${MNH_INT}-\${VERSION_XYZ}\${MNH_ECRAD:+-ECRAD}\${MNH_FOREFIRE:+-FF}\${VER_USER:+-\${VER_USER}}-\${VER_MPI}-\${OPTLEVEL}"
 #[ "x\${VER_USER}" != "x" ] && export XYZ="\${XYZ}-\${VER_USER}"
 # PATH to find tools like "makegen, etc ..."
 export BIN_TOOLS=${BIN_TOOLS}
index ef4e422..ef5a0b3 100644 (file)
@@ -339,8 +339,8 @@ gribapi_clean :
 ##########################################################
 ifeq "$(VER_CDF)" "CDFAUTO"
 #
-HDF_OPT    = ${OPT_BASE_I4:-$OPT_BASE}
-NETCDF_OPT = ${OPT_BASE_I4:-$OPT_BASE}
+HDF_OPT    ?= ${OPT_BASE_I4:-$OPT_BASE}
+NETCDF_OPT ?= ${OPT_BASE_I4:-$OPT_BASE}
 #
 cdf : $(CDF_MOD)
 $(CDF_MOD) :
@@ -352,6 +352,12 @@ $(CDF_MOD) :
        cd ${DIR_CDFC} && ./configure --disable-shared --prefix=${CDF_PATH} --libdir=${CDF_PATH}/lib64 --disable-dap \
        CC="$(CC)" CFLAGS="$(NETCDF_OPT)" CPPFLAGS="${INC_NETCDF}" ${CDF_CONF} LDFLAGS="-L${CDF_PATH}/lib64" LIBS="-lhdf5_hl -lhdf5 -lsz -laec -lz" && \
        $(MAKE) && $(MAKE) install && $(MAKE) clean
+ifdef MNH_FOREFIRE
+       cd ${DIR_CDFCXX} && ./configure --disable-shared --prefix=${CDF_PATH} --libdir=${CDF_PATH}/lib64 \
+       CXX="$(CXX)" CXXFLAGS="$(NETCDF_OPT)" FC="$(FC)" FCFLAGS="$(NETCDF_OPT) $(NETCDF_SUPPFLAGS)" FFLAGS="$(NETCDF_OPT)"  \
+       CPPFLAGS="${INC_NETCDF}" ${CDF_CONF} LDFLAGS="-L${CDF_PATH}/lib64" LIBS="-lnetcdf -lhdf5_hl -lhdf5 -lsz -laec -lz" && \
+       $(MAKE) && $(MAKE) install && $(MAKE) clean
+endif
        cd ${DIR_CDFF} && ./configure --disable-shared --prefix=${CDF_PATH} --libdir=${CDF_PATH}/lib64 \
        CC="$(CC)" CFLAGS="$(NETCDF_OPT)" FC="$(FC)" FCFLAGS="$(NETCDF_OPT) $(NETCDF_SUPPFLAGS)" FFLAGS="$(NETCDF_OPT)"  \
        CPPFLAGS="${INC_NETCDF}" ${CDF_CONF} LDFLAGS="-L${CDF_PATH}/lib64" LIBS="-lnetcdf -lhdf5_hl -lhdf5 -lsz -laec -lz" && \
@@ -363,6 +369,9 @@ cleancdf :
        cd ${DIR_LIBAEC} && $(MAKE) clean
        cd ${DIR_HDF} && $(MAKE) clean 
        cd ${DIR_CDFC} && $(MAKE) clean 
+ifdef MNH_FOREFIRE
+       cd ${DIR_CDFCXX} && $(MAKE) clean 
+endif
        cd ${DIR_CDFF} && $(MAKE) clean
 endif
 ##########################################################
index bda2902..1a16078 100644 (file)
@@ -252,6 +252,7 @@ OBJS_LISTE_MASTER     += C_ForeFire_Interface.o
 INC                   += $(INC_FOREFIRE)
 VPATH                 += $(DIR_FOREFIRE)
 CPPFLAGS              += -DMNH_FOREFIRE
+ARCH_XYZ    := $(ARCH_XYZ)-FF
 endif
 ##########################################################
 #           Source TOOLS                                 #
@@ -467,6 +468,7 @@ endif
 #
 ifeq "$(VER_CDF)" "CDFAUTO"
 DIR_CDFC?=${SRC_MESONH}/src/LIB/netcdf-${VERSION_CDFC}
+DIR_CDFCXX?=${SRC_MESONH}/src/LIB/netcdf-cxx-${VERSION_CDFCXX}
 DIR_CDFF?=${SRC_MESONH}/src/LIB/netcdf-fortran-${VERSION_CDFF}
 CDF_PATH?=${SRC_MESONH}/src/LIB/netcdf-${ARCH}-R${MNH_REAL}I${MNH_INT}
 CDF_MOD?=${CDF_PATH}/include/netcdf.mod
index 26ff8ee..cdf8bc9 100644 (file)
@@ -58,6 +58,7 @@ endif
 #
 #  
 CC = gcc
+CXX = g++
 FC = gfortran 
 ifeq "$(VER_MPI)" "MPIAUTO"
 F90 = mpif90
@@ -97,6 +98,8 @@ CNAME_GRIBEX=_gfortran
 # Netcdf/HDF5 flags
 #
 HDF_CONF= CFLAGS=-std=c99
+HDF_OPT ?= -fPIC
+NETCDF_OPT ?= -fPIC
 #
 ## LIBTOOLS flags
 #
index 48b9c5c..3a3185d 100644 (file)
@@ -128,6 +128,7 @@ endif
 #
 #
 CC ?= gcc
+CXX ?= g++
 FC = ifort
 ifeq "$(VER_MPI)" "MPIAUTO"
 ifneq "$(findstring TAU,$(XYZ))" ""
@@ -191,6 +192,12 @@ endif
 TARGET_GRIBEX=linux
 CNAME_GRIBEX=ifort
 #
+# Netcdf/HDF5 flags
+#
+HDF_CONF= CFLAGS=-std=c99
+HDF_OPT ?= -fPIC
+NETCDF_OPT ?= -fPIC
+#
 # LIBTOOLS flags
 #
 #if MNH_TOOLS exists => compile the tools
index 4dfbf2c..9b3b03b 100755 (executable)
@@ -9,12 +9,13 @@ if [ "x$XYZ" = "x" ]
 then
 # 
 export VERSION_MASTER=${VERSION_MASTER:-MNH-V5-4}
-export VERSION_BUG=${VERSION_BUG:-1}
+export VERSION_BUG=${VERSION_BUG:-2}
 export VERSION_XYZ=${VERSION_XYZ:-${VERSION_MASTER}-${VERSION_BUG}${VER_OASIS:+-${VER_OASIS}}}
 export VERSION_DATE=${VERSION_DATE:-"dd/mm/yyyy"}
 export VERSION_LIBAEC=${VERSION_LIBAEC:-"0.3.2"}
 export VERSION_HDF=${VERSION_HDF:-"1.8.20"}
 export VERSION_CDFC=${VERSION_CDFC:-"4.5.0"}
+export VERSION_CDFCXX=${VERSION_CDFCXX:-"4.2"}
 export VERSION_CDFF=${VERSION_CDFF:-"4.4.4"}
 export VERSION_GRIBAPI=${VERSION_GRIBAPI:-"1.26.0-Source"}
 export MNH_INT=${MNH_INT:-"4"}
@@ -429,7 +430,7 @@ fi
 #
 ${LOCAL}/bin/eval_dollar  profile_mesonh.ihm > profile_mesonh
 chmod +x profile_mesonh
-XYZ=${ARCH}-R${MNH_REAL}I${MNH_INT}-${VERSION_XYZ}${MNH_ECRAD:+-ECRAD}${VER_USER:+-${VER_USER}}-${VER_MPI}-${OPTLEVEL}
+XYZ=${ARCH}-R${MNH_REAL}I${MNH_INT}-${VERSION_XYZ}${MNH_ECRAD:+-ECRAD}${MNH_FOREFIRE:+-FF}${VER_USER:+-${VER_USER}}-${VER_MPI}-${OPTLEVEL}
 cp profile_mesonh profile_mesonh-${XYZ}
 #
 #  Do some post-install stuff
@@ -466,6 +467,7 @@ if [ "x${VER_CDF}" == "xCDFAUTO" ] ;then
 ( cd $LOCAL/src/LIB ; [ ! -d libaec-${VERSION_LIBAEC} ] && tar xvfz libaec-${VERSION_LIBAEC}.tar.gz )
 ( cd $LOCAL/src/LIB ; [ ! -d hdf5-${VERSION_HDF} ] && tar xvfz hdf5-${VERSION_HDF}.tar.gz )
 ( cd $LOCAL/src/LIB ; [ ! -d netcdf-${VERSION_CDFC} ] && tar xvfz netcdf-${VERSION_CDFC}.tar.gz )
+( cd $LOCAL/src/LIB ; [ ! -d netcdf-cxx-${VERSION_CDFCXX} ] && tar xvfz netcdf-cxx-${VERSION_CDFCXX}.tar.gz )
 ( cd $LOCAL/src/LIB ; [ ! -d netcdf-fortran-${VERSION_CDFF} ] && tar xvfz netcdf-fortran-${VERSION_CDFF}.tar.gz )
 fi
 #