Salome HOME
spns #24217 Validation SALOME 9.7.0 - medfile embed libgfortran.so.5 if devtoolset...
[tools/sat_salome.git] / products / compil_scripts / med.sh
1 #!/bin/bash
2
3 echo "##########################################################################"
4 echo "med" $VERSION
5 echo "##########################################################################"
6
7
8
9 CONFIGURE_FLAGS=$CONFIGURE_FLAGS'CFLAGS=-m64 CXXFLAGS=-m64' 
10 # OP 06/02/2017
11 # Putting option enable-python=no 
12 # Reason : compilation failure of python interface modules on FD24 (generated by swig in medfile)
13 # CEA decision 13/02/2017 : deactivation of the compilation of python interface modules because no need python interface
14 CONFIGURE_FLAGS=$CONFIGURE_FLAGS' --enable-python=no'
15
16 if [ -n "$SAT_HPC" ]
17 then
18     CONFIGURE_FLAGS=$CONFIGURE_FLAGS' --enable-parallel'
19 else
20     # CNC 24/01/2017
21     # the line "export F77=gfortran" is commented, as we think it is not useful.
22     # at least it should'n.
23     # If it happens to be necessary, we will correct automake procedure.
24     #
25     # SRE 27/01/2017
26     # In fact this line is necessary because when the g77 compiler exists on the machine,
27     # it is found before gfortran and it makes the compilation fail.
28     # A mail has been sent to Eric Fayolle to fix this bug.
29     # En attendant, on remet la ligne.
30     export F77=gfortran
31 fi
32
33 if [ -n "$SALOME_USE_64BIT_IDS" ]
34 then
35     echo "WARNING: user requested 64 bits encoding for integers..."
36     export FFLAGS=-fdefault-integer-8
37     export FFLAGS=$FFLAGS' -g -O2 -ffixed-line-length-none'
38     CONFIGURE_FLAGS=$CONFIGURE_FLAGS' --with-med_int=long'
39 else
40     FFLAGS="-g -O2 -ffixed-line-length-none"
41 fi
42
43 echo
44 echo "*** configure"
45 $SOURCE_DIR/configure --prefix=$PRODUCT_INSTALL FFLAGS="${FFLAGS}" $CONFIGURE_FLAGS
46 if [ $? -ne 0 ]
47 then
48     echo "ERROR on configure"
49     exit 1
50 fi
51 echo
52 echo "*** make" $MAKE_OPTIONS
53 make $MAKE_OPTIONS
54 if [ $? -ne 0 ]
55 then
56     echo "ERROR on make"
57     exit 2
58 fi
59
60 echo
61 echo "*** make install"
62 make install
63 if [ $? -ne 0 ]
64 then
65     echo "ERROR on make install"
66     exit 3
67 fi
68
69 # post-build action in case devtoolset-8 is used
70 LINUX_DISTRIBUTION="$DIST_NAME$DIST_VERSION"
71 case $LINUX_DISTRIBUTION in
72     CO7)
73         if [ -n "$X_SCLS" ]
74         then
75             X_SCLSVALUE=$(echo $X_SCLS)
76             if [ $X_SCLSVALUE == "devtoolset-8" ]; then
77                 echo "WARNING: devtoolset-8 is installed on ${LINUX_DISTRIBUTION} - libgfortran will be embedded..."
78                 cp -RP /usr/lib64/libgfortran.so.5* $PRODUCT_INSTALL/lib/
79             fi
80         else
81             echo "INFO: X_SCLS does not seem to be set. skipping..."
82         fi
83         ;;
84     *)
85         ;;
86 esac
87
88 echo
89 echo "########## END"
90