VisIt/build_x86: compile_visit.sh

File compile_visit.sh, 4.9 KB (added by Jens Henrik Goebbert, 9 years ago)

compile script for VisIt

Line 
1#!/bin/zsh
2
3#-------- setup
4module purge
5module load DEVELOP
6module load gcc
7module load openmpi/1.8.1
8
9VERS_MAJ=2
10VERS_MIN=9
11VERS_BUG=2
12VERS_DOT=${VERS_MAJ}.${VERS_MIN}.${VERS_BUG}
13VERS_ULINE=${VERS_MAJ}_${VERS_MIN}_${VERS_BUG}
14
15BUILD_PATH=/home/vrsw/VisIt/install/${VERS_DOT}/gcc44_ompi181_debug
16INST_PATH=/home/vrsw/VisIt/${VERS_DOT}/gcc44_ompi181_debug
17
18BUILD_PROCS=8
19BUILD_MODE=Debug
20
21ROOT_PATH=`pwd`
22ARCH=linux-`uname -m`
23HOSTNAME=`hostname`
24
25#------- print info
26echo
27echo "-------------------------------------------------------------------"
28echo "Building VisIt ${VERS_DOT} ${BUILD_MODE} for ${ARCH} on ${HOSTNAME}"
29echo " build path : ${BUILD_PATH}"
30echo " install path: ${INST_PATH}"
31echo " build with no. procs: ${BUILD_PROCS}"
32echo "-------------------------------------------------------------------"
33echo " Loaded modules:"
34module list
35echo
36
37#------- prepare directories
38mkdir -p ${BUILD_PATH}
39cd ${BUILD_PATH}
40if [ $? -eq 0 ]; then
41 echo "SUCCESS: build directory created (${BUILD_PATH})"
42else
43 echo "ERROR: cannot create build directory (${BUILD_PATH})"
44 exit
45fi
46
47#------- get build script
48wget http://portal.nersc.gov/svn/visit/trunk/releases/${VERS_DOT}/build_visit${VERS_ULINE}
49chmod +x build_visit${VERS_ULINE}
50if [ $? -eq 0 ]; then
51 echo "SUCCESS: build script downloaded"
52else
53 echo "ERROR: cannot download build script"
54 exit
55fi
56
57#------- patch build script
58patch -p0 -E build_visit${VERS_ULINE} << 'EOF'
59@@ -1644,12 +1644,12 @@
60 BYPASS_QT_LICENSE="yes"
61 fi
62
63- if [[ "$BYPASS_QT_LICENSE" == "no" && "$DOWNLOAD_ONLY" == "no" ]] ; then
64- qt_license_prompt
65- if [[ $? != 0 ]] ;then
66- error "Qt4 Open Source Edition License Declined. Bailing out."
67- fi
68- fi
69+# if [[ "$BYPASS_QT_LICENSE" == "no" && "$DOWNLOAD_ONLY" == "no" ]] ; then
70+# qt_license_prompt
71+# if [[ $? != 0 ]] ;then
72+# error "Qt4 Open Source Edition License Declined. Bailing out."
73+# fi
74+# fi
75 fi
76
77 #
78EOF
79
80#------- build 3rd party libraries
81echo "building 3rd party libraries ... "
82echo " be patient or check ${BUILD_PATH}/1-build_3rdparty.log"
83echo
84echo " ./build_visit${VERS_ULINE} \ "
85echo " --console --no-visit \ "
86echo " --build-mode ${BUILD_MODE} --makeflags \"-j ${BUILD_PROCS}\" \ "
87echo " --parallel --fortran \ "
88echo " --cmake --mesa --python --vtk --qt --szip --zlib --boost \ "
89echo " --hdf5 --silo --netcdf --xdmf \ "
90echo " --prefix ${INST_PATH} > ${BUILD_PATH}/1-build_3rdparty.log"
91echo
92./build_visit${VERS_ULINE} \
93 --console --no-visit \
94 --build-mode ${BUILD_MODE} --makeflags "-j ${BUILD_PROCS}" \
95 --parallel --fortran \
96 --cmake --mesa --python --vtk --qt --szip --zlib --boost \
97 --hdf5 --silo --netcdf --xdmf \
98 --prefix ${INST_PATH} > ${BUILD_PATH}/1-build_3rdparty.log 2>&1
99if [ $? -eq 0 ]; then
100 echo "SUCCESS: 3rd party libraries build"
101else
102 echo "ERROR: cannot build 3rd party libraries"
103 exit
104fi
105
106#------- download VisIt
107echo "downloading VisIt source ... "
108wget http://portal.nersc.gov/svn/visit/trunk/releases/${VERS_DOT}/visit${VERS_DOT}.tar.gz
109tar -xzf visit${VERS_DOT}.tar.gz
110if [ $? -eq 0 ]; then
111 echo "SUCCESS: VisIt source downloaded and extracted"
112else
113 echo "ERROR: cannot download and extract VisIt source"
114 exit
115fi
116
117#------- configure VisIt
118echo "configuring VisIt ... "
119echo " be patient or check ${BUILD_PATH}/2-conf_visit.log"
120cp ${HOSTNAME}.cmake visit${VERS_DOT}/src/config-site/
121cd visit${VERS_DOT}/src
122
123export CMAKE_BIN=`find ../../visit/cmake -mindepth 1 -maxdepth 1 -type d | sort | head -1`
124export CMAKE_BIN=`find ${CMAKE_BIN} -mindepth 1 -maxdepth 1 -type d | sort | head -1`
125${CMAKE_BIN}/bin/cmake \
126 -DCMAKE_BUILD_TYPE:STRING=${BUILD_MODE} \
127 -DVISIT_PARALLEL:BOOL=ON \
128 -DVISIT_FORTRAN:BOOL=ON \
129 . > ${BUILD_PATH}/2-conf_visit.log 2>&1
130if [ $? -eq 0 ]; then
131 echo "SUCCESS: VisIt configured and Makefile created"
132else
133 echo "ERROR: cannot configure VisIt and create Makefile"
134 exit
135fi
136
137#------- compile VisIt
138echo "compiling VisIt ... "
139echo " be patient or check ${BUILD_PATH}/3-compile_visit.log"
140make -j ${BUILD_PROCS} > ${BUILD_PATH}/3-compile_visit.log 2>&1
141if [ $? -eq 0 ]; then
142 echo "SUCCESS: VisIt compiled"
143else
144 echo "ERROR: cannot compile VisIt"
145 exit
146fi
147
148#------- package VisIt
149echo "package VisIt ... "
150echo " be patient or check ${BUILD_PATH}/4-package_visit.log"
151make package > ${BUILD_PATH}/4-package_visit.log 2>&1
152if [ $? -eq 0 ]; then
153 echo "SUCCESS: VisIt packaged"
154else
155 echo "ERROR: cannot package VisIt"
156 exit
157fi
158
159#------- install VisIt
160echo "install VisIt ... "
161echo " be patient or check ${BUILD_PATH}/5-install_visit.log"
162./svn_bin/visit-install -c none ${VERS_DOT} ${ARCH} ${INST_PATH} > ${BUILD_PATH}/5-install_visit.log 2>&1
163if [ $? -eq 0 ]; then
164 echo "SUCCESS: VisIt installed"
165else
166 echo "ERROR: cannot install VisIt"
167 exit
168fi
169