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

Issue421 durack1 add seawater packages #1072

Merged
merged 7 commits into from
Feb 27, 2015
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMake/cdat_modules/gsw_deps.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(gsw_deps ${python_pkg} ${numpy_pkg})
24 changes: 24 additions & 0 deletions CMake/cdat_modules/gsw_external.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# gsw (Gibbs Seawater)
#
set(gsw_source_dir "${CMAKE_CURRENT_BINARY_DIR}/build/gsw")

configure_file(
"${cdat_CMAKE_SOURCE_DIR}/cdat_modules_extra/gsw_build_step.cmake.in"
"${cdat_CMAKE_BINARY_DIR}/gsw_build_step.cmake"
@ONLY
)

set(gsw_build_command ${CMAKE_COMMAND} -P ${cdat_CMAKE_BINARY_DIR}/gsw_build_step.cmake)

ExternalProject_Add(gsw
DOWNLOAD_DIR ${CDAT_PACKAGE_CACHE_DIR}
SOURCE_DIR ${gsw_source_dir}
URL ${GSW_URL}/${GSW_GZ}
URL_MD5 ${GSW_MD5}
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ""
BUILD_COMMAND ${gsw_build_command}
INSTALL_COMMAND ""
DEPENDS ${gsw_deps}
${ep_log_options}
)
18 changes: 18 additions & 0 deletions CMake/cdat_modules/gsw_pkg.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
set( GSW_MAJOR 3 )
set( GSW_MINOR 0 )
set( GSW_PATCH 3 )
set( GSW_VERSION ${GSW_MAJOR}.${GSW_MINOR}.${GSW_PATCH} )
set( GSW_URL ${LLNL_URL} )
set( GSW_GZ python-gsw-${SEAWATER_VERSION}.tar.gz )
Copy link
Contributor

Choose a reason for hiding this comment

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

This won't work. SEAWATER_VERSION is not set globally or in parent scope.

set( GSW_MD5 a522a9ab6ab41fb70064e0378e904ffd )

set (nm GSW)
string(TOUPPER ${nm} uc_nm)
set(${uc_nm}_VERSION ${${nm}_MAJOR}.${${nm}_MINOR}.${${nm}_PATCH})
set(GSW_SOURCE ${GSW_URL}/${GSW_GZ})

if (CDAT_BUILD_ALL)
add_cdat_package(gsw "" "" ON)
else()
add_cdat_package(gsw "" "" OFF)
endif()
1 change: 1 addition & 0 deletions CMake/cdat_modules/seawater_deps.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(seawater_deps ${python_pkg} ${numpy_pkg})
24 changes: 24 additions & 0 deletions CMake/cdat_modules/seawater_external.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# seawater
#
set(seawater_source_dir "${CMAKE_CURRENT_BINARY_DIR}/build/seawater")

configure_file(
"${cdat_CMAKE_SOURCE_DIR}/cdat_modules_extra/seawater_build_step.cmake.in"
"${cdat_CMAKE_BINARY_DIR}/seawater_build_step.cmake"
@ONLY
)

set(seawater_build_command ${CMAKE_COMMAND} -P ${cdat_CMAKE_BINARY_DIR}/seawater_build_step.cmake)

ExternalProject_Add(seawater
DOWNLOAD_DIR ${CDAT_PACKAGE_CACHE_DIR}
SOURCE_DIR ${seawater_source_dir}
URL ${SEAWATER_URL}/${SEAWATER_GZ}
URL_MD5 ${SEAWATER_MD5}
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ""
BUILD_COMMAND ${seawater_build_command}
INSTALL_COMMAND ""
DEPENDS ${seawater_deps}
${ep_log_options}
)
18 changes: 18 additions & 0 deletions CMake/cdat_modules/seawater_pkg.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
set( SEAWATER_MAJOR 3 )
set( SEAWATER_MINOR 3 )
set( SEAWATER_PATCH 2 )
set( SEAWATER_VERSION ${SEAWATER_MAJOR}.${SEAWATER_MINOR}.${SEAWATER_PATCH} )
set( SEAWATER_URL ${LLNL_URL} )
set( SEAWATER_GZ python-seawater-${SEAWATER_VERSION}.tar.gz )
set( SEAWATER_MD5 b23df1bbf3b96771aa9926dc851c4675 )

set (nm SEAWATER)
string(TOUPPER ${nm} uc_nm)
set(${uc_nm}_VERSION ${${nm}_MAJOR}.${${nm}_MINOR}.${${nm}_PATCH})
set(SEAWATER_SOURCE ${SEAWATER_URL}/${SEAWATER_GZ})

if (CDAT_BUILD_ALL)
add_cdat_package(seawater "" "" ON)
else()
add_cdat_package(seawater "" "" OFF)
endif()
6 changes: 6 additions & 0 deletions CMake/cdat_modules_extra/gsw_build_step.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include(@cdat_CMAKE_BINARY_DIR@/cdat_common_environment.cmake)

execute_process(
COMMAND "@PYTHON_EXECUTABLE@" setup.py install @PYTHON_EXTRA_PREFIX@
WORKING_DIRECTORY "@gsw_source_dir@"
)
6 changes: 6 additions & 0 deletions CMake/cdat_modules_extra/seawater_build_step.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include(@cdat_CMAKE_BINARY_DIR@/cdat_common_environment.cmake)

execute_process(
COMMAND "@PYTHON_EXECUTABLE@" setup.py install @PYTHON_EXTRA_PREFIX@
WORKING_DIRECTORY "@seawater_source_dir@"
)
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ include(ffmpeg_pkg)
include(g2clib_pkg)
include(gdal_pkg)
include(geos_pkg)
include(gsw_pkg)
include(gui_support_pkg)
include(h5py_pkg)
include(hdf5_pkg)
Expand Down Expand Up @@ -487,6 +488,7 @@ include(numpy_pkg)
include(mpi_pkg)
include(osmesa_pkg)
include(python_pkg)
include(seawater_pkg)
if (CDAT_BUILD_PARALLEL)
include(paraview_pkg)
else()
Expand Down