Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmake fixes #1062

Merged
merged 10 commits into from Feb 23, 2015
1 change: 0 additions & 1 deletion CMake/cdat_modules/pyqt_deps.cmake
@@ -1,2 +1 @@
message("SIP: ${sip_pkg}")
set(PyQt_deps ${pkgconfig_pkg} ${qt_pkg} ${sip_pkg} ${python_pkg})
3 changes: 0 additions & 3 deletions CMake/cdat_modules/pyqt_external.cmake
@@ -1,7 +1,4 @@
# PyQt
#
set(PyQt_source "${CMAKE_CURRENT_BINARY_DIR}/build/PyQt")
message("[INFO] Using environment PYTHONPATH \"$ENV{PYTHONPATH}\"")
set(PyQt_configure_command
env PYTHONPATH=${PYTHONPATH}
"${PYTHON_EXECUTABLE}" configure.py
Expand Down
3 changes: 0 additions & 3 deletions CMake/cdat_modules/sip_pkg.cmake
@@ -1,4 +1,3 @@
message("SIPPING ...")
set(SIP_MAJOR 4)
set(SIP_MINOR 12)
set(SIP_PATCH 1)
Expand All @@ -12,6 +11,4 @@ set(SIP_GZ sip-${SIP_MAJOR_SRC}.${SIP_MINOR_SRC}.${SIP_PATCH_SRC}.tar.gz)
set(SIP_MD5 a9840670a064dbf8f63a8f653776fec9 )
set(SIP_SOURCE ${SIP_URL}/${SIP_GZ})


add_cdat_package_dependent(SIP "" "" OFF "CDAT_BUILD_GUI" OFF)
message("name: ${sip_pkg}")
2 changes: 1 addition & 1 deletion CMake/cdat_modules/uvcmetrics_external.cmake
Expand Up @@ -12,7 +12,7 @@ execute_process(
)

if (NOT ${res} EQUAL 0)
message("Couldn't fetch test files for uvcmetrics package, tests will fail")
message("[INFO] Failed to fetch test data for uvcmetrics, tests will fail")
endif()

set(GIT_CMD_STR GIT_REPOSITORY "${UVCMETRICS_SOURCE}")
Expand Down
8 changes: 3 additions & 5 deletions CMake/cdat_modules/vistrails_external.cmake
Expand Up @@ -26,12 +26,8 @@ if (NOT _branch STREQUAL "${refspec}")
elseif(_url MATCHES "^.*uvcdat-devel.git")
set(vistrails_branch uvcdat-next)
endif()
else()
message(WARNING "Unable to extract url for '${_remote}' using default VisTrails branch")
endif()
else()
message(WARNING "Unable to extract remote for '${_branch}' using default VisTrails branch")
endif()
endif()
else()
message(WARNING "Unable to branch from '${refspec}' using default VisTrails branch")
endif()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove that one it was kind of nice to know it couldn't get the desired branch

Expand All @@ -40,6 +36,8 @@ if("${refspec}" STREQUAL "refs/heads/devel-master")
set(vistrails_branch uvcdat-next)
endif()

message("[INFO] Using vistrails branch: ${vistrails_branch}")

set(vistrails_tag_point_message "Specify branch of vistrails to be used for UVCDAT")
set(VISTRAILS_TAG_POINT ${vistrails_branch} CACHE STRING "${vistrails_tag_point_message}")
set(vistrails_url "${VISTRAILS_SOURCE}")
Expand Down
12 changes: 0 additions & 12 deletions CMake/cdat_modules_extra/cdat_common_environment.cmake.in
Expand Up @@ -17,18 +17,6 @@ set(ENV{FLIBS} "")
set(ENV{LD_X11} "") # for xgks
set(ENV{PYTHONPATH} @PYTHONPATH@)

if (DEFINED ENV{UVCDAT_ANONYMOUS_LOG})
if (($ENV{UVCDAT_ANONYMOUS_LOG} STREQUAL "True") OR ($ENV{UVCDAT_ANONYMOUS_LOG} STREQUAL "False"))
message("[INFO] Using UVCDAT_ANONYMOUS_LOG found in environment which is set to: '$ENV{UVCDAT_ANONYMOUS_LOG}'")
else()
message("[INFO] Found UVCDAT_ANONYMOUS_LOG in environment which is set to: '$ENV{UVCDAT_ANONYMOUS_LOG}'")
message("[INFO] Valid values are 'True' or 'False' resetting to: 'True'")
set(ENV{UVCDAT_ANONYMOUS_LOG} "True")
endif()
else()
set(ENV{UVCDAT_ANONYMOUS_LOG} "True")
endif()

if(APPLE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That block is needed I think it will hang if you don't have a .uvcdat directory

set(ENV{MAC_OSX_DEPLOYMENT_TARGET} "@CMAKE_OSX_DEPLOYMENT_TARGET@")
endif()
Expand Down
1 change: 0 additions & 1 deletion CMake/cmake_modules/FindMpi4py.cmake
@@ -1,7 +1,6 @@
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import mpi4py" RESULT_VARIABLE res OUTPUT_VARIABLE out ERROR_VARIABLE err)

if ( NOT ${res} EQUAL 0 )
message("[INFO] Could not system mpi4py, ${PYTHON_EXECUTABLE}")
set( Mpi4py_FOUND 0 )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove these warmings?

else ( NOT ${res} EQUAL 0 )
execute_process(COMMAND "@PYTHON_EXECUTABLE@" -c "import mpi4py;print mpi4py.__version__" RESULT_VARIABLE res OUTPUT_VARIABLE out ERROR_VARIABLE err)
Expand Down
1 change: 0 additions & 1 deletion CMake/cmake_modules/FindShapely.cmake
@@ -1,7 +1,6 @@
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import shapely" RESULT_VARIABLE res OUTPUT_VARIABLE out ERROR_VARIABLE err)

if ( NOT ${res} EQUAL 0 )
message("Could not detect shapely, ${PYTHON_EXECUTABLE}")
set( Shapely_FOUND 0 )
else ( NOT ${res} EQUAL 0 )
execute_process(COMMAND "@PYTHON_EXECUTABLE@" -c "import shapely;print shapely.__version__" RESULT_VARIABLE res OUTPUT_VARIABLE out ERROR_VARIABLE err)
Expand Down
6 changes: 2 additions & 4 deletions CMake/cmake_modules/pipinstaller.cmake
Expand Up @@ -11,20 +11,18 @@ else()
endif()

if(DEFINED GIT_CMD_STR )
message([INFO] getting ${nm} from git repo: ${GIT_CMD_STR})
message("[INFO] [PIP] Installing ${nm} from ${GIT_CMD_STR}")
include(GetGitRevisionDescription)
set(URL_STR )
set(URL_MD5_STR )
else()
message([INFO] getting ${nm} from tarball)
message("[INFO] [PIP] Installing ${nm} from tarball")
set(URL_STR URL ${${uc_nm}_SOURCE})
set(URL_MD5_STR URL_MD5 ${${uc_nm}_MD5})
set(GIT_CMD_STR )
set(GIT_TAG )
endif()

message([INFO] URL STRING IS: ${URL_STR})

ExternalProject_Add(${nm}
DOWNLOAD_DIR ${CDAT_PACKAGE_CACHE_DIR}
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/build/${nm}
Expand Down
88 changes: 43 additions & 45 deletions CMakeLists.txt
@@ -1,15 +1,16 @@
#=============================================================================
cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)

if ("${CMAKE_VERSION}" VERSION_LESS "2.8.12")
message(WARNING "Your CMake version is ${CMAKE_VERSION} which is depreciated for UV-CDAT. The recommended minimum CMake version is 2.8.12. Using older versions can result in build errors particularly with Xcode 5")
endif()

# Project name and initial checks
#-----------------------------------------------------------------------------
#=============================================================================
project(cdat)

# Set cdat and cmake variables
#-----------------------------------------------------------------------------
# Set various variables
#=============================================================================
set(LLNL_URL http://uv-cdat.llnl.gov/cdat/resources)
set(cdat_CMAKE_SOURCE_DIR ${cdat_SOURCE_DIR}/CMake)
set(cdat_CMAKE_BINARY_DIR ${cdat_BINARY_DIR}/CMake)
Expand All @@ -36,8 +37,21 @@ set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
)

if (DEFINED ENV{UVCDAT_ANONYMOUS_LOG})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok I see you put it back here

if (($ENV{UVCDAT_ANONYMOUS_LOG} STREQUAL "True") OR
($ENV{UVCDAT_ANONYMOUS_LOG} STREQUAL "False"))
message("[INFO] Using UVCDAT_ANONYMOUS_LOG found in environment which is set to: '$ENV{UVCDAT_ANONYMOUS_LOG}'")
else()
message("[INFO] Found UVCDAT_ANONYMOUS_LOG in environment which is set to: '$ENV{UVCDAT_ANONYMOUS_LOG}'")
message("[INFO] Valid values are 'True' or 'False' resetting to: 'True'")
set(ENV{UVCDAT_ANONYMOUS_LOG} "True")
endif()
else()
set(ENV{UVCDAT_ANONYMOUS_LOG} "True")
endif()

# Disable in source build of any kind.
#-----------------------------------------------------------------------------
#=============================================================================
include(CheckBuildOutOfSource)
check_build_out_of_source("${cdat_SOURCE_DIR}" "${cdat_BINARY_DIR}"
BUILDINSOURCE)
Expand All @@ -48,15 +62,15 @@ if(BUILDINSOURCE)
endif()

# Include useful cmake scripts
#-----------------------------------------------------------------------------
#=============================================================================
include(cmake_utils)
include(check_fortran)
include(CTest)

# Set up the test data. If UVCDAT_USE_SYSTEM_TESTDATA is ON and UVCDAT_TESTDATA
# is not set then we won't use it for testing. Otherwise we'll test either
# with the system test data or download it ourselves.
#-----------------------------------------------------------------------------
#=============================================================================
if (BUILD_TESTING)
set(UVCDAT_USE_SYSTEM_TESTDATA ON CACHE BOOL "Use UV-CDAT's test data from the system")
if(UVCDAT_USE_SYSTEM_TESTDATA)
Expand Down Expand Up @@ -121,7 +135,7 @@ if(APPLE)
endif()

# Setup git and related options
#-----------------------------------------------------------------------------
#=============================================================================
find_package(Git)

if(NOT GIT_PROTOCOL)
Expand All @@ -146,7 +160,7 @@ if(NOT GIT_PROTOCOL)
endif()

set(GIT_PROTOCOL ${temp_git_protocol} CACHE STRING "Choose protocol to be used by git" FORCE)
set_property(CACHE GIT_PROTOCOL PROPERTY STRINGS "git://" "http://")
set_property(CACHE GIT_PROTOCOL PROPERTY STRINGS "git://" "http://" "https://")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

endif()

if(GIT_PROTOCOL MATCHES "http://")
Expand Down Expand Up @@ -194,6 +208,7 @@ else()
endif()

# Checkout the baseline repository.
#=============================================================================
if(BUILD_TESTING)
set(UVCDAT_GIT_TESTDATA_DIR "${CMAKE_BINARY_DIR}/uvcdat-testdata/"
CACHE PATH "Directory to store supplemental testing data (Baselines, etc).")
Expand All @@ -214,44 +229,25 @@ if(BUILD_TESTING)
)
endif()

# Initialize submodules
#-----------------------------------------------------------------------------
# C. Doutriaux commented this out no submodules left at this time
#if(GIT_FOUND)
# message("[INFO] Updating git submodules")
# execute_process(
# COMMAND ${GIT_EXECUTABLE} submodule init
# OUTPUT_VARIABLE subinit_out
# ERROR_VARIABLE subinit_err
# WORKING_DIRECTORY ${cdat_SOURCE_DIR}
# )
# execute_process(
# COMMAND ${GIT_EXECUTABLE} submodule update
# OUTPUT_VARIABLE subup_out
# ERROR_VARIABLE subup_err
# WORKING_DIRECTORY ${cdat_SOURCE_DIR}
# )
#endif()

# Check if system has fortran compiler and act accordingly
#-----------------------------------------------------------------------------
#=============================================================================
if(CMAKE_Fortran_COMPILER)
enable_language(Fortran)
set(CONFIG_SUMMARY ${cdat_BINARY_DIR}/logs/config.summary)
include(${CMAKE_ROOT}/Modules/CMakeDetermineFortranCompiler.cmake)
endif(CMAKE_Fortran_COMPILER)


# Set build related properties
#-----------------------------------------------------------------------------
#=============================================================================
set(PARTS_BUILT_INFO "${cdat_BINARY_DIR}/build_info.txt" CACHE STRING "File where to store build infos" FORCE)

## The following is to know if we are prepring for an offline installation
## ON is the default means we can download as we build
## PREP means with are using this machine as a proxy to download all needed files in order to move them (somehow) to the OFFLINE machine where build will happen
## OFF the machine has no internet access all files are suppposed to be here, pre-downloaded
option(OFFLINE_BUILD "Is there internet access, are we preping for it?" OFF)
# The following is to know if we are prepring for an offline installation
# ON is the default means we can download as we build
# PREP means with are using this machine as a proxy to download all needed
# files in order to move them (somehow) to the OFFLINE machine where build will happen
# OFF the machine has no internet access all files are suppposed to be here, pre-downloaded

option(OFFLINE_BUILD "Is there internet access, are we preping for it?" OFF)
option(CDAT_BUILD_PARALLEL "Build parallel components of CDAT" OFF)

# OSMesa/VTK aren't playing nicely on macs. Disabling for now.
Expand All @@ -274,7 +270,7 @@ option(CDAT_USE_SYSTEM_PYTHON "Use system Python" OFF)
set(CDAT_BUILD_LEAN OFF)
set(CDAT_BUILD_ALL OFF)

# Options
# Some more options
option(CDAT_BUILD_GUI "Builds GUI-based dependencies (Vistrails, ParaView, VisIt, R, etc.) " ON)
option(CDAT_BUILD_GRAPHICS "Build graphics-based dependencies (vcs, pyqt, Vistrails, ParaView, VisIt, R, etc.) " ON)
option(CDAT_BUILD_ESGF "Alias for CDAT_BUILD_LEAN" OFF)
Expand Down Expand Up @@ -356,6 +352,8 @@ set(ep_log_options
)
endif()

# Set compiler arguments
#=============================================================================
set(cdat_compiler_args
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
Expand Down Expand Up @@ -419,7 +417,7 @@ endif()
# Include external project now (we have our own modifications) and create
# required directories as often third party install systems do bad things
# when left to create them.
#-----------------------------------------------------------------------------
#=============================================================================
set(CDAT_PACKAGE_CACHE_DIR
# ${CMAKE_CURRENT_BINARY_DIR}/../cdat_dependencies"
"${CMAKE_CURRENT_BINARY_DIR}"
Expand All @@ -438,13 +436,13 @@ file(MAKE_DIRECTORY ${cdat_BINARY_DIR}/build)
file(MAKE_DIRECTORY ${cdat_BINARY_DIR}/sources)

# Configure cdat command files
#-----------------------------------------------------------------------------
#=============================================================================
set(cdat_configure_command ${CMAKE_COMMAND} -P ${cdat_CMAKE_BINARY_DIR}/cdat_configure_step.cmake)
set(cdat_make_command ${CMAKE_COMMAND} -P ${cdat_CMAKE_BINARY_DIR}/cdat_make_step.cmake)
set(cdat_install_command ${CMAKE_COMMAND} -P ${cdat_CMAKE_BINARY_DIR}/cdat_install_step.cmake)

# Include essential packages
#-----------------------------------------------------------------------------
#=============================================================================
set(external_packages)
set(found_system_include_dirs)
set(found_system_libraries)
Expand Down Expand Up @@ -560,7 +558,7 @@ if (CDAT_BUILD_GUI)
endif()

# Configure custom configure/build/install step files
#-----------------------------------------------------------------------------
#=============================================================================
configure_file(${cdat_CMAKE_SOURCE_DIR}/cdat_modules_extra/cdat_common_environment.cmake.in
${cdat_CMAKE_BINARY_DIR}/cdat_common_environment.cmake
@ONLY
Expand Down Expand Up @@ -602,9 +600,9 @@ configure_file(${cdat_CMAKE_SOURCE_DIR}/fix_install_name.py.in
)

# Now sort and include external packages
#-----------------------------------------------------------------------------
#=============================================================================
include(TopologicalSort)
message("[DEBUG] packages ${external_packages}")
message("[INFO] These are the packages that we will try to build: ${external_packages}")
foreach(package ${external_packages})
string(TOLOWER ${package} lc_package)
include("${lc_package}_deps")
Expand Down Expand Up @@ -632,8 +630,9 @@ foreach(package ${external_packages})
endif()
endforeach()
file(WRITE ${PARTS_BUILT_INFO} ${packages_info})

# Construct Include and Link variables
#-----------------------------------------------------------------------------
#=============================================================================
if(found_system_include_dirs)
list(REMOVE_DUPLICATES found_system_include_dirs)
list(REMOVE_ITEM found_system_include_dirs ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES} ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES})
Expand All @@ -657,11 +656,10 @@ message("[INFO] CDAT external link directories: ${cdat_external_link_directories
message("[INFO] WGET EXEC: ${WGET_EXECUTABLE}")

# Configure remaining files
#-----------------------------------------------------------------------------
#=============================================================================

# set candidate paths for setup_runtime scripts
# will be added to environment variables in reverse order
message("PARAVIEW VALS:${PARAVIEW_MAJOR}")
set(SETUP_LIBRARY_PATHS
"Externals/lib/paraview-${PARAVIEW_MAJOR}.${PARAVIEW_MINOR} "
"Externals/lib/R/lib "
Expand Down