Skip to content

Commit 4065167

Browse files
committed
Merge pull request #1072 from durack1/issue421_durack1_AddSeawaterPackages
Issue421 durack1 add seawater packages
2 parents 08bb72a + d2ee6ec commit 4065167

9 files changed

Lines changed: 100 additions & 0 deletions

File tree

CMake/cdat_modules/gsw_deps.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
set(gsw_deps ${python_pkg} ${numpy_pkg})
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# gsw (Gibbs Seawater)
2+
#
3+
set(gsw_source_dir "${CMAKE_CURRENT_BINARY_DIR}/build/gsw")
4+
5+
configure_file(
6+
"${cdat_CMAKE_SOURCE_DIR}/cdat_modules_extra/gsw_build_step.cmake.in"
7+
"${cdat_CMAKE_BINARY_DIR}/gsw_build_step.cmake"
8+
@ONLY
9+
)
10+
11+
set(gsw_build_command ${CMAKE_COMMAND} -P ${cdat_CMAKE_BINARY_DIR}/gsw_build_step.cmake)
12+
13+
ExternalProject_Add(gsw
14+
DOWNLOAD_DIR ${CDAT_PACKAGE_CACHE_DIR}
15+
SOURCE_DIR ${gsw_source_dir}
16+
URL ${GSW_URL}/${GSW_GZ}
17+
URL_MD5 ${GSW_MD5}
18+
BUILD_IN_SOURCE 1
19+
CONFIGURE_COMMAND ""
20+
BUILD_COMMAND ${gsw_build_command}
21+
INSTALL_COMMAND ""
22+
DEPENDS ${gsw_deps}
23+
${ep_log_options}
24+
)

CMake/cdat_modules/gsw_pkg.cmake

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
set( GSW_MAJOR 3 )
2+
set( GSW_MINOR 0 )
3+
set( GSW_PATCH 3 )
4+
set( GSW_VERSION ${GSW_MAJOR}.${GSW_MINOR}.${GSW_PATCH} )
5+
set( GSW_URL ${LLNL_URL} )
6+
set( GSW_GZ python-gsw-${GSW_VERSION}.tar.gz )
7+
set( GSW_MD5 a522a9ab6ab41fb70064e0378e904ffd )
8+
9+
set (nm GSW)
10+
string(TOUPPER ${nm} uc_nm)
11+
set(${uc_nm}_VERSION ${${nm}_MAJOR}.${${nm}_MINOR}.${${nm}_PATCH})
12+
set(GSW_SOURCE ${GSW_URL}/${GSW_GZ})
13+
14+
if (CDAT_BUILD_ALL)
15+
add_cdat_package(gsw "" "" ON)
16+
else()
17+
add_cdat_package(gsw "" "" OFF)
18+
endif()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
set(seawater_deps ${python_pkg} ${numpy_pkg})
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# seawater
2+
#
3+
set(seawater_source_dir "${CMAKE_CURRENT_BINARY_DIR}/build/seawater")
4+
5+
configure_file(
6+
"${cdat_CMAKE_SOURCE_DIR}/cdat_modules_extra/seawater_build_step.cmake.in"
7+
"${cdat_CMAKE_BINARY_DIR}/seawater_build_step.cmake"
8+
@ONLY
9+
)
10+
11+
set(seawater_build_command ${CMAKE_COMMAND} -P ${cdat_CMAKE_BINARY_DIR}/seawater_build_step.cmake)
12+
13+
ExternalProject_Add(seawater
14+
DOWNLOAD_DIR ${CDAT_PACKAGE_CACHE_DIR}
15+
SOURCE_DIR ${seawater_source_dir}
16+
URL ${SEAWATER_URL}/${SEAWATER_GZ}
17+
URL_MD5 ${SEAWATER_MD5}
18+
BUILD_IN_SOURCE 1
19+
CONFIGURE_COMMAND ""
20+
BUILD_COMMAND ${seawater_build_command}
21+
INSTALL_COMMAND ""
22+
DEPENDS ${seawater_deps}
23+
${ep_log_options}
24+
)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
set( SEAWATER_MAJOR 3 )
2+
set( SEAWATER_MINOR 3 )
3+
set( SEAWATER_PATCH 2 )
4+
set( SEAWATER_VERSION ${SEAWATER_MAJOR}.${SEAWATER_MINOR}.${SEAWATER_PATCH} )
5+
set( SEAWATER_URL ${LLNL_URL} )
6+
set( SEAWATER_GZ python-seawater-${SEAWATER_VERSION}.tar.gz )
7+
set( SEAWATER_MD5 b23df1bbf3b96771aa9926dc851c4675 )
8+
9+
set (nm SEAWATER)
10+
string(TOUPPER ${nm} uc_nm)
11+
set(${uc_nm}_VERSION ${${nm}_MAJOR}.${${nm}_MINOR}.${${nm}_PATCH})
12+
set(SEAWATER_SOURCE ${SEAWATER_URL}/${SEAWATER_GZ})
13+
14+
if (CDAT_BUILD_ALL)
15+
add_cdat_package(seawater "" "" ON)
16+
else()
17+
add_cdat_package(seawater "" "" OFF)
18+
endif()
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
include(@cdat_CMAKE_BINARY_DIR@/cdat_common_environment.cmake)
2+
3+
execute_process(
4+
COMMAND "@PYTHON_EXECUTABLE@" setup.py install @PYTHON_EXTRA_PREFIX@
5+
WORKING_DIRECTORY "@gsw_source_dir@"
6+
)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
include(@cdat_CMAKE_BINARY_DIR@/cdat_common_environment.cmake)
2+
3+
execute_process(
4+
COMMAND "@PYTHON_EXECUTABLE@" setup.py install @PYTHON_EXTRA_PREFIX@
5+
WORKING_DIRECTORY "@seawater_source_dir@"
6+
)

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ include(ffmpeg_pkg)
458458
include(g2clib_pkg)
459459
include(gdal_pkg)
460460
include(geos_pkg)
461+
include(gsw_pkg)
461462
include(gui_support_pkg)
462463
include(h5py_pkg)
463464
include(hdf5_pkg)
@@ -487,6 +488,7 @@ include(numpy_pkg)
487488
include(mpi_pkg)
488489
include(osmesa_pkg)
489490
include(python_pkg)
491+
include(seawater_pkg)
490492
if (CDAT_BUILD_PARALLEL)
491493
include(paraview_pkg)
492494
else()

0 commit comments

Comments
 (0)