3 ####################################################################################
5 # Created : Thu Dec 18 12:01:00 2002
6 # Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
8 # Module : Installation Wizard
9 # Copyright : 2002-2007 CEA
11 # This script is the part of the SALOME installation procedure.
13 ####################################################################################
17 if [ -z "$MED2HOME" ]; then
18 #echo "MED2HOME doesn't set"
21 check_lib_version libmed.so.1.1.2 ${MED2HOME}/lib
22 if [ "$?" -eq "0" ]; then
23 #echo "The product ${PRODUCT} has been already installed on yours system"
31 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
32 #$DELIM ${PRODUCT_TYPE} $DELIM
33 export MED2HOME=\${INSTALL_ROOT}/${PRODUCT}
34 export PATH=\${MED2HOME}/bin:\${PATH}
35 export LD_LIBRARY_PATH=\${MED2HOME}/lib:\${LD_LIBRARY_PATH}
38 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
39 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
44 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
45 #$DELIM ${PRODUCT_TYPE}_src $DELIM
49 (test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
50 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
54 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
55 try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
61 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
62 source ${INSTALL_WORK}/$SHRC
65 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
67 # to generate environment scripts
71 install_source_and_build()
78 makedir ${PRODUCT_DIR}
80 #vsr: provide additional flags for f95 (Mandriva 2006.0, Fedora Core 4)
84 if [ -e /etc/redhat-release ] ; then
85 grep -e "Mandriva Linux release 2006.0" /etc/redhat-release > /dev/null
86 if [ $? == 0 ] ; then is_mandriva=1 ; fi
87 grep -e "Mandriva Linux release 2007.0" /etc/redhat-release > /dev/null
88 if [ $? == 0 ] ; then is_mandriva2007=1 ; fi
89 grep -e "Fedora Core release 4" /etc/redhat-release > /dev/null
90 if [ $? == 0 ] ; then is_fedora=1 ; fi
92 if [ $is_mandriva2007 == 1 ] ; then
93 chmod +w ./Makefile.am
94 mv Makefile.am Makefile.am.orig
95 sed -e 's/ include src tests tools doc / include src tools doc /g' Makefile.am.orig > Makefile.am
97 if [ $is_mandriva == 1 ] || [ $is_mandriva2007 == 1 ] || [ $is_fedora == 1 ] ; then
98 if test `uname -m` = "x86_64" ; then
99 echo "`pwd` -> ./configure --prefix=${PRODUCT_DIR} FFLAGS='-g -O2 -ffixed-line-length-none' CFLAGS=-m64 CXXFLAGS=-m64 >> ${PRODUCT_DIR}/CONFIGURE.LOG"
100 ./configure --prefix=${PRODUCT_DIR} FFLAGS="-g -O2 -ffixed-line-length-none" CFLAGS=-m64 CXXFLAGS=-m64 >> ${PRODUCT_DIR}/CONFIGURE.LOG 2> ${PRODUCT_DIR}_SRC/errlog
102 echo "`pwd` -> ./configure --prefix=${PRODUCT_DIR} FFLAGS='-g -O2 -ffixed-line-length-none' >> ${PRODUCT_DIR}/CONFIGURE.LOG"
103 ./configure --prefix=${PRODUCT_DIR} FFLAGS="-g -O2 -ffixed-line-length-none" >> ${PRODUCT_DIR}/CONFIGURE.LOG 2> ${PRODUCT_DIR}_SRC/errlog
105 if [ "$?" -ne "0" ] ; then
106 cat ${PRODUCT_DIR}/CONFIGURE.LOG
107 cat ${PRODUCT_DIR}_SRC/errlog >&2
108 cat ${PRODUCT_DIR}_SRC/errlog >> ${PRODUCT_DIR}/CONFIGURE.LOG
112 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR}
116 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
120 check_job ${PRODUCT_DIR}/MAKE.LOG make
121 check_job ${PRODUCT_DIR}/INSTALL.LOG make install
123 #du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
126 # remove sources and temporary files after building
127 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
128 test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
131 # to generate environment scripts
137 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
138 source ${INSTALL_WORK}/$SHRC
140 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
142 ### modify libmed.la libmedC.la files to correct direct path to hdf5 library
143 ### also modify libmed.la and libmedC.la files to correct direct path to med libraries
144 ### no need to do this for sources installation because 'make install' does it!
145 cd ${PRODUCT_DIR}/lib
146 sed -e 's%\(.*\)\([[:space:]].*libhdf5.la\)\(.*\)%\1 -lhdf5\3%g' -e "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" libmed.la > libmed.la.new
147 mv -f libmed.la.new libmed.la
148 sed -e 's%\(.*\)\([[:space:]].*libhdf5.la\)\(.*\)%\1 -lhdf5\3%g' -e "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" libmedC.la > libmedC.la.new
149 mv -f libmedC.la.new libmedC.la
151 if [ -n "${HDF5HOME}" ]; then
152 tmp="-L${HDF5HOME}/lib"
154 sed -e "s%\(.*\)\([[:space:]].*-L.*/hdf5-[0-9]\.[0-9]\.[0-9]/lib[[:space:]]\)\(.*\)%\1 $tmp \3%g" libmed.la > libmed.la.new
155 mv -f libmed.la.new libmed.la
156 sed -e "s%\(.*\)\([[:space:]].*-L.*/hdf5-[0-9]\.[0-9]\.[0-9]/lib[[:space:]]\)\(.*\)%\1 $tmp \3%g" libmedC.la > libmedC.la.new
157 mv -f libmedC.la.new libmedC.la
162 ### modify scripts to correct installation path
163 cd ${PRODUCT_DIR}/bin
164 sed -e "s%set cmd \".*/bin/mdump\"%set cmd \"${PRODUCT_DIR}/bin/mdump\"%g" xmdump > _xmdump
168 # to generate environment script for sources
173 export INSTALL_WORK=$2;
174 export SOURCE_DIR=$3;
175 export INSTALL_ROOT=$4;
176 export PRODUCT_SEQUENCE=$5;
177 export PRODUCT_TYPE=$6;
178 export INSTALL_PRODUCTS=$7;
181 export PRODUCT="med-2.3.2"
182 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
183 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}