VisIt/build_Juqueen: build_visit_BGQ_2.10.1

File build_visit_BGQ_2.10.1, 39.2 KB (added by Jens Henrik Goebbert, 8 years ago)
Line 
1#!/bin/bash
2
3VISIT_VERSION="2.10.0"
4
5################################################################################
6## DEFAULT VALUES FOR VARIABLES
7################################################################################
8
9# Global variables
10ARCH=linux-ppc64_gcc-4.4
11PREFIXARCH=linux-ppc64-BGQ
12PREFIX="$PWD/$PREFIXARCH"
13
14BG_CC=bgxlc_r
15BG_C_OPT_FLAGS="-qarch=qp -qtune=qp"
16BG_CXX=bgxlC_r
17
18# Compiler used for Mesa.
19BG_GNU_CC=/bgsys/drivers/ppcfloor/gnu-linux/bin/powerpc64-bgq-linux-gcc
20BG_GNU_CXX=/bgsys/drivers/ppcfloor/gnu-linux/bin/powerpc64-bgq-linux-g++
21
22BG_MPI_GNU_CC=mpicc # not used
23BG_MPI_GNU_CXX=mpicxx
24
25BG_MPI_CC=mpixlc_r
26BG_MPI_C_OPT_FLAGS="-qarch=qp -qtune=qp"
27BG_MPI_CXX_OPT_FLAGS=""
28BG_MPI_CXX=mpixlcxx_r
29
30BUILD_MODE="Release"
31CC=gcc
32C_OPT_FLAGS=""
33CXX=g++
34CXX_OPT_FLAGS=""
35EXTRA_ARGS=""
36GROUP="bdiv"
37INSTALLATION_BUILD_DIR="builds_static"
38IO_PACKAGES="--szip --hdf5 --silo"
39VISIT_SELECTED_DATABASE_PLUGINS="BOV;Cale;CaleHDF5;Curve2D;EnSight;Miranda;PDB;PlainText;SAMRAI;Silo;VTK"
40MAKE=make
41MAKE_OPT_FLAGS=""
42NO_VISIT=""
43DO_SVN=""
44DO_SVN_ANON=""
45SVN=""
46TAR=tar
47THIRD_PARTY_PATH="`pwd`/thirdparty_static"
48TARBALL="--tarball visit${VISIT_VERSION}.tar.gz"
49
50export CMAKE_VERSION=3.0.2
51export CMAKE_SHORT_VERSION=3.0
52
53export MESA_FILE=${MESA_FILE:-"MesaLib-7.8.2.tar.gz"}
54export MESA_VERSION=${MESA_VERSION:-"7.8.2"}
55export MESA_BUILD_DIR=${MESA_BUILD_DIR:-"Mesa-7.8.2"}
56export MESA_URL="http://visit.ilight.com/svn/visit/trunk/third_party"
57
58export ZLIB_FILE=${ZLIB_FILE:-"zlib-1.2.8.tar.gz"}
59export ZLIB_VERSION=${ZLIB_VERSION:-"1.2.8"}
60export ZLIB_BUILD_DIR=${ZLIB_BUILD_DIR:-"zlib-1.2.8"}
61export ZLIB_URL="http://zlib.net/"
62
63export VTK_VERSION="6.1.0"
64
65################################################################################
66## CODE BORROWED FROM build_visit
67################################################################################
68
69#First step download the support directory from svn repository..
70bv_PATH=`dirname $0`
71
72bv_PREFIX=$bv_PATH/bv_support/
73
74function configure_support_files
75{
76 if [ ! -d $bv_PREFIX ]; then
77 #check current directory
78 bv_PREFIX=$PWD/bv_support/
79
80 if [ ! -d $bv_PREFIX ]; then
81
82 for choice in `echo "curl wget svn"`
83 do
84 echo "Trying to fetch support files using: $choice"
85
86 #if choice successful then exit, else try next..
87 webaddr="http://visit.ilight.com/svn/visit/trunk/src/svn_bin/bv_support/"
88 tmp_choice=`which $choice`
89
90 if [ $? != 0 ]; then
91 continue
92 fi
93 if [[ $choice == "curl" ]]; then
94 tmp_curl=`curl -s ${webaddr}/ | grep 'sh\|xml' | grep li|sed s/.*bv_/bv_/g | sed -e s/\.sh.*/\.sh/g | sed -e s/.*href\=\"//g;`
95
96 if [ $? != 0 ]; then
97 continue
98 fi
99
100 mkdir -p bv_support_tmp
101 is_successful=1
102 #fetch each file..
103 for curl_files in `echo $tmp_curl`
104 do
105 curl -s ${webaddr}/${curl_files} -o bv_support_tmp/$curl_files
106 if [ $? != 0 ]; then
107 is_successful=0
108 break
109 fi
110 done
111
112 #if not successful cleanup and try next option..
113 if [ $is_successful == 0 ]; then
114 rm -fR bv_support_tmp
115 else
116 mv bv_support_tmp bv_support
117 fi
118 elif [[ $choice == "wget" ]]; then
119 wget -r -nH --cut-dirs=5 --no-parent --reject="index.html" -q ${webaddr}
120 else
121 svn co ${webaddr} bv_support
122 fi
123
124 if [ ! -d $bv_PREFIX ]; then
125 echo "$choice failed to retrieve support files"
126 else
127 echo "Success. downloaded support, continuing"
128 break
129 fi
130 done
131 fi
132
133 if [ ! -d $bv_PREFIX ]; then
134 echo "Failed to detect or fetch support files, please contact visit-users mailing list with error. Quitting..."
135 exit 2
136 fi
137 fi
138}
139
140#configure the support files if needed..
141configure_support_files
142
143#import initialize and run functions..
144. $bv_PREFIX/bv_main.sh
145
146#import helper functions..
147. $bv_PREFIX/helper_funcs.sh
148
149function banner
150{
151 echo "===================================================================================="
152 echo "$1"
153 echo "===================================================================================="
154
155 return 0
156}
157
158################################################################################
159## build_mesa_BGQ
160################################################################################
161
162function build_mesa_BGQ
163{
164 PF=$THIRD_PARTY_PATH/mesa/$MESA_VERSION/${ARCH}_BGQ
165
166 #
167 # Test whether Mesa has already been installed.
168 #
169 if test -d $PF ; then
170 return 0
171 fi
172
173 #
174 # Download file if needed
175 #
176 if ! test -e $MESA_FILE ; then
177 download_file $MESA_FILE $MESA_URL
178 if [[ $? == 1 ]] ; then
179 warn "Unable to download Mesa sources $MESA_FILE. Giving Up!"
180 return 1
181 fi
182 fi
183
184 #
185 # prepare build dir
186 #
187 prepare_build_dir $MESA_BUILD_DIR $MESA_FILE
188 untarred_mesa=$?
189
190 if [[ $untarred_mesa == -1 ]] ; then
191 warn "Unable to prepare Mesa build directory. Giving Up!"
192 return 1
193 fi
194
195 if test -e $MESA_BUILD_DIR ; then
196 echo "Moving $MESA_BUILD_DIR into ${INSTALLATION_BUILD_DIR}_BGQ"
197 if test -e ${INSTALLATION_BUILD_DIR}_BGQ/$MESA_BUILD_DIR ; then
198 rm -rf ${INSTALLATION_BUILD_DIR}_BGQ/$MESA_BUILD_DIR
199 fi
200 mv $MESA_BUILD_DIR ${INSTALLATION_BUILD_DIR}_BGQ/$MESA_BUILD_DIR
201 cd ${INSTALLATION_BUILD_DIR}_BGQ
202 fi
203
204 #
205 # Build bluegene-visit-osmesa config.
206 #
207 banner "Building Mesa (Compute Node)"
208 cd $MESA_BUILD_DIR || error "Couldn't cd to mesa build dir."
209 if test -e configs/bluegene-visit-osmesa ; then
210 rm -f configs/bluegene-visit-osmesa
211 fi
212 cat << \EOF > configs/bluegene-visit-osmesa
213include $(TOP)/configs/default
214CONFIG_NAME = bluegene-visit-osmesa
215# Compiler and flags
216APP_CC = gcc
217APP_CXX = g++
218CFLAGS = -O3 -DNDEBUG -pedantic -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
219CXXFLAGS = -O3 -DNDEBUG -pedantic -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
220MKLIB_OPTIONS = -static
221GL_LIB_NAME = libUsedToBeCalledGL.a
222GLU_LIB_NAME = libGLU.a
223GLUT_LIB_NAME = libglut.a
224GLW_LIB_NAME = libGLw.a
225OSMESA_LIB = OSMesa
226OSMESA_LIB_NAME = libOSMesa.a
227# Directories
228SRC_DIRS = glsl mesa glu
229DRIVER_DIRS = osmesa
230PROGRAM_DIRS = osdemos
231# Dependencies
232GL_LIB_DEPS =
233OSMESA_LIB_DEPS = -lm
234GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)
235GLUT_LIB_DEPS =
236GLW_LIB_DEPS =
237APP_LIB_DEPS = -lOSMesa -lGLU -lm
238EOF
239
240 # Append the bluegene compilers and install location.
241 echo "CC=$BG_GNU_CC" >> configs/bluegene-visit-osmesa
242 echo "CXX=$BG_GNU_CXX" >> configs/bluegene-visit-osmesa
243 echo "INSTALL_DIR=$PF" >> configs/bluegene-visit-osmesa
244
245 sed "s/bluegene-osmesa/bluegene-osmesa bluegene-visit-osmesa/g" Makefile > Makefile.visit
246 mv Makefile.visit Makefile
247
248 cat configs/bluegene-visit-osmesa
249
250 #
251 # Build Mesa.
252 #
253 info "Building OSMesa as libGL replacement ..."
254 ${MAKE} bluegene-visit-osmesa ${MAKE_OPT_FLAGS}
255 if [[ $? != 0 ]] ; then
256 warn "Mesa: 'make bluegene-visit-osmesa' failed. Giving up"
257 return 1
258 fi
259 info "Installing OSMesa as libGL replacement ..."
260 ${MAKE} install
261 if [[ $? != 0 ]] ; then
262 warn "Mesa: 'make install' failed. Giving up"
263 return 1
264 fi
265
266 # Some versions of Mesa erroneously install GLEW as well. We need to make
267 # sure we get VisIt's GLEW when we include it, so remove the ones Mesa
268 # installs.
269 rm -f $PF/include/GL/gl*ew.h
270
271 if [[ $? != 0 ]] ; then
272 warn "Mesa build failed. Giving up"
273 return 1
274 fi
275
276 chmod -R ug+w,a+rX "$THIRD_PARTY_PATH/mesa"
277 chgrp -R ${GROUP} "$THIRD_PARTY_PATH/mesa"
278
279 info "Done with Mesa"
280 return 0
281}
282
283function write_platform_file
284{
285 # Remove the platform file if it exists.
286 if test -e $1 ; then
287 rm -f $1
288 fi
289
290 # Write boilerplate platform file.
291 cat << \EOF > $1
292# From BlueGeneP-base.cmake
293
294#
295# For BGQ builds, we're cross compiling, but we don't want to re-root things
296# (e.g. with CMAKE_FIND_ROOT_PATH) because users may have libraries anywhere on
297# the shared filesystems, and this may lie outside the root. Instead, we set the
298# system directories so that the various system BGQ CNK library locations are
299# searched first. This is not the clearest thing in the world, given IBM's driver
300# layout, but this should cover all the standard ones.
301#
302set(CMAKE_SYSTEM_LIBRARY_PATH
303 /bgsys/drivers/ppcfloor/comm/default/lib # default comm layer (used by mpi compiler wrappers)
304 /bgsys/drivers/ppcfloor/comm/sys/lib # DCMF, other lower-level comm libraries
305 /bgsys/drivers/ppcfloor/runtime/SPI # other low-level stuff
306 /bgsys/drivers/ppcfloor/gnu-linux/lib # CNK python installation directory
307 /bgsys/drivers/ppcfloor/gnu-linux/powerpc-BGQ-linux/lib # CNK Linux image -- standard runtime libs, pthread, etc.
308)
309
310#
311# This adds directories that find commands should specifically ignore for cross compiles.
312# Most of these directories are the includeand lib directories for the frontend on BG/P systems.
313# Not ignoring these can cause things like FindX11 to find a frontend PPC version mistakenly.
314# We use this on BG instead of re-rooting because backend libraries are typically strewn about
315# the filesystem, and we can't re-root ALL backend libraries to a single place.
316#
317set(CMAKE_SYSTEM_IGNORE_PATH
318 /lib /lib64 /include
319 /usr/lib /usr/lib64 /usr/include
320 /usr/local/lib /usr/local/lib64 /usr/local/include
321 /usr/X11/lib /usr/X11/lib64 /usr/X11/include
322 /usr/lib/X11 /usr/lib64/X11 /usr/include/X11
323 /usr/X11R6/lib /usr/X11R6/lib64 /usr/X11R6/include
324 /usr/X11R7/lib /usr/X11R7/lib64 /usr/X11R7/include
325)
326
327#
328# Indicate that this is a unix-like system
329#
330set(UNIX 1)
331
332#
333# Library prefixes, suffixes, extra libs.
334#
335set(CMAKE_LINK_LIBRARY_SUFFIX "")
336set(CMAKE_STATIC_LIBRARY_PREFIX "lib") # lib
337set(CMAKE_STATIC_LIBRARY_SUFFIX ".a") # .a
338
339set(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
340set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so
341set(CMAKE_EXECUTABLE_SUFFIX "") # .exe
342set(CMAKE_DL_LIBS "dl")
343
344#
345# This macro needs to be called for dynamic library support. Unfortunately on BGQ,
346# We can't support both static and dynamic links in the same platform file. The
347# dynamic link platform file needs to call this explicitly to set up dynamic linking.
348#
349macro(__BlueGeneP_set_dynamic_flags compiler_id lang)
350 if (${compiler_id} STREQUAL XL)
351 # Flags for XL compilers if we explicitly detected XL
352 set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-qpic")
353 set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-qpie")
354 set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-qpic")
355 set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-qmkshrobj -qnostaticlink")
356 set(BGQ_${lang}_DYNAMIC_EXE_FLAGS "-qnostaticlink -qnostaticlink=libgcc")
357 else()
358 # Assume flags for GNU compilers (if the ID is GNU *or* anything else).
359 set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC")
360 set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE")
361 set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC")
362 set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
363 set(BGQ_${lang}_DYNAMIC_EXE_FLAGS "-dynamic")
364 endif()
365
366 # Both toolchains use the GNU linker on BG/P, so these options are shared.
367 set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-rpath,")
368 set(CMAKE_SHARED_LIBRARY_RPATH_LINK_${lang}_FLAG "-Wl,-rpath-link,")
369 set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG "-Wl,-soname,")
370 set(CMAKE_EXE_EXPORTS_${lang}_FLAG "-Wl,--export-dynamic")
371 set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "") # +s, flag for exe link to use shared lib
372 set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":") # : or empty
373
374 set(BGQ_${lang}_DEFAULT_EXE_FLAGS
375 "<FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
376 set(CMAKE_${lang}_LINK_EXECUTABLE
377 "<CMAKE_${lang}_COMPILER> -Wl,-relax ${BGQ_${lang}_DYNAMIC_EXE_FLAGS} ${BGQ_${lang}_DEFAULT_EXE_FLAGS}")
378endmacro()
379
380#
381# This macro needs to be called for static builds. Right now it just adds -Wl,-relax
382# to the link line.
383#
384macro(__BlueGeneQ_set_static_flags compiler_id lang)
385 set(BGQ_${lang}_DEFAULT_EXE_FLAGS
386 "<FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
387 set(CMAKE_${lang}_LINK_EXECUTABLE
388 "<CMAKE_${lang}_COMPILER> -Wl,-relax ${BGQ_${lang}_DEFAULT_EXE_FLAGS}")
389endmacro()
390
391# From BlueGeneP-static.cmake, which has a broken include
392set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
393set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
394set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
395
396# Use the XL compilers
397__BlueGeneQ_set_static_flags(XL CXX)
398EOF
399
400 return 0
401}
402
403#
404# Build cmake with the regular compiler. Make a link to the regular version
405# so we can have a "BGQ" version too.
406#
407function build_cmake
408{
409 if test -d $THIRD_PARTY_PATH/cmake/$CMAKE_VERSION/${ARCH}_BGQ ; then
410 info "CMake is already installed."
411 return 0
412 fi
413
414 MAKEARGS=""
415 if test -n "$MAKE_OPT_FLAGS" ; then
416 MAKEARGS="--makeflags \"$MAKE_OPT_FLAGS\""
417 fi
418 CFLAGSARGS=""
419 if test -n "$C_OPT_FLAGS" ; then
420 CFLAGSARGS="--cflags \"$C_OPT_FLAGS\""
421 fi
422 CXXFLAGSARGS=""
423 if test -n "$CXX_OPT_FLAGS" ; then
424 CXXFLAGSARGS="--cxxflags \"$CXX_OPT_FLAGS\""
425 fi
426
427 banner "Building CMake"
428 (export BUILD_VISIT_BGQ="yes"
429 eval $bv_PATH/build_visit \
430 --version ${VISIT_VERSION} \
431 --console --static --no-visit $SVN $TARBALL\
432 --no-thirdparty --cmake\
433 --log-file building_cmake.txt \
434 --arch "${ARCH}" \
435 --prefix "${PREFIX}" \
436 --build-mode $BUILD_MODE \
437 --thirdparty-path $THIRD_PARTY_PATH \
438 --installation-build-dir "${INSTALLATION_BUILD_DIR}" \
439 --cc $CC $CFLAGSARGS \
440 --cxx $CXX $CXXFLAGSARGS $MAKEARGS \
441 --group $GROUP || error "Cannot build cmake for login node.")
442
443 # Create a symlink to make a "BGQ" version of the login node cmake.
444 STARTDIR=`pwd`
445 cd $THIRD_PARTY_PATH/cmake/$CMAKE_VERSION
446 if ! test -e "${ARCH}_BGQ" ; then
447 ln -s $ARCH "${ARCH}_BGQ"
448 fi
449 cd $STARTDIR
450
451 # The BlueGeneP-static-XL-CXX platform files are hosed in cmake's install.
452 # Overwrite.
453 TOOLCHAIN="$THIRD_PARTY_PATH/cmake/$CMAKE_VERSION/$ARCH/share/cmake-$CMAKE_SHORT_VERSION/Modules/Platform/BlueGeneP-static-XL-CXX.cmake"
454 write_platform_file "$TOOLCHAIN"
455
456 cd $STARTDIR
457
458 return 0
459}
460
461function build_zlib_BGQ
462{
463 MAKEARGS=""
464 if test -n "$MAKE_OPT_FLAGS" ; then
465 MAKEARGS="--makeflags \"$MAKE_OPT_FLAGS\""
466 fi
467 CFLAGSARGS=""
468 if test -n "$BG_C_OPT_FLAGS" ; then
469 CFLAGSARGS="--cflag \"${BG_C_OPT_FLAGS}\""
470 fi
471 CXXFLAGSARGS=""
472 if test -n "$BG_CXX_OPT_FLAGS" ; then
473 CXXFLAGSARGS="--cxxflag \"${BG_CXX_OPT_FLAGS}\""
474 fi
475
476 # Build some packages that require GNU compilers.
477 banner "Building zlib (Compute Node)"
478 (eval $bv_PATH/build_visit \
479 --version ${VISIT_VERSION} \
480 --console --static --no-visit $SVN $TARBALL --engine-only \
481 --log-file compute_node.txt \
482 --arch "${ARCH}_BGQ" \
483 --prefix "${PREFIX}" \
484 --build-mode $BUILD_MODE \
485 --thirdparty-path $THIRD_PARTY_PATH \
486 --installation-build-dir "${INSTALLATION_BUILD_DIR}_BGQ" \
487 --cc $BG_CC $CFLAGSARGS \
488 --cxx $BG_CXX $CXXFLAGSARGS $MAKEARGS \
489 --no-thirdparty --zlib \
490 --group $GROUP)
491 if [[ $? != 0 ]] ; then
492 warn "ZLIB build failed. Giving up"
493 return 1
494 fi
495
496 return 0
497}
498
499function build_vtk_BGQ
500{
501 # Come up with some extra arguments for VTK's cmake line.
502 MESADIR="$THIRD_PARTY_PATH/mesa/$MESA_VERSION/${ARCH}_BGQ"
503 ZLIBDIR="$THIRD_PARTY_PATH/zlib/$ZLIB_VERSION/${ARCH}_BGQ"
504 VTKDIR="$THIRD_PARTY_PATH/vtk/$VTK_VERSION/${ARCH}_BGQ"
505 VTK_SRC_DIR="${INSTALLATION_BUILD_DIR}_BGQ/VTK-${VTK_VERSION}"
506 VTK_BUILD_DIR="${INSTALLATION_BUILD_DIR}_BGQ/VTK-${VTK_VERSION}-build"
507
508 # If the VTK installation directory already exists, return.
509 if test -d $VTKDIR ; then
510 info "VTK is already installed."
511 return 0
512 fi
513
514 MAKEARGS=""
515 if test -n "$MAKE_OPT_FLAGS" ; then
516 MAKEARGS="--makeflags \"$MAKE_OPT_FLAGS\""
517 fi
518 CFLAGSARGS=""
519 if test -n "$BG_C_OPT_FLAGS" ; then
520 CFLAGSARGS="--cflags \"$BG_C_OPT_FLAGS\""
521 fi
522 CXXFLAGSARGS=""
523 if test -n "$BG_CXX_OPT_FLAGS" ; then
524 CXXFLAGSARGS="--cxxflags \"$BG_CXX_OPT_FLAGS\""
525 fi
526
527 # Form extra arguments that we'll pass to cmake for VTK.
528 vopts="-DCMAKE_CROSSCOMPILING:BOOL=ON -DVTK_OPENGL_HAS_OSMESA:BOOL=ON"
529 vopts="${vopts} -DOPENGL_INCLUDE_DIR:PATH=$MESADIR/include"
530 vopts="${vopts} -DOPENGL_gl_LIBRARY:PATH=$MESADIR/lib/libOSMesa.a"
531 vopts="${vopts} -DOPENGL_glu_LIBRARY:PATH=$MESADIR/lib/libGLU.a"
532 vopts="${vopts} -DVTK_USE_X:BOOL=OFF"
533 vopts="${vopts} -DOSMESA_LIBRARY:FILEPATH=$MESADIR/lib/libOSMesa.a"
534 vopts="${vopts} -DOSMESA_INCLUDE_DIR:FILEPATH=$MESADIR/include"
535
536 vopts="${vopts} -DVTK_USE_SYSTEM_ZLIB:BOOL=ON"
537 vopts="${vopts} -DZLIB_INCLUDE_DIR:PATH=$ZLIBDIR/include"
538 vopts="${vopts} -DZLIB_LIBRARY:FILEPATH=$ZLIBDIR/lib/libz.a"
539
540 vopts="${vopts} -DCMAKE_REQUIRE_LARGE_FILE_SUPPORT:INTERNAL=1"
541 vopts="${vopts} -DVTK_TYPE_CHAR_IS_SIGNED:INTERNAL=1"
542 vopts="${vopts} -DVTK_ANSI_STREAM_EOF_RESULT:INTERNAL=0"
543 vopts="${vopts} -DKWSYS_LFS_WORKS:INTERNAL=0"
544 vopts="${vopts} -DKWSYS_CHAR_IS_SIGNED:INTERNAL=0"
545
546 # Delete the old cache file if there is one.
547 if test -e $VTK_BUILD_DIR/CMakeCache.txt ; then
548 rm -f $VTK_BUILD_DIR/CMakeCache.txt
549 fi
550
551 # Call build_visit.
552 banner "Building VTK (Compute Node)"
553 (export VTK_EXTRA_OPTIONS="${vopts}"
554 export C_COMPILER=$BG_CC
555 export BUILD_VISIT_BGQ="yes"
556 eval $bv_PATH/build_visit \
557 --version ${VISIT_VERSION} \
558 --console --static --no-visit $SVN $TARBALL --engine-only \
559 --no-thirdparty --cmake --vtk \
560 --log-file compute_node.txt \
561 --arch "${ARCH}_BGQ" \
562 --build-mode $BUILD_MODE \
563 --thirdparty-path $THIRD_PARTY_PATH \
564 --installation-build-dir "${INSTALLATION_BUILD_DIR}_BGQ" \
565 --cc $BG_CC $CFLAGSARGS \
566 --cxx $BG_CXX $CXXFLAGSARGS $MAKEARGS \
567 --group $GROUP)
568
569 rm -rf $VTK_SRC_DIR
570 rm -rf $VTK_BUILD_DIR
571
572 return $?
573}
574
575function build_icet_BGQ
576{
577 MAKEARGS=""
578 if test -n "$MAKE_OPT_FLAGS" ; then
579 MAKEARGS="--makeflags \"$MAKE_OPT_FLAGS\""
580 fi
581 CFLAGSARGS=""
582 if test -n "$BG_C_OPT_FLAGS" ; then
583 CFLAGSARGS="--cflag \"$BG_C_OPT_FLAGS\""
584 fi
585 CXXFLAGSARGS=""
586 if test -n "$BG_CXX_OPT_FLAGS" ; then
587 CXXFLAGSARGS="--cxxflag \"$BG_CXX_OPT_FLAGS\""
588 fi
589
590 # Call build_visit just to build Ice-T. Use the gnu compilers to build
591 # it but use the XL/MPI compilers to detect MPI.
592 banner "Building Ice-T (Compute Node)"
593 (export PAR_COMPILER=$BG_MPI_CC
594 export C_COMPILER=$BG_CC
595 eval $bv_PATH/build_visit \
596 --version ${VISIT_VERSION} \
597 --console --static --no-visit $SVN $TARBALL --engine-only \
598 --no-thirdparty --cmake --icet \
599 --log-file compute_node.txt \
600 --arch "${ARCH}_BGQ" \
601 --prefix "${PREFIX}" \
602 --build-mode $BUILD_MODE \
603 --thirdparty-path $THIRD_PARTY_PATH \
604 --installation-build-dir "${INSTALLATION_BUILD_DIR}_BGQ" \
605 --cc $BG_GNU_CC $CFLAGSARGS \
606 --cxx $BG_GNU_CXX $CXXFLAGSARGS $MAKEARGS \
607 --group $GROUP)
608
609 rm -rf ${INSTALLATION_BUILD_DIR}_BGQ/IceT-1-0-0
610
611 return $?
612}
613
614# 0 on success, Non-zero on failure.
615function build_for_compute_node
616{
617 banner "BUILDING FOR COMPUTE NODE"
618
619 # We need to build Mesa with a special config file.
620 STARTDIR=`pwd`
621 build_mesa_BGQ
622 if [[ $? != 0 ]] ; then
623 warn "Mesa build failed. Giving up"
624 return 1
625 fi
626 cd $STARTDIR
627
628 # We need to build zlib
629 build_zlib_BGQ
630 if [[ $? != 0 ]] ; then
631 warn "ZLIB build failed. Giving up"
632 return 1
633 fi
634 cd $STARTDIR
635
636 # We need to build VTK
637 build_vtk_BGQ
638 if [[ $? != 0 ]] ; then
639 warn "VTK build failed. Giving up"
640 return 1
641 fi
642 cd $STARTDIR
643
644 # We need to build Ice-T
645 build_icet_BGQ
646 if [[ $? != 0 ]] ; then
647 warn "Ice-T build failed. Giving up"
648 return 1
649 fi
650 cd $STARTDIR
651
652 # Build the other packages (and VisIt) that don't need special treatment.
653
654 MAKEARGS=""
655 if test -n "$MAKE_OPT_FLAGS" ; then
656 MAKEARGS="--makeflags \"$MAKE_OPT_FLAGS\""
657 fi
658 CFLAGSARGS=""
659 if test -n "$BG_C_OPT_FLAGS" ; then
660 CFLAGSARGS="--cflag \"$BG_C_OPT_FLAGS\""
661 fi
662 CXXFLAGSARGS=""
663 if test -n "$BG_CXX_OPT_FLAGS" ; then
664 CXXFLAGSARGS="--cxxflag \"$BG_CXX_OPT_FLAGS\""
665 fi
666
667 # Build some packages that require GNU compilers.
668 banner "Building I/O libraries (Compute Node)"
669 (export SILO_EXTRA_OPTIONS="--disable-browser --disable-hzip --disable-fpzip"
670 export BUILD_VISIT_BGQ="yes"
671 eval $bv_PATH/build_visit \
672 --version ${VISIT_VERSION} \
673 --console --static --no-visit $SVN $TARBALL --engine-only \
674 --log-file compute_node.txt \
675 --arch "${ARCH}_BGQ" \
676 --prefix "${PREFIX}" \
677 --build-mode $BUILD_MODE \
678 --thirdparty-path $THIRD_PARTY_PATH \
679 --installation-build-dir "${INSTALLATION_BUILD_DIR}_BGQ" \
680 --cc $BG_GNU_CC $CFLAGSARGS \
681 --cxx $BG_GNU_CXX $CXXFLAGSARGS $MAKEARGS \
682 --no-thirdparty --zlib $IO_PACKAGES \
683 --group $GROUP)
684 if [[ $? != 0 ]] ; then
685 warn "3rd party I/O build failed. Giving up"
686 return 1
687 fi
688
689 # Call build_visit to build VisIt itself. Note that we set PAR_COMPILER,
690 # C_COMPILER, BUILD_VISIT_BGQ to trigger special behaviors in build_visit.
691 #
692 # NOTE: We do not build with Mesa support because we're already using Mesa
693 # as our GL library. This way, we use the VTK rendering classes since
694 # they are working better than the VisIt Mesa-based ones.
695 #
696
697 DBPLUGINSARGS=""
698 if test -n "${VISIT_SELECTED_DATABASE_PLUGINS}" ; then
699 DBPLUGINSARGS="--database-plugins \"${VISIT_SELECTED_DATABASE_PLUGINS}\""
700 fi
701
702 banner "Building VisIt (Compute Node)"
703 (export PAR_COMPILER=$BG_MPI_CC
704 export C_COMPILER=$BG_CC
705 export BUILD_VISIT_BGQ="yes"
706 eval $bv_PATH/build_visit \
707 --version ${VISIT_VERSION} \
708 --console --static $NO_VISIT $SVN $TARBALL --engine-only\
709 --log-file compute_node.txt \
710 --arch "${ARCH}_BGQ" \
711 --prefix "${PREFIX}" \
712 --build-mode $BUILD_MODE \
713 --thirdparty-path $THIRD_PARTY_PATH \
714 --installation-build-dir "${INSTALLATION_BUILD_DIR}_BGQ" \
715 --cc $BG_CC $CFLAGSARGS \
716 --cxx $BG_CXX $CXXFLAGSARGS $MAKEARGS \
717 --no-thirdparty --boost --zlib $IO_PACKAGES \
718 --parallel --cmake --icet \
719 --group $GROUP \
720 ${DBPLUGINSARGS})
721 if [[ $? != 0 ]] ; then
722 warn "VisIt build failed. Giving up"
723 return 1
724 fi
725
726 # If we built VisIt then move the libsim lib directory because otherwise
727 # we'll clobber it with the login node version later.
728 if test "$NO_VISIT" = "" ; then
729 LIBSIM_BGQ=""
730 if test -d $PREFIX/${VISIT_VERSION}/linux-ppc64/libsim/V2/lib ; then
731 LIBSIM_BGQ=$PREFIX/${VISIT_VERSION}/linux-ppc64/libsim/V2/libBGQ
732 mv $PREFIX/${VISIT_VERSION}/linux-ppc64/libsim/V2/lib ${LIBSIM_BGQ}
733 fi
734 if test -d $PREFIX/${VISIT_VERSION}b/linux-ppc64/libsim/V2/lib ; then
735 LIBSIM_BGQ=$PREFIX/${VISIT_VERSION}b/linux-ppc64/libsim/V2/libBGQ
736 mv $PREFIX/${VISIT_VERSION}b/linux-ppc64/libsim/V2/lib ${LIBSIM_BGQ}
737 fi
738 # copy static libs, which are dependencies for the static libsimV2 libs
739 if [ ! -z "${LIBSIM_BGQ}" ]; then
740 cp builds_static_BGQ/src/lib/libsimV2runtime_par.a ${LIBSIM_BGQ}
741 cp builds_static_BGQ/src/lib/libengine_par.a ${LIBSIM_BGQ}
742 cp builds_static_BGQ/src/lib/libsimV2_static_par.a ${LIBSIM_BGQ}
743 cp builds_static_BGQ/src/lib/libcognomen.a ${LIBSIM_BGQ}
744 cp builds_static_BGQ/src/lib/libvisit_vtk.a ${LIBSIM_BGQ}
745 fi
746 fi
747
748 return 0
749}
750
751function build_for_login_node
752{
753 banner "BUILDING FOR LOGIN NODE"
754
755 MAKEARGS=""
756 if test -n "$MAKE_OPT_FLAGS" ; then
757 MAKEARGS="--makeflags \"$MAKE_OPT_FLAGS\""
758 fi
759
760 CFLAGSARGS=""
761 if test -n "$C_OPT_FLAGS" ; then
762 CFLAGSARGS="--cflag \"$C_OPT_FLAGS\""
763 fi
764 CXXFLAGSARGS=""
765 if test -n "$CXX_OPT_FLAGS" ; then
766 CXXFLAGSARGS="--cxxflag \"$CXX_OPT_FLAGS\""
767 fi
768 DBPLUGINSFLAGSARGS=""
769 if test -n "$VISIT_SELECTED_DATABASE_PLUGINS" ; then
770 DBPLUGINSFLAGSARGS="--database-plugins \"$VISIT_SELECTED_DATABASE_PLUGINS\""
771 fi
772
773 # Build cmake, python, VTK. We pass BUILD_VISIT_BGQ in the environment so
774 # VTK will be configured using a script. This works around a glitch in
775 # identifying the compiler.
776 banner "Building Dependencies (Login Node)"
777 (eval $bv_PATH/build_visit \
778 --version ${VISIT_VERSION} \
779 --console --static --no-visit $SVN $TARBALL --server-components-only \
780 --log-file login_node.txt \
781 --arch $ARCH \
782 --prefix "${PREFIX}" \
783 --build-mode $BUILD_MODE \
784 --thirdparty-path $THIRD_PARTY_PATH \
785 --installation-build-dir $INSTALLATION_BUILD_DIR \
786 --cc $CC $CFLAGSARGS \
787 --cxx $CXX $CXXFLAGSARGS $MAKEARGS \
788 --no-thirdparty --cmake --vtk --python \
789 --group $GROUP)
790 if [[ $? != 0 ]] ; then
791 warn "VisIt build failed. Giving up"
792 return 1
793 fi
794
795 # Do another build_visit pass with no BUILD_VISIT_BGQ since we don't want what
796 # it would do to the resulting config-site file.
797 banner "Building VisIt (Login Node)"
798 (eval $bv_PATH/build_visit \
799 --version ${VISIT_VERSION} \
800 --console --static $NO_VISIT $SVN $TARBALL --server-components-only \
801 --log-file login_node.txt \
802 --arch $ARCH \
803 --prefix "${PREFIX}" \
804 --build-mode $BUILD_MODE \
805 --thirdparty-path $THIRD_PARTY_PATH \
806 --installation-build-dir $INSTALLATION_BUILD_DIR \
807 --cc $CC $CFLAGSARGS \
808 --cxx $CXX $CXXFLAGSARGS $MAKEARGS \
809 --no-thirdparty --boost --cmake --vtk $IO_PACKAGES --python \
810 --group $GROUP \
811 ${DBPLUGINSFLAGSARGS})
812 if [[ $? != 0 ]] ; then
813 warn "VisIt build failed. Giving up"
814 return 1
815 fi
816
817 # If we built VisIt then move the libsim lib directory because otherwise
818 # we'll clobber it with the login node version later.
819 if test "$NO_VISIT" = "" ; then
820 if test -d $PREFIX/${VISIT_VERSION}/linux-ppc64/libsim/V2/lib ; then
821 mv $PREFIX/${VISIT_VERSION}/linux-ppc64/libsim/V2/lib $PREFIX/${VISIT_VERSION}/linux-ppc64/libsim/V2/libBGQ
822 fi
823 if test -d $PREFIX/${VISIT_VERSION}b/linux-ppc64/libsim/V2/lib ; then
824 mv $PREFIX/${VISIT_VERSION}b/linux-ppc64/libsim/V2/lib $PREFIX/${VISIT_VERSION}b/linux-ppc64/libsim/V2/libBGQ
825 fi
826 fi
827
828 return 0
829}
830
831
832function printvars
833{
834 echo "========================================================================"
835 echo "The following variables will be used during the build process:"
836 echo ""
837 echo "Build Settings"
838 echo "==============="
839 echo "ARCH=$ARCH"
840 echo "BUILD_MODE=$BUILD_MODE"
841 echo "THIRD_PARTY_PATH=$THIRD_PARTY_PATH"
842 echo "INSTALLATION_BUILD_DIR=$INSTALLATION_BUILD_DIR"
843 echo "PREFIX=$PREFIX"
844 echo "EXTRA_ARGS=$EXTRA_ARGS"
845 echo "GROUP=$GROUP"
846 echo "IO_PACKAGES=$IO_PACKAGES"
847 echo "MAKE_OPT_FLAGS=$MAKE_OPT_FLAGS"
848 echo "NO_VISIT=$NO_VISIT"
849 echo "SVN=$SVN"
850 echo "VISIT_SELECTED_DATABASE_PLUGINS=$VISIT_SELECTED_DATABASE_PLUGINS"
851 echo ""
852 echo "Login Node"
853 echo "==========="
854 echo "CC=$CC"
855 echo "C_OPT_FLAGS=$C_OPT_FLAGS"
856 echo "CXX=$CXX"
857 echo "CXX_OPT_FLAGS=$CXX_OPT_FLAGS"
858 echo ""
859 echo "Compute Node"
860 echo "============="
861 echo "BG_CC=$BG_CC"
862 echo "BG_C_OPT_FLAGS=$BG_C_OPT_FLAGS"
863 echo "BG_CXX=$BG_CXX"
864 echo "BG_CXX_OPT_FLAGS=$BG_CXX_OPT_FLAGS"
865 echo ""
866 echo "BG_GNU_CC=$BG_GNU_CC"
867 echo "BG_GNU_CXX=$BG_GNU_CXX"
868 echo ""
869 echo "BG_MPI_CC=$BG_MPI_CC"
870 echo "BG_MPI_C_OPT_FLAGS=$BG_MPI_C_OPT_FLAGS"
871 echo "BG_MPI_CXX=$BG_MPI_CXX"
872 echo "BG_MPI_CXX_OPT_FLAGS=$BG_MPI_CXX_OPT_FLAGS"
873 echo "========================================================================"
874
875 return 0
876}
877
878function usage
879{
880 echo "Usage: build_visit_BGQ [arguments]"
881 echo ""
882 echo "This script builds statically-linked VisIt server components for BlueGene-Q "
883 echo "computers. The parallel compute engine is built for the compute nodes and the"
884 echo "mdserver, vcl, and engine_ser components are built for the login nodes."
885 echo ""
886 echo "Argument Description"
887 echo "============================= =========================================================="
888 echo "--database-plugins list A list of database plugins to build (e.g. Curve2D;Silo)"
889 echo "--installation-build-dir dir The build directory to be used to build the code."
890 echo "--thirdparty-path path The directory where 3rd party libraries will be installed."
891 echo "--build-mode mode The build mode: Debug or Release"
892 echo "--group group Set the group for installed 3rd party libraries."
893 echo "-h/--help Print the help and exit."
894 echo "--print Print the variables that will be used for the build."
895 echo "--makeflags flags Build the code, passing flags to make."
896 echo "--no-compute Do not build the compute node version."
897 echo "--no-login Do not build the login node version."
898 echo "--no-visit Do not build the VisIt sources."
899 echo "--svn Download sources from svn."
900 echo "--svn-anonymous Download sources from anonymous svn."
901 echo ""
902 echo "Login Node"
903 echo "==========="
904 echo "--cc path The C compiler to use for login node compilation."
905 echo "--cflag flag Append a flag to the CFLAGS used with the --cc compiler."
906 echo "--cflags flags Set the CFLAGS used with the --cc compiler."
907 echo "--cxx path The C++ compiler to use for login node compilation."
908 echo "--cxxflag flag Append a flag to the CXXFLAGS used with the --cxx compiler."
909 echo "--cxxflags flags Set the CXXFLAGS used with the --cxx compiler."
910 echo ""
911 echo ""
912 echo "Compute Node"
913 echo "============="
914 echo "--bgcc path The serial C compiler to use for compute node compilation."
915 echo "--bgcflag flag Append a flag to the CFLAGS used with the --bgcc/--bggnucc compilers."
916 echo "--bgcflags flags Set the CFLAGS used with the --bgcc/--bggnucc compilers."
917 echo "--bgcxx path The serial C++ compiler to use for compute node compilation."
918 echo "--bgcxxflag flag Append a flag to the CXXFLAGS used with the --bgcxx/--bggnucxx compilers."
919 echo "--bgcxxflags flags Set the CXXFLAGS used with the --bgcxx/--bggnucxx compilers."
920 echo ""
921 echo "--bggnucc path The serial GNU C compiler to use for compute node compilation."
922 echo " This compiler is used for 3rd party packages that have autoconf"
923 echo " build systems: Mesa, Silo, ... The CFLAGS specified using "
924 echo " --bgcflag/--bgcflags are used."
925 echo "--bggnucxx path The serial GNU C++ compiler to use for compute node compilation."
926 echo " The CXXFLAGS specified using --bgcxxflag/--bgcxxflags are used."
927 echo
928 echo "--bgmpicc path The parallel C compiler to use for compute node compilation."
929 echo "--bgmpicflag flag Append a flag to the CFLAGS used with the --bgmpicc compiler."
930 echo "--bgmpicflags flags Set the CFLAGS used with the --bgmpicc compiler."
931 echo "--bgmpicxx path The parallel C++ compiler to use for compute node compilation."
932 echo "--bgmpicxxflag flag Append a flag to the CXXFLAGS used with the --bgmpicxx compiler."
933 echo "--bgmpicxxflags flags Set the CXXFLAGS used with the --bgmpicxx compiler."
934
935 return 0
936}
937
938function main
939{
940 DO_COMPUTE="yes"
941 DO_LOGIN="yes"
942 next_action=""
943 next_arg=""
944 for arg in "$@" ; do
945 # Was the last option something that took an argument?
946 if test -n "$next_arg" ; then
947 # Yep. Which option was it?
948 case $next_arg in
949 installation-build-dir) INSTALLATION_BUILD_DIR="$arg";;
950 build-mode) BUILD_MODE="${arg}";;
951
952 append-cflags) C_OPT_FLAGS="${C_OPT_FLAGS} ${arg}";;
953 append-cxxflags) CXX_OPT_FLAGS="${CXX_OPT_FLAGS} ${arg}";;
954 cflags) C_OPT_FLAGS="${arg}";;
955 cxxflags) CXX_OPT_FLAGS="${arg}";;
956 cc) CC="${arg}";;
957 cxx) CXX="${arg}";;
958
959 append-bgcflags) BG_C_OPT_FLAGS="${BG_C_OPT_FLAGS} ${arg}";;
960 append-bgcxxflags) BG_CXX_OPT_FLAGS="${BG_CXX_OPT_FLAGS} ${arg}";;
961 bgcflags) BG_C_OPT_FLAGS="${arg}";;
962 bgcxxflags) BG_CXX_OPT_FLAGS="${arg}";;
963 bgcc) BG_CC="${arg}";;
964 bgcxx) BG_CXX="${arg}";;
965 bggnucc) BG_GNU_CC="${arg}";;
966 bggnucxx) BG_GNU_CXX="${arg}";;
967
968 append-bgmpicflags) BG_MPI_C_OPT_FLAGS="${BG_MPI_C_OPT_FLAGS} ${arg}";;
969 append-bgmpicxxflags) BG_MPI_CXX_OPT_FLAGS="${BG_MPI_CXX_OPT_FLAGS} ${arg}";;
970 bgmpicflags) BG_MPI_C_OPT_FLAGS="${arg}";;
971 bgmpicxxflags) BG_MPI_CXX_OPT_FLAGS="${arg}";;
972 bgmpicc) BG_MPI_CC="${arg}";;
973 bgmpicxx) BG_MPI_CXX="${arg}";;
974
975 database-plugins) VISIT_SELECTED_DATABASE_PLUGINS="${arg}";;
976 group) GROUP="${arg}";;
977 makeflags) MAKE_OPT_FLAGS="${arg}";;
978 thirdparty-path) THIRD_PARTY_PATH="${arg}";;
979 *) error "Unknown next_arg value '$next_arg'!"
980 esac
981 # Make sure we process the next option as an option and not an
982 # argument to an option.
983 next_arg=""
984 continue
985 fi
986 case $arg in
987 --installation-build-dir) next_arg="installation-build-dir";;
988 --build-mode) next_arg="build-mode";;
989
990 --cflag) next_arg="append-cflags";;
991 --cflags) next_arg="cflags";;
992 --cxxflag) next_arg="append-cxxflags";;
993 --cxxflags) next_arg="cxxflags";;
994 --cc) next_arg="cc";;
995 --cxx) next_arg="cxx";;
996
997 --bgcflag) next_arg="append-bgcflags";;
998 --bgcflags) next_arg="bgcflags";;
999 --bgcxxflag) next_arg="append-bgcxxflags";;
1000 --bgcxxflags) next_arg="bgcxxflags";;
1001 --bgcc) next_arg="bgcc";;
1002 --bgcxx) next_arg="bgcxx";;
1003 --bggnucc) next_arg="bggnucc";;
1004 --bggnucxx) next_arg="bggnucxx";;
1005
1006 --bgmpicflag) next_arg="append-bgmpicflags";;
1007 --bgmpicflags) next_arg="bgmpicflags";;
1008 --bgmpicxxflag) next_arg="append-bgmpicxxflags";;
1009 --bgmpicxxflags) next_arg="bgmpicxxflags";;
1010 --bgmpicc) next_arg="bgmpicc";;
1011 --bgmpicxx) next_arg="bgmpicxx";;
1012
1013 --database-plugins) next_arg="database-plugins";;
1014 --group) next_arg="group";;
1015 -h|--help) next_action="help";;
1016 --print) next_action="printvars";;
1017 --makeflags) next_arg="makeflags";;
1018 --no-compute) DO_COMPUTE="";;
1019 --no-login) DO_LOGIN="";;
1020 --no-visit) NO_VISIT="--no-visit";;
1021 --svn) SVN="--svn" ; DO_SVN="yes" ; TARBALL="";;
1022 --svn-anonymous) SVN="--svn-anonymous"; DO_SVN_ANON="yes" ; TARBALL="";;
1023 --thirdparty-path) next_arg="thirdparty-path";;
1024 esac
1025 done
1026
1027 if test -n "${next_action}" ; then
1028 case ${next_action} in
1029 printvars) printvars; exit 2;;
1030 help) usage; exit 2;;
1031 esac
1032 fi
1033
1034 # Print the settings we're using for the build
1035 printvars
1036
1037 # Make build directories.
1038 if ! test -d $INSTALLATION_BUILD_DIR ; then
1039 mkdir $INSTALLATION_BUILD_DIR
1040
1041 fi
1042 if ! test -d ${INSTALLATION_BUILD_DIR}_BGQ ; then
1043 mkdir ${INSTALLATION_BUILD_DIR}_BGQ
1044 fi
1045
1046 # Make an installation directory.
1047 if ! test -d $THIRD_PARTY_PATH ; then
1048 mkdir $THIRD_PARTY_PATH
1049 else
1050 echo "$THIRD_PARTY_PATH already exists."
1051 fi
1052
1053 if test "${SVN}" == "" && test "${NO_VISIT}" == "" ; then
1054 # We're building VisIt from a local source file (not svn) so check that
1055 # the file is present at the level of the build_visit_BGQ script.
1056 # If we find it then we'll copy it into the installation build dirs so
1057 # the build_visit scripts will locate it.
1058 if ! test -e visit${VISIT_VERSION}.tar.gz ; then
1059 error "VisIt source file visit${VISIT_VERSION}.tar.gz not found in $PWD. Exiting."
1060 exit 3
1061 fi
1062
1063 # Copy local source file into installation build dirs if it's not there.
1064 if ! test -e $INSTALLATION_BUILD_DIR/visit${VISIT_VERSION}.tar.gz ; then
1065 cp visit${VISIT_VERSION}.tar.gz $INSTALLATION_BUILD_DIR
1066 fi
1067 if ! test -e ${INSTALLATION_BUILD_DIR}_BGQ/visit${VISIT_VERSION}.tar.gz ; then
1068 cp visit${VISIT_VERSION}.tar.gz ${INSTALLATION_BUILD_DIR}_BGQ
1069 fi
1070 fi
1071
1072 # We build cmake specially so we can share the build between the login
1073 # node and compute node build stages.
1074 build_cmake
1075
1076 # We build the compute node version first.
1077 if test -n "${DO_COMPUTE}" ; then
1078 build_for_compute_node
1079 if [[ $? != 0 ]] ; then
1080 warn "Compute node build failed. Giving up"
1081 exit 4
1082 fi
1083 fi
1084
1085 # Now build for the login node so the engine_ser for the login node will
1086 # overwrite the compute node's version that was previously installed.
1087 if test -n "${DO_LOGIN}" ; then
1088 build_for_login_node
1089 if [[ $? != 0 ]] ; then
1090 warn "Login node build failed. Giving up"
1091 exit 5
1092 fi
1093 fi
1094
1095 # We installed VisIt so tar up the binary distribution since it contains
1096 # binaries for both the login nodes and the compute nodes.
1097 if test "$NO_VISIT" = "" ; then
1098 VV=$(echo ${VISIT_VERSION} | tr "." "_")
1099 tar zcf visit${VV}.${PREFIXARCH}.tar.gz ${PREFIXARCH}
1100 fi
1101
1102 return 0
1103}
1104
1105main "$@"
1106exit 0