Commit ec774f24 authored by allens's avatar allens
Browse files

added force flag for explicitly requesting a library, if mpich is requested...

added force flag for explicitly requesting a library, if mpich is requested parallel is set, and if optional libs (Uintah/Adios) are requested but parallel is not set they will not be built.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@23385 18c085ea-50e0-402c-830e-de6fd14e8384
parent 14096e3a
function bv_adios_initialize function bv_adios_initialize
{ {
export DO_ADIOS="no" export FORCE_ADIOS="no"
export ON_ADIOS="off" export DO_ADIOS="no"
export ON_ADIOS="off"
export USE_SYSTEM_ADIOS="no"
add_extra_commandline_args "adios" "alt-adios-dir" 1 "Use alternative directory for adios"
} }
function bv_adios_enable function bv_adios_enable
{ {
DO_ADIOS="yes" if [[ "$1" == "force" ]]; then
ON_ADIOS="on" FORCE_ADIOS="yes"
#TODO: temporary until I get dependencies working fi
DO_MXML="yes"
ON_MXML="on" DO_ADIOS="yes"
ON_ADIOS="on"
} }
function bv_adios_disable function bv_adios_disable
{ {
DO_ADIOS="no" DO_ADIOS="no"
ON_ADIOS="off" ON_ADIOS="off"
}
function bv_adios_alt_adios_dir
{
echo "Using alternate Adios directory"
# Check to make sure the directory or a particular include file exists.
# [ ! -e "$1" ] && error "Adios not found in $1"
bv_adios_enable
USE_SYSTEM_ADIOS="yes"
ADIOS_INSTALL_DIR="$1"
} }
function bv_adios_depends_on function bv_adios_depends_on
{ {
echo "mxml" if [[ "$USE_SYSTEM_ADIOS" == "yes" ]]; then
echo ""
else
echo "mxml"
fi
}
function bv_adios_initialize_vars
{
if [[ "$FORCE_ADIOS" == "no" && "$parallel" == "no" ]]; then
bv_adios_disable
warn "Adios requested by default but the parallel flag has not been set. Adios will not be built."
return
fi
if [[ "$USE_SYSTEM_ADIOS" == "no" ]]; then
ADIOS_INSTALL_DIR="${VISITDIR}/adios/$ADIOS_VERSION/$VISITARCH"
fi
} }
function bv_adios_info function bv_adios_info
...@@ -63,16 +97,21 @@ function bv_adios_host_profile ...@@ -63,16 +97,21 @@ function bv_adios_host_profile
echo "## (configured w/ mpi compiler wrapper)" >> $HOSTCONF echo "## (configured w/ mpi compiler wrapper)" >> $HOSTCONF
fi fi
echo "##" >> $HOSTCONF echo "##" >> $HOSTCONF
echo \
"VISIT_OPTION_DEFAULT(VISIT_ADIOS_DIR \${VISITHOME}/ADIOS/$ADIOS_VERSION/\${VISITARCH})" \ if [[ "$USE_SYSTEM_ADIOS" == "yes" ]]; then
>> $HOSTCONF echo "VISIT_OPTION_DEFAULT(VISIT_ADIOS_DIR $ADIOS_INSTALL_DIR)" >> $HOSTCONF
else
echo \
"VISIT_OPTION_DEFAULT(VISIT_ADIOS_DIR \${VISITHOME}/adios/$ADIOS_VERSION/\${VISITARCH})" \
>> $HOSTCONF
fi
fi fi
} }
function bv_adios_ensure function bv_adios_ensure
{ {
if [[ "$DO_ADIOS" == "yes" ]] ; then if [[ "$DO_ADIOS" == "yes" && "$USE_SYSTEM_ADIOS" == "no" ]] ; then
ensure_built_or_ready "ADIOS" $ADIOS_VERSION $ADIOS_BUILD_DIR $ADIOS_FILE ensure_built_or_ready "adios" $ADIOS_VERSION $ADIOS_BUILD_DIR $ADIOS_FILE
if [[ $? != 0 ]] ; then if [[ $? != 0 ]] ; then
ANY_ERRORS="yes" ANY_ERRORS="yes"
DO_ADIOS="no" DO_ADIOS="no"
...@@ -116,14 +155,14 @@ function build_ADIOS ...@@ -116,14 +155,14 @@ function build_ADIOS
CC="$C_COMPILER" CFLAGS="$CFLAGS $C_OPT_FLAGS" CXXFLAGS="$CXXFLAGS $CXX_OPT_FLAGS" \ CC="$C_COMPILER" CFLAGS="$CFLAGS $C_OPT_FLAGS" CXXFLAGS="$CXXFLAGS $CXX_OPT_FLAGS" \
MPICC="$VISIT_MPI_COMPILER" \ MPICC="$VISIT_MPI_COMPILER" \
--disable-fortran \ --disable-fortran \
--without-netcdf --without-nc4par --without-hdf5 --without-phdf5 \ --without-netcdf --without-nc4par --without-hdf5 --without-phdf5 \
--with-mxml="$VISITDIR/mxml/$MXML_VERSION/$VISITARCH" \ --with-mxml="$VISITDIR/mxml/$MXML_VERSION/$VISITARCH" \
--prefix="$VISITDIR/ADIOS/$ADIOS_VERSION/$VISITARCH" --prefix="$VISITDIR/ADIOS/$ADIOS_VERSION/$VISITARCH"
else else
./configure ${OPTIONAL} CXX="$CXX_COMPILER" \ ./configure ${OPTIONAL} CXX="$CXX_COMPILER" \
CC="$C_COMPILER" CFLAGS="$CFLAGS $C_OPT_FLAGS" CXXFLAGS="$CXXFLAGS $CXX_OPT_FLAGS" \ CC="$C_COMPILER" CFLAGS="$CFLAGS $C_OPT_FLAGS" CXXFLAGS="$CXXFLAGS $CXX_OPT_FLAGS" \
--without-mpi --disable-fortran\ --without-mpi --disable-fortran\
--without-netcdf --without-nc4par --without-hdf5 --without-phdf5 \ --without-netcdf --without-nc4par --without-hdf5 --without-phdf5 \
--with-mxml="$VISITDIR/mxml/$MXML_VERSION/$VISITARCH" \ --with-mxml="$VISITDIR/mxml/$MXML_VERSION/$VISITARCH" \
--prefix="$VISITDIR/ADIOS/$ADIOS_VERSION/$VISITARCH" --prefix="$VISITDIR/ADIOS/$ADIOS_VERSION/$VISITARCH"
fi fi
...@@ -170,6 +209,10 @@ function bv_adios_is_enabled ...@@ -170,6 +209,10 @@ function bv_adios_is_enabled
function bv_adios_is_installed function bv_adios_is_installed
{ {
if [[ "$USE_SYSTEM_ADIOS" == "yes" ]]; then
return 1
fi
check_if_installed "ADIOS" $ADIOS_VERSION check_if_installed "ADIOS" $ADIOS_VERSION
if [[ $? == 0 ]] ; then if [[ $? == 0 ]] ; then
return 1 return 1
...@@ -180,22 +223,12 @@ function bv_adios_is_installed ...@@ -180,22 +223,12 @@ function bv_adios_is_installed
function bv_adios_build function bv_adios_build
{ {
cd "$START_DIR" cd "$START_DIR"
if [[ "$DO_ADIOS" == "yes" ]] ; then
if [[ "$DO_ADIOS" == "yes" && "$USE_SYSTEM_ADIOS" == "no" ]] ; then
check_if_installed "ADIOS" $ADIOS_VERSION check_if_installed "ADIOS" $ADIOS_VERSION
if [[ $? == 0 ]] ; then if [[ $? == 0 ]] ; then
info "Skipping ADIOS build. ADIOS is already installed." info "Skipping ADIOS build. ADIOS is already installed."
else else
check_if_installed "mxml" $MXML_VERSION
if [[ $? == 0 ]] ; then
info "Skipping build of MXML"
else
build_mxml
if [[ $? != 0 ]] ; then
error "Unable to build or install mxml. Bailing out."
fi
info "Done building mxml"
fi
info "Building ADIOS (~1 minutes)" info "Building ADIOS (~1 minutes)"
build_ADIOS build_ADIOS
if [[ $? != 0 ]] ; then if [[ $? != 0 ]] ; then
...@@ -205,4 +238,3 @@ if [[ "$DO_ADIOS" == "yes" ]] ; then ...@@ -205,4 +238,3 @@ if [[ "$DO_ADIOS" == "yes" ]] ; then
fi fi
fi fi
} }
...@@ -349,7 +349,6 @@ if [[ "$VISIT_FILE" != "" ]] ; then ...@@ -349,7 +349,6 @@ if [[ "$VISIT_FILE" != "" ]] ; then
fi fi
export VISIT_FILE=${VISIT_FILE:-"visit${VISIT_VERSION}.tar.gz"} export VISIT_FILE=${VISIT_FILE:-"visit${VISIT_VERSION}.tar.gz"}
for (( bv_i=0; bv_i<${#reqlibs[*]}; ++bv_i )) for (( bv_i=0; bv_i<${#reqlibs[*]}; ++bv_i ))
do do
initializeFunc="bv_${reqlibs[$bv_i]}_info" initializeFunc="bv_${reqlibs[$bv_i]}_info"
...@@ -836,7 +835,8 @@ for arg in "${arguments[@]}" ; do ...@@ -836,7 +835,8 @@ for arg in "${arguments[@]}" ; do
if [[ $? == 0 ]] ; then if [[ $? == 0 ]] ; then
#echo "enabling ${resolve_arg}" #echo "enabling ${resolve_arg}"
initializeFunc="bv_${resolve_arg}_enable" initializeFunc="bv_${resolve_arg}_enable"
$initializeFunc #argument is being explicitly set by the user so add a "force" flag
$initializeFunc force
continue continue
elif [[ ${#resolve_arg} -gt 3 ]] ; then #in case it is --no- elif [[ ${#resolve_arg} -gt 3 ]] ; then #in case it is --no-
resolve_arg_no_opt=${resolve_arg:3} resolve_arg_no_opt=${resolve_arg:3}
...@@ -1305,35 +1305,6 @@ if [[ $? != 0 ]] ; then ...@@ -1305,35 +1305,6 @@ if [[ $? != 0 ]] ; then
error "Stopping build because of bad variable option setting error." error "Stopping build because of bad variable option setting error."
fi fi
#
# See if the user wants to build a parallel version.
#
check_parallel
if [[ $? != 0 ]] ; then
error "Stopping build because necessary parallel options are not set."
fi
#
# See if the user wants to modify variables
#
check_variables
if [[ $? != 0 ]] ; then
error "Stopping build because of bad variable option setting error."
fi
if [[ $VISITARCH == "" ]] ; then
export VISITARCH=${ARCH}_${C_COMPILER}
if [[ "$CXX_COMPILER" == "g++" ]] ; then
VERSION=$(g++ -v 2>&1 | grep "gcc version" | cut -d' ' -f3 | cut -d'.' -f1-2)
if [[ ${#VERSION} == 3 ]] ; then
VISITARCH=${VISITARCH}-${VERSION}
fi
fi
fi
if [[ "$DO_ICET" == "yes" && "$PREVENT_ICET" != "yes" ]] ; then
DO_CMAKE="yes"
fi
# #
# Log build_visit invocation w/ arguments & the start time. # Log build_visit invocation w/ arguments & the start time.
# Especially helpful if there are multiple starts dumped into the # Especially helpful if there are multiple starts dumped into the
...@@ -1426,9 +1397,37 @@ if [[ "$DOWNLOAD_ONLY" == "no" ]] ; then ...@@ -1426,9 +1397,37 @@ if [[ "$DOWNLOAD_ONLY" == "no" ]] ; then
error "Unable to access the third party location. Bailing out." error "Unable to access the third party location. Bailing out."
fi fi
fi fi
if [[ $VISITARCH == "" ]] ; then
export VISITARCH=${ARCH}_${C_COMPILER}
if [[ "$CXX_COMPILER" == "g++" ]] ; then
VERSION=$(g++ -v 2>&1 | grep "gcc version" | cut -d' ' -f3 | cut -d'.' -f1-2)
if [[ ${#VERSION} == 3 ]] ; then
VISITARCH=${VISITARCH}-${VERSION}
fi
fi
fi
export VISITDIR=${VISITDIR:-$(pwd)} export VISITDIR=${VISITDIR:-$(pwd)}
cd "$START_DIR" cd "$START_DIR"
#
# See if the user wants to build a parallel version.
#
check_parallel
if [[ $? != 0 ]] ; then
error "Stopping build because necessary parallel options are not set."
fi
check_variables
if [[ $? != 0 ]] ; then
error "Stopping build because of bad variable option setting error."
fi
if [[ "$DO_ICET" == "yes" && "$PREVENT_ICET" != "yes" ]] ; then
DO_CMAKE="yes"
fi
#initialize module variables, since all of VisIt's variables should be set by now.. #initialize module variables, since all of VisIt's variables should be set by now..
initialize_module_variables initialize_module_variables
# #
...@@ -1504,4 +1503,3 @@ fi ...@@ -1504,4 +1503,3 @@ fi
#build visit itself.. #build visit itself..
bv_visit_build bv_visit_build
} }
function bv_uintah_initialize function bv_uintah_initialize
{ {
export FORCE_UINTAH="no"
export DO_UINTAH="no" export DO_UINTAH="no"
export ON_UINTAH="off" export ON_UINTAH="off"
export USE_SYSTEM_UINTAH="no" export USE_SYSTEM_UINTAH="no"
...@@ -8,18 +9,27 @@ add_extra_commandline_args "uintah" "alt-uintah-dir" 1 "Use alternative director ...@@ -8,18 +9,27 @@ add_extra_commandline_args "uintah" "alt-uintah-dir" 1 "Use alternative director
function bv_uintah_enable function bv_uintah_enable
{ {
DO_UINTAH="yes" if [[ "$1" == "force" ]]; then
ON_UINTAH="on" FORCE_UINTAH="yes"
fi
DO_UINTAH="yes"
ON_UINTAH="on"
} }
function bv_uintah_disable function bv_uintah_disable
{ {
DO_UINTAH="no" DO_UINTAH="no"
ON_UINTAH="off" ON_UINTAH="off"
} }
function bv_uintah_alt_uintah_dir function bv_uintah_alt_uintah_dir
{ {
echo "Using alternate Uintah directory"
# Check to make sure the directory or a particular include file exists.
[ ! -e "$1/../src/StandAlone/tools/uda2vis/udaData.h" ] && error "Uintah not found in $1"
bv_uintah_enable bv_uintah_enable
USE_SYSTEM_UINTAH="yes" USE_SYSTEM_UINTAH="yes"
UINTAH_INSTALL_DIR="$1" UINTAH_INSTALL_DIR="$1"
...@@ -29,11 +39,19 @@ function bv_uintah_depends_on ...@@ -29,11 +39,19 @@ function bv_uintah_depends_on
{ {
if [[ "$USE_SYSTEM_UINTAH" == "yes" ]]; then if [[ "$USE_SYSTEM_UINTAH" == "yes" ]]; then
echo "" echo ""
else
echo ""
fi fi
} }
function bv_uintah_initialize_vars function bv_uintah_initialize_vars
{ {
if [[ "$FORCE_UINTAH" == "no" && "$parallel" == "no" ]]; then
bv_uintah_disable
warn "Uintah requested by default but the parallel flag has not been set. Uintah will not be built."
return
fi
if [[ "$USE_SYSTEM_UINTAH" == "no" ]]; then if [[ "$USE_SYSTEM_UINTAH" == "no" ]]; then
UINTAH_INSTALL_DIR="${VISITDIR}/uintah/$UINTAH_VERSION/$VISITARCH" UINTAH_INSTALL_DIR="${VISITDIR}/uintah/$UINTAH_VERSION/$VISITARCH"
fi fi
...@@ -63,6 +81,7 @@ function bv_uintah_print ...@@ -63,6 +81,7 @@ function bv_uintah_print
function bv_uintah_print_usage function bv_uintah_print_usage
{ {
printf "%-15s %s [%s]\n" "--uintah" "Build UINTAH" "${DO_UINTAH}" printf "%-15s %s [%s]\n" "--uintah" "Build UINTAH" "${DO_UINTAH}"
printf "%-15s %s [%s]\n" "--alt-uintah-dir" "Use Uintah" "Use Uintah from alternative directory"
} }
function bv_uintah_graphical function bv_uintah_graphical
...@@ -81,7 +100,7 @@ function bv_uintah_host_profile ...@@ -81,7 +100,7 @@ function bv_uintah_host_profile
if [[ "$USE_SYSTEM_UINTAH" == "yes" ]]; then if [[ "$USE_SYSTEM_UINTAH" == "yes" ]]; then
echo "VISIT_OPTION_DEFAULT(VISIT_UINTAH_DIR $UINTAH_INSTALL_DIR)" >> $HOSTCONF echo "VISIT_OPTION_DEFAULT(VISIT_UINTAH_DIR $UINTAH_INSTALL_DIR)" >> $HOSTCONF
echo "SET(VISIT_USE_SYSTEM_UINTAH TRUE)" >> $HOSTCONF echo "SET(VISIT_USE_SYSTEM_UINTAH TRUE)" >> $HOSTCONF
else else
echo \ echo \
"VISIT_OPTION_DEFAULT(VISIT_UINTAH_DIR \${VISITHOME}/uintah/$UINTAH_VERSION/\${VISITARCH})" \ "VISIT_OPTION_DEFAULT(VISIT_UINTAH_DIR \${VISITHOME}/uintah/$UINTAH_VERSION/\${VISITARCH})" \
...@@ -307,7 +326,6 @@ function bv_uintah_is_enabled ...@@ -307,7 +326,6 @@ function bv_uintah_is_enabled
function bv_uintah_is_installed function bv_uintah_is_installed
{ {
if [[ "$USE_SYSTEM_UINTAH" == "yes" ]]; then if [[ "$USE_SYSTEM_UINTAH" == "yes" ]]; then
return 1 return 1
fi fi
......
...@@ -948,6 +948,10 @@ function check_parallel ...@@ -948,6 +948,10 @@ function check_parallel
{ {
rv=0 rv=0
if [[ "$DO_MPICH" == "yes" && "$parallel" == "no" ]] ; then
parallel="yes"
fi
# #
# Parallelization # Parallelization
# #
...@@ -986,7 +990,7 @@ function check_parallel ...@@ -986,7 +990,7 @@ function check_parallel
# #
# VisIt's cmake build can obtain all necessary MPI flags from # VisIt's cmake build can obtain all necessary MPI flags from
# a MPI compiler wrapper. If we have found one & the user # a MPI compiler wrapper. If we have found one & the user
# did not set PAR_LIBS or PAR_INCLUDE we are done. # did not set PAR_LIBS or PAR_INCLUDE we are done.
# #
if [[ "$PAR_INCLUDE" == "" && "$PAR_LIBS" == "" && "$MPIWRAPPER" != "" ]] ; then if [[ "$PAR_INCLUDE" == "" && "$PAR_LIBS" == "" && "$MPIWRAPPER" != "" ]] ; then
export VISIT_MPI_COMPILER=$MPIWRAPPER export VISIT_MPI_COMPILER=$MPIWRAPPER
...@@ -996,6 +1000,21 @@ function check_parallel ...@@ -996,6 +1000,21 @@ function check_parallel
return 0 return 0
fi fi
#
# VisIt's build_visit can obtain all necessary MPI flags from
# bv_mpich. If we are building mpich and the user
# did not set PAR_LIBS or PAR_INCLUDE we are done.
#
if [[ "$DO_MPICH" == "yes" && "$PAR_INCLUDE" == "" && "$PAR_LIBS" == "" && "$MPIWRAPPER" == "" ]] ; then
export MPICH_COMPILER="${VISITDIR}/mpich/$MPICH_VERSION/${VISITARCH}/bin/mpicc"
export VISIT_MPI_COMPILER="$MPICH_COMPILER"
export PAR_COMPILER="$MPICH_COMPILER"
info \
"Configuring with build mpich: $MPICH_COMPILER"
return 0
fi
# #
# If we have not found a MPI compiler wrapper. # If we have not found a MPI compiler wrapper.
# Keep trying to discover mpi setttings. # Keep trying to discover mpi setttings.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment