]> SALOME platform Git repositories - tools/install.git/blob - config_files/hdf5-1.4.4.sh
Salome HOME
Remove HappyDoc dependencies
[tools/install.git] / config_files / hdf5-1.4.4.sh
1 #!/bin/sh
2
3 check_version()
4 {
5 if [ -z "$HDF5HOME" ]; then
6     return 1 
7 fi
8 check_lib_version libhdf5.so.0.0.0 ${HDF5HOME}/lib
9 if [ "$?" -ne "0" ]; then
10     return 1
11 fi
12 check_lib_version libhdf5.settings ${HDF5HOME}/lib
13 if [ "$?" -eq "0" ]; then
14     ver=`grep "HDF5 Version:" ${HDF5HOME}/lib/libhdf5.settings | awk '{print $3}'` 
15     if [ "$ver" = "1.4.4" ]; then 
16         return 0
17     fi
18 fi
19 return 1
20 }
21
22 print_env()
23 {
24 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
25 #$DELIM ${PRODUCT_TYPE} $DELIM
26 export HDF5HOME=\${INSTALL_ROOT}/${PRODUCT}
27 export PATH=\${HDF5HOME}/bin:\$PATH
28 export LD_LIBRARY_PATH=\${HDF5HOME}/lib:\${LD_LIBRARY_PATH}
29 ##
30 EOF
31 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
32 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
33 }
34
35 # looks for the native product and collects it's environment (used by make_env())
36 try_native(){
37 check_version
38 if [ $? -eq 0 ] ; then
39     tmp="\${HDF5HOME}/bin ${HDF5HOME}/bin \${PATH} ${PATH}";  
40     path=`sort_path ${tmp}`
41     tmp="\${HDF5HOME}/lib ${HDF5HOME}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";  
42     ld_library_path=`sort_path ${tmp}`
43     cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
44 #$DELIM ${PRODUCT_TYPE} $DELIM
45 export HDF5HOME=${HDF5HOME}
46 export PATH=${path}
47 export LD_LIBRARY_PATH=${ld_library_path}
48 ##
49 EOF
50     make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
51     return 0
52 fi
53 return 1;
54 }
55
56 try_preinstalled(){
57 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
58 return $?
59 }
60
61 install_source()
62 {
63 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
64 source ${INSTALL_WORK}/$SHRC
65
66 check_jb tar xfz ${SOURCE_DIR}/hdf5-1.4.4.tar.gz -C ${INSTALL_WORK}
67 cd ${PRODUCT_WORK}
68 makedir ${PRODUCT_DIR}
69 check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
70     ./configure --prefix=${PRODUCT_DIR} --enable-threadsafe --enable-hdf5v1_2 \
71         --enable-stream-vfd --disable-hsizet --with-pthread=/usr/include,/usr/lib 
72 GCC=`which gcc`
73 cat >> ${PRODUCT_DIR}/MAKE0.LOG <<EOF
74 used gcc=$GCC
75 EOF
76 check_job ${PRODUCT_DIR}/MAKE0.LOG make 
77 # 1
78 sed -e 's%$(srcdir)/usr%/usr%g' ./src/.depend > ./src/.dependnew
79 mv ./src/.dependnew ./src/.depend
80 cat >> ${PRODUCT_DIR}/MAKE1.LOG <<EOF
81 used gcc=$GCC
82 EOF
83 check_job ${PRODUCT_DIR}/MAKE1.LOG make  
84 # 2
85 sed -e 's%$(srcdir)/usr%/usr%g' ./test/.depend > ./test/.dependnew
86 mv ./test/.dependnew ./test/.depend
87 cat >> ${PRODUCT_DIR}/MAKE2.LOG <<EOF
88 used gcc=$GCC
89 EOF
90 check_job ${PRODUCT_DIR}/MAKE2.LOG make
91 # 3
92 sed -e 's%$(srcdir)/usr%/usr%g' ./tools/lib/.depend > ./tools/lib/.dependnew
93 mv ./tools/lib/.dependnew ./tools/lib/.depend
94 cat >> ${PRODUCT_DIR}/MAKE3.LOG <<EOF
95 used gcc=$GCC
96 EOF
97 check_job ${PRODUCT_DIR}/MAKE3.LOG make
98 # 4
99 sed -e 's%$(srcdir)/usr%/usr%g' ./tools/h5dump/.depend > ./tools/h5dump/.dependnew
100 mv ./tools/h5dump/.dependnew ./tools/h5dump/.depend
101 cat >> ${PRODUCT_DIR}/MAKE4.LOG <<EOF
102 used gcc=$GCC
103 EOF
104 check_job ${PRODUCT_DIR}/MAKE4.LOG make
105 # 5
106 sed -e 's%$(srcdir)/usr%/usr%g' ./tools/h5ls/.depend > ./tools/h5ls/.dependnew
107 mv ./tools/h5ls/.dependnew ./tools/h5ls/.depend
108 cat >> ${PRODUCT_DIR}/MAKE5.LOG <<EOF
109 used gcc=$GCC
110 EOF
111 check_job ${PRODUCT_DIR}/MAKE5.LOG make
112 # 6
113 sed -e 's%$(srcdir)/usr%/usr%g' ./tools/misc/.depend > ./tools/misc/.dependnew
114 mv ./tools/misc/.dependnew ./tools/misc/.depend
115 cat >> ${PRODUCT_DIR}/MAKE6.LOG <<EOF
116 used gcc=$GCC
117 EOF
118 check_job ${PRODUCT_DIR}/MAKE6.LOG make
119 # 7
120 #sed -e 's%$(srcdir)/usr%/usr%g' ./examples/.depend > ./examples/.dependnew
121 #mv ./examples/.dependnew ./examples/.depend
122 #cat >> ${PRODUCT_DIR}/MAKE7.LOG <<EOF
123 #used gcc=$GCC
124 #EOF
125 #check_job ${PRODUCT_DIR}/MAKE7.LOG make
126 ##
127 #check_job ${PRODUCT_DIR}/MAKECHECK.LOG make check
128 check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
129
130 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
131 cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
132 print_env
133 }
134
135 install_binary()
136 {
137 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
138 source ${INSTALL_WORK}/$SHRC
139
140 check_jb tar xfz ${SOURCE_DIR}/hdf5-1.4.4.tar.gz -C ${INSTALL_ROOT}
141
142 ### modify libhdf5.la file to correct direct path to hdf5 library
143 ### no need to do this for sources installation because 'make install' does it!
144 cd ${PRODUCT_DIR}/lib
145 sed -e "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" libhdf5.la > libhdf5.la.new
146 mv -f libhdf5.la.new libhdf5.la
147
148 print_env
149 }
150
151 export PROCEDURE=$1;
152 export INSTALL_WORK=$2;
153 export SOURCE_DIR=$3;
154 export INSTALL_ROOT=$4;
155 export PRODUCT_SEQUENCE=$5;
156 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="hdf" ; fi
157 export PRODUCT="hdf5-1.4.4"
158 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
159 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
160 source ./common.sh
161 $PROCEDURE