Salome HOME
Ensure cmake_build_type is used in SALOME 9.12.0
[tools/sat_salome.git] / products / compil_scripts / med.sh
index 886fa7ecacea8e2701b6a67a75671348808097f1..5716a07ad06f0f82a9abf54c1bd92e5d7cb32462 100755 (executable)
@@ -5,37 +5,28 @@ echo "med" $VERSION
 echo "##########################################################################"
 
 
+CONFIGURE_FLAGS=
+CONFIGURE_FLAGS+=' CFLAGS=-m64 CXXFLAGS=-m64'
+CONFIGURE_FLAGS+=' --enable-python=no'
+echo $HDF5_VERSION
 
-CONFIGURE_FLAGS=$CONFIGURE_FLAGS'CFLAGS=-m64 CXXFLAGS=-m64' 
-# OP 06/02/2017
-# Putting option enable-python=no 
-# Reason : compilation failure of python interface modules on FD24 (generated by swig in medfile)
-# CEA decision 13/02/2017 : deactivation of the compilation of python interface modules because no need python interface
-CONFIGURE_FLAGS=$CONFIGURE_FLAGS' --enable-python=no'
+function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; }
 
-if [ -n "$SAT_HPC" ]
-then
-    CONFIGURE_FLAGS=$CONFIGURE_FLAGS' --enable-parallel'
+if version_ge "$HDF5_VERSION" "1.12" ; then
+    echo "WARNING: ensure compatibility with HDF 1.12"
+    CONFIGURE_FLAGS+=' CPPFLAGS=-DH5_USE_110_API'
+fi
+
+if [ -n "$SAT_HPC" ]; then
+    CONFIGURE_FLAGS+=' --enable-parallel'
 else
-    # CNC 24/01/2017
-    # the line "export F77=gfortran" is commented, as we think it is not useful.
-    # at least it should'n.
-    # If it happens to be necessary, we will correct automake procedure.
-    #
-    # SRE 27/01/2017
-    # In fact this line is necessary because when the g77 compiler exists on the machine,
-    # it is found before gfortran and it makes the compilation fail.
-    # A mail has been sent to Eric Fayolle to fix this bug.
-    # En attendant, on remet la ligne.
     export F77=gfortran
 fi
 
-if [ -n "$SALOME_USE_64BIT_IDS" ]
-then
+if [ "$SALOME_USE_64BIT_IDS" == "1" ]; then
     echo "WARNING: user requested 64 bits encoding for integers..."
-    export FFLAGS=-fdefault-integer-8
-    export FFLAGS=$FFLAGS' -g -O2 -ffixed-line-length-none'
-    CONFIGURE_FLAGS=$CONFIGURE_FLAGS' --with-med_int=long'
+    export FFLAGS='-fdefault-integer-8 -g -O2 -ffixed-line-length-none'
+    CONFIGURE_FLAGS+=' --with-med_int=long'
 else
     FFLAGS="-g -O2 -ffixed-line-length-none"
 fi
@@ -43,16 +34,15 @@ fi
 echo
 echo "*** configure --prefix=$PRODUCT_INSTALL FFLAGS=${FFLAGS} $CONFIGURE_FLAGS"
 $SOURCE_DIR/configure --prefix=$PRODUCT_INSTALL FFLAGS="${FFLAGS}" $CONFIGURE_FLAGS
-if [ $? -ne 0 ]
-then
+if [ $? -ne 0 ]; then
     echo "ERROR on configure"
     exit 1
 fi
+
 echo
 echo "*** make" $MAKE_OPTIONS
 make $MAKE_OPTIONS
-if [ $? -ne 0 ]
-then
+if [ $? -ne 0 ]; then
     echo "ERROR on make"
     exit 2
 fi
@@ -60,8 +50,7 @@ fi
 echo
 echo "*** make install"
 make install
-if [ $? -ne 0 ]
-then
+if [ $? -ne 0 ]; then
     echo "ERROR on make install"
     exit 3
 fi