Commit 14effd80 authored by miller86's avatar miller86
Browse files

Added logic to fatally terminate cmake if unable to find all pieces for

a third party library.

Added option, IGNORE_THIRD_PARTY_LIB_PROBLEMS, to override this behavior. It
is OFF by default meaning cmake will terminate immediately upon encountering
a problem with a third party library.

Adjusted alstor regression test script to pass -DIGNORE_THIRD_PARTY_LIB_PROBLEMS:BOOL=ON
so testing will proceed past problems finding third party libraries.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@12072 18c085ea-50e0-402c-830e-de6fd14e8384
parent f9877a4c
......@@ -52,13 +52,10 @@ INCLUDE(${VISIT_SOURCE_DIR}/CMake/ThirdPartyInstallLibrary.cmake)
# x_LIB
# x_FOUND
#
# assumes headers are in ${x_DIR}/include
# assumes headers are in ${x_DIR}/${incextensiondir}
# assumes libs are in ${x_DIR}/${libextensiondir}
#
#
# NOTE: this macro does not FIND packages, but merely tranlates the passed
# parameters into the afore mentioned variables.
#
# pkg is the name used to specify the x_DIR (generally upper case name
# of pkg)
# libdirextension is the path beyond x_DIR where the libs may be found.
......@@ -67,139 +64,168 @@ INCLUDE(${VISIT_SOURCE_DIR}/CMake/ThirdPartyInstallLibrary.cmake)
#
# uses path specified by pkg_DIR as base path for the files
#
# Modfications:
# Mark C. Miller, Thu Jul 29 23:39:05 PDT 2010
# Adjusted to fail fatally when things cannot be found and to override
# this failure behavior with option IGNORE_THIRD_PARTY_LIB_PROBLEMS.
# Replaced multiple leves of indentation with inverted IF logic
# and early returns. Got rid of setup_lib_error variable. Output
# 'not requested' message if pkg was not specified by user. Tried
# to make status message for failure to find distinguishable in
# cmake output from other messages.
#
FUNCTION(SET_UP_THIRD_PARTY pkg libdirextension incdirextension libs)
MESSAGE(STATUS "Looking for ${pkg}")
UNSET(lib_setup_error)
SET(base_dir "${pkg}_DIR")
SET(base_dir_val "${${base_dir}}")
IF ("${base_dir}" AND EXISTS "${base_dir_val}")
SET(inc_dir_var "${pkg}_INCLUDE_DIR")
SET(lib_dir_var "${pkg}_LIBRARY_DIR")
SET(lib_var "${pkg}_LIB")
SET(tp_found "${pkg}_FOUND")
#
# Zero out lib names b/c they may be hanging around from a previous
# configure.
#
UNSET("${tp_found}")
SET("${lib_var}" "")
SET("${inc_dir_var}" "${base_dir_val}/${incdirextension}")
SET("${lib_dir_var}" "${base_dir_val}/${libdirextension}")
IF(NOT EXISTS ${${inc_dir_var}})
MESSAGE(SEND_ERROR "Include Directory for ${pkg} (${${inc_dir_var}}) does not exist.")
SET(lib_setup_error 1)
ENDIF(NOT EXISTS ${${inc_dir_var}})
IF(NOT EXISTS ${${lib_dir_var}})
MESSAGE(SEND_ERROR "Library Directory for ${pkg} (${${lib_dir_var}}) does not exist.")
SET(lib_setup_error 1)
ENDIF(NOT EXISTS ${${lib_dir_var}})
# If the inc and lib directories are different then attempt to
# install the include directory.
IF(NOT ${${inc_dir_var}} STREQUAL ${${lib_dir_var}})
THIRD_PARTY_INSTALL_INCLUDE(${pkg} ${${inc_dir_var}})
ENDIF(NOT ${${inc_dir_var}} STREQUAL ${${lib_dir_var}})
SET(all_libs ${libs})
FOREACH (X ${ARGN})
SET(all_libs ${all_libs} ${X})
ENDFOREACH (X ${ARGN})
FOREACH (X ${all_libs})
FIND_LIBRARY(full_lib_path ${X}
PATHS ${${lib_dir_var}}
NO_DEFAULT_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_CMAKE_PATH
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_SYSTEM_PATH)
IF(full_lib_path)
IF(NOT "${lib_dir_var}" STREQUAL "/usr/lib")
THIRD_PARTY_INSTALL_LIBRARY(${full_lib_path})
ENDIF(NOT "${lib_dir_var}" STREQUAL "/usr/lib")
GET_FILENAME_COMPONENT(alib ${full_lib_path} NAME)
LIST(APPEND "${lib_var}" ${alib})
MESSAGE(STATUS " Found library ${X} in ${${lib_dir_var}}")
ELSE(full_lib_path)
MESSAGE(SEND_ERROR "Library ${X} not found in ${${lib_dir_var}}")
SET(lib_setup_error 1)
ENDIF(full_lib_path)
UNSET(full_lib_path CACHE)
ENDFOREACH (X ${all_libs})
SET(lib_dep "${pkg}_LIBDEP")
IF(${lib_dep})
#
# This alternates between a reading path & a lib from ${pkg}_LIBDEP
#
SET(is_lib 1)
FOREACH (X ${${lib_dep}})
IF(${X})
SET(X_VALUE ${${X}})
ELSE(${X})
SET(X_VALUE ${X})
ENDIF(${X})
IF(is_lib)
SET(is_lib 0)
LIST(APPEND "${lib_dir_var}" ${X_VALUE})
SET(current_lib_dir ${X_VALUE})
ELSE(is_lib)
SET(is_lib 1)
FIND_LIBRARY(full_lib_path
NAMES ${X_VALUE}
PATHS ${current_lib_dir}
NO_DEFAULT_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_CMAKE_PATH
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_SYSTEM_PATH)
IF(full_lib_path)
IF(NOT "${current_lib_dir}" STREQUAL "/usr/lib")
THIRD_PARTY_INSTALL_LIBRARY(${full_lib_path})
ENDIF(NOT "${current_lib_dir}" STREQUAL "/usr/lib")
GET_FILENAME_COMPONENT(alib ${full_lib_path} NAME)
LIST(APPEND "${lib_var}" ${alib})
MESSAGE(STATUS " Found library ${X_VALUE} in ${current_lib_dir}")
ELSE(full_lib_path)
MESSAGE(SEND_ERROR "Library ${X_VALUE} not found in ${current_lib_dir}")
SET(lib_setup_error 1)
ENDIF(full_lib_path)
UNSET(full_lib_path CACHE)
ENDIF(is_lib)
ENDFOREACH (X ${${lib_dep}})
ELSEIF(${lib_dep})
MESSAGE("${lib_dep} not set")
ENDIF(${lib_dep})
IF(lib_setup_error)
MESSAGE(FATAL_ERROR "Error: Could not setup ${pkg} due to missing libraries or dependancies.")
UNSET(lib_setup_error CACHE)
ELSE(lib_setup_error)
# Cache final results
SET("${tp_found}" 1 CACHE BOOL "${pkg} library found" FORCE)
SET("${base_dir}" ${${base_dir}} CACHE PATH "${pkg} base directory" FORCE)
SET("${inc_dir_var}" ${${inc_dir_var}} CACHE PATH "${pkg} include directory" FORCE)
SET("${lib_dir_var}" ${${lib_dir_var}} CACHE PATH "${pkg} library directory" FORCE)
SET("${lib_var}" ${${lib_var}} CACHE STRING "${pkg} library" FORCE)
MARK_AS_ADVANCED("${tp_found}"
"${base_dir}"
"${inc_dir_var}"
"${lib_dir_var}"
"${lib_var}")
MESSAGE(STATUS "${pkg} found")
ENDIF(lib_setup_error)
ELSE ("${base_dir}" AND EXISTS "${base_dir_val}")
MESSAGE(STATUS "${pkg} not found")
ENDIF ("${base_dir}" AND EXISTS "${base_dir_val}")
# If this packaged wasn't requested, thats ok so just return.
IF ("${base_dir_val}" STREQUAL "")
MESSAGE(STATUS " ${pkg} not requested")
RETURN()
ENDIF ("${base_dir_val}" STREQUAL "")
# If base dir doesn't exist, we can't go further.
IF (NOT (EXISTS "${base_dir_val}"))
IF(IGNORE_THIRD_PARTY_LIB_PROBLEMS)
MESSAGE(STATUS "\n** \n** \n** Base Directory for ${pkg} ${base_dir_val} does not exist.\n**\n**")
ELSE(IGNORE_THIRD_PARTY_LIB_PROBLEMS)
MESSAGE(FATAL_ERROR " Base Directory for ${pkg} ${base_dir_val} does not exist.")
ENDIF(IGNORE_THIRD_PARTY_LIB_PROBLEMS)
RETURN()
ENDIF (NOT (EXISTS "${base_dir_val}"))
SET(inc_dir_var "${pkg}_INCLUDE_DIR")
SET(lib_dir_var "${pkg}_LIBRARY_DIR")
SET(lib_var "${pkg}_LIB")
SET(tp_found "${pkg}_FOUND")
#
# Zero out lib names b/c they may be hanging around from a previous
# configure.
#
UNSET("${tp_found}")
SET("${lib_var}" "")
SET("${inc_dir_var}" "${base_dir_val}/${incdirextension}")
SET("${lib_dir_var}" "${base_dir_val}/${libdirextension}")
IF(NOT EXISTS ${${inc_dir_var}})
IF(IGNORE_THIRD_PARTY_LIB_PROBLEMS)
MESSAGE(STATUS "\n** \n** \n** Include Directory for ${pkg} (${${inc_dir_var}}) does not exist.\n**\n**")
ELSE(IGNORE_THIRD_PARTY_LIB_PROBLEMS)
MESSAGE(FATAL_ERROR " Include Directory for ${pkg} (${${inc_dir_var}}) does not exist.")
ENDIF(IGNORE_THIRD_PARTY_LIB_PROBLEMS)
RETURN()
ENDIF(NOT EXISTS ${${inc_dir_var}})
IF(NOT EXISTS ${${lib_dir_var}})
IF(IGNORE_THIRD_PARTY_LIB_PROBLEMS)
MESSAGE(STATUS "\n** \n** \n** Library Directory for ${pkg} (${${lib_dir_var}}) does not exist.\n**\n**")
ELSE(IGNORE_THIRD_PARTY_LIB_PROBLEMS)
MESSAGE(FATAL_ERROR " Library Directory for ${pkg} (${${lib_dir_var}}) does not exist.")
ENDIF(IGNORE_THIRD_PARTY_LIB_PROBLEMS)
RETURN()
ENDIF(NOT EXISTS ${${lib_dir_var}})
# If the inc and lib directories are different then attempt to
# install the include directory.
IF(NOT ${${inc_dir_var}} STREQUAL ${${lib_dir_var}})
THIRD_PARTY_INSTALL_INCLUDE(${pkg} ${${inc_dir_var}})
ENDIF(NOT ${${inc_dir_var}} STREQUAL ${${lib_dir_var}})
SET(all_libs ${libs})
FOREACH (X ${ARGN})
SET(all_libs ${all_libs} ${X})
ENDFOREACH (X ${ARGN})
FOREACH (X ${all_libs})
FIND_LIBRARY(full_lib_path ${X}
PATHS ${${lib_dir_var}}
NO_DEFAULT_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_CMAKE_PATH
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_SYSTEM_PATH)
IF(full_lib_path)
IF(NOT "${lib_dir_var}" STREQUAL "/usr/lib")
THIRD_PARTY_INSTALL_LIBRARY(${full_lib_path})
ENDIF(NOT "${lib_dir_var}" STREQUAL "/usr/lib")
GET_FILENAME_COMPONENT(alib ${full_lib_path} NAME)
LIST(APPEND "${lib_var}" ${alib})
MESSAGE(STATUS " Found library ${X} in ${${lib_dir_var}}")
ELSE(full_lib_path)
IF(IGNORE_THIRD_PARTY_LIB_PROBLEMS)
MESSAGE(STATUS "\n** \n** \n** Library ${X} not found in ${${lib_dir_var}}.\n**\n**")
ELSE(IGNORE_THIRD_PARTY_LIB_PROBLEMS)
MESSAGE(FATAL_ERROR "Library ${X} not found in ${${lib_dir_var}}")
ENDIF(IGNORE_THIRD_PARTY_LIB_PROBLEMS)
RETURN()
ENDIF(full_lib_path)
UNSET(full_lib_path CACHE)
ENDFOREACH (X ${all_libs})
SET(lib_dep "${pkg}_LIBDEP")
IF(NOT "${${lib_dep}}" STREQUAL "")
MESSAGE(STATUS " Looking for dependent libraries for ${pkg}")
ENDIF(NOT "${${lib_dep}}" STREQUAL "")
#
# This alternates between a reading path & a lib from ${pkg}_LIBDEP
#
SET(is_lib 1)
FOREACH (X ${${lib_dep}})
IF(${X})
SET(X_VALUE ${${X}})
ELSE(${X})
SET(X_VALUE ${X})
ENDIF(${X})
IF(is_lib)
SET(is_lib 0)
LIST(APPEND "${lib_dir_var}" ${X_VALUE})
SET(current_lib_dir ${X_VALUE})
ELSE(is_lib)
SET(is_lib 1)
FIND_LIBRARY(full_lib_path
NAMES ${X_VALUE}
PATHS ${current_lib_dir}
NO_DEFAULT_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_CMAKE_PATH
NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_SYSTEM_PATH)
IF(full_lib_path)
IF(NOT "${current_lib_dir}" STREQUAL "/usr/lib")
THIRD_PARTY_INSTALL_LIBRARY(${full_lib_path})
ENDIF(NOT "${current_lib_dir}" STREQUAL "/usr/lib")
GET_FILENAME_COMPONENT(alib ${full_lib_path} NAME)
LIST(APPEND "${lib_var}" ${alib})
MESSAGE(STATUS " Found library ${X_VALUE} in ${current_lib_dir}")
ELSE(full_lib_path)
IF(IGNORE_THIRD_PARTY_LIB_PROBLEMS)
MESSAGE(STATUS "\n** \n** \n** Library ${X_VALUE} not found in ${current_lib_dir}.\n**\n**")
ELSE(IGNORE_THIRD_PARTY_LIB_PROBLEMS)
MESSAGE(FATAL_ERROR " Library ${X_VALUE} not found in ${current_lib_dir}")
ENDIF(IGNORE_THIRD_PARTY_LIB_PROBLEMS)
RETURN()
ENDIF(full_lib_path)
UNSET(full_lib_path CACHE)
ENDIF(is_lib)
ENDFOREACH (X ${${lib_dep}})
# Cache final results
SET("${tp_found}" 1 CACHE BOOL "${pkg} library found" FORCE)
SET("${base_dir}" ${${base_dir}} CACHE PATH "${pkg} base directory" FORCE)
SET("${inc_dir_var}" ${${inc_dir_var}} CACHE PATH "${pkg} include directory" FORCE)
SET("${lib_dir_var}" ${${lib_dir_var}} CACHE PATH "${pkg} library directory" FORCE)
SET("${lib_var}" ${${lib_var}} CACHE STRING "${pkg} library" FORCE)
MARK_AS_ADVANCED("${tp_found}"
"${base_dir}"
"${inc_dir_var}"
"${lib_dir_var}"
"${lib_var}")
MESSAGE(STATUS " ${pkg} found")
ENDFUNCTION(SET_UP_THIRD_PARTY)
......@@ -137,6 +137,10 @@
# Mark C. Miller, Thu Jul 29 17:36:48 PDT 2010
# Added logic to include compiler version information as a comment int
# The PluginVsInstall.cmake file.
#
# Mark C. Miller, Thu Jul 29 23:43:52 PDT 2010
# Added option to ignore problems finding third party libs. It is OFF
# by default.
#****************************************************************************/
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
......@@ -271,6 +275,8 @@ OPTION(VISIT_RPATH_RELATIVE_TO_EXECUTABLE_PATH "Install rpath relative to execut
OPTION(VISIT_FORTRAN "Enable compilation of Fortran example progams" OFF)
OPTION(VISIT_DATA_MANUAL_EXAMPLES "Build Getting Data Into VisIt examples" OFF)
OPTION(IGNORE_THIRD_PARTY_LIB_PROBLEMS "Ignore problems finding requested third party libraries")
MACRO(VISIT_3RDPARTY_VAR vvar comment libvar)
# Create a path variable
......
#!/bin/sh
#
# Modifications:
# Mark C. Miller, Thu Jul 29 23:35:19 PDT 2010
# Added option to ignore third party lib problems to cmake invokation.
#
# Determine the users name and e-mail address.
......@@ -171,7 +175,7 @@ ln -s yana1.cmake config-site/\`hostname\`.cmake
if test "$serial" = "true" ; then
sed -i "s/VISIT_PARALLEL ON/VISIT_PARALLEL OFF/" config-site/yana1.cmake
fi
/usr/gapps/visit/cmake/2.8.0/linux-x86_64_gcc-4.1/bin/cmake . -DCMAKE_BUILD_TYPE=Release -DVISIT_BUILD_ALL_PLUGINS=1 >> ../buildlog 2>&1
/usr/gapps/visit/cmake/2.8.0/linux-x86_64_gcc-4.1/bin/cmake . -DCMAKE_BUILD_TYPE=Release -DVISIT_BUILD_ALL_PLUGINS=1 -DIGNORE_THIRD_PARTY_LIB_PROBLEMS:BOOL=ON >> ../buildlog 2>&1
make -j 12 >> ../buildlog 2>&1
if test "$debug" = "true" ; then
echo "Source build completed at: \`date\`" | mail -s "Source build completed" $userEmail
......
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