Skip to content

Commit

Permalink
Merge pull request #24 from jmikeowen/feature/cmake-add-axom-sidre
Browse files Browse the repository at this point in the history
Adding Axom as a TPL
  • Loading branch information
mdavis36 authored Aug 26, 2020
2 parents e48019f + 707bbad commit d52fc61
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmake/InstallTPLs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ set(hdf5_BUILD ON CACHE BOOL "Option to build hdf5")
set(silo_BUILD ON CACHE BOOL "Option to build silo")
set(maneos_BUILD ON CACHE BOOL "Option to build ANEOS")
set(opensubdiv_BUILD ON CACHE BOOL "Option to build Opensubdiv")
set(conduit_BUILD ON CACHE BOOL "Option to build Conduit")
set(axom_BUILD ON CACHE BOOL "Option to build Axom")

set(pybind11_BUILD ON CACHE BOOL "Option to build pybind11")
set(python_BUILD ON CACHE BOOL "Option to build python")
Expand All @@ -35,6 +37,8 @@ Spheral_Handle_TPL(eigen spheral_depends)
Spheral_Handle_TPL(qhull spheral_depends)
Spheral_Handle_TPL(hdf5 spheral_depends)
Spheral_Handle_TPL(silo spheral_depends)
Spheral_Handle_TPL(conduit spheral_depends)
Spheral_Handle_TPL(axom spheral_depends)

# Only needed when building the python interface of spheral
if(NOT ENABLE_CXXONLY)
Expand Down
49 changes: 49 additions & 0 deletions cmake/tpl/axom.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
set(AXOM_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${lib_name})
set(AXOM_DIST "Axom-v0.3.3.tar.gz")
set(AXOM_URL "https://github.com/LLNL/axom/releases/download/v0.3.3/${AXOM_DIST}")
set(AXOM_CACHE "${CACHE_DIR}/${AXOM_DIST}")

set(${lib_name}_libs )

if(${lib_name}_BUILD)

if (EXISTS ${AXOM_CACHE})
set(AXOM_URL ${AXOM_CACHE})
endif()

ExternalProject_add(${lib_name}
PREFIX ${AXOM_PREFIX}
URL ${AXOM_URL}
DOWNLOAD_DIR ${CACHE_DIR}
CMAKE_ARGS ../axom/src/
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_FLAGS=-fPIC

-DAXOM_ENABLE_TESTS=OFF
-DAXOM_ENABLE_EXAMPLES=OFF
-DAXOM_ENABLE_DOCS=OFF
-DAXOM_ENABLE_INLET=Off
-DAXOM_ENABLE_LUMBERJACK=Off
-DAXOM_ENABLE_SLAM=Off
-DAXOM_ENABLE_MINT=Off
-DAXOM_ENABLE_PRIMAL=Off
-DAXOM_ENABLE_SPIN=Off
-DAXOM_ENABLE_QUEST=Off
-DENABLE_TESTS=Off

-DCONDUIT_DIR=${CONDUIT_INSTALL_DIR}
-DHDF5_DIR=${HDF5_INSTALL_DIR}

-DCMAKE_INSTALL_PREFIX=${${lib_name}_DIR}

DEPENDS hdf5 conduit

LOG_DOWNLOAD ${OUT_PROTOCOL_EP}
LOG_CONFIGURE ${OUT_PROTOCOL_EP}
LOG_BUILD ${OUT_PROTOCOL_EP}
LOG_INSTALL ${OUT_PROTOCOL_EP}
)

endif()
35 changes: 35 additions & 0 deletions cmake/tpl/conduit.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
set(CONDUIT_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${lib_name})
set(CONDUIT_DIST "conduit-v0.5.1-src-with-blt.tar.gz")
set(CONDUIT_URL "https://github.com/LLNL/conduit/releases/download/v0.5.1/${CONDUIT_DIST}")
set(CONDUIT_CACHE "${CACHE_DIR}/${CONDUIT_DIST}")

set(${lib_name}_libs )

if(${lib_name}_BUILD)

if (EXISTS ${CONDUIT_CACHE})
set(CONDUIT_URL ${CONDUIT_CACHE})
endif()

ExternalProject_add(${lib_name}
PREFIX ${CONDUIT_PREFIX}
URL ${CONDUIT_URL}
DOWNLOAD_DIR ${CACHE_DIR}
CMAKE_ARGS ../conduit/src/ -DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_FLAGS=-fPIC
-DENABLE_TESTS=Off
-DHDF5_DIR=${HDF5_INSTALL_DIR}
-DCMAKE_INSTALL_PREFIX=${${lib_name}_DIR}

DEPENDS hdf5

LOG_DOWNLOAD ${OUT_PROTOCOL_EP}
LOG_CONFIGURE ${OUT_PROTOCOL_EP}
LOG_BUILD ${OUT_PROTOCOL_EP}
LOG_INSTALL ${OUT_PROTOCOL_EP}
)

endif()
set(CONDUIT_INSTALL_DIR ${${lib_name}_DIR} PARENT_SCOPE)

0 comments on commit d52fc61

Please sign in to comment.